automake
[Top][All Lists]
Advanced

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

Building Fortran 77 libtool modules


From: Schleicher Ralph (LLI)
Subject: Building Fortran 77 libtool modules
Date: Thu, 11 Dec 2003 14:07:56 +0100

ltmain.sh (GNU libtool) 1.5 (1.1220 2003/04/05 19:32:58)
automake (GNU automake) 1.8

Hi,

I want to create a libtool module written in Fortran 77 and ended up
with the following code:


$ cat configure.ac
AC_INIT([foo], [1.0], address@hidden)
AM_INIT_AUTOMAKE([1.7 foreign no-define])
AC_CONFIG_SRCDIR([foo.f])
AC_CONFIG_FILES([Makefile])
AC_PROG_LIBTOOL
AC_OUTPUT

$ cat Makefile.am
lib_LTLIBRARIES = foo.la
foo_la_SOURCES = foo.f
foo_la_LDFLAGS = -avoid-version -module -shrext .bar

$ cat foo.f
      subroutine foo
      return
      end

$ libtoolize && aclocal && automake -a && autoconf && ./configure && make
/bin/sh ./libtool --mode=compile g77  -g -O2 -c -o foo.lo foo.f
mkdir .libs
 g77 -g -O2 -c foo.f  -fPIC -o .libs/foo.o
 g77 -g -O2 -c foo.f -o foo.o >/dev/null 2>&1
/bin/sh ./libtool --mode=link g77  -g -O2   -o foo.la -rpath /usr/local/lib 
-avoid-version -module -shrext .bar foo.lo
g77 -shared -fPIC -Wl,+h -Wl,foo.sl -Wl,+b -Wl,/usr/local/lib -o .libs/foo.sl  
.libs/foo.o
ar cru .libs/foo.a  foo.o
ranlib .libs/foo.a
creating foo.la
(cd .libs && rm -f foo.la && ln -s ../foo.la foo.la)


Hmm, looks good on first sight but the module name is foo.sl (this is a
HP-UX box) instead of foo.bar!  When I run libtool manually with the
--tag=F77 option, the module name is foo.bar instead:


$ /bin/sh ./libtool --mode=link --tag=F77 g77  -g -O2   -o foo.la -rpath 
/usr/local/lib -avoid-version -module -shrext .bar foo.lo
rm -fr  .libs/foo.a .libs/foo.la .libs/foo.lai .libs/foo.sl
g77 -shared -fPIC -Wl,+h -Wl,foo.bar -Wl,+b -Wl,/usr/local/lib -o .libs/foo.bar 
 .libs/foo.o
ar cru .libs/foo.a  foo.o
ranlib .libs/foo.a
creating foo.la
(cd .libs && rm -f foo.la && ln -s ../foo.la foo.la)


Can anybody enlighten me what's going on.  Libtool's --tag option
is not documented therefore it's quite hard for the average user to
figure it out.  Anyway, adding --tag=F77 to foo_la_LDFLAGS does not
help either because the --tag option must be specified before the
compilation command.  I would consider this a bug if there is no
proper solution.

-- 
Ralph




reply via email to

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