]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltconfig.in (sys_lib_dlsearch_path_spec): new variable, that
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Sat, 13 Mar 1999 23:09:57 +0000 (23:09 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Sat, 13 Mar 1999 23:09:57 +0000 (23:09 +0000)
lists the system *run-time* search path.  Listed directories are
not implicitly hard-coded into executables.
* ltmain.in: use it, but *never* discard -R flags
* doc/libtool.texi: document it
* NEWS: ditto
Reported by Bob Friesenhahn <bfriesen@simple.dallas.tx.us>

ChangeLog
NEWS
doc/libtool.texi
ltconfig.in
ltmain.in

index a5ba5d24bfdd2c5f1ea093d83fa5ff3d1c3530ed..6fc12b13c4303554e7fcfa6d9ef687354b94dcf6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 1999-03-13  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * ltconfig.in (sys_lib_dlsearch_path_spec): new variable, that
+       lists the system *run-time* search path.  Listed directories are
+       not implicitly hard-coded into executables.
+       * ltmain.in: use it, but *never* discard -R flags
+       * doc/libtool.texi: document it
+       * NEWS: ditto
+       Reported by Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
        * tests/sh.test: look for `$Xsed' without `$echo "X...' 
        * ltconfig.in, ltmain.in: fixed a few such occurrences
 
diff --git a/NEWS b/NEWS
index 9b18388a96e20450dd270c6e23f116b4671fdf2b..39796ad4a7e6583a041d945c4bdd3e2dda0355fa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,8 @@ NEWS - list of user-visible changes between releases of GNU Libtool
 New in 1.2e: CVS version; 1.2f: 1999-?-?, Libtool team:
 * libtool will correctly link uninstalled libraries into programs
   and prefer uninstalled libraries to installed ones
-* Library paths that are in the system search path are no longer hardcoded.
+* Library paths that are in the system default run-time search path
+  are no longer hardcoded into executables.
 * New fast installation mode, which links the final executable
   in order to avoid relinking during installation.
   Programs in the build-tree are relinked when executed.
index 93a38767bb381bce1196385d9a7b34adfaa4b0f6..18d365be0538f242767937dc95734585bd065e97 100644 (file)
@@ -3675,10 +3675,19 @@ The name coded into shared libraries, if different from the real name of
 the file.
 @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.
+@end defvar
+
 @defvar sys_lib_search_path_spec
-Expression to get the system library search path.  The directories
-listed in @var{shlibpath_var} are automatically appended to this list,
-every time libtool runs (i.e., not at configuration time).
+Expression to get the compile-time system library search path.  This
+variable is used by libtool when it has to test whether a certain
+library is shared or static.  The directories listed in
+@var{shlibpath_var} are automatically appended to this list, every time
+libtool runs (i.e., not at configuration time), because some linkers use
+this variable to extend the library search path.  Linker switches such
+as @code{-L} also augment the search path.
 @end defvar
 
 @defvar version_type
index ecb2c6ec5e97d673c687e5a0ef7c68175963b09f..519ebd93eb073112993d0ba009cad6fe71d24dfe 100755 (executable)
@@ -1568,6 +1568,7 @@ shlibpath_var=
 shlibpath_overrides_runpath=unknown
 version_type=none
 dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 file_magic_cmd=
 deplibs_check_method='unknown'
@@ -1624,6 +1625,7 @@ bsdi4*)
   shlibpath_var=LD_LIBRARY_PATH
   deplibs_check_method='file_magic ELF 32-bit LSB shared object'
   sys_lib_search_path="/shlib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path="/shlib /usr/lib" # /usr/local/lib?
   ;;
 
 cygwin* | mingw*)
@@ -1710,7 +1712,12 @@ irix6*)
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
+  # even though /usr/local/lib is always searched, the man-page says
+  # shared libraries should not be installed there if they use an ABI
+  # different from -32, so we'd better not search for shared libraries
+  # there either
   sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
   deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" # or should it be pass_all?
   file_magic_cmd=file
   ;;
@@ -2364,7 +2371,7 @@ case "$ltmain" in
     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_search_path_spec sys_lib_dlsearch_path_spec \
     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
 
     case "$var" in
@@ -2372,7 +2379,7 @@ case "$ltmain" in
     old_postinstall_cmds | old_postuninstall_cmds | \
     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
     postinstall_cmds | postuninstall_cmds | \
-    finish_cmds | sys_lib_search_path_spec)
+    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
       # Double-quote double-evaled strings.
       eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
       ;;
@@ -2646,9 +2653,12 @@ hardcode_minus_L=$hardcode_minus_L
 # the resulting binary.
 hardcode_shlibpath_var=$hardcode_shlibpath_var
 
-# System search path for libraries
+# Compile-time system search path for libraries
 sys_lib_search_path_spec=$sys_lib_search_path_spec
 
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
+
 # Fix the shell variable \$srcfile for the compiler.
 fix_srcfile_path="$fix_srcfile_path"
 
index dc98e72209aa2b37ee5653ef20f9a1f9524c60fb..fab68d8b04ae52dd8324a8580f3c3a1fe44997cf 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -2173,13 +2173,18 @@ EOF
       fi
 
       # Now hardcode the library paths
-      eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+      eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
       rpath=
       hardcode_libdirs=
       for libdir in $compile_rpath $finalize_rpath; do
-       # Skip directories that are in the system search path
-       case " $sys_lib_search_path " in
-       *" $libdir "*) continue ;;
+       # Skip directories that are in the system default run-time
+       # search path, unless they have been requested with -R.
+       case " $sys_lib_dlsearch_path " in
+       *" $libdir "*)
+         case " $xrpath " in
+         *" $libdir "*) ;;
+         *) continue ;;
+         esac
        *) ;;
        esac
        
@@ -2220,9 +2225,13 @@ EOF
       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 ;;
+       # Skip directories that are in the system default run-time
+       # search path, unless they have been requested with -R.
+       case " $sys_lib_dlsearch_path " in
+       *" $libdir "*)
+         case " $xrpath " in
+         *" $libdir "*) ;;
+         *) continue ;;
        *) ;;
        esac