diff options
author | Gary V. Vaughan <gary@gnu.org> | 2013-09-21 23:11:09 +0700 |
---|---|---|
committer | Gary V. Vaughan <gary@gnu.org> | 2013-09-21 23:11:09 +0700 |
commit | 64d44150bc5c9af45051371550f9917027e0fa41 (patch) | |
tree | b3d1f15311909b2ff0ac89341346b2297e3299db /m4/m4private.h | |
parent | 7781a595d8236fe0cc6bd2f2fdd2d67c5707eb50 (diff) | |
download | m4-64d44150bc5c9af45051371550f9917027e0fa41.tar.gz |
modules: huge simplification of module loading without libltdl.
Libltdl is huge and slow, and carrying the weight of support for
decades old systems. We can do much better using POSIX dlopen
and dlsym directly, simplifying and speeding up as we do so.
* configure.ac (LT_CONFIG_LTDL_DIR, LTDL_INIT): Remove.
(M4_DEFAULT_PRELOAD): Set to ""; we lost preload support along
with removing libltdl.
* Makefile.am: Don't include ltdl/Makefile.inc.
(AM_CPPFLAGS): Manually add current directory to include search
paths.
* m4/m4private.h (includes): Remove ltdl.h.
(INIT_SYMBOL, m4__module_init): Remove.
(struct m4_module): Change handle type from lt_dlhandle to void *.
* m4/m4module.h (M4INIT_HANDLER): Remove.
* m4/module.c (includes): Add dlfcn.h.
(m4__module_interface, iface_id, m4__module_init, module_dlerror):
Remove.
(m4__module_open): Drastically simplified without all the
libltdl setup and interface id twiddling. Just call dlopen to
get a native handle, and the dlsym to get the init function.
(m4_module_import): Similarly wrt dlsym.
* m4/path.c (FILE_SUFFIXES): Replace .la and LT_MODULE_EXT with
hardcoded ".so".
(m4_load_filename): Likewise.
* modules/gnu.c: Remove libltdl preprocessor symbol renaming,
and use "include_<modulename>" as the single entry point function.
* modules/import.c, modules/m4.c, modules/modtest.c,
modules/mpeval.c, modules/shadow.c, modules/stdlib.c,
modules/time.c, modules/traditional.c: Likewise.
* main.c (main): Remove calls to m4__module_init and
LTDL_SET_PRELOADED_SYMBOLS.
* tests/m4.in: Make sure we always have the modules/.libs and
tests/.libs directories at the front of M4PATH so that the
tests will find the modules they need to include.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Diffstat (limited to 'm4/m4private.h')
-rw-r--r-- | m4/m4private.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/m4/m4private.h b/m4/m4private.h index 926df58f..452496da 100644 --- a/m4/m4private.h +++ b/m4/m4private.h @@ -22,7 +22,6 @@ #define M4PRIVATE_H 1 #include <m4/m4module.h> -#include <ltdl.h> #include "cloexec.h" #include "quotearg.h" @@ -175,20 +174,17 @@ extern void m4__builtin_print (m4_obstack *, const m4__builtin *, bool, /* --- MODULE MANAGEMENT --- */ -#define INIT_SYMBOL "m4_init_module" - /* Representation of a loaded m4 module. */ struct m4_module { const char *name; /* Name of the module. */ - lt_dlhandle handle; /* All ltdl module information. */ + void *handle; /* System module handle. */ m4__builtin *builtins; /* Sorted array of builtins. */ m4_macro *macros; /* Unsorted array of macros. */ size_t builtins_len; /* Number of builtins. */ m4_module *next; }; -extern void m4__module_init (m4 *context); extern m4_module * m4__module_open (m4 *context, const char *name, m4_obstack *obs); extern m4_module * m4__module_find (m4 *context, const char *name); |