mirror of
git://git.savannah.gnu.org/libtool.git
synced 2024-12-27 07:09:26 +08:00
07978fe161
* libltdl/Makefile.am (CFLAGS): ditto * libltdl/configure.in: check for memory.h, rindex() and dlpreopening. Fixed NEED_USCORE caching policy. * libltdl/ltdl.h (lt_dlsym): make the name argument const * libltdl/ltdl.c (types): new variable: head of list of available dlopening mechanisms (lt_dltype_t): interface of a dlopening mechanism, with pointers to functions for init, exit, open, close and sym (lt_dlhandle_t): added pointer to interface type (strdup): don't name it strdup; it can be troublesome (strrchr): ditto; use rindex if available (LIBTOOL_STATIC): check HAVE_DLPREOPEN instead, and move to the end of the file, so that it becomes the header of the list (all): renamed all interface-implementation functions, to avoid name clashes, and created lt_dltype_t nodes for all of them (lt_dlinit): initialize all available interfaces; remove those that fail from the list. Return failure only if no interfaces could be initialized. (lt_dlexit): return number of failures (tryall_dlopen): try to open the library with all available interfaces (lt_dlopen): use tryall_dlopen; increased size of fixed buffers. We should probably make these bound-checked or dynamically allocated for the final release! Fix bug when filename did not contain slashes; should we check for `\\' too? Try old_library if everything else fails. (lt_dlclose): use the interface type for closing (lt_dlsym): make `symbol' const, use interface type for looking up * mdemo/Makefile.am: moved mdemo/modules/* back into mdemo (SUBDIRS): removed (libfoo2_la_LDFLAGS): added -static; nice test. However, since it causes -lm to linked into hell*, it causes tests that should fail to pass (noinst_HEADERS): no need to install foo.h * mdemo/configure.in: remove modules/Makefile tests/mdemo-exec.test: updated accordingly
37 lines
1.1 KiB
Makefile
37 lines
1.1 KiB
Makefile
# A brief demonstration of using Automake with Libtool. -*-Makefile-*-
|
|
#
|
|
# NOTE: Don't forget that in the libtool distribution, files in this
|
|
# directory are distributed by the demo_distfiles variable in the top
|
|
# level Makefile.
|
|
AUTOMAKE_OPTIONS = no-dependencies foreign
|
|
|
|
INCLUDES = -I$(srcdir)/../libltdl
|
|
|
|
EXTRA_DIST = acinclude.m4
|
|
|
|
lib_LTLIBRARIES = libfoo1.la libfoo2.la
|
|
|
|
libfoo1_la_SOURCES = foo1.c
|
|
libfoo1_la_LDFLAGS = -lm -module
|
|
|
|
libfoo2_la_SOURCES = foo2.c
|
|
libfoo2_la_LDFLAGS = -lm -module -static
|
|
|
|
noinst_HEADERS = foo.h
|
|
|
|
bin_PROGRAMS = hell hell.debug
|
|
|
|
# Create a version of hell that does dlopen.
|
|
hell_SOURCES = main.c
|
|
hell_LDADD = ../libltdl/libltdl.la \
|
|
-lm # We won't need this when libltdl takes care of dependencies
|
|
hell_LDFLAGS = -export-dynamic -dlopen libfoo1.la -dlopen libfoo2.la
|
|
hell_DEPENDENCIES = ../libltdl/libltdl.la libfoo1.la libfoo2.la
|
|
|
|
# Create an easier-to-debug version of hell.
|
|
hell_debug_SOURCES = main.c
|
|
hell_debug_LDADD = ../libltdl/libltdl.la
|
|
hell_debug_LDFLAGS = -static -export-dynamic \
|
|
-dlopen libfoo1.la -dlopen libfoo2.la
|
|
hell_DEPENDENCIES = ../libltdl/libltdl.la libfoo1.la libfoo2.la
|