diff --git a/ChangeLog b/ChangeLog index 15560e83..b995667e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 1999-01-11 Alexandre Oliva + * ltmain.in, NEWS, doc/libtool.texi: Added support for -R flag + * ltmain.in, doc/libtool.texi: documented that -rpath is the same + as -R for programs + * ltmain.in: softened the instructions for linking with installed + libraries, and noted that libtool can be used to link with them; + documented that -rpath is not required for convenience libraries + * ltconfig.in (symxfrm): don't print $pipe_works twice, once for each $ac_symprfx Reported by Godmar Back diff --git a/NEWS b/NEWS index bac6df3a..4feb92f9 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ NEWS - list of user-visible changes between releases of GNU Libtool New in 1.2e: CVS version: +* Support -R for specifying run-time path of programs and library dependencies * Support for BeOS * Improved support for Win32, SysV 4.3, BSD/OS 4.x and NetBSD * Various bugfixes diff --git a/doc/libtool.texi b/doc/libtool.texi index 0d4268af..e4b9fb31 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1195,7 +1195,14 @@ the @samp{-version-info} flag instead (@pxref{Versioning}). @item -rpath @var{libdir} If @var{output-file} is a library, it will eventually be installed in -@var{libdir}. +@var{libdir}. If @var{output-file} is a program, add @var{libdir} to +the run-time path of the program. + +@item -R @var{libdir} +If @var{output-file} is a program, add @var{libdir} to its run-time +path. If @var{output-file} is a library, add -R@var{libdir} to its +@var{dependency_libs}, so that, whenever the library is linked into a +program, @var{libdir} will be added to its run-time path. @item -static If @var{output-file} is a program, then do not link it against any diff --git a/ltmain.in b/ltmain.in index 7c91bad9..8bb3a846 100644 --- a/ltmain.in +++ b/ltmain.in @@ -629,6 +629,7 @@ compiler." prevarg= release= rpath= + xrpath= perm_rpath= temp_rpath= vinfo= @@ -694,6 +695,11 @@ compiler." prev= continue ;; + xrpath) + xrpath="$xrpath $arg" + prev= + continue + ;; *) eval "$prev=\"\$arg\"" prev= @@ -818,6 +824,16 @@ compiler." continue ;; + -R) + prev=xrpath + continue + ;; + + -R*) + xrpath="$xrpath "`echo "X$arg" | $Xsed -e 's/^-R//'` + continue + ;; + -static) # If we have no pic_flag, then this is the same as -all-static. if test -z "$pic_flag" && test -n "$link_static_flag"; then @@ -920,6 +936,18 @@ compiler." fi fi + if test -n "$dependency_libs"; then + # Extract -R from dependency_libs + temp_deplibs= + for arg in $dependency_libs; do + case "$arg" in + -R*) xrpath="$xrpath "`echo "X$arg" | $Xsed -e 's/^-R//'`;; + *) temp_deplibs="$temp_deplibs $arg";; + esac + done + dependency_libs="$temp_deplibs" + fi + if test -z "$libdir"; then # It is a libtool convenience library, so add in its objects. convenience="$convenience $dir/$old_library" @@ -1170,6 +1198,10 @@ compiler." $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi @@ -1210,6 +1242,14 @@ compiler." ;; esac + if test -n "$xrpath"; then + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + done + deplibs="$temp_xrpath $deplibs" + fi + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" @@ -1694,6 +1734,10 @@ EOF $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi @@ -1777,9 +1821,9 @@ EOF $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi - if test -n "$rpath"; then + if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. - for libdir in $rpath; do + 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 @@ -1971,7 +2015,9 @@ dld_preloaded_symbols[] = # We keep going just in case the user didn't refer to # dld_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + if test -n "$dlfiles$dlprefiles"; then + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` @@ -2754,10 +2800,10 @@ libdir='$install_libdir'\ echo " $libdir" done echo - echo "To link against installed libraries in a given directory, LIBDIR," - echo "you must use the \`-LLIBDIR' flag during linking." - echo - echo " You will also need to do at least one of the following:" + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" @@ -3142,6 +3188,7 @@ The following components of LINK-COMMAND are treated specially: -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] @@ -3152,8 +3199,9 @@ Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only -library objects (\`.lo' files) may be specified, and \`-rpath' is required. +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'.