+Tue Apr 22 12:41:34 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * ltmain.sh.in (hardcode_runpath_var, runpath_var): Use them, if
+ the linker has no -rpath flag.
+ Quote the values we use to set runpath_var and shlibpath_var.
+ (link): Use libobjlibs for libtool convenience libraries.
+
+ * ltconfig.in (hardcode_runpath_var, runpath_var): Add new
+ variables to describe linkers that honour `LD_RUN_PATH'.
+ (host_cpu, host_os): Use these more specific variables, rather
+ than the full canonical host system name.
+
+ * ltmain.sh.in (dlname): Distinguish between missing
+ `-export-dynamic' and when the library is only statically linked.
+
+Mon Apr 21 09:52:51 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * ltconfig.in: Trivial port to OpenBSD by making it an alias for
+ NetBSD. From Tim Pierce.
+
+Wed Apr 16 19:32:05 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * ltconfig.in: Temporary measures to check for a broken collect2
+ program. Right now, we just see if we're using GCC on AIX 3.
+
Sun Apr 13 19:40:58 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
* ltmain.sh.in (mode): Use `egrep -e' when inferring the operation
Sat Apr 12 13:09:24 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
* ltconfig.in (linker): Some GNU ld's don't accept `--version',
- but do accept `-v'. From Stephan Kulow.
+ but do accept `-v'. From Jukka Honkela.
(ld_shlibs): AIX lossage may be settling down. AIX 3.2.5 ld does
*not* hardcode direct libraries, but AIX 4.1.[45] ld does.
* Automake support for Libtool now uses the LTLIBRARIES primary. See
the Automake documentation for more information.
* Basic support for dynamically loaded modules: new `-export-dynamic'
- link flag and corresponding `dlname' mode.
+ linking flag and corresponding `dlname' mode.
+* New `--features' flag to display configured libtool attributes.
* Basic support for convenience libraries made of libtool objects: new
`-whole-archive' and `-no-whole-archive' linking flags.
* Support *-*-linux-gnu* as an alias for *-*-linux*.
+* Support for *-*-openbsd*.
\f
New in 0.9:
* Bug fixes.
IRIX 5.x, 6.x (*-*-irix5*, *-*-irix6*)
Linux ELF targets (*-*-linux*, except *-*-linuxaout* and *-*-linuxoldld*)
NetBSD 1.x (*-*-netbsd*)
+ OpenBSD 2.x (*-*-openbsd*)
SCO OpenServer 5.x (*-*-sco3.2v5*)
Solaris 1.x, a.k.a. SunOS 4.x (*-*-sunos4*)
Solaris 2.x (*-*-solaris2*)
-* Sanity check to detect broken collect2 on AIX:
-
-checking if libraries in .libs can be linked... no
-configure: error: basic sanity check failed; look at config.log
-If you are using GCC versions before 2.8 on AIX, try configuring with
-the native C compiler instead (set the CC environment variable to `xlc').
-
-mkdir .libs
-echo > conftest.c
-$CC -c conftest.c
-$AR cru .libs/libct.a conftest.o
-$RANLIB .libs/libct.a # if necessary
-echo 'int main () { return 0; }' > conftest.c
-$CC -c conftest.c
-$CC -o conftest conftest.o .libs/libct.a
+* Sanity check to detect broken collect2 on AIX (see collect2bug).
+
+* Document inter-library dependencies, and allowing undefined
+symbols (`-allow-undefined').
* Document convenience libraries, -whole-archive, and
-no-whole-archive.
Don't create, modify, or delete any files, just show what commands would
be executed by libtool.
+@item --features
+Display libtool configuration information and exit. This provides a way
+for packages to determine whether shared or static libraries will be
+built.
+
@item --finish
Same as @samp{--mode=finish}.
@item
On some systems, notably SunOS 4, the dynamic linker does not call
non-constant initializers. This can lead to hard-to-pinpoint bugs in
-your library.
+your library. GCC 2.7 and later versions work around this problem, but
+previous versions and other compilers do not.
@end enumerate
This second issue is very complex. Basically, avoid any global or
static variable initializations that would cause an ``initializer
-element is not constant'' error if you compiled themwith a standard C
+element is not constant'' error if you compiled them with a standard C
compiler.
-There are ways of working around this problem, but they are beyond the
-scope of this manual.
+There are other ways of working around this problem, but they are beyond
+the scope of this manual.
@node Troubleshooting
@chapter Troubleshooting
types that it supports, and that it fails when the suffix is invalid.
@item test-e.test
-This program checks that the @code{test -e} construct is @emph{never} in
-the libtool scripts. Checking for the existence of a file can only be
-done in a portable way by using @code{test -f}.
+This program checks that the @code{test -e} construct is @emph{never}
+used in the libtool scripts. Checking for the existence of a file can
+only be done in a portable way by using @code{test -f}.
@end table
@node When Tests Fail
required.
@item man pages for ld.so(8), rtld(8), or equivalent
-These are a valuable resource for understanding how libraries are loaded
-on the system.
+These are a valuable resource for understanding how shared libraries are
+loaded on the system.
@item man page for ldconfig(8), or equivalent
This page usually describes how to install shared libraries.
``Inappropriate file type or format'' when used on static libraries.
@item hpux10*
-HP-UX @file{strip} requires that @samp{-r} and @samp{-x} flags in order
+HP-UX @file{strip} requires the @samp{-r} and @samp{-x} flags in order
to strip libraries.
@end table
@end defvar
@defvar finish_cmds
-Commands to tell the dynamic linker to find shared libraries a
-directory.
+Commands to tell the dynamic linker how to find shared libraries a
+specific directory.
@end defvar
@defvar hardcode_action
-Either @samp{immediately} or @samp{relink}, depending on whether shared
+Either @samp{immediate} or @samp{relink}, depending on whether shared
library paths can be hardcoded into executables before they are installed,
or if they need to be relinked.
@end defvar
dynamic linker searches @var{libdir} for shared libraries at runtime.
@end defvar
+@defvar hardcode_libdir_separator
+If the compiler only accepts a single @var{hardcode_libdir_flag}, then
+this variable contains the string that should separate multiple
+arguments to that flag.
+@end defvar
+
@defvar hardcode_minus_L
Set to @samp{yes} or @samp{no}, depending on whether the linker
hardcodes directories specified by @samp{-L} flags into the resulting
executable.
@end defvar
+@defvar hardcode_runpath_var
+Set to @samp{yes} or @samp{no}, depending on whether the linker
+hardcodes directories specified by setting @samp{$runpath_var} into the
+resulting executable.
+@end defvar
+
@defvar hardcode_shlibpath_var
Set to @samp{yes} or @samp{no}, depending on whether the linker
hardcodes directories specified by setting @samp{$shlibpath_var} into
-the resulting executable.
+the resulting executable. Set to @samp{unsupported} if directories
+specified by @samp{$shlibpath_var} are searched at run time, but not at
+link time.
@end defvar
@defvar host
Commands to create a reloadable object.
@end defvar
+@defvar runpath_var
+The environment variable that tells the linker which directories to
+hardcode in the resulting executable.
+@end defvar
+
@defvar shlibpath_var
The environment variable that tells the dynamic linker where to find
shared libraries.
powerpc-ibm-aix4.1.4.0 xlc 0.9d ok
powerpc-ibm-aix4.1.4.0 gcc 0.9a ok
rs6000-ibm-aix3.2.5 xlc 0.9e ok
-rs6000-ibm-aix3.2.5 gcc 0.9d fail
+rs6000-ibm-aix3.2.5 gcc 0.9e ok*
rs6000-ibm-aix4.1.4.0 xlc 0.9e ok
rs6000-ibm-aix4.1.4.0 gcc 0.9e ok
sparc-sun-linux2.1.23 gcc 0.9 ok
sparc-sun-solaris2.5 cc 0.9 ok
sparc-sun-solaris2.5 gcc 0.9e ok
--------------------------------------------------------
+
+* Libtool will not build shared libraries because of a bug in
+GCC 2.7.2.2's collect2 linker program.
link_static_flag='-static'
else
# PORTME Check for PIC flags for the system compiler.
- case "$host" in
- *-*-aix3* | *-*-aix4*)
+ case "$host_os" 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'
;;
- *-*-hpux9* | *-*-hpux10*)
+ 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*)
+ irix5* | irix6*)
wl='-Wl,'
link_static_flag='-non_shared'
# PIC (with -KPIC) is the default.
pic_flag=
;;
- *-*-osf3* | *-*-osf4*)
+ osf3* | osf4*)
# FIXME - pic_flag is probably required for hppa*-osf* and i860-osf*
wl='-Wl,'
link_static_flag='-non_shared'
;;
- *-*-sco3.2v5*)
+ sco3.2v5*)
pic_flag='-Kpic'
link_static_flag='-dn'
special_shlib_compile_flags='-belf'
;;
- *-*-solaris2*)
+ solaris2*)
pic_flag='-KPIC'
link_static_flag='-Bstatic'
;;
- *-*-sunos4*)
+ sunos4*)
pic_flag='-PIC'
link_static_flag='-Bstatic'
wl='-Qoption ld '
esac
fi
-case "$host" in
-rs6000-*-* | powerpc-*-* | powerpcle-*-*)
+case "$host_cpu" in
+rs6000 | powerpc | powerpcle)
# Yippee! All RS/6000 and PowerPC code is position-independent.
pic_flag=
;;
fi
fi
+# See if we are using a broken GCC collect2 program.
+if test "$with_gcc" = yes; then
+ echo $ac_n "checking for broken GCC collect2... $ac_c" 1>&6
+
+ # FIXME: Run a test here, instead of relying on the canonical system name.
+ case "$host_os" in
+ aix3*)
+ can_build_shared=no
+ echo $ac_t yes 1>&6
+ echo "$progname: to build shared libraries, set the CC env variable to \`xlc' and reconfigure" 1>&2
+ ;;
+ *)
+ echo $ac_t no 1>&6
+ ;;
+ esac
+fi
+
echo $ac_n "checking for $compiler option to statically link programs... $ac_c" 1>&6
if test -n "$link_static_flag"; then
echo $ac_t "$link_static_flag" 1>&6
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
+hardcode_runpath_var=no
hardcode_shlibpath_var=unsupported
+runpath_var=
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# See if GNU ld supports shared libraries.
- case "$host" in
- *-*-sunos4*)
+ case "$host_os" in
+ sunos4*)
ld_shlibs=yes
hardcode_direct=yes
hardcode_shlibpath_var=no
*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
ld_shlibs=yes
else
ld_shlibs=no
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
- case "$host" in
- *-*-aix3*)
+ case "$host_os" in
+ aix3*)
archive_cmds='/usr/ucb/nm$libobjs | egrep \" [BD] \" | sed \"s/^.* //\" > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;$AR cru $lib $objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
;;
- *-*-aix4*)
+ aix4*)
archive_cmds='/bin/nm -B$libobjs | egrep \" [BD] \" | sed \"s/^.* //\" > $lib.exp;$cc -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry$deplibs;$AR cru $lib $objdir/$soname'
hardcode_direct=yes
hardcode_minus_L=yes
;;
- *-*-freebsd*)
+ freebsd*)
archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
hardcode_direct=yes
hardcode_minus_L=yes
hardcode_shlibpath_var=no
;;
- *-*-hpux9*)
+ hpux9*)
archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs;mv $objdir/$soname $lib'
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
- *-*-hpux10*)
+ hpux10*)
archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs'
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
- *-*-irix5* | *-*-irix6*)
+ irix5* | irix6*)
archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
;;
- *-*-netbsd*)
+ netbsd* | openbsd*)
# Tested with NetBSD 1.2 ld
archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
;;
- *-*-osf3* | *-*-osf4*)
+ osf3* | osf4*)
archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
- *-*-sco3.2v5*)
+ sco3.2v5*)
archive_cmds='$LD -G -o $lib$libobjs$deplibs'
hardcode_direct=yes
;;
- *-*-solaris2*)
+ solaris2*)
archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
;;
- *-*-sunos4*)
+ sunos4*)
archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
# Check hardcoding attributes.
echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
hardcode_action=
-if test -n "$hardcode_libdir_flag_spec"; then
+if test -n "$hardcode_libdir_flag_spec" || \
+ test "$hardcode_runpath_var" = yes; then
+
# We can hardcode non-existant directories.
- if test "$hardcode_direct" != no &&
- test "$hardcode_minus_L" != no &&
+ if test "$hardcode_direct" != no && \
+ test "$hardcode_minus_L" != no && \
test "$hardcode_shlibpath_var" != no; then
# Linking always hardcodes the temporary library directory.
# We can link without hardcoding, and we can hardcode nonexisting dirs.
hardcode_action=immediate
fi
-elif test "$hardcode_direct" != yes &&
- test "$hardcode_minus_L" != yes &&
+elif test "$hardcode_direct" != yes && \
+ test "$hardcode_minus_L" != yes && \
test "$hardcode_shlibpath_var" != yes; then
# We can't hardcode anything.
hardcode_action=unsupported
dynamic_linker="$host_os ld.so"
echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
-case "$host" in
-*-*-aix3* | *-*-aix4*)
+case "$host_os" in
+aix3* | aix4*)
version_type=linux
library_names_spec='$libname.so.$versuffix $libname.a'
shlibpath_var=LIBPATH
soname_spec='$libname.so.$major'
;;
-*-*-freebsd*)
+freebsd*)
version_type=sunos
library_names_spec='$libname.so.$versuffix $libname.so'
finish_cmds='ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
;;
-# *-*-gnu* needs to come after *-*-linux-gnu*.
+gnu*)
+ version_type=sunos
+ library_names_spec='$libname.so.$versuffix'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
-*-*-hpux9* | *-*-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* | *-*-irix6*)
+irix5* | irix6*)
version_type=osf
soname_spec='$libname.so'
library_names_spec='$libname.so.$versuffix $libname.so'
;;
# No shared lib support for Linux oldld, aout, or coff.
-*-*-linux-gnuoldld* | *-*-linux-gnuaout* | *-*-linux-gnucoff*)
+linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
dynamic_linker=no
can_build_shared=no
;;
# This must be Linux ELF.
-*-*-linux-gnu*)
+linux-gnu*)
version_type=linux
library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
soname_spec='$libname.so.$major'
shlibpath_var=LD_LIBRARY_PATH
;;
-*-*-gnu*)
- version_type=sunos
- library_names_spec='$libname.so.$versuffix'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*-*-netbsd*)
+netbsd* | openbsd*)
version_type=sunos
library_names_spec='$libname.so.$versuffix'
finish_cmds='ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
;;
-*-*-osf3* | *-*-osf4*)
+osf3* | osf4*)
version_type=osf
soname_spec='$libname.so'
library_names_spec='$libname.so.$versuffix $libname.so'
shlibpath_var=LD_LIBRARY_PATH
;;
-*-*-sco3.2v5*)
+sco3.2v5*)
version_type=osf
soname_spec='$libname.so.$major'
library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
shlibpath_var=LD_LIBRARY_PATH
;;
-*-*-solaris2*)
+solaris2*)
version_type=linux
library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
soname_spec='$libname.so.$major'
shlibpath_var=LD_LIBRARY_PATH
;;
-*-*-sunos4*)
+sunos4*)
version_type=sunos
library_names_spec='$libname.so.$versuffix'
finish_cmds='ldconfig $libdir'
striplib='$striplib'
old_striplib='$old_striplib'
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
# This is the shared library path variable.
shlibpath_var=$shlibpath_var
# resulting binary.
hardcode_minus_L=$hardcode_minus_L
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the
+# Set to yes if using RUNPATH_VAR=DIR during linking hardcodes DIR into the
+# resulting binary.
+hardcode_runpath_var=$hardcode_runpath_var
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
# the resulting binary.
hardcode_shlibpath_var=$hardcode_shlibpath_var
hardcode_libdirs=
install_libdir=
libobjs=
+ libobjlibs=
link_against_libtool_libs=
link_static=
ltlibs=
output=
prev=
prevarg=
+ perm_rpath=
temp_rpath=
vinfo=
whole_archive=no
done
elif test -f "$dir$objdir/$file"; then
# .libs/libfoo.a exists, so this is an archive of libobjects.
- libobjs="$libobjs $arg"
+ libobjlibs="$libobjlibs $dir$objdir/$file"
+ arg="$dir$objdir/$file"
else
# Standard archive.
objs="$objs $arg"
compile_command="$compile_command $hardcode_libdir_flag"
finalize_command="$finalize_command $hardcode_libdir_flag"
fi
+ elif test "$hardcode_runpath_var" = yes; then
+ # Do the same for the permanent run path.
+ case "$perm_rpath " in
+ "* $libdir *") ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
fi
+
case "$hardcode_action" in
immediate)
if test "$hardcode_direct" = no; then
exit 1
fi
+ # Incorporate all of the convenience libraries.
+ libobjs="$libobjs"`echo "$libobjlibs" | sed "s%/$objdir/%/%g"`
+
# How the heck are we supposed to write a wrapper for a shared library?
if test -n "$link_against_libtool_libs"; then
echo "$progname: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
# Delete the old objects.
$run $rm $obj $libobj
- # Create the old-style object (skipping any convenience libraries).
- # FIXME: skipping them is simplistic. We should determine which members
- # are actually needed to resolve symbols.
- reload_objs="$objs"`echo "$libobjs " | sed 's/[^ ]*\.a //g; s/\.lo /.o /g; s/ $//g'`
+ # Create the old-style object.
+ # FIXME: simplistically, we include all libobjlibs here.
+ # We really should determine which members are needed to resolve symbols.
+ reload_objs="$objs"`echo "$libobjs " | sed 's/[^ ]*\.a //g; s/\.lo /.o /g; s/ $//g'`"$libobjlibs"
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/ $//'`
+ finalize_command=`echo "$finalize_command " | sed 's/\.lo /.o /g; s/ $//'`
fi
if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
;;
esac
done
+ temp_rpath="$rpath"
fi
# Delete the old output file.
$run $rm $output
if test -n "$compile_shlibpath"; then
- compile_command="$shlibpath_var=$compile_shlibpath\$$shlibpath_var $compile_command"
+ compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
fi
if test -n "$finalize_shlibpath"; then
- finalize_command="$shlibpath_var=$finalize_shlibpath\$$shlibpath_var $finalize_command"
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
+ finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
fi
case "$hardcode_action" in
# This environment variable determines our operation mode.
if test "\$libtool_install_magic" = "$magic"; then
# install mode needs the following variables:
- link_against_libtool_libs="$link_against_libtool_libs"
- finalize_command="$finalize_command"
+ link_against_libtool_libs='$link_against_libtool_libs'
+ finalize_command='$finalize_command'
else
# Find the directory that this script lives in.
thisdir=\`echo \$0 | sed 's%/[^/]*$%%'\`
EOF
# Export our shlibpath_var if we have one.
- if test -n "$shlibpath_var" && test -n "$rpath"; then
+ if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
cat >> $output <<EOF
# Add our own library path to $shlibpath_var
- $shlibpath_var="$rpath\$$shlibpath_var"
+ $shlibpath_var="$temp_rpath\$$shlibpath_var"
export $shlibpath_var
EOF
fi
# Now set the variables for building old libraries.
oldlib="$objdir/$libname.a"
- # Transform .lo files to .o (skipping convenience libraries).
- # FIXME: skipping them is simplistic. We should determine which members
- # are actually needed to resolve symbols.
- oldobjs="$objs"`echo "$libobjs " | sed 's/[^ ]*\.a //g; s/\.lo /.o /g; s/ $//g'`
+ # Transform .lo files to .o files.
+ # FIXME: simplistically, we include all libobjlibs here.
+ # We really should determine which members are needed to resolve symbols.
+ oldobjs="$objs"`echo "$libobjs " | sed 's/[^ ]*\.a //g; s/\.lo /.o /g; s/ $//g'`"$libobjlibs"
if test -d "$objdir"; then
$show "$rm $oldlib"
ltlibs="$ltlibs $lib"
done
+ if test -z "$ltlibs"; then
+ echo "$progname: you must specify at least one LTLIBRARY" 1>&2
+ echo "$help" 1>&2
+ exit 1
+ fi
+
# Now check to make sure each one is a valid libtool library.
status=0
for lib in $ltlibs; do
dlname=
libdir=
+ library_names=
# Check to see that this really is a libtool archive.
if egrep "^# Generated by $PROGRAM" $arg >/dev/null 2>&1; then :
status=1
elif test -n "$dlname"; then
echo "$libdir/$dlname"
+ elif test -z "$library_names"; then
+ echo "$progname: \`$arg' is not a shared library" 1>&2
+ status=1
else
echo "$progname: \`$arg' was not linked with \`-export-dynamic'" 1>&2
status=1
dlname)
cat <<EOF
-Usage: $progname [OPTION]... --mode=dlname LTLIBRARY [LTLIBRARY]...
+Usage: $progname [OPTION]... --mode=dlname LTLIBRARY...
Print filenames to use to \`dlopen' libtool libraries.
+Wed Apr 16 19:21:00 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
+
+ * hardcode.test: AIX also has arbitrary limits on the line length
+ of input to fgrep(1), so we need to translate NUL characters to
+ newlines in order to properly detect embedded `.libs'. From Bruno
+ Haible.
+ Also redirect stderr to /dev/null, so that AIX users don't get
+ worried by `fgrep: Maximum line length of 2048 exceeded.'.
+
Tue Apr 1 12:48:32 1997 Gordon Matzigkeit <gord@gnu.ai.mit.edu>
* hardcode.test: AIX 3 doesn't have strings(1) so we need to do a
hardcoded=no
if fgrep '.libs' $file > /dev/null; then
hardcoded=yes
- elif cat $file | tr '\200-\277' '\100-\177' | tr '\300-\377' '\100-\177' | tr '\000-\037' '\040-\077' | fgrep '.libs' > /dev/null; then
+ elif cat $file | tr '\200-\277' '\100-\177' | tr '\300-\377' '\100-\177' \
+ | tr '\000-\037' '\040-\077' | tr '\040' '\012' \
+ | fgrep '.libs' > /dev/null 2>&1; then
# At least AIX fgrep doesn't work for binary files, and AIX also
# doesn't have strings(1), so we need this strange conversion.
+ # AIX fgrep also has a limited line length, that's why we finally
+ # turn the NUL characters into newlines.
hardcoded=yes
elif egrep 'unsupported' $file > /dev/null; then
hardcoded=unsupported