From: Thomas Tanner Date: Tue, 29 Jun 1999 17:37:06 +0000 (+0000) Subject: * NEWS: mention -no-fast-install, rename dummy to force X-Git-Tag: release-1-3b~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86180ef4d5291a193196251621088cb38534e6ca;p=thirdparty%2Flibtool.git * NEWS: mention -no-fast-install, rename dummy to force * doc/PLATFORMS: 1.3b passes all tests on GNU/Linux, FreeBSD (2.2.6 and 3.1) * doc/libtool.texi: it's possible to link libtool libraries using -L and -l, better documentation of uninstall and clean mode, rename dummy to force, documented -no-fast-install, AC_LIBLTDL_* must be called before AC_PROG_LIBTOOL, documented hardcode_into_libs and striplib/old_striplib, * ltconfig.in: search for strip program, added hardcode_into_libs and striplib/old_striplib variables, set strip commands for GNU strip, on FreeBSD >= 3.2 set hardcode_into_libs to yes, fast-install mode doesn't work if hardcode_into_libs = yes * ltmain.in: reimplemented hardcoding into libraries: new relink mode, preserve all libtool args, relink libraries when installing if necessary added -no-fast-install flag, removed unnecessary `dlname' initialization, use striplib/old_striplib for stripping libraries, dlname is always soname or in library_names so we don't need to handle different file names --- diff --git a/ChangeLog b/ChangeLog index c29e8251c..d0acb6ff5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +1999-06-29 Thomas Tanner + + * NEWS: mention -no-fast-install, rename dummy to force + * doc/PLATFORMS: 1.3b passes all tests on GNU/Linux, + FreeBSD (2.2.6 and 3.1) + * doc/libtool.texi: it's possible to link libtool libraries + using -L and -l, better documentation of uninstall and clean mode, + rename dummy to force, documented -no-fast-install, + AC_LIBLTDL_* must be called before AC_PROG_LIBTOOL, + documented hardcode_into_libs and striplib/old_striplib, + * ltconfig.in: search for strip program, added hardcode_into_libs + and striplib/old_striplib variables, set strip commands for GNU strip, + on FreeBSD >= 3.2 set hardcode_into_libs to yes, + fast-install mode doesn't work if hardcode_into_libs = yes + * ltmain.in: reimplemented hardcoding into libraries: + new relink mode, preserve all libtool args, relink libraries + when installing if necessary + added -no-fast-install flag, removed unnecessary `dlname' + initialization, use striplib/old_striplib for stripping libraries, + dlname is always soname or in library_names so we don't need + to handle different file names + 1999-06-29 Alexandre Oliva * ltconfig.in (freebsd*, shlibpath_overrides_runpath): Set to yes diff --git a/NEWS b/NEWS index 32256ead4..0aa9f1f75 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ New in 1.3b: 1999-??-??; CVS version 1.3a, Libtool team: directly to the compiler * New "-Wl,flag" and "-Xlinker flag" flags to pass flags directly to the linker +* New "-no-fast-install" flag to selectively disable fast-install mode. * Support for installing stripped libraries using GNU strip (install -s). Automake >= 1.5 will install stripped libraries with "make install-strip". * Support for linking DLLs on Win32 @@ -17,7 +18,7 @@ New in 1.3b: 1999-??-??; CVS version 1.3a, Libtool team: * Various bugfixes New in 1.3.3: 1999-06-2?, CVS version 1.3.2a, Libtool team: -* New `-dlpreopen dummy' flag to ensure that +* New `-dlpreopen force' flag to ensure that lt_preloaded_symbols is always defined. * Work around self-dlclose bug in FreeBSD 3.1. * Expand convenience libraries when creating reloadable objects. diff --git a/doc/PLATFORMS b/doc/PLATFORMS index 4058e9b69..d4aecefdb 100644 --- a/doc/PLATFORMS +++ b/doc/PLATFORMS @@ -32,10 +32,10 @@ i*86-pc-cygwin gcc 1.3.2 NS (egcs-1.1 stock b20.1 compiler) i*86-*-dguxR4.20MU01 gcc 1.2 ok i*86-*-freebsdelf4.0 gcc 1.2f ok -i*86-*-freebsdelf3.1 gcc 1.2f ok +i*86-*-freebsdelf3.1 gcc 1.3b ok i*86-*-freebsd3.0 gcc 1.2e ok i*86-*-freebsd2.2.8 gcc 1.2f ok -i*86-*-freebsd2.2.6 gcc 1.3.2 ok +i*86-*-freebsd2.2.6 gcc 1.3b ok (egcs-1.1 & gcc-2.7.2.1, native ld) i*86-*-freebsd2.1.5 gcc 0.5 ok i*86-*-gnu gcc 1.3.2 ok @@ -47,7 +47,7 @@ i*86-*-netbsd1.3.2 gcc 1.2e ok i*86-*-netbsd1.3I gcc 1.2e ok (egcs 1.1?) i*86-*-netbsd1.2 gcc 0.9g ok -i*86-*-linux-gnu gcc 1.3.2 ok +i*86-*-linux-gnu gcc 1.3b ok (egcs-1.1.2, GNU ld 2.9.1.0.23) i*86-*-linux-gnulibc1 gcc 1.2f ok i*86-*-openbsd2.4 gcc 1.2f ok diff --git a/doc/libtool.texi b/doc/libtool.texi index b18126c49..70406b866 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -671,7 +671,7 @@ burger$ @kbd{gcc -g -O -o hell.old main.o libhello.a -lm} burger$ @end example -Libtool's way is almost the same@footnote{However, you should never use +Libtool's way is almost the same@footnote{However, you should avoid using @samp{-L} or @samp{-l} flags to link against an uninstalled libtool library. Just specify the relative path to the @samp{.la} file, such as @file{../intl/libintl.la}. This is a design decision to eliminate any @@ -1102,7 +1102,10 @@ Install libraries or executables. Create a library or an executable. @item uninstall -Delete libraries or executables. +Delete installed libraries or executables. + +@item clean +Delete uninstalled libraries or executables. @end table @item --version @@ -1209,7 +1212,7 @@ Link @var{file} into the output program, and add its symbols to @var{lt_preloaded_symbols} (@pxref{Dlpreopening}). If @var{file} is @code{self}, the symbols of the program itself will be added to @var{lt_preloaded_symbols}. -If @var{file} is @code{dummy} libtool will make sure that +If @var{file} is @code{force} libtool will make sure that @var{lt_preloaded_symbols} is always @emph{defined}, regardless of whether it's empty or not. @@ -1244,6 +1247,11 @@ Module names don't need to be prefixed with 'lib'. In order to prevent name clashes, however, 'libname' and 'name' must not be used at the same time in your package. +@item -no-fast-install +Disable fast-install mode for the executable @var{output-file} +(@pxref{Invoking ltconfig}). Useful if the program is only used in the +build tree, e.g., for generating other files. + @item -no-undefined Declare that @var{output-file} does not depend on any other libraries. Some platforms cannot create shared libraries that depend on other @@ -1360,7 +1368,7 @@ Running this command may require superuser privileges, so the @cindex uninstall mode @cindex mode, uninstall -@dfn{Uninstall} mode deletes installed libraries (and other files). +@dfn{Uninstall} mode deletes installed libraries, executables and objects. The first @var{mode-arg} is the name of the program to use to delete files (typically @file{/bin/rm}). @@ -1373,7 +1381,8 @@ The remaining @var{mode-args} are either flags for the deletion program @cindex clean mode @cindex mode, clean -@dfn{Clean} mode deletes uninstalled libraries (and other files). +@dfn{Clean} mode deletes uninstalled libraries, executables, objects +and libtool's temporary files associated with them. The first @var{mode-arg} is the name of the program to use to delete files (typically @file{/bin/rm}). @@ -3047,11 +3056,11 @@ symbols. In general you can safely use the convenience library in programs which don't depend on other libraries that might use libltdl too. In order to enable this flavor of libltdl, you should add the line @samp{AC_LIBLTDL_CONVENIENCE} to your @file{configure.in}, -@emph{after} @samp{AM_PROG_LIBTOOL}. +@emph{before} @samp{AM_PROG_LIBTOOL}. In order to select the installable version of libltdl, you should add a call of the macro @samp{AC_LIBLTDL_INSTALLABLE} to your -@file{configure.in} @emph{after} @samp{AM_PROG_LIBTOOL}. This macro +@file{configure.in} @emph{before} @samp{AM_PROG_LIBTOOL}. This macro will check whether libltdl is already installed and, if not, request the libltdl embedded in your package to be built and installed. Note, however, that no version checking is performed. The user may override @@ -3079,7 +3088,7 @@ with programs that include @file{ltdl.h}. It is up to you to use default, such as @var{LIBS} and @var{CPPFLAGS}. If you're using the convenience libltdl, @var{LIBLTDL} will be the -pathname for the convenience version of libltdland @var{INCLTDL} will be +pathname for the convenience version of libltdl and @var{INCLTDL} will be @samp{-I} followed by the directory that contains libltdl, both starting with @samp{$@{top_builddir@}/}. @@ -3116,17 +3125,16 @@ assume that libltdl was embedded using @samp{libtoolize --ltdl}. configure.in: @example ... -dnl Check for dlopen support -AC_LIBTOOL_DLOPEN -dnl Configure libtool -AM_PROG_LIBTOOL dnl Enable building of the convenience library dnl and set LIBLTDL accordingly AC_LIBLTDL_CONVENIENCE -dnl Substitute LIBLTDL in the Makefiles +dnl Substitute INCLTDL and LIBLTDL in the Makefiles +AC_SUBST(INCLTDL) AC_SUBST(LIBLTDL) -dnl Add INCLTDL to the include path -CPPFLAGS="$CPPFLAGS $INCLTDL" +dnl Check for dlopen support +AC_LIBTOOL_DLOPEN +dnl Configure libtool +AM_PROG_LIBTOOL dnl Configure libltdl AC_CONFIG_SUBDIRS(libltdl) ... @@ -3137,6 +3145,8 @@ Makefile.am: ... SUBDIRS = libltdl +INCLUDES = $(INCLTDL) + myprog_LDFLAGS = -export-dynamic # The quotes around -dlopen below fool automake into accepting it myprog_LDADD = $(LIBLTDL) "-dlopen" self "-dlopen" libfoo.la @@ -4008,6 +4018,12 @@ line (such as @samp{@var{dir}/lib@var{name}.a}) when @var{hardcode_libdir_flag_spec} is specified. @end defvar +@defvar hardcode_into_libs +Whether the platform supports hardcoding of run-paths into libraries. +If enabled, linking of programs will be much simpler but libraries will +need to be relinked during installation. Set to @samp{yes} or @samp{no}. +@end defvar + @defvar hardcode_libdir_flag_spec Flag to hardcode a @var{libdir} variable into a binary, so that the dynamic linker searches @var{libdir} for shared libraries at runtime. @@ -4157,6 +4173,13 @@ The name coded into shared libraries, if different from the real name of the file. @end defvar +@defvar striplib +@defvarx old_striplib +Command to strip a shared (@code{striplib}) or static (@code{old_striplib}) +library, respectively. If these variables are empty, the strip flag +in the install mode will be ignored for libraries (@pxref{Install mode}). +@end defvar + @defvar sys_lib_dlsearch_path_spec Expression to get the run-time system library search path. Directories that appear in this list are never hard-coded into executables. diff --git a/ltconfig.in b/ltconfig.in index e64da7511..cd9a8a987 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -574,6 +574,33 @@ if test -z "$NM"; then echo "$ac_t$NM" 1>&6 fi +# Search for a strip program +echo $ac_n "checking for strip... $ac_c" 1>&6 +echo "$progname:@LINENO@: checking for strip" 1>&5 +if test "X${ac_cv_prog_STRIP+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 + result="$ac_cv_prog_STRIP" +else + if test -n "$STRIP"; then + result="$STRIP" # Let the user override the test. + ac_cv_prog_STRIP="$result" + else + result=no + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/strip || test -f $dir/strip$ac_exeext; then + result="strip" + ac_cv_prog_STRIP="$result" + break + fi + done + IFS="$save_ifs" + fi +fi +test -n "$ac_cv_prog_STRIP" && STRIP="$ac_cv_prog_STRIP" +echo "$ac_t$result" 1>&6 + # Check to see if we are using GCC. if test "$with_gcc" != yes || test -z "$CC"; then # If CC is not set, then try to find GCC or a usable CC. @@ -1182,9 +1209,12 @@ archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= +striplib= +old_striplib= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= +hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no @@ -1638,6 +1668,14 @@ else fi echo "$ac_t$hardcode_action" 1>&6 +echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6 +if test -n "$STRIP" && $STRIP -V | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "${ac_t}yes" 1>&6 +else + echo "${ac_t}no" 1>&6 +fi reload_flag= reload_cmds='$LD$reload_flag -o $output$reload_objs' @@ -1775,6 +1813,7 @@ freebsd*) ;; *) # from 3.2 on shlibpath_overrides_runpath=no + hardcode_into_libs=yes ;; esac ;; @@ -2233,7 +2272,7 @@ test "$enable_shared" = yes || enable_static=yes echo "checking whether to build static libraries... $enable_static" 1>&6 -if test "$hardcode_action" = relink; then +if test "$hardcode_action" = relink || test "$hardcode_into_libs" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || @@ -2692,7 +2731,8 @@ case "$ltmain" in RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ - file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ + old_striplib striplib file_magic_cmd export_symbols_cmds \ + deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ @@ -2934,6 +2974,10 @@ archive_expsym_cmds=$archive_expsym_cmds postinstall_cmds=$postinstall_cmds postuninstall_cmds=$postuninstall_cmds +# Commands to strip libraries. +old_striplib=$old_striplib +striplib=$striplib + # Method to check whether dependent libraries are shared objects. deplibs_check_method=$deplibs_check_method @@ -2970,6 +3014,9 @@ shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec diff --git a/ltmain.in b/ltmain.in index ec56c4f97..1b5d29584 100644 --- a/ltmain.in +++ b/ltmain.in @@ -611,8 +611,10 @@ compiler." ;; # libtool link mode - link) + link | relink) modename="$modename: link" + relink=no + test "$mode" = "relink" && relink=yes case "$host" in *-*-cygwin* | *-*-mingw* | *-*-os2*) # It is impossible to link a dll without this setting, and @@ -800,6 +802,7 @@ compiler." allow_undefined=yes ;; esac + libtool_args="$nonopt" compile_command="$nonopt" finalize_command="$nonopt" @@ -872,6 +875,7 @@ compiler." while test $# -gt 0; do arg="$1" shift + libtool_args="$libtool_args $arg" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -892,7 +896,7 @@ compiler." fi case "$arg" in *.la | *.lo) ;; # We handle these cases below. - dummy) + force) if test "$dlself" = no; then dlself=needless export_dynamic=yes @@ -1102,6 +1106,11 @@ compiler." continue ;; + -no-fast-install) + fast_install=no + continue + ;; + -no-undefined) allow_undefined=no continue @@ -1621,16 +1630,18 @@ compiler." fi fi - # Create the output directory, or remove our outputs if we need to. - if test -d $output_objdir; then - $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" - $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* - else - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status + if test "$relink" = no; then + # Create the output directory, or remove our outputs if we need to. + if test -d $output_objdir; then + $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" + $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* + else + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test $status -ne 0 && test ! -d $output_objdir; then + exit $status + fi fi fi @@ -1692,7 +1703,6 @@ compiler." fi ;; esac - dlname= libdir= library_names= old_library= @@ -1773,6 +1783,30 @@ compiler." if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # This is a shared library + if test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names @@ -1822,49 +1856,73 @@ compiler." add_dir= add_shlibpath= add_name=no - lib_linked=yes - case "$hardcode_action" in - immediate | unsupported) - if test "$hardcode_direct" = no; then - deplibs="$deplibs $dir/$linklib" - elif test "$hardcode_minus_L" = no; then - case "$host" in - *-*-sunos*) add_shlibpath="$dir" ;; + if test "$relink" = no; then + lib_linked=yes + case "$hardcode_action" in + immediate | unsupported) + if test "$hardcode_direct" = no; then + deplibs="$deplibs $dir/$linklib" + elif test "$hardcode_minus_L" = no; then + case "$host" in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add_name=yes + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add_name=yes + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + deplibs="$deplibs $dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + add_name=yes + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add_name=yes + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit 1 + fi + if test -n "$add_shlibpath"; then + case ":$compile_shlibpath:" in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac - add_dir="-L$dir" - add_name=yes - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add_name=yes - else - lib_linked=no fi - ;; - relink) + else + # Install command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then - deplibs="$deplibs $dir/$linklib" + deplibs="$deplibs $libdir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" + add_dir="-L$libdir" add_name=yes elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" add_name=yes else - lib_linked=no + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + add_name=yes fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 fi - if test -n "$add_shlibpath"; then - case ":$compile_shlibpath:" in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case ":$finalize_shlibpath:" in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac fi if test -n "$add_dir"; then case "$deplibs " in @@ -2227,10 +2285,61 @@ EOF # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then - if test -n "$compile_shlibpath"; then - eval "$shlibpath_var='$compile_shlibpath\$$shlibpath_var'; export $shlibpath_var" + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$relink" = no && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi + shlibpath="$finalize_shlibpath" + test "$relink" = no && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names @@ -2334,6 +2443,11 @@ EOF linker_flags="$linker_flags $flag" fi + # Make a backup of the uninstalled library when relinking + if test "$relink" = yes && test "$hardcode_into_libs" = yes ; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" @@ -2348,6 +2462,12 @@ EOF done IFS="$save_ifs" + # Restore the uninstalled library and exit + if test "$relink" = yes && test "$hardcode_into_libs" = yes; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + exit 0 + fi + # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then @@ -2597,7 +2717,6 @@ EOF fi ;; esac - dlname= libdir= library_names= old_library= @@ -2724,7 +2843,6 @@ EOF fi ;; esac - dlname= libdir= library_names= old_library= @@ -2789,8 +2907,10 @@ EOF absdir="$abs_ladir/$objdir" fi name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - if test -n "$library_names" && + + hardcode=yes + test "$hardcode_into_libs" = yes && test "$alldeplibs" = yes && hardcode=no + if test "$hardcode" = yes && test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var"; then @@ -3347,7 +3467,7 @@ static const void *lt_preloaded_setup() { fi fi - if test "$hardcode_action" = relink; then + if test "$hardcode_action" = relink || test "$hardcode_into_libs" = yes; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" @@ -3679,6 +3799,10 @@ fi\ test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" + # Quote the link command for shipping. + relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do @@ -3734,8 +3858,11 @@ revision=$revision installed=$installed # Directory that this library needs to be installed in: -libdir='$install_libdir'\ -" +libdir='$install_libdir'" + if test "$installed" = no; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi done fi @@ -3788,7 +3915,6 @@ libdir='$install_libdir'\ install_type= isdir=no stripme= - gnustrip=no for arg do if test -n "$dest"; then @@ -3805,7 +3931,6 @@ libdir='$install_libdir'\ -o) prev="-o" ;; -s) stripme=" -s" - strip -V | grep "GNU strip" >/dev/null && gnustrip=yes continue ;; -*) ;; @@ -3917,6 +4042,7 @@ libdir='$install_libdir'\ library_names= old_library= + relink_command= # If there is no directory component, then add one. case "$file" in */* | *\\*) . $file ;; @@ -3941,6 +4067,20 @@ libdir='$install_libdir'\ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" + if test "$hardcode_into_libs" = yes; then + if test -z "$relink_command"; then + $echo "$modename: invalid libtool pseudo library \`$file'" 1>&2 + exit 1 + fi + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + continue + fi + fi + # See the names of the shared library. set dummy $library_names if test -n "$2"; then @@ -3948,20 +4088,21 @@ libdir='$install_libdir'\ shift shift + srcname="$realname" + test "$hardcode_into_libs" = yes && srcname="$realname"T + # Install the shared library and build the symlinks. - $show "$install_prog $dir/$realname $destdir/$realname" - $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? - test "X$dlname" = "X$realname" && dlname= - if test $gnustrip = yes; then - $show "strip --strip-unneeded $destdir/$realname" - $run eval "strip --strip-unneeded $destdir/$realname" || exit $? + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? fi if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do - test "X$dlname" = "X$linkname" && dlname= if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" @@ -3969,12 +4110,6 @@ libdir='$install_libdir'\ done fi - if test -n "$dlname"; then - # Install the dynamically-loadable library. - $show "$install_prog $dir/$dlname $destdir/$dlname" - $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $? - fi - # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" @@ -4085,6 +4220,13 @@ libdir='$install_libdir'\ fi done + relink_command= + # If there is no directory component, then add one. + case "$file" in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then @@ -4133,9 +4275,9 @@ libdir='$install_libdir'\ $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? - if test $gnustrip = yes; then - $show "strip --strip-debug $oldlib" - $run eval "strip --strip-debug $oldlib" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. @@ -4282,9 +4424,7 @@ libdir='$install_libdir'\ # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" - test "X$n" = "X$dlname" && dlname= done - test -n "$dlname" && rmfiles="$rmfiles $objdir/$dlname" test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" rmfiles="$rmfiles $objdir/$name $objdir/${name}i" fi @@ -4490,9 +4630,7 @@ libdir='$install_libdir'\ # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $dir/$n" - test "X$n" = "X$dlname" && dlname= done - test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname" test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" $show "$rm $rmfiles"