From: Thomas Tanner Date: Sun, 7 Mar 1999 15:27:23 +0000 (+0000) Subject: * TODO: scheduled some items for next release/future X-Git-Tag: release-1-2f~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d71a558fe062e695579cb8089a1d5e7e008e1ed3;p=thirdparty%2Flibtool.git * TODO: scheduled some items for next release/future * demo/configure.in: use AC_LIBTOOL_DLOPEN * libtool.m4: added AC_ENABLE/DISABLE_FAST_INSTALL macro * ltconfig.in: added --disable-fast-install flag * ltmain.in: partially reverted Alexandre's patch and implemented on-demand linking in such a way that the old developer-friendly linking style is optional, don't hardcode library paths that are in the system search path, fixed a typo in lib_search_path, implemented -export-symbols-regex for programs --- diff --git a/ChangeLog b/ChangeLog index 45a047e9f..0c54ff6cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +1999-03-07 Thomas Tanner + + * TODO: scheduled some items for next release/future + * demo/configure.in: use AC_LIBTOOL_DLOPEN + * libtool.m4: added AC_ENABLE/DISABLE_FAST_INSTALL macro + * ltconfig.in: added --disable-fast-install flag + * ltmain.in: partially reverted Alexandre's patch and implemented + on-demand linking in such a way that the old developer-friendly + linking style is optional, + don't hardcode library paths that are in the system search path, + fixed a typo in lib_search_path, + implemented -export-symbols-regex for programs + 1999-03-06 Alexandre Oliva * libltdl/ltdl.c (LTDL_LAZY_OR_NOW): renamed from LTDL_NOW; prefer diff --git a/TODO b/TODO index 76e7d5842..09999e520 100644 --- a/TODO +++ b/TODO @@ -4,23 +4,23 @@ For next alpha release: * Fast installation (linking on demand in the build tree) must be optional. +* libltdl is broken when configured with --enable-ltdl-install + +* update the NEWS file + +For next public release: +************************ + * check whether the version of libtool.m4 is compatible with ltconfig/ltmain.sh -* libltdl is broken when configured with --enable-ltdl-install - * check whether the "file" command is available -* update the NEWS file - * Tom Lane adds that HP-UX's linker, at least (I've also found this on AIX 4), distinguishes between global function and global variable references. This means that we cannot declare every symbol as `extern char'. Find a workaround. -For next public release: -************************ - * Inter-library dependencies should be fully tracked by libtool and need to work for ltlibraries too. This requires looking up installed libtool libraries for transparent support. @@ -33,6 +33,20 @@ paths into libraries, as well as binaries: `... -Wl,-soname * Lists of exported symbols should be stored in the pseudo library so that the size of lt_preloaded_symbols can be reduced. +* Documentation: + +- libltdl documentation needs to be completed. + +- AC_PROG_LIBTOOL, AC_ENABLE/DISABLE_SHARED/STATIC/FAST_INSTALL, + AC_LIBTOOL_DLOPEN are not documented. + +- Purpose and usage of convenience libraries must be better documented + +- some new internal variables are not documented yet. + +In the future: +************** + * Godmar Back writes: libltdl uses such stdio functions as fopen, fgets, feof, fclose, and others. These functions are not async-signal-safe. While this does not make @@ -49,20 +63,6 @@ so that the size of lt_preloaded_symbols can be reduced. possible would greatly improve libltdl's ability to be embedded in and used by other systems. -* Documentation: - -- libltdl documentation needs to be completed. - -- AC_PROG_LIBTOOL, AC_ENABLE/DISABLE_SHARED/STATIC, AC_LIBTOOL_DLOPEN - are not documented. - -- Purpose and usage of convenience libraries must be better documented - -- some new internal variables are not documented yet. - -In the future: -************** - * Fix */demo on win32. This may require resolving some of the items below. diff --git a/demo/configure.in b/demo/configure.in index 67cb0bd21..498879ca9 100644 --- a/demo/configure.in +++ b/demo/configure.in @@ -5,6 +5,7 @@ AM_INIT_AUTOMAKE(hell,1.0) AC_PROG_CC AC_C_CONST AC_EXEEXT +AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then diff --git a/libtool.m4 b/libtool.m4 index 4e3724e78..70e6e681e 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -26,6 +26,7 @@ AC_DEFUN(AC_PROG_LIBTOOL, [AC_PREREQ(2.12.2)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl @@ -44,6 +45,7 @@ AC_SUBST(LIBTOOL)dnl libtool_flags= test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" test "x$lt_cv_dlopen" != xno && libtool_flags="$libtool_flags --enable-dlopen" test "x$lt_cv_dlopen_self" = xyes && libtool_flags="$libtool_flags --enable-dlopen-self" test "$silent" = yes && libtool_flags="$libtool_flags --silent" @@ -187,10 +189,6 @@ enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl AC_DEFUN(AC_DISABLE_SHARED, [AC_ENABLE_SHARED(no)]) -# AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN(AC_DISABLE_STATIC, -[AC_ENABLE_STATIC(no)]) - # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to @@ -220,6 +218,44 @@ esac], enable_static=AC_ENABLE_STATIC_DEFAULT)dnl ]) +# AC_DISABLE_STATIC - set the default static flag to --disable-static +AC_DEFUN(AC_DISABLE_STATIC, +[AC_ENABLE_STATIC(no)]) + + +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_FAST_INSTALL, +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(fast-install, +changequote(<<, >>)dnl +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl +]) + +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN(AC_DISABLE_FAST_INSTALL, +[AC_ENABLE_FAST_INSTALL(no)]) + # AC_PROG_LD - find the path to the GNU or non-GNU linker AC_DEFUN(AC_PROG_LD, diff --git a/ltconfig.in b/ltconfig.in index 0c10258fb..9901e88fa 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -177,6 +177,7 @@ can_build_shared=yes enable_shared=yes # All known linkers require a `.a' archive for static linking. enable_static=yes +enable_fast_install=yes enable_dlopen=unknown enable_dlopen_self=unknown ltmain= @@ -231,6 +232,7 @@ Generate a system-specific libtool script. --debug enable verbose shell tracing --disable-shared do not build shared libraries --disable-static do not build static libraries + --disable-fast-install do not optimize for fast installation --enable-dlopen enable dlopen support --enable-dlopen-self enable support for dlopening programs --help display this help and exit @@ -261,6 +263,8 @@ EOM --disable-static) enable_static=no ;; + --disable-fast-install) enable_fast_install=no ;; + --enable-dlopen) enable_dlopen=yes ;; --enable-dlopen-self) enable_dlopen_self=yes ;; @@ -1529,6 +1533,11 @@ else fi echo "$ac_t$hardcode_action" 1>&6 +if test "$hardcode_action" = relink || test "$shlibpath_overrides_rpath" = yes; then + # Fast installation is not supported/necessary + fast_install=no +fi + reload_flag= reload_cmds='$LD$reload_flag -o $output$reload_objs' @@ -2011,6 +2020,9 @@ build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + # The host system. host_alias=$host_alias host=$host diff --git a/ltmain.in b/ltmain.in index 52cba89a0..5833fce35 100644 --- a/ltmain.in +++ b/ltmain.in @@ -780,9 +780,11 @@ compiler." allow_undefined=yes ;; esac - compile_command="$CC@BUILD_LIBDIRS_FLAGS@" + compile_command="$CC" finalize_command="$CC" + compile_rpath= + finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= @@ -794,7 +796,7 @@ compiler." # get the directories listed in $shlibpath_var eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else - libsearch_path= + lib_search_path= fi # now prepend the system-specific ones eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\" @@ -807,7 +809,6 @@ compiler." export_symbols= export_symbols_regex= generated= - hardcode_libdirs= libobjs= link_against_libtool_libs= ltlibs= @@ -1161,7 +1162,7 @@ compiler." for deplib in $dependency_libs; do case "$deplib" in -R*) temp_xrpath=`echo "X$deplib" | $Xsed -e 's/^-R//'` - case " $rpath $xrpath " in + case " $rpath $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; @@ -1224,39 +1225,27 @@ compiler." esac fi - # This is the magic to use -rpath. - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - # Put the magic libdir with the hardcode flag. - hardcode_libdirs="$libdir" - libdir="@HARDCODE_LIBDIRS@" - 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 - libdir= - fi - fi - - if test -n "$libdir"; then - eval flag=\"$hardcode_libdir_flag_spec\" - - compile_command="$compile_command $flag" - finalize_command="$finalize_command $flag" + # We need an absolute path. + case "$dir" in + /* | [A-Za-z]:[/\\]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$libdir'" 1>&2 + exit 1 fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $absdir "*) ;; - *) perm_rpath="$perm_rpath $absdir" ;; - esac - fi - + ;; + esac + + # This is the magic to use -rpath. + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" ;; + esac + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac lib_linked=yes case "$hardcode_action" in @@ -1299,33 +1288,20 @@ compiler." ;; relink) - # We need an absolute path. - case "$dir" in - /* | [A-Za-z]:[/\\]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit 1 - fi - dir="$absdir" - ;; - esac - if test "$hardcode_direct" = yes; then - compile_command="$compile_command $dir/$linklib" - deplibs="$deplibs $dir/$linklib" + compile_command="$compile_command $absdir/$linklib" + deplibs="$deplibs $absdir/$linklib" elif test "$hardcode_minus_L" = yes; then case "$compile_command " in - *" -L$dir "*) ;; - *) compile_command="$compile_command -L$dir";; + *" -L$absdir "*) ;; + *) compile_command="$compile_command -L$absdir";; esac compile_command="$compile_command -l$name" - deplibs="$deplibs -L$dir -l$name" + deplibs="$deplibs -L$absdir -l$name" elif test "$hardcode_shlibpath_var" = yes; then case ":$compile_shlibpath:" in - *":$dir:"*) ;; - *) compile_shlibpath="$compile_shlibpath$dir:";; + *":$absdir:"*) ;; + *) compile_shlibpath="$compile_shlibpath$absdir:";; esac compile_command="$compile_command -l$name" deplibs="$deplibs -l$name" @@ -1719,8 +1695,12 @@ compiler." # 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}.* + $show "${rm}r $output_objdir/$outputname $output_objdir/$objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" + $run ${rm}r $output_objdir/$outputname $output_objdir/$objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* + + if test -z "$run" && test -f "$output_objdir/$objdir/$outputname"; then + $echo "$modename: warning: $output_objdir/$objdir/$outputname could not be removed" 1>&2 + fi else $show "$mkdir $output_objdir" $run $mkdir $output_objdir @@ -2005,7 +1985,7 @@ EOF linkopts="$linkopts $flag" fi - + # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then @@ -2021,10 +2001,10 @@ EOF done IFS="$save_ifs" if test -n "$export_symbols_regex"; then - $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"$export_symbols\"T" - $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "$export_symbols"T' - $show "$mv \"$export_symbols\"T \"$export_symbols\"" - $run eval '$mv "$export_symbols"T "$export_symbols"' + $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi @@ -2182,46 +2162,103 @@ EOF if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - # Put the magic libdir with the hardcode flag. - hardcode_libdirs="$libdir" - libdir="@HARDCODE_LIBDIRS@" - 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 - libdir= - fi - fi - - if test -n "$libdir"; then - eval flag=\"$hardcode_libdir_flag_spec\" + # This is the magic to use -rpath. + case "$compile_rpath " in + *" $libdir "*) ;; + *) compile_rpath="$compile_rpath $libdir" ;; + esac + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi - compile_command="$compile_command $flag" - finalize_command="$finalize_command $flag" + # Now hardcode the library paths + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + rpath= + hardcode_libdirs= + for libdir in $compile_rpath; do + # Skip directories that are in the system search path + case " $sys_lib_search_path " in + *" $libdir "*) continue ;; + *) ;; + esac + + 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\" - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac + rpath="$rpath $flag" fi - done - 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"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + # Skip directories that are in the system search path + case " $sys_lib_search_path " in + *" $libdir "*) continue ;; + *) ;; + esac + + 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\" - # Substitute the hardcoded libdirs into the compile commands. + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator"; then - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%@HARDCODE_BUILD_LIBDIRS@$hardcode_libdirs%g"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"` + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" fi + finalize_rpath="$rpath" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then @@ -2238,7 +2275,7 @@ EOF dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 @@ -2281,19 +2318,36 @@ extern \"C\" { /* External symbol declarations for the compiler. */\ " - if test "$dlself" = yes; then - if test -n "$export_symbols"; then - $run eval 'sed -e "s/^\(.*\)/\1 \1/" < "$export_symbols" > "$nlist"' - else - # Add our own program objects to the preloaded list. - progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done + # Prepare the list of exported symbols + if test "$dlself" = yes && test -z "$export_symbols"; then + $show "generating symbol list for \`$output'" + export_symbols="$objdir/$output.exp" + $run $rm $export_symbols + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$export_symbols'" + done + + if test -n "$exclude_expsyms"; then + $run eval 'egrep -v "^($exclude_expsyms)" "$export_symbols" > "${export_symbols}T"' + $run eval '$mv ${export_symbols}T $export_symbols' + fi + + if test -n "$export_symbols_regex"; then + $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi + if test "$dlself" = yes; then + $run eval 'sed -e "s/^\(.*\)/\1 \1/" < "$export_symbols" > "$nlist"' + fi + for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" @@ -2345,25 +2399,7 @@ lt_preloaded_symbols[] = # First entry is the program itself echo >> "$output_objdir/$dlsyms" "\ {\"@PROGRAM@\", (lt_ptr_t) 0}," - if test -n "$export_symbols"; then - sed 's/^\(.*\)/ {"\1", (lt_ptr_t) \&\1},/' < "$export_symbols" >> "$output_objdir/$dlsyms" - else - $rm "$nlist" - for arg in $progfiles; do - eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -f "$nlist"; then - if test -n "$exclude_expsyms"; then - egrep -v "^($exclude_expsyms) " "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - sed 's/^\(.*\) \(.*\)$/ {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms" - else - echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - fi + sed 's/^\(.*\)/ {"\1", (lt_ptr_t) \&\1},/' < "$export_symbols" >> "$output_objdir/$dlsyms" fi for arg in $dlprefiles; do @@ -2439,87 +2475,15 @@ static const void *lt_preloaded_setup() { if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g' -e 's%@BUILD_LIBDIRS_FLAGS@%%' -e 's%@HARDCODE_BUILD_LIBDIRS@%%'` + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. - $show "$compile_command" - $run eval "$compile_command" + $show "$link_command" + $run eval "$link_command" exit $? fi - # Create the binary in the object directory, then wrap it. - if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $objdir; then - exit $status - fi - fi - - if test "$shlibpath_overrides_runpath" != yes; then - build_libdirs_flags= - build_libdirs= - build_rpath= - - for libdir in $temp_rpath; do - case "$libdir" in - /* | [A-Za-z]:[/\\]*) - # Absolute path, ok. - ;; - *) - # Relative path: add a thisdir entry. - libdir="@THISDIR@/$libdir" - ;; - esac - - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$build_libdirs"; then - # Put the magic libdir with the hardcode flag. - case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - build_libdirs="$libdir$hardcode_libdir_separator" - ;; - esac - else - # Just accumulate the unique libdirs. - case "$hardcode_libdir_separator$build_libdirs$hardcode_libdirs$hardcode_libdir_separator" in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - build_libdirs="$build_libdirs$libdir$hardcode_libdir_separator" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - - build_libdirs_flags="$build_libdirs_flags $flag" - fi - - elif test -n "$runpath_var"; then - case ":$build_rpath" in - *":$libdir:"*) ;; - *) - case " $perm_rpath " in - *" $libdir "*) ;; - *) build_rpath="$build_rpath$libdir:" ;; - esac - ;; - esac - fi - done - - $run $rm "$output_objdir/$objdir/$outputname" - - if test -z "$run" && test -f "$output_objdir/$objdir/$outputname"; then - $echo "$modename: warning: $output_objdir/$objdir/$outputname could not be removed" 1>&2 - fi - fi - if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= @@ -2538,9 +2502,6 @@ static const void *lt_preloaded_setup() { 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" fi @@ -2548,6 +2509,8 @@ static const void *lt_preloaded_setup() { finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi + compile_var= + finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. @@ -2555,32 +2518,68 @@ static const void *lt_preloaded_setup() { for dir in $perm_rpath; do rpath="$rpath$dir:" done - compile_command="$runpath_var=\"@BUILD_RPATH@$rpath\$$runpath_var\" $compile_command" + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + # AGH! Flame the AIX and HP-UX people for me, will ya? $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 + elif test "$shlibpath_overrides_rpath" = yes; then + # Fast installation is not necessary + link_command="$finalize_var$compile_command$finalize_rpath" + relink_command= + else + if test "$fast_install" = yes; then + link_command="$finalize_var$compile_command$finalize_rpath" + relink_command="$compile_var$compile_command$compile_rpath" + relink_command=`echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi fi - if test "$shlibpath_overrides_runpath" != yes; then - compile_for_build_command=`echo "X$compile_command" | $Xsed -e "s%@BUILD_LIBDIRS_FLAGS@%$build_libdirs_flags%" -e "s%@BUILD_RPATH@%$build_rpath%" -e "s%@HARDCODE_BUILD_LIBDIRS@%$build_libdirs%" -e 's%@THISDIR@%\$thisdir%g' -e 's%@OUTPUT@%\$progdir/\$file%g'` + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Create the binary in the object directory, then wrap it. + if test ! -d $output_objdir; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test $status -ne 0 && test ! -d $objdir; then + exit $status + fi fi - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@BUILD_LIBDIRS_FLAGS@%%' -e 's%@BUILD_RPATH@%%' -e 's%@HARDCODE_BUILD_LIBDIRS@%%'` - finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'T%g'` + # Delete the old output file. + $run $rm $output - $show "$compile_command" - $run eval "$compile_command" || exit $? + $show "$link_command" + $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" - # Quote the finalize command for shipping. - finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"` + # Quote the relink command for shipping. + if test -n "$relink_command"; then + relink_command="cd `pwd`; $relink_command" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then @@ -2624,11 +2623,12 @@ sed_quote_subst='$sed_quote_subst' # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi +relink_command=\"$relink_command\" + # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: + # install mode needs the following variable: link_against_libtool_libs='$link_against_libtool_libs' - finalize_command=\"cd `pwd | sed -e $sed_quote_subst`; $finalize_command\" else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then @@ -2673,15 +2673,13 @@ else # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" +" - program='$outputname'" - - if test "$shlibpath_overrides_runpath" = yes; then - echo >> $output " progdir=\"\$thisdir/$objdir\"" - else + if test "$fast_install" = yes; then echo >> $output "\ - progdir=\"\$thisdir/$objdir/$objdir\" - + program='$outputname'T + progdir=\"\$thisdir/$objdir\" + if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then @@ -2696,11 +2694,13 @@ else echo >> $output "\ - # link executable that uses uninstalled libraries - if (cd \"\$thisdir\" && $compile_for_build_command); then : - else - $rm \"\$progdir/\$file\" - exit 1 + # relink executable if necessary + if test -n \"\$relink_command\"; then + if (cd \"\$thisdir\" && eval \$relink_command); then : + else + $rm \"\$progdir/\$file\" + exit 1 + fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || @@ -2708,6 +2708,11 @@ else $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" + else + echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" fi echo >> $output "\ @@ -3199,7 +3204,7 @@ libdir='$install_libdir'\ # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then link_against_libtool_libs= - finalize_command= + relink_command= # If there is no directory component, then add one. case "$file" in @@ -3208,7 +3213,7 @@ libdir='$install_libdir'\ esac # Check the variables that should have been set. - if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then + if test -z "$link_against_libtool_libs"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi @@ -3231,16 +3236,21 @@ libdir='$install_libdir'\ fi done - if test "$hardcode_action" = relink; then + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes; then + outputname="/tmp/$$-$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2 - $show "$finalize_command" - if $run eval "$finalize_command"; then : + $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 - file="$objdir/$file"T + file="$outputname" else $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2 fi @@ -3252,6 +3262,7 @@ libdir='$install_libdir'\ $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && $rm $outputname ;; esac done