[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_FC_LIBRARY_LDFLAGS: quoting bug on Solaris with gfortran

From: Eric Blake
Subject: Re: AC_FC_LIBRARY_LDFLAGS: quoting bug on Solaris with gfortran
Date: Thu, 16 Sep 2010 15:16:19 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100907 Fedora/3.1.3-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.3

On 09/16/2010 03:06 PM, Stefano Lattarini wrote:
This is what I'm seeing on Solaris:

Driving: gfortran -o conftest -g -O2 -v conftest.f -lgfortranbegin -lgfortran 
-lm -shared-libgcc

We already discard this line...

Using built-in specs.
Target: i386-pc-solaris2.10
Configured with: /home/bfriesen/src/gnu/gcc-4.4.4/configure 
LDFLAGS='-L/usr/local/lib -R/usr/local/lib' --program-suffix=-4.4.4 
--enable-shared --enable-threads --
enable-version-specific-runtime-libs --with-gnu-as 
--with-as=/usr/local/lib/binutils-2.20/bin/as --without-gnu-ld 
--with-ld=/usr/ccs/bin/ld --with-gmp=/usr/local --
with-mpfr=/usr/local --with-cpu=opteron --enable-languages=c,c++,fortran

...so maybe the solution is to discard this line, too!

COLLECT_GCC_OPTIONS='-o' 'conftest' '-g' '-O2' '-v' '-shared-libgcc' 
  /usr/local/libexec/gcc/i386-pc-solaris2.10/4.4.4/collect2 -V -Y 
P,/usr/ccs/lib:/usr/lib -Qy -o conftest /usr/lib/crt1.o /usr/lib/crti.o 
/tmp/ccUwxfR4.o -lgfortranbegin -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc 
/usr/local/lib/gcc/i386-pc-solaris2.10/4.4.4/crtend.o /usr/lib/crtn.o

In the end, it seems like we really only want this line, anyways. After all, we're trying to figure out what the fortran driver uses to link conftest.f, not what was used to link the fortran driver.

If my hunch is right, then does this (untested) patch fix your
Unfortunately no.

Would you like me to post the output of "sh -x configure" run
on my testcase with an autoconf having your patch enabled?

Not just yet; let's try this patch first (and I feel better about it not being as global of a change):

diff --git i/ChangeLog w/ChangeLog
index 061c6ae..89be92c 100644
--- i/ChangeLog
+++ w/ChangeLog
@@ -1,5 +1,8 @@
 2010-09-16  Eric Blake  <address@hidden>

+       * lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT): Also skip
+       'Configured by:' lines from gfortran.
        m4sugar: fix regression in AC_MSG_ERROR expansion
        * lib/m4sugar/m4sugar.m4 (m4_defun_init): Avoid macro
        concatenation on subsequent expansions
diff --git i/lib/autoconf/fortran.m4 w/lib/autoconf/fortran.m4
index e8f7bbc..82a7a5d 100644
--- i/lib/autoconf/fortran.m4
+++ w/lib/autoconf/fortran.m4
@@ -505,7 +505,8 @@ _AS_ECHO_LOG([$[*]])
 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
 # LIBRARY_PATH; skip all such settings.
 ac_[]_AC_LANG_ABBREV[]_v_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1 |
-  grep -v 'Driving:' | grep -v "^[[_$as_cr_Letters]][[_$as_cr_alnum]]*="`
+  sed '/^Driving:/d; /^Configured with:/d;
+      '"/^[[_$as_cr_Letters]][[_$as_cr_alnum]]*=/d"`
 AS_ECHO(["$ac_[]_AC_LANG_ABBREV[]_v_output"]) >&AS_MESSAGE_LOG_FD

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]