Hello Giulio, apologies for the long delay.
* Giulio Paci wrote on Sun, Jan 30, 2011 at 01:43:21AM CET: > >>> + # If we are using fort77 (the f2c wrapper) then filter output and > >>> delete quotes. > >>> + *fort77*gcc*) > >>> + ac_[]_AC_LANG_ABBREV[]_v_output=`echo > >>> "$ac_[]_AC_LANG_ABBREV[]_v_output" | grep '"gcc"' | sed '/"-c"/d; > >>> s/^.*"gcc"/"gcc"/; s/"//g' ;; > >>> > >>> > >> What if the user builds in a directory name containing "gcc" or TMPDIR > >> contains that? Can we tighten the regex a bit? Also, 'grep | sed' is > >> often superflous grep and can be replaced with > >> sed -n '/regex/{ > >> ... > >> }' > >> > >> but replacing semi-colons with newlines in the ... part. > >> > >> > > I tried to take care about your comments in this new patch. I avoided > > grep and made the regex more robust against the TMPDIR. > > The building directory is not a problem. If the TMPDIR contains '"gcc"' > > or a space, fort77 fails, so it should not be a problem either. > > With the attached patch we should have no problem with the TMPDIR (I am > > removing all the lines ending by '.c' or '.c"', that is where TMPDIR > > appears) even if fort77 get fixed. However I am not able to test it. > > > Any news? Thanks for the updated patch. I took it and made the sed script portable, added you to THANKS, and committed as below after testing it on my Debian system. The '(tiny change)' is just to note that you haven't signed copyright papers for this. We should still tighten the "GNU Fortran 77" test somewhat so that it doesn't fail with this compiler. Cheers, Ralf 2011-02-12 Giulio Paci <giuliop...@interfree.it> (tiny change) Ralf Wildenhues <ralf.wildenh...@gmx.de> Fix detection of link flags for fort77 on GNU/Linux. * lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT): Properly detect the fort77 (f2c wrapper) compiler verbose linking output flag. Fixes also AC_F77_LIBRARY_LDFLAGS and AC_F77_DUMMY_MAIN. * THANKS: Update. diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index bed9c96..d5afbb9 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -540,6 +540,16 @@ case $ac_[]_AC_LANG_ABBREV[]_v_output in s/-ignore *'[[^']]*'/ /g; s/-ignore *\"[[^\"]]*\"/ /g s/-def *'[[^']]*'/ /g; s/-def *\"[[^\"]]*\"/ /g"` ;; + # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. + *fort77*f2c*gcc*) + ac_[]_AC_LANG_ABBREV[]_v_output=`echo "$ac_[]_AC_LANG_ABBREV[]_v_output" | sed -n ' + /:[[ ]]\+Running[[ ]]\{1,\}"gcc"/{ + /"-c"/d + /[[.]]c"*/d + s/^.*"gcc"/"gcc"/ + s/"//gp + }'` ;; + # If we are using Cray Fortran then delete quotes. *cft90*) ac_[]_AC_LANG_ABBREV[]_v_output=`echo $ac_[]_AC_LANG_ABBREV[]_v_output | sed 's/"//g'` ;;