From: Gordon Matzigkeit Date: Thu, 24 Apr 1997 17:51:39 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release-1-0a~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b24f92f4fef449cd44bfdbd817e76ff14ab68f4d;p=thirdparty%2Flibtool.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index 4f68ebb8b..cff6418b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +Tue Apr 22 12:41:34 1997 Gordon Matzigkeit + + * 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 + + * 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 + + * 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 * ltmain.sh.in (mode): Use `egrep -e' when inferring the operation @@ -6,7 +31,7 @@ Sun Apr 13 19:40:58 1997 Gordon Matzigkeit Sat Apr 12 13:09:24 1997 Gordon Matzigkeit * 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. diff --git a/NEWS b/NEWS index b32031e18..dd098e413 100644 --- a/NEWS +++ b/NEWS @@ -5,10 +5,12 @@ New in 0.9e: * 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*. New in 0.9: * Bug fixes. diff --git a/README b/README index e8b946b30..4aa88254d 100644 --- a/README +++ b/README @@ -17,6 +17,7 @@ Shared library support has been implemented for these platforms: 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*) diff --git a/TODO b/TODO index f0e0c2c90..2ff8970eb 100644 --- a/TODO +++ b/TODO @@ -1,18 +1,7 @@ -* 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. diff --git a/doc/libtool.texi b/doc/libtool.texi index 8bc275812..a27f38e48 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -894,6 +894,11 @@ and accepts the following options: 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}. @@ -1759,16 +1764,17 @@ features such as constructors, exception handling, and RTTI. @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 @@ -1842,9 +1848,9 @@ This test validates that libtool can handle suffixes for all the file 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 @@ -1928,8 +1934,8 @@ need to follow some cross references to find the information that is 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. @@ -2073,7 +2079,7 @@ The @samp{-x} flag works for shared libraries, but fails with ``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 @@ -2119,12 +2125,12 @@ Whether libtool should build static libraries on this system. Set to @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 @@ -2140,16 +2146,30 @@ Flag to hardcode a @var{libdir} variable into a binary, so that the 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 @@ -2183,6 +2203,11 @@ Commands run after installing a shared or static librar, respectively. 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. diff --git a/doc/platforms.texi b/doc/platforms.texi index 04943bbe2..7cdd813de 100644 --- a/doc/platforms.texi +++ b/doc/platforms.texi @@ -22,7 +22,7 @@ mips-sgi-irix6.2 cc -n32 0.9 ok 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 @@ -33,3 +33,6 @@ sparc-sun-solaris2.4 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. diff --git a/ltconfig.in b/ltconfig.in index 0517b941b..fa6b2b89a 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -395,45 +395,45 @@ if test "$with_gcc" = yes; then 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 ' @@ -445,8 +445,8 @@ else 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= ;; @@ -469,6 +469,23 @@ if test -n "$special_shlib_compile_flags"; then 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 @@ -498,14 +515,16 @@ hardcode_libdir_flag_spec= 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 @@ -513,6 +532,8 @@ if test "$with_gnu_ld" = yes; then *) 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 @@ -527,47 +548,47 @@ if test "$with_gnu_ld" = yes; then 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' @@ -575,24 +596,24 @@ else 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 @@ -611,10 +632,12 @@ echo $ac_t "$ld_shlibs" 1>&6 # 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. @@ -623,8 +646,8 @@ if test -n "$hardcode_libdir_flag_spec"; then # 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 @@ -654,8 +677,8 @@ version_type=none 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 @@ -664,16 +687,20 @@ case "$host" in 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" @@ -685,7 +712,7 @@ case "$host" in postinstall_cmds='chmod 555 $lib' ;; -*-*-irix5* | *-*-irix6*) +irix5* | irix6*) version_type=osf soname_spec='$libname.so' library_names_spec='$libname.so.$versuffix $libname.so' @@ -693,13 +720,13 @@ case "$host" in ;; # 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' @@ -707,41 +734,35 @@ case "$host" in 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' @@ -884,6 +905,9 @@ finish_cmds='$finish_cmds' 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 @@ -905,7 +929,11 @@ hardcode_direct=$hardcode_direct # 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 diff --git a/ltmain.sh.in b/ltmain.sh.in index f4111850b..89d0f1e0a 100644 --- a/ltmain.sh.in +++ b/ltmain.sh.in @@ -288,6 +288,7 @@ if test -z "$show_help"; then hardcode_libdirs= install_libdir= libobjs= + libobjlibs= link_against_libtool_libs= link_static= ltlibs= @@ -295,6 +296,7 @@ if test -z "$show_help"; then output= prev= prevarg= + perm_rpath= temp_rpath= vinfo= whole_archive=no @@ -414,7 +416,8 @@ if test -z "$show_help"; then 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" @@ -499,8 +502,15 @@ if test -z "$show_help"; then 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 @@ -631,6 +641,9 @@ if test -z "$show_help"; 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 @@ -825,10 +838,10 @@ if test -z "$show_help"; then # 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\"` @@ -876,6 +889,7 @@ if test -z "$show_help"; then 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 @@ -925,16 +939,27 @@ if test -z "$show_help"; 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 @@ -971,8 +996,8 @@ if test -z "$show_help"; then # 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%/[^/]*$%%'\` @@ -1000,11 +1025,11 @@ else 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 <&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 : @@ -1482,6 +1514,9 @@ EOF 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 @@ -1631,7 +1666,7 @@ EOF dlname) cat < + + * 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 * hardcode.test: AIX 3 doesn't have strings(1) so we need to do a diff --git a/tests/hardcode.test b/tests/hardcode.test index a0b0029ab..c6484e771 100755 --- a/tests/hardcode.test +++ b/tests/hardcode.test @@ -76,9 +76,13 @@ for file in hc-*; do 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