From bb68bc18379fb91f9ea39a5bb4870a05e1f7516a Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Thu, 27 Nov 2014 12:45:44 +0000 Subject: [PATCH] modules: clean up no-longer supported preloading references. * doc/m4.texi: Remove references to preloaded modules. * configure.ac (Preloaded module configuration): Remove. * Makefile.am (src_m4_LDFLAGS): Remove. DLPREOPEN no longer set. (src_m4_DEPENDENCIES): Remove PREOPEN_DEPENDENCIES reference. * tests/atlocal.in (DYNAMIC_MODULES): Remove. * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): Remove. * tests/builtins.at, tests/modules.at: Remove references to removed AT_CHECK_DYNAMIC_MODULE. * tests/generate.awk: Don't generate AT_CHECK_DYNAMIC_MODULE calls. Signed-off-by: Gary V. Vaughan --- Makefile.am | 3 +-- configure.ac | 40 --------------------------------------- doc/m4.texi | 55 ++++++++++++------------------------------------------ tests/atlocal.in | 1 - tests/builtins.at | 1 - tests/generate.awk | 2 -- tests/modules.at | 6 ------ tests/testsuite.at | 11 ----------- 8 files changed, 13 insertions(+), 106 deletions(-) diff --git a/Makefile.am b/Makefile.am index 10a5eab3..86561a85 100644 --- a/Makefile.am +++ b/Makefile.am @@ -142,9 +142,8 @@ if STACKOVF src_m4_SOURCES += src/stackovf.c endif src_m4_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -I$(srcdir)/src -src_m4_LDFLAGS = $(AM_LDFLAGS) $(DLPREOPEN) src_m4_LDADD = m4/libm4.la $(LTLIBICONV) $(LTLIBTHREAD) -src_m4_DEPENDENCIES = $(PREOPEN_DEPENDENCIES) m4/libm4.la +src_m4_DEPENDENCIES = m4/libm4.la ## ## ## --- PASTED MANUALLY FROM GNULIB --- ## diff --git a/configure.ac b/configure.ac index 2688a7f1..9b336c70 100644 --- a/configure.ac +++ b/configure.ac @@ -271,46 +271,6 @@ AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ['$PATH_SEPARATOR'], [Define this to system search path delimiter]) -## ------------------------------- ## -## Preloaded module configuration. ## -## ------------------------------- ## -AS_IF([test "x$enable_shared" != xno], - [DYNAMIC_MODULES=yes], [DYNAMIC_MODULES=no]) -AC_SUBST([DYNAMIC_MODULES], [$DYNAMIC_MODULES]) - -AC_MSG_CHECKING([for modules to preload]) - DLPREOPEN= - - AC_ARG_WITH([modules], - [AS_HELP_STRING([--with-modules=MODULES], - [preload MODULES @<:@default: ]M4_DEFAULT_PRELOAD[@:>@])], - [use_modules="$withval"], - [use_modules="$M4_default_preload"]) - - PREOPEN_DEPENDENCIES= - DLPREOPEN="-dlpreopen force" - if test -z "$use_modules"; then - use_modules=none - else - if test "$use_modules" != yes; then - for module in $use_modules; do - case $module in - no|none) break ;; - m4|traditional|gnu|load|mpeval) dir=modules ;; - import|modtest|shadow|stdlib|time) dir=tests ;; - *) AC_MSG_ERROR([Unrecognized module `$module' in --with-modules]) - ;; - esac - DLPREOPEN="$DLPREOPEN -dlpreopen $dir/$module.la" - PREOPEN_DEPENDENCIES="$PREOPEN_DEPENDENCIES $dir/$module.la" - done - fi - fi -AC_MSG_RESULT([$use_modules]) -AC_SUBST([DLPREOPEN]) -AC_SUBST([PREOPEN_DEPENDENCIES]) - - ## ---------------- ## ## Gettext support. ## ## ---------------- ## diff --git a/doc/m4.texi b/doc/m4.texi index e09f3c40..ba1b1576 100644 --- a/doc/m4.texi +++ b/doc/m4.texi @@ -6587,16 +6587,11 @@ could be added only by writing more code in the M4 language, or at the extreme by hacking the sources and recompiling the whole thing to make a custom M4 installation. -Starting with release 2.0, M4 uses Libtool's @code{libltdl} facilities -(@pxref{Using libltdl, , libltdl, libtool, The GNU Libtool Manual}) -to move all of M4's builtins out to pluggable modules. Unless compile -time options are set to change the default build, the installed M4 2.0 -binary is virtually identical to 1.4.x, supporting the same builtins. -However, additional modules can be loaded into the running M4 interpreter -as it is started up at the command line, or during normal expansion of -macros. This facilitates runtime extension of the M4 builtin macro -list using compiled C code linked against a new shared library, -typically named @file{libm4.so}. +Starting with release 2.0, M4 supports and is composed of loadable modules. +Additional modules can be loaded into the running M4 interpreter as it is +started up at the command line, or during normal expansion of macros. This +facilitates runtime extension of the M4 builtin macro list using compiled C +code linked against a new shared library, typically named @file{libm4.so}. For example, you might want to add a @code{setenv} builtin to M4, to use before invoking @code{esyscmd}. We might write a @file{setenv.c} @@ -6655,27 +6650,11 @@ setenv(`PATH', `/sbin:/bin:/usr/sbin:/usr/bin') @result{} @end example -Also, at build time, you can choose which modules to build into -the core (so that they will be available without dynamic loading). -SUSv3 M4 functionality is contained in the module @samp{m4}, GNU -extensions in the module @samp{gnu}, additional module builtins in the -module @samp{load} and so on. - -We hinted earlier that the @code{m4} and @code{gnu} modules are -preloaded into the installed M4 binary, but it is possible to install -a @emph{thinner} binary; for example, omitting the GNU -extensions by configuring the distribution with @kbd{./configure ---with-modules=m4}. For a binary built with that option to understand -code that uses GNU extensions, you must then run @kbd{m4 gnu}. -It is also possible to build a @emph{fatter} binary with additional -modules preloaded: adding, say, the @code{load} module using -@kbd{./configure --with-modules="m4 gnu load"}. - -GNU M4 now has a facility for defining additional builtins without -recompiling the sources. In actual fact, all of the builtins provided -by GNU M4 are loaded from such modules. All of the builtin -descriptions in this manual are annotated with the module from which -they are loaded -- mostly from the module @samp{m4}. +Also, at run time, you can choose which core modules to load. SUSv3 M4 +functionality is contained in the module @samp{m4}, GNU extensions in the +module @samp{gnu}, and so on. All of the builtin descriptions in this manual +are annotated with the module from which they are loaded -- mostly from the +module @samp{m4}. When you start GNU M4, the modules @samp{m4} and @samp{gnu} are loaded by default. If you supply the @option{-G} option at startup, the @@ -6698,8 +6677,8 @@ a module multiple times will not affect the order of this list, the position depends on when the module was @emph{first} loaded. @end deffn -For example, if GNU @code{m4} is started with the -@option{load} module, @code{m4modules} will yield the following: +For example, after GNU @code{m4} is started with no additional modules, +@code{m4modules} will yield the following: @example $ @kbd{m4} @@ -6751,16 +6730,6 @@ Expands to the empty string, as an indication that the @samp{traditional} module is loaded. @end deffn -@item load -This module supplies the builtins for advanced use of modules from within a -GNU @code{m4} program. @xref{Modules}, for more details. The -module also defines the following macro: - -@deffn {Macro (load)} __load__ -Expands to the empty string, as an indication that the @samp{load} -module is loaded. -@end deffn - @item mpeval This module provides the implementation for the experimental @code{mpeval} feature. If the host machine does not have the diff --git a/tests/atlocal.in b/tests/atlocal.in index 119898e1..84cd9ea7 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -21,7 +21,6 @@ # Some tests cannot be performed with all the configurations. USE_GMP=@USE_GMP@ -DYNAMIC_MODULES=@DYNAMIC_MODULES@ # Prefer tools learned during configure. SED='@SED@' diff --git a/tests/builtins.at b/tests/builtins.at index 5b17a867..8bda542e 100644 --- a/tests/builtins.at +++ b/tests/builtins.at @@ -806,7 +806,6 @@ AT_CLEANUP ## ------ ## AT_SETUP([mpeval]) -AT_CHECK_DYNAMIC_MODULE AT_CHECK_GMP AT_DATA([[in]], diff --git a/tests/generate.awk b/tests/generate.awk index a80d499a..f0ee5a7a 100755 --- a/tests/generate.awk +++ b/tests/generate.awk @@ -173,8 +173,6 @@ function new_test(input, status, output, error, options, xfail, examples) { if (error == "ignore\n") error = "ignore"; - if (options ~ / (import|load|modtest|mpeval|perl|shadow|stdlib|time)/) - printf ("AT_CHECK_DYNAMIC_MODULE\n"); if (options ~ / mpeval/) printf ("AT_CHECK_GMP\n"); if (xfail == 1) diff --git a/tests/modules.at b/tests/modules.at index f5d28b70..9320ce48 100644 --- a/tests/modules.at +++ b/tests/modules.at @@ -27,7 +27,6 @@ AT_BANNER([Module support.]) AT_SETUP([Freezing modules]) AT_KEYWORDS([frozen]) -AT_CHECK_DYNAMIC_MODULE AT_DATA([[frozen.m4]], [[divert(1)dnl @@ -78,7 +77,6 @@ AT_CLEANUP([frozen.m4f]) # or M4-OPTIONS set to pick up test modules. m4_define([AT_CHECK_M4_MODTEST], [AT_SETUP([$1]) -AT_CHECK_DYNAMIC_MODULE AT_DATA([input.m4], [[test @@ -130,7 +128,6 @@ AT_CHECK_M4_MODTEST([M4PATH: relative path], ## ------ ## AT_SETUP([modules: shadow]) -AT_CHECK_DYNAMIC_MODULE AT_DATA([[input.m4]], [[# no modules loaded yet @@ -233,7 +230,6 @@ AT_CLEANUP # from the first command: AT_SETUP([modules: importing]) -AT_CHECK_DYNAMIC_MODULE AT_DATA([[input.m4]], [[import @@ -278,7 +274,6 @@ AT_CLEANUP # Support text macros with requested numbers of parameters. AT_SETUP([modules: text]) -AT_CHECK_DYNAMIC_MODULE AT_DATA([input.m4], [[__test__ @@ -320,7 +315,6 @@ AT_CLEANUP # memory and then redefined by a subsequent load. AT_SETUP([modules: trace]) -AT_CHECK_DYNAMIC_MODULE AT_DATA([[input.m4]], [[test diff --git a/tests/testsuite.at b/tests/testsuite.at index aad7f0d0..a7cdfc47 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -141,17 +141,6 @@ m4_pattern_allow([^dnl$]) # We exercise m4. AT_TESTED([m4]) -# AT_CHECK_DYNAMIC_MODULE -# ----------------------- -# Add keyword `module' to the test, and skip the test if dynamic -# modules were disabled at configure time. -m4_define([AT_CHECK_DYNAMIC_MODULE], -[AT_KEYWORDS([module]) -AT_CHECK([if test "x$DYNAMIC_MODULES" = xno ; then - echo Dynamic module support not detected, skipping this test. - exit 77 -fi])]) - # AT_CHECK_GMP # ----------------------- # Add keyword `gmp' to the test, and skip the test if the use of GMP -- 2.11.4.GIT