autoconf-patches
[Top][All Lists]
Advanced

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

bug fix for F77_LIBRARY_LDFLAGS


From: Steven G. Johnson
Subject: bug fix for F77_LIBRARY_LDFLAGS
Date: Sat, 8 Dec 2001 17:50:30 -0500 (EST)

Hi, below is a fix for a problem reported by Denis Barbier some time ago:

        http://sources.redhat.com/ml/autoconf/2000-12/msg00233.html

Basically, on HP/UX there are additional -L directories for the Fortran
compiler that need to be included in FLIBS, but which require special
parsing in the f90 -v output.  In particular, there is a line like the
following in the f90 -v output:

        LPATH is: 
/opt/fortran90/lib/pa2.0/:/opt/fortran90/lib/:/usr/lib/:/opt/langtools/lib/

This patch turns that line into:

        LPATH is -L/opt/fortran90/lib/pa2.0/ -L/opt/fortran90/lib/ -L/usr/lib/ 
-L/opt/langtools/lib/

so that the the directories will correctly get added to the FLIBS search
path by AC_F77_LIBRARY_LDFLAGS.

*However*, I should point out that I do not have an HP/UX system to test
this patch on.  (I *have* tried it on several non HP/UX systems to make
sure it doesn't screw things up.)  Although it's fairly simple, I think
someone (Denis?) should make sure it works before it is committed.  To
that end, I've attached a tar.gz of a simple configure script (generated
by the patched autoconf) to test with.  Running ./configure should
successfully detect the Fortran linker flags and, as a test, find the
(correct) Fortran name-mangling scheme.

2001-12-08  Steven G. Johnson  <address@hidden>

        * lib/autoconf/fortran.m4 (_AC_PROG_F77_V_OUTPUT): Fix failed
        C/Fortran linking on HP/UX, by extracting the Fortran library
        search path from the LPATH line in the $F77 -v output.

===================================================================
RCS file: /cvs/autoconf/lib/autoconf/fortran.m4,v
retrieving revision 1.153
diff -u -r1.153 fortran.m4
--- lib/autoconf/fortran.m4     2001/11/25 15:13:04     1.153
+++ lib/autoconf/fortran.m4     2001/12/08 22:31:16
@@ -384,6 +384,11 @@
   ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'`
 fi
 
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz:
+ac_f77_v_output="$ac_f77_v_output `echo $ac_f77_v_output | egrep '^ *LPATH 
is:' | sed 's,: */, -L/,g'`"
+
 # If we are using Cray Fortran then delete quotes.
 # Use "\"" instead of '"' for font-lock-mode.
 # FIXME: a more general fix for quoted arguments with spaces?

Attachment: tstacfix.tar.gz
Description: Binary data


reply via email to

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