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
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.
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
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'
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*)
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
;;
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
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\"\`\\\""
;;
# 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"
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
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