* ltmain.in (link mode) < -static-libtool-libs >: New option. * doc/libtool.texi (Link mode, Distributing libltdl): Document it. Suggested by Gary Kumfert . Index: ltmain.in =================================================================== RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v retrieving revision 1.334.2.118 diff -u -r1.334.2.118 ltmain.in --- ltmain.in 21 Jan 2006 16:46:08 -0000 1.334.2.118 +++ ltmain.in 23 Jan 2006 16:08:07 -0000 @@ -1145,8 +1145,9 @@ for arg do case $arg in - -all-static | -static) - if test "X$arg" = "X-all-static"; then + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi @@ -1154,12 +1155,20 @@ dlopen_self=$dlopen_self_static fi prefer_static_libs=yes - else + ;; + -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built - fi + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac build_libtool_libs=no build_old_libs=yes break @@ -1719,7 +1728,7 @@ continue ;; - -static) + -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects @@ -6782,9 +6791,9 @@ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE + try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX - try to export only the symbols matching REGEX + try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened @@ -6798,9 +6807,11 @@ -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 + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] + specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Index: doc/libtool.texi =================================================================== RCS file: /cvsroot/libtool/libtool/doc/libtool.texi,v retrieving revision 1.134.2.14 diff -u -r1.134.2.14 libtool.texi --- doc/libtool.texi 16 Dec 2005 18:11:47 -0000 1.134.2.14 +++ doc/libtool.texi 23 Jan 2006 16:08:08 -0000 @@ -1217,10 +1217,11 @@ @item -dlopen @var{file} Same as @samp{-dlpreopen @var{file}}, if native dlopening is not supported on the host platform (@pxref{Dlopened modules}) or if -the program is linked with @samp{-static} or @samp{-all-static}. -Otherwise, no effect. If @var{file} is @code{self} libtool will make -sure that the program can @code{dlopen} itself, either by enabling address@hidden or by falling back to @samp{-dlpreopen self}. +the program is linked with @samp{-static}, @samp{-static-libtool-libs}, +or @samp{-all-static}. Otherwise, no effect. If @var{file} is address@hidden libtool will make sure that the program can @code{dlopen} +itself, either by enabling @code{-export-dynamic} or by falling back to address@hidden self}. @item -dlpreopen @var{file} Link @var{file} into the output program, and add its symbols to @@ -1318,6 +1319,11 @@ uninstalled shared libtool libraries. If @var{output-file} is a library, then only create a static library. address@hidden -static-libtool-libs +If @var{output-file} is a program, then do not link it against any +shared libtool libraries (@samp{.la} files). If @var{output-file} is a +library, then only create a static library. + @item -version-info @var{current}[:@var{revision}[:@var{age}]] If @var{output-file} is a libtool library, use interface version information @var{current}, @var{revision}, and @var{age} to build it @@ -3592,9 +3598,10 @@ libtool will assume no dlopening mechanism is supported, and revert to dlpreopening, which is probably not what you want. -Avoid using the @code{-static} or @code{-all-static} switches when -linking programs with libltdl. This will not work on all platforms, -because the dlopening functions may not be available for static linking. +Avoid using the @code{-static}, @code{-static-libtool-libs} or address@hidden switches when linking programs with libltdl. This +will not work on all platforms, because the dlopening functions may not +be available for static linking. The following example shows you how to embed the convenience libltdl in your package. In order to use the installable variant just replace