* doc/m4.texinfo (Modules): RMS asked me for an explanation of
[m4/ericb.git] / ChangeLog
blobf59e1d33e456472f9149d5b30175a086a07cf52d
1 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
3         * doc/m4.texinfo (Modules):  RMS asked me for an explanation of
4         the modular architecture of M4.  The result is paraphrased here
5         for the benefit of future readers of the manual.
7 2006-07-14  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
9         * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
11 2006-07-14  Eric Blake  <ebb9@byu.net>
13         * src/main.c (main): Avoid compiler warning.
14         * modules/gnu.c (renamesyms): Remove unused variable.
16 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
18         * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
19         (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
20         new functions for managing regexp syntax options.
21         * m4/m4private.h (m4): Add regexp_syntax field.
22         * m4/resyntax.c: New file implements the above.
23         * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
24         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
25         (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
26         (m4_patsubst_do, m4_renamesyms_do): Removed.
27         (builtin_changeresyntax): New builtin to change regular expression
28         syntax.
29         (m4_resyntax_encode_safe): Factor out diagnostics code.
30         * src/freeze.c (produce_resyntax_dump): New function to dump
31         default regexp syntax specifier to frozen file.
32         (reload_frozen_state): Updated to action 'R' directive.
33         * src/main.c (usage): Describe new -r option.
34         (long_options, OPTSTRING): Declare it.
35         (main): Encode and store cli regexp syntax option argument.
36         * tests/freeze.at (regexp syntax): New test that regexp syntax
37         survives freezing.
38         * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
39         * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
40         (Epatsubst and Patsubst): Renamed to...
41         (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
42         documentation and added new examples.
43         (Changeresyntax): New section describing changeresyntax builtin,
44         and regexp syntax names.
45         (Regular expression syntax): New section describing differences
46         between various regular expression syntaxes.
47         (Frozen files): Document 'R' directive.
48         * NEWS: Updated.
50 2006-07-13  Gary V. Vaughan  <gary@gnu.org>
52         * bootstrap: Enhanced to work more like our other scripts:
53         Add a copyright statement; support --version and --help; accept a
54         --download-po option with argument as a substitute for DOWNLOAD_PO
55         in the environment.
57 2006-07-11  Eric Blake  <ebb9@byu.net>
59         * Makefile.am (doc/m4.1): Port patch from branch that avoids
60         intermediate file.
61         * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
62         changed.
64 2006-07-10  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
66         * tests/builtin.at (patsubst, regexp):  Adjust these tests, now
67         that `\0' is no longer accepted.
69         * src/main.c (usage): Alphabetize options within their sections.
71         * modules/gnu.c (m4_regexp_search, regsub, substitute)
72         (esyscmd):  Improve comments.
74         * modules/gnu.c (substitute): Remove old warning for \0.
75         (substitute_warned): No longer required.  Removed.
77         * modules/gnu.c: Put macro definitions into alphabetical order.
79 2006-07-07  Eric Blake  <ebb9@byu.net>
81         * tests/freeze.at (loading format 1): New file, with new test.
82         * tests/testsuite.at: Include it.
83         * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
84         * tests/modules.at (Freezing modules): Likewise.
86         * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
87         (AC_CHECK_HEADERS): Assume signal.h.
88         (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
89         (AC_CHECK_FUNCS_ONCE): Likewise.
90         * src/m4.h (includes): Assume signal.h.
92 2006-07-05  Eric Blake  <ebb9@byu.net>
94         Fix all testsuite failures on cygwin.
95         * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
96         branch-1_4.  Solves testsuite failure when uninstalled m4 is
97         shadowed by redefinition of PATH in libtool wrapper.
98         * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
99         contains the -no-undefined required by cygwin.
100         (TESTS_ENVIRONMENT): Export abs_top_builddir.
101         * tests/others.at (misc): Port to platforms where /etc/passwd
102         does not exist or does not contain user named root.
103         * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
104         directory.
105         * tests/builtins.at (define, divert): Avoid overquoting.
106         * tests/generate.awk (new_group): Likewise.
108 2006-07-05  Gary V. Vaughan  <gary@gnu.org>
110         The regs_allocated field in a struct re_pattern_buffer refers
111         to the state of a particular re_registers struct when used in
112         successive matches using the same compiled pattern.  Avoid a
113         SEGV in `renamesyms' resulting from using a new re_registers
114         with an existing re_pattern_buffer:
116         * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
117         pattern buffer and registers.
118         (m4_regexp_search): New function to call re_regexp_search with
119         correctly matched pattern buffer and register instantiations.
120         (m4_regexp_compile): Return an m4_pattern_buffer.  Adust all
121         callers.
123 2006-07-04  Gary V. Vaughan  <gary@gnu.org>
125         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
126         changes to gnulib getopt.m4 since last build.
127         * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
128         if the system getopt fails M4_GETOPT tests.
130 2006-06-22  Eric Blake  <ebb9@byu.net>
132         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
133         Reported by Bruno Haible.
135 2006-06-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
137         * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
139 2006-06-19  Eric Blake  <ebb9@byu.net>
141         * THANKS: Update.
143 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
145         * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
146         (clean-local): Split into and depend upon...
147         (clean-local-tests, clean-local-src): ...these two.  The latter
148         removes the libtool object directory below `src', to work around
149         a buglet in Automake, failing to list it.
150         (EXTRA_DIST): Distribute modules/perl.c.
152 2006-06-19  Eric Blake  <ebb9@byu.net>
154         * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
155         right side of dependency; VPATH does that.
156         (stamp-vcl): Update to use libtool's algorithm.
157         (EXTRA_DIST): Distribute stamp-vcl.
158         Reported by Ralf Wildenhues.
159         (TESTSUITE): Revert earlier change that used absolute path, as
160         that broke 'make dist' in VPATH.  Stick with $(srcdir) instead.
161         (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
162         (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
163         atlocal takes care of it instead.
164         (check-local, installcheck-local, clean-local): Inline absolute
165         path to testsuite here, rather than relative path to testsuite
166         elsewhere.
168 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
170         * m4/m4private.h (DELETE): Cast away const here...
171         * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
172         * src/freeze.c (reload_frozen_state): Avoid uninitialized
173         variable warning.
175 2006-06-19  Eric Blake  <ebb9@byu.net>
177         * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
178         .info pages are built.
179         Reported by Ralf Wildenhues.
180         (EXTRA_DIST): Inline definition of testsuite, so that make dist
181         works again.
183 2006-06-16  Eric Blake  <ebb9@byu.net>
185         Follow recommendations from autoconf manual for autotest.
186         * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
187         turn it into an absolute path until autotest provides an option
188         that allows us to avoid changing directories.  Properly quote
189         throughout.
190         (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
191         (check-recursive): Delete unused target.
192         ($(TESTSUITE)): Atomically update testsuite.
193         (CD_TESTDIR): Simplify.
194         (m4__cd): Delete unused macro.
195         (check-local): Let TESTSUITEFLAGS influence the run.
196         (installcheck-local): Let TESTSUITEFLAGS override
197         AUTOTEST_PATH.  Add dependencies.
198         (clean-local): Clean up.
199         (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
200         * README: Document how to use the testsuite.
202 2006-06-15  Eric Blake  <ebb9@byu.net>
204         * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
206         * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
207         clashes with m4sugar.
208         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
209         * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
210         * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
211         * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
212         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
213         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
214         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
215         * configure.ac: Likewise.
216         (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
217         * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
218         conditional.
219         * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
221         Reduce compiler warnings.  Inside GMP, mpq_t is an array type, so
222         const mpq_t is not assignable from plain mpq_t.  Avoid
223         type-punning warnings caused trying to mix these types.
224         * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
225         (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
226         * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
227         (mult_term, exp_term): Remove type-punning casts.
228         (numb_pow): Remove const qualifier.
229         * src/freeze.c (reload_frozen_state): Fix typo in messages.
230         Fix variables that can be used uninitialized, which fixes
231         security hole where malicious frozen file can execute arbitrary
232         code.
234 2006-06-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
236         * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
238 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
239             Eric Blake  <ebb9@byu.net>
241         Allow `make dist' to work again.
242         * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
243         (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
244         (cvs-dist): Fix typo.
245         * NEWS: Match current version number.
247 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
249         * Makefile.am (AM_CPPFLAGS):  Add $(LTDLINCL), so the right
250         ltdl.h is used.
252         * bootstrap: Do not run libtoolize manually, this is done
253         correctly by autoreconf.  Invoke autoreconf with --no-recursive
254         to avoid unnecessary rerunning of autotools for libltdl.
256 2006-06-13  Eric Blake  <ebb9@byu.net>
258         * THANKS: Update.
260 2006-06-12  Eric Blake  <ebb9@byu.net>
262         * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
263         bother with mktemp.
264         * src/m4.h: Don't declare mktemp.
265         * m4/input.c (m4__next_token): Avoid bzero.
266         * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
267         * Makefile.am (doc/m4.1): Depend on installed help2man, rather
268         than distributing outdated helptoman.pl.
269         * doc/helptoman.pl: Delete.
271 2006-06-10  Eric Blake  <ebb9@byu.net>
273         * README (Patches): Document the current dependence on CVS
274         builds of autotools.
275         * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
276         * configure.ac: Use consistent quoting throughout.
277         (AC_PREREQ): Bump to 2.59d.
278         (AC_INIT): Package name begins with uppercase.
279         (AC_ARG_WITH): Use AS_HELP_STRING.
280         (AM_INIT_AUTOMAKE): Enable gnits mode.
281         (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
282         (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
283         (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
284         done by gnulib or automake, or which autoconf has declared
285         obsolete.
286         * m4/m4private.h (Includes): Assume C89 or better, and use errno
287         unconditionally.
288         * m4/output.c (Includes): Likewise.
289         * modules/gnu.c (Includes): Likewise.
290         * modules/m4.c (Includes): Likewise.
291         * src/m4.h (Includes): Likewise.
293         * README-alpha: Update web address.
294         * README: Likewise. Change encoding to ASCII.  Remove old advice
295         about cygwin.  Document bootstrapping dependency.
296         * AUTHORS: Update from branch-1_4.
297         * THANKS: Likewise.  Change encoding to UTF-8.
298         * BACKLOG: Delete.  This file is too old and unmaintained to be
299         worthwhile.
300         * ChangeLog: Change encoding to UTF-8.
302         Avoid compiler warnings.
303         * m4/macro.c (trace_format): Don't mark this as a printf format,
304         since we don't accept the same set of modifiers as printf.  It
305         would be nice if gcc let us specify a custom format archetype.
306         * src/main.c (main): Cast away const.
308 2006-06-10  Andreas Schwab  <schwab@suse.de>  (tiny change)
309             Eric Blake  <ebb9@byu.net>
311         * modules/time.c (ctime): Pass correctly typed variable to
312         m4_numeric_arg.
313         (gmtime): Likewise.
314         (localtime): Likewise.
315         (strftime): Likewise.
316         * m4/utility.c (m4_numeric_arg): For now, document arbitrary
317         limit inherent in this interface.
319 2006-05-08  Bruno Haible  <bruno@clisp.org>  (tiny change)
321         * modules/m4.c (WEXITSTATUS): Provide fallback definition.
322         (sysval): Use WEXITSTATUS.
323         * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
324         big-endian and little-endian wait status definitions.
326 2006-05-06  Eric Blake  <ebb9@byu.net>
328         * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
329         subdirectory to use.
330         (support for -pipe): Move after LT_INIT, since it relies on
331         libtool internals.
333 2006-05-05  Eric Blake  <ebb9@byu.net>
335         * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
337         * THANKS: Update.
339 2006-05-05  Bruno Haible  <bruno@clisp.org>
340             Eric Blake  <ebb9@byu.net>
342         * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
343         * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
344         usage pattern.
345         * bootstrap: Update usage of gnulib-tool.
347 2006-05-04  Eric Blake  <ebb9@byu.net>
349         * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
350         Cleanup whitespace.
352 2005-12-05  Gary V. Vaughan  <gary@gnu.org>
354         * bootstrap (func_update_po): Synch with CVS GNU tar.  wget 1.9.x
355         and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
356         Reported by Eric Blake <ebb9@byu.net>
358 2005-12-04  Gary V. Vaughan  <gary@gnu.org>
360         * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
361         http caching as -C is no longer supported by wget 1.10.x.
362         Reported by Eric Blake <ebb9@byu.net>
364 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
366         * m4/module.c (caller_id): To match libtool-2.0 interface, changed
367         to ...
368         (iface_id): ...an lt_dlinterface_id type.
369         (m4__module_find): New abstraction for lt_dlhandle_fetch.  Use
370         throughout, instead of calling obsolete lt_dlhandle_find directly.
371         (m4__module_next): Use multiloader-safe lt_dlhandle_iterate.  Use
372         throughout, instead of calling obsolete lt_dlhandle_next.
373         * m4/m4private.h (m4__module_find): Declare it.
374         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
375         Use m4__module_next instead of obsolete lt_dlhandle_next.
377 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
379         * bootstrap (func_update_po): Update pofiles directly from the
380         translation project.
381         * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
382         po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
383         these files under source control anymore.
384         Suggested by Eric Blake <ebb9@byu.net>
386 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
388         * ltdl/m4/m4-gnulib.m4: Update FSF contact address.  Somehow this
389         file escaped the address updates on 2005-05-01.
391 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
393         * bootstrap: Allow user overriding of gnulib-tool location, and
394         correctly determine module source directories whether gnulib-tool
395         is given as a relative or absolute path, or is found by searching
396         PATH.
397         Reported by Eric Blake <ebb9@byu.net>
399 2005-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
401         * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
402         and $RM are defined for various versions of
403         AC_LIBTOOL_COMPILER_OPTION.
405         * bootstrap (AUTORECONF): New variable to allow user overriding of
406         autoreconf path.
408 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
410         * doc/m4.texinfo (History): Add better notes on the ancestory of
411         GNU m4, and other historical interest.
413 2005-05-08  Gary V. Vaughan  <gary@gnu.org>
415         * m4/symtab.c (m4_symbol_rename): New function that performs a low
416         level symbol rename.
417         * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
418         * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
419         (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
420         regsub...
421         (erenamesyms, renamesyms): ...builtins that use these to implement
422         macro renaming by regular expression.
423         * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
424         * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
425         to stop the new generated tests from choking.
427 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
429         Since most of the build is handled from a single Makefile.am now,
430         we can teach make about the dependencies between the m4 binary and
431         the preopened modules it is built against:
433         * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
434         preopened modules.
435         * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
436         of the preopened modules have changed.
438 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
440         * configure.ac (gl_MODULES): Add mkstemp for machines that don't
441         have a native implementation.
443 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
445         * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed.  These are
446         handled already by gnu/exit.h.
448         * configure.ac (gl_MODULES): Add assert to support a
449         --disable-assert configure time option for NDEBUG setting.
451         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
452         * bootstrap (src_modules): Add version-etc-fsf.
453         * src/main.c (version_etc_copyright): Removed.
455         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
457 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
459         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
460         recognition macros.
461         * src/freeze.c (produce_frozen_state): Use \n line-endings even
462         on Windows, so that the frozen file reader will work.
463         Reported by Josef T. Burger <bolo@bolo.com>
465 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
467         Forward port of a patch that allowed m4-1.4.2 to compile on
468         QNX 6.3:
470         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
471         sys/signal.h.
472         * src/m4.h: And include them as appropriate.
473         * src/main.c, src/stackovf.h: Don't include signal.h literally;
474         m4.h will include the correct file.
476 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
478         * m4/m4private.h: Make errno visible for the sources patched
479         below.
481 2005-05-04  Paul Eggert  <eggert@twinsun.com>
483         * src/main.c (print_program_name_CB): Preserve errno, since
484         M4ERROR relies on this.
485         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
486         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
487         * m4/path.c (m4_path_search): Don't let "free" trash errno when
488         returning NULL.
490         * m4/output.c (m4_insert_file): Don't assume errno has a valid
491         value simply because fread returns zero.  This fixes a
492         portability bug reported by Marion Hakanson in
493         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
495 2005-05-04  Santiago Vila  <sanvila@debian.org>
497         * tests/stackovf.test: Use tempfile if available.
499 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
501         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
502         * m4/output.c (m4_insert_file): Do not mix buffered and
503         unbuffered I/O, as this breaks on the Hurd.
505 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
507         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
508         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
509         and libtoolize does a better job of ltdl importing now too, so
510         take advantage of that while updating the tree:
512         * acm4, config: Moved from here...
513         * ltdl/m4, ltdl/config: ...to here.
514         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
515         src/Makefile.am, tests/Makefile.am: Removed...
516         * Makefile.am: ...and migrated to here, with adjustments to
517         compensate for relative path differences.
518         * commit: Adjust relative paths.
519         * configure.ac: Adjust relative paths.
520         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
521         patch.
522         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
523         the meanwhile, CVS HEAD libtool is needed.
524         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
525         stricly new enough, we also need a patch.
526         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
527         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
528         (gl_MODULES): Don't list getopt and version-etc, as they don't
529         belong in libm4.
530         * bootstrap: After running gnulib-tool to import the listed
531         modules, fetch getopt and version-etc into src manually.
532         (ltdldir): Change to ltdl.
533         * src/main.c: Adjust for changes in version-etc API.
534         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
535         but works when the getopt module isn't to be included in the lib.
536         * README: Add note about patching autoconf and automake to
537         bootstrap CVS m4.
539 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
541         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
542         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
543         empty file rather than to a nonexistent file.  This closes a
544         common security hole.
545         * modules/m4.c (m4_maketemp): Implement the above, by using
546         mkstemp rather than mktemp.
548 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
550         The FSF are moving offices today.  Changed their contact address
551         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
552         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
554 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
556         * tests/Makefile (clean-local): Ignore testsuite cleanup
557         failures.
559 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
561         * tests/Makefile (clean-local): Only run the testsuite cleanup
562         if the testsuite has been generated.
564 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
566         * TODO: slight clarification of the example of qindir usage.
568 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
570         * TODO: Add qindir requirement, and defn bug.
571         From Stepan Kasal  <kasal@ucw.cz>
573 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
575         * TODO: Add ``execution stack'', fix a typo.
576         * doc/m4.texinfo: Typos.
578 2004-12-24  Eric Blake  <ebb9@byu.net>
580         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
581         to the gnu subdirectory.
582         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
583         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
584         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
585         * m4/system_.h: Likewise, in non-configured includes.
587 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
588             Gary V. Vaughan  <gary@gnu.org>
590         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
591         Protect definitions from macro expansion under -DNDEBUG by
592         parenthesising the expanded function names.
593         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
594         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
595         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
596         (m4_is_syntax_macro_escaped): Similarly protect function
597         definitions from macro expansion under -DNDEBUG by #undefing the
598         matching macro names before each definition.  Also, move all the
599         function definitions to the end of the file so that any
600         invocations in the rest of the file pick up the fast macro
601         versions.
602         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
603         (m4_set_debug_file, m4_set_trace_messages)
604         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
605         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
606         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
607         option setter functions.
609 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
611         * src/main.c: Include gnulib files from the correct directory.
613         * gnulib/*: Don't store any of the gnulib files in arch, as they
614         generate spurious changes.
615         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
616         gnulib macros now share our macro directory.
617         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
618         * bootstrap: Call gnulib-tool to import from the gnulib tree.
619         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
620         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
621         the gettext macros from autopoint that overwrite the gnulib-tool
622         imported versions.  Import sources and Makefile.am into the `gnu'
623         directory.  Changed all callers.
624         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
625         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
626         for imported modules.
627         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
628         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
629         hardcoding the gnulib macros they wrap.
631 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
633         Latest CVS libtool can preload modules in libraries, including
634         its own module loaders!  Tweak m4 so that it doesn't try to treat
635         libltdl's module loaders as m4 modules when freezing and on exit:
637         * gnulib/acm4/*.m4: Don't store these files in arch since they
638         generate spurious changes.
639         * bootstrap: Simplify initial libtoolize call, since CVS
640         libtoolize is smarter these days.
641         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
642         build.
643         * m4/module.h (m4__module_exit): Missing declaration.
644         * m4/m4private.h (m4__module_next): New function declaration.
645         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
646         encapsulation.  Changed all callers.
647         (m4__module_interface): New function to verify m4 loadable module
648         interfaces.
649         (m4__module_init): Register the interface validator.
650         (m4__module_exit): Only close my own modules.
651         * modules/m4.c (unistd.h): Provide missing declaration.
652         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
653         (m4_expand_ranges): More missing declarations.
654         * modules/modtest.c (export_test): Ditto.
655         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
656         * src/main.c (main): Bump copyright year.
657         * tests/modules.at: Fix sed syntax error.
660 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
662         Tweaking to enable compilation with latest CVS libtool and
663         libltdl.  We can't just dump the library files directly into the
664         m4 directory anymore now that libltdl is built from pieces itself:
666         * bootstrap: Rewritten to use latest libtoolize sanely, and to
667         set up libltdl subdirectory.
668         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
669         gnulib subdirectory's config.
670         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
671         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
672         macros from gnulib.
673         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
674         configure.ac, so use AC_WITH_LTDL instead.
675         * Makefile.am (SUBDIRS): Add libltdl.
676         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
677         gl_INCLUDED_REGEX.
678         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
679         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
680         (libm4_la_LIBADD): Add LIBLTDL.
681         * m4/ltdl.c, m4/ltdl.h: Removed.
682         * m4/m4module.h: Include canonical ltdl.h.
683         * po/*.po: Updated.
685 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
687         * gnulib/import: Now updates makefile fragments, and configure.ac.
688         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
689         * gnulib/m4/Makefile.am: include it.
690         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
691         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
692         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
693         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
694         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
695         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
696         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
697         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
698         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
699         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
700         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
701         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
702         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
703         import.
704         * gnulib/m4/getopt_int.h: New source file from latest gnulib
705         import.
706         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
707         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
708         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
709         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
710         Updated source files from latest gnulib.
712 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
714         * config/mailnotify: New file for mailing commit notifications,
715         imported from cvs-utils.
716         * commit: Updated from cvs-utils and tweaked for m4.
718 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
720         * config/mkstamp: Updated from CVS libtool.
721         * configure.ac: Generate a gnu coding standards compliant version
722         number, and use it for the banner.
723         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
724         mhen the TIMESTAMP changes in ChangeLog, but the file modification
725         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
726         contain the previous version number.
727         * src/main.c: Make --version output conform to the GNU standard.
729         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
730         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
731         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
732         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
733         time_la_SOURCES): ...so that these are defaulted correctly, and
734         can be removed from this file.
735         (AM_LDFLAGS): Add -module...
736         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
737         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
738         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
739         the individual settings can be removed.
740         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
741         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
742         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
743         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
744         time_la_LIBADD): ...so that these are picked up as a deplib of
745         libm4 and don't need to be set explicitly.
747 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
749         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
750         from the standard build.  It is too fragile.
752         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
753         CVS libtool after merging m4 changes across to libtool.
755         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
756         * m4/path.c (search_path_add): Ditto.
758 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
760         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
761         libtool tags we don't use in configure.  This reduces the size
762         of the script from over 1Mb to under 700Kb.
764 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
766         The import script was not written properly, and the last gnulib
767         import was incomplete.  Fixed that problem, and reimport our
768         gnulib dependencies, which picks up the address calculation
769         overflow checks described by Paul below.  Also tweak the clients
770         of the gnulib xalloc module not to use deprecated macros:
772         * gnulib/import: Recurse through module dependencies rather than
773         naively descending only one level.
774         * configure.ac: Add calls to gnulib's strnlen and extension module
775         macros.
776         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
777         extension modules.
778         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
779         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
780         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
781         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
782         gnulib.
783         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
784         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
785         place of `xcalloc (1, S)'.
786         * m4/m4.c (m4_create): Likewise.
787         * m4/m4private.h (m4_symbol_value_create): Likewise.
788         * m4/symtab.c (symtab_fetch): Likewise.
789         * m4/syntax.c (m4_syntax_create): Likewise.
790         * src/freeze.c (reload_frozen_state): Likewise.
791         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
792         macro.
793         * m4/symtab.c (m4_symtab_create): Likewise.
795 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
797         * tests/module.at: Comment typo.
799 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
801         * tests/modules.at (modules: importing): Apply some lateral
802         thinking, and use AT_CHECK to compare the output of a sed pass
803         over stderr against the canonical strerror string.
805         * tests/modules.at (modules: importing): Edit the generated stderr
806         output to canonicalize strerror output, before a comparison.
808 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
810         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
811         careful not to trip over the mess:
813         * modules/perl.c: Some builds of perl install headers that contain
814         `#define try __builtin_try'.  Be sure to undefine that macro
815         before `m4/hash.h' gets included, which uses the `try' symbol.
816         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
817         `false' before including `stdbool.h'.
818         (DELETE):  This symbol is not in m4's namespace, and is in any
819         case only used internally...
820         * m4/m4private.h (DELETE): ...so move it to here.
821         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
823 2003-10-08  Paul Eggert  <eggert@twinsun.com>
825         Don't use XMALLOC and XCALLOC.  Once we install the
826         corresponding patch into gnulib, this will fix some
827         address-calculation overflow bugs on hosts where calloc (A, B)
828         returns garbage when A*B overflows.
830         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
831         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
832         xmalloc, XCALLOC with xcalloc.
833         * m4/m4.c (m4_create): Likewise.
834         * m4/m4private.h (m4_symbol_value_create): Likewise.
835         * m4/output.c (m4_output_init): Likewise.
836         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
837         * m4/syntax.c (remove_syntax_attribute): Likewise.
838         * src/freeze.c (reload_frozen_state): Likewise.
839         * src/main.c (main): Likewise.
841 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
843         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
844         gnulib/acm4 directories for aclocal m4 macros.
845         * gnulib/Makefile.am (EXTRA_DIST): Removed.
846         (MAINTAINERCLEANFILES): Add Makefile.in.
847         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
848         modules we use.
849         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
850         * gnulib/import: New file.  Temporary script for updating gnulib
851         imported files, until gnulib-tool is working.
852         * gnulib/config/codeset.m4, gnulib/config/error.m4,
853         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
854         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
855         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
856         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
857         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
858         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
859         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
860         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
861         gnulib/config/nls.m4, gnulib/config/obstack.m4,
862         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
863         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
864         gnulib/config/regex.m4, gnulib/config/restrict.m4.
865         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
866         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
867         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
868         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
869         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
870         gnulib/config/xstrndup.m4: Removed.
871         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
872         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
873         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
874         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
875         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
876         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
877         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
878         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
879         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
880         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
881         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
882         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
883         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
884         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
885         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
886         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
887         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
888         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
889         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
890         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
891         gnulib/import script.
892         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
893         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
894         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
895         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
896         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
897         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
898         gnulib with gnulib/import script.
899         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
900         guards ready for gnulib-tool to autoupdate on import.
901         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
902         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
903         config/stackovf.m4: Moved from here...
904         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
905         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
906         acm4/stackovf.m4: ...to here, to separate aclocal macros from
907         configure time helper scripts.
908         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
909         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
910         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
911         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
912         gnulib xalloc.h.
913         * src/main.c (version_etc_copyright): Only output the current
914         year.
915         (version_etc): Call with new variadic API.
917 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
919         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
920         version-etc module from CVS gnulib.
921         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
922         * src/Makefile.am: Build it.
923         * src/main.c: Use it.
925         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
926         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
927         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
928         exit.h instead.
930 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
931             Gary V. Vaughan  <gary@gnu.org>
933         * bootstrap: Separate options.
934         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
935         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
936         not set.
937         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
938         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
939         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
940         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
941         $(LTLIBINTL) for gettext support on cygwin.
942         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
943         have $(LTLIBINTL) from the preloaded module la files.
944         * README: Remove the warning about using --disable-nls on Windows
945         machines.
947 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
949         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
950         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
951         is required.
953 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
955         * doc/STYLE: Document the gnulib header naming conventions, and
956         #include policy.
957         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
958         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
959         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
960         respectively.
961         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
963         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
964         module from CVS gnulib.
965         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
966         (gl_FUNC_STRTOL): In favour of the module macro.
968 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
970         Replace the getopt code with CVS gnulib getopt.  The source files
971         detect whether they are in a glibc environment and preprocess away
972         all of the code if there is a system getopt, so we can compile
973         them into the m4 executable unconditionally:
975         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
976         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
977         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
978         macros.
979         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
980         version.
981         * src/Makefile.am: Adjust.
982         * src/main.c: Always include our shipped getopt.h.
983         * po/POTFILES.in: Use new location of getopt.c.
985 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
987         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
988         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
989         in this directory automatically.
990         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
992         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
993         isn't set yet.
994         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
995         inline.
996         * modules/Makefile.am (pkglibexecdir): Set it here.
997         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
999         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
1000         Import regex module from CVS gnulib.
1001         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
1002         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
1003         do extra substitutions for Makefile.
1004         * configure.ac: Use it.
1005         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
1006         from regex_.h if necessary.
1007         * m4/system_.h: Include the correct version of regex.h.
1008         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
1009         version.
1010         * po/POTFILES.in: Use new location of regex.c.
1012         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
1013         realloc.c: automake distributes these files already.
1015 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
1017         Replace the xstrzdup code by importing the xstrndup module from
1018         CVS gnulib, along with its dependencies: strndup and strnlen:
1020         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
1021         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
1022         gnulib.
1023         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
1024         gnulib/config/strndup.m4: Ditto wrt strndup.
1025         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
1026         strnlen.
1027         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
1028         However, contrary to gnulib, we install xstrndup.h.
1029         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
1030         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
1031         is an artifact of the old m4 portability layer.
1032         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
1033         * m4/system_.h: Include xstrndup.h.
1034         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
1036 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
1038         Reimport the latest xalloc module from CVS gnulib, and adjust the
1039         m4 sources to take advantage of xalloc xfree.  Also create a new
1040         macro DELETE with the same semantics as the old m4 XFREE macro,
1041         and carefully tweak callers:
1043         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
1044         gnulib.
1045         * m4/utility.c (xfree): Removed.  This function is now supplied by
1046         gnulib xalloc.
1047         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
1048         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
1049         * m4/symtab.c (m4_symtab_create): Ditto.
1050         * m4/system_.h: Removed XFREE redefine.
1051         (DELETE): New macro with same functionality as the original m4
1052         XFREE macro, but based on xalloc.h now.  Changed all callers.
1053         * src/main.c (main): Use XMALLOC macro.
1054         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
1055         instead of XFREE.
1056         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
1058 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
1060         Import the xalloc module from CVS gnulib, along with its
1061         dependencies: exitfail, malloc and realloc. We had different
1062         semantics for our XFREE and a function xfree() not supplied by
1063         gnulib, so also a bit of work to keep everything running
1064         smoothly:
1066         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
1067         (gl_XALLOC): Use gnulib equivalents.
1068         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
1069         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
1070         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
1071         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
1072         realloc.
1073         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
1074         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
1075         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
1076         imported modules.
1077         (pkgincdir): Removed.  Use pkgincludedir instead.
1078         * m4/m4private.h (XFREE): xfree already checks for NULL.
1079         * m4/system_.h: Use xalloc module, and remove macros already
1080         supplied by xalloc.h.
1081         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
1082         moved the old definition from m4/xmalloc.c to here for now.
1084 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
1086         Import the error and progname modules from CVS gnulib.  Our old
1087         error.c subsumed the functionality of both, so a little adjustment
1088         was required to accomodate the split in sources.  Also added more
1089         wrapper macros to choose between a system installed error.h or our
1090         shipped gnulib error module:
1092         * m4/error.c, m4/error.h: Removed.
1093         * m4/Makefile.am: Adjust.
1094         (pkgincdir): Removed.  Use pkgincludedir instead.
1095         * m4/module.h, src/main.c: Don't include `m4/error.h'.
1096         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
1097         error.h.
1098         * gnulib/m4/progname.c: Imported from CVS gnulib.
1099         * gnulib/m4/progname.h: Ditto.
1100         * src/main.c: Adjust to use progname module.
1101         * gnulib/m4/error.c: Imported from CVS gnulib.
1102         * gnulib/m4/error_.h: Ditto.
1103         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
1104         if appropriate, and link a local error.h if the system version is
1105         missing.
1106         (libgnu_la_SOURCES) Add progname module sources.
1107         * gnulib/config/error.m4: Imported from CVS gnulib.
1108         * gnulib/config/strerror_r.m4: Ditto.
1109         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
1110         to have ERROR_H for Makefile substitutions and tell system.h
1111         whether the system error.h should be used, or a locally installed
1112         version.
1113         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
1115 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
1117         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
1118         s/gettext_.h/gettext.h/.
1120         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
1121         automake have been fixed.
1123         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
1124         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
1125         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
1126         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
1128 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
1130         The gnulib obstack module requires the gnulib gettext module for
1131         systems that do not have GNU gettext installed.  Because we use
1132         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
1133         that directory incase it clashes with the system gettext.h.  This
1134         delta uses gettext_.h and extra rules in the Makefile to make a
1135         link to gettext.h when needed:
1137         * Makefile.am (auxdir): Removed.  No longer used.
1138         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
1139         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
1140         moved.
1141         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
1142         Makefile based build.
1143         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
1144         of the macros are kept.
1145         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
1146         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
1147         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
1148         distributes these automatically.
1149         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
1150         warning from automake-1.7a.
1151         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
1152         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
1153         all callers.
1154         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
1155         wrt. m4_FUNC_OBSTACK.
1156         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
1157         wrt. m4_sys_STACKOVF.
1158         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
1159         wrt. _m4_LIB_GMP, m4_LIB_GMP.
1160         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
1161         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
1162         respectively.
1163         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
1164         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
1165         gettext.h link on deficient systems.
1166         (pkginc_HEADERS): Mention $(GETTEXT_H).
1167         (EXTRA_HEADERS): Mention gettext.h.
1168         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
1169         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
1170         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
1171         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
1172         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
1173         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
1174         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
1175         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
1176         gnulib/config/po.m4, gnulib/config/progtest.m4,
1177         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
1178         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
1180 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
1182         We can't mirror the gnulib directory structure here, since we need
1183         to be able to eg. `#include <m4/obstack.h>' from our source files,
1184         which is much easier if the local obstack.h is created in a
1185         directory named m4.  Rather than trying to symlink everything into
1186         the m4 directory, now we build a libtool convenience library from
1187         the sources we get from gnulib and link that with libm4.la:
1189         * gnulib/config/extensions.m4: Imported from CVS gnulib.
1190         * gnulib/config/unlocked-io.m4: Ditto.
1191         * gnulib/m4/unlocked-io.h: Ditto.
1192         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
1193         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
1194         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
1195         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
1196         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
1197         * m4/Makefile.am: Adjust.
1198         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
1199         macros we redistribute.
1200         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
1201         library among others.
1202         (GNULIB_SRCS, GNULIB_MACROS): Removed.
1203         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
1204         * config/m4-obstack.m4: Adjust.
1205         * po/POTFILES.in: Adjust.
1206         * configure.ac: Reformatting.  Call newly imported gnulib macros.
1207         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
1208         bogus calls of `#include "m4.h"'.
1209         * Makefile.am: INCLUDES has been deprecated in favour of
1210         AM_CPPFLAGS.
1211         * m4/Makefile.am: Ditto.
1212         * modules/Makefile.am: Ditto.
1213         * src/Makefile.am: Ditto.
1215 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
1217         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
1219 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
1221         Migrate the obstack support into the gnulib directories for easy
1222         synchronisation with upstream files in gnulib:
1224         * config/gnu-obstack.m4: Moved from here...
1225         * config/m4-obstack.m4: ...to here.
1226         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
1227         * m4/obstack.c, m4/obstack_.h: Moved from here...
1228         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
1229         * po/POTFILES.in: Adjust.
1230         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
1231         * m4/Makefile.am: Add a whole new section to link the obstack
1232         sources from the gnulib tree if necessary.
1233         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
1234         from gnulib.
1235         * config/m4-obstack.m4: Rewrite as a wrapper for
1236         gnulib/m4/obstack.m4.
1238 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
1240         GNU M4 currently builds with a number of files adapted from
1241         upstream sources.  Recently the gnulib project on savannah.gnu.org
1242         has pulled together a great many of these externally maintained
1243         files.  This delta is the beginnings of isolating those files
1244         maintained in gnulib to make it easy to synchronise M4 with the
1245         upstream files prior to releases.
1247         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
1248         directory.
1249         (SUBDIRS): Added new gnulib subdirectory.
1250         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
1251         * config/stdbool.m4: Moved from here...
1252         * gnulib/m4/stdbool.m4: ...to here.
1253         * m4/stdbool_.h: Moved from here...
1254         * gnulib/lib/stdbool_.h: ...to here.
1255         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
1256         distributed.
1257         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
1258         code to work with new stdbool_.h location.
1259         (gnulib_srcdir): New.
1261 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
1263         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
1264         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
1265         builds to work.
1266         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
1267         (EXTRA_DIST): Use it.
1269         * bootstrap: CVS autoreconf leaves file droppings.  Remove
1270         aclocal.m4t incase autoreconf doesn't.
1272 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
1274         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
1275         the other gnulib imports, renamed to m4/obstack_.h.
1276         * m4/obstack.c: Updated from CVS gnulib.
1277         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
1278         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
1279         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
1280         about vpath already, and $top_srcdir upsets CVS Automake, so the
1281         $top_srcdir reference was removed.
1283         * m4/system-h.in: For consistency with the gnulib imports, renamed
1284         to m4/system_.h.
1285         * m4/Makefile (EXTRA_HEADERS): Adjust.
1286         * configure.ac (AC_CONFIG_FILES): Adjust.
1288         * m4/stdbool_.h: New file from gnulib for systems without their
1289         own.
1290         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
1291         * config/stdbool.m4: New file.  Macros from gnulib for same.
1292         * configure.ac: Use it.
1294 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
1296         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
1297         * config/gmp.m4: Ditto.
1298         * config/gnu-obstack.m4: Ditto.
1299         * config/stackovf.m4: Ditto.
1300         * m4/builtin.c: Ditto.
1301         * m4/debug.c: Ditto.
1302         * m4/error.c: Ditto.
1303         * m4/error.h: Ditto.
1304         * m4/gnu-obstack.h: Ditto.
1305         * m4/hash.c: Ditto.
1306         * m4/hash.h: Ditto.
1307         * m4/input.c: Ditto.
1308         * m4/m4.c: Ditto.
1309         * m4/m4module.h: Ditto.
1310         * m4/m4private.h: Ditto.
1311         * m4/macro.c: Ditto.
1312         * m4/module.c: Ditto.
1313         * m4/obstack.c: Ditto.
1314         * m4/output.c: Ditto.
1315         * m4/path.c: Ditto.
1316         * m4/regex.c: Ditto.
1317         * m4/regex.h: Ditto.
1318         * m4/strtol.c: Ditto.
1319         * m4/symtab.c: Ditto.
1320         * m4/syntax.c: Ditto.
1321         * m4/utility.c: Ditto.
1322         * m4/xmalloc.c: Ditto.
1323         * m4/xstrdup.c: Ditto.
1324         * m4/xstrzdup.c: Ditto.
1325         * modules/evalparse.c: Ditto.
1326         * modules/format.c: Ditto.
1327         * modules/gnu.c: Ditto.
1328         * modules/import.c: Ditto.
1329         * modules/load.c: Ditto.
1330         * modules/m4.c: Ditto.
1331         * modules/m4.h: Ditto.
1332         * modules/modtest.c: Ditto.
1333         * modules/mpeval.c: Ditto.
1334         * modules/perl.c: Ditto.
1335         * modules/shadow.c: Ditto.
1336         * modules/stdlib.c: Ditto.
1337         * modules/time.c: Ditto.
1338         * modules/traditional.c: Ditto.
1339         * src/freeze.c: Ditto.
1340         * src/getopt.c: Ditto.
1341         * src/getopt1.c: Ditto.
1342         * src/m4.h: Ditto.
1343         * src/main.c: Ditto.
1344         * src/stackovf.c: Ditto.
1346         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
1347         ac_default_headers is an autoconf internal variable.
1348         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
1349         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
1351         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
1352         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
1353         delta.
1355 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
1357         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
1358         C99 bool.
1359         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
1360         possible or faking one with a typedef.  Changed all callers.
1362 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
1364         Still cleaning up the users' module API, by taking out the stuff
1365         that isn't used by any existing modules, and moving specialised
1366         functions out of libm4 and into the module they are used by.
1368         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
1369         * m4/utility.c (m4_skip_space): ...to here the home of its only
1370         use, made static and renamed to `skip_space'.  Changed all
1371         callers.
1372         * m4/m4module.h (m4_expand_ranges): Removed prototype.
1373         * m4/utility.c (m4_expand_ranges): Moved definition from here...
1374         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
1375         ltdl.
1376         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
1377         casting .
1378         * modules/gnu.c (builtin_syntax): Import and use in this
1379         builtin implementation.
1380         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
1381         Not used.  Deleted.
1382         * m4/macro.c (trace_flush): Except here where the macro is now
1383         manually inlined.
1384         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
1385         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
1386         moved...
1387         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
1388         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
1390 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
1392         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
1393         compiler based AC_CHECK_HEADER that was introduced in
1394         autoconf-2.56.
1395         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
1396         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
1397         * configure.ac: Use renamed M4_AC_LIB_GMP.
1399         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
1400         macro that requires arguments! This stops the shell's bad
1401         substitution error at configure time.
1403         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
1404         variables to the testsuite shell.  Set the value of USE_GMP so
1405         that the gmp test will run!
1406         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
1408 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
1410         Libltdl already has an excellent mechanism for accessing C symbols
1411         in modules.  Lets use that!  Remove all the exporting cruft and
1412         just use lt_dlsym in conjunction with a few conventions to
1413         simplify module writers' jobs.  Also removed the table address
1414         caching code and otherwise simplified the module loader quite a
1415         bit.  To access exported symbols in other modules, first the
1416         exporting module must name the symbols <modname>_LTX_<symname>,
1417         and the importing module must define a function type called
1418         <symname>_func.  The importer then adds
1419         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
1420         that wishes to call out to the exported functions.  Care must be
1421         taken that <symname> is non-NULL in the importing module incase
1422         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
1423         definition was in the importers source.  Study
1424         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
1425         m4_module_import will attempt to automatically load a module
1426         required for symbol access if it is not loaded already.
1428         * TODO: Removed the items fixed in this delta.
1429         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
1430         module name.
1431         * m4/ltdl.h (lt_dlhandle_find): Declare it.
1432         * m4/module.c (m4_module_unload): Use it.
1433         * src/freeze.c (reload_frozen_state): Ditto.
1434         * m4/m4module.h (m4_export): Deleted.  Removed all references.
1435         (M4_MODULE_IMPORT): New user convenience macro for importing
1436         arbitrary symbols from other modules.
1437         * m4/module.c (m4_module_import): New function to service
1438         M4_MODULE_IMPORT macro.
1439         (module_data): Removed.  Looking up the tables on demand with
1440         lt_dlsym, rather than caching their addresses here simplifies the
1441         code substantially.
1442         (m4_get_module_builtin_table, m4_get_module_macro_table):
1443         Removed.  Changed all callers.
1444         (set_module_macro_table, set_module_builtin_table): Renamed to
1445         install_macro_table and install_builtin_table respectively, and
1446         simplified now that the cache is no more.
1447         * modules/gnu.c (builtin_symbols): Use this new mechanism to
1448         import m4_dump_symbols from the m4 module.
1449         (builtin_esyscmd): Likewise for m4_set_sysval and
1450         m4_sysval_flush.
1451         * modules/m4.c (m4_export_table): Removed.  Functions are
1452         addressed with the new mechanism which doesn't need this.
1453         (m4_set_sysval): New exported accessor function to prevent
1454         problems with variable access on inferior architectures.
1455         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
1456         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
1457         that we can have some type safety.
1458         * modules/modtest.c (export_test): C level exported function for
1459         testing the new import mechanism.
1460         * modules/import.c: New file for the import end of the test.
1461         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
1462         * tests/modules.at: New test cases for intermodule symbol
1463         importing.
1465 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
1467         * m4/m4module.c (m4_string): Moved from here...
1468         * m4/m4private.c (m4_string): ...to here.
1470         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
1472 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
1474         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
1475         already available to module writers through
1476         m4_{get,set}_nesting_limit_opt(), so moved from here...
1477         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
1478         (m4_create): Use it.
1480 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
1482         Aside from auditing path.c for m4module.h api obfuscation, this
1483         delta introduces the concept of private struct members in opaque
1484         data types to GNU m4: See the STYLE file for details.
1486         * TODO: Remind ourselves that a rewrite of path.c is needed.
1487         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
1488         Moved from here...
1489         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
1490         here and renamed.  These type definitions are for internal api use
1491         only.  Changed all callers.
1492         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
1493         Moved from here...
1494         * m4/path.c (search_path_env_init, search_path_add): ...to here
1495         and renamed.  These calls were never used outside this file.
1496         Changed all callers.
1497         (dirpath): Moved functionality of this static declaration...
1498         * m4/m4private.h (struct m4): ...to this new internal only
1499         search_path field.  Changed all callers.
1500         (m4__get_search_path): Added new internal api accessor.
1501         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
1502         (m4_include_init): Removed...
1503         * m4/m4.c (m4_create): ...because the new m4 field is now
1504         initialised here.
1505         (m4_delete): Recycle search_path memory.
1506         * src/main.c (main): Don't call m4_include_init now that it's
1507         gone!
1508         * doc/STYLE: Document convention for private fields in opaque
1509         ADTs.
1511 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
1513         Sometimes exporting the address of a symbol from a module isn't
1514         enough for other modules to call that symbol correctly.  If
1515         custom data types are used for function parameters, they need to
1516         be known to the caller.  This change introduces the concept of
1517         $(prefix)/include/modules/$(modulename).h to declare those
1518         structures.  Also we move m4_dump_symbols from libm4 to the m4
1519         module to show this concept in action.
1521         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
1522         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
1523         exporting data structures from modules/m4.c.
1524         * modules/m4.c, modules/gnu.c: Include it.
1525         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
1526         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
1527         prototypes.
1528         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
1529         Moved from here...
1530         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
1531         ...to here, with slight renaming.
1532         (m4_export_table): Prototype and add m4_dump_symbols.
1533         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
1534         definition of m4_dump_symbols.
1535         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
1536         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
1538 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
1540         Create an export table in modules/m4.c in readiness for beefing up
1541         the module loader to track module exports and imports.
1543         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
1544         * m4/debug.c (m4_debug_flush_files): Moved...
1545         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
1546         * modules/gnu.c (builtin_esysval): Use it.
1547         * m4/m4module.h (m4_export): New type for declaring module symbols
1548         for export.
1549         * modules/m4.c (m4_export_table): List symbols exported from this
1550         module for use by other modules.
1552 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
1554         An experiment: There is loads of code in libm4 which should be in
1555         the m4 module, but is also used by another module. Just because
1556         some linkers won't cope with calls across dynamic runtime loaded
1557         objects I initially left the code in libm4.  It will tidy the
1558         module api immensely if this code moves to the right place, I just
1559         need to remember to invent a suitable calling mechanism at some
1560         point.  For now, only modules that are statically linked and
1561         preloaded will get this treatment, so the only platforms that will
1562         break are those that require all symbols to be resolved at link
1563         time.
1565         * TODO: Reminder that what I am doing could reduce portability
1566         unless I do something more robust later.
1567         * m4/m4module.h (m4_sysval): No longer exported from libm4.
1568         * m4/utility.c (m4_sysval): No longer declared in libm4.
1569         * modules/Makefile.am: Reformatting.
1570         * modules/m4.c (m4_sysval): Declare it at place of use.
1571         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
1573 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
1575         * m4/m4module.h: Reformatting and rearranging lines a bit.
1576         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
1577         all users.
1578         (m4_call_macro, m4_expand_input): Renamed...
1579         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
1580         callers.
1581         (m4_expansion_level, m4_process_macro): Moved...
1582         * m4/macro.c (expansion_level, process_macro): ...to here, and
1583         made static.
1585         * m4/m4module.h (program_name): Not used by modules at all, so
1586         moved...
1587         * src/main.c (program_name): ...to here.
1588         (print_program_name): Renamed...
1589         (print_program_name_CB): ...to conform to the STYLE guide.
1591 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
1593         More refactoring of the m4module.h API.  Replace #defines with an
1594         enum, and move non-public functions out of the public API.
1596         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
1597         inclusion.
1598         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
1599         * m4/debug.c (m4_debug, trace): Moved...
1600         * m4/m4private.h (struct m4): ...to fields of this struct.
1601         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
1602         for the new fields.
1603         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
1604         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
1605         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
1606         * m4/m4module.h (m4_context_field_table): Add entries for new
1607         debug_file and trace_messages fields.
1608         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
1609         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
1610         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
1611         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
1612         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
1613         (m4_is_debug_bit): New macro to simplfy checks against the debug
1614         bits above.
1615         (m4_trace_format, m4_trace_header, m4_trace_flush)
1616         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
1617         prototypes.
1618         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
1619         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
1620         * m4/macro.c (trace_format, trace_header, trace_flush)
1621         (trace_prepre, trace_pre, trace_post): ...to these newly static
1622         functions, since they are only ever used from this file.  Changed
1623         all callers.
1625 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
1627         Change the macros for checking syntax so that matching against
1628         multiple possible syntax classes can be done with a single
1629         comparison some of the time.  The various classes are now bits of
1630         an int that can be checked with bitwise logic operators.
1632         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
1633         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
1634         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
1635         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
1636         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
1637         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
1638         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
1639         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
1640         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
1641         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
1642         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
1643         Replace all calls with invocations of these...
1644         (m4_is_syntax, m4_has_syntax): ...New macros.
1645         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
1646         is no longer required with new macros.  Changed all callers.
1648 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
1650         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
1651         values are returned as part of the internal interface, so they
1652         need to be moved...
1653         * m4/private.h: ...to here.
1654         * m4/macro.c (expand_token): Check for out of range
1655         m4_peek_input() results before looking up in the syntax table.
1656         (collect_arguments): Ditto.
1658         * NEWS: Note `$' syntax class.
1660 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
1661             Gary V. Vaughan  <gary@gnu.org>
1663         Conform to POSIX if the POSIXLY_CORRECT environment is set.
1664         --traditional `define' now smashes all the definitions.
1666         * NEWS: Explain this.
1667         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
1668         (Extensions): Explain that extensions that are incompatible with
1669         POSIX are disabled if POSIXLY_CORRECT is set.
1670         (Incompatibilities): Remove.
1671         (Define, Other Incompat): Explain difference
1672         between GNU and POSIX behavior of define, pushdef, popdef.
1673         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
1674         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
1675         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
1676         (m4_get_posixly_correct_opt): New macro.
1677         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
1678         POSIXLY_CORRECT.
1679         * modules/m4.c (builtin_functions): defn now takes any number of args.
1680         (builtin_define): Smash all the definitions if
1681         POSIXLY_CORRECT.
1682         (builtin_defn)): Allow any number of arguments.
1683         (builtin_undivert): Do not allow nonnumeric arguments
1684         if POSIXLY_CORRECT.
1685         * src/main.c (main): Set posixly-correct behavior if either
1686         POSIXLY_CORRECT is set, or if -G is given.
1687         * tests/builtins.at: New test for smashed definitions.
1689 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
1691         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
1692         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
1693         not to slow the parser down.
1694         (M4__IS_STRING): New macro to test string syntax class membership.
1695         * m4/syntax.c: Adjust docucomment.
1696         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
1697         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
1698         * m4/input.c (init_builtin_token): Comment typo.
1699         (m4__next_token): Comment typo.
1700         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
1701         by using the new M4__IS_STRING macro.
1702         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
1703         variable references in macro expansions.
1705         * doc/m4.texinfo (Eregexp and Regexp): Typo.
1706         (Epatsubst and Patsubst): Typo.
1707         (Eval): Typo.
1709 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
1711         Move the global variables that pertain to syntax to a new `struct
1712         m4_syntax_table', and then add one of these to `struct m4'.  The
1713         ripple effect through the code to both change formerly global
1714         references, and make sure a suitable context is available in
1715         lexical scope is disproportionately large compared to the size of
1716         the change proper.  This change is a large part of decoupling
1717         syntax.c from the rest of the code that uses it.
1719         * m4/m4private.h (struct m4): Add a syntax field.
1720         * m4/m4.c (m4_create): Initialise it,
1721         (m4_delete): Recycle it.
1722         (m4_get_symtab): Remove hand coded version...
1723         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
1724         callers.
1725         * m4/m4module.h (m4_context_field_table): Add an extra field so we
1726         can generate m4_get_symbol_table.  Add a new row for
1727         m4_get_syntax_table.
1728         (M4SYNTAX): Syntactic sugar for module writers.
1729         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
1730         (m4_syntax_table): New home for syntax related formerly global
1731         variables.
1732         * m4/m4private.h (struct m4_syntax_table): Define it.
1733         * m4/input.c (m4_input_init): Initialisation of these formerly
1734         global variables moved...
1735         * m4/syntax.c (m4_syntax_create): ...to here.
1736         * m4/input.c (m4_input_exit): And similarly, recycling of the
1737         memory used by those values moved...
1738         * m4/syntax.c (m4_syntax_delete): ...to here.
1739         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
1740         Moved to m4/m4private.h.
1741         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
1742         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1743         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
1744         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
1745         objects.  Changed all callers that used to directly access the
1746         global equivalents.
1747         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
1748         Removed and incorporated into m4_syntax_table structure.
1749         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
1750         * m4/syntax.c (m4_set_syntax): Now returns an error status,
1751         instead of requiring a `struct m4' to generate its own errors.
1752         Changed all callers.
1753         * src/main.c (main): Now that the syntax table is initialised as
1754         part of m4_create, we have to manually wipe the syntax entries if
1755         we are about to read a frozen file.
1757 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
1759         * doc/STYLE: Added notes on callback naming schemes.
1761         * m4/module.c (m4_set_module_macro_table)
1762         (m4_set_module_builtin_table): Declarations weren't changed when
1763         definitions were renamed on 2003-06-19.
1765         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
1766         neither used nor particularly appropriate since it exposes the
1767         internal workings of the hash module.  I haven't yet decided
1768         whether to remove it entirely.
1770 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
1772         Two related changes, and a huge knockon effect throughout the
1773         source: Moved the option variables out of global space and into
1774         `struct m4'; made `m4_symtab' a real datatype, so that its api
1775         is not marred passing `struct m4' around just so it can decide
1776         whether to keep traced symbol names or not.  Added setters and
1777         getters for the formerly global option variables, and obviously
1778         changed a vast number of functions to take a `struct m4' and use
1779         the getter funcs to find option values.
1781         * m4/utility.c (interactive, sync_output, debug_level)
1782         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
1783         (max_debug_argument_length, warning_status, nesting_limit)
1784         (discard_comments): Removed.
1785         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
1786         (debug_level, max_debug_argument_length, prefix_all_builtins)
1787         (suppress_warnings, discard_comments, interactive, sync_output):
1788         Removed from here...
1789         * m4/m4private.h (struct m4): ...and equivalent fields added to
1790         this structure.
1791         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1792         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1793         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1794         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1795         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
1796         macros for the new fields.
1797         * m4/m4module.h (m4_context_field_table)
1798         (m4_context_opt_bit_table): Helper macros used to generate
1799         prototypes, setters and getters for new option fields
1800         consistently.
1801         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1802         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1803         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1804         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1805         (m4_get_interactive_opt, m4_get_sync_output_opt)
1806         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
1807         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
1808         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
1809         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
1810         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
1811         setter and getter functions generated by cpp from
1812         m4_context_field_table and m4_context_opt_bit_table, exported as
1813         part of the module api.  Changed all callers.
1814         * m4/symtab (struct m4_symtab): Used as the concrete type for
1815         m4_symtab now.
1816         (m4_symtab_create): Allocate and initialise a new struct.
1817         (m4_symtab_apply): New function that works like m4_hash_apply, but
1818         with different callbacks specific to symbol tables.  Changed all
1819         callers.
1820         (symbol_destroy, arg_destroy, arg_copy): Renamed
1821         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
1822         they have unused parameters for a reason!
1823         (dump_symbol_CB): New callback to dump the contents of a single
1824         symbol.
1825         (symtob_dump): Rewritten in terms of dump_symbol_CB.
1826         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
1827         Changed all callers.
1828         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
1829         of the contained `m4_symtab' at the `no_gnu_extensions' field.
1830         Although I'm not convinced these semantics are correct, they are
1831         at least consistent with how things were before this delta.  Also
1832         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
1834 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
1836         Tie down the interface to libm4 some more.  Make more structures
1837         opaque to modules by moving them to m4private.h, and writing
1838         setters and getters.  To win back the speed penalty for doing this
1839         also wrote macroized versions that do know about structure layout
1840         in m4private.h and #include that file into modules when NDEBUG is
1841         defined at compile time.  There are still some accessor macros in
1842         m4private.h that need to go, but that is not necessary to clean
1843         the module api up.
1845         * m4/m4module.h (m4_symbol_type): Moved...
1846         * m4/m4private.h (m4__symbol_type): ...to here.
1847         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
1848         (m4_set_symbol_traced, m4_set_symbol_name_traced)
1849         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1850         (m4_get_symbol_func, m4_symbol_value_create)
1851         (m4_symbol_value_delete, m4_set_symbol_value_text)
1852         (m4_set_symbol_value_func): New exported api to symbols.
1853         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
1854         and m4_is_symbol_value_func.
1855         * m4/m4module.h: Prototype these guys.
1856         * m4/module.c (m4_set_module_macro_table)
1857         (m4_set_module_builtin_table): Make these static, there is no
1858         reason to pollute the api with them.
1859         * m4/m4private.h: Reformatting.
1860         (m4_get_symtab): Only define when NDEBUG is defined.
1861         (m4_get_symbol_value, m4_get_symbol_traced)
1862         (m4_set_symbol_traced, m4_set_symbol_name_traced)
1863         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1864         (m4_get_symbol_func, m4_symbol_value_create)
1865         (m4_symbol_value_delete, m4_set_symbol_value_text)
1866         (m4_set_symbol_value_func): Macro implementations of the new
1867         functions when NDEBUG is defined.
1868         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
1869         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
1870         Superceded by the above.  All callers changed.
1871         (M4ARG): Removed.  This is no longer different to the
1872         m4/m4module.h definition.
1873         * modules/gnu.c, modules/m4.c: Only include m4private.h when
1874         NDEBUG is defined.  That way we exercise the same (albeit slower)
1875         api that external modules must use.
1877 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
1879         Renamed some of the types and their accessors to make more sense.
1880         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
1881         has a stack of SYMBOL_VALUEs.
1883         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
1884         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
1885         m4_get_symbol_value_type,  m4_get_symbol_value_text,
1886         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
1887         Changed all callers.
1888         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
1889         (m4_get_token_type): Renamed
1890         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
1891         to the internal api.
1892         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
1893         s/TOKEN_/VALUE_/
1894         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
1895         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
1896         (m4__token_type): Moved here from m4module.h.
1897         (m4__next_token): Renamed from m4_next_token.
1898         * m4/symtab.c: Removed some of the parameterised macro support
1899         functions for modularisation later.
1900         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
1901         m4_hash_dup to perform a true deep copy of the SRC.
1902         (arg_copy): Callback for m4_symbol_value_copy.
1903         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
1904         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
1905         m4_get_symbol_value_func.  Changed all callers.
1907 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
1909         Tidy up style of hash.[ch] in accordance with doc/STYLE.
1911         * m4/hash.c: Internal symbol renaming and formatting.
1912         (m4_hash_dup): New function to facilitate deep copies of hash
1913         tables.
1914         (m4_hash_apply_func): Returns a void* now, which is a richer type
1915         for returning exceptions (NULL means keep going).
1916         (m4_hash_apply): Ditto.
1917         * m4/hash.h: Declare exported symbols with an explicit extern.
1918         Reformated.
1920 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
1922         Still refactoring furiously.  This delta represents a change in
1923         semantics to symtab.c.  Instead of building temporary m4_tokens
1924         in the caller, and copying fields in the methods, we now create
1925         the actual m4_token for hashing in the caller so the methods just
1926         slot them in directly.  Also, this means that we don't lookup a
1927         symbol and get back an allocated but VOID token to copy fields
1928         into, we create the token we want to push and pass that to
1929         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
1930         a few other small changes to stop knowledge of the implementation
1931         of symtab.c leaking out into other files.
1933         * m4/macro.c (expand_argument): Comment typo corrected.
1934         * m4/symtab.c (symtab_fetch): New function to fetch the address of
1935         an interned symbol.
1936         (m4_symbol_pushdef): Take an extra value parameter and use this
1937         directly as the new top of the value stack.  All callers changed
1938         to build a token and pass responsibility for memory in, rather
1939         than copying as we used to.
1940         (m4_symbol_define): Also use the new value parameter directly as a
1941         replacement for the top of the value stack.  All callers changed
1942         to build a token as above.
1943         (m4_set_symbol_traced): New function to set the traced bit on the
1944         named symbol, creating it if necessary.
1945         (symbol_popval): The guts of the old m4_symbol_popdef.
1946         (m4_symbol_popdef): Use it.
1947         * m4/builtin.c (m4_symbol_set_token): Removed,
1948         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
1949         replaced...
1950         * m4/module.c (m4_set_module_builtin_table)
1951         (m4_set_module_macro_table): ...with these more orthogonal
1952         functions.
1953         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
1954         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
1955         required.
1956         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
1957         (m4_arg_signature_parse): Moved...
1958         * m4/symtab.c: ...to here.
1959         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
1960         screw something up. Moved...
1961         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
1962         actually does a proper deep copy of source to dest.
1964 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
1966         Further refactoring to stabilise the module API.  Renaming some
1967         functions for orthogonality, and judicious definition migration to
1968         move things out of the set of exported symbols.
1970         * doc/STYLE: New file.  Notes on coding style.
1971         * m4/m4module.c: Updated bitrotted docucomment at the top of the
1972         file.
1973         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
1974         m4_get_module_name, m4_get_module_builtin_table,
1975         m4_get_module_macro_table which are verb phrases.  Changed all
1976         callers.
1977         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
1978         Moved to...
1979         * m4/module.c (m4_set_module_builtin_table)
1980         (m4_set_module_macro_table): ...here, and renamed. Changed all
1981         callers.
1982         * m4/m4module.c (m4_module_data): This...
1983         * m4/m4private.c (struct m4_module_data): ...and this...
1984         * m4/module.c (module_data) ...consolidated here and no longer
1985         exported.  Changed all callers.
1987 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
1989         Begin work on lifting the curse of the global variables.  To start
1990         with create a `struct m4' context container, and replace
1991         `m4__symtab' with `context->symtab' throughout.  This means
1992         initialising a context container in main, and adjusting many
1993         functions between main and the module entry points so that the
1994         container gets passed through.  It would have been nice to
1995         defer this until after 1.5, but it has a major effect on the
1996         user's module writing ABI, so it needs to be addressed now - at
1997         least in the areas that impact the ABI.  An interrelated change
1998         in the symtab API removes the dependency on a global symbol table,
1999         and instead focuses on a passed table (from the context
2000         container).
2002         * TODO: Reminders for finishing context functionality.
2003         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
2004         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
2005         global variables and eventually allow m4 to be reentrant.
2006         * m4/m4private.h (m4): Define the new structure here...
2007         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
2008         don't carry the overhead of a function call.
2009         * m4/m4module.h: Prototype extern functions from m4/m4.c.
2010         (m4): Declare type for new struct m4 objects.
2011         (M4SYMTAB): User macro to ease finding the symbol table for the
2012         current context for module developers.
2013         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
2014         verb.
2015         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
2016         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
2017         (m4_call_macro, m4_dump_symbols, m4_expand_input)
2018         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
2019         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
2020         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
2021         m4* context parameter. Changed definitions and all callers.
2022         (m4_symtab): Alias for m4_hash to decouple the
2023         m4_symtab api from m4_hash.
2024         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
2025         m4_hash.
2026         (m4_symtab_create): New function to return an initialised
2027         m4_symtab.
2028         (m4_symtab_delete): New function to delete an m4_symtab's memory.
2029         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
2030         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
2031         instead of simply using the global m4__symtab.  Changed
2032         definitions and all callers.
2033         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
2034         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
2035         * src/main.c (main): Create a context and use that instead of the
2036         former global m4__symtab.
2038 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
2040         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
2041         to the callback.  Callbacks should not need to hardcode the
2042         hashtable they are working from, nor should we have to waste the
2043         userdata parameter to pass the table in.
2044         * m4/hash.h (m4_hash_apply_func): Require the initial table
2045         parameter.
2046         * m4/symtab.c (symtab_destroy): Use the passed table instead
2047         of hardcoding m4__symtab.
2048         (m4_symbol_popdef): Don't use the userdata parameter to pass the
2049         table to arg_destroy.
2050         (arg_destroy): Use the hash parameter, ignore userdata.
2051         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
2052         prototype.
2053         (traceon, traceoff): Call set_trace with the extra initial
2054         parameter.
2056 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
2058         More refactoring to stabilise the module api, this time for
2059         symtab.c.  Additionally, start to pay attention to function names
2060         that don't contain a verb like they should.
2062         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
2063         wrapper for m4_hash_apply to decouple the symtab module from the
2064         hash module.
2065         (m4_symbol_builtin, m4_symbol_macro): Renamed to
2066         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
2067         callers.
2068         (m4_symbol_delete): Create a macro version to save a function
2069         call.
2070         (m4_token_t, m4_data_t): These violate the POSIX reserved
2071         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
2072         all callers.
2073         (m4_token_type): Renamed to m4_token_get_type.
2074         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
2075         (m4_symtab_exit): Removed from the exported module
2076         api...
2077         * m4/m4private.h (m4__symtab, m4__symtab_init)
2078         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
2079         renamed and added to the internal api. Changed all callers.
2080         (m4_symtab_apply): A faster macro version of the function for
2081         users of the internal api.
2082         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
2083         symbol_destroy and arg_destroy.
2084         (symtab_debug): Added a prototype.
2085         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
2086         so that callers in this file get the faster macro versions from
2087         m4/m4private.h.
2089 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
2091         Refactoring modules to rationalise the API into an external
2092         documented (eventually!) API for use by modules in the `m4_'
2093         namespace declared in m4/m4module.h, an internal API between the
2094         source files we ship (including our shipped modules) in the `m4__'
2095         namespace declared in m4/m4private.h and making the rest as
2096         cohesive as possible with liberal use of the `static' keyword.
2097         This change represents an audit to m4/module.c along these
2098         guidelines.
2100         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
2101         Removed.  No longer used.
2102         (m4_module_close): Removed prototypes.
2103         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
2104         from the exported module api...
2105         * m4/m4private.h (m4__module_init, m4__module_open)
2106         (m4__module_exit): ...and renamed and added to the internal api.
2107         Changed all callers.
2108         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
2109         Centralised definitions after renaming...
2110         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
2111         (M4_FINISH_SYMBOL): ...and removing from here.
2112         (m4_module_dlerror, m4_module_remove, m4_module_close)
2113         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
2114         module_remove, module_close and caller_id.
2115         (MODULE_SELF_NAME): New macro to make reporting self errors
2116         easier.
2117         (m4_module_load, module_close, module_remove): Use it.
2118         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
2119         name.
2120         * src/main.c (main): Use it.
2122 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
2124         * README: Remove references to --enable-changeword, which has been
2125         removed from the code.
2127 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
2129         Getting rid of the annoying bug with configure --enable-debug,
2130         which spewed -e: command not found errors.  This was an interaction
2131         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
2132         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
2133         branch-1-5) to get the full fix.
2135         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
2136         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
2137         and then use the probed value of $SED.
2138         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
2139         this, it messes up the AC_REQUIRE stack.
2141 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
2143         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
2144         the destroy callback.
2145         (m4_arg_destroy): Use the hash address to free the hash node key
2146         field.
2148 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
2150         First cut at formal parameters in macros.
2152         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
2153         * m4/xstrzdup.c: New file.
2154         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
2155         associative array of parameter names to details.
2156         (m4_symbol_token): Capture macro names with parameter lists.
2157         (m4_arg_signature_parse): And build an associative array to hang
2158         from the symbol structure to map names to details.
2159         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
2160         m4_hash_resize idiom.  Now that we potentially add a little hash
2161         table to many of the entries in the symbol table, added an extra
2162         arg to set the initial size.  Changed all callers.
2163         (m4_hash_apply): New function that is basically a generalised
2164         version of...
2165         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
2166         all callers to call m4_hash_apply instead.
2167         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
2168         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
2169         m4_arg_signature association that might be attached to the symbol,
2170         * m4/hash.h (m4_hash_apply_func): Replacement type for...
2171         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
2172         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
2173         parameter lists.
2174         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
2175         (M4_IS_IDENT): Detect characters that can be safely used in
2176         parameter names.
2177         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
2178         * m4/macro.c: Corrected grammar in some comments.  Use `token'
2179         rather than `td' for m4_token variables.
2180         (m4_process_macro): If we find a dollar followed by some
2181         M4_IS_IDENT characters, replace that with the contents of the argv
2182         entry with offset stored in the m4_token_arg associated with the
2183         collected identifier.
2185 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
2187         Begin preparations for supporting formal parameters in m4 macros.
2189         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
2190         the details of a formal parameter.
2191         (m4_token): Add an arg_signature member to hold a hash table for
2192         looking up formal parameters.
2193         * m4/input.c: Update more bitrotted comments.
2194         (m4_push_builtin): Initialise arg_signature member.
2195         (init_builtin_token): Copy arg_signature member.
2196         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
2197         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
2198         replace...
2199         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
2200         (m4_macro_pushdef, m4_macro_define): ...these, And...
2201         (m4_symbol_token): ...wrapped around this new function, which
2202         vastly simplifies the arguments required by the functions it
2203         replaces.
2204         Changed all callers.
2206 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
2208         * m4/macro.c: Format changes.
2210 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
2212         * m4/input.c: Updated various bitrotted comments.
2213         (m4_push_builtin): Just pass the whole m4_token, rather than
2214         extracting all the fields in the caller.  This also allows us to
2215         check the token type for consistency.
2216         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
2217         Renamed to builtin_funcs, builtin_peek, builtin_read,
2218         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
2219         the code.  Changed all callers.
2220         (struct input_block): Similarly renamed u_m member to u_b, and
2221         changed all callers.
2222         (m4_next_token): Use bzero to initialise the data fields.
2223         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
2225 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
2227         These changes were necessary to get m4 to build on my iBook
2228         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
2229         (GCC) 3.1 20020420 (prerelease)":
2231         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
2232         inclusion of module loader headers.
2233         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
2234         * m4/Makefile.am: Ditto.
2235         (libm4_la_LIBADD): Added $(LTLIBINTL).
2236         * m4/utility.c (program_name): Removed declaration in favour of
2237         the one already in error.c!
2238         * m4/m4module.h (program_name): Define to program_invocation_name
2239         when using GNU C library. Use an explicit extern declaration.
2240         (interactive, sync_output, debug_level, hash_table_size)
2241         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
2242         (suppress_warnings, warning_status, nesting_limit, discard_comments)
2243         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
2244         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
2245         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
2246         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
2247         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
2248         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
2249         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
2250         (m4_current_line, m4_current_diversion, m4_output_current_line):
2251         Don't rely on default, use an explicit extern.
2252         * m4/error.h (error, error_at_line, error_print_progname)
2253         (error_message_count, error_one_per_line): Ditto.
2254         * m4/ltdl.c: Update from CVS libtool.
2255         * m4/ltdl.h: Ditto.
2256         * commit: Update from CVS cvs-utils.
2258 2002-11-04  Akim Demaille  <akim@epita.fr>
2260         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
2261         running m4 itself.
2262         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
2264 2002-11-04  Akim Demaille  <akim@epita.fr>
2266         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
2268 2002-11-04  Akim Demaille  <akim@epita.fr>
2270         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
2271         used as `external', and Libtool 1.4.3.
2272         (LINGUAS): Remove.
2273         (LTLIBOBJS): Don't play with it.
2274         * intl/: Remove.
2275         * Makefile.am (SUBDIRS): Remove intl.
2276         (ACLOCAL_AMFLAGS): Add -I config.
2277         (EXTRA_DIST): Add config/config.rpath.
2278         * po/LINGUAS: New.
2279         * po/Makevars: New.
2280         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
2282 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
2284         Preparations for refactoring syntax tables to allow reverse
2285         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
2286         speed of normal lookups in an array of unsigned short.
2288         * m4/input.c (single_quotes, single_comments, use_macro_escape):
2289         Moved from here...
2290         * m4/m4private.h (m4__single_quotes, m4__single_comments,
2291         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
2292         is for internal symbols which unavoidably pollute the global
2293         namespace, but are not published APIs.
2294         Adjusted all callers.
2295         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
2296         m4_set_comment, m4_set_syntax, set_syntax_internal,
2297         unset_syntax_attribute): Moved from this file...
2298         * m4/syntax.c: New. ...to this file.
2299         Also added an m4_syntax_exit stub for orthogonality.
2300         * src/main.c (main): Use it.
2301         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
2302         * m4/m4module.h: Reformatting.  New prototypes.
2304 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
2306         * bootstrap (aclocal_apiversion): The aclocal apiversion is
2307         distinct from the automake release number (in that the apiversion
2308         apparently has no micro-version-component).
2309         (aclocal_apilibdir): Use it.
2311 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
2313         * m4/hash.c (m4_hash_resize): New function.
2314         * m4/hash.h: Add prototype.
2315         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
2316         benchmarking to find a good value for, say, autoconf.  This is
2317         already a little quicker than before for me.
2319         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
2320         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
2321         and reenamed.
2322         * m4/hash.h: Adjust prototypes.
2324 2002-01-22  Akim Demaille  <akim@epita.fr>
2326         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
2327         APIVERSION scheme.
2328         * tests/Makefile.am (package.m4): New.
2329         * tests/atlocal.in: Adjust to CVS Autotest.
2330         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
2331         * configure.ac: LIBOBJ is a forbidden string.
2332         Simplify AM_INIT_AUTOMAKE invocation.
2333         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
2334         options.m4.
2336 2001-10-19  Akim Demaille  <akim@epita.fr>
2338         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
2340 2001-10-19  Akim Demaille  <akim@epita.fr>
2342         * m4/input.c (m4_next_token): Display where was opened what is
2343         not closed.
2345 2001-10-19  Akim Demaille  <akim@epita.fr>
2347         * m4/macro.c (expand_argument): Display where was opened what is
2348         not closed.
2350 2001-10-18  Akim Demaille  <akim@epita.fr>
2352         * m4/input.c, modules/m4.c: Formatting changes.
2354 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
2356         * bootstrap: s/configure.in/configure.ac/
2358 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
2360         * m4/symtab.c (m4_symbol_destroy): This function calls
2361         m4_symbol_popdef, which recycles a symbols memory when the last
2362         definition is popped.  Since we were passing the address of the
2363         symbol name found in the symbol table, and it was being removed
2364         partway through m4_symbol_destroy() we were referencing freed
2365         memory for the balance of the function.  Now we take a copy of the
2366         symbol name tring and use that as a key into the symbol
2367         table... that way if the original symbol name is freed, the copy
2368         is still valid.
2370 2001-10-13  Akim Demaille  <akim@epita.fr>
2372         * m4/ltdl.c: Update.
2374 2001-10-13  Akim Demaille  <akim@epita.fr>
2376         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
2377         Don't gettextize internal error messages.
2379 2001-10-13  Akim Demaille  <akim@epita.fr>
2381         * tests/macros.at (Arity and defn): New failing test.
2382         (Arity, defn, and freeze): New.
2384         Fix `Arity and defn'.
2386         * m4/input.c (m4_push_macro): Don't forget the arity.
2387         * modules/m4.c (defn): Likewise.
2389 2001-10-13  Akim Demaille  <akim@epita.fr>
2391         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
2392         to...
2393         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
2394         (Propagation of traceon, Propagation of --trace): this new file.
2396 2001-10-13  Akim Demaille  <akim@epita.fr>
2398         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
2399         interface instead of (name, argc...).
2400         Upon failure, specify which argument was guilty.
2401         Adjust callers.
2403 2001-10-13  Akim Demaille  <akim@epita.fr>
2405         * modules/evalparse.c: Save translators' time: don't translate
2406         internal error messages.
2407         (m4_evaluate): Simplify/normalize error messages.
2408         * doc/m4.texinfo (Eval): Adjust.
2410 2001-10-13  Akim Demaille  <akim@epita.fr>
2412         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
2413         where no checking is needed.
2414         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
2415         interface instead of (name, argc...).
2416         Adjust callers.
2417         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
2418         elsewhere.
2420 2001-10-13  Akim Demaille  <akim@epita.fr>
2422         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
2423         exclude the builtin name from the count.
2424         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
2425         calling ifelse with a single argument is valid.
2426         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
2427         with 1 and 2 args, mostly to strengthen the test suite.
2429 2001-10-13  Akim Demaille  <akim@epita.fr>
2431         * m4/output.c (m4_make_diversion, m4_insert_file)
2432         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
2434 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
2436         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
2437         since we call these things builtins in the rest of the code!
2439         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
2441 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
2443         Rather than forcing each builtin definition to manage its own
2444         argument range checking, tabulate the maxima and minima for all
2445         builtins in each module.  This forces us to consider what the
2446         valid ranges for each builtin should be, and moves the checking
2447         code out of each builtin implementation and into the builtin
2448         caller infrastructure.
2450         * m4/m4module.h (struct m4_builtin): Add argument minima and
2451         maxima.
2452         * m4/m4private.h (struct m4_token): Reflect them here too.
2453         * m4/input.c (struct input_block): ...and here.
2454         (m4_token_copy): New function for token copying.
2455         (init_macro_token): Copy them from a token to the input stack.
2456         (m4_next_token): Don't forget to initialise them for text
2457         macros.
2458         * m4/macro.c (expand_argument): Use m4_token_copy, and also
2459         check argument counts before calling the builtin handler.
2460         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
2461         (m4_symbol_macro): Likewise.
2462         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
2463         parameters.  Updated all callers.
2464         (m4_builtin_define): Ditto.
2465         (m4_macro_pushdef, m4_macro_define): Ditto.
2466         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
2467         * modules/evalparse.c:  Declare argument counts for defined
2468         builtins and remove explicit calls to m4_bad_argc().
2469         * modules/gnu.c: Ditto.
2470         * modules/load.c: Ditto.
2471         * modules/m4.c: Ditto.
2472         * modules/modtest.c: Ditto.
2473         * modules/mpeval.c: Ditto.
2474         * modules/perl.c: Ditto.
2475         * modules/shadow.c: Ditto.
2476         * modules/stdlib.c: Ditto.
2477         * modules/time.c: Ditto.
2478         * TODO: Updated.
2480 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
2482         The trace semantics now attach the trace bit to a symbol name.
2483         For as long as a traceon(`foo') is active, calls to foo will be
2484         traced regardless of intervening undefines or module unloads.
2485         Fixed the flag propogation issues differently to the fixes
2486         reverted with the last attempt at nailing down trace:
2488         * m4/m4private.h:  This file is not visible outside of the m4
2489         source tree, so I removed all the `M4_' and `m4_' prefixes to save
2490         on typing.  Updated all clients.
2491         (m4_token): New typedef contains the fields that need to be passed
2492         around with the low level tokeniser.
2493         (m4_token_data):  Removed.
2494         (m4_symbol): Now contains the traced flag again.
2495         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
2496         the trace bit set.  This change is contained entirely within this
2497         module and doesn't leak out into the callers.  Updated all
2498         clients.
2499         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
2500         new fields in m4_token.  Updated all clients.
2501         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
2502         that `groks_macro_args' and `blind_if_no_args' flags are retained
2503         when defn() results are passed around in m4 code.  Updated all
2504         callers.
2505         (m4_builtin_define): Ditto.
2506         (m4_macro_pushdef, m4_macro_define): Ditto.
2507         * m4/input.c (struct input_block): Add a flags field to facilitate
2508         the above.
2509         (m4_push_macro):  ...use it.
2510         (init_macro_token):  Retrieve it.
2511         (m4_next_token): Initialise it.
2512         * m4/macro.c (expand_argument):  Copy it.
2513         * m4/m4module.h: Adjust.
2514         * tests/builtins.at:  Adjust the expected output of the trace
2515         tests to reflect the change in semantics.
2516         * tests/modules.at (modules: trace):  Check that unloading a
2517         module which supplies a traced symbol definition doesn't lose te
2518         trace bit.
2520 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
2522         * modules/gnu.c (m4_macro_table): Display the timetamp when
2523         expanding __m4_version__.
2525         * configure.ac (--with-modules): Forgot a comma in the
2526         AC_HELP_STRING parameter list.
2528 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
2530         * bootstrap: Remove aclocal.m4t when it is no longer required.
2532 2001-10-05  Akim Demaille  <akim@epita.fr>
2534         * tests/Makefile.am: Adjust for gnuprog2.
2535         * tests/m4.in: There can be a leading path.
2536         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
2537         * tests/testsuite.at: Adjust to the most recent Autotest.
2538         (AT_CHECK_M4_FILTER): Fix and rename as...
2539         (AT_TEST_M4): this.
2540         * tests/others.at: Use it.
2542         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
2543         variable in shell scripts, one uses `$'...
2545 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
2547         * configure.ac: `rm -f $m4_getopt_h' was lost.
2549 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
2551         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
2552         time.  Define it for config.h in order to...
2553         * src/main.c (main): ...display the timestamp for --version.
2555 2001-10-04  Akim Demaille  <akim@epita.fr>
2557         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
2558         previous builtins `regexp' and `patsubst'.
2559         (regexp, patsubst): Use them.
2560         (eregexp, epatsubst): New builtins.
2561         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
2562         (Epatsubst and Patsubst, Eregexp and Regexp): these.
2563         (Extensions): More info on REs.
2565 2001-10-04  Akim Demaille  <akim@epita.fr>
2567         * modules/modtest.c (init_handler): Consistently output to stderr.
2568         (finish_handler): New.
2569         (test): The `if' is an `assert'.
2570         * tests/modules.at: Adjust.
2572 2001-10-04  Akim Demaille  <akim@epita.fr>
2574         * m4/utility.c (m4_bad_argc): Detail the mismatches.
2576 2001-10-01  Akim Demaille  <akim@epita.fr>
2578         * tests/generate.awk: Tag the tests with `documentation'.
2579         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
2580         Use the make the existing modtest tests more uniform, and complete
2581         the set of possibilities.
2583 2001-10-01  Akim Demaille  <akim@epita.fr>
2585         * config/gmp.m4: Consult the user before using GMP: use
2586         --without-gmp.
2587         * configure.ac: Adjust.
2588         * modules/gmp.c: No protection needed as the module is not built
2589         if GMP is not used.
2591 2001-10-01  Akim Demaille  <akim@epita.fr>
2593         * tests/generate.awk: Remove debugging code.
2594         (fatal): Specify the current location.
2596         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
2597         * modules/gnu.c, modules/m4.c: Use M4ARG.
2599 2001-10-01  Akim Demaille  <akim@epita.fr>
2601         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
2602         (m4_regexp_compile): New.
2603         (regexp, patsubst): Use it.
2605 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
2607         Reinstate the memory handling improvements from the patch I just
2608         reverted.  Relevant ChangeLog entries repeated here:
2610         * m4/module.c (m4_module_remove): New function that holds the core
2611         of the old m4_module_unload.
2612         (m4_module_unload): Use it.
2613         (m4_module_unload_all): When we know the modules will never be
2614         used again (i.e. on exit), free up as much module memory as
2615         possible.  There are still some artifacts from resident modules
2616         living inside ltdl.c, but everything else is freed.
2617         * m4/debug.c (m4_debug_exit): Free memory allocated in
2618         m4_debug_init().
2619         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2620         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2621         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2622         * m4/m4module.h: Updated prototypes.
2623         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2624         * m4/hash.h: Updated prototypes.
2625         * src/main.c (main): Use all these new functions to clean up as
2626         much memory as possible before exit.
2628 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
2630         Reverted my large patch for removing the old m4_symbol
2631         structure on 2001-09-20.  We are still not happy about the way
2632         trace works in conjunction with defn and undefine, and leaving
2633         the reverted patch active prevents us from moving the traced
2634         bit from the definition back to the symbol.
2636 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
2638         * configure.in: Moved to...
2639         * configure.ac: ...here.  Added a libtool like timestamped
2640         banner, and tidied up the libltdl cruft.
2641         * config/mkstamp: Script to extract a timestamp from ChangeLog.
2642         * modules/Makefile.am (INCLTDL):  Removed.  This is required
2643         only when libltdl is configured in a subdirectory.
2644         * src/Makefile.am: Ditto.
2645         (LIBADD_DL):  No need to add this again, libtool already knows
2646         that libm4.la depends on it.
2647         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
2648         them.
2650         * TODO: stackovf.c is basically broken.
2651         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
2653 2001-09-28  Akim Demaille  <akim@epita.fr>
2655         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
2657 2001-09-27  Akim Demaille  <akim@epita.fr>
2659         * tests/m4.in: Don't use short options.
2660         Simplify the stderr signature normalization.
2662 2001-09-27  Akim Demaille  <akim@epita.fr>
2664         tests/m4 shall be position independent.
2666         * tests/m4.in: New.
2667         * tests/m4: Remove.
2668         * tests/testsuite.at: No args to AT_INIT.
2669         * configure.in, tests/Makefile.am: Adjust.
2671 2001-09-22  Akim Demaille  <akim@epita.fr>
2673         Autotest has changed again.
2675         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
2676         (package.m4): Remove.
2677         * configure.in: Adjust to LIBADD_GMP.
2679 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
2681         * config/gmp.m4 (AC_ARG_WITH): Removed.
2682         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
2683         (AC_LIB_GMP): When performing a test compile against libgmp,
2684         include the header gmp.h if possible, and link against -lgmp.  If
2685         they both work define USE_GMP.
2686         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
2687         (mpeval_LTX_init_func): Complain on load that there was no libgmp
2688         at compile time.
2690 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
2692         * m4/evalparse.c: Moved to...
2693         * modules/evalparse.c:  ...here.  This code is shared between
2694         modules/mpeval.c and modules/m4.c, so there is no need to pollute
2695         the libm4 API with its details.  Moderately rewritten to interface
2696         into its clients more simply.
2697         * m4/eval.c: Deleted.  Migrated functionality to...
2698         * modules/m4.c: ...here.
2699         (builtin_eval):  Implemented in terms of the new interface style.
2700         * modules/mpeval.c (builtin_mpeval): Ditto.
2701         * m4/m4module.h: Removed references to the former m4/eval.c.
2702         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
2703         (EXTRA_libm4_la_SOURCES): Deleted.
2704         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
2705         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
2707 2001-09-20  Akim Demaille  <akim@epita.fr>
2709         * config/gmp.m4 (AM_WITH_GMP): Rename as...
2710         (AC_LIB_GMP): this.
2711         By default, use gmp.
2712         Massive revamping.
2713         * configure.in: Adjust.
2714         Use Automake conditionals for USE_GMP.
2715         Always compute sizeof (long long int).
2716         This was a bug BTW, as `eval' (not `mpeval') depends on it:
2717         before, it was used _only_ if mpeval was not activated.
2718         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
2719         (mpeval_la_LIBADD): New macros.
2720         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
2721         Indent.
2722         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
2723         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
2724         WITH_GMP.
2726 2001-09-20  Akim Demaille  <akim@epita.fr>
2728         * tests/Makefile.am (package.m4): New.
2729         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
2731 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
2733         More cleanup.  After the last patch, m4_symbol holds nothing but
2734         the head of a chain of m4_token_data.  So I have removed the old
2735         m4_symbol, so that m4_token_data chains are stored directly in the
2736         value cell of a hash table node.  But there's more... m4_symbol
2737         was a more natural name for the symbol value cell, and now that it
2738         is gone I have renamed the former m4_token_data structure to
2739         m4_symbol.  This change turned out to be a pig to get right, since
2740         the original code didn't need to modify the value cell itself,
2741         since changing the chain happened inside the m4_symbol that used
2742         to be returned -- I had to pass the address of the value cell
2743         across various function calls, incase the head value changed.  I
2744         also tightened up the memory management to help me find a nasty
2745         memory corruption bug that took me all night to track down...
2747         * m4/m4private.h (struct m4_symbol): Removed.
2748         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
2749         all references.
2750         * m4/hash.c (m4_hash_iterator_value): Return the address of the
2751         value cell.  Updated all callers.
2752         * m4/symtab.c: Took advantage of the simplification in the data
2753         structures to rewrite a lot of this file more simply.  There is
2754         still some room for optimisation here, but we should tackle that
2755         systematically closer to the release.
2757         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
2758         revealed.  This version is ahead of CVS libtool until I get chance
2759         to flush my changes.
2760         * m4/module.c (m4_module_remove): New function that holds the core
2761         of the old m4_module_unload.
2762         (m4_module_unload): Use it.
2763         (m4_module_unload_all): When we know the modules will never be
2764         used again (i.e. on exit), free up as much module memory as
2765         possible.  There are still some artifacts from resident modules
2766         living inside ltdl.c, but everything else is freed.
2767         * m4/debug.c (m4_debug_exit): Free memory allocated in
2768         m4_debug_init().
2769         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2770         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2771         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2772         * m4/m4module.h: Updated prototypes.
2773         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2774         * m4/hash.h: Updated prototypes.
2775         * src/main.c (main): Use all these new functions to clean up as
2776         much memory as possible before exit.
2778 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
2780         The `traced' flag needs to be attached to the definition of a
2781         symbol rather than the current symbol containing the definition.
2782         Implementing this showed up some long standing post 1.4 bugs in
2783         flag propogation which I also fixed.
2785         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
2786         (struct m4_token_data): And add it back in here.
2787         * m4/input.c (init_macro_token): Propogate the traced flag
2788         correctly.
2789         * m4/macro.c (expand_argument): Ditto.
2790         * tests/builtins.at (trace2, trace3): New tests based on Akim's
2791         sadistic email ;-)
2793 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
2795         * m4/m4private.h (struct m4_token_data): Simplified by removing
2796         the redundant `traced' flag, and one level of structure nesting.
2797         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
2798         * m4/input.c (init_macro_token): No need to initialise removed
2799         `traced' field.
2800         * m4/macro.c (expand_argument): No need to copy it either.
2801         * m4/utility.c (m4_token_data_func_traced): Or provide an access
2802         function.
2804         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
2805         dependant on multiple symbols with the same key, so preserving
2806         relative symbol order in each bucket during resizing is no longer
2807         required.  The resize function is considerably faster as a result.
2809         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
2810         s/m4_symbol_insert/m4_symbol_define/g;
2811         s/m4_builtin_insert/m4_builtin_define/g;
2812         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
2814 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
2816         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
2817         commits, the m4_lookup_symbol dispatch function is split into
2818         specialised functions that must be called directly.
2820         * m4/m4module.h (m4_symbol_lookup_t): Removed.
2821         * m4/symtab.c (m4_lookup_symbol): Removed.
2822         (m4_symbol_builtin, m4_symbol_macro): New functions.
2823         * m4/builtin.c (m4_builtin_define): Split into...
2824         (m4_builtin_pushdef, m4_builtin_insert): ...these.
2825         (m4_macro_define): Split into...
2826         (m4_macro_pushdef, m4_macro_insert): ...these.
2827         * src/main.c (main): Set command line macros from `-D' parameters
2828         using `m4_macro_define'.
2830 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
2832         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
2833         this from m4_remove_table_reference_symbols().
2834         * m4/m4module.h, m4/module.c: Updated all references.
2836 2001-09-07  Akim Demaille  <akim@epita.fr>
2838         * modules/stdlib.c, modules/times.c: Misc cleanups.
2840 2001-09-07  Akim Demaille  <akim@epita.fr>
2842         * configure.in: We now need Autoconf 2.52e.
2843         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
2844         and `M4_SYMBOL_DELETE'.
2845         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
2846         * src/main.c (main): Adjust.
2848 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
2850         Fix the obstack.h problem once and for all!  At configure time we
2851         can test for a system supplied obstack.h:  depending on the
2852         result, we now generate system.h with an #include of the correct
2853         header.  As a bonus, I've also added a --with-included-obstack,
2854         incase the user doesn't like the system obstack for some
2855         reason... and also we can test the shipped obstack on a system
2856         that has oe of its own.  We also now need to be careful to add
2857         build directories to the include search path, since the generated
2858         system.h will be in the build tree.
2860         * configure.in (AC_CONFIG_FILES): Generate system.h from
2861         system-h.in.
2862         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
2863         include the system obstack header or the copy shipped with M4.
2864         Allow the user to override configure and force the build to use
2865         the shipped version.
2866         * m4/system-h.in: New file, template for...
2867         * m4/system.h: ...this.  Now deleted.
2868         * m4/m4module.h: Include system.h before everything else.
2869         * src/freeze.c: Ditto.
2870         * m4/Makefile.am (dist-hook): Remove generated system.h.
2871         (INCLUDES): Check builddir for generated headers before checking
2872         srcdir.
2873         * modules/Makefile.am (INCLUDES): Ditto.
2874         * src/Makefile.am (INCLUDES): Ditto.
2876 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
2878         * TODO: Remove the items that have been addressed already.
2880 2001-09-05  Akim Demaille  <akim@epita.fr>
2882         * src/main.c (main): Standardize --version.
2884 2001-09-05  Akim Demaille  <akim@epita.fr>
2886         * modules/format.c (format): Have a bigger `str'.
2888 2001-09-05  Akim Demaille  <akim@epita.fr>
2890         Rationalize warnings, reporting the macro name as if it were a
2891         program name, and assertions.
2893         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
2894         (M4WARN): New.
2895         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
2896         (m4_symbol_delete):
2897         Use assert for internal errors.
2898         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
2899         M4WARN.
2900         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
2901         M4WARN and assert.
2902         * tests/builtins.at (pushpop): Adjust.
2904 2001-09-05  Akim Demaille  <akim@epita.fr>
2906         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
2907         with pointers.
2909 2001-09-05  Akim Demaille  <akim@epita.fr>
2911         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
2912         * m4/macro.c, m4/symtab.c: Adjust.
2914 2001-09-05  Akim Demaille  <akim@epita.fr>
2916         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
2917         (m4_symbol_pop, m4_symbol_del): this.
2918         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
2919         (m4_symbol_popdef, m4_symbol_delete): New.
2920         (m4_lookup_symbol): Adjust.
2921         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
2923 2001-09-05  Akim Demaille  <akim@epita.fr>
2925         * m4/m4module.h (m4_symbol_lookup): Rename as...
2926         (m4_symbol_lookup_t): this.
2928 2001-09-05  Akim Demaille  <akim@epita.fr>
2930         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
2931         unused.
2932         * m4/symtab.c (m4_lookup_symbol): Adjust.
2934 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
2936         Bootstrap will now work with Libtool 1.4.1 or higher:
2937         * bootstrap: Remove stale autom4te.cache files when
2938         rebootstrapping.
2939         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
2940         libtool.m4.
2941         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
2942         libtool.m4 directly.
2943         Run libtoolize to refresh ltmain.sh.
2944         * config/ltmain.sh:  Deleted.
2945         * acinclude.m4: Deleted.
2946         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
2948         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
2949         implementation for the cvs impaired libtool user.
2951 2001-09-03  Akim Demaille  <akim@epita.fr>
2953         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
2954         internal errors.
2955         Avoid using `default' in switch, as it hides useful compiler
2956         warnings when a case is forgotten.
2958 2001-09-03  Akim Demaille  <akim@epita.fr>
2960         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
2961         is no such thing as `WITH_MODULES'.
2963 2001-09-03  Akim Demaille  <akim@epita.fr>
2965         Improve the test suite's selfcontainedness.
2967         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
2968         (Include, Undivert): Tag the other input files.
2969         * tests/generate.awk: Catch `@comment file:'.
2970         `-I $src' is no longer needed.
2971         `next' is really like `return': the rest is skipped.
2972         Adjust to `input.m4'.
2973         (fatal): New function.
2974         * tests/foo, tests/incl.m4: Remove.
2976 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
2978         The shadowing mechanism and, infact, the whole symbol table
2979         implementation was creaking under the weight of the features piled
2980         on top of it.  We now have a separate hash table module which will
2981         dynamically resize to keep symbol density withing good performace
2982         limits, and a new symtab module layered above it.  Symbol lookups
2983         are now marginally more efficient (since the shadowed flag is no
2984         longer required) and symbol removal, such as on module unload, is
2985         considerably faster due to a reorganisation of the data structures
2986         used in symtab.c.
2988         * src/main.c (main):  Don't mention `-H'.
2989         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
2990         effect.
2991         * NEWS: Updated.
2992         * m4/hash.c: New generalised dynamic hash table data structure
2993         management module.
2994         * m4/hash.h: Public interface.
2995         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
2996         (libm4_la_SOURCES): Add hash.c.
2997         * m4/symtab.c: More or less rewritten from scratch, within the
2998         bounds of the previous API.
2999         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
3000         call.  Updated all callers.
3001         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
3002         declarations to reflect API changes.
3003         (M4INIT): Generate a declaration too, to avoid the warning with
3004         --enable-debug builds.
3005         (M4FINISH): Ditto.
3006         (HASHMAX): Removed.
3007         * m4/utility.c (hash_table_size):  Removed.
3008         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
3009         names, which are then looked up by builtin_dumpdef() as necessary.
3010         This implies a small speedup in builtin_symbols(), which discarded
3011         all of the symbol info under the old call.
3012         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
3013         shadowing is implicit in respect to the new data structures.
3014         symbol names are no longer duplicated here, they are stored in the
3015         key field of the hash table.
3016         Moved macro_args and blind_no_args...
3017         (m4_token_data): ...to here.
3018         m4/macro.c (expand_macro):  Added a name argument since the symbol
3019         name is no longer copied into each struct m4_symbol.  Modified all
3020         callers.
3021         (collect_arguments):  Ditto.
3022         * modules/m4.c (set_trace): Ditto.
3023         * modules/gnu.c (builtin_symbols): Updated.
3024         * src/freeze.c (produce_symbol_dump): Much improved in light of
3025         the improved symbol table layout.
3027 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
3029         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
3030         to M4_SYMBOL_NEXT.
3031         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
3032         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
3033         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
3034         SYMBOL_HANDLE): Ditto.
3035         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
3036         modules/gnu.c, modules/m4.c, src/freeze.c,
3037         src/main.c:  Updated all references.
3039         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
3040         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
3041         already listed in m4_LDADD... how did that ever used to work?
3042         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
3043         link.
3044         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
3045         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
3047         * tests/m4: Don't call the m4 wrapper script with libtool, it
3048         works fine all by itself.
3050 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
3052         The experimental `changeword' feature never took off, and has
3053         no obvious advantages over `changesyntax' to compensate the
3054         enormous speed penalty it carries:
3055         * configure.in (ENABLE_CHANGEWORD): Removed.
3056         * m4/m4module.h (m4_set_word_regexp): Removed.
3057         * m4/m4private.h (m4_token_data): Removed original_text field.
3058         * m4/utility.c (m4_token_data_orig_text): Removed.
3059         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
3060         * m4/macro.c: Ditto.
3061         * src/main.c: Ditto.
3062         * modules/Makefile.am (changeword.la): Removed.
3063         * modules/changeword.c: File removed.
3064         * doc/m4.texinfo: References to changeword and --word-regexp
3065         removed.
3066         * po/POTFILES.in: modules/changeword.c removed.
3067         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
3068         * tests/builtins.at (changeword): Test removed.
3070 2001-08-30  Akim Demaille  <akim@epita.fr>
3072         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
3073         This also help having a single list of m4 files: in
3074         config/Makefile.am.
3075         * config/Makefile.am (STANDARD_MACROS): Rename as...
3076         (ACLOCAL_MACROS): this.
3077         (list-standard-macros): Remove.
3078         (spy): New.
3080 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
3082         In an attempt to moderate my egomania...
3083         * tests/modules.at: Remove attributions.
3085         * tests/generate.awk: When making substitutions to "@&t@", either
3086         "&" or "\&" in the substitution string argument to gsub refer back
3087         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
3088         67 now pass for me.
3090 2001-08-29  Akim Demaille  <akim@epita.fr>
3092         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
3093         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
3094         (sync-lines, trace, translit, undivert, wrap): Move to...
3095         * tests/builtins.at: this new file.
3096         * tests/others.at (Discard comments, import-environment): Move to...
3097         * tests/options.at: this new file.
3099 2001-08-29  Akim Demaille  <akim@epita.fr>
3101         * tests/others.at (Freezing modules)
3102         (--module-directory: absolute path, modpath2, modpath3)
3103         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
3104         * tests/modules.at: here, new file.
3105         * tests/others.at, tests/generate.awk: Add a banner.
3106         * tests/testsuite.at: Adjust.
3107         (AT_CHECK_M4_FILTER): New, but unused.
3109 2001-08-29  Akim Demaille  <akim@epita.fr>
3111         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
3112         handle that.
3113         * tests/others.at (wrap): Inline wrap.m4.
3114         (shadow): Inline shadow.m4.
3115         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
3116         * tests/m4: Simplify.
3118 2001-08-29  Akim Demaille  <akim@epita.fr>
3120         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
3121         --language.
3123 2001-08-29  Akim Demaille  <akim@epita.fr>
3125         * tests/generate.awk (normalize): s/@__@/@&t@/.
3127 2001-08-28  Akim Demaille  <akim@epita.fr>
3129         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
3131 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
3133         * bootstrap (generate.awk): Generate test cases with new script.
3135 2001-08-27  Akim Demaille  <akim@epita.fr>
3137         * tests/Makefile.am (installcheck-local): Don't use
3138         `dc_install_base' which is not visible here, but `exec_prefix'
3139         which is clearly the RT anyway.
3140         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
3141         related to testing a now installed m4.
3142         * tests/m4: Do it here.
3144 2001-08-27  Akim Demaille  <akim@epita.fr>
3146         * tests/others.at (indir): Formatting change.
3148 2001-08-27  Akim Demaille  <akim@epita.fr>
3150         * tests/Makefile.am (installcheck-local): New.
3151         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
3152         the test suite.
3153         Prefer options over envvars.
3154         * src/main.c (main): First bug caught by the test suite (yeah!):
3155         --batch lacked a `break' which resulted in an accidental
3156         invocation of --discard-comments.
3158 2001-08-27  Akim Demaille  <akim@epita.fr>
3160         * tests/others.at (capitalize, changeword, comments, ddivert)
3161         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
3162         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
3163         (sysv-args, trace, translit, undivert): Don't rely on files in
3164         examples/: AT_DATA them.
3166 2001-08-27  Akim Demaille  <akim@epita.fr>
3168         Let the test suite use a wrapper around the not installed m4 to
3169         pretend it is (installed).
3171         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
3172         such a way that m4 does not process them.
3173         * configure.in: The package name seems to be `m4', not `M4'.
3174         * tests/m4: New.
3175         * tests/atlocal.in (at_package, M4): Remove.
3176         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
3178 2001-08-27  Akim Demaille  <akim@epita.fr>
3180         * tests/Makefile.am (CLEANFILES): Remove.
3181         (DISTCLEANFILES, clean-local): New.
3182         * examples/mktests.sh: Remove.
3184 2001-08-27  Akim Demaille  <akim@epita.fr>
3186         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
3187         Don't use aclocal: it's written by hand.
3188         * aclocal.m4: m4_include all the files instead of being built by
3189         aclocal.
3190         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
3191         until it reads the traces by itself.
3192         * configure.in: Require Autoconf 2.42c as we are now using
3193         AC_CONFIG_TESTDIR instead of AT_CONFIG.
3194         Catch unexpanded `jm_' macros.
3195         * config/atconfig.m4: Remove.
3196         * config/error.m4: new.
3197         * config/Makefile.am: Ship the files included by aclocal.m4.
3198         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
3199         (TESTSUITE_AT): this, to please Automake.
3200         (TESTSUITE): This target uses autotest/autotest.m4, not
3201         autotest/general.m4.
3202         * tests/testsuite.at: Prereq Autotest 2.52c.
3203         * examples/Makefile.am (pkgdata_DATA): Rename as...
3204         (dist_pkgdata_DATA): this.
3205         * doc/Makefile.am (man_MANS): Rename as...
3206         (dist_man_mans): this.
3208 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
3210         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
3211         Robert Collins, building on Cygwin no longer requires Windows
3212         import and export symbol decorations.
3213         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
3214         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
3215         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3216         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3217         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3218         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3219         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3220         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3221         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3222         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
3223         anymore.
3224         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
3225         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
3227 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
3229         Ansify the source.  Previously we had a mix, where my code was
3230         in a K&R compatible style, and the preexisting code was in ANSI
3231         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
3232         and now the code base is much cleaner.
3234         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
3235         VOID macro and all users.
3236         * m4/m4module.h:  Ansify function prototypes and headers.
3237         * m4/builtin.c:  Ditto.
3238         * m4/evalparse.c:  Ditto.
3239         * m4/input.c:  Ditto.
3240         * m4/macro.c:  Ditto.
3241         * m4/module.c:  Ditto.
3242         * m4/output.c:  Ditto.
3243         * m4/path.c:  Ditto.
3244         * m4/symtab.c:  Ditto.
3245         * m4/utility.c:  Ditto.
3246         * modules/format.c:  Ditto.
3247         * modules/gnu.c:  Ditto.
3248         * modules/m4.c:  Ditto.
3249         * modules/mpeval.c:  Ditto.
3250         * src/freeze.c:  Ditto.
3251         * src/m4.h:  Ditto.
3252         * src/main.c:  Ditto.
3254 2001-08-20  Akim Demaille  <akim@epita.fr>
3256         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
3257         generated with stock 2.52.
3259 2001-08-20  Akim Demaille  <akim@epita.fr>
3261         * config/atconfig.m4: New, until part of Autoconf per se.
3262         * configure.in (AT_CONFIG): Use it.
3263         Adjust.
3264         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
3265         * tests/atlocal.in: New.
3266         * tests/generate.awk: For the time being, the empty quadrigraph is
3267         `@__@'.
3268         * tests/others.at (changeword, gmp): Check the configuration
3269         variable against `yes'.
3270         * tests/testsuite.at (dnl): Allow it, as it's used all over the
3271         place.
3273 2001-08-20  Akim Demaille  <akim@epita.fr>
3275         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
3276         * modules/m4.c (undivert): Disable the possibility of undiverting
3277         several files at once: it is not documented, it is inconsistent
3278         with the other macros, it can be straightforwardly mocked by
3279         several invocations, and most importantly, it prevents the
3280         possibility of other kinds of extension.
3281         Use `m4_numeric_arg'.
3283 2001-08-20  Akim Demaille  <akim@epita.fr>
3285         * examples/include.m4: Typo.
3286         * tests/generate.awk: Really add it.
3287         * tests/Makefile.am: Adjust.
3288         * tests/others.at (Discard comments): It sure fails without `-c'.
3289         (include, undivert): Add -I examples/.
3291 2001-08-20  Akim Demaille  <akim@epita.fr>
3293         Use sprintf, not ecft and friends since it is standard, portable,
3294         simplifies the code, and since the latter is even deprecated
3295         according to the GNU libc documentation.
3297         * modules/format.c: Drop evct support.
3299 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
3301         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
3302         for `-pipe' here...
3303         * configure.in: ...do it here instead.
3305         * c-boxes.el: Deleted.
3306         * m4/builtin.c: Reformat box comments to be closer to GNU
3307         standards.
3308         * m4/debug.c:  Ditto.
3309         * m4/eval.c:  Ditto.
3310         * m4/evalparse.c:  Ditto.
3311         * m4/input.c:  Ditto.
3312         * m4/m4module.h:  Ditto.
3313         * m4/macro.c:  Ditto.
3314         * m4/output.c:  Ditto.
3315         * m4/symtab.c:  Ditto.
3316         * m4/utility.c:  Ditto.
3317         * modules/changeword.c:  Ditto.
3318         * modules/format.c:  Ditto.
3319         * modules/gnu.c:  Ditto.
3320         * modules/load.c:  Ditto.
3321         * modules/m4.c:  Ditto.
3322         * modules/modtest.c:  Ditto.
3323         * modules/mpeval.c:  Ditto.
3324         * modules/perl.c:  Ditto.
3325         * modules/shadow.c:  Ditto.
3326         * modules/stdlib.c:  Ditto.
3327         * modules/time.c:  Ditto.
3328         * src/freeze.c:  Ditto.
3329         * src/main.c:  Ditto.
3331 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
3333         * m4/module.c: Fixup some errors in the description comment.
3335 2001-08-17  Akim Demaille  <akim@epita.fr>
3337         * tests/others.at (iso8859): Specify the path to the M4 test file.
3338         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
3339         files in error messages.
3341 2001-08-17  Akim Demaille  <akim@epita.fr>
3343         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
3344         * tests/others.at: Adjust input files paths.
3345         * tests/atconfig.in: Set top_builddir.
3346         * tests/Makefile.am: Adjust.
3347         `testsuite' is in src, not build.
3349 2001-08-17  Akim Demaille  <akim@epita.fr>
3351         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
3352         (generate.at): Install a temporary hack until the actual
3353         generate.awk is added to the repository.
3354         * tests/atconfig.in: New.
3356 2001-08-17  Akim Demaille  <akim@epita.fr>
3358         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
3360 2001-08-17  Akim Demaille  <akim@epita.fr>
3362         * doc/m4.texinfo: Promote proper quotation.
3364 2001-08-17  Akim Demaille  <akim@epita.fr>
3366         Remove the non Autotest tests.
3368         * tests/other-tests/capitalize.test,
3369         * tests/other-tests/changeword.test,
3370         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
3371         * tests/other-tests/debug.test,
3372         * tests/other-tests/discard-comments.m4,
3373         * tests/other-tests/discard-comments.test,
3374         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
3375         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
3376         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
3377         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
3378         * tests/other-tests/hanoi.test,
3379         * tests/other-tests/import-environment.m4,
3380         * tests/other-tests/import-environment.test,
3381         * tests/other-tests/include.test, tests/other-tests/indir.test,
3382         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
3383         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
3384         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
3385         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
3386         * tests/other-tests/modtest.test,
3387         * tests/other-tests/multiquotes.test,
3388         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
3389         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
3390         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
3391         * tests/other-tests/sync-lines.m4,
3392         * tests/other-tests/sync-lines.test,
3393         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
3394         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
3395         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
3396         * tests/other-tests/wrap.test: Remove.
3398         * tests/run-test, tests/get-them: Remove.
3399         * tests/Makefile.am: Adjust.
3401 2001-08-17  Akim Demaille  <akim@epita.fr>
3403         others.at no longer depends on other-tests/.
3405         * tests/others.at (stackovf): You're actually...
3406         (sync-lines): this.
3407         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
3408         (unload.test): Keep their authorship.
3409         (discard-comments, gmp, import-environment, modfreeze)
3410         (sync-lines): Embed the input files.
3411         * tests/stackovf.test: Copy from other-tests/stackovf.test.
3412         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
3414 2001-08-17  Akim Demaille  <akim@epita.fr>
3416         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
3417         (M4exit): Tag the exit status of the example.
3418         * tests/get-them: Adjust.
3419         * tests/generate.awk: New, based on get-them.
3420         * tests/Makefile.am: Adjust to generate `generated.at'.
3421         * tests/testsuite.at: Adjust.
3422         (AT_CHECK_M4): Don't overquote.  Blush...
3424 2001-08-17  Akim Demaille  <akim@epita.fr>
3426         Start using Autotest.  atconfig creation is still lacking.
3428         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
3429         * examples/reverse.m4, tests/other-tests/import-environment.m4,
3430         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
3431         * tests/other-tests/import-environment.test: Don't check LANGUAGE
3432         as it might be `unset', or set to `C'.
3433         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
3434         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
3435         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
3436         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
3437         * tests/other-tests/shadow.test: Adjust.
3438         * tests/testsuite.at, tests/others.at: New.
3439         * tests/Makefile.am: Adjust.
3441 2001-08-17  Akim Demaille  <akim@epita.fr>
3443         Drop Autoconf 2.13 compatibility.
3445         * configure.in (changeword): No need to undefine it, as anyway if
3446         it's defined, M4sugar moved it as m4_changeword.
3447         And anyway, proper quotation is enough.
3448         (m4_pattern_allow): As it exists in 2.50, just use it.
3449         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
3450         Don't handle Gettext's duties, let it handle them.
3451         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
3453 2001-08-17  Akim Demaille  <akim@epita.fr>
3455         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
3456         (m4_errprint): Use fputs.
3457         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
3458         dumpdef are not concerned.
3459         (Dumpdef, Errprint): Emphasize their insensitivity to
3460         --error-output.
3461         * doc/Makefile.am: Add `TAGS' support.
3462         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
3463         in `config/' now.
3464         * config/Makefile.am (MAINTAINERCLEANFILES): New.
3466 2001-08-17  Akim Demaille  <akim@epita.fr>
3468         * modules/Makefile.am (ETAGS_ARGS): New.
3470 2001-08-17  Akim Demaille  <akim@epita.fr>
3472         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
3473         changes.
3475 2001-08-17  Akim Demaille  <akim@epita.fr>
3477         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
3479 2001-08-17  Akim Demaille  <akim@epita.fr>
3481         * m4/m4module.h (m4/list.h): Don't include it.
3483 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
3485         m4_modules are no more, we use lt_dlhandles directly and let
3486         latest libltdl features manage the list of loaded modules.
3487         * acinclude.m4: Regenerated.
3488         * m4/ltdl.c: Updated from master copy.
3489         * m4/module.c: Reimplemented to take advantage of advances in
3490         libltdl.
3491         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
3492         list with lt_dlhandle_next.
3493         (m4_builtin_find_by_func): Ditto.
3494         (m4_builtin_table_install): Use lt_dlhandle.
3495         (m4_macro_define): Ditto.
3496         (m4_macro_table_install): Ditto.
3497         m4/module.h: Prototype new module management API.
3498         (m4_modules): No longer required.
3499         (m4_module_init_t, m4_module_finish_t): POSIX namespace
3500         violations, renamed to...
3501         (m4_module_init_func, m4_module_finish_func): ...these,
3502         respectively.
3503         (M4INIT_HANDLER): Clean way to declare init functions in modules.
3504         (M4FINISH_HANDLER):  And similarly for finish functions.
3505         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
3506         -- Add indirection to the CONC macro so that arguments are
3507         correctly expanded.
3508         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
3509         * modules/shadow.c (m4_init_module):  Ditto.
3510         Due to new init function semantics, be careful to perform the
3511         initialisation only on first load.
3512         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
3513         (m4_finish_module): Replaced with M4FINISH_HANDLER.
3514         Due to new finish function semantics, be careful to perform the
3515         finalisation only on first load.
3516         * m4/m4private.h (m4_module): Removed in favour of...
3517         (m4_module_data): ...structure without all the wrapper fields.
3518         Instances of this new structure are stored associated lt_dlhandles
3519         with lt_dlcaller_data_set().
3520         * m4/builtin.c (m4_builtin_define): Takes a handle argument
3521         instead of the old module argument.
3522         (m4_builtin_table_install): Ditto.
3523         * modules/load.c (m4_resident_module):  Removed.  This is no
3524         longer implemented as a magic symbol...
3525         * modules/m4.c (m4_resident_module): Ditto.
3526         * modules/load.c (M4INIT_HANDLER): ...the module init function now
3527         uses the ltdl api to make the module resident.
3528         * modules/m4.c (M4INIT_HANDLER): Ditto.
3529         * modules/load.c (builtin_modules): Traverse the loaded module
3530         list with lt_dlhandle_next.
3531         (builtin_load): Much simplified in light of the reimplemented
3532         module loader.
3533         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
3534         light of the m4/module.c rewrite.
3535         (produce_symbol_dump): Ditto.
3536         (reload_frozen_state): Ditto.
3537         * m4/list.c, m4/list.h: Files deleted.  No longer required.
3538         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
3539         (libm4_la_SOURCES): Delete list.c reference.
3540         * m4/m4private.h (m4_token_data):  Add a handle field.  This
3541         eliminates many of the searches to find the handle associated with
3542         various tokens that are passed between functions.
3543         (struct m4_symbol):  Removed the module field.  The
3544         module association does not belong with the symbol...
3545         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
3546         that the module implementation code is from.  Added a handle
3547         field.
3548         (m4_push_macro): Add a `handle' argument.  Changed all callers.
3549         (init_macro_token):  Set the `handle' field for the
3550         m4_token_data.
3551         * m4/macro.c (expand_argument): Copy the new handle field during
3552         reassignment.
3553         * modules/m4.c (macro_install): Use the new handle field to
3554         optimise the search for the correct builtin structure, and pass
3555         the handle details to m4_builtin_define.
3557 2001-08-15  Akim Demaille  <akim@epita.fr>
3559         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
3560         when creating `m4/obstack.h'.
3561         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
3562         top_builddir.
3563         * tests/defs: Make them absolute.
3564         (CDPATH) Neutralize.
3565         * tests/gethem: Use them.
3567 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
3569         * config/ltmain.sh: Doh!  Import again for a quoting fix that
3570         prevented any regression test from passing.
3572         * m4/m4module.h (obstack.h): Choose between installed version
3573         and shipped version based on configure tests.
3574         * src/freeze.c (obstack.h): Ditto.
3576         * acconfig.h: Removed.  No longer required.
3578         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
3579         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
3580         them to AC_INIT and AM_INIT_AUTOMAKE.
3581         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
3582         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
3583         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
3584         shell variable m4_cv_func_obstack_h.
3585         * tests/defs (M4): Be more careful about relative path to libtool
3586         script and m4 binary by using $srcdir.
3588         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
3589         optargs to the existing libltdl search path.
3590         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
3591         * m4/ltdl.c: Updated.
3592         * m4/ltdl.h: Ditto.
3593         * config/ltmain.sh: Ditto.
3595 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
3597         * src/main.c (main): Add `-b' (for `batch') mode switch to force
3598         interactive mode off.
3600 2001-08-10  Akim Demaille  <akim@epita.fr>
3602         * configure.in: Require Autoconf 2.52.
3603         (AC_ARG_PROGRAM): Remove, handled by Automake.
3604         (m4_getopt): Rename as...
3605         (m4_getopt_h): this.
3606         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
3607         Undefine `changeword' only if defined.
3608         * config/gnu-obstack.m4: Require Autoconf 2.52.
3609         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
3610         Allow this token.
3612 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
3614         * doc/m4.texinfo: Fix some typos, and apply some small
3615         clarifications.
3617 2001-08-09  Andreas Schwab  <schwab@suse.de>
3619         * src/main.c (main): Fix improper uses of error (missing format
3620         string).
3622 2001-08-07  Akim Demaille  <akim@epita.fr>
3624         Improve `make distcheck'.
3626         * configure.in: Be sure to be able to run `mkconfig.sh' when src
3627         != build.
3628         * Makefile.am (dist-hook): Remove, as it is no longer needed.
3629         * doc/m4.texinfo (Include): Add missing blank.
3630         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
3631         obstack.c.
3633 2001-08-07  Akim Demaille  <akim@epita.fr>
3635         * m4/evalparse.c: A better introductory comment.
3636         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
3637         * m4/macro.c: Adjust old comments.
3638         * modules/README: Typo.
3640 2001-08-07  Akim Demaille  <akim@epita.fr>
3642         * config/gnu-obstack.m4: New.
3644 2001-08-07  Akim Demaille  <akim@epita.fr>
3646         * config/Makefile.am, config/stackovf.m4: New.
3647         * configure.in, Makefile.am: Adjust.
3649 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
3651         * modules/format.c (format):  Formatting for %f was not
3652         interpreting the position of the decimal point correctly for
3653         whole numbers.
3655 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
3657         * TODO:  Removed m4exit bug.
3658         * modules/load.c (m4_resident_module): Make this module resident.
3659         * module/m4.c (m4_resident_module): Ditto.
3660         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
3661         feature to mark modules as resident if they export
3662         `m4_resident_module' as TRUE.
3663         (m4_module_unload): Do not remove resident modules, and take care
3664         with symbol insertion and deletion with resident modules.
3665         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
3666         use resident modules feature.
3668 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
3670         * TODO: Updated.  Removed some cruft that has since been fixed
3671         or implemented.  Added some more entries.
3672         * NEWS: Updated.
3673         * README: Updated.
3674         * modules/README: Updated.
3675         * doc/m4.texinfo: Updated.
3677         * modules/gnu.c (builtin_functions): Make indir orthogonal to
3678         builtin, in that each is recognised as a macro only with parameters
3679         (builtin_indir): Passing 0 arguments is now an error, as with
3680         builtin.
3682         * src/main.c (usage): Added missing description of `-c' option.
3684 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
3686         Consolidate the myriad of dispersed test scripts into the
3687         tests subdirectory.  I think I now have all the file where I
3688         want them, so there shouldn't be anymore upheaval =)O|
3689         Honest!
3690         * tests/Makefile.am: Updated to run the new tests added below.
3691         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
3692         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
3693         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
3694         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
3695         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
3696         tests/other-tests/hanoi.test, tests/other-tests/include.test,
3697         tests/other-tests/indir.test, tests/other-tests/misc.test,
3698         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
3699         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
3700         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
3701         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
3702         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
3703         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
3704         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
3705         tests/other-tests/translit.test, tests/other-tests/undivert.test,
3706         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
3707         tests/other-tests/wrap.test:  New tests based on the contents
3708         of the tests removed below.
3709         * examples/Makefile.am, modules/Makefile.am:  Updated to
3710         reflect removed tests.
3711         * examples/defs,modules/defs: Removed.
3712         * examples/capitalize.test, examples/comments.test,
3713         examples/ddivert.test, examples/debug.test,
3714         examples/esyscmd.test, examples/exp.test,
3715         examples/foreach.test, examples/forloop.test,
3716         examples/fstab.test, examples/hanoi.test,
3717         examples/include.test, examples/indir.test,
3718         examples/misc.test, examples/multiquotes.test,
3719         examples/patsubst.test, examples/pushpop.test,
3720         examples/regexp.test, examples/reverse.test,
3721         examples/sysv-args.test, examples/trace.test,
3722         examples/translit.test, examples/undivert.test,
3723         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
3724         modules/modpath1.test, modules/modpath2.test,
3725         modules/modpath3.test, modules/modpath4.test,
3726         modules/modtest.test, modules/shadow.test,
3727         modules/unfrozen.m4, modules/unload.test: Removed.
3729         Move the implementation of GMP support for the mpeval() builtin
3730         into a loadable module that depends on libgmp.  mpeval() and
3731         eval() share a common parser, now in m4/evalparser.c; the code
3732         in m4/numb.c and m4/numb.h is now physically split between
3733         m4/eval.c (the eval() backend) and modules/mpeval.c (the
3734         mpeval() backend), rather than being differentiated by cpp
3735         macros and multiple inclusion.  The mpeval module is always
3736         built but will generate an diagnostic if it is used from an
3737         installation that didn't link in the gmp library.
3738         * modules/Makefile.am: build and install the new mpeval module.
3739         * modules/mpeval.c: Now contains the former parts of m4/numb.c
3740         and m4/numb.h that are required for gmp support in mpeval().
3741         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
3742         * m4/evalmp.c:  Removed.
3743         * m4/m4module.h: Removed conditional prototype for
3744         m4_mp_evaluate().
3745         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
3746         and m4/numb.h that do not rely on gmp.
3747         * m4/evalparse.c:  New file, contains the shared parts of the
3748         eval() and evalmp() parser implementations, and is no longer
3749         unencumbered by cpp magic to uncover the right parts.
3750         * m4/numb.h:  Removed.  It's former contents are split between
3751         m4/eval.c and modules/mpeval.c.
3752         * m4/numb.c: ditto.
3754         * tests/other-tests/changeword.test: New test.  Rudimentary
3755         testing of changeword builtin runs only if --wnable-changeword
3756         was used at configure time.
3757         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
3758         alternation correctly.  Split into two expressions to compensate.
3759         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
3760         * modules/Makefile.am: Build changeword module.
3761         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
3762         only when --enable-changeword was passed to configure.
3763         (builtin_changeword): If --enable-changeword was not used, then
3764         report that changeword() builtin has no support in m4 binary.
3766 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
3768         * src/main.c (main): Fixed a particularly nasty bug is
3769         user_search_path setting -- the -M flag processing must be
3770         extremely careful with search path ordering, or else the default
3771         installed module directory (possibly containing modules from a
3772         previous release) is placed earlier in the search path than any -M
3773         arguments (which are relied upon to load uninstalled modules with
3774         most of the tests in the regresion suite).
3776         * modules/load.c (builtin_load):  Nasty hack to prevent adding
3777         symbols to symtab again if a module is loaded more than once.
3778         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
3780         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
3781         possible NULL pointer dereference.
3783         * m4/module.c (m4_module_find_by_modname): Renamed from
3784         m4_module_modname_find.   Fixed all references.
3785         (m4_module_find_by_builtin):  New function.
3787         * modules/modfreeze.test: load the `load' module with each
3788         invocation.
3789         * src/freeze.c (produce_frozen_state): Simplified in light of
3790         module field in m4_symbol.  Allow a third argument for text macros
3791         to name the originating module.
3792         (reload_frozen_state): ditto.
3793         * m4/m4module.h:  Fixup prototypes.
3794         * m4/builtin.h (m4_builtin_define): Add a module argument so
3795         that symbols can be registered against the defining module.
3796         (m4_macro_define): ditto.
3797         * m4/m4private.h (m4_symbol): Make the module field const to save
3798         on casting in the rest of the code.
3799         (SYMBOL_MODULE): New macro.
3801         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
3802         symbol reference maintenance bugs when removing a symbol from the
3803         symtab.
3805         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
3807 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
3809         * configure.in (m4_cv_func_obstack): A better check for whether
3810         libc has an obstack implementation.
3811         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
3813         * configure.in (--with-modules): Changed semantics.  This
3814         option is now used to list modules to be preopened.
3815         * src/m4.h: #include "ltdl.h" unconditionally.
3816         * src/main.c: Removed all dependencies on WITH_MODULES.
3817         * src/freeze.c: ditto.
3818         * modules/Makefile.am: ditto.
3819         * m4/m4.c (builtin_m4exit): ditto.
3820         * modules/modpath1.test: ditto.
3821         * modules/modpath2.test: ditto.
3822         * modules/modpath3.test: ditto.
3823         * modules/modpath4.test: ditto.
3824         * modules/modtest.test: ditto.
3825         * modules/shadow.test: ditto.
3826         * modules/unload.test: ditto.
3828         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
3829         comes up on demand in LTLIBOBJS now.
3830         * configure.in (getopt_long):  Creating and relying on a link for
3831         getopt.h on hosts with no getopt_long() of thier own works
3832         correctly now.  This is necessary so that callers of getopt_long()
3833         can simply `#include <getopt.h>': the naive way of doing this
3834         would end up using our own getopt.h and the installed
3835         getopt_long(), which is asking for trouble!
3836         (obstack_init): A similar argument applies to obstack.h and
3837         obstack_init().
3839         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
3840         On Solaris-2.5 (at least) the native dlopen implementation
3841         gets confused about m4.o when looking for module "m4".  This
3842         version always looks for .la an .$lib_ext suffixed names first
3843         to work around the problem.  Sigh.
3845         * po/POTFILES.in: Take account of these file movements.
3846         * src/Makefile.am (m4_SOURCES): removed eval.c.
3847         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
3848         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
3849         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
3850         * modules/m4.c (builtin_eval): Use m4_evaluate().
3851         * m4/eval.c: Moved here from src/eval.c to facilitate
3852         implementation of eval() builtin as part of the `m4' loadable
3853         module.
3854         (m4_evaluate): renamed from evaluate for namespace cleanliness.
3855         * m4/numb.c: Moved here from src/numb.c, since it is #included
3856         into eval.c at compile time.
3857         * m4/m4module.h (m4_evaluate): Added prototype.
3858         * src/m4.h (evaluate): Removed prototype.
3860 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
3862         * modules/perl.c (builtin_perleval):  Use PL_na for
3863         compatibility with perl-5.6.
3865         * src/main.c (main):  It is now safe to
3866         ``m4_module_install("m4")'', without tripping over the m4
3867         binary itself!
3868         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
3869         versions having fixed the insidious module search order bug.
3871         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
3872         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
3874         * configure.in: Figure out whether to use the installed
3875         getopt.h or the supplied one.
3876         * src/Makefile.am: ditto.
3878         * po/POTFILES.in: List files in their new positions.
3880         * config/ltmain.sh:  This needs to be checked in to match the
3881         libtool macros copied to acinclude.m4 (until a released
3882         libtool copes with m4's needs).
3883         * bootstrap:  Run gettextize.
3885 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
3887         * AUTHORS:  Added my details.
3888         * TODO: updated.
3889         * NEWS: updated.
3890         * bootstrap: temporary update until released libtool catches up.
3892         * All files:  Use new GNU GPL copyright blurb with current contact
3893         address.
3895         * configure.in (LTLIBOBJS): Use canonical code for calculation of
3896         this variable.
3898         * config: renamed acm4 directory to config to be more like
3899         other autoconfiscated packages.
3901         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
3902         * config/debug.m4:  New file implementing configure macros to add
3903         suitable debug flags to the compiler invocation.
3905         * modules/load.c:  New file implementing the ``load'' and
3906         ``unload'' builtins.
3907         * tests/get-them:  Set the module search directory to the modules
3908         build directory in generated tests.
3909         * modules/shadow.test: ditto.
3910         * modules/modtest.test: ditto.
3911         * modules/modpath1.test: ditto.
3912         * modules/modpath2.test: ditto.
3913         * modules/modpath3.test: ditto.
3914         * modules/modpath4.test: ditto.
3915         * modules/modtest.test: ditto.
3916         * modules/modfreeze.test: ditto.
3917         * modules/unload.test: ditto.
3919         * modules/changeword.c:  New file implementing the ``changeword''
3920         builtin as a loadable module.
3921         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
3922         as a loadable module.
3924         * src/main.c (main):  Load the gnu module if m4 was started
3925         normally -- i.e. without the -G option.
3926         * modules/gnu.c:  New file implementing a new loadable module wuth
3927         definitions for all the gnu extension builtins.
3928         * modules/format.c:  Moved here from src/format.c.  Now included
3929         directly by gnu.c.
3931         * src/main.c (main):  Load the traditional module if m4 was
3932         started in `no_gnu_extensions' mode.
3933         * modules/traditional.c:  New file implementing the ``unix'' macro,
3934         required when m4 is executed in traditional mode, as a loadable
3935         module.
3937         * src/main.c:  Renamed from m4.c to avoid confusion with
3938         modules/m4.c.
3939         (main):  Always load the m4 module.
3940         * modules/m4.c:  New file implementing a new loadable module with
3941         definitions for all m4 builtins that are not gnu extensions.
3943         * m4/Makefile.am:  Adjusted to take new files below into account.
3944         * m4/m4module.h: Prototypes for exported functions and types moved
3945         to this directory from the src directory.
3946         * m4/m4private.h: Moved here from src/m4private.h to facilitate
3947         the migration of all builtin implementations to loadable modules.
3948         * m4/macro.c: Moved this file here from the src directory,
3949         renaming all exported symbols to use the prefix ``m4_''.
3950         * m4/builtin.c: ditto.
3951         * m4/module.c: ditto.
3952         * m4/symtab.c: ditto.
3953         * m4/debug.c: ditto.
3954         * m4/input.c: ditto.
3955         * m4/output.c: ditto.
3956         * m4/path.c: ditto.
3957         * m4/ltdl.h, m4/ltdl.c: ditto.
3958         * m4/utility.c: Odd functions moved here from files in the src
3959         directory to facilitate builtin migration.
3961 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
3963         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
3964         error message, to make translators' jobs a little easier.
3965         (builtin_builtin): ditto.
3966         (builtin_traceon): ditto.
3967         (builtin_traceoff): ditto.
3968         Reported by Akim Demaille <akim@epita.fr>
3970         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
3971         pkgincludedir instead.
3973         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
3974         it is exported globally.  Fixed all references.
3975         (lquote): ditto.
3976         (bcomm): ditto.
3977         (ecomm): ditto.
3978         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
3979         globally.  Fixed all references.
3980         (DEF_LQUOTE): ditto.
3981         (DEF_BCOMM): ditto.
3982         (DEF_ECOMM): ditto.
3984 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
3986         * NEWS: updated.
3987         * TODO: updated.
3989         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
3990         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
3992         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
3993         Removed `Prev', `Next' and `Up' fields of all @nodes now that
3994         makeinfo calculates them for us, and to make any future
3995         reorganisation easier.
3996         (Frozen files): Document format version 2.
3997         `V' now takes argument `2'.
3998         `F' can take a single argument if symbol and builtin names
3999         are the same, or 3 arguments if the builtin is from a module.
4000         New `S' specification for saving syntax table contents.
4001         New `M' specification for saving loaded module names.
4002         * src/freeze.c: Implement them.
4003         * src/input.c (syntax_code): For interpreting frozen syntax
4004         state.
4006         * examples/Makefile.am:  Add the contents of the WWW directory to
4007         the distribution.
4008         * examples/WWW/Makefile:  ditto,
4009         (%.htm): Compares file contents (not just sizes) to determine
4010         whether a change has occured.
4011         * examples/WWW/_header.htm: Bumped version number.
4012         * examples/WWW: Regenerated content.
4014         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
4015         compilers comes much easier without ansi2knr.
4016         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
4018         * m4/list.c: New generic list container type.
4019         * m4/list.h: Interface to new container type.
4020         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
4021         (libm4_la_SOURCES): compile and link list.c.
4022         * src/builtin.c (builtin_tables): Use list container.
4023         * src/module.c (symtab): ditto.
4024         * src/symtab.c (symtab): ditto.
4026         * m4/system.h: New file for common preprocessor definitions.
4027         * m4/Makefile.am (pkginc_HEADERS): install system.h.
4028         * m4/error.c: Use system.h in place of inline preprocessor.
4029         * m4/error.h: ditto.
4030         * m4/module.c: ditto.
4031         * m4/module.h: ditto.
4032         * m4/xmalloc.c: ditto.
4034         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
4035         compatibility.
4036         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
4038         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
4039         it is exported globally.  Fixed all references.
4040         (builtin): ditto.
4041         (module_init_t): ditto.
4042         (module_finish_t): ditto.
4043         (token_data): ditto.
4044         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
4045         it is exported globally.  Fixed all references.
4046         (SYNTAX_IGNORE): ditto.
4047         (SYNTAX_SPACE): ditto.
4048         (SYNTAX_OPEN): ditto.
4049         (SYNTAX_CLOSE): ditto.
4050         (SYNTAX_COMMA): ditto.
4051         (SYNTAX_DOLLAR): ditto.
4052         (SYNTAX_ACTIVE): ditto.
4053         (SYNTAX_ESCAPE): ditto.
4054         (SYNTAX_ALPHA): ditto.
4055         (SYNTAX_NUM): ditto.
4056         (SYNTAX_ALNUM): ditto.
4057         (SYNTAX_LQUOTE): ditto.
4058         (SYNTAX_RQUOTE): ditto.
4059         (SYNTAX_BCOMM): ditto.
4060         (SYNTAX_ECOMM): ditto.
4061         (SYNTAX_VALUE): ditto.
4062         (SYNTAX_MASKS): ditto.
4063         (IS_OTHER): ditto.
4064         (IS_IGNORE): ditto.
4065         (IS_SPACE): ditto.
4066         (IS_OPEN): ditto.
4067         (IS_CLOSE): ditto.
4068         (IS_COMMA): ditto.
4069         (IS_DOLLAR): ditto.
4070         (IS_ACTIVE): ditto.
4071         (IS_ESCAPE): ditto.
4072         (IS_ALPHA): ditto.
4073         (IS_NUM): ditto.
4074         (IS_ALNUM): ditto.
4075         (IS_LQUOTE): ditto.
4076         (IS_RQUOTE): ditto.
4077         (IS_BCOMM): ditto.
4078         (IS_ECOMM): ditto.
4079         (TOKEN_EOF): ditto.
4080         (TOKEN_NONE): ditto.
4081         (TOKEN_STRING): ditto.
4082         (TOKEN_SPACE): ditto.
4083         (TOKEN_WORD): ditto.
4084         (TOKEN_SIMPLE): ditto.
4085         (TOKEN_MACDEF): ditto.
4087         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
4088         consistency.  Fixed all references.
4089         (STRING): Renamed to `m4_string' for consistency, and because if
4090         is exported globally.  Fixed all references.
4091         (token_type): Renamed to `m4_token_t' for the same reasons.
4092         (token_data_type): Renamed to `m4_token_data_t' for the same
4093         reasons.
4095         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
4096         sizes.
4097         (XMALLOC): ditto.
4098         (XREALLOC): ditto.
4099         (XFREE): Wrapper macro which avoids freeing NULL pointers.
4101         * m4/m4module.h (m4_macro):  New type for module defined user
4102         macros.
4103         * modules/modtest.c (m4_macro_table):  Define module user macros.
4104         * modules/shadow.c (m4_macro_table):  ditto.
4106         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
4107         declared with M4BUILTIN.
4109         * m4/xmalloc.c: Use memset if bzero is not available when
4110         emulating calloc with malloc.
4111         (xcalloc): Fallback to malloc/bzero if calloc is not available.
4112         (xfree): Added for consistency.  Will not try to free NULL
4113         pointers.
4114         * src/m4.c (xfree):  Deleted in favour of the above.
4115         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
4116         linking with libdmalloc.
4117         * m4/xstrdup.c (WITH_DMALLOC): ditto.
4119         * modules/frozen.m4:  New test case.
4120         * modules/unfrozen.m4:  ditto.
4121         * modules/modfreeze.test:  New test.
4122         * modules/unload.test:  ditto.
4123         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
4124         (TESTS): Use them.
4125         * modules/modpath1.test:  Don't try this test if module support is
4126         not compiled in.
4127         * modules/modpath2.test: ditto.
4128         * modules/modpath3.test: ditto.
4129         * modules/modpath4.test: ditto.
4130         * modules/modtest.test: ditto.
4131         * modules/shadow.test: ditto.
4133         * modules/perl.c: New module.
4134         * modules/perl.m4: Example of using it.
4135         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
4137         * src/m4.c (main): Assume interactive mode if STDIN is connected
4138         to a tty.
4139         Changed startup sequence slightly so that syntax is not
4140         initialised from here when loading a frozen file.
4142         * src/builtin.c:  Much improved macro definition style.
4143         * src/m4private.h:  Internal structures for m4_builtin and
4144         m4_macro instances.  These are not exposed to module writers.
4145         * src/module.c (module_modname_find):  Find a module structure
4146         from the its name.
4147         (make_macro_table):  Build an internal macro table from a external
4148         definition.
4149         (make_builtin_table):  Build an internal builtin table from an
4150         external definition.
4152         * src/module.c (module_unload): Be extremely careful to remove
4153         builtins and macros that match the module being unloaded -- no
4154         longer assume that the top element can be removed incase another
4155         odule defines an identical name.
4156         * src/symtab.c (remove_table_reference_symbols): remove all symbol
4157         table entries which refer to a given builtin table.
4158         * src/builtin.c (remove_tables): Use it!
4160 2000-07-13  Thomas Tanner  <tanner@ffii.org>
4162         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
4163         * acm4/modules.m4: deleted
4164         * bootstrap: don't libtoolize libltdl!
4165         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
4166         if set, enable WITH_MODULES and add modules to DLPREOPEN
4167         * examples/misc.test: redirect standard output
4168         * lib/Makefile.am: don't use DLLDFLAGS
4169         * lib/m4module.c: include necessary headers to silence GCC -Wall
4170         * lib/m4regex.c: fixes to silence GCC -Wall
4171         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
4172           build modules conditionally
4173         * modules/shadow.c: define symbol aliases before using them
4174         * modules/test.c: define symbol aliases before using them
4175         * po/de.po: update translation
4176         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
4177         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
4178         LIBLTDL to LIBS.
4179         * src/m4.c: initialize libltdl's preloaded symbols via
4180         LTDL_SET_PRELOADED_SYMBOLS
4181         * src/module.c: libltdl's memory management must be initialized
4182         before calling lt_dlinit!, fix warnings
4184 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
4186         * README:  Caveat about nls not supported by dll architecture on
4187         Windows.
4189         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
4191         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
4192         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
4193         * modules/Makefile.am (LIBS): ditto.
4194         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
4195         $(top_srcdir)/m4 (for only <m4module.h>).
4196         * modules/shadow.test: fixed for VPATH.
4197         * modules/modtest.test: ditto.
4198         * modules/modpath4.test: ditto.
4199         * modules/modpath3.test: ditto.
4200         * modules/modpath2.test: ditto.
4201         * modules/modpath1.test: ditto.
4203         * modules/time.test: Removed due to timezone dependence,
4204         * modules/Makefile.am (TESTS): Removed time.test.
4206         * configure.in: Use $3 of AC_DEFINE so that we can,,,
4207         * acconfig.h: Remove everything except the gettext parameters.
4208         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
4209         AC_DEFINE.
4210         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
4211         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
4212         increment serial number.
4214         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
4215         src dir and immediately after libm4 is built for confidence that
4216         it doesn't rely on the src directory.
4217         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
4218         makeinfo stop the build on cygwin (because they don't work).
4220         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
4222         * m4/m4private.h: ...is not a public header, so moved to src.
4223         Add `#include <config.h>', `#define _COMPILING_M4' and
4224         `#include "m4.h".
4225         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
4226         * src/Makefile.am (noinst_HEADERS): add m4private.h.
4227         * src/builtin.c: `#include "m4private.h"' now takes care of the
4228         above.  Duplicates removed.
4229         * src/debug.c: ditto.
4230         * src/eval.c: ditto.
4231         * src/evalmp.c: ditto.
4232         * src/format.c: ditto.
4233         * src/freeze.c: ditto.
4234         * src/input.c: ditto.
4235         * src/m4.c: ditto.
4236         * src/macro.c: ditto.
4237         * src/module.c: ditto.
4238         * src/numb.h: ditto.
4239         * src/output.c: ditto.
4240         * src/path.c: ditto.
4241         * stackovf.c: ditto.
4242         * symtab.c: ditto.
4244         * po/POTFILES.in: compensate for renaming of lib/*.
4245         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
4246         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
4247         and then in $(top_srcdir)/lib (for eg. "m4private.h").
4248         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
4249         m4/libm4.la.
4250         * m4/m4error.h:  Renamed error.h, for installation to
4251         $prefix/include/m4..
4252         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
4253         * m4/m4regex.h: Renamed regex.h, for same reason.
4254         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
4255         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
4256         * m4/m4regex.c: Renamed regex.c, and fix #includes.
4258         * lib: moved to m4 to easily support header installation to
4259         $prefix/include/m4.
4260         * Makefile.am (SUBDIRS): renamed lib dir to m4.
4261         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
4262         * acm4/regex.m4: Point to m4/regex.c.
4264         * examples/foreach.m4:  Sanitise quoting.
4265         * examples/foreach.test:  New torture test.
4266         From Akim Demaille <akim@epita.fr>
4268 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
4270         * src/ltdl.c: Use access() to abort doomed module load attempts
4271         if module file does not exist.
4273         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
4274         getopt1.o will already be used if appropriate, so I moved getopt.c
4275         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
4277         * modules/modpath1.test: Use correct filename in header line.
4278         * modules/modpath2.test: ditto.
4279         * modules/modpath3.test: ditto.
4280         * modules/modpath4.test: ditto.
4282         Without these changes lt_dlopen("test") attempts to
4283         LoadLibrary("/bin/test") on Windows, which although harmless
4284         generates a spurious error message which spoils most of the tests:
4285         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
4286         (TESTS): s/test.test /modtest.test /
4287         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
4288         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
4289         * modules/modpath1.test: s/test.m4 /modtest.m4 /
4290         * modules/modpath2.test: ditto.
4291         * modules/modpath4.test: ditto.
4292         * modules/modpath3.test: s/-m test /-m modtest /
4293         * modules/shadow.m4: use {un,}loadmodule(`modtest').
4295 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
4297         * src/ltdl.c (find_file): Updated to new version with fixed memory
4298         allocation bug in `next'.
4299         * src/ltdl.h: updated to match.
4301         * modules/Makefile.am:  Cleaned up and reordered.
4303 2000-01-16  René Seindal  <rene@seindal.dk>
4305         * modules/Makefile.am (TESTS): New tests for the module system.
4307         * modules/*.test: New files.
4309         * src/m4.c (main): Added call to module_init().
4310         Treats -M and -m as the arguments -D -U and -t, ie deferred.
4312         * src/m4.h: Added declaration of module_init().
4314         * src/module.c (module_init): No longer static
4316         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
4317         Added to shut up automake about non standard libtool library
4318         names.
4320         * src/module.c: Disabled DEBUG by default.
4322         * modules/README: Changed example from unload.m4 to shadow.m4
4324         * modules/shadow.m4: Renamed from unload.m4
4326         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
4328         * src/m4.c (main): Functionality for -m and -M were reversed.
4329         Fixed.
4331 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
4333         * doc/help2man.pl: updated to version 1.020.
4335         * lib/COPYING.LIB:  updated to version 2.1.
4337         * lib/m4module.h: restructure the M4_SCOPE code to work when
4338         creating a dll which links with libm4.la and both DLL_EXPORT
4339         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
4340         both defined.
4342 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
4344         Merged the following changes from my tree:
4346         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
4348         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
4349         ported to compile shared libs.
4351         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
4352         use `__declspec(dllimport)' when linking libm4.la on win32.
4353         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
4355         * configure.in (M4OBJS): Discover whether we need the shipped
4356         implementation of getopt_long.
4357         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
4358         main binary here, as opposed to the module library in lib/libm4.la.
4360         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
4362         * modules/README: Updated to describe the improved libltdl based
4363         module scheme.
4364         * README (cygwin): Added some compilation notes for building m4
4365         correctly under cygwin.
4366         * TODO: Cleaned out the entries for the module system since they
4367         are now implemented.
4369         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
4370         all instances of __P with M4_PARAMS.
4372         * lib/getdate.h: removed unreferenced file.
4374         * lib/m4private.h: New file to define the private interface to the
4375         token_data struct, which must be shared between m4module.c, and
4376         builtin.c but not exported to modules built from the installed
4377         m4module.h since it's size changes depending on compile time
4378         options.
4380         * src/m4.h: Lots of stuff moved to lib/m4module.h.
4382         * lib/m4module.h: New file to define the interface available when
4383         compiling m4 modules.
4384         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
4385         necessary for module compilation into this new file.
4387         * lib/Makefile.am (include_HEADERS): install headers (renamed to
4388         avoid nameclash with other system headers) necessary for compiling
4389         modules.
4390         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
4391         so that modules can include the (renamed) installed headers and
4392         be guaranteed a matching implementation.
4393         * lib/m4error.h: renamed from error.h.
4394         * lib/m4obstack.h: renamed from obstack.h.
4395         * lib/m4regex.h: renamed from regex.h.
4396         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
4397         implementation, simply include the shipped version
4398         unconditionally, otherwise it is hard for a module to know
4399         whether the m4obstack.h header it is using matches the
4400         implementation it ends up linking against.
4401         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
4402         the same reason.
4404         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
4406         * examples/misc.test: Don't run this test on machines which don't
4407         have a root user in /etc/passwd (e.g. cygwin).
4409         * tests/get-them (/^@example$/): Error messages might have a
4410         ``.exe'' suffix to the program name, or else use the libtool
4411         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
4412         of these cases are now catered for when comparing error messages
4413         in generated tests.
4414         * tests/other-tests/*.test: ditto.
4415         * examples/*.test: ditto.
4417         * tests/defs (M4): use libtool execute mode.
4418         * examples/defs (M4): ditto.
4420         * tests/get-them (END): explicitly close any open file.
4421         (printthem): In a regular expression, '{' is the start of a repeat
4422         count!  Use `[{]' for a literal open brace.
4423         (/^@node /): Don't use substr on a string shorter than the trim
4424         length.
4426         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
4428         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
4429         substituted.
4430         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
4432 2000-01-10  Andreas Schwab  <schwab@suse.de>
4434         * tests/other-tests/gmp.test: Find config.sh in build directory.
4436         * configure.in: Find tests/mkconfig.sh in $srcdir.
4438         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
4439         <signal.h> (for SUS2 compliant systems).
4441         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
4442         HAVE_SIGINFO_H.
4444 2000-01-10  René Seindal  <rene@seindal.dk>
4446         * Prerelease 1.4o.
4448         * TODO, NEWS: Cleaned up and updated.
4450         * src/m4.c (main): New variable exit_status for exit status in
4451         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
4452         file cannot be read instead of EXIT_SUCCESS.
4454         * src/builtin.c (m4_indir): Changed error message to help
4455         translators (from Akim Demaille <demaille@inf.enst.fr>).
4457         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
4458         Cygnus.
4460         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
4461         from glic 2.1.2.
4463         * src/input.c (match_input): Reordering of code, to avoid multiple
4464         calls to push_string_init() from obstack_grow(), which can happen
4465         with some compilers (found and fixed by James Bonfield
4466         <jkb@mrc-lmb.cam.ac.uk>).
4468         * src/stackovf.c: Added prototypes for ultrix.
4469         (setup_stackovf_trap): Added __P to cast.
4470         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
4472 2000-01-09  René Seindal  <rene@seindal.dk>
4474         * doc/m4.texinfo (Changequote): Added comment about changing
4475         quotes when the old quote is a part of the new.
4477         * src/builtin.c (expand_ranges): Added break after trailing dash.
4478         This caused misbehavious on some systems (found and fixed by Akim
4479         Demaille <demaille@inf.enst.fr>).
4481         * AUTHORS: Thomas Tanner included
4483         * acconfig.h: Added entry for ss_sp (see below).
4485         * configure.in (use_stackovf): Added check for stack_t with member
4486         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
4487         <eggert@twinsun.com>).
4489         * doc/m4.texinfo (Frozen files): Added a simpler example for
4490         generating frozen files from several input files.
4492 1999-11-14  Paul Eggert  <eggert@twinsun.com>
4494         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
4495         lib/regex.c, lib/xmalloc.c.
4497 1999-11-10  René Seindal  <rene@seindal.dk>
4499         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
4501         * src/module.c: reindented.
4502         (module_load): return if this is a repeated load of same module.
4503         (module_init): slight change of logic to avoid repeated
4504         initialisation debug messages.
4506         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
4507         in the distribution.
4509         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
4510         automake warnings about missing lib prefix.
4511         (time_la_LDFLAGS): ditto
4512         (stdlib_la_LDFLAGS): ditto
4514 1999-11-10  Paul Eggert  <eggert@twinsun.com>
4516         * src/m4.h: Include error.h, since our macros use error.
4517         * src/m4.c: Don't need to include error.h.
4519 1999-11-09  Paul Eggert  <eggert@twinsun.com>
4521         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
4522         and zero, as Solaris 7 cc does.
4523         (bcopy): Remove macro; no longer needed with new obstack.h.
4525         * src/output.c (freeze_diversions): Don't assume that a
4526         diversion size can fit in `int'.  Check for diversion file
4527         size too large to be printed with `unsigned long'.
4529         * src/Makefile.am (CFLAGS): Omit -Wall.
4531         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
4533         * src/debug.c (trace_format):
4534         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
4536         * src/freeze.c (produce_frozen_state):
4537         Don't assume string lengths fit in int.
4539 1999-10-13  René Seindal  <rene@seindal.dk>
4541         * configure.in (ALL_LINGUAS): Added Greek translation (el).
4542         (ALL_LINGUAS): Added Czech translation (cs).
4544 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
4546         * src/builtin.c: moved module loading functions into...
4547         * src/module.c: entirely new implementation using libltdl.
4548         * po/POTFILES.in: added src/module.c.
4549         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
4550         are modules, not linktime libraries.
4551         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
4552         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
4553         avoidance on exported symbols.
4554         * modules/test.c (m4_macro_table, m4_init_module,
4555         m4_finish_module): ditto.
4556         * modules/time.c (m4_macro_table): ditto.
4558         * modules/time2.m4: new file which requires command line loading
4559         of modules.
4560         * src/m4.c (--load-module): dynamically load named runtime module
4561         into running executable before reading the source.
4562         (--module-directory): prepend a directory to the module search
4563         path.
4564         (module_init()): Do this the first time we load a module instead;
4565         if the module subsystem is broken normal m4 scripts can still run.
4566         * src/m4.h (install_builtin_table): is now exported.
4568 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
4570         * src/module.c: removed.  No longer required.
4571         * po/POTFILES.in: removed src/module.c.
4573         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
4574         the bootstrap script can recreate.
4575         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
4576         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
4577         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
4578         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
4579         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
4580         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
4581         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
4582         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
4584         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
4585         better.
4586         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
4587         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
4588         the installed gettext.m4 file when running aclocal.
4590 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
4592         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
4593         distinguish this from the last prerelease.
4594         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
4595         in its own subdirectory.
4597         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
4598         lib prefix on a module" feature.
4599         (LDFLAGS): Added `-module -avoid-version' flags to build
4600         versionless module libraries.
4601         * src/builtin.c (m4_load_module): use libltdl.
4602         (module_unload_all): use libltdl.
4603         * src/m4.c (module_init): initialise module loading on demand for
4604         better diagnostics, and so that m4 will still work even if
4605         the module code is broken.
4606         * src/m4.h (module_init): removed.  No longer relevant.
4607         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
4608         exported symbols for compatibility with dlpreopening.
4609         * modules/test.c (m4_macro_table, m4_init_module,
4610         m4_finish_module): ditto.
4611         * modules/time.c (m4_macro_table): ditto.
4613         * bootstrap: New file.  Runs all the autoutils in the right order
4614         after a fresh checkout, or a make maintainer-clean.
4616 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
4618         * src/builtin.c (dump_symbols): New function, factoring common
4619         content of m4_dumpdef and m4_symbols.
4620         (m4_dumpdef): Use it.
4621         (m4_symbols): New function, implementing `symbols'.  Use it.
4622         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
4623         file compile with modern makeinfo.
4624         (Symbols): New node, documenting symbols.
4625         (direntry): Modernize.
4627 1998-12-11  René Seindal  <rene@seindal.dk>
4629         * src/builtin.c (predefined_tab): New predefined macros
4630         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
4631         configure time options.
4633 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
4635         * src/module.c (module_try_load): Don't try to be clever and
4636         overwrite argument string.  Instead allocate all constructed
4637         strings locally, since they can have arbitrary lengths.  Make
4638         arguments pointers to const.
4639         (module_search): Simplify due to above change.
4641 1998-11-29  René Seindal  <rene@seindal.dk>
4643         * Prerelease 1.4n.
4645         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
4647         * tests/other-tests/import-environment.{m4,test}: New test.
4649         * tests/other-tests/discard-comments.{m4,test}: New test.
4651         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
4653         * src/m4.c (main): New option -c --discard-comments.
4654         New global variable discard_comments.
4656         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
4657         discarded, ie never returned from next_token().
4658         Added declaration of discard_comments.
4660         * src/input.c (next_token): Now loops until token type is not
4661         TOKEN_NONE.  Comments are now given this type when comments should
4662         be discarded.
4664         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
4665         and mpeval.
4667 1998-11-28  René Seindal  <rene@seindal.dk>
4669         * src/m4.c (main): New option --import-environment (no single
4670         letter option).
4672         * When configured with --with-gmp both the normal (fast) eval()
4673         and the gmp aware mpeval() are defined.  To restore previous
4674         bahaviour use "define(`eval', defn(`mpeval'))".
4676         * tests/other-tests/gmp.m4: Changed to use mpeval().
4678         * src/evalmp.c: New file for compiling eval.c as gmp aware.
4679         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
4681         * src/eval.c: Now includes "numb.c" directly.  Everything in this
4682         file must by static, except evaluate(), which is changed to
4683         mp_evaluate() if USE_GMP in force.
4685         * src/numb.c: Changed to be included by eval.c instead of being
4686         compiled separately.  Everything is declared static.
4688         * src/numb.h: Removed declarations of functions, as numb.c is now
4689         included by eval.c.
4691         * src/builtin.c: Declaration of m4_mpeval() added.
4692         Inserted `mpeval' in builtin table.
4693         (do_eval): New function with common code for m4_eval and m4_mpeval.
4694         (m4_mpeval): New function for gmp version of eval.
4696         * src/m4.h: Declaration of mp_evaluate().
4698         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
4699         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
4701         * src/m4.c (main): m4 --version also shows which options were used
4702         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
4704 1998-11-27  René Seindal  <rene@seindal.dk>
4706         * Error messages now always print program name before input file
4707         name as specified by GNU coding standards.  Reported by Akim
4708         Demaille <demaille@inf.enst.fr>.
4710         * doc/m4.texinfo (Include): Change due to changed error message
4711         format.
4712         (Eval): Do.
4714         * tests/get-them: Minor change to sed script due to changed error
4715         message format.
4717         * src/m4.c (print_program_name): New func used to print program
4718         name, input file and line number in error ().  Used as an
4719         error_print_progname handler.
4720         (reference_error): Removed.
4721         (main): Assigns error_print_progname.
4723         * src/m4.h (M4ERROR): Removed reference_error ().
4725 1998-11-25  René Seindal  <rene@seindal.dk>
4727         * Updated to libtool 1.2b.
4729         * src/builtin.c (install_builtin_table): Added braces to avoid
4730         warning of ambiguous 'else'.
4732         * src/module.c: Inserted search path code from path.c modified to
4733         use new interface.
4734         (module_init): Configured default path used only if M4MODPATH is
4735         not set.
4736         (module_try_load): Now reads libMODULE.la as generated by libtool
4737         for actual module name.
4738         (module_load): Gives better error messages on failure.
4740         * src/m4.h: Added declarations of structures and functions for
4741         generic search path handling.
4743         * src/path.c: Removed all module specific code and introduced new
4744         functions of more generic search path handling.
4746 1998-11-24  René Seindal  <rene@seindal.dk>
4748         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
4749         included gettext, as <libintl.h> might not be found
4750         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
4752 1998-11-22  René Seindal  <rene@seindal.dk>
4754         * src/output.c (insert_diversion): Fixed bug that might cause m4
4755         to read from standard output!  Triggered by input
4756         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
4757         so now 'undivert(0)' does nothing.
4759 1998-11-18  René Seindal  <rene@seindal.dk>
4761         * Prerelease 1.4m.
4763         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
4764         could be changed when compiling a illegal regexp, causing later
4765         use of the regexp to dump core.
4767         * src/module.c (module_load): Changed error message to conform to
4768         standards.
4770         * src/m4.c (usage): Added message about reporting bugs.
4772         * doc/m4.texinfo (Changeword): Corrected a wrong example.
4773         (Changeword): Added note about the type of regexps used.
4775         * ltconfig, ltmain.sh: New files from Libtool 1.2.
4777         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
4778         and AM_PROG_LIBTOOL.
4780         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
4781         with libtool.
4783         * modules/Makefile.am: Changed completely to compile modules using
4784         libtool.  The modules are compiled as shared libraries, and are
4785         renamed when installed.
4787         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
4788         USE_SHL_LOAD to HAVE_SHL_LOAD
4790         * src/builtin.c (shipout_string): Now tests for a NULL string.
4792         * src/module.c: New level of indirection around non-portable
4793         functions to load shared objects.  Intended to encapsulate the non
4794         portable parts better and to reduce the number of #ifdefs in the
4795         code.
4797         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
4798         directory modules/ to the distribution.
4800 1998-11-15  René Seindal  <rene@seindal.dk>
4802         * Prerelease 1.4l.
4804         * modules/stdlib.c: New module `stdlib' defining some standard
4805         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
4806         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
4808         * src/builtin.c (shipout_string): New convenience function for
4809         builtins and modules.
4811         * src/module.c (module_load): Tentative support for
4812         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
4814         * Makefile.am (SUBDIRS): Directory modules added if configured.
4816         * modules/Makefile.am: Now correctly compiles and installs
4817         modules in pkglibexecdir.
4819         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
4820         These two are now initialised by autoconf macros.
4822         * src/path.c (module_env_init): MODULE_PATH is always on the
4823         search path.
4825         * src/Makefile.am: Now generated pathconf.h which defined the
4826         default MODULE_PATH.
4828         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
4829         where modules are installed.
4831         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
4832         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
4833         build and install automatically, and it is prepared for other
4834         interfacec than dlopen().
4836         * src/builtin.c (predefined_tab): Added __m4_version__ for the
4837         current version of GNU m4.  It is a GNU extension.
4839 1998-11-14  René Seindal  <rene@seindal.dk>
4841         * tests/Makefile.am (GENERATED_TESTS): Added new
4842         generated-tests/changesy.8.test
4844         * doc/m4.texinfo (Changesyntax): Documentation for escape
4845         syntax class.
4847         * src/macro.c (expand_token): Check for escaped macro call before
4848         symbol table lookup.
4850         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
4851         characters
4853         * src/input.c: New static variable use_macro_escape, which is TRUE
4854         iff some character has code SYNTAX_ESCAPE
4855         (input_init): Added initialisation of use_macro_escape.
4856         (check_use_macro_escape): New function to synchronise
4857         use_macro_escape with the syntax table.
4858         (set_quotes): Added call to check_use_macro_escape()
4859         (set_comment): Do.
4860         (set_syntax): Do.
4861         (next_token): Added new case for IS_ESCAPE.
4863         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
4865 1998-10-13  René Seindal  <rene@seindal.dk>
4867         * Prerelease 1.4k.
4869         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
4870         generated-tests.
4872         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
4873         maintained tests in tests/other-tests.  These currently tests for
4874         8-bit transparency, multiple precision arithmetic and sync-line
4875         output.  Test for stackoverflow detection does not work.
4877         * examples/Makefile.am (TESTS): Added tests for all example files.
4879         * examples/mktests.sh: New file.  Help program for creating test
4880         files.
4882         * tests/mkconfig.sh: New file to generate tests/config.m4 and
4883         tests/config.sh.  This is for tests of configure selectable
4884         features.  Picks up all set WITH_ and ENABLE_ veriables from
4885         config.h
4887         * src/path.c (path_search): Added argument 'char **expanded_name'
4888         to return the expanded name.
4890         * src/m4.h: Added 2nd argument to declaration of path_search().
4892         * src/m4.c (main): Added 2nd argument to path_search().
4894         * src/freeze.c (reload_frozen_state): Do.
4896         * src/builtin.c (m4_undivert): Do.
4897         (include): Do.
4899 1998-10-11  René Seindal  <rene@seindal.dk>
4901         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
4903         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
4905         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
4907         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
4909         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
4911         * intl/: Updated to GNU gettext 0.10.35.
4913         * doc/m4.texinfo (Format): Documented that format is blind.
4915         * src/builtin.c (builtin_tab): Builtin format marked as blind.
4917 1998-10-07  René Seindal  <rene@seindal.dk>
4919         * Prerelease 1.4j.
4921         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
4922         .test, as the files are no longer just m4 input.
4924         * tests/get-them (FILE): Changed .m4 extension to .test.
4926         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
4927         Otherwise quoted strings with leading whitespace first in a macro
4928         argument would be eliminated.
4930         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
4931         (expand_argument): Do.
4933         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
4934         grouped together iff both quote and comment strings are single
4935         character.  Otherwise they might include a comment/quote leader.
4936         (next_token): Returns new token type TOKEN_SPACE.
4938         * src/builtin.c (push_builtin_table): New function to push a
4939         builtin_table on the stack without installing its contents.
4940         (find_builtin_by_name): Added call to push_builtin_table() if
4941         reading frozen files.  Otherwise the builtins named in the frozen
4942         files could not be found.
4943         (install_builtin_table): Changed to use push_builtin_table()
4945 1998-10-04  René Seindal  <rene@seindal.dk>
4947         * Prerelease 1.4i.
4949         * configure.in (ALL_LINGUAS): Added Polish pl.po
4951 1998-10-03  René Seindal  <rene@seindal.dk>
4953         * Many files: Incorporated changes to implement dynamic modules.
4954         Detailed comments in src/modules.c and modules/README
4956         * src/module.c: New file, implements the OS dependant parts of
4957         dynamic module loading.
4959         * src/Makefile.am (m4_SOURCES): Added module.c
4961         * src/builtin.h: New file, declares some functions from builtin.c
4962         that are of use for other modules (shipout_int, numeric_arg,
4963         skip_space, bad_argc), and the macros ARG() and DECLARE().
4965         * src/builtin.c (install_builtin_table): New function.  Each
4966         module brings in a builtin_table, which is pushed on a stack.
4967         (struct builtin_table): New struct for list of builtin_tables.
4968         (m4_loadmodule): New function to implement builtin "loadmodule".
4969         (shipout_int): No longer static, to be used by modules.
4970         (numeric_arg): do.
4971         (skip_space): do.
4972         (bad_argc): do.
4973         (builtin_init): changed to call install_builtin_table()
4974         (find_builtin_by_name): Now searches all builtin_tables
4975         (find_builtin_by_addr): do.
4977         * src/path.c: Reorganised to allow for two search paths, one for
4978         include files and one for modules.
4980         * src/m4.h: Added declarations for new functions in module.c and
4981         in path.c.
4983         * src/m4.c (main): Added call to module_init().
4985         * modules: New directory with a few demo modules.
4987         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
4988         in SUBDIRS.
4990         * configure.in: Added modules/Makefile to AC_OUTPUT.
4992         * configure.in: Added code to implement --with-modules.  Tests for
4993         <dlfcn.h> and -ldl.
4995         * acconfig.h: Added WITH_MODULES
4997 1998-10-02  René Seindal  <rene@seindal.dk>
4999         * examples/Makefile.am (pkgdata_DATA): Removed special target for
5000         check and variables TESTS.  These tests are now run from the
5001         tests/ directory.
5003         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
5004         directory.  The files stay there but the tests are run from the
5005         tests/ directory.
5007         * tests/Makefile.am (EXTRA_DIST): Added run-test.
5009         * tests/run-test: New file.  Run a test manually
5011         * tests/Makefile.am, tests/get_them: Moved automatically generated
5012         tests (from the manual) to sub directory tests/gentest/.  The
5013         tests/ directory had gotten a bit messy.
5015 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
5017         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
5018         wrap}.test: Added a few testcases.
5020 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
5022         * Prerelease 1.4h.
5024         * lib/Makefile.am (noinst_HEADERS): regex.h added
5026         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
5027         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
5029         * acm4/Makefile.am: created providing rules to create
5030         $(top_srcdir)/acinclude.m4 to be used by aclocal.
5032         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
5033         `C'. Reported by Ulrich Drepper.
5035         * Makefile.am (SUBDIRS): Removed checks directory
5036         * configure.in (AC_OUTPUT): Removed checks/Makefile
5038         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
5039         the space when m4.texinfo is edited and whitespace.el is active.
5040         (Defn,example): idem.
5042 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
5044         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
5045         ../COPYING. ../Makefile is a file which is certainly present when
5046         test is executed in testSubDir. One can't be sure that the COPYING
5047         file is in .. or ../.. in all situations, the ../Makefile is
5048         always there.
5050         * doc/m4.texinfo (Include): adjusted expected test output
5051         according to new tests, i.e. the input will always come from the
5052         file `in' created by the test.
5054         * tests/Makefile.am: Added three lines at the top to get
5055         esyscmd.1.test working.
5057         * tests/get-them: modified to generate clearer tests who will need
5058         less maintenance when new test examples are created in
5059         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
5060         need the generic file `defs') shell scripts creating `in', `ok',
5061         `out' and when apropriate `okerr' and `err' in the directory
5062         `testSubDir' when executed. The compare of `ok' and `out'
5063         (and of `okerr' and `err') will be the exit status of the test.
5064         `out' must match `ok' (and `okerr' must match `err') for the test
5065         to be succesful.
5067         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
5068         the tests generated by tests/get-them getting it input normally
5069         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
5070         (dot) before the numeric part) is reserved for all other (hand
5071         written) tests. The `+' means one or more times.
5073 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
5075         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
5076         supported short man page to refer to info documentation
5077         * helptoman.pl: added
5078         * configure.in: AC_PATH_PROG(PERL,perl)
5079         * Makefile.am (SUBDIRS): doc after src
5081         * libitized with libit 0.5 from
5082         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
5084         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
5085         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
5086          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
5087         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
5088           lib/rx.{c,h}: added
5089         * configure.in (AC_CHECK_FUNC): getopt_long
5091         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
5093         * TODO: added entry about dependencies
5095 1998-08-10  René Seindal  <rene@seindal.dk>
5097         * Prerelease 1.4f
5099         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
5100         "changesyntax".
5102         * src/builtin.c (m4_changesyntax): Added builtin macro
5103         "changesyntax" to modify the syntax table.
5105         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
5106         table.  All categories are assigned a syntax code and tokens are
5107         read according to this table.
5109 1998-08-09  René Seindal  <rene@seindal.dk>
5111         * src/numb.{c,h}: New files, implements multiple precision eval
5112         using GNU gmp.  Originally submitted by John Gerard Makecki
5113         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
5115         * doc/m4.texinfo (Eval): Added documentation for multiple
5116         precision arithmetic library support.
5118         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
5119         to accommodate multiple precision eval.
5121 1998-08-07  René Seindal  <rene@seindal.dk>
5123         * src/input.c (MATCH, match_input), src/m4.h: changed definition
5124         of comment and quote strings to `unsigned int' to allow eight bit
5125         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
5127         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
5128         patch from Mike Howard <mike@clove.com>
5130 1998-08-06  René Seindal  <rene@seindal.dk>
5132         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
5133         -lintl.
5135 1998-08-03  René Seindal  <rene@seindal.dk>
5137         * Prerelease 1.4e
5139         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
5140         and _ macro.  M4 now builds with --disable-nls.
5142         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
5143         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
5145         * configure.in (ALL_LINGUAS): Added complete list of translations:
5146         de fr it ja nl ru sv.
5148 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
5150         * Prerelease 1.4d.
5152         * src/m4.c: #include <signal.h> not <sys/signal.h>.
5154         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
5156         * checks/Makefile.am: explicit list tests in CHECKS.
5158         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
5159         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
5160         mkinstalldirs, install-sh: Added automake (1.3) support.
5162         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
5163         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
5164         Used libitize (0.4) to update.
5166         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
5167         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
5168         README accordingly.
5170         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
5171         stack overflow functionality.
5173 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
5175         * Prerelease 1.4.1.
5177         * Makefile.in (realclean-local): Delete stamp-h.in.
5179         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
5180         Localize, adapting from how it is done in sharutils.
5182         * fr.tt: New file, for French.
5184         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
5185         src/freeze.c: Rename PRODUCT to PACKAGE.
5187 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
5189         * configure.in: Check for <libintl.h> and <locale.h>.
5190         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
5191         src/stackovf.c: Rename _ to __P.
5192         * src/m4.h: Declare _ as a macro returning its argument, or else,
5193         include <libintl.h> and declare _ as gettext.
5194         * src/m4.c: Possibly include <locale.h> and call setlocale.
5195         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
5196         src/input.c, src/macro.c, src/output.c, src/path.c,
5197         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
5198         strings.
5200 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
5202         * doc/Makefile.in (stamp-vti): Use new -r option to date.
5204         * configure.in: Put --with-gmp in place, in prevision for John
5205         Gerard's work.
5206         * acconfig.h: Document WITH_GMP.
5208 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
5210         * Release 1.4.
5212         * doc/Makefile.in (realclean): Also remove stamp-vti.
5213         Reported by Eric Backus.
5215 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
5217         * src/freeze.c (produce_frozen_state): If the frozen file cannot
5218         be opened, return immediately after producing the error message.
5219         Reported by Andreas Schwab.
5221         * configure.in: Check for const only after having found possible
5222         ANSIfying compiler flags, this is of no use to check it before.
5223         Reported by Alexander Lehmann.
5225 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
5227         * src/macro.c (collect_arguments): Cast obstack arguments to
5228         (voidstar), so avoiding compiler warnings.
5229         Reported by Joseph E. Sacco.
5231         * src/freeze.c (produce_frozen_state): Cast printed lengths to
5232         (int) so they correspond to %d format items.
5233         Reported by Joseph E. Sacco.
5235         * src/m4.c (main): Cast the argument to xfree to (voidstar).
5236         * src/symtab.c (free_symbol): Idem.
5237         Reported by Karl Vogel.
5239 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
5241         * Makefile.in (DISTFILES): Distribute BACKLOG.
5243         * configure.in: Define PRODUCT and VERSION.
5244         * acconfig.h: Document PRODUCT and VERSION.
5245         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
5246         constant string m4 and variable or parameter named version.
5248 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
5250         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
5251         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
5252         defines __STDC__ to 0, for indicating it is *not* ANSI!
5253         Reported by Kaveh R. Ghazi.
5255         * configure.in: Added obsolescent tests for AIX and Minix.
5257         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
5258         which texclean does not exist anymore.
5259         Reported by Eric Backus, Jim Meyering, John David Anglin and
5260         Joseph E. Sacco.
5262 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
5264         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
5265         Reported by John David Anglin.
5267         * src/ansi2knr.c: New version, sent by Peter Deutsch.
5268         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
5269         ANSI2KNR, depending on the fact the compiler is ANSI or not.
5270         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
5271         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
5272         of $U, put underline in extensions rather than in basenames.  Use
5273         implicit rules, now that regularity makes this possible.
5274         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
5275         of ansi2knr whenever it is needed.
5276         * configure.in: Adjusted for correct STACKOVF substitution.
5277         * src/debug.c (trace_format): When not __STDC__, use (...) as a
5278         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
5279         Reported by David MacKenzie.
5281         * Makefile.in: Remove binprefix.  Use transform_name instead.
5282         Reported by David MacKenzie.
5284         * doc/Makefile.in: Create version.texi, use it, clean it.
5285         Reported by Jim Meyering.
5287 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
5289         * Makefile.in (all, install, uninstall): Depend on Makefile.
5291         * Makefile.in: For actions invoking $(MAKE) from within compound
5292         sh statements, exit non-zero if the sub-make fails.  Otherwise,
5293         the top-level make may exit successfully when it should fail.
5294         Reported by Jim Kingdon.
5296         * {,/*}Makefile.in: Use && after all cd, in case they fail.
5298         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
5299         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
5300         * configure.in: Substitute PRODUCT and VERSION.
5302         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
5304 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
5306         * Makefile.in (mostlyclean-local): Do not remove *~.
5307         * */Makefile.in (mostlyclean): Idem.
5308         Reported by Robert E. Brown and Richard Stallman.
5310 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
5312         * src/m4.h: Get rid of CONFIG_BROKETS.
5314 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
5316         * configure.in: Use AC_ARG_PROGRAM.
5317         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
5318         Reported by David MacKenzie.
5320 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
5322         * configure.in: Do not add -O to CFLAGS for GNU C, now that
5323         configure does it automatically.
5324         Reported by Jim Meyering.
5326 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
5328         * src/stackovf.c: Declare the handler_t typedef earlier in the
5329         code, use it for stackovf_handler.
5330         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
5331         casting sigsegv_handler.
5332         Reported by Robert Bernstein.
5334         * src/m4.c (main): Initialize program_name to argv[0] without
5335         basename'ing it.
5336         Reported by Karl Berry.
5338 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
5340         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
5341         Reported by Karl Berry.
5343 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
5345         * lib/Makefile.in (mostlyclean): Added.
5346         (TAGS): Make in $(srcdir).
5348         * configure.in: Use `choke me' in test, like everywhere!
5350         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
5351         unreacheable and useless.
5353         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
5355         * lib/Makefile.in (DISTFILES): Distribute TAGS.
5356         (distclean): Do not remove TAGS.
5357         (realclean): Remove it.
5358         * Makefile.in: Make TAGS in lib also, not just in src.
5359         Reported by Karl Berry.
5361         * Makefile.in (distclean, realclean): Instead of recursively
5362         calling $(MAKE) for the -local part, allow parallel execution of
5363         -recursive and -local, only delay the removal of config.status,
5364         which is repeated in both goals.
5366 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
5368         * Release 1.3.
5370         * Makefile.in: Group all *clean-recursive goals in one, using sed
5371         to remove `-recursive' while calling make recursively.  Also, use
5372         a subshell for each recursive $(MAKE).
5373         Reported by Jim Meyering.
5375         * src/m4.h (memcpy): Define with bcopy for BSD systems.
5376         Reported by Kaveh R. Ghazi.
5378         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
5379         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
5380         specify it.
5382         * configure.in: Use date instead of touch for stamp-h.
5383         * Makefile.in (stamp-h.in): Idem.
5385         * Makefile.in (distclean, realclean): Force serial execution of
5386         both goals, in case parallel makes are being used.
5387         Reported by Jim Meyering.
5389         * src/Makefile.in (DISTFILES): Distribute TAGS.
5390         (distclean): Do not remove TAGS.
5391         (realclean): Remove it.
5392         Reported by Karl Berry.
5394 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
5396         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
5397         to old names, for following Autoconf.
5399 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
5401         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
5402         ./install.sh will not be correctly referred to in sub-Makefiles.
5403         Reported by John David Anglin.
5405         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
5406         Reported by Eric Backus.
5408         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
5409         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
5410         config.status into remaking this directory's Makefile only.
5411         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
5412         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
5413         Reported by Jim Meyering.
5415 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
5417         * configure.in: Correct stack overflow detection logic, taking
5418         care of systems having only incomplete implementations (like for
5419         Pyramid 9820 OSx 5.0d).
5420         Reported by Kaveh R. Ghazi.
5422         * src/Makefile.in (TAGS): Remote -t from etags call.
5424 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
5426         * lib/Makefile.in (install): Depend on all.
5428 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
5430         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
5431         Reported by Jim Meyering and John David Anglin.
5433         * Makefile.in (distclean-local): Delete config.log.
5434         Reported by Jim Meyering.
5436         Solidify frozen files with respect to -P:
5437         * src/m4.c: Have -P set prefix_all_buitins variable instead of
5438         calling a function by that name.  Declare the variable.
5439         * src/m4.h: Adjust declaration for prefix_all_buitins.
5440         * src/builtin.c (builtin_init): Merge in functionality from
5441         previous prefix_all_buitins function, while making entries in the
5442         symbol table, but not modifying the builtin description itself.
5444         * src/freeze.c (reload_frozen_state): Add a useless `break;',
5445         because *many* compilers do not accept an empty `default:'.
5446         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
5447         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
5449         * configure.in: Use AC_TYPE_SIGNAL.
5450         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
5451         Reported by Robert Bernstein.
5453         * checks/Makefile.in (check): Modify PATH so check-them will find
5454         m4 in the src directory.
5455         * Makefile.in (check): Don't.
5456         Reported by Akiko Matsushita and Jim Meyering.
5458         * src/output.c (make_room_for, output_character_helper): New
5459         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
5460         a per buffer MAXIMUM_BUFFER_SIZE.
5462         * src/output.c (output_text): New function, for optimizing the
5463         output of strings of characters.  Use it.
5465 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
5467         * doc, src: New directories reorganizing the distribution.
5468         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
5469         files.
5470         * Makefile.in: Adjusted.
5471         * configure.in: Configure new Makefiles.
5473         * m4.h: Declare STRING typedef.  Use it for comment and quote
5474         strings, adjusting all references.  (This is the rudiments of a
5475         beginning for the eventual withdrawal of NUL terminated strings.)
5476         * output.c (shipout_text): Accept a length parameter, and use it.
5477         All callers adjusted.
5479 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
5481         * m4.h: Include <unistd.h> if it exists.
5482         * stackovf.c: Don't.
5484         Clean up for current_diversion variable:
5485         * output.c: Move current_diversion from builtin.c.
5486         * m4.h: Declare current_diversion so builtin.c can access it.
5487         * output.c (output_init, make_diversion): Initialize or update
5488         current_diversion.
5489         * builtin.c (builtin_init, m4_divert): Leave current_diversion
5490         alone.
5492         Remove limit on number of diversions:
5493         * output.c: Replace ndiversion by diversions, declare it.
5494         (output_init): Allocate only diversion 0.
5495         (make_diversion): Allocate new diversions as needed.
5496         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
5497         * m4.c: Still accept -N, but do nothing with it.
5498         Reported by David MacKenzie.
5500         Freeze diversions:
5501         * output.c (freeze_diversions): New function.
5502         * m4.h: Declare freeze_diversions.
5503         * freeze.c: Document frozen file format, revise it, call
5504         freeze_diversions to add diversions to frozen format, and code to
5505         reload them properly.
5506         * m4.c: Do not undivert automatically at end when status being
5507         frozen.  Do not call builtin_init when reloading frozen state.
5509         Speed up diversion processing:
5510         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
5511         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
5512         structure and variables, cached variables out of output_diversion,
5513         reallocate_diversion_for and OUTPUT_CHARACTER.
5514         (shipout_text, make_diversion, insert_diversion): Adapted to new
5515         structures.
5516         (insert_file): Use better buffering.
5517         Reported by David MacKenzie.
5519 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
5521         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
5522         dist works from another build directory.
5524 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
5526         * symtab.c (hack_all_symbols): Use hash_table_size instead of
5527         constant HASHMAX, for -H option to work better.
5529         * builtin.c (DECLARE): Simplify by using _ ().
5531         * freeze.c: New file.
5532         * Makefile.in: Compile it, distribute it.
5533         * m4.c: Recognize, document and process --freeze-state (-F) and
5534         --reload-state (-R) options.  Pass a true flag to builtin_init
5535         only if no reloading some state.
5536         * builtin.c (define_builtin): Remove static specifier.
5537         (find_builtin_by_name): Remove static specifier.
5538         (builtin_init): Accept and obey a flag argument.
5539         * m4.h: Add declarations for freeze.c, changes for builtin.c.
5541 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
5543         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
5544         specifier.
5546         * configure.in: Implement --with-dmalloc.
5547         * acconfig.h: Document WITH_DMALLOC.
5548         * m4.h: Add code for when WITH_DMALLOC.
5550 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
5552         * m4.c (long_options): Use "error-output", the dash was missing.
5553         Reported by Akiko Matsushita.
5555 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
5557         * m4.h: Include <sys/types.h>.
5558         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
5559         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
5560         int.
5561         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
5562         as size_t, not int.
5563         * builtin.c (dump_args): Declare len as size_t, not int.
5565         * debug.c: Prototype the forward declaration of debug_set_file.
5567         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
5568         shadowing of this variable.
5569         * output.c (insert_diversion): Idem.
5571         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
5572         (input_init): Duplicate default quote and comment strings.
5573         (set_quotes): Free previous quote strings in all cases.  Duplicate
5574         even default quote strings.
5575         (set_comment): Free previous comment strings in all cases.
5576         Duplicate even default comment strings.
5578         * configure.in: Updated for Autoconf 2.0.
5579         * Makefile.in (distclean-local): Also delete config.cache.
5581         * m4.c (usage): Reorganize the --help output by topic.  Include a
5582         description for debugging flags.
5584 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
5586         * configure.in: If sigaction is available and SA_ONSTACK defined,
5587         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
5588         defined, use sigvec.  Else don't compile stackovf.c.
5589         * stackovf.c (setup_stackovf_trap): Idem.
5590         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
5591         and Simon Leinen.
5593 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
5595         * m4.c (usage): Replace printf par fputs.
5597 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
5599         * Release 1.2
5601 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
5603         * configure.in: Check for sigaction and sigvec.  Add a new delayed
5604         check for RLIMIT_STACK, combine in the checking for getrlimit.
5605         All those things are not universally available.
5606         * stackovf.c: Split setting up the trap handler and catching
5607         signals, for better taking care of various configure outcomes.
5608         * examples/stackovf.sh: Correct a typo.
5609         Reported by Eric Backus, Jim Avera and Jim Meyering.
5611 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
5613         * ansi2knr.c: New version sent by its author, Peter Deutsch.
5615 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
5617         * Makefile.in: Modify so parallel make will not try making
5618         lib/libm4.a twice simultaneously.
5619         Reported by Jim Meyering.
5621 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
5623         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
5624         error message, for when no code possibility exists.  Even if this
5625         line is completely #ifdef'ed out, it brings a syntax error.
5626         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
5628         * Makefile.in (install): Have install depend on all too, for lib
5629         to be remade as needed.
5631         * examples/stackovf.sh: Try ksh, bsh and bash for shells
5632         providing ulimit, instead of using only ksh.
5633         Reported by Jim Avera and Joseph E. Sacco.
5635 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
5637         * Makefile.in (check): Have it depend on all instead of m4.  In
5638         this way, a change in lib will be detected and processed.
5640         * builtin.c (numeric_arg): Use strtol and verify the conversion,
5641         instead of using sscanf which stops as soon as there is a
5642         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
5643         and divert(1xyzzy) were all accepted without any warning or error
5644         messages.
5645         * m4.h: Declare strtol as long if not including stdlib.h.
5646         * configure.in: Check for limits.h, and replace strtol if missing.
5647         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
5648         * lib/strtol.c: New file, from elsewhere.
5649         Reported by Andreas Schwab.
5651 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
5653         * macro.c (expand_macro): Cast value to (boolean) prior to
5654         assigning it to traced.
5655         Reported by Tom McConnell.
5657         * Makefile.in (m4): Always make all in lib first.
5658         Reported by Jim Meyering.
5660 1994-07-06  Jim Avera <jima@netcom.com>
5662         * stackovf.c: Isolated OS-dependent sections; Improved portability,
5663         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
5664         handlers), and a default error message if the fault address is not
5665         available (when neither siginfo.h nor BSD sigcontext are supported).
5666         * configure.in: Changes for stackovf.h: Check for sigcontext,
5667         sigaction, sigstack, and define rlim_t as int if necessary.
5668         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
5669         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
5670         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
5672 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
5674         * configure.in: Use AC_SET_MAKE.
5675         * Makefile.in: Use @SET_MAKE@.
5676         Reported by Jim Meyering.
5678         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
5679         Reported by Ian Taylor.
5681 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
5683         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
5684         because siginfo.h is unrelated to standard headers, and siginfo.h
5685         is already checked for.
5686         Reported by Joseph E. Sacco.
5688         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
5689         PROTOTYPES.
5690         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
5691         AC_PROTOTYPES.
5693 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
5695         * builtin.c (substitute): Use \& to represent this part of the
5696         string which was matched by the whole regexp, instead of
5697         representing the whole string.  Any usage of \0 issues a warning
5698         and acts like \&, it will disappear in some subsequent release.
5700 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
5702         * m4.c: Complete prototype for forwarded declaration of usage.
5704         * input.c (init_macro_token): Correct own reference in error
5705         message.  Previous name get_macro_func was referred to instead.
5706         (next_char):  Correct own reference in error message.  Previous
5707         name advance_input was referred to instead.
5709         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
5710         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
5711         and_term, not_term, logical_not_term, cmp_term, shift_term,
5712         add_term, mult_term, exp_term, unary_term, simple_term): Add
5713         prototype to forwarded declarations.  Declare parameter v1 as
5714         eval_t * instead of int *.  Same for local variable v2 in dyadic
5715         functions.  Same for result in exp_term.
5716         * builtin.c (m4_eval): Declare value as eval_t instead of int.
5717         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
5718         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
5719         (shipout_int): Cast first argument of ntoa to eval_t.
5720         Reported by Thorsten Ohl.
5722         * macro.c: Complete the prototypes of forwarded expand_macro and
5723         expand_token.
5724         Reported by Thorsten Ohl.
5726         * m4.h: Define voidstar as void * or char * depending on __STDC__.
5727         The Ultrix 3.1 compiler cannot do much with void pointers.
5729         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
5730         * m4.c (xfree):  Replace void * by voidstar.
5731         Reported by Tom McConnell.
5733         * ansi2knr.1: New, from elsewhere.
5734         * Makefile.in (DISTFILES): Distribute ansi2knr.1
5736         * Makefile.in (stamp-h.in): Avoid running ./config.status if
5737         stamp-h does not exist yet.  This avoids running it a second time
5738         just after the initial ./configure.
5739         Reported by David MacKenzie and Tom McConnell.
5741         * m4.h: Replace the enum debug_info declaration with a series of
5742         #define's.  The Ultrix 3.1 compiler would otherwise need casting
5743         (int) to most references, when used in expressions.
5744         Reported by Tom McConnell.
5746 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
5748         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
5749         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
5750         calls the compiler.  Previously, FP_PROTOTYPES was only calling
5751         the preprocessor; by not being subject to CFLAGS, this was
5752         discouraging those flags asking for ANSI compilation.
5753         * acconfig.h: Document HAVE_PROTOTYPES.
5754         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
5755         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
5756         Reported by Eric Backus.
5758         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
5759         from the environment.  Default CFLAGS to -g if not set.
5760         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
5761         * lib/Makefile.in: Have CFLAGS substituted from configure.
5762         Reported by Eric Backus and Tom McConnell.
5764         * configure.in: m4_undefine changeword before using AC_ENABLE.
5766         * m4.h: Declare prototypes for error (for ANSI compilers only),
5767         prefix_all_builtins and reference_error.
5768         Reported by Tom McConnell.
5770         * input.c (set_word_regexp): Do not try to initialize the array
5771         test from a string, this does not work with non-ANSI compilers.
5772         Reported by Eric Backus.
5774         * Makefile.in (dist): Clean examples/ before saving it.
5775         (distclean-local): Also remove stamp-h.
5776         Reported by Eric Backus.
5778         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
5779         non ANSI compilers.
5780         Reported by Tom McConnell.
5782         * checks/Makefile.in (clean): Depends on mostlyclean.
5783         (mostlyclean): New goal.
5785 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
5787         * Makefile.in (DISTFILES): Distribute install.sh.
5788         * install.sh: New file, copied from elsewhere.
5789         Reported by Assar Westerlund and Kaveh R. Ghazi.
5791 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
5793         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
5794         * acconfig.h: Explain ENABLE_CHANGEWORD.
5796         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
5797         from code provided by Pete Chown]
5798         * m4.h: Add original_text field to u_t variant of union u.
5799         Declare TOKEN_DATA_FUNC macro.
5800         * builtin.c: Declare changeword.
5801         (m4_changeword): New function.
5802         * input.c: Include "regex.h", define variables with word regexps.
5803         (input_init): Initialize the word regexp.
5804         (set_word_regexp): New.
5805         (next_token): Declare local variables, use the previous code if
5806         default_word_regexp is true.  Else, match using a new code.  Save
5807         the original text.
5808         * macro.c (expand_token): Ship out original text if not a macro
5809         name.
5810         Reported by Krste Asanovic and Pete Chown.
5812         [These modifs all depend upon ENABLE_CHANGEWORD]
5813         * m4.h: Declare external user_word_regexp.
5814         * m4.c: Declare user_word_regexp, and initialize it from
5815         --word-regexp or -W, or NULL if not specified.
5816         * input.c: Use user_word_regexp if specified, instead of
5817         DEFAULT_WORD_REGEXP.
5819         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
5820         agree with it.
5822         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
5823         * checks/Makefile.in: Empty the suffix list.
5824         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
5826         * m4.c: Declare nesting_limit and initialize it to 250.
5827         Implement -LNUMBER or --nesting-limit=NUMBER to change its
5828         value.
5829         * m4.h: Declare nesting_limit as external.
5830         * macro.c (expand_macro): Stop execution whenever nesting limit
5831         is exceeded.
5832         Reported by Bengt Mertensson.
5834         * eval.c (evaluate): Diagnose excess characters in eval input.
5835         Things like `eval(08)' used to return 0 with no diagnostic.
5837         * m4.h: Capitalize first letter of all macro arguments in
5838         definitions.
5840         * m4.c: Declare warning_status, initialize it to 0.  Add new
5841         option -E, or --fatal-warnings, which sets warning_status to
5842         EXIT_FAILURE instead.
5843         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
5844         EXIT_FAILURE if not otherwise done by header files.
5845         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
5846         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
5847         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
5848         argument of all M4ERROR calls.
5849         Reported by Noah Friedman.
5851         * examples/incl-test.m4: Renamed from incl_test.m4.
5852         * examples/include.m4: Include incl-test.m4 instead of
5853         incl_test.m4.
5854         * examples/multiquotes.m4: Renamed from multi-quotes.m.
5856 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
5858         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
5859         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
5860         also tested it on a Sun Sparc workstation running SunOS 4.x.
5862         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
5863         49.format check, abusing a `union values' argument with sprintf
5864         without selecting the proper field.  Now, save the formatting type
5865         first, delaying the fetch of the corresponding argument.
5866         Reported by Joseph E. Sacco and Tom Quinn.
5868         * format.c (format): Remove const from char *fmt declaration when
5869         not HAVE_EFGCVT, because a NUL may be forced into it.
5871         * m4.h: Declare atof() when not STDC_HEADERS.
5872         Reported by Joseph E. Sacco.
5874         * Regenerate configure using Autoconf 1.11, this corrects a
5875         problem about an incorrect cpp seting on NeXT 3.1.
5876         Reported by Alexander Lehmann.
5878 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
5880         * m4.h (_): Change argument from `x' to `Args'.
5882 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
5884         * m4.h: Rename Args() to _().
5885         * m4.h: Remove extern specifier from all function declarations.
5887 1994-04-22  Jim Avera <jima@netcom.com>
5889         * stackovf.c: New file implementing stack-overflow detection.
5890         * configure.in: Check for getrlimit, sigaction.  If all of
5891         standard headers, getrlimit and sigaction, define USE_STACKOVF and
5892         substitute ${U}stackovf.o for STACKOVF.
5893         * acconfig.h: Declare USE_STACKOVF.
5894         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
5895         * m4.h: Declare setup_stackovf_trap().
5896         * m4.c: Call setup_stackovf_trap().
5897         * tests/stackovf_test.sh: New file.
5899 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
5901         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
5903         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
5905 1994-01-30    <pinard@iro.umontreal.ca>
5907         * m4.h: Remove definition of volatile, not used anymore.
5908         Reported by Jim Meyering and Joseph E. Sacco.
5910         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
5911         of `if ... else /* nothing */' for if macros.
5912         Reported by Jim Meyering.
5914         * builtin.c (m4_regexp): Reorganize the code for avoiding a
5915         warning from gcc about `repl' possibly used before defined.
5916         Reported by Jim Meyering.
5918         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
5919         Reported by Jim Meyering.
5921 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
5923         * m4.h: Move the conditional definition of volatile after the
5924         inclusion of system files, because they may define it first.
5926 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
5928         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
5929         get around a problem with Alpha make seeing a syntax error, there.
5930         Reported by Vern Paxson.
5932 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
5934         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
5935         Reported by Richard Stallman.
5937 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
5939         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
5940         instead of AC_HAVE_FUNCS.
5941         Reported by Noah Friedman.
5943 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
5945         * m4.c: Initialize show_help and show_version to zero.
5947         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
5948         Use them in exit() and usage() calls.
5950 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
5952         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
5953         syserr() macro.  Delete errref, add reference_error and M4ERROR.
5954         * m4.c: Replace errref, which was returning an input reference
5955         string, with reference_error, which prints it on standard error.
5956         * builtin.c, output.c: Use errno as second parameter to error,
5957         instead of using syserr() with %s.
5958         * *.c: Use M4ERROR instead of error: no more errref() with %s.
5959         Doing so, the program name appears after the input reference
5960         instead of before, which eases M-x next-error processing.
5962 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
5964         * checks/get-them: Escape braces with backslashes in patterns,
5965         because HPUX-9.01 awk needs this.
5966         Reported by Jim Meyering.
5968 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
5970         * builtin.c: Declare "FILE *popen ();".
5972         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
5973         macros, replace error_message_prefix() declaration by errref()'s.
5974         Declare xrealloc, for use in errref().
5975         * m4.c: Delete error_message_prefix() function, add errref().
5976         * *.c: Use error() systematically in place of all error macros,
5977         now that error() flushes stdout first.  Make needed adjustments.
5979         * m4.h: Remove const in sys_errlist[] declaration, it creates
5980         conflicts on SGI and Alpha.
5981         Reported by Kaveh R. Ghazi.
5983 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
5985         * m4.c: Include <getopt.h> instead of "getopt.h".
5987         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
5988         * acconfig.h: New, for documenting HAVE_EFGCVT.
5989         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
5990         use them wherever appropriate.  Also use -I. for compilations.
5991         * lib/Makefile.in: Use -I.. for compilations.
5992         * *.c: Include <config.h> or "config.h".
5994         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
5995         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
5997 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
5999         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
6001         * input.c (input_init): Initialize quote and comment strings
6002         explicitely instead of calling set_quotes and set_comment: by
6003         doing so, we ensure we do not free uninitialized variables.
6005         * checks/check-them: Reverse arguments to both diff, so the
6006         expected is on the left and the obtained on the right.
6008         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
6009         macros. Delete declarations for m4error, warning, fatal and
6010         internal_error, add declaration for error_message_prefix.
6011         * m4.c:  Delete m4error, warning, fatal and internal_error
6012         routines, add error_message_prefix routine.
6013         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
6014         warning with WARNING*, fatal with FATAL* and internal_error with
6015         INTERNAL_ERROR*.
6016         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
6017         this is not needed anymore.
6019         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
6020         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
6021         and debug_message, add declaration for debug_message_prefix.
6022         * debug.c: Remove static specifier for FILE *debug declaration.
6023         Delete debug_print and debug_message routines, add
6024         debug_message_prefix routine.
6025         * builtin.c, debug.c: Replace debug_print routine calls with
6026         DEBUG_PRINT* macro calls.
6027         * input.c, path.c: Replace debug_message routine calls with
6028         DEBUG_MESSAGE* macro calls.
6030         * m4.h: Remove inclusion of <varargs.h>.
6031         * debug.c: Include <stdarg.h> or <varargs.h>.
6032         (trace_format): Use stdarg instead of varargs if __STDC__.
6034         * configure.in: Remove checks for vfprintf and _doprnt.  These
6035         implementations use varargs tricks which are not portable enough.
6036         * lib/vfprintf.c: Deleted.
6037         * lib/_doprnt.c: Deleted.
6038         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
6039         Reported by Joel Sherrill.
6041         * path.c (add_include_directory): Use xstrdup.
6043         * builtin.c (find_builtin_by_name): Declare static.
6045         * *.[ch]: Add const to a few "char *" declarations.
6047         * configure.in: Remove commented tests for fileno() and fstat().
6048         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
6050         * debug.c (debug_flush_files): New.
6051         * m4.h: Declares it.
6052         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
6053         Reported by Nicolas Pioch.
6055 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
6057         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
6058         Reported by Joel Sherrill.
6060         * builtin.c (prefix_all_builtins): Instead of the table size, use
6061         the null entry at end for stopping the loop.  It was overwritten.
6062         Reported by Andreas Schwab and Jim Meyering.
6064         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
6065         Reported by Kaveh R. Ghazi.
6067         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
6068         Reported by Karl Vogel.
6070 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
6072         * m4.h: Do not define volatile if already defined.
6073         Reported by René Seindal.
6075         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
6077         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
6078         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
6080 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
6082         * m4.h: Define strchr and strrchr in terms of index and rindex,
6083         instead of the other way around.
6084         * builtin.c, m4.c, path.c: Use strchr instead of index.
6086         * input.c (next_char): Remove a "break;" after a "return ...;".
6087         Reported by Tom McConnell.
6089 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
6091         * Release 1.1
6093         * configure.in: Do not copy check files in the build hierarchy.
6094         * checks/check-them: Identify the m4 version being checked.  For
6095         finding m4, look in $PATH instead of in the parent directory.
6096         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
6097         * checks/Makefile.in (.all-stamp): Always create check files in
6098         the source hierarchy, not anymore in the build hierarchy.
6099         (check): cd to the source hierarchy before performing checks.
6100         Do not copy nor clean COPYING anymore, take it from `..'.
6101         Reported by Tom McConnell.
6103         * Makefile.in (Makefile): Use $(SHELL).
6104         (config.status): Use $(SHELL).  Use "config.status --recheck"
6105         instead of "configure --no-create", which is obsolete.
6106         Reported by Tom McConnell.
6108 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
6110         * m4.c (usage): Use "%s" instead of "m4" in format string.
6111         Reported by Jim Meyering.
6113         * Makefile.in: Distribute mkinstalldirs.
6114         Reported by Pierre Gaumond.
6115         Reported by Jim Meyering.
6116         Reported by Tom McConnell.
6117         Reported by Andreas Gustafsson.
6119         * checks/check-them: Renamed from checks/check_them.
6120         * checks/get-them: Renamed from checks/get_them.
6121         * checks/.all-stamp: Renamed from checks/.all_stamp.
6122         * checks/Makefile.in: Changed accordingly.
6123         Reported by Jim Meyering.
6125 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
6127         * lib/Makefile.in (dist): Correct permissions on files.
6129         * output.c: Declare tmpfile, some systems don't.
6131 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
6133         * checks/Makefile.in (dist): Correct permissions on files.
6135         * Makefile.in (dist): Ensure recursive linking for subdirectory
6136         `examples', also set read/write permissions on all its files.
6138         * mkinstalldirs: New, from elsewhere.
6139         * Makefile.in: Use it.
6141         * debug.c: Synchronize debug messages and regular output when
6142         the debug file and stdout are redirected to the same file.
6143         * configure.in: Add (commented) checks for fileno and fstat.
6144         Reported by Jim Avera.
6146         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
6147         etc., arguments, then ignore the superfluous one.  m4 used to
6148         diagnose missing arguments and return the empty string.
6149         Reported by Nick S. Kanakakorn.
6151 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
6153         * m4.c (main): At end of all input, ensure all undiverted text
6154         goes to the main output stream.
6155         Reported by Andreas Gustafsson.
6157         * m4.c (main): exit (0), instead of return 0.
6159         * m4.c: Implement -P and --prefix-builtins.
6160         * builtin.c: Delete const specifier on builtin_tab.
6161         (prefix_all_builtins): New.
6162         Reported by Noah Friedman.
6163         Reported by Scott Bartram.
6165         * c-boxes.el: New, from elsewhere.
6166         * Makefile.in: Distribute it.
6168         * m4.h: Do not define bcopy if <string.h> defines it.
6169         Reported by Stephen Perkins.
6171         * builtin.c (define_macro): Allow a missing second argument, in
6172         which case it is implied empty.  Affects define and pushdef.
6173         Reported by Eric Allman.
6175 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
6177         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
6178         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
6179         * builtin.c: Initialize all the blindness fields in builtin_tab.
6180         (define_builtin): Copy the blindness of a builtin into its symbol.
6181         * macro.c (expand_token): Avoid processing a blind builtin if the
6182         next character is not an opening parenthesis.
6183         Reported by David MacKenzie.
6184         Reported by Noah Friedman.
6186         * configure.in: Ensure an exit status of 0 on completion.
6187         Reported by Vivek P. Singhal.
6189         * eval.c (eval_lex): Admit both lower and upper case letters for
6190         bases greater than 10.  Only lower case letters were accepted.
6192         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
6193         Reported by Krste Asanovic.
6195         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
6196         * eval.c (logical_not_term): New name for not_term.
6197         * eval.c (xor_term): New, between or_term and and_term.
6198         * eval.c (not_term): New, between and_term and logical_not_term.
6199         * eval.c (shift_term): New, between cmp_term and add_term.
6200         Reported by Krste Asanovic: ~, ^, <<, >>.
6201         Reported by Ben A. Mesander: ** vs ^.
6203         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
6204         * m4.h: Delete xrealloc.c.
6205         * lib/xmalloc.c: New, from elsewhere.
6206         * lib/xstrdup.c: New, from elsewhere.
6207         * lib/Makefile.in: Distribute and compile them.
6209         * m4.c: Change progname to program_name.
6210         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
6211         * lib/error.c: New, from elsewhere.
6212         * lib/Makefile.in: Distribute and compile error.c.
6213         * configure.in: Check AC_VPRINTF and for strerror.
6214         * m4.c: Delete cmd_error.  Use error instead.
6215         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
6217         * m4.h: Delete #define const, let Autoconf takes care of this.
6219         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
6220         Merge parse_args into main.  Declare argv to be `char *const *',
6221         then remove superfluous casts.
6223         * m4.c: Rename --no-gnu-extensions to --traditional.
6224         Reported by Ben A. Mesander.
6226         * m4.c (usage): Add a status parameter.  Supply one in various
6227         calls.  Add --help processing.  Remove -V for --version.
6229         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
6231         * lib/Makefile.in: Have an AR=ar declaration.
6232         Reported by Eric Backus.
6233         Reported by Bjorn R. Bjornsson.
6234         Reported by Tom Tromey.
6235         Reported by Kristine Lund.
6236         Reported by Marion Hakanson.
6238 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
6240         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
6241         Reported by Noah Friedman.
6243 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
6245         * Makefile.in: Remove MDEFINES and cleanup.
6247 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
6249         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
6250         Create a gzip file.
6252 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
6254         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
6255         ensure 777 mode for directories, so older tar's will restore file
6256         modes properly.
6258 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
6260         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
6261         so the installer can override automatically configured choices.
6262         Reported by Karl Berry.
6264 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
6266         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
6267         previous version was not working properly on m68k-hp-bsd4.3.
6268         Reported by Roland McGrath.
6270         * lib/_doprnt.c: Stolen from Oleo distribution.
6271         * configure.in: Check for _doprnt.c if vfprintf.c selected.
6272         * lib/Makefile.in: Distribute _doprnt.c.
6273         Do not distribute regex.[ch].old anymore.
6275 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
6277         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
6278         Richard wants it there.
6280 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
6282         * Makefile.in: Add DEFS to MDEFINES.
6283         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
6284         (libm4.a): Remove the library before creating it.
6285         (distclean): Remove tags and TAGS too.
6287 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
6289         * Makefile.in (dvi, m4.dvi): New goals.
6291         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
6292         macro.c, output.c, path.c, symtab.c: Change Copyright from
6293         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
6295         * examples/divert.m4: Deleted, this bug has been corrected.
6297         * Makefile.in (texclean, mostlyclean): New goals.
6299         * Makefile.in (clean): Remove clutter from ansi2knr.
6300         Reported by Pierre Gaumond.
6302 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
6304         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
6305         might well use CFLAGS is s/he needs it.
6307         * Makefile.in: Allow installation of info files from a separate
6308         build directory.
6309         Reported by Jason Merrill.
6310         Reported by David MacKenzie.
6311         Reported by Skip Montanaro.
6312         Reported by Erez Zadok.
6313         Reported by Assar Westerlund.
6315 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
6317         * Release 1.0.3
6318         This is still a beta release for the future GNU m4 version 1.1.
6320         * lib/alloca.c: New, from elsewhere.
6321         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
6323         * m4.h: Do not define index/rindex if already defined.  If
6324         FALSE/TRUE are already defined, do not redefine them, but merely
6325         define boolean typedef to int.
6327         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
6328         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
6329         because some C compilers do not like connectives with #ifdef.
6330         * m4.h: Define `volatile' only if __GNUC__, instead of once for
6331         __GNUC__ and once for __STDC__.
6332         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
6334         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
6335         Makefile dependencies.  Without it, make keeps destroying and
6336         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
6338         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
6339         to diversion/DIVERSION, this was a spelling error.
6341         * m4.c: Declare version[], remove #include "version.h".
6342         * version.h: Deleted.
6343         * Makefile.in: Remove references to version.h.
6345         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
6346         production, by using a simpler and more robust algorithm.  This
6347         solves the problem of synclines sometimes written in the middle of
6348         an output line.  Delete sync_line() and output_lines variable.
6349         * m4.h: Remove sync_line prototype and output_lines declaration.
6350         * input.c (next_char), output.c (shipout_text): Remove references
6351         to output_lines.
6352         * input.c (push_file, pop_file): Merely put the value -1 in
6353         output_current_line instead of calling sync_line, for delaying a
6354         single `#line NUM FILE' before next output line.  Do not test
6355         for sync_output, because this is unnecessary clutter.
6356         * output.c (make_divertion, insert_divertion): Idem.
6357         * input.c: Rename must_advance_line to start_of_input_line, for
6358         consistency.
6360         * debug.c (trace_header): Select a new debug line format, which
6361         better complies with GNU standards for formatting error messages.
6362         With option `-dfl', M-x next-error might be used on the output.
6363         * m4.c (vmesg): Adjust format of error output to GNU standards.
6364         * m4.texinfo: Adjust examples for `make check' to work.
6366         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
6367         case for enum debug_info constants, which were all lower case.
6369         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
6370         re_search_2.
6371         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
6372         collected patches.  I tried a few times using newer regex.[ch], it
6373         mysteriously stopped aborting with this one.  Insecure feeling...
6374         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
6376 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
6378         * m4.c: Change `--no-warnings' to `--silent'.
6379         Reported by David MacKenzie.
6381         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
6382         leave it off for now.  See comment in m4.c for justification.
6383         Reported by David MacKenzie.
6385         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
6386         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
6388         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
6390         * Makefile.in: Ensure recursive cleaning is done before local
6391         cleaning for all clean goals.
6393         * builtin.c (ntoa): Ensure the value is always interpreted as a
6394         signed quantity, whatever the radix is.
6396 1992-11-18  Jim Meyering  <meyering@idefix>
6398         * builtin.c, format.c, input.c: Split long lines.
6399         * m4.c: Use typedef macro_definition instead of struct
6400         macro_definition.
6401         * symtab.c: Use typedef symbol instead of struct symbol.
6403 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
6405         * *.[ch]: Remove all trailing whitespace, in code and comments.
6407         * configure.in: Find some awk.
6408         * Makefile.in: Add $(AWK) to MDEFINES.
6409         * checks/Makefile.in: Transmit $(AWK) to get_them.
6410         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
6411         awk script when switching files, because without this, mawk runs
6412         out of file descriptors.
6414 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
6416         * Makefile.in (realclean): Delete m4.info*.
6417         Reported by Jim Meyering.
6419         * Makefile.in: Adjust and link with checks/Makefile.
6420         * checks/Makefile.in: New.
6421         * configure.in: Output checks/Makefile.
6423         * checks/get_them: Have the dnl header of each test more
6424         recognizable by next-error, also use a better message.
6426 1992-11-16  Jim Meyering  <meyering@idefix>
6428         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
6429         And use that only if __GNUC__ since we're using it's GCC-specific
6430         semantics that tell the compiler the associated function doesn't
6431         return.
6433         * builtin.c (substitute): Don't use character as an array index.
6434         (dumpdef_cmp): Make formal arguments `const void *' to avoid
6435         warnings with gcc -W -Wall on systems with qsort prototype.
6436         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
6437         from gcc -W -Wall.
6439         * eval.c (most functions): Add parentheses to assignments used
6440         as truth values go avoid warnings from gcc -Wall.
6442         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
6443         any functions that don't need external scope.
6445         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
6446         (many functions and arrays): Declare `const'.
6448 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
6450         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
6451         removing the declaration from m4.h.  Also rename false to FALSE
6452         and true to TRUE.
6454         * lib/Makefile.in (Makefile): New goal.
6456         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
6457         so heavily loaded.  It gets more easily overridable, calling make.
6458         Reported by Jim Meyering.
6460         * Makefile.in (dist): Get .fname from the current directory name,
6461         instead of from version.h.  I need updating many files manually,
6462         when the version changes, version.h is just one of them.
6464 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
6466         * m4.h: Remove the tag `boolean' on the enum introducing typedef
6467         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
6468         Reported by Tom McConnell.
6470 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
6472         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
6473         39.cleardiv, which were describing missing or spurious newlines.
6474         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
6475         do not depend on machine word size, `/bin/false' implementation,
6476         or `wc' output format.  `make check' is more dependable, now.
6478         * checks/check_them: Summarize the failed tests by listing their
6479         name, at end.  If none, issue `All checks successful'.  Output
6480         `Checking' instead of `Input file:'.
6482         * checks/get_them, checks/check_them: Reindented.
6484         * Makefile.in (dist): chmod a+r before making the tar file.
6486 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
6488         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
6490         * input.c (next_token): Reinitialize token_buttom just after using
6491         it as a watermark with obstack_free.  Or else, a future token, big
6492         enough for triggering reallocation of the obstack chunk, could
6493         void the initialized value of token_buttom, later causing panic in
6494         obstack_free.  Rename token_buttom to token_bottom everywhere.
6496         * m4.h: Before declaring errno, first include <errno.h> and
6497         ensure that it does not define errno.
6498         Reported by Richard Stallman.
6500 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
6502         * builtin.c: Define and use DECLARE macro for builtins.
6504         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
6505         argument, this is a common idiom for introducing long comments.
6507         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
6508         arguments.  The last argument was silently ignored.
6510         * m4.c (cmd_error): Add a missing semicolon before va_end().
6512 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
6514         * Makefile.in: Now handle protoized sources.  Define and use U.
6515         Compile and use ansi2knr with old compilers.  Update DISTFILES.
6516         Add `aclocal.m4' to `configure' dependencies.
6517         * ansi2knr.c: New, from Ghostscript distribution.
6518         * configure.in: Define U through FP_PROTOTYPES for old compilers.
6519         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
6520         * aclocal.m4: New, provide FP_PROTOTYPES.
6521         * m4.h: Conditionnaly protoized through Args, save for varags.
6522         * builtin.c: Protoized.  Then:
6523         Include <sys/types.h> if size_t is not defined, before "regex.h".
6524         (m4_ifelse): Fetch built-in name properly for diagnostic.
6525         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
6526         (m4_regexp): Add const to `msg' declaration.
6527         (m4_patsubst): Add const to `msg' declaration.
6528         * debug.c: Protoized, save for varargs.
6529         * eval.c: Protoized.
6530         * format.c: Protoized.
6531         * input.c: Protoized.
6532         * m4.c: Protoized, save for varargs.  Then:
6533         (xfree): Accept void * instead of char *.
6534         (xmalloc): Return void * instead of char *.
6535         (xrealloc): Accept and return void * instead of char *.
6536         * macro.c: Protoized.
6537         * output.c: Protoized.
6538         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
6539         * symtab.c: Protoized.
6541 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
6543         * m4.texinfo: Remove directory from diagnostics in 30.include,
6544         51.eval, 56.errprint and 57.m4exit tests.
6546         * m4.h: Remove declarations for int or void system functions, they
6547         cause more conflicting trouble than they make good.
6549         * configure.in: Avoid configuration header file.  Add some tests.
6550         * m4.h: Remove #include "config.h".
6551         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
6552         Then, rewritten for better compliance with GNU standards.
6554 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
6556         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
6557         because of a misplaced #endif.
6559         * Many *.[hc] files: Correct intra-line spacing here and there,
6560         according to GNU indent 1.6 advice.
6562         * configure.in: New, using Autoconf 1.2.
6563         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
6564         * Delete old configure.in, configure, etc/configure.in,
6565         etc/configure, lib/configure.in, lib/configure and config/*.
6566         Reported by Jason Merrill.
6568         * symtab.c (hash): Change (char) NULL to '\0'.
6569         Reported by Jason Merrill.
6571         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
6572         etc/nextvers.sh.  Release numbers will be edited `by hand'.
6573         * version.h: De-automatize, force value in.
6575         * m4.c: Changes in order to use a newer getopt.h.
6576         Reported by David MacKenzie.
6578         * checks/: New name for examples/.
6579         * checks/get_them: New location for etc/get_examples.
6580         * checks/check_them: New location for etc/check_examples.
6581         * Makefile.in, checks/get_them, checks/check_them: Adjust.
6582         * lib/vfprintf.c: New location for etc/vfprintf.c.
6583         * Delete empty etc/.
6584         * examples/: New name for test/.
6586 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
6588         * Makefile.in (check): Add m4 as dependency.
6590         * m4.c: Accept --no-warnings instead of --no_warnings, and
6591         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
6592         usage message more informative.
6593         Reported by David MacKenzie.
6595 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
6597         * etc/check_examples: New name for check_examples.sh.
6598         * etc/get_examples: New name for get_examples.sh.
6599         * Makefile.in, etc/Makefile.in: Use new names.
6601         * Makefile.in: Transmit $(CC) while making in lib.
6603         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
6604         code disposition by hand.
6606 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
6608         * m4.h: Delete definitions for abort() and exit().
6609         Reported by Richard Stallman.
6611         * config/hmake-unicos, config/s-unicos.h: New files.
6612         Reported by Hal Peterson.
6614         * eval.c (exp_term): Have N^0 return 1.
6615         Reported by Michael Fetterman.
6617         * eval.c, input.c, m4.h: Remove last comma in enums.
6618         Reported by Mike Lijewski.
6620         * Transfer of maintenance duties from René to François.
6622 1991-10-24  René Seindal <seindal@diku.dk>
6624         * Release 1.0.  Many thanks to those, who provided me with bug
6625         reports and feedback.
6627         * Uses GNU configure, taken from the gdb distribution.
6629         * Uses GNU getopt(), with long option names.
6631         * The -Q/+quiet option is added, which suppresses warnings about
6632         missing or superflous arguments to built-in macros.
6634         * Added default options via the M4OPTS environment variable.
6636         * The built-in format can now be configured to use sprintf as
6637         the formatting engine, for systems without [efg]cvt(3).
6639         * GNU library code is moved to the ./lib subdirectory; other
6640         utility files are now in ./etc.
6642         * Several minor bugs have been fixed.
6644 1991-07-26  René Seindal <seindal@diku.dk>
6646         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
6647         Francois Pinard and Roland H. Pesch for providing me with reports.
6649         * The builtins incr and decr are now implemented without use of
6650         eval.
6652         * The builtin indir is added, to allow for indirect macro calls
6653         (allows use of "illegal" macro names).
6655         * The debugging and tracing facilities has been enhanced
6656         considerably.  See the manual for details.
6658         * The -tMACRO option is added, marks MACRO for tracing as soon
6659         as it is defined.
6661         * Builtins are traced after renaming iff they were before.
6663         * Named files can now be undiverted.
6665         * The -Nnum option can be used to increase the number of
6666         divertions available.
6668         * Calling changecom without arguments now disables all comment
6669         handling.
6671         * The function m4_patsubst() is now consistently declared
6672         static.
6674         * A bug in dnl is fixed.
6676         * A bug in the multi-character quoting code is fixed.
6678         * Several typos in the manual has been corrected.  More probably
6679         persist.
6681         * The m4.info file is now installed along with the program.
6683 1990-11-15  René Seindal <seindal@diku.dk>
6685         * Updated and enhanced version.  Release 0.75, manual 0.07.
6687         * Implemented search path for include files (-I option and
6688         M4PATH envronment variable).
6690         * Implemented builtin "format" for printf-like formatting.
6692         * Implemented builtin "regexp" for searching for regular
6693         expressions.
6695         * Implemented builtin "patsubst" for substitution with regular
6696         expressions.
6698         * Implemented builtin "esyscmd", which expands to a shell
6699         commands output.
6701         * Implemented "__file__" and "__line__" for use in error
6702         messages.
6704         * Implemented character ranges in "translit".
6706         * Implemented control over debugging output.
6708         * Implemented multi-character quotes.
6710         * Implemented multi-character comment delimiters.
6712         * Changed predefined macro "gnu" to "__gnu__".
6714         * Changed predefined macro "unix" to "__unix__", when the -G
6715         option is not used.  With -G, "unix" is still defined.
6717         * Changed "shift", "$@" and "$*" to not insert spaces afters
6718         commas.
6720         * Added program name to error messages.
6722         * Fixed two missing null bytes bugs.
6724 1990-01-22  René Seindal <seindal@diku.dk>
6726         * Initial beta release.  Release 0.50, manual 0.05.
6729         $Revision$ $Date$