+Thu Jan 16 17:57:38 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * ltmain.sh.in (link): If linking with $link_static_flag fails,
+ then retry without it, but still use the .a versions of
+ uninstalled libtool archives.
+
+Wed Jan 15 08:59:22 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * ltmain.sh.in (link): Eval $link_static_flag. Reported by Bruno
+ Haible.
+
+ * PLATFORMS: Add to distribution. Suggested by Bruno Haible.
+
+Mon Jan 13 12:59:29 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * ltconfig.in: Add support for SCO OpenServer 5.x.
+
+ (can_build_shared): Initialize at the top of the file, so that
+ shared libraries aren't built on platforms that don't support
+ them.
+
+Sat Jan 11 13:29:08 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * ltmain.sh.in, ltconfig.in, libtoolize.in, doc/libtool.texi:
+ Update the copyright completion years.
+
Wed Jan 8 15:01:06 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
* ltconfig.in: Port to IRIX 5.3, 6.2.
SUBDIRS = doc tests
# Distribute ltconfig and ltmain.sh so that the demo directory works.
-EXTRA_DIST = libtool.m4 libtoolize.in ltconfig ltconfig.in \
+EXTRA_DIST = PLATFORMS libtool.m4 libtoolize.in ltconfig ltconfig.in \
ltmain.sh ltmain.sh.in README-automake
CLEANFILES = libtool libtoolize
MAINTAINERCLEANFILES = ltconfig ltmain.sh
-New in 0.6e:
+New in 0.7:
* Total rewrite of libtool, along with a new model for library building.
* Completely rewritten documentation for the new paradigm.
* Sane handling of broken system linkers, such as the ones on AIX
* Support for stripping libraries during installation.
* Library version information is now passed on the command line, not
through a version file.
-* Quote metacharacters in arguments to compile mode.
\f
Version 0.6 was never released.
\f
+* Implement `ld -r' on all platforms.
+
* Don't forget to find link_static_flag for native cc's on HP-UX and OSF/1.
* Write installcheck for the demo directory.
* GCC docs imply that all rs6000 code is PIC. See if it is true of
any other processors (like maybe powerpc).
+
+* Maybe choosing between ln -s and cp -p should be done in ltconfig,
+not ltmain.sh?
AC_INIT(ltmain.sh.in)
-AM_INIT_AUTOMAKE(libtool, 0.7)
+AM_INIT_AUTOMAKE(libtool, 0.7a)
pkgdatadir='${datadir}/libtool'
AC_SUBST(pkgdatadir)
aclocaldir='${datadir}/aclocal'
AC_SUBST(aclocaldir)
+localedir='${datadir}/locale'
+AC_SUBST(localedir)
AC_OUTPUT([Makefile doc/Makefile tests/Makefile])
# A brief demonstration of using Automake with Libtool.
AUTOMAKE_OPTIONS = ansi2knr foreign
-EXTRA_DIST = $(TESTS)
+EXTRA_DIST = $(TESTS) acinclude.m4
# Build a libtool library, libhell.la for installation in libdir.
lib_PROGRAMS = libhell.la
include_HEADERS = foo.h
+bin_PROGRAMS = hell hell.static
+
# Build hell from main.c and libhell.la
-bin_PROGRAMS = hell
hell_SOURCES = main.c
hell_LDADD = libhell.la
+# Create a statically-linked version of hell.
+hell_static_SOURCES = main.c
+hell_static_LDADD = libhell.la
+hell_static_LDFLAGS = -static
+
TESTS = run.test
-# Regenerate the acinclude.m4 from the parent, if it doesn't exist.
-$(top_srcdir)/acinclude.m4:
- ln -s $(top_srcdir)/../libtool.m4 $(top_srcdir)/acinclude.m4
+# Regenerate our acinclude.m4 only if it doesn't exist.
+$(srcdir)/acinclude.m4:
+ rm -f $(srcdir)/acinclude.m4
+ ln -s ../libtool.m4 $(srcdir)/acinclude.m4
@samp{program_LDADD} variable:
@example
+bin_PROGRAMS = hell hell.static
+
# Build hell from main.c and libhell.la
-bin_PROGRAMS = hell
hell_SOURCES = main.c
hell_LDADD = libhell.la
+
+# Create a statically-linked version of hell.
+hell_static_SOURCES = main.c
+hell_static_LDADD = libhell.la
+hell_static_LDFLAGS = -static
@end example
You may use the @samp{program_LDFLAGS} variable to stuff in any flags
-you want to pass to libtool while linking @samp{program}, such as
-@samp{-static}.
+you want to pass to libtool while linking @samp{program} (such as
+@samp{-static} to create a statically-linked executable).
Building a libtool library is almost as trivial@dots{} note the use of
@samp{libhell_la_LDFLAGS} to pass the @samp{-version-info}
@item CFLAGS
Compiler flags used to generate standard object files.
+@item CPPFLAGS
+C preprocessor flags.
+
@item LD
The system linker to use (if the generated @file{libtool} requires one).
#! /bin/sh
# ltconfig - Create a system-specific libtool.
+# When updating this script, search for LINENUM and fix line number refs.
# @configure_input@
# Copyright (C) 1996, Free Software Foundation, Inc.
# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
echo "$help" 1>&2
exit 1
-else
+else
host_alias=$host
fi
old_postinstall_cmds="$old_postinstall_cmds;\$RANLIB \$oldlib"
fi
-# FIXME: this is simplistic, and doesn't allow for cross-compiling.
-echo $ac_n "checking for library strip program... $ac_c" 1>&6
-striplib=
-if strip -x /dev/null 2>&1 | grep '/dev/null' >/dev/null 2>&1; then
- # strip: /dev/null: Inappropriate file type or format
- striplib="strip -x"
-fi
-
-if test -n "$striplib"; then
- echo $ac_t "$striplib" 1>&6
-else
- echo $ac_t none 1>&6
-fi
-
-
-# Check if old-style libraries may be stripped.
-old_striplib=
-if test -n "$striplib"; then
- echo $ac_n "checking if $striplib works for static archives... $ac_c" 1>&6
- old_striplib="$striplib"
- trap 'rm -rf conftest*; exit 1' 1 2 15
- cat > conftest.c <<EOF
-#line 305 "$progname"
-int external_func() { return 1; }
-static int hidden_func() { return 2; }
-EOF
- if { (eval echo $progname:308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- oldlib=conftest.a
- oldobjs=' conftest.o'
-
- # Do each of the archive commands.
- cmds=`eval echo \"$old_archive_cmds\"`
- IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
- for cmd in $cmds; do
- IFS="$save_ifs"
- if { (echo $progname:317: \"$cmd\") 1>&5; ($cmd) 2>&5; }; then :
- else
- old_striplib=
- break
- fi
- done
- IFS="$save_ifs"
-
- if test -n "$old_striplib"; then
- if { (echo $progname:326: \"$old_striplib conftest.a\") 1>&5; ($old_striplib conftest.a) 2>&5; }; then :
- else
- old_striplib=
- fi
- fi
- else
- old_striplib=
- fi
- rm -rf conftest*
- trap '' 1 2 15
-
- if test -n "$old_striplib"; then
- echo "$ac_t""yes" 1>&6
- else
- echo "$ac_t""no" 1>&6
- fi
-fi
-
-
# Check to see if we are using GCC.
if test "$with_gcc" = no; then
# If CC is not set, then try to find GCC or a usable CC.
yes;
#endif
EOF
- if eval "$CC -E conftest.c" | egrep yes >/dev/null 2>&1; then :
+ # LINENUM
+ if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
with_gcc=yes
fi
$rm conftest.c
case "$host" in
*-*-aix3* | *-*-aix4*)
# FIXME All rs/6000 code is PIC, but is there any non-rs/6000 AIX platform?
+ pic_flag=
link_static_flag='-bnso -bI:/lib/syscalls.exp'
;;
- *-*-hpux10*)
- # FIXME link_static_flag?
+ *-*-hpux9* | *-*-hpux10*)
+ # FIXME is there a better link_static_flag that works with the bundled CC?
+ wl='-Wl,'
+ link_static_flag='${wl}-a ${wl}archive'
pic_flag='+Z'
;;
+ *-*-irix5* | *-*-irix6*)
+ wl='-Wl,'
+ link_static_flag='-non_shared'
+ # PIC (with -KPIC) is the default.
+ pic_flag=
+ ;;
+
*-*-osf3*)
- # FIXME - pic_flag, link_static_flag?
+ # FIXME - pic_flag is probably required for hppa*-osf* and i860-osf*
+ link_static_flag='-non_shared'
;;
*-*-solaris2*)
fi
case "$host" in
-rs6000-*-*)
- # Yippee! All rs/6000 code is position-independent.
+rs6000-*-* | powerpc-*-* | powerpcle-*-*)
+ # Yippee! All RS/6000 and PowerPC code is position-independent.
pic_flag=
;;
esac
+# FIXME actually try compiling an object file with the pic flag?
+
if test -n "$pic_flag"; then
echo $ac_t "$pic_flag" 1>&6
pic_flag=" $pic_flag"
# PORTME fill in a description of your system's linker (not GNU ld)
case "$host" in
*-*-aix3*)
- archive_cmds='$rm $lib.exp;/ucb/nm$libobjs | egrep \" D \" | sed \"s/^.* //\" > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;ar cru $lib $objdir/$soname'
+ archive_cmds='$rm $lib.exp;/usr/ucb/nm$libobjs | egrep \" D \" | sed \"s/^.* //\" > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;ar cru $lib $objdir/$soname'
hardcode_shlibpath_var=yes
hardcode_minus_L=yes
;;
hardcode_minus_L=yes
;;
- *-*-hpux10*)
+ *-*-hpux9* | *-*-hpux10*)
archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs'
link_rpath_flag='${wl}+b ${wl}$libdir'
hardcode_minus_L=yes
hardcode_shlibpath_var=yes
;;
+ *-*-irix5* | *-*-irix6*)
+ archive_cmds='$LD -shared -o $lib -soname $install_libdir/$soname -set_version $verstring$libobjs -lc$deplibs'
+ link_rpath_flag='${wl}-rpath ${wl}$libdir'
+ ;;
+
*-*-netbsd*)
# Tested with NetBSD 1.2 ld
archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
;;
*-*-osf3*)
- archive_cmds='$LD -shared -o $lib -rpath $install_libdir -soname $soname -set_version $verstring$libobjs -lc$deplibs'
+ archive_cmds='$LD -shared -o $lib -soname $install_libdir/$soname -set_version $verstring$libobjs -lc$deplibs'
link_rpath_flag='${wl}-rpath ${wl}$libdir'
;;
;;
*-*-sunos4*)
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs$deplibs'
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
link_rpath_flag='-L$libdir'
hardcode_minus_L=yes
;;
shlibpath_var=LD_LIBRARY_PATH
;;
-*-*-hpux10*)
+*-*-hpux9* | *-*-hpux10*)
# Give a soname corresponding to the major version so that dld.sl refuses to
# link against other versions.
dynamic_linker="$host_os dld.sl"
postinstall_cmds='chmod 555 $lib'
;;
+*-*-irix5*)
+ version_type=osf
+ soname_spec='$libname.so.$major'
+ lib_names='$libname.so.$versuffix $libname.so.$major $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
# No shared lib support for linuxoldld or linuxaout.
*-*-linuxoldld* | *-*-linuxaout*)
dynamic_linker=no
*-*-osf3*)
version_type=osf
- soname_spec='$libname.so'
- lib_names='$libname.so.$versuffix $libname.so'
+ soname_spec='$libname.so.$major'
+ lib_names='$libname.so.$versuffix $libname.so.$major $libname.so'
shlibpath_var=LD_LIBRARY_PATH
;;
echo "$ac_t""$dynamic_linker"
+# FIXME need to add library stripping features
+# strip -x works for most platforms, though not for static libraries on NetBSD
+# HP-UX requires "-r" for library stripping
+striplib=
+old_striplib=
+
+#echo $ac_n "checking for static library strip program... $ac_c" 1>&6
+#if test -n "$old_striplib"; then
+# echo $ac_t "$old_striplib" 1>&6
+#else
+# echo $ac_t none 1>&6
+#fi
+
+#if test "$can_build_shared" = yes; then
+# echo $ac_n "checking for shared library strip program... $ac_c" 1>&6
+#
+# if test -n "$striplib"; then
+# echo $ac_t "$striplib" 1>&6
+# else
+# echo $ac_t none 1>&6
+# fi
+#fi
+
# Report the consequences.
echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
# ltmain.sh - Provide generalized library-building support services.
# @configure_input@
-# Copyright (C) 1996 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
done
# Get the name of the library object.
- libobj=`echo "$srcfile" | sed -e 's%^.*/%%; s/\.[Sc]$/.lo/'`
+ libobj=`echo "$srcfile" | sed -e 's%^.*/%%`
+
+ # Recognize several different file suffixes.
+ xform='[cCFSf]'
+ case $libobj in
+ *.c++) xform='c\+\+' ;;
+ *.cc) xform=cc ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.f90) xform=f90 ;;
+ *.for) xform='for' ;;
+ esac
+
+ libobj=`echo "$libobj" | sed -e "s/\.$xform$/.lo/"`
+
case $libobj in
*.lo) obj=`echo "$libobj" | sed -e 's/\.lo$/.o/'` ;;
*)
case "$arg" in
-L*)
- deplibs="$deplibs $arg"
dir=`echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
case "$dir" in
/*)
exit 1
;;
esac
+ deplibs="$deplibs $arg"
;;
-l*) deplibs="$deplibs $arg" ;;
-*) cc="$cc $arg" ;; # Some other compiler flag.
- # Automake's ansi2knr support code uses the "._o" and ".l_o" object
- # suffixes.
- *.o | *._o | *.a)
+ *.o | *.a)
# A standard object.
objs="$objs $arg"
;;
- *.lo | *.l_o)
+ *.lo)
# A library object.
libobjs="$libobjs $arg"
;;
case "$version_type" in
none) ;;
- libtool)
- version_vars="$version_vars versuffix"
- versuffix="$current.$age.$revision"
- ;;
-
linux)
version_vars="$version_vars major versuffix"
major=`expr $current - $age`
osf)
version_vars="$version_vars versuffix verstring"
+ major=`expr $current - $age`
versuffix="$current.$age.$revision"
verstring="$versuffix"
;;
esac
- # Maybe add a suffix.
- test -n "$suffix" && libname=$libname"_$suffix"
-
# Create the output directory, or remove our outputs if we need to.
if test -d $objdir; then
$show "$rm $objdir/$libname.*"
done
# Use standard objects if they are PIC.
- test -z "$pic_flag" && libobjs=`echo "$libobjs " | sed 's/\.lo /.o /g; s/\.l_o /._o /g; s/ $//g'`
+ test -z "$pic_flag" && libobjs=`echo "$libobjs " | sed 's/\.lo /.o /g; s/ $//g'`
# Do each of the archive commands.
cmds=`eval echo \"$archive_cmds\"`
$run $rm $obj $libobj
# Create the old-style object.
- reload_objs="$objs"`echo "$libobjs " | sed 's/\.lo /.o /g; s/\.l_o /._o /g; s/ $//g'`
+ reload_objs="$objs"`echo "$libobjs " | sed 's/\.lo /.o /g; s/ $//g'`
output="$obj"
cmds=`eval echo \"$reload_cmds\"`
if test -n "$libobjs"; then
# Transform all the library objects into standard objects.
- compile_command=`echo "$compile_command " | sed 's/\.lo /.o /g; s/\.l_o /._o /g; s/ $//g'`
-
+ compile_command=`echo "$compile_command " | sed 's/\.lo /.o /g; s/ $//g'`
fi
if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
elif test "$hardcode_shlibpath_var" != yes; then
# We just need to export the shlibpath for the link command.
$show "$shlibpath_var=$linkrpath $compile_command"
- eval "export $shlibpath_var=$linkrpath"
+ eval "$shlibpath_var=$linkrpath"
+ eval "export $shlibpath_var"
else
# AGH! Flame the AIX and HP-UX people for me, will ya?
# See if we need to build an old-fashioned archive.
if test "$build_old_libs" = "yes"; then
- # Transform .lo files to .o (and don't forget ansi2knr .l_o to ._o).
- oldobjs="$objs"`echo "$libobjs " | sed 's/\.lo /.o /g; s/\.l_o /._o /g; s/ $//g'`
+ # Transform .lo files to .o
+ oldobjs="$objs"`echo "$libobjs " | sed 's/\.lo /.o /g; s/ $//g'`
case "$output" in
*.la)
# Now set the variables for building old libraries.
libfile="$libdir/`echo "$lib" | sed 's%^.*/%%g'`"
if test -z "$libdir"; then
echo "$progname: warning: \`$lib' contains no -rpath information"
- elif test -f "$libfile"; then :
+ elif test -f "$libfile"; then :
else
echo "$progname: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
finalize=no
;;
esac
done
-
+
# FIXME Install any profiled libraries, too.
# newfiles=
# for file in $staticlibs; do
$show "$rm $file"
$run $rm $file
done
- exit 0
+ exit 0
;;
NONE)
object files.
If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
-library objects (\`.lo' or \`.l_o' files) may be specified, and the \`-rpath'
-option is required.
+library objects (\`.lo' files) may be specified, and \`-rpath' is required.
If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
and \`ranlib'.