* libltdl/config/ltmain.m4sh (func_mode_link) < -static-libtool-libs >: New option. * doc/libtool.texi (Link mode, Distributing libltdl): Document it. Suggested by Gary Kumfert . Index: doc/libtool.texi =================================================================== RCS file: /cvsroot/libtool/libtool/doc/libtool.texi,v retrieving revision 1.208 diff -u -r1.208 libtool.texi --- doc/libtool.texi 4 Dec 2005 17:57:46 -0000 1.208 +++ doc/libtool.texi 23 Jan 2006 17:36:15 -0000 @@ -1332,9 +1332,10 @@ @item -dlopen @var{file} Same as @option{-dlpreopen @var{file}}, if native dlopening is not supported on the host platform (@pxref{Dlopened modules}) or if -the program is linked with @option{-static} or @option{-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 +the program is linked with @option{-static}, address@hidden, or @option{-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 @option{-export-dynamic} or by falling back to @option{-dlpreopen self}. @item -dlpreopen @var{file} @@ -1440,6 +1441,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. 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 @@ -4419,7 +4425,8 @@ You should probably also use the @samp{dlopen} option to @code{LT_INIT} in your @file{configure.ac}, otherwise libtool will assume no dlopening mechanism is supported, and revert to dlpreopening, which is probably not -what you want. Avoid using the @option{-static} or @option{-all-static} +what you want. Avoid using the @option{-static}, address@hidden, or @option{-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. Index: libltdl/config/ltmain.m4sh =================================================================== RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v retrieving revision 1.30 diff -u -r1.30 ltmain.m4sh --- libltdl/config/ltmain.m4sh 21 Jan 2006 16:44:41 -0000 1.30 +++ libltdl/config/ltmain.m4sh 23 Jan 2006 17:36:15 -0000 @@ -331,9 +331,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 @@ -349,9 +349,11 @@ -R[[ ]]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension - -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]] -weak LIBNAME declare that the target provides the LIBNAME interface All other options (arguments beginning with \`-') are ignored. @@ -2230,8 +2232,9 @@ build_old_libs=no break ;; - -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 func_warning "complete static linking is impossible in this configuration" fi @@ -2242,12 +2245,20 @@ finalize_command="$finalize_command $link_static_flag" 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 @@ -2768,7 +2779,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