From 1c3b55c7032ba07787b6d81f52a19a91bb0c4cb0 Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Fri, 11 Dec 1998 23:21:03 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 8 +++++++ doc/libtool.texi | 46 ++++++++++++++++++++++++++++++++++++++- ltmain.in | 19 +++++++++++----- mdemo/Makefile.am | 3 +-- mdemo/modules/Makefile.am | 4 ++-- 5 files changed, 69 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index cbf69f7d..2833ca5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +1998-12-11 Thomas Tanner + + * ltmain.in: -module implies now -export-dynamic, + dlpreopen files if we're linking statically + * doc/libtool.texi (link flags): added documentation for -module + and the tests for mdemo and libltdl + * mdemo/Makefile.am: replaced -dlpreopen with -dlopen + 1998-12-09 Alexandre Oliva * PORTING: removed the text Akim Demaille converted to .texi diff --git a/doc/libtool.texi b/doc/libtool.texi index 7d1912ed..36cf6c8f 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1163,6 +1163,12 @@ installed. This option is required even when @var{output-file} is not an executable. +@item -module +Creates a library that can be dlopenend (@pxref{Dlopened modules}). +This option doesn't work for programs and must not be used +together with @samp{-export-symbols}. +It implies the option @samp{-export-dynamic}. + @item -no-undefined Declare that @var{output-file} does not depend on any other libraries. Some platforms cannot create shared libraries that depend on other @@ -2376,7 +2382,7 @@ in @var{dld_preloaded_symbols}. @cindex names of dynamic modules @cindex dynamic modules, names -After a library has been linked with @samp{-export-dynamic}, it can be dlopened. +After a library has been linked with @samp{-module}, it can be dlopened. Unfortunately, because of the variation in library names, your package needs to determine the correct file to dlopen. @@ -2562,6 +2568,44 @@ uninstalled correctly. The @file{demo} subdirectory contains a demonstration of a trivial package that uses libtool. +@item libltdl-conf.test +@itemx libltdl-inst.test +@itemx libltdl-make.test +@itemx libltdl-unst.test +@pindex libltdl-conf.test +@pindex libltdl-inst.test +@pindex libltdl-make.test +@pindex libltdl-unst.test +These programs check to see that the @file{libltdl} subdirectory of the +libtool distribution can be configured, built, installed, and +uninstalled correctly. + +The @file{libltdl} subdirectory contains the library 'libltdl', +which provides a dlopen wrapper for various platforms +(Linux, Solaris, HP/UX, Win32 etc.) including support for dlpreopened modules +(@pxref{Dlpreopening}). + +@item mdemo-conf.test +@itemx mdemo-exec.test +@itemx mdemo-inst.test +@itemx mdemo-make.test +@itemx mdemo-unst.test +@pindex mdemo-conf.test +@pindex mdemo-exec.test +@pindex mdemo-inst.test +@pindex mdemo-make.test +@pindex mdemo-unst.test +These programs check to see that the @file{mdemo} subdirectory of the +libtool distribution can be configured, built, installed, and +uninstalled correctly. + +The @file{mdemo} subdirectory contains a demonstration of a package that +uses libtool and the system independent dlopen wrapper 'libltdl' to load +modules. + +NOTE: The tests @file{mdemo-exec.test} and @file{mdemo-inst.test} are known +to fail on platforms that do not support inter-library dependencies. + @item hardcode.test @pindex hardcode.test On all systems with shared libraries, the location of the library can be diff --git a/ltmain.in b/ltmain.in index b847d6ec..3f9b9241 100644 --- a/ltmain.in +++ b/ltmain.in @@ -734,8 +734,14 @@ compiler." -l*) deplibs="$deplibs $arg" ;; -module) - module=yes - continue + if test "$module" != yes; then + module=yes + if test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + else + arg= + fi + fi ;; -no-undefined) @@ -870,8 +876,9 @@ compiler." # This library was specified with -dlopen. if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" - if test -z "$dlname"; then - # If there is no dlname, we need to preload. + if test -z "$dlname" || test "$build_libtool_libs" = no; then + # If there is no dlname or we're linking statically, + # we need to preload. prev=dlprefiles else # We should not create a dependency on this library, but we @@ -1565,8 +1572,8 @@ EOF fi done - # If -export-dynamic was specified, set the dlname. - if test "$export_dynamic" = yes; then + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi diff --git a/mdemo/Makefile.am b/mdemo/Makefile.am index f6c2ef47..ac71f75d 100644 --- a/mdemo/Makefile.am +++ b/mdemo/Makefile.am @@ -24,5 +24,4 @@ hell_DEPENDENCIES = modules/libfoo1.la modules/libfoo2.la hell_debug_SOURCES = main.c hell_debug_LDADD = ../libltdl/libltdl.la hell_debug_LDFLAGS = -static -export-dynamic \ - -dlpreopen modules/libfoo1.la -dlpreopen modules/libfoo2.la -# Shouldn't this be the same as -dlopen, since we're linking statically? + -dlopen modules/libfoo1.la -dlopen modules/libfoo2.la diff --git a/mdemo/modules/Makefile.am b/mdemo/modules/Makefile.am index 0257a983..6c0d27d7 100644 --- a/mdemo/modules/Makefile.am +++ b/mdemo/modules/Makefile.am @@ -10,9 +10,9 @@ INCLUDES = -I$(srcdir)/../../libltdl lib_LTLIBRARIES = libfoo1.la libfoo2.la libfoo1_la_SOURCES = foo1.c -libfoo1_la_LDFLAGS = -export-dynamic -lm -module +libfoo1_la_LDFLAGS = -lm -module libfoo2_la_SOURCES = foo2.c -libfoo2_la_LDFLAGS = -export-dynamic -lm -module +libfoo2_la_LDFLAGS = -lm -module include_HEADERS = foo.h