mirror of
git://git.savannah.gnu.org/libtool.git
synced 2024-12-27 07:09:26 +08:00
5dfb0ce7e2
them as libtool modules. Currently loader-preopen.c is linked unconditionally and other appropriate loaders discovered by AC_LTDL_DLLIB are built and linked in: * libltdl/Makefile.am (libltdl_la_SOURCES): Add loader-preopen module. * m4/ltdl.m4 (AC_LTDL_DLLIB): Use AC_LIBOBJ to add appropriate loaders to libltdl. * libltdl/lt_system.h (LT_SCOPE): Moved to here. * libltdl/ltdl.h (lt_dlloader, lt_user_data, lt_module) (lt_module_open, lt_module_close, lt_find_sym, lt_dlloader_exit) (struct lt_user_dlloader, lt_dlloader_next, lt_dlloader_find) (lt_dlloader_name, lt_dlloader_data, lt_dlloader_add) (lt_dlloader_remove): Moved declarations... * libltdl/lt_loader.h: ...to here. * libltdl/ltdl.c: Include lt_loader.h. Move loader implementation code from here... * libltdl/loader-dld_link.c, libltdl/loader-dlopen.c, libltdl/loader-dyld.c, libltdl/loader-load_add_on.c, libltdl/loader-loadlibrary.c, libltdl/loader-preopen.c, libltdl/loader-shl_load.c: ...to here. * tests/cdemo/Makefile.am, tests/demo/Makefile.am, tests/depdemo/Makefile.am, tests/f77demo/Makefile.am, tests/mdemo/Makefile.am, tests/mdemo2/Makefile.am, tests/pdemo/Makefile.am, tests/tagdemo/Makefile.am (AM_CPPFLAGS): Add -I$(top_srcdir)/../.. so that libltdl include files can be written as #include <libltdl/lt_dlloader.h> and found correctly. |
||
---|---|---|
.. | ||
.cvsignore | ||
configure.ac | ||
foo1.c | ||
foo2.c | ||
foo.h | ||
main.c | ||
Makefile.am | ||
mlib.c | ||
README | ||
sub.c |
This is mdemo, an example package that uses GNU libtool with an Automake-generated environment to build two simple modules and a program. It demonstrates how to build both dynamic and static libraries that can be dlopened. mdemo uses libtool's portable dlopen wrapper called "libltdl". All exported symbols are prefixed with "libname_LTX_" to avoid symbols conflicts, especially when linking statically. libltdl will automatically cut the prefix off to get the real name. Note that on Windows, for the purposes of illustrating ltdl, the libraries *are* built as dll's, but do not have the __declspec machinery to make them suitable for loading at link time. This is only for clarity inside this example, look at the example in ../demo to see how the __declspec macros should be set up.