The regs_allocated field in a struct re_pattern_buffer refers
[m4/ericb.git] / ChangeLog
blob2ee5afdf9ffa5100df08b45cf520e1203cfe194a
1 2006-07-05  Gary V. Vaughan  <gary@gnu.org>
3         The regs_allocated field in a struct re_pattern_buffer refers
4         to the state of a particular re_registers struct when used in
5         successive matches using the same compiled pattern.  Avoid a
6         SEGV in `renamesyms' resulting from using a new re_registers
7         with an existing re_pattern_buffer:
9         * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
10         pattern buffer and registers.
11         (m4_regexp_search): New function to call re_regexp_search with
12         correctly matched pattern buffer and register instantiations.
13         (m4_regexp_compile): Return an m4_pattern_buffer.  Adust all
14         callers.
16 2006-07-04  Gary V. Vaughan  <gary@gnu.org>
18         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
19         changes to gnulib getopt.m4 since last build.
20         * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
21         if the system getopt fails M4_GETOPT tests.
23 2006-06-22  Eric Blake  <ebb9@byu.net>
25         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
26         Reported by Bruno Haible.
28 2006-06-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
30         * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
32 2006-06-19  Eric Blake  <ebb9@byu.net>
34         * THANKS: Update.
36 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
38         * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
39         (clean-local): Split into and depend upon...
40         (clean-local-tests, clean-local-src): ...these two.  The latter
41         removes the libtool object directory below `src', to work around
42         a buglet in Automake, failing to list it.
43         (EXTRA_DIST): Distribute modules/perl.c.
45 2006-06-19  Eric Blake  <ebb9@byu.net>
47         * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
48         right side of dependency; VPATH does that.
49         (stamp-vcl): Update to use libtool's algorithm.
50         (EXTRA_DIST): Distribute stamp-vcl.
51         Reported by Ralf Wildenhues.
52         (TESTSUITE): Revert earlier change that used absolute path, as
53         that broke 'make dist' in VPATH.  Stick with $(srcdir) instead.
54         (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
55         (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
56         atlocal takes care of it instead.
57         (check-local, installcheck-local, clean-local): Inline absolute
58         path to testsuite here, rather than relative path to testsuite
59         elsewhere.
61 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
63         * m4/m4private.h (DELETE): Cast away const here...
64         * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
65         * src/freeze.c (reload_frozen_state): Avoid uninitialized
66         variable warning.
68 2006-06-19  Eric Blake  <ebb9@byu.net>
70         * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
71         .info pages are built.
72         Reported by Ralf Wildenhues.
73         (EXTRA_DIST): Inline definition of testsuite, so that make dist
74         works again.
76 2006-06-16  Eric Blake  <ebb9@byu.net>
78         Follow recommendations from autoconf manual for autotest.
79         * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
80         turn it into an absolute path until autotest provides an option
81         that allows us to avoid changing directories.  Properly quote
82         throughout.
83         (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
84         (check-recursive): Delete unused target.
85         ($(TESTSUITE)): Atomically update testsuite.
86         (CD_TESTDIR): Simplify.
87         (m4__cd): Delete unused macro.
88         (check-local): Let TESTSUITEFLAGS influence the run.
89         (installcheck-local): Let TESTSUITEFLAGS override
90         AUTOTEST_PATH.  Add dependencies.
91         (clean-local): Clean up.
92         (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
93         * README: Document how to use the testsuite.
95 2006-06-15  Eric Blake  <ebb9@byu.net>
97         * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
99         * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
100         clashes with m4sugar.
101         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
102         * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
103         * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
104         * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
105         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
106         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
107         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
108         * configure.ac: Likewise.
109         (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
110         * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
111         conditional.
112         * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
114         Reduce compiler warnings.  Inside GMP, mpq_t is an array type, so
115         const mpq_t is not assignable from plain mpq_t.  Avoid
116         type-punning warnings caused trying to mix these types.
117         * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
118         (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
119         * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
120         (mult_term, exp_term): Remove type-punning casts.
121         (numb_pow): Remove const qualifier.
122         * src/freeze.c (reload_frozen_state): Fix typo in messages.
123         Fix variables that can be used uninitialized, which fixes
124         security hole where malicious frozen file can execute arbitrary
125         code.
127 2006-06-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
129         * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
131 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
132             Eric Blake  <ebb9@byu.net>
134         Allow `make dist' to work again.
135         * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
136         (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
137         (cvs-dist): Fix typo.
138         * NEWS: Match current version number.
140 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
142         * Makefile.am (AM_CPPFLAGS):  Add $(LTDLINCL), so the right
143         ltdl.h is used.
145         * bootstrap: Do not run libtoolize manually, this is done
146         correctly by autoreconf.  Invoke autoreconf with --no-recursive
147         to avoid unnecessary rerunning of autotools for libltdl.
149 2006-06-13  Eric Blake  <ebb9@byu.net>
151         * THANKS: Update.
153 2006-06-12  Eric Blake  <ebb9@byu.net>
155         * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
156         bother with mktemp.
157         * src/m4.h: Don't declare mktemp.
158         * m4/input.c (m4__next_token): Avoid bzero.
159         * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
160         * Makefile.am (doc/m4.1): Depend on installed help2man, rather
161         than distributing outdated helptoman.pl.
162         * doc/helptoman.pl: Delete.
164 2006-06-10  Eric Blake  <ebb9@byu.net>
166         * README (Patches): Document the current dependence on CVS
167         builds of autotools.
168         * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
169         * configure.ac: Use consistent quoting throughout.
170         (AC_PREREQ): Bump to 2.59d.
171         (AC_INIT): Package name begins with uppercase.
172         (AC_ARG_WITH): Use AS_HELP_STRING.
173         (AM_INIT_AUTOMAKE): Enable gnits mode.
174         (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
175         (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
176         (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
177         done by gnulib or automake, or which autoconf has declared
178         obsolete.
179         * m4/m4private.h (Includes): Assume C89 or better, and use errno
180         unconditionally.
181         * m4/output.c (Includes): Likewise.
182         * modules/gnu.c (Includes): Likewise.
183         * modules/m4.c (Includes): Likewise.
184         * src/m4.h (Includes): Likewise.
186         * README-alpha: Update web address.
187         * README: Likewise. Change encoding to ASCII.  Remove old advice
188         about cygwin.  Document bootstrapping dependency.
189         * AUTHORS: Update from branch-1_4.
190         * THANKS: Likewise.  Change encoding to UTF-8.
191         * BACKLOG: Delete.  This file is too old and unmaintained to be
192         worthwhile.
193         * ChangeLog: Change encoding to UTF-8.
195         Avoid compiler warnings.
196         * m4/macro.c (trace_format): Don't mark this as a printf format,
197         since we don't accept the same set of modifiers as printf.  It
198         would be nice if gcc let us specify a custom format archetype.
199         * src/main.c (main): Cast away const.
201 2006-06-10  Andreas Schwab  <schwab@suse.de>  (tiny change)
202             Eric Blake  <ebb9@byu.net>
204         * modules/time.c (ctime): Pass correctly typed variable to
205         m4_numeric_arg.
206         (gmtime): Likewise.
207         (localtime): Likewise.
208         (strftime): Likewise.
209         * m4/utility.c (m4_numeric_arg): For now, document arbitrary
210         limit inherent in this interface.
212 2006-05-08  Bruno Haible  <bruno@clisp.org>  (tiny change)
214         * modules/m4.c (WEXITSTATUS): Provide fallback definition.
215         (sysval): Use WEXITSTATUS.
216         * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
217         big-endian and little-endian wait status definitions.
219 2006-05-06  Eric Blake  <ebb9@byu.net>
221         * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
222         subdirectory to use.
223         (support for -pipe): Move after LT_INIT, since it relies on
224         libtool internals.
226 2006-05-05  Eric Blake  <ebb9@byu.net>
228         * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
230         * THANKS: Update.
232 2006-05-05  Bruno Haible  <bruno@clisp.org>
233             Eric Blake  <ebb9@byu.net>
235         * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
236         * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
237         usage pattern.
238         * bootstrap: Update usage of gnulib-tool.
240 2006-05-04  Eric Blake  <ebb9@byu.net>
242         * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
243         Cleanup whitespace.
245 2005-12-05  Gary V. Vaughan  <gary@gnu.org>
247         * bootstrap (func_update_po): Synch with CVS GNU tar.  wget 1.9.x
248         and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
249         Reported by Eric Blake <ebb9@byu.net>
251 2005-12-04  Gary V. Vaughan  <gary@gnu.org>
253         * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
254         http caching as -C is no longer supported by wget 1.10.x.
255         Reported by Eric Blake <ebb9@byu.net>
257 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
259         * m4/module.c (caller_id): To match libtool-2.0 interface, changed
260         to ...
261         (iface_id): ...an lt_dlinterface_id type.
262         (m4__module_find): New abstraction for lt_dlhandle_fetch.  Use
263         throughout, instead of calling obsolete lt_dlhandle_find directly.
264         (m4__module_next): Use multiloader-safe lt_dlhandle_iterate.  Use
265         throughout, instead of calling obsolete lt_dlhandle_next.
266         * m4/m4private.h (m4__module_find): Declare it.
267         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
268         Use m4__module_next instead of obsolete lt_dlhandle_next.
270 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
272         * bootstrap (func_update_po): Update pofiles directly from the
273         translation project.
274         * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
275         po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
276         these files under source control anymore.
277         Suggested by Eric Blake <ebb9@byu.net>
279 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
281         * ltdl/m4/m4-gnulib.m4: Update FSF contact address.  Somehow this
282         file escaped the address updates on 2005-05-01.
284 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
286         * bootstrap: Allow user overriding of gnulib-tool location, and
287         correctly determine module source directories whether gnulib-tool
288         is given as a relative or absolute path, or is found by searching
289         PATH.
290         Reported by Eric Blake <ebb9@byu.net>
292 2005-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
294         * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
295         and $RM are defined for various versions of
296         AC_LIBTOOL_COMPILER_OPTION.
298         * bootstrap (AUTORECONF): New variable to allow user overriding of
299         autoreconf path.
301 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
303         * doc/m4.texinfo (History): Add better notes on the ancestory of
304         GNU m4, and other historical interest.
306 2005-05-08  Gary V. Vaughan  <gary@gnu.org>
308         * m4/symtab.c (m4_symbol_rename): New function that performs a low
309         level symbol rename.
310         * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
311         * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
312         (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
313         regsub...
314         (erenamesyms, renamesyms): ...builtins that use these to implement
315         macro renaming by regular expression.
316         * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
317         * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
318         to stop the new generated tests from choking.
320 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
322         Since most of the build is handled from a single Makefile.am now,
323         we can teach make about the dependencies between the m4 binary and
324         the preopened modules it is built against:
326         * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
327         preopened modules.
328         * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
329         of the preopened modules have changed.
331 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
333         * configure.ac (gl_MODULES): Add mkstemp for machines that don't
334         have a native implementation.
336 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
338         * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed.  These are
339         handled already by gnu/exit.h.
341         * configure.ac (gl_MODULES): Add assert to support a
342         --disable-assert configure time option for NDEBUG setting.
344         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
345         * bootstrap (src_modules): Add version-etc-fsf.
346         * src/main.c (version_etc_copyright): Removed.
348         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
350 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
352         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
353         recognition macros.
354         * src/freeze.c (produce_frozen_state): Use \n line-endings even
355         on Windows, so that the frozen file reader will work.
356         Reported by Josef T. Burger <bolo@bolo.com>
358 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
360         Forward port of a patch that allowed m4-1.4.2 to compile on
361         QNX 6.3:
363         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
364         sys/signal.h.
365         * src/m4.h: And include them as appropriate.
366         * src/main.c, src/stackovf.h: Don't include signal.h literally;
367         m4.h will include the correct file.
369 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
371         * m4/m4private.h: Make errno visible for the sources patched
372         below.
374 2005-05-04  Paul Eggert  <eggert@twinsun.com>
376         * src/main.c (print_program_name_CB): Preserve errno, since
377         M4ERROR relies on this.
378         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
379         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
380         * m4/path.c (m4_path_search): Don't let "free" trash errno when
381         returning NULL.
383         * m4/output.c (m4_insert_file): Don't assume errno has a valid
384         value simply because fread returns zero.  This fixes a
385         portability bug reported by Marion Hakanson in
386         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
388 2005-05-04  Santiago Vila  <sanvila@debian.org>
390         * tests/stackovf.test: Use tempfile if available.
392 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
394         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
395         * m4/output.c (m4_insert_file): Do not mix buffered and
396         unbuffered I/O, as this breaks on the Hurd.
398 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
400         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
401         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
402         and libtoolize does a better job of ltdl importing now too, so
403         take advantage of that while updating the tree:
405         * acm4, config: Moved from here...
406         * ltdl/m4, ltdl/config: ...to here.
407         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
408         src/Makefile.am, tests/Makefile.am: Removed...
409         * Makefile.am: ...and migrated to here, with adjustments to
410         compensate for relative path differences.
411         * commit: Adjust relative paths.
412         * configure.ac: Adjust relative paths.
413         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
414         patch.
415         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
416         the meanwhile, CVS HEAD libtool is needed.
417         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
418         stricly new enough, we also need a patch.
419         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
420         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
421         (gl_MODULES): Don't list getopt and version-etc, as they don't
422         belong in libm4.
423         * bootstrap: After running gnulib-tool to import the listed
424         modules, fetch getopt and version-etc into src manually.
425         (ltdldir): Change to ltdl.
426         * src/main.c: Adjust for changes in version-etc API.
427         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
428         but works when the getopt module isn't to be included in the lib.
429         * README: Add note about patching autoconf and automake to
430         bootstrap CVS m4.
432 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
434         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
435         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
436         empty file rather than to a nonexistent file.  This closes a
437         common security hole.
438         * modules/m4.c (m4_maketemp): Implement the above, by using
439         mkstemp rather than mktemp.
441 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
443         The FSF are moving offices today.  Changed their contact address
444         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
445         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
447 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
449         * tests/Makefile (clean-local): Ignore testsuite cleanup
450         failures.
452 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
454         * tests/Makefile (clean-local): Only run the testsuite cleanup
455         if the testsuite has been generated.
457 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
459         * TODO: slight clarification of the example of qindir usage.
461 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
463         * TODO: Add qindir requirement, and defn bug.
464         From Stepan Kasal  <kasal@ucw.cz>
466 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
468         * TODO: Add ``execution stack'', fix a typo.
469         * doc/m4.texinfo: Typos.
471 2004-12-24  Eric Blake  <ebb9@byu.net>
473         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
474         to the gnu subdirectory.
475         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
476         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
477         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
478         * m4/system_.h: Likewise, in non-configured includes.
480 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
481             Gary V. Vaughan  <gary@gnu.org>
483         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
484         Protect definitions from macro expansion under -DNDEBUG by
485         parenthesising the expanded function names.
486         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
487         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
488         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
489         (m4_is_syntax_macro_escaped): Similarly protect function
490         definitions from macro expansion under -DNDEBUG by #undefing the
491         matching macro names before each definition.  Also, move all the
492         function definitions to the end of the file so that any
493         invocations in the rest of the file pick up the fast macro
494         versions.
495         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
496         (m4_set_debug_file, m4_set_trace_messages)
497         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
498         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
499         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
500         option setter functions.
502 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
504         * src/main.c: Include gnulib files from the correct directory.
506         * gnulib/*: Don't store any of the gnulib files in arch, as they
507         generate spurious changes.
508         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
509         gnulib macros now share our macro directory.
510         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
511         * bootstrap: Call gnulib-tool to import from the gnulib tree.
512         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
513         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
514         the gettext macros from autopoint that overwrite the gnulib-tool
515         imported versions.  Import sources and Makefile.am into the `gnu'
516         directory.  Changed all callers.
517         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
518         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
519         for imported modules.
520         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
521         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
522         hardcoding the gnulib macros they wrap.
524 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
526         Latest CVS libtool can preload modules in libraries, including
527         its own module loaders!  Tweak m4 so that it doesn't try to treat
528         libltdl's module loaders as m4 modules when freezing and on exit:
530         * gnulib/acm4/*.m4: Don't store these files in arch since they
531         generate spurious changes.
532         * bootstrap: Simplify initial libtoolize call, since CVS
533         libtoolize is smarter these days.
534         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
535         build.
536         * m4/module.h (m4__module_exit): Missing declaration.
537         * m4/m4private.h (m4__module_next): New function declaration.
538         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
539         encapsulation.  Changed all callers.
540         (m4__module_interface): New function to verify m4 loadable module
541         interfaces.
542         (m4__module_init): Register the interface validator.
543         (m4__module_exit): Only close my own modules.
544         * modules/m4.c (unistd.h): Provide missing declaration.
545         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
546         (m4_expand_ranges): More missing declarations.
547         * modules/modtest.c (export_test): Ditto.
548         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
549         * src/main.c (main): Bump copyright year.
550         * tests/modules.at: Fix sed syntax error.
553 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
555         Tweaking to enable compilation with latest CVS libtool and
556         libltdl.  We can't just dump the library files directly into the
557         m4 directory anymore now that libltdl is built from pieces itself:
559         * bootstrap: Rewritten to use latest libtoolize sanely, and to
560         set up libltdl subdirectory.
561         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
562         gnulib subdirectory's config.
563         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
564         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
565         macros from gnulib.
566         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
567         configure.ac, so use AC_WITH_LTDL instead.
568         * Makefile.am (SUBDIRS): Add libltdl.
569         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
570         gl_INCLUDED_REGEX.
571         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
572         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
573         (libm4_la_LIBADD): Add LIBLTDL.
574         * m4/ltdl.c, m4/ltdl.h: Removed.
575         * m4/m4module.h: Include canonical ltdl.h.
576         * po/*.po: Updated.
578 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
580         * gnulib/import: Now updates makefile fragments, and configure.ac.
581         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
582         * gnulib/m4/Makefile.am: include it.
583         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
584         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
585         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
586         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
587         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
588         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
589         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
590         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
591         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
592         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
593         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
594         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
595         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
596         import.
597         * gnulib/m4/getopt_int.h: New source file from latest gnulib
598         import.
599         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
600         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
601         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
602         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
603         Updated source files from latest gnulib.
605 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
607         * config/mailnotify: New file for mailing commit notifications,
608         imported from cvs-utils.
609         * commit: Updated from cvs-utils and tweaked for m4.
611 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
613         * config/mkstamp: Updated from CVS libtool.
614         * configure.ac: Generate a gnu coding standards compliant version
615         number, and use it for the banner.
616         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
617         mhen the TIMESTAMP changes in ChangeLog, but the file modification
618         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
619         contain the previous version number.
620         * src/main.c: Make --version output conform to the GNU standard.
622         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
623         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
624         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
625         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
626         time_la_SOURCES): ...so that these are defaulted correctly, and
627         can be removed from this file.
628         (AM_LDFLAGS): Add -module...
629         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
630         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
631         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
632         the individual settings can be removed.
633         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
634         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
635         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
636         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
637         time_la_LIBADD): ...so that these are picked up as a deplib of
638         libm4 and don't need to be set explicitly.
640 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
642         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
643         from the standard build.  It is too fragile.
645         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
646         CVS libtool after merging m4 changes across to libtool.
648         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
649         * m4/path.c (search_path_add): Ditto.
651 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
653         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
654         libtool tags we don't use in configure.  This reduces the size
655         of the script from over 1Mb to under 700Kb.
657 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
659         The import script was not written properly, and the last gnulib
660         import was incomplete.  Fixed that problem, and reimport our
661         gnulib dependencies, which picks up the address calculation
662         overflow checks described by Paul below.  Also tweak the clients
663         of the gnulib xalloc module not to use deprecated macros:
665         * gnulib/import: Recurse through module dependencies rather than
666         naively descending only one level.
667         * configure.ac: Add calls to gnulib's strnlen and extension module
668         macros.
669         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
670         extension modules.
671         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
672         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
673         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
674         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
675         gnulib.
676         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
677         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
678         place of `xcalloc (1, S)'.
679         * m4/m4.c (m4_create): Likewise.
680         * m4/m4private.h (m4_symbol_value_create): Likewise.
681         * m4/symtab.c (symtab_fetch): Likewise.
682         * m4/syntax.c (m4_syntax_create): Likewise.
683         * src/freeze.c (reload_frozen_state): Likewise.
684         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
685         macro.
686         * m4/symtab.c (m4_symtab_create): Likewise.
688 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
690         * tests/module.at: Comment typo.
692 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
694         * tests/modules.at (modules: importing): Apply some lateral
695         thinking, and use AT_CHECK to compare the output of a sed pass
696         over stderr against the canonical strerror string.
698         * tests/modules.at (modules: importing): Edit the generated stderr
699         output to canonicalize strerror output, before a comparison.
701 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
703         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
704         careful not to trip over the mess:
706         * modules/perl.c: Some builds of perl install headers that contain
707         `#define try __builtin_try'.  Be sure to undefine that macro
708         before `m4/hash.h' gets included, which uses the `try' symbol.
709         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
710         `false' before including `stdbool.h'.
711         (DELETE):  This symbol is not in m4's namespace, and is in any
712         case only used internally...
713         * m4/m4private.h (DELETE): ...so move it to here.
714         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
716 2003-10-08  Paul Eggert  <eggert@twinsun.com>
718         Don't use XMALLOC and XCALLOC.  Once we install the
719         corresponding patch into gnulib, this will fix some
720         address-calculation overflow bugs on hosts where calloc (A, B)
721         returns garbage when A*B overflows.
723         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
724         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
725         xmalloc, XCALLOC with xcalloc.
726         * m4/m4.c (m4_create): Likewise.
727         * m4/m4private.h (m4_symbol_value_create): Likewise.
728         * m4/output.c (m4_output_init): Likewise.
729         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
730         * m4/syntax.c (remove_syntax_attribute): Likewise.
731         * src/freeze.c (reload_frozen_state): Likewise.
732         * src/main.c (main): Likewise.
734 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
736         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
737         gnulib/acm4 directories for aclocal m4 macros.
738         * gnulib/Makefile.am (EXTRA_DIST): Removed.
739         (MAINTAINERCLEANFILES): Add Makefile.in.
740         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
741         modules we use.
742         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
743         * gnulib/import: New file.  Temporary script for updating gnulib
744         imported files, until gnulib-tool is working.
745         * gnulib/config/codeset.m4, gnulib/config/error.m4,
746         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
747         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
748         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
749         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
750         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
751         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
752         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
753         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
754         gnulib/config/nls.m4, gnulib/config/obstack.m4,
755         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
756         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
757         gnulib/config/regex.m4, gnulib/config/restrict.m4.
758         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
759         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
760         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
761         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
762         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
763         gnulib/config/xstrndup.m4: Removed.
764         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
765         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
766         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
767         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
768         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
769         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
770         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
771         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
772         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
773         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
774         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
775         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
776         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
777         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
778         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
779         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
780         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
781         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
782         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
783         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
784         gnulib/import script.
785         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
786         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
787         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
788         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
789         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
790         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
791         gnulib with gnulib/import script.
792         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
793         guards ready for gnulib-tool to autoupdate on import.
794         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
795         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
796         config/stackovf.m4: Moved from here...
797         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
798         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
799         acm4/stackovf.m4: ...to here, to separate aclocal macros from
800         configure time helper scripts.
801         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
802         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
803         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
804         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
805         gnulib xalloc.h.
806         * src/main.c (version_etc_copyright): Only output the current
807         year.
808         (version_etc): Call with new variadic API.
810 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
812         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
813         version-etc module from CVS gnulib.
814         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
815         * src/Makefile.am: Build it.
816         * src/main.c: Use it.
818         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
819         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
820         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
821         exit.h instead.
823 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
824             Gary V. Vaughan  <gary@gnu.org>
826         * bootstrap: Separate options.
827         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
828         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
829         not set.
830         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
831         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
832         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
833         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
834         $(LTLIBINTL) for gettext support on cygwin.
835         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
836         have $(LTLIBINTL) from the preloaded module la files.
837         * README: Remove the warning about using --disable-nls on Windows
838         machines.
840 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
842         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
843         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
844         is required.
846 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
848         * doc/STYLE: Document the gnulib header naming conventions, and
849         #include policy.
850         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
851         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
852         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
853         respectively.
854         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
856         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
857         module from CVS gnulib.
858         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
859         (gl_FUNC_STRTOL): In favour of the module macro.
861 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
863         Replace the getopt code with CVS gnulib getopt.  The source files
864         detect whether they are in a glibc environment and preprocess away
865         all of the code if there is a system getopt, so we can compile
866         them into the m4 executable unconditionally:
868         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
869         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
870         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
871         macros.
872         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
873         version.
874         * src/Makefile.am: Adjust.
875         * src/main.c: Always include our shipped getopt.h.
876         * po/POTFILES.in: Use new location of getopt.c.
878 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
880         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
881         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
882         in this directory automatically.
883         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
885         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
886         isn't set yet.
887         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
888         inline.
889         * modules/Makefile.am (pkglibexecdir): Set it here.
890         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
892         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
893         Import regex module from CVS gnulib.
894         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
895         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
896         do extra substitutions for Makefile.
897         * configure.ac: Use it.
898         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
899         from regex_.h if necessary.
900         * m4/system_.h: Include the correct version of regex.h.
901         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
902         version.
903         * po/POTFILES.in: Use new location of regex.c.
905         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
906         realloc.c: automake distributes these files already.
908 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
910         Replace the xstrzdup code by importing the xstrndup module from
911         CVS gnulib, along with its dependencies: strndup and strnlen:
913         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
914         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
915         gnulib.
916         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
917         gnulib/config/strndup.m4: Ditto wrt strndup.
918         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
919         strnlen.
920         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
921         However, contrary to gnulib, we install xstrndup.h.
922         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
923         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
924         is an artifact of the old m4 portability layer.
925         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
926         * m4/system_.h: Include xstrndup.h.
927         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
929 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
931         Reimport the latest xalloc module from CVS gnulib, and adjust the
932         m4 sources to take advantage of xalloc xfree.  Also create a new
933         macro DELETE with the same semantics as the old m4 XFREE macro,
934         and carefully tweak callers:
936         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
937         gnulib.
938         * m4/utility.c (xfree): Removed.  This function is now supplied by
939         gnulib xalloc.
940         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
941         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
942         * m4/symtab.c (m4_symtab_create): Ditto.
943         * m4/system_.h: Removed XFREE redefine.
944         (DELETE): New macro with same functionality as the original m4
945         XFREE macro, but based on xalloc.h now.  Changed all callers.
946         * src/main.c (main): Use XMALLOC macro.
947         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
948         instead of XFREE.
949         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
951 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
953         Import the xalloc module from CVS gnulib, along with its
954         dependencies: exitfail, malloc and realloc. We had different
955         semantics for our XFREE and a function xfree() not supplied by
956         gnulib, so also a bit of work to keep everything running
957         smoothly:
959         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
960         (gl_XALLOC): Use gnulib equivalents.
961         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
962         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
963         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
964         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
965         realloc.
966         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
967         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
968         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
969         imported modules.
970         (pkgincdir): Removed.  Use pkgincludedir instead.
971         * m4/m4private.h (XFREE): xfree already checks for NULL.
972         * m4/system_.h: Use xalloc module, and remove macros already
973         supplied by xalloc.h.
974         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
975         moved the old definition from m4/xmalloc.c to here for now.
977 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
979         Import the error and progname modules from CVS gnulib.  Our old
980         error.c subsumed the functionality of both, so a little adjustment
981         was required to accomodate the split in sources.  Also added more
982         wrapper macros to choose between a system installed error.h or our
983         shipped gnulib error module:
985         * m4/error.c, m4/error.h: Removed.
986         * m4/Makefile.am: Adjust.
987         (pkgincdir): Removed.  Use pkgincludedir instead.
988         * m4/module.h, src/main.c: Don't include `m4/error.h'.
989         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
990         error.h.
991         * gnulib/m4/progname.c: Imported from CVS gnulib.
992         * gnulib/m4/progname.h: Ditto.
993         * src/main.c: Adjust to use progname module.
994         * gnulib/m4/error.c: Imported from CVS gnulib.
995         * gnulib/m4/error_.h: Ditto.
996         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
997         if appropriate, and link a local error.h if the system version is
998         missing.
999         (libgnu_la_SOURCES) Add progname module sources.
1000         * gnulib/config/error.m4: Imported from CVS gnulib.
1001         * gnulib/config/strerror_r.m4: Ditto.
1002         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
1003         to have ERROR_H for Makefile substitutions and tell system.h
1004         whether the system error.h should be used, or a locally installed
1005         version.
1006         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
1008 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
1010         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
1011         s/gettext_.h/gettext.h/.
1013         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
1014         automake have been fixed.
1016         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
1017         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
1018         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
1019         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
1021 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
1023         The gnulib obstack module requires the gnulib gettext module for
1024         systems that do not have GNU gettext installed.  Because we use
1025         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
1026         that directory incase it clashes with the system gettext.h.  This
1027         delta uses gettext_.h and extra rules in the Makefile to make a
1028         link to gettext.h when needed:
1030         * Makefile.am (auxdir): Removed.  No longer used.
1031         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
1032         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
1033         moved.
1034         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
1035         Makefile based build.
1036         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
1037         of the macros are kept.
1038         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
1039         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
1040         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
1041         distributes these automatically.
1042         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
1043         warning from automake-1.7a.
1044         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
1045         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
1046         all callers.
1047         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
1048         wrt. m4_FUNC_OBSTACK.
1049         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
1050         wrt. m4_sys_STACKOVF.
1051         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
1052         wrt. _m4_LIB_GMP, m4_LIB_GMP.
1053         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
1054         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
1055         respectively.
1056         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
1057         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
1058         gettext.h link on deficient systems.
1059         (pkginc_HEADERS): Mention $(GETTEXT_H).
1060         (EXTRA_HEADERS): Mention gettext.h.
1061         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
1062         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
1063         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
1064         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
1065         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
1066         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
1067         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
1068         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
1069         gnulib/config/po.m4, gnulib/config/progtest.m4,
1070         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
1071         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
1073 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
1075         We can't mirror the gnulib directory structure here, since we need
1076         to be able to eg. `#include <m4/obstack.h>' from our source files,
1077         which is much easier if the local obstack.h is created in a
1078         directory named m4.  Rather than trying to symlink everything into
1079         the m4 directory, now we build a libtool convenience library from
1080         the sources we get from gnulib and link that with libm4.la:
1082         * gnulib/config/extensions.m4: Imported from CVS gnulib.
1083         * gnulib/config/unlocked-io.m4: Ditto.
1084         * gnulib/m4/unlocked-io.h: Ditto.
1085         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
1086         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
1087         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
1088         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
1089         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
1090         * m4/Makefile.am: Adjust.
1091         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
1092         macros we redistribute.
1093         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
1094         library among others.
1095         (GNULIB_SRCS, GNULIB_MACROS): Removed.
1096         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
1097         * config/m4-obstack.m4: Adjust.
1098         * po/POTFILES.in: Adjust.
1099         * configure.ac: Reformatting.  Call newly imported gnulib macros.
1100         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
1101         bogus calls of `#include "m4.h"'.
1102         * Makefile.am: INCLUDES has been deprecated in favour of
1103         AM_CPPFLAGS.
1104         * m4/Makefile.am: Ditto.
1105         * modules/Makefile.am: Ditto.
1106         * src/Makefile.am: Ditto.
1108 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
1110         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
1112 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
1114         Migrate the obstack support into the gnulib directories for easy
1115         synchronisation with upstream files in gnulib:
1117         * config/gnu-obstack.m4: Moved from here...
1118         * config/m4-obstack.m4: ...to here.
1119         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
1120         * m4/obstack.c, m4/obstack_.h: Moved from here...
1121         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
1122         * po/POTFILES.in: Adjust.
1123         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
1124         * m4/Makefile.am: Add a whole new section to link the obstack
1125         sources from the gnulib tree if necessary.
1126         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
1127         from gnulib.
1128         * config/m4-obstack.m4: Rewrite as a wrapper for
1129         gnulib/m4/obstack.m4.
1131 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
1133         GNU M4 currently builds with a number of files adapted from
1134         upstream sources.  Recently the gnulib project on savannah.gnu.org
1135         has pulled together a great many of these externally maintained
1136         files.  This delta is the beginnings of isolating those files
1137         maintained in gnulib to make it easy to synchronise M4 with the
1138         upstream files prior to releases.
1140         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
1141         directory.
1142         (SUBDIRS): Added new gnulib subdirectory.
1143         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
1144         * config/stdbool.m4: Moved from here...
1145         * gnulib/m4/stdbool.m4: ...to here.
1146         * m4/stdbool_.h: Moved from here...
1147         * gnulib/lib/stdbool_.h: ...to here.
1148         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
1149         distributed.
1150         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
1151         code to work with new stdbool_.h location.
1152         (gnulib_srcdir): New.
1154 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
1156         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
1157         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
1158         builds to work.
1159         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
1160         (EXTRA_DIST): Use it.
1162         * bootstrap: CVS autoreconf leaves file droppings.  Remove
1163         aclocal.m4t incase autoreconf doesn't.
1165 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
1167         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
1168         the other gnulib imports, renamed to m4/obstack_.h.
1169         * m4/obstack.c: Updated from CVS gnulib.
1170         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
1171         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
1172         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
1173         about vpath already, and $top_srcdir upsets CVS Automake, so the
1174         $top_srcdir reference was removed.
1176         * m4/system-h.in: For consistency with the gnulib imports, renamed
1177         to m4/system_.h.
1178         * m4/Makefile (EXTRA_HEADERS): Adjust.
1179         * configure.ac (AC_CONFIG_FILES): Adjust.
1181         * m4/stdbool_.h: New file from gnulib for systems without their
1182         own.
1183         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
1184         * config/stdbool.m4: New file.  Macros from gnulib for same.
1185         * configure.ac: Use it.
1187 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
1189         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
1190         * config/gmp.m4: Ditto.
1191         * config/gnu-obstack.m4: Ditto.
1192         * config/stackovf.m4: Ditto.
1193         * m4/builtin.c: Ditto.
1194         * m4/debug.c: Ditto.
1195         * m4/error.c: Ditto.
1196         * m4/error.h: Ditto.
1197         * m4/gnu-obstack.h: Ditto.
1198         * m4/hash.c: Ditto.
1199         * m4/hash.h: Ditto.
1200         * m4/input.c: Ditto.
1201         * m4/m4.c: Ditto.
1202         * m4/m4module.h: Ditto.
1203         * m4/m4private.h: Ditto.
1204         * m4/macro.c: Ditto.
1205         * m4/module.c: Ditto.
1206         * m4/obstack.c: Ditto.
1207         * m4/output.c: Ditto.
1208         * m4/path.c: Ditto.
1209         * m4/regex.c: Ditto.
1210         * m4/regex.h: Ditto.
1211         * m4/strtol.c: Ditto.
1212         * m4/symtab.c: Ditto.
1213         * m4/syntax.c: Ditto.
1214         * m4/utility.c: Ditto.
1215         * m4/xmalloc.c: Ditto.
1216         * m4/xstrdup.c: Ditto.
1217         * m4/xstrzdup.c: Ditto.
1218         * modules/evalparse.c: Ditto.
1219         * modules/format.c: Ditto.
1220         * modules/gnu.c: Ditto.
1221         * modules/import.c: Ditto.
1222         * modules/load.c: Ditto.
1223         * modules/m4.c: Ditto.
1224         * modules/m4.h: Ditto.
1225         * modules/modtest.c: Ditto.
1226         * modules/mpeval.c: Ditto.
1227         * modules/perl.c: Ditto.
1228         * modules/shadow.c: Ditto.
1229         * modules/stdlib.c: Ditto.
1230         * modules/time.c: Ditto.
1231         * modules/traditional.c: Ditto.
1232         * src/freeze.c: Ditto.
1233         * src/getopt.c: Ditto.
1234         * src/getopt1.c: Ditto.
1235         * src/m4.h: Ditto.
1236         * src/main.c: Ditto.
1237         * src/stackovf.c: Ditto.
1239         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
1240         ac_default_headers is an autoconf internal variable.
1241         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
1242         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
1244         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
1245         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
1246         delta.
1248 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
1250         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
1251         C99 bool.
1252         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
1253         possible or faking one with a typedef.  Changed all callers.
1255 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
1257         Still cleaning up the users' module API, by taking out the stuff
1258         that isn't used by any existing modules, and moving specialised
1259         functions out of libm4 and into the module they are used by.
1261         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
1262         * m4/utility.c (m4_skip_space): ...to here the home of its only
1263         use, made static and renamed to `skip_space'.  Changed all
1264         callers.
1265         * m4/m4module.h (m4_expand_ranges): Removed prototype.
1266         * m4/utility.c (m4_expand_ranges): Moved definition from here...
1267         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
1268         ltdl.
1269         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
1270         casting .
1271         * modules/gnu.c (builtin_syntax): Import and use in this
1272         builtin implementation.
1273         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
1274         Not used.  Deleted.
1275         * m4/macro.c (trace_flush): Except here where the macro is now
1276         manually inlined.
1277         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
1278         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
1279         moved...
1280         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
1281         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
1283 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
1285         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
1286         compiler based AC_CHECK_HEADER that was introduced in
1287         autoconf-2.56.
1288         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
1289         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
1290         * configure.ac: Use renamed M4_AC_LIB_GMP.
1292         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
1293         macro that requires arguments! This stops the shell's bad
1294         substitution error at configure time.
1296         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
1297         variables to the testsuite shell.  Set the value of USE_GMP so
1298         that the gmp test will run!
1299         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
1301 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
1303         Libltdl already has an excellent mechanism for accessing C symbols
1304         in modules.  Lets use that!  Remove all the exporting cruft and
1305         just use lt_dlsym in conjunction with a few conventions to
1306         simplify module writers' jobs.  Also removed the table address
1307         caching code and otherwise simplified the module loader quite a
1308         bit.  To access exported symbols in other modules, first the
1309         exporting module must name the symbols <modname>_LTX_<symname>,
1310         and the importing module must define a function type called
1311         <symname>_func.  The importer then adds
1312         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
1313         that wishes to call out to the exported functions.  Care must be
1314         taken that <symname> is non-NULL in the importing module incase
1315         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
1316         definition was in the importers source.  Study
1317         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
1318         m4_module_import will attempt to automatically load a module
1319         required for symbol access if it is not loaded already.
1321         * TODO: Removed the items fixed in this delta.
1322         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
1323         module name.
1324         * m4/ltdl.h (lt_dlhandle_find): Declare it.
1325         * m4/module.c (m4_module_unload): Use it.
1326         * src/freeze.c (reload_frozen_state): Ditto.
1327         * m4/m4module.h (m4_export): Deleted.  Removed all references.
1328         (M4_MODULE_IMPORT): New user convenience macro for importing
1329         arbitrary symbols from other modules.
1330         * m4/module.c (m4_module_import): New function to service
1331         M4_MODULE_IMPORT macro.
1332         (module_data): Removed.  Looking up the tables on demand with
1333         lt_dlsym, rather than caching their addresses here simplifies the
1334         code substantially.
1335         (m4_get_module_builtin_table, m4_get_module_macro_table):
1336         Removed.  Changed all callers.
1337         (set_module_macro_table, set_module_builtin_table): Renamed to
1338         install_macro_table and install_builtin_table respectively, and
1339         simplified now that the cache is no more.
1340         * modules/gnu.c (builtin_symbols): Use this new mechanism to
1341         import m4_dump_symbols from the m4 module.
1342         (builtin_esyscmd): Likewise for m4_set_sysval and
1343         m4_sysval_flush.
1344         * modules/m4.c (m4_export_table): Removed.  Functions are
1345         addressed with the new mechanism which doesn't need this.
1346         (m4_set_sysval): New exported accessor function to prevent
1347         problems with variable access on inferior architectures.
1348         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
1349         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
1350         that we can have some type safety.
1351         * modules/modtest.c (export_test): C level exported function for
1352         testing the new import mechanism.
1353         * modules/import.c: New file for the import end of the test.
1354         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
1355         * tests/modules.at: New test cases for intermodule symbol
1356         importing.
1358 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
1360         * m4/m4module.c (m4_string): Moved from here...
1361         * m4/m4private.c (m4_string): ...to here.
1363         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
1365 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
1367         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
1368         already available to module writers through
1369         m4_{get,set}_nesting_limit_opt(), so moved from here...
1370         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
1371         (m4_create): Use it.
1373 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
1375         Aside from auditing path.c for m4module.h api obfuscation, this
1376         delta introduces the concept of private struct members in opaque
1377         data types to GNU m4: See the STYLE file for details.
1379         * TODO: Remind ourselves that a rewrite of path.c is needed.
1380         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
1381         Moved from here...
1382         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
1383         here and renamed.  These type definitions are for internal api use
1384         only.  Changed all callers.
1385         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
1386         Moved from here...
1387         * m4/path.c (search_path_env_init, search_path_add): ...to here
1388         and renamed.  These calls were never used outside this file.
1389         Changed all callers.
1390         (dirpath): Moved functionality of this static declaration...
1391         * m4/m4private.h (struct m4): ...to this new internal only
1392         search_path field.  Changed all callers.
1393         (m4__get_search_path): Added new internal api accessor.
1394         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
1395         (m4_include_init): Removed...
1396         * m4/m4.c (m4_create): ...because the new m4 field is now
1397         initialised here.
1398         (m4_delete): Recycle search_path memory.
1399         * src/main.c (main): Don't call m4_include_init now that it's
1400         gone!
1401         * doc/STYLE: Document convention for private fields in opaque
1402         ADTs.
1404 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
1406         Sometimes exporting the address of a symbol from a module isn't
1407         enough for other modules to call that symbol correctly.  If
1408         custom data types are used for function parameters, they need to
1409         be known to the caller.  This change introduces the concept of
1410         $(prefix)/include/modules/$(modulename).h to declare those
1411         structures.  Also we move m4_dump_symbols from libm4 to the m4
1412         module to show this concept in action.
1414         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
1415         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
1416         exporting data structures from modules/m4.c.
1417         * modules/m4.c, modules/gnu.c: Include it.
1418         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
1419         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
1420         prototypes.
1421         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
1422         Moved from here...
1423         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
1424         ...to here, with slight renaming.
1425         (m4_export_table): Prototype and add m4_dump_symbols.
1426         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
1427         definition of m4_dump_symbols.
1428         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
1429         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
1431 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
1433         Create an export table in modules/m4.c in readiness for beefing up
1434         the module loader to track module exports and imports.
1436         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
1437         * m4/debug.c (m4_debug_flush_files): Moved...
1438         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
1439         * modules/gnu.c (builtin_esysval): Use it.
1440         * m4/m4module.h (m4_export): New type for declaring module symbols
1441         for export.
1442         * modules/m4.c (m4_export_table): List symbols exported from this
1443         module for use by other modules.
1445 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
1447         An experiment: There is loads of code in libm4 which should be in
1448         the m4 module, but is also used by another module. Just because
1449         some linkers won't cope with calls across dynamic runtime loaded
1450         objects I initially left the code in libm4.  It will tidy the
1451         module api immensely if this code moves to the right place, I just
1452         need to remember to invent a suitable calling mechanism at some
1453         point.  For now, only modules that are statically linked and
1454         preloaded will get this treatment, so the only platforms that will
1455         break are those that require all symbols to be resolved at link
1456         time.
1458         * TODO: Reminder that what I am doing could reduce portability
1459         unless I do something more robust later.
1460         * m4/m4module.h (m4_sysval): No longer exported from libm4.
1461         * m4/utility.c (m4_sysval): No longer declared in libm4.
1462         * modules/Makefile.am: Reformatting.
1463         * modules/m4.c (m4_sysval): Declare it at place of use.
1464         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
1466 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
1468         * m4/m4module.h: Reformatting and rearranging lines a bit.
1469         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
1470         all users.
1471         (m4_call_macro, m4_expand_input): Renamed...
1472         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
1473         callers.
1474         (m4_expansion_level, m4_process_macro): Moved...
1475         * m4/macro.c (expansion_level, process_macro): ...to here, and
1476         made static.
1478         * m4/m4module.h (program_name): Not used by modules at all, so
1479         moved...
1480         * src/main.c (program_name): ...to here.
1481         (print_program_name): Renamed...
1482         (print_program_name_CB): ...to conform to the STYLE guide.
1484 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
1486         More refactoring of the m4module.h API.  Replace #defines with an
1487         enum, and move non-public functions out of the public API.
1489         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
1490         inclusion.
1491         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
1492         * m4/debug.c (m4_debug, trace): Moved...
1493         * m4/m4private.h (struct m4): ...to fields of this struct.
1494         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
1495         for the new fields.
1496         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
1497         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
1498         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
1499         * m4/m4module.h (m4_context_field_table): Add entries for new
1500         debug_file and trace_messages fields.
1501         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
1502         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
1503         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
1504         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
1505         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
1506         (m4_is_debug_bit): New macro to simplfy checks against the debug
1507         bits above.
1508         (m4_trace_format, m4_trace_header, m4_trace_flush)
1509         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
1510         prototypes.
1511         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
1512         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
1513         * m4/macro.c (trace_format, trace_header, trace_flush)
1514         (trace_prepre, trace_pre, trace_post): ...to these newly static
1515         functions, since they are only ever used from this file.  Changed
1516         all callers.
1518 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
1520         Change the macros for checking syntax so that matching against
1521         multiple possible syntax classes can be done with a single
1522         comparison some of the time.  The various classes are now bits of
1523         an int that can be checked with bitwise logic operators.
1525         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
1526         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
1527         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
1528         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
1529         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
1530         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
1531         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
1532         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
1533         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
1534         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
1535         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
1536         Replace all calls with invocations of these...
1537         (m4_is_syntax, m4_has_syntax): ...New macros.
1538         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
1539         is no longer required with new macros.  Changed all callers.
1541 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
1543         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
1544         values are returned as part of the internal interface, so they
1545         need to be moved...
1546         * m4/private.h: ...to here.
1547         * m4/macro.c (expand_token): Check for out of range
1548         m4_peek_input() results before looking up in the syntax table.
1549         (collect_arguments): Ditto.
1551         * NEWS: Note `$' syntax class.
1553 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
1554             Gary V. Vaughan  <gary@gnu.org>
1556         Conform to POSIX if the POSIXLY_CORRECT environment is set.
1557         --traditional `define' now smashes all the definitions.
1559         * NEWS: Explain this.
1560         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
1561         (Extensions): Explain that extensions that are incompatible with
1562         POSIX are disabled if POSIXLY_CORRECT is set.
1563         (Incompatibilities): Remove.
1564         (Define, Other Incompat): Explain difference
1565         between GNU and POSIX behavior of define, pushdef, popdef.
1566         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
1567         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
1568         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
1569         (m4_get_posixly_correct_opt): New macro.
1570         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
1571         POSIXLY_CORRECT.
1572         * modules/m4.c (builtin_functions): defn now takes any number of args.
1573         (builtin_define): Smash all the definitions if
1574         POSIXLY_CORRECT.
1575         (builtin_defn)): Allow any number of arguments.
1576         (builtin_undivert): Do not allow nonnumeric arguments
1577         if POSIXLY_CORRECT.
1578         * src/main.c (main): Set posixly-correct behavior if either
1579         POSIXLY_CORRECT is set, or if -G is given.
1580         * tests/builtins.at: New test for smashed definitions.
1582 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
1584         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
1585         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
1586         not to slow the parser down.
1587         (M4__IS_STRING): New macro to test string syntax class membership.
1588         * m4/syntax.c: Adjust docucomment.
1589         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
1590         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
1591         * m4/input.c (init_builtin_token): Comment typo.
1592         (m4__next_token): Comment typo.
1593         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
1594         by using the new M4__IS_STRING macro.
1595         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
1596         variable references in macro expansions.
1598         * doc/m4.texinfo (Eregexp and Regexp): Typo.
1599         (Epatsubst and Patsubst): Typo.
1600         (Eval): Typo.
1602 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
1604         Move the global variables that pertain to syntax to a new `struct
1605         m4_syntax_table', and then add one of these to `struct m4'.  The
1606         ripple effect through the code to both change formerly global
1607         references, and make sure a suitable context is available in
1608         lexical scope is disproportionately large compared to the size of
1609         the change proper.  This change is a large part of decoupling
1610         syntax.c from the rest of the code that uses it.
1612         * m4/m4private.h (struct m4): Add a syntax field.
1613         * m4/m4.c (m4_create): Initialise it,
1614         (m4_delete): Recycle it.
1615         (m4_get_symtab): Remove hand coded version...
1616         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
1617         callers.
1618         * m4/m4module.h (m4_context_field_table): Add an extra field so we
1619         can generate m4_get_symbol_table.  Add a new row for
1620         m4_get_syntax_table.
1621         (M4SYNTAX): Syntactic sugar for module writers.
1622         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
1623         (m4_syntax_table): New home for syntax related formerly global
1624         variables.
1625         * m4/m4private.h (struct m4_syntax_table): Define it.
1626         * m4/input.c (m4_input_init): Initialisation of these formerly
1627         global variables moved...
1628         * m4/syntax.c (m4_syntax_create): ...to here.
1629         * m4/input.c (m4_input_exit): And similarly, recycling of the
1630         memory used by those values moved...
1631         * m4/syntax.c (m4_syntax_delete): ...to here.
1632         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
1633         Moved to m4/m4private.h.
1634         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
1635         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1636         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
1637         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
1638         objects.  Changed all callers that used to directly access the
1639         global equivalents.
1640         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
1641         Removed and incorporated into m4_syntax_table structure.
1642         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
1643         * m4/syntax.c (m4_set_syntax): Now returns an error status,
1644         instead of requiring a `struct m4' to generate its own errors.
1645         Changed all callers.
1646         * src/main.c (main): Now that the syntax table is initialised as
1647         part of m4_create, we have to manually wipe the syntax entries if
1648         we are about to read a frozen file.
1650 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
1652         * doc/STYLE: Added notes on callback naming schemes.
1654         * m4/module.c (m4_set_module_macro_table)
1655         (m4_set_module_builtin_table): Declarations weren't changed when
1656         definitions were renamed on 2003-06-19.
1658         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
1659         neither used nor particularly appropriate since it exposes the
1660         internal workings of the hash module.  I haven't yet decided
1661         whether to remove it entirely.
1663 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
1665         Two related changes, and a huge knockon effect throughout the
1666         source: Moved the option variables out of global space and into
1667         `struct m4'; made `m4_symtab' a real datatype, so that its api
1668         is not marred passing `struct m4' around just so it can decide
1669         whether to keep traced symbol names or not.  Added setters and
1670         getters for the formerly global option variables, and obviously
1671         changed a vast number of functions to take a `struct m4' and use
1672         the getter funcs to find option values.
1674         * m4/utility.c (interactive, sync_output, debug_level)
1675         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
1676         (max_debug_argument_length, warning_status, nesting_limit)
1677         (discard_comments): Removed.
1678         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
1679         (debug_level, max_debug_argument_length, prefix_all_builtins)
1680         (suppress_warnings, discard_comments, interactive, sync_output):
1681         Removed from here...
1682         * m4/m4private.h (struct m4): ...and equivalent fields added to
1683         this structure.
1684         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1685         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1686         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1687         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1688         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
1689         macros for the new fields.
1690         * m4/m4module.h (m4_context_field_table)
1691         (m4_context_opt_bit_table): Helper macros used to generate
1692         prototypes, setters and getters for new option fields
1693         consistently.
1694         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
1695         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
1696         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
1697         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
1698         (m4_get_interactive_opt, m4_get_sync_output_opt)
1699         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
1700         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
1701         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
1702         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
1703         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
1704         setter and getter functions generated by cpp from
1705         m4_context_field_table and m4_context_opt_bit_table, exported as
1706         part of the module api.  Changed all callers.
1707         * m4/symtab (struct m4_symtab): Used as the concrete type for
1708         m4_symtab now.
1709         (m4_symtab_create): Allocate and initialise a new struct.
1710         (m4_symtab_apply): New function that works like m4_hash_apply, but
1711         with different callbacks specific to symbol tables.  Changed all
1712         callers.
1713         (symbol_destroy, arg_destroy, arg_copy): Renamed
1714         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
1715         they have unused parameters for a reason!
1716         (dump_symbol_CB): New callback to dump the contents of a single
1717         symbol.
1718         (symtob_dump): Rewritten in terms of dump_symbol_CB.
1719         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
1720         Changed all callers.
1721         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
1722         of the contained `m4_symtab' at the `no_gnu_extensions' field.
1723         Although I'm not convinced these semantics are correct, they are
1724         at least consistent with how things were before this delta.  Also
1725         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
1727 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
1729         Tie down the interface to libm4 some more.  Make more structures
1730         opaque to modules by moving them to m4private.h, and writing
1731         setters and getters.  To win back the speed penalty for doing this
1732         also wrote macroized versions that do know about structure layout
1733         in m4private.h and #include that file into modules when NDEBUG is
1734         defined at compile time.  There are still some accessor macros in
1735         m4private.h that need to go, but that is not necessary to clean
1736         the module api up.
1738         * m4/m4module.h (m4_symbol_type): Moved...
1739         * m4/m4private.h (m4__symbol_type): ...to here.
1740         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
1741         (m4_set_symbol_traced, m4_set_symbol_name_traced)
1742         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1743         (m4_get_symbol_func, m4_symbol_value_create)
1744         (m4_symbol_value_delete, m4_set_symbol_value_text)
1745         (m4_set_symbol_value_func): New exported api to symbols.
1746         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
1747         and m4_is_symbol_value_func.
1748         * m4/m4module.h: Prototype these guys.
1749         * m4/module.c (m4_set_module_macro_table)
1750         (m4_set_module_builtin_table): Make these static, there is no
1751         reason to pollute the api with them.
1752         * m4/m4private.h: Reformatting.
1753         (m4_get_symtab): Only define when NDEBUG is defined.
1754         (m4_get_symbol_value, m4_get_symbol_traced)
1755         (m4_set_symbol_traced, m4_set_symbol_name_traced)
1756         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
1757         (m4_get_symbol_func, m4_symbol_value_create)
1758         (m4_symbol_value_delete, m4_set_symbol_value_text)
1759         (m4_set_symbol_value_func): Macro implementations of the new
1760         functions when NDEBUG is defined.
1761         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
1762         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
1763         Superceded by the above.  All callers changed.
1764         (M4ARG): Removed.  This is no longer different to the
1765         m4/m4module.h definition.
1766         * modules/gnu.c, modules/m4.c: Only include m4private.h when
1767         NDEBUG is defined.  That way we exercise the same (albeit slower)
1768         api that external modules must use.
1770 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
1772         Renamed some of the types and their accessors to make more sense.
1773         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
1774         has a stack of SYMBOL_VALUEs.
1776         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
1777         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
1778         m4_get_symbol_value_type,  m4_get_symbol_value_text,
1779         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
1780         Changed all callers.
1781         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
1782         (m4_get_token_type): Renamed
1783         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
1784         to the internal api.
1785         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
1786         s/TOKEN_/VALUE_/
1787         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
1788         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
1789         (m4__token_type): Moved here from m4module.h.
1790         (m4__next_token): Renamed from m4_next_token.
1791         * m4/symtab.c: Removed some of the parameterised macro support
1792         functions for modularisation later.
1793         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
1794         m4_hash_dup to perform a true deep copy of the SRC.
1795         (arg_copy): Callback for m4_symbol_value_copy.
1796         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
1797         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
1798         m4_get_symbol_value_func.  Changed all callers.
1800 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
1802         Tidy up style of hash.[ch] in accordance with doc/STYLE.
1804         * m4/hash.c: Internal symbol renaming and formatting.
1805         (m4_hash_dup): New function to facilitate deep copies of hash
1806         tables.
1807         (m4_hash_apply_func): Returns a void* now, which is a richer type
1808         for returning exceptions (NULL means keep going).
1809         (m4_hash_apply): Ditto.
1810         * m4/hash.h: Declare exported symbols with an explicit extern.
1811         Reformated.
1813 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
1815         Still refactoring furiously.  This delta represents a change in
1816         semantics to symtab.c.  Instead of building temporary m4_tokens
1817         in the caller, and copying fields in the methods, we now create
1818         the actual m4_token for hashing in the caller so the methods just
1819         slot them in directly.  Also, this means that we don't lookup a
1820         symbol and get back an allocated but VOID token to copy fields
1821         into, we create the token we want to push and pass that to
1822         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
1823         a few other small changes to stop knowledge of the implementation
1824         of symtab.c leaking out into other files.
1826         * m4/macro.c (expand_argument): Comment typo corrected.
1827         * m4/symtab.c (symtab_fetch): New function to fetch the address of
1828         an interned symbol.
1829         (m4_symbol_pushdef): Take an extra value parameter and use this
1830         directly as the new top of the value stack.  All callers changed
1831         to build a token and pass responsibility for memory in, rather
1832         than copying as we used to.
1833         (m4_symbol_define): Also use the new value parameter directly as a
1834         replacement for the top of the value stack.  All callers changed
1835         to build a token as above.
1836         (m4_set_symbol_traced): New function to set the traced bit on the
1837         named symbol, creating it if necessary.
1838         (symbol_popval): The guts of the old m4_symbol_popdef.
1839         (m4_symbol_popdef): Use it.
1840         * m4/builtin.c (m4_symbol_set_token): Removed,
1841         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
1842         replaced...
1843         * m4/module.c (m4_set_module_builtin_table)
1844         (m4_set_module_macro_table): ...with these more orthogonal
1845         functions.
1846         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
1847         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
1848         required.
1849         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
1850         (m4_arg_signature_parse): Moved...
1851         * m4/symtab.c: ...to here.
1852         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
1853         screw something up. Moved...
1854         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
1855         actually does a proper deep copy of source to dest.
1857 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
1859         Further refactoring to stabilise the module API.  Renaming some
1860         functions for orthogonality, and judicious definition migration to
1861         move things out of the set of exported symbols.
1863         * doc/STYLE: New file.  Notes on coding style.
1864         * m4/m4module.c: Updated bitrotted docucomment at the top of the
1865         file.
1866         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
1867         m4_get_module_name, m4_get_module_builtin_table,
1868         m4_get_module_macro_table which are verb phrases.  Changed all
1869         callers.
1870         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
1871         Moved to...
1872         * m4/module.c (m4_set_module_builtin_table)
1873         (m4_set_module_macro_table): ...here, and renamed. Changed all
1874         callers.
1875         * m4/m4module.c (m4_module_data): This...
1876         * m4/m4private.c (struct m4_module_data): ...and this...
1877         * m4/module.c (module_data) ...consolidated here and no longer
1878         exported.  Changed all callers.
1880 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
1882         Begin work on lifting the curse of the global variables.  To start
1883         with create a `struct m4' context container, and replace
1884         `m4__symtab' with `context->symtab' throughout.  This means
1885         initialising a context container in main, and adjusting many
1886         functions between main and the module entry points so that the
1887         container gets passed through.  It would have been nice to
1888         defer this until after 1.5, but it has a major effect on the
1889         user's module writing ABI, so it needs to be addressed now - at
1890         least in the areas that impact the ABI.  An interrelated change
1891         in the symtab API removes the dependency on a global symbol table,
1892         and instead focuses on a passed table (from the context
1893         container).
1895         * TODO: Reminders for finishing context functionality.
1896         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
1897         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
1898         global variables and eventually allow m4 to be reentrant.
1899         * m4/m4private.h (m4): Define the new structure here...
1900         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
1901         don't carry the overhead of a function call.
1902         * m4/m4module.h: Prototype extern functions from m4/m4.c.
1903         (m4): Declare type for new struct m4 objects.
1904         (M4SYMTAB): User macro to ease finding the symbol table for the
1905         current context for module developers.
1906         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
1907         verb.
1908         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
1909         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
1910         (m4_call_macro, m4_dump_symbols, m4_expand_input)
1911         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
1912         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
1913         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
1914         m4* context parameter. Changed definitions and all callers.
1915         (m4_symtab): Alias for m4_hash to decouple the
1916         m4_symtab api from m4_hash.
1917         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
1918         m4_hash.
1919         (m4_symtab_create): New function to return an initialised
1920         m4_symtab.
1921         (m4_symtab_delete): New function to delete an m4_symtab's memory.
1922         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
1923         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
1924         instead of simply using the global m4__symtab.  Changed
1925         definitions and all callers.
1926         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
1927         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
1928         * src/main.c (main): Create a context and use that instead of the
1929         former global m4__symtab.
1931 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
1933         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
1934         to the callback.  Callbacks should not need to hardcode the
1935         hashtable they are working from, nor should we have to waste the
1936         userdata parameter to pass the table in.
1937         * m4/hash.h (m4_hash_apply_func): Require the initial table
1938         parameter.
1939         * m4/symtab.c (symtab_destroy): Use the passed table instead
1940         of hardcoding m4__symtab.
1941         (m4_symbol_popdef): Don't use the userdata parameter to pass the
1942         table to arg_destroy.
1943         (arg_destroy): Use the hash parameter, ignore userdata.
1944         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
1945         prototype.
1946         (traceon, traceoff): Call set_trace with the extra initial
1947         parameter.
1949 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
1951         More refactoring to stabilise the module api, this time for
1952         symtab.c.  Additionally, start to pay attention to function names
1953         that don't contain a verb like they should.
1955         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
1956         wrapper for m4_hash_apply to decouple the symtab module from the
1957         hash module.
1958         (m4_symbol_builtin, m4_symbol_macro): Renamed to
1959         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
1960         callers.
1961         (m4_symbol_delete): Create a macro version to save a function
1962         call.
1963         (m4_token_t, m4_data_t): These violate the POSIX reserved
1964         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
1965         all callers.
1966         (m4_token_type): Renamed to m4_token_get_type.
1967         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
1968         (m4_symtab_exit): Removed from the exported module
1969         api...
1970         * m4/m4private.h (m4__symtab, m4__symtab_init)
1971         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
1972         renamed and added to the internal api. Changed all callers.
1973         (m4_symtab_apply): A faster macro version of the function for
1974         users of the internal api.
1975         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
1976         symbol_destroy and arg_destroy.
1977         (symtab_debug): Added a prototype.
1978         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
1979         so that callers in this file get the faster macro versions from
1980         m4/m4private.h.
1982 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
1984         Refactoring modules to rationalise the API into an external
1985         documented (eventually!) API for use by modules in the `m4_'
1986         namespace declared in m4/m4module.h, an internal API between the
1987         source files we ship (including our shipped modules) in the `m4__'
1988         namespace declared in m4/m4private.h and making the rest as
1989         cohesive as possible with liberal use of the `static' keyword.
1990         This change represents an audit to m4/module.c along these
1991         guidelines.
1993         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
1994         Removed.  No longer used.
1995         (m4_module_close): Removed prototypes.
1996         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
1997         from the exported module api...
1998         * m4/m4private.h (m4__module_init, m4__module_open)
1999         (m4__module_exit): ...and renamed and added to the internal api.
2000         Changed all callers.
2001         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
2002         Centralised definitions after renaming...
2003         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
2004         (M4_FINISH_SYMBOL): ...and removing from here.
2005         (m4_module_dlerror, m4_module_remove, m4_module_close)
2006         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
2007         module_remove, module_close and caller_id.
2008         (MODULE_SELF_NAME): New macro to make reporting self errors
2009         easier.
2010         (m4_module_load, module_close, module_remove): Use it.
2011         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
2012         name.
2013         * src/main.c (main): Use it.
2015 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
2017         * README: Remove references to --enable-changeword, which has been
2018         removed from the code.
2020 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
2022         Getting rid of the annoying bug with configure --enable-debug,
2023         which spewed -e: command not found errors.  This was an interaction
2024         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
2025         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
2026         branch-1-5) to get the full fix.
2028         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
2029         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
2030         and then use the probed value of $SED.
2031         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
2032         this, it messes up the AC_REQUIRE stack.
2034 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
2036         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
2037         the destroy callback.
2038         (m4_arg_destroy): Use the hash address to free the hash node key
2039         field.
2041 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
2043         First cut at formal parameters in macros.
2045         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
2046         * m4/xstrzdup.c: New file.
2047         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
2048         associative array of parameter names to details.
2049         (m4_symbol_token): Capture macro names with parameter lists.
2050         (m4_arg_signature_parse): And build an associative array to hang
2051         from the symbol structure to map names to details.
2052         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
2053         m4_hash_resize idiom.  Now that we potentially add a little hash
2054         table to many of the entries in the symbol table, added an extra
2055         arg to set the initial size.  Changed all callers.
2056         (m4_hash_apply): New function that is basically a generalised
2057         version of...
2058         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
2059         all callers to call m4_hash_apply instead.
2060         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
2061         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
2062         m4_arg_signature association that might be attached to the symbol,
2063         * m4/hash.h (m4_hash_apply_func): Replacement type for...
2064         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
2065         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
2066         parameter lists.
2067         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
2068         (M4_IS_IDENT): Detect characters that can be safely used in
2069         parameter names.
2070         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
2071         * m4/macro.c: Corrected grammar in some comments.  Use `token'
2072         rather than `td' for m4_token variables.
2073         (m4_process_macro): If we find a dollar followed by some
2074         M4_IS_IDENT characters, replace that with the contents of the argv
2075         entry with offset stored in the m4_token_arg associated with the
2076         collected identifier.
2078 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
2080         Begin preparations for supporting formal parameters in m4 macros.
2082         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
2083         the details of a formal parameter.
2084         (m4_token): Add an arg_signature member to hold a hash table for
2085         looking up formal parameters.
2086         * m4/input.c: Update more bitrotted comments.
2087         (m4_push_builtin): Initialise arg_signature member.
2088         (init_builtin_token): Copy arg_signature member.
2089         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
2090         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
2091         replace...
2092         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
2093         (m4_macro_pushdef, m4_macro_define): ...these, And...
2094         (m4_symbol_token): ...wrapped around this new function, which
2095         vastly simplifies the arguments required by the functions it
2096         replaces.
2097         Changed all callers.
2099 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
2101         * m4/macro.c: Format changes.
2103 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
2105         * m4/input.c: Updated various bitrotted comments.
2106         (m4_push_builtin): Just pass the whole m4_token, rather than
2107         extracting all the fields in the caller.  This also allows us to
2108         check the token type for consistency.
2109         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
2110         Renamed to builtin_funcs, builtin_peek, builtin_read,
2111         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
2112         the code.  Changed all callers.
2113         (struct input_block): Similarly renamed u_m member to u_b, and
2114         changed all callers.
2115         (m4_next_token): Use bzero to initialise the data fields.
2116         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
2118 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
2120         These changes were necessary to get m4 to build on my iBook
2121         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
2122         (GCC) 3.1 20020420 (prerelease)":
2124         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
2125         inclusion of module loader headers.
2126         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
2127         * m4/Makefile.am: Ditto.
2128         (libm4_la_LIBADD): Added $(LTLIBINTL).
2129         * m4/utility.c (program_name): Removed declaration in favour of
2130         the one already in error.c!
2131         * m4/m4module.h (program_name): Define to program_invocation_name
2132         when using GNU C library. Use an explicit extern declaration.
2133         (interactive, sync_output, debug_level, hash_table_size)
2134         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
2135         (suppress_warnings, warning_status, nesting_limit, discard_comments)
2136         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
2137         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
2138         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
2139         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
2140         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
2141         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
2142         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
2143         (m4_current_line, m4_current_diversion, m4_output_current_line):
2144         Don't rely on default, use an explicit extern.
2145         * m4/error.h (error, error_at_line, error_print_progname)
2146         (error_message_count, error_one_per_line): Ditto.
2147         * m4/ltdl.c: Update from CVS libtool.
2148         * m4/ltdl.h: Ditto.
2149         * commit: Update from CVS cvs-utils.
2151 2002-11-04  Akim Demaille  <akim@epita.fr>
2153         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
2154         running m4 itself.
2155         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
2157 2002-11-04  Akim Demaille  <akim@epita.fr>
2159         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
2161 2002-11-04  Akim Demaille  <akim@epita.fr>
2163         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
2164         used as `external', and Libtool 1.4.3.
2165         (LINGUAS): Remove.
2166         (LTLIBOBJS): Don't play with it.
2167         * intl/: Remove.
2168         * Makefile.am (SUBDIRS): Remove intl.
2169         (ACLOCAL_AMFLAGS): Add -I config.
2170         (EXTRA_DIST): Add config/config.rpath.
2171         * po/LINGUAS: New.
2172         * po/Makevars: New.
2173         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
2175 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
2177         Preparations for refactoring syntax tables to allow reverse
2178         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
2179         speed of normal lookups in an array of unsigned short.
2181         * m4/input.c (single_quotes, single_comments, use_macro_escape):
2182         Moved from here...
2183         * m4/m4private.h (m4__single_quotes, m4__single_comments,
2184         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
2185         is for internal symbols which unavoidably pollute the global
2186         namespace, but are not published APIs.
2187         Adjusted all callers.
2188         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
2189         m4_set_comment, m4_set_syntax, set_syntax_internal,
2190         unset_syntax_attribute): Moved from this file...
2191         * m4/syntax.c: New. ...to this file.
2192         Also added an m4_syntax_exit stub for orthogonality.
2193         * src/main.c (main): Use it.
2194         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
2195         * m4/m4module.h: Reformatting.  New prototypes.
2197 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
2199         * bootstrap (aclocal_apiversion): The aclocal apiversion is
2200         distinct from the automake release number (in that the apiversion
2201         apparently has no micro-version-component).
2202         (aclocal_apilibdir): Use it.
2204 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
2206         * m4/hash.c (m4_hash_resize): New function.
2207         * m4/hash.h: Add prototype.
2208         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
2209         benchmarking to find a good value for, say, autoconf.  This is
2210         already a little quicker than before for me.
2212         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
2213         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
2214         and reenamed.
2215         * m4/hash.h: Adjust prototypes.
2217 2002-01-22  Akim Demaille  <akim@epita.fr>
2219         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
2220         APIVERSION scheme.
2221         * tests/Makefile.am (package.m4): New.
2222         * tests/atlocal.in: Adjust to CVS Autotest.
2223         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
2224         * configure.ac: LIBOBJ is a forbidden string.
2225         Simplify AM_INIT_AUTOMAKE invocation.
2226         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
2227         options.m4.
2229 2001-10-19  Akim Demaille  <akim@epita.fr>
2231         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
2233 2001-10-19  Akim Demaille  <akim@epita.fr>
2235         * m4/input.c (m4_next_token): Display where was opened what is
2236         not closed.
2238 2001-10-19  Akim Demaille  <akim@epita.fr>
2240         * m4/macro.c (expand_argument): Display where was opened what is
2241         not closed.
2243 2001-10-18  Akim Demaille  <akim@epita.fr>
2245         * m4/input.c, modules/m4.c: Formatting changes.
2247 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
2249         * bootstrap: s/configure.in/configure.ac/
2251 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
2253         * m4/symtab.c (m4_symbol_destroy): This function calls
2254         m4_symbol_popdef, which recycles a symbols memory when the last
2255         definition is popped.  Since we were passing the address of the
2256         symbol name found in the symbol table, and it was being removed
2257         partway through m4_symbol_destroy() we were referencing freed
2258         memory for the balance of the function.  Now we take a copy of the
2259         symbol name tring and use that as a key into the symbol
2260         table... that way if the original symbol name is freed, the copy
2261         is still valid.
2263 2001-10-13  Akim Demaille  <akim@epita.fr>
2265         * m4/ltdl.c: Update.
2267 2001-10-13  Akim Demaille  <akim@epita.fr>
2269         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
2270         Don't gettextize internal error messages.
2272 2001-10-13  Akim Demaille  <akim@epita.fr>
2274         * tests/macros.at (Arity and defn): New failing test.
2275         (Arity, defn, and freeze): New.
2277         Fix `Arity and defn'.
2279         * m4/input.c (m4_push_macro): Don't forget the arity.
2280         * modules/m4.c (defn): Likewise.
2282 2001-10-13  Akim Demaille  <akim@epita.fr>
2284         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
2285         to...
2286         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
2287         (Propagation of traceon, Propagation of --trace): this new file.
2289 2001-10-13  Akim Demaille  <akim@epita.fr>
2291         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
2292         interface instead of (name, argc...).
2293         Upon failure, specify which argument was guilty.
2294         Adjust callers.
2296 2001-10-13  Akim Demaille  <akim@epita.fr>
2298         * modules/evalparse.c: Save translators' time: don't translate
2299         internal error messages.
2300         (m4_evaluate): Simplify/normalize error messages.
2301         * doc/m4.texinfo (Eval): Adjust.
2303 2001-10-13  Akim Demaille  <akim@epita.fr>
2305         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
2306         where no checking is needed.
2307         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
2308         interface instead of (name, argc...).
2309         Adjust callers.
2310         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
2311         elsewhere.
2313 2001-10-13  Akim Demaille  <akim@epita.fr>
2315         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
2316         exclude the builtin name from the count.
2317         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
2318         calling ifelse with a single argument is valid.
2319         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
2320         with 1 and 2 args, mostly to strengthen the test suite.
2322 2001-10-13  Akim Demaille  <akim@epita.fr>
2324         * m4/output.c (m4_make_diversion, m4_insert_file)
2325         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
2327 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
2329         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
2330         since we call these things builtins in the rest of the code!
2332         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
2334 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
2336         Rather than forcing each builtin definition to manage its own
2337         argument range checking, tabulate the maxima and minima for all
2338         builtins in each module.  This forces us to consider what the
2339         valid ranges for each builtin should be, and moves the checking
2340         code out of each builtin implementation and into the builtin
2341         caller infrastructure.
2343         * m4/m4module.h (struct m4_builtin): Add argument minima and
2344         maxima.
2345         * m4/m4private.h (struct m4_token): Reflect them here too.
2346         * m4/input.c (struct input_block): ...and here.
2347         (m4_token_copy): New function for token copying.
2348         (init_macro_token): Copy them from a token to the input stack.
2349         (m4_next_token): Don't forget to initialise them for text
2350         macros.
2351         * m4/macro.c (expand_argument): Use m4_token_copy, and also
2352         check argument counts before calling the builtin handler.
2353         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
2354         (m4_symbol_macro): Likewise.
2355         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
2356         parameters.  Updated all callers.
2357         (m4_builtin_define): Ditto.
2358         (m4_macro_pushdef, m4_macro_define): Ditto.
2359         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
2360         * modules/evalparse.c:  Declare argument counts for defined
2361         builtins and remove explicit calls to m4_bad_argc().
2362         * modules/gnu.c: Ditto.
2363         * modules/load.c: Ditto.
2364         * modules/m4.c: Ditto.
2365         * modules/modtest.c: Ditto.
2366         * modules/mpeval.c: Ditto.
2367         * modules/perl.c: Ditto.
2368         * modules/shadow.c: Ditto.
2369         * modules/stdlib.c: Ditto.
2370         * modules/time.c: Ditto.
2371         * TODO: Updated.
2373 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
2375         The trace semantics now attach the trace bit to a symbol name.
2376         For as long as a traceon(`foo') is active, calls to foo will be
2377         traced regardless of intervening undefines or module unloads.
2378         Fixed the flag propogation issues differently to the fixes
2379         reverted with the last attempt at nailing down trace:
2381         * m4/m4private.h:  This file is not visible outside of the m4
2382         source tree, so I removed all the `M4_' and `m4_' prefixes to save
2383         on typing.  Updated all clients.
2384         (m4_token): New typedef contains the fields that need to be passed
2385         around with the low level tokeniser.
2386         (m4_token_data):  Removed.
2387         (m4_symbol): Now contains the traced flag again.
2388         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
2389         the trace bit set.  This change is contained entirely within this
2390         module and doesn't leak out into the callers.  Updated all
2391         clients.
2392         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
2393         new fields in m4_token.  Updated all clients.
2394         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
2395         that `groks_macro_args' and `blind_if_no_args' flags are retained
2396         when defn() results are passed around in m4 code.  Updated all
2397         callers.
2398         (m4_builtin_define): Ditto.
2399         (m4_macro_pushdef, m4_macro_define): Ditto.
2400         * m4/input.c (struct input_block): Add a flags field to facilitate
2401         the above.
2402         (m4_push_macro):  ...use it.
2403         (init_macro_token):  Retrieve it.
2404         (m4_next_token): Initialise it.
2405         * m4/macro.c (expand_argument):  Copy it.
2406         * m4/m4module.h: Adjust.
2407         * tests/builtins.at:  Adjust the expected output of the trace
2408         tests to reflect the change in semantics.
2409         * tests/modules.at (modules: trace):  Check that unloading a
2410         module which supplies a traced symbol definition doesn't lose te
2411         trace bit.
2413 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
2415         * modules/gnu.c (m4_macro_table): Display the timetamp when
2416         expanding __m4_version__.
2418         * configure.ac (--with-modules): Forgot a comma in the
2419         AC_HELP_STRING parameter list.
2421 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
2423         * bootstrap: Remove aclocal.m4t when it is no longer required.
2425 2001-10-05  Akim Demaille  <akim@epita.fr>
2427         * tests/Makefile.am: Adjust for gnuprog2.
2428         * tests/m4.in: There can be a leading path.
2429         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
2430         * tests/testsuite.at: Adjust to the most recent Autotest.
2431         (AT_CHECK_M4_FILTER): Fix and rename as...
2432         (AT_TEST_M4): this.
2433         * tests/others.at: Use it.
2435         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
2436         variable in shell scripts, one uses `$'...
2438 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
2440         * configure.ac: `rm -f $m4_getopt_h' was lost.
2442 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
2444         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
2445         time.  Define it for config.h in order to...
2446         * src/main.c (main): ...display the timestamp for --version.
2448 2001-10-04  Akim Demaille  <akim@epita.fr>
2450         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
2451         previous builtins `regexp' and `patsubst'.
2452         (regexp, patsubst): Use them.
2453         (eregexp, epatsubst): New builtins.
2454         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
2455         (Epatsubst and Patsubst, Eregexp and Regexp): these.
2456         (Extensions): More info on REs.
2458 2001-10-04  Akim Demaille  <akim@epita.fr>
2460         * modules/modtest.c (init_handler): Consistently output to stderr.
2461         (finish_handler): New.
2462         (test): The `if' is an `assert'.
2463         * tests/modules.at: Adjust.
2465 2001-10-04  Akim Demaille  <akim@epita.fr>
2467         * m4/utility.c (m4_bad_argc): Detail the mismatches.
2469 2001-10-01  Akim Demaille  <akim@epita.fr>
2471         * tests/generate.awk: Tag the tests with `documentation'.
2472         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
2473         Use the make the existing modtest tests more uniform, and complete
2474         the set of possibilities.
2476 2001-10-01  Akim Demaille  <akim@epita.fr>
2478         * config/gmp.m4: Consult the user before using GMP: use
2479         --without-gmp.
2480         * configure.ac: Adjust.
2481         * modules/gmp.c: No protection needed as the module is not built
2482         if GMP is not used.
2484 2001-10-01  Akim Demaille  <akim@epita.fr>
2486         * tests/generate.awk: Remove debugging code.
2487         (fatal): Specify the current location.
2489         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
2490         * modules/gnu.c, modules/m4.c: Use M4ARG.
2492 2001-10-01  Akim Demaille  <akim@epita.fr>
2494         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
2495         (m4_regexp_compile): New.
2496         (regexp, patsubst): Use it.
2498 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
2500         Reinstate the memory handling improvements from the patch I just
2501         reverted.  Relevant ChangeLog entries repeated here:
2503         * m4/module.c (m4_module_remove): New function that holds the core
2504         of the old m4_module_unload.
2505         (m4_module_unload): Use it.
2506         (m4_module_unload_all): When we know the modules will never be
2507         used again (i.e. on exit), free up as much module memory as
2508         possible.  There are still some artifacts from resident modules
2509         living inside ltdl.c, but everything else is freed.
2510         * m4/debug.c (m4_debug_exit): Free memory allocated in
2511         m4_debug_init().
2512         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2513         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2514         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2515         * m4/m4module.h: Updated prototypes.
2516         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2517         * m4/hash.h: Updated prototypes.
2518         * src/main.c (main): Use all these new functions to clean up as
2519         much memory as possible before exit.
2521 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
2523         Reverted my large patch for removing the old m4_symbol
2524         structure on 2001-09-20.  We are still not happy about the way
2525         trace works in conjunction with defn and undefine, and leaving
2526         the reverted patch active prevents us from moving the traced
2527         bit from the definition back to the symbol.
2529 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
2531         * configure.in: Moved to...
2532         * configure.ac: ...here.  Added a libtool like timestamped
2533         banner, and tidied up the libltdl cruft.
2534         * config/mkstamp: Script to extract a timestamp from ChangeLog.
2535         * modules/Makefile.am (INCLTDL):  Removed.  This is required
2536         only when libltdl is configured in a subdirectory.
2537         * src/Makefile.am: Ditto.
2538         (LIBADD_DL):  No need to add this again, libtool already knows
2539         that libm4.la depends on it.
2540         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
2541         them.
2543         * TODO: stackovf.c is basically broken.
2544         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
2546 2001-09-28  Akim Demaille  <akim@epita.fr>
2548         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
2550 2001-09-27  Akim Demaille  <akim@epita.fr>
2552         * tests/m4.in: Don't use short options.
2553         Simplify the stderr signature normalization.
2555 2001-09-27  Akim Demaille  <akim@epita.fr>
2557         tests/m4 shall be position independent.
2559         * tests/m4.in: New.
2560         * tests/m4: Remove.
2561         * tests/testsuite.at: No args to AT_INIT.
2562         * configure.in, tests/Makefile.am: Adjust.
2564 2001-09-22  Akim Demaille  <akim@epita.fr>
2566         Autotest has changed again.
2568         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
2569         (package.m4): Remove.
2570         * configure.in: Adjust to LIBADD_GMP.
2572 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
2574         * config/gmp.m4 (AC_ARG_WITH): Removed.
2575         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
2576         (AC_LIB_GMP): When performing a test compile against libgmp,
2577         include the header gmp.h if possible, and link against -lgmp.  If
2578         they both work define USE_GMP.
2579         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
2580         (mpeval_LTX_init_func): Complain on load that there was no libgmp
2581         at compile time.
2583 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
2585         * m4/evalparse.c: Moved to...
2586         * modules/evalparse.c:  ...here.  This code is shared between
2587         modules/mpeval.c and modules/m4.c, so there is no need to pollute
2588         the libm4 API with its details.  Moderately rewritten to interface
2589         into its clients more simply.
2590         * m4/eval.c: Deleted.  Migrated functionality to...
2591         * modules/m4.c: ...here.
2592         (builtin_eval):  Implemented in terms of the new interface style.
2593         * modules/mpeval.c (builtin_mpeval): Ditto.
2594         * m4/m4module.h: Removed references to the former m4/eval.c.
2595         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
2596         (EXTRA_libm4_la_SOURCES): Deleted.
2597         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
2598         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
2600 2001-09-20  Akim Demaille  <akim@epita.fr>
2602         * config/gmp.m4 (AM_WITH_GMP): Rename as...
2603         (AC_LIB_GMP): this.
2604         By default, use gmp.
2605         Massive revamping.
2606         * configure.in: Adjust.
2607         Use Automake conditionals for USE_GMP.
2608         Always compute sizeof (long long int).
2609         This was a bug BTW, as `eval' (not `mpeval') depends on it:
2610         before, it was used _only_ if mpeval was not activated.
2611         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
2612         (mpeval_la_LIBADD): New macros.
2613         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
2614         Indent.
2615         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
2616         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
2617         WITH_GMP.
2619 2001-09-20  Akim Demaille  <akim@epita.fr>
2621         * tests/Makefile.am (package.m4): New.
2622         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
2624 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
2626         More cleanup.  After the last patch, m4_symbol holds nothing but
2627         the head of a chain of m4_token_data.  So I have removed the old
2628         m4_symbol, so that m4_token_data chains are stored directly in the
2629         value cell of a hash table node.  But there's more... m4_symbol
2630         was a more natural name for the symbol value cell, and now that it
2631         is gone I have renamed the former m4_token_data structure to
2632         m4_symbol.  This change turned out to be a pig to get right, since
2633         the original code didn't need to modify the value cell itself,
2634         since changing the chain happened inside the m4_symbol that used
2635         to be returned -- I had to pass the address of the value cell
2636         across various function calls, incase the head value changed.  I
2637         also tightened up the memory management to help me find a nasty
2638         memory corruption bug that took me all night to track down...
2640         * m4/m4private.h (struct m4_symbol): Removed.
2641         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
2642         all references.
2643         * m4/hash.c (m4_hash_iterator_value): Return the address of the
2644         value cell.  Updated all callers.
2645         * m4/symtab.c: Took advantage of the simplification in the data
2646         structures to rewrite a lot of this file more simply.  There is
2647         still some room for optimisation here, but we should tackle that
2648         systematically closer to the release.
2650         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
2651         revealed.  This version is ahead of CVS libtool until I get chance
2652         to flush my changes.
2653         * m4/module.c (m4_module_remove): New function that holds the core
2654         of the old m4_module_unload.
2655         (m4_module_unload): Use it.
2656         (m4_module_unload_all): When we know the modules will never be
2657         used again (i.e. on exit), free up as much module memory as
2658         possible.  There are still some artifacts from resident modules
2659         living inside ltdl.c, but everything else is freed.
2660         * m4/debug.c (m4_debug_exit): Free memory allocated in
2661         m4_debug_init().
2662         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
2663         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
2664         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
2665         * m4/m4module.h: Updated prototypes.
2666         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
2667         * m4/hash.h: Updated prototypes.
2668         * src/main.c (main): Use all these new functions to clean up as
2669         much memory as possible before exit.
2671 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
2673         The `traced' flag needs to be attached to the definition of a
2674         symbol rather than the current symbol containing the definition.
2675         Implementing this showed up some long standing post 1.4 bugs in
2676         flag propogation which I also fixed.
2678         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
2679         (struct m4_token_data): And add it back in here.
2680         * m4/input.c (init_macro_token): Propogate the traced flag
2681         correctly.
2682         * m4/macro.c (expand_argument): Ditto.
2683         * tests/builtins.at (trace2, trace3): New tests based on Akim's
2684         sadistic email ;-)
2686 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
2688         * m4/m4private.h (struct m4_token_data): Simplified by removing
2689         the redundant `traced' flag, and one level of structure nesting.
2690         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
2691         * m4/input.c (init_macro_token): No need to initialise removed
2692         `traced' field.
2693         * m4/macro.c (expand_argument): No need to copy it either.
2694         * m4/utility.c (m4_token_data_func_traced): Or provide an access
2695         function.
2697         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
2698         dependant on multiple symbols with the same key, so preserving
2699         relative symbol order in each bucket during resizing is no longer
2700         required.  The resize function is considerably faster as a result.
2702         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
2703         s/m4_symbol_insert/m4_symbol_define/g;
2704         s/m4_builtin_insert/m4_builtin_define/g;
2705         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
2707 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
2709         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
2710         commits, the m4_lookup_symbol dispatch function is split into
2711         specialised functions that must be called directly.
2713         * m4/m4module.h (m4_symbol_lookup_t): Removed.
2714         * m4/symtab.c (m4_lookup_symbol): Removed.
2715         (m4_symbol_builtin, m4_symbol_macro): New functions.
2716         * m4/builtin.c (m4_builtin_define): Split into...
2717         (m4_builtin_pushdef, m4_builtin_insert): ...these.
2718         (m4_macro_define): Split into...
2719         (m4_macro_pushdef, m4_macro_insert): ...these.
2720         * src/main.c (main): Set command line macros from `-D' parameters
2721         using `m4_macro_define'.
2723 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
2725         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
2726         this from m4_remove_table_reference_symbols().
2727         * m4/m4module.h, m4/module.c: Updated all references.
2729 2001-09-07  Akim Demaille  <akim@epita.fr>
2731         * modules/stdlib.c, modules/times.c: Misc cleanups.
2733 2001-09-07  Akim Demaille  <akim@epita.fr>
2735         * configure.in: We now need Autoconf 2.52e.
2736         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
2737         and `M4_SYMBOL_DELETE'.
2738         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
2739         * src/main.c (main): Adjust.
2741 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
2743         Fix the obstack.h problem once and for all!  At configure time we
2744         can test for a system supplied obstack.h:  depending on the
2745         result, we now generate system.h with an #include of the correct
2746         header.  As a bonus, I've also added a --with-included-obstack,
2747         incase the user doesn't like the system obstack for some
2748         reason... and also we can test the shipped obstack on a system
2749         that has oe of its own.  We also now need to be careful to add
2750         build directories to the include search path, since the generated
2751         system.h will be in the build tree.
2753         * configure.in (AC_CONFIG_FILES): Generate system.h from
2754         system-h.in.
2755         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
2756         include the system obstack header or the copy shipped with M4.
2757         Allow the user to override configure and force the build to use
2758         the shipped version.
2759         * m4/system-h.in: New file, template for...
2760         * m4/system.h: ...this.  Now deleted.
2761         * m4/m4module.h: Include system.h before everything else.
2762         * src/freeze.c: Ditto.
2763         * m4/Makefile.am (dist-hook): Remove generated system.h.
2764         (INCLUDES): Check builddir for generated headers before checking
2765         srcdir.
2766         * modules/Makefile.am (INCLUDES): Ditto.
2767         * src/Makefile.am (INCLUDES): Ditto.
2769 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
2771         * TODO: Remove the items that have been addressed already.
2773 2001-09-05  Akim Demaille  <akim@epita.fr>
2775         * src/main.c (main): Standardize --version.
2777 2001-09-05  Akim Demaille  <akim@epita.fr>
2779         * modules/format.c (format): Have a bigger `str'.
2781 2001-09-05  Akim Demaille  <akim@epita.fr>
2783         Rationalize warnings, reporting the macro name as if it were a
2784         program name, and assertions.
2786         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
2787         (M4WARN): New.
2788         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
2789         (m4_symbol_delete):
2790         Use assert for internal errors.
2791         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
2792         M4WARN.
2793         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
2794         M4WARN and assert.
2795         * tests/builtins.at (pushpop): Adjust.
2797 2001-09-05  Akim Demaille  <akim@epita.fr>
2799         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
2800         with pointers.
2802 2001-09-05  Akim Demaille  <akim@epita.fr>
2804         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
2805         * m4/macro.c, m4/symtab.c: Adjust.
2807 2001-09-05  Akim Demaille  <akim@epita.fr>
2809         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
2810         (m4_symbol_pop, m4_symbol_del): this.
2811         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
2812         (m4_symbol_popdef, m4_symbol_delete): New.
2813         (m4_lookup_symbol): Adjust.
2814         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
2816 2001-09-05  Akim Demaille  <akim@epita.fr>
2818         * m4/m4module.h (m4_symbol_lookup): Rename as...
2819         (m4_symbol_lookup_t): this.
2821 2001-09-05  Akim Demaille  <akim@epita.fr>
2823         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
2824         unused.
2825         * m4/symtab.c (m4_lookup_symbol): Adjust.
2827 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
2829         Bootstrap will now work with Libtool 1.4.1 or higher:
2830         * bootstrap: Remove stale autom4te.cache files when
2831         rebootstrapping.
2832         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
2833         libtool.m4.
2834         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
2835         libtool.m4 directly.
2836         Run libtoolize to refresh ltmain.sh.
2837         * config/ltmain.sh:  Deleted.
2838         * acinclude.m4: Deleted.
2839         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
2841         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
2842         implementation for the cvs impaired libtool user.
2844 2001-09-03  Akim Demaille  <akim@epita.fr>
2846         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
2847         internal errors.
2848         Avoid using `default' in switch, as it hides useful compiler
2849         warnings when a case is forgotten.
2851 2001-09-03  Akim Demaille  <akim@epita.fr>
2853         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
2854         is no such thing as `WITH_MODULES'.
2856 2001-09-03  Akim Demaille  <akim@epita.fr>
2858         Improve the test suite's selfcontainedness.
2860         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
2861         (Include, Undivert): Tag the other input files.
2862         * tests/generate.awk: Catch `@comment file:'.
2863         `-I $src' is no longer needed.
2864         `next' is really like `return': the rest is skipped.
2865         Adjust to `input.m4'.
2866         (fatal): New function.
2867         * tests/foo, tests/incl.m4: Remove.
2869 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
2871         The shadowing mechanism and, infact, the whole symbol table
2872         implementation was creaking under the weight of the features piled
2873         on top of it.  We now have a separate hash table module which will
2874         dynamically resize to keep symbol density withing good performace
2875         limits, and a new symtab module layered above it.  Symbol lookups
2876         are now marginally more efficient (since the shadowed flag is no
2877         longer required) and symbol removal, such as on module unload, is
2878         considerably faster due to a reorganisation of the data structures
2879         used in symtab.c.
2881         * src/main.c (main):  Don't mention `-H'.
2882         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
2883         effect.
2884         * NEWS: Updated.
2885         * m4/hash.c: New generalised dynamic hash table data structure
2886         management module.
2887         * m4/hash.h: Public interface.
2888         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
2889         (libm4_la_SOURCES): Add hash.c.
2890         * m4/symtab.c: More or less rewritten from scratch, within the
2891         bounds of the previous API.
2892         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
2893         call.  Updated all callers.
2894         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
2895         declarations to reflect API changes.
2896         (M4INIT): Generate a declaration too, to avoid the warning with
2897         --enable-debug builds.
2898         (M4FINISH): Ditto.
2899         (HASHMAX): Removed.
2900         * m4/utility.c (hash_table_size):  Removed.
2901         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
2902         names, which are then looked up by builtin_dumpdef() as necessary.
2903         This implies a small speedup in builtin_symbols(), which discarded
2904         all of the symbol info under the old call.
2905         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
2906         shadowing is implicit in respect to the new data structures.
2907         symbol names are no longer duplicated here, they are stored in the
2908         key field of the hash table.
2909         Moved macro_args and blind_no_args...
2910         (m4_token_data): ...to here.
2911         m4/macro.c (expand_macro):  Added a name argument since the symbol
2912         name is no longer copied into each struct m4_symbol.  Modified all
2913         callers.
2914         (collect_arguments):  Ditto.
2915         * modules/m4.c (set_trace): Ditto.
2916         * modules/gnu.c (builtin_symbols): Updated.
2917         * src/freeze.c (produce_symbol_dump): Much improved in light of
2918         the improved symbol table layout.
2920 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
2922         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
2923         to M4_SYMBOL_NEXT.
2924         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
2925         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
2926         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
2927         SYMBOL_HANDLE): Ditto.
2928         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
2929         modules/gnu.c, modules/m4.c, src/freeze.c,
2930         src/main.c:  Updated all references.
2932         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
2933         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
2934         already listed in m4_LDADD... how did that ever used to work?
2935         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
2936         link.
2937         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
2938         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
2940         * tests/m4: Don't call the m4 wrapper script with libtool, it
2941         works fine all by itself.
2943 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
2945         The experimental `changeword' feature never took off, and has
2946         no obvious advantages over `changesyntax' to compensate the
2947         enormous speed penalty it carries:
2948         * configure.in (ENABLE_CHANGEWORD): Removed.
2949         * m4/m4module.h (m4_set_word_regexp): Removed.
2950         * m4/m4private.h (m4_token_data): Removed original_text field.
2951         * m4/utility.c (m4_token_data_orig_text): Removed.
2952         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
2953         * m4/macro.c: Ditto.
2954         * src/main.c: Ditto.
2955         * modules/Makefile.am (changeword.la): Removed.
2956         * modules/changeword.c: File removed.
2957         * doc/m4.texinfo: References to changeword and --word-regexp
2958         removed.
2959         * po/POTFILES.in: modules/changeword.c removed.
2960         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
2961         * tests/builtins.at (changeword): Test removed.
2963 2001-08-30  Akim Demaille  <akim@epita.fr>
2965         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
2966         This also help having a single list of m4 files: in
2967         config/Makefile.am.
2968         * config/Makefile.am (STANDARD_MACROS): Rename as...
2969         (ACLOCAL_MACROS): this.
2970         (list-standard-macros): Remove.
2971         (spy): New.
2973 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
2975         In an attempt to moderate my egomania...
2976         * tests/modules.at: Remove attributions.
2978         * tests/generate.awk: When making substitutions to "@&t@", either
2979         "&" or "\&" in the substitution string argument to gsub refer back
2980         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
2981         67 now pass for me.
2983 2001-08-29  Akim Demaille  <akim@epita.fr>
2985         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
2986         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
2987         (sync-lines, trace, translit, undivert, wrap): Move to...
2988         * tests/builtins.at: this new file.
2989         * tests/others.at (Discard comments, import-environment): Move to...
2990         * tests/options.at: this new file.
2992 2001-08-29  Akim Demaille  <akim@epita.fr>
2994         * tests/others.at (Freezing modules)
2995         (--module-directory: absolute path, modpath2, modpath3)
2996         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
2997         * tests/modules.at: here, new file.
2998         * tests/others.at, tests/generate.awk: Add a banner.
2999         * tests/testsuite.at: Adjust.
3000         (AT_CHECK_M4_FILTER): New, but unused.
3002 2001-08-29  Akim Demaille  <akim@epita.fr>
3004         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
3005         handle that.
3006         * tests/others.at (wrap): Inline wrap.m4.
3007         (shadow): Inline shadow.m4.
3008         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
3009         * tests/m4: Simplify.
3011 2001-08-29  Akim Demaille  <akim@epita.fr>
3013         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
3014         --language.
3016 2001-08-29  Akim Demaille  <akim@epita.fr>
3018         * tests/generate.awk (normalize): s/@__@/@&t@/.
3020 2001-08-28  Akim Demaille  <akim@epita.fr>
3022         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
3024 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
3026         * bootstrap (generate.awk): Generate test cases with new script.
3028 2001-08-27  Akim Demaille  <akim@epita.fr>
3030         * tests/Makefile.am (installcheck-local): Don't use
3031         `dc_install_base' which is not visible here, but `exec_prefix'
3032         which is clearly the RT anyway.
3033         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
3034         related to testing a now installed m4.
3035         * tests/m4: Do it here.
3037 2001-08-27  Akim Demaille  <akim@epita.fr>
3039         * tests/others.at (indir): Formatting change.
3041 2001-08-27  Akim Demaille  <akim@epita.fr>
3043         * tests/Makefile.am (installcheck-local): New.
3044         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
3045         the test suite.
3046         Prefer options over envvars.
3047         * src/main.c (main): First bug caught by the test suite (yeah!):
3048         --batch lacked a `break' which resulted in an accidental
3049         invocation of --discard-comments.
3051 2001-08-27  Akim Demaille  <akim@epita.fr>
3053         * tests/others.at (capitalize, changeword, comments, ddivert)
3054         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
3055         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
3056         (sysv-args, trace, translit, undivert): Don't rely on files in
3057         examples/: AT_DATA them.
3059 2001-08-27  Akim Demaille  <akim@epita.fr>
3061         Let the test suite use a wrapper around the not installed m4 to
3062         pretend it is (installed).
3064         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
3065         such a way that m4 does not process them.
3066         * configure.in: The package name seems to be `m4', not `M4'.
3067         * tests/m4: New.
3068         * tests/atlocal.in (at_package, M4): Remove.
3069         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
3071 2001-08-27  Akim Demaille  <akim@epita.fr>
3073         * tests/Makefile.am (CLEANFILES): Remove.
3074         (DISTCLEANFILES, clean-local): New.
3075         * examples/mktests.sh: Remove.
3077 2001-08-27  Akim Demaille  <akim@epita.fr>
3079         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
3080         Don't use aclocal: it's written by hand.
3081         * aclocal.m4: m4_include all the files instead of being built by
3082         aclocal.
3083         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
3084         until it reads the traces by itself.
3085         * configure.in: Require Autoconf 2.42c as we are now using
3086         AC_CONFIG_TESTDIR instead of AT_CONFIG.
3087         Catch unexpanded `jm_' macros.
3088         * config/atconfig.m4: Remove.
3089         * config/error.m4: new.
3090         * config/Makefile.am: Ship the files included by aclocal.m4.
3091         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
3092         (TESTSUITE_AT): this, to please Automake.
3093         (TESTSUITE): This target uses autotest/autotest.m4, not
3094         autotest/general.m4.
3095         * tests/testsuite.at: Prereq Autotest 2.52c.
3096         * examples/Makefile.am (pkgdata_DATA): Rename as...
3097         (dist_pkgdata_DATA): this.
3098         * doc/Makefile.am (man_MANS): Rename as...
3099         (dist_man_mans): this.
3101 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
3103         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
3104         Robert Collins, building on Cygwin no longer requires Windows
3105         import and export symbol decorations.
3106         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
3107         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
3108         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3109         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3110         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3111         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3112         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3113         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3114         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
3115         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
3116         anymore.
3117         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
3118         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
3120 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
3122         Ansify the source.  Previously we had a mix, where my code was
3123         in a K&R compatible style, and the preexisting code was in ANSI
3124         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
3125         and now the code base is much cleaner.
3127         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
3128         VOID macro and all users.
3129         * m4/m4module.h:  Ansify function prototypes and headers.
3130         * m4/builtin.c:  Ditto.
3131         * m4/evalparse.c:  Ditto.
3132         * m4/input.c:  Ditto.
3133         * m4/macro.c:  Ditto.
3134         * m4/module.c:  Ditto.
3135         * m4/output.c:  Ditto.
3136         * m4/path.c:  Ditto.
3137         * m4/symtab.c:  Ditto.
3138         * m4/utility.c:  Ditto.
3139         * modules/format.c:  Ditto.
3140         * modules/gnu.c:  Ditto.
3141         * modules/m4.c:  Ditto.
3142         * modules/mpeval.c:  Ditto.
3143         * src/freeze.c:  Ditto.
3144         * src/m4.h:  Ditto.
3145         * src/main.c:  Ditto.
3147 2001-08-20  Akim Demaille  <akim@epita.fr>
3149         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
3150         generated with stock 2.52.
3152 2001-08-20  Akim Demaille  <akim@epita.fr>
3154         * config/atconfig.m4: New, until part of Autoconf per se.
3155         * configure.in (AT_CONFIG): Use it.
3156         Adjust.
3157         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
3158         * tests/atlocal.in: New.
3159         * tests/generate.awk: For the time being, the empty quadrigraph is
3160         `@__@'.
3161         * tests/others.at (changeword, gmp): Check the configuration
3162         variable against `yes'.
3163         * tests/testsuite.at (dnl): Allow it, as it's used all over the
3164         place.
3166 2001-08-20  Akim Demaille  <akim@epita.fr>
3168         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
3169         * modules/m4.c (undivert): Disable the possibility of undiverting
3170         several files at once: it is not documented, it is inconsistent
3171         with the other macros, it can be straightforwardly mocked by
3172         several invocations, and most importantly, it prevents the
3173         possibility of other kinds of extension.
3174         Use `m4_numeric_arg'.
3176 2001-08-20  Akim Demaille  <akim@epita.fr>
3178         * examples/include.m4: Typo.
3179         * tests/generate.awk: Really add it.
3180         * tests/Makefile.am: Adjust.
3181         * tests/others.at (Discard comments): It sure fails without `-c'.
3182         (include, undivert): Add -I examples/.
3184 2001-08-20  Akim Demaille  <akim@epita.fr>
3186         Use sprintf, not ecft and friends since it is standard, portable,
3187         simplifies the code, and since the latter is even deprecated
3188         according to the GNU libc documentation.
3190         * modules/format.c: Drop evct support.
3192 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
3194         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
3195         for `-pipe' here...
3196         * configure.in: ...do it here instead.
3198         * c-boxes.el: Deleted.
3199         * m4/builtin.c: Reformat box comments to be closer to GNU
3200         standards.
3201         * m4/debug.c:  Ditto.
3202         * m4/eval.c:  Ditto.
3203         * m4/evalparse.c:  Ditto.
3204         * m4/input.c:  Ditto.
3205         * m4/m4module.h:  Ditto.
3206         * m4/macro.c:  Ditto.
3207         * m4/output.c:  Ditto.
3208         * m4/symtab.c:  Ditto.
3209         * m4/utility.c:  Ditto.
3210         * modules/changeword.c:  Ditto.
3211         * modules/format.c:  Ditto.
3212         * modules/gnu.c:  Ditto.
3213         * modules/load.c:  Ditto.
3214         * modules/m4.c:  Ditto.
3215         * modules/modtest.c:  Ditto.
3216         * modules/mpeval.c:  Ditto.
3217         * modules/perl.c:  Ditto.
3218         * modules/shadow.c:  Ditto.
3219         * modules/stdlib.c:  Ditto.
3220         * modules/time.c:  Ditto.
3221         * src/freeze.c:  Ditto.
3222         * src/main.c:  Ditto.
3224 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
3226         * m4/module.c: Fixup some errors in the description comment.
3228 2001-08-17  Akim Demaille  <akim@epita.fr>
3230         * tests/others.at (iso8859): Specify the path to the M4 test file.
3231         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
3232         files in error messages.
3234 2001-08-17  Akim Demaille  <akim@epita.fr>
3236         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
3237         * tests/others.at: Adjust input files paths.
3238         * tests/atconfig.in: Set top_builddir.
3239         * tests/Makefile.am: Adjust.
3240         `testsuite' is in src, not build.
3242 2001-08-17  Akim Demaille  <akim@epita.fr>
3244         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
3245         (generate.at): Install a temporary hack until the actual
3246         generate.awk is added to the repository.
3247         * tests/atconfig.in: New.
3249 2001-08-17  Akim Demaille  <akim@epita.fr>
3251         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
3253 2001-08-17  Akim Demaille  <akim@epita.fr>
3255         * doc/m4.texinfo: Promote proper quotation.
3257 2001-08-17  Akim Demaille  <akim@epita.fr>
3259         Remove the non Autotest tests.
3261         * tests/other-tests/capitalize.test,
3262         * tests/other-tests/changeword.test,
3263         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
3264         * tests/other-tests/debug.test,
3265         * tests/other-tests/discard-comments.m4,
3266         * tests/other-tests/discard-comments.test,
3267         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
3268         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
3269         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
3270         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
3271         * tests/other-tests/hanoi.test,
3272         * tests/other-tests/import-environment.m4,
3273         * tests/other-tests/import-environment.test,
3274         * tests/other-tests/include.test, tests/other-tests/indir.test,
3275         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
3276         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
3277         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
3278         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
3279         * tests/other-tests/modtest.test,
3280         * tests/other-tests/multiquotes.test,
3281         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
3282         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
3283         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
3284         * tests/other-tests/sync-lines.m4,
3285         * tests/other-tests/sync-lines.test,
3286         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
3287         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
3288         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
3289         * tests/other-tests/wrap.test: Remove.
3291         * tests/run-test, tests/get-them: Remove.
3292         * tests/Makefile.am: Adjust.
3294 2001-08-17  Akim Demaille  <akim@epita.fr>
3296         others.at no longer depends on other-tests/.
3298         * tests/others.at (stackovf): You're actually...
3299         (sync-lines): this.
3300         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
3301         (unload.test): Keep their authorship.
3302         (discard-comments, gmp, import-environment, modfreeze)
3303         (sync-lines): Embed the input files.
3304         * tests/stackovf.test: Copy from other-tests/stackovf.test.
3305         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
3307 2001-08-17  Akim Demaille  <akim@epita.fr>
3309         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
3310         (M4exit): Tag the exit status of the example.
3311         * tests/get-them: Adjust.
3312         * tests/generate.awk: New, based on get-them.
3313         * tests/Makefile.am: Adjust to generate `generated.at'.
3314         * tests/testsuite.at: Adjust.
3315         (AT_CHECK_M4): Don't overquote.  Blush...
3317 2001-08-17  Akim Demaille  <akim@epita.fr>
3319         Start using Autotest.  atconfig creation is still lacking.
3321         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
3322         * examples/reverse.m4, tests/other-tests/import-environment.m4,
3323         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
3324         * tests/other-tests/import-environment.test: Don't check LANGUAGE
3325         as it might be `unset', or set to `C'.
3326         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
3327         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
3328         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
3329         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
3330         * tests/other-tests/shadow.test: Adjust.
3331         * tests/testsuite.at, tests/others.at: New.
3332         * tests/Makefile.am: Adjust.
3334 2001-08-17  Akim Demaille  <akim@epita.fr>
3336         Drop Autoconf 2.13 compatibility.
3338         * configure.in (changeword): No need to undefine it, as anyway if
3339         it's defined, M4sugar moved it as m4_changeword.
3340         And anyway, proper quotation is enough.
3341         (m4_pattern_allow): As it exists in 2.50, just use it.
3342         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
3343         Don't handle Gettext's duties, let it handle them.
3344         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
3346 2001-08-17  Akim Demaille  <akim@epita.fr>
3348         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
3349         (m4_errprint): Use fputs.
3350         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
3351         dumpdef are not concerned.
3352         (Dumpdef, Errprint): Emphasize their insensitivity to
3353         --error-output.
3354         * doc/Makefile.am: Add `TAGS' support.
3355         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
3356         in `config/' now.
3357         * config/Makefile.am (MAINTAINERCLEANFILES): New.
3359 2001-08-17  Akim Demaille  <akim@epita.fr>
3361         * modules/Makefile.am (ETAGS_ARGS): New.
3363 2001-08-17  Akim Demaille  <akim@epita.fr>
3365         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
3366         changes.
3368 2001-08-17  Akim Demaille  <akim@epita.fr>
3370         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
3372 2001-08-17  Akim Demaille  <akim@epita.fr>
3374         * m4/m4module.h (m4/list.h): Don't include it.
3376 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
3378         m4_modules are no more, we use lt_dlhandles directly and let
3379         latest libltdl features manage the list of loaded modules.
3380         * acinclude.m4: Regenerated.
3381         * m4/ltdl.c: Updated from master copy.
3382         * m4/module.c: Reimplemented to take advantage of advances in
3383         libltdl.
3384         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
3385         list with lt_dlhandle_next.
3386         (m4_builtin_find_by_func): Ditto.
3387         (m4_builtin_table_install): Use lt_dlhandle.
3388         (m4_macro_define): Ditto.
3389         (m4_macro_table_install): Ditto.
3390         m4/module.h: Prototype new module management API.
3391         (m4_modules): No longer required.
3392         (m4_module_init_t, m4_module_finish_t): POSIX namespace
3393         violations, renamed to...
3394         (m4_module_init_func, m4_module_finish_func): ...these,
3395         respectively.
3396         (M4INIT_HANDLER): Clean way to declare init functions in modules.
3397         (M4FINISH_HANDLER):  And similarly for finish functions.
3398         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
3399         -- Add indirection to the CONC macro so that arguments are
3400         correctly expanded.
3401         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
3402         * modules/shadow.c (m4_init_module):  Ditto.
3403         Due to new init function semantics, be careful to perform the
3404         initialisation only on first load.
3405         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
3406         (m4_finish_module): Replaced with M4FINISH_HANDLER.
3407         Due to new finish function semantics, be careful to perform the
3408         finalisation only on first load.
3409         * m4/m4private.h (m4_module): Removed in favour of...
3410         (m4_module_data): ...structure without all the wrapper fields.
3411         Instances of this new structure are stored associated lt_dlhandles
3412         with lt_dlcaller_data_set().
3413         * m4/builtin.c (m4_builtin_define): Takes a handle argument
3414         instead of the old module argument.
3415         (m4_builtin_table_install): Ditto.
3416         * modules/load.c (m4_resident_module):  Removed.  This is no
3417         longer implemented as a magic symbol...
3418         * modules/m4.c (m4_resident_module): Ditto.
3419         * modules/load.c (M4INIT_HANDLER): ...the module init function now
3420         uses the ltdl api to make the module resident.
3421         * modules/m4.c (M4INIT_HANDLER): Ditto.
3422         * modules/load.c (builtin_modules): Traverse the loaded module
3423         list with lt_dlhandle_next.
3424         (builtin_load): Much simplified in light of the reimplemented
3425         module loader.
3426         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
3427         light of the m4/module.c rewrite.
3428         (produce_symbol_dump): Ditto.
3429         (reload_frozen_state): Ditto.
3430         * m4/list.c, m4/list.h: Files deleted.  No longer required.
3431         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
3432         (libm4_la_SOURCES): Delete list.c reference.
3433         * m4/m4private.h (m4_token_data):  Add a handle field.  This
3434         eliminates many of the searches to find the handle associated with
3435         various tokens that are passed between functions.
3436         (struct m4_symbol):  Removed the module field.  The
3437         module association does not belong with the symbol...
3438         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
3439         that the module implementation code is from.  Added a handle
3440         field.
3441         (m4_push_macro): Add a `handle' argument.  Changed all callers.
3442         (init_macro_token):  Set the `handle' field for the
3443         m4_token_data.
3444         * m4/macro.c (expand_argument): Copy the new handle field during
3445         reassignment.
3446         * modules/m4.c (macro_install): Use the new handle field to
3447         optimise the search for the correct builtin structure, and pass
3448         the handle details to m4_builtin_define.
3450 2001-08-15  Akim Demaille  <akim@epita.fr>
3452         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
3453         when creating `m4/obstack.h'.
3454         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
3455         top_builddir.
3456         * tests/defs: Make them absolute.
3457         (CDPATH) Neutralize.
3458         * tests/gethem: Use them.
3460 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
3462         * config/ltmain.sh: Doh!  Import again for a quoting fix that
3463         prevented any regression test from passing.
3465         * m4/m4module.h (obstack.h): Choose between installed version
3466         and shipped version based on configure tests.
3467         * src/freeze.c (obstack.h): Ditto.
3469         * acconfig.h: Removed.  No longer required.
3471         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
3472         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
3473         them to AC_INIT and AM_INIT_AUTOMAKE.
3474         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
3475         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
3476         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
3477         shell variable m4_cv_func_obstack_h.
3478         * tests/defs (M4): Be more careful about relative path to libtool
3479         script and m4 binary by using $srcdir.
3481         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
3482         optargs to the existing libltdl search path.
3483         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
3484         * m4/ltdl.c: Updated.
3485         * m4/ltdl.h: Ditto.
3486         * config/ltmain.sh: Ditto.
3488 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
3490         * src/main.c (main): Add `-b' (for `batch') mode switch to force
3491         interactive mode off.
3493 2001-08-10  Akim Demaille  <akim@epita.fr>
3495         * configure.in: Require Autoconf 2.52.
3496         (AC_ARG_PROGRAM): Remove, handled by Automake.
3497         (m4_getopt): Rename as...
3498         (m4_getopt_h): this.
3499         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
3500         Undefine `changeword' only if defined.
3501         * config/gnu-obstack.m4: Require Autoconf 2.52.
3502         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
3503         Allow this token.
3505 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
3507         * doc/m4.texinfo: Fix some typos, and apply some small
3508         clarifications.
3510 2001-08-09  Andreas Schwab  <schwab@suse.de>
3512         * src/main.c (main): Fix improper uses of error (missing format
3513         string).
3515 2001-08-07  Akim Demaille  <akim@epita.fr>
3517         Improve `make distcheck'.
3519         * configure.in: Be sure to be able to run `mkconfig.sh' when src
3520         != build.
3521         * Makefile.am (dist-hook): Remove, as it is no longer needed.
3522         * doc/m4.texinfo (Include): Add missing blank.
3523         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
3524         obstack.c.
3526 2001-08-07  Akim Demaille  <akim@epita.fr>
3528         * m4/evalparse.c: A better introductory comment.
3529         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
3530         * m4/macro.c: Adjust old comments.
3531         * modules/README: Typo.
3533 2001-08-07  Akim Demaille  <akim@epita.fr>
3535         * config/gnu-obstack.m4: New.
3537 2001-08-07  Akim Demaille  <akim@epita.fr>
3539         * config/Makefile.am, config/stackovf.m4: New.
3540         * configure.in, Makefile.am: Adjust.
3542 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
3544         * modules/format.c (format):  Formatting for %f was not
3545         interpreting the position of the decimal point correctly for
3546         whole numbers.
3548 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
3550         * TODO:  Removed m4exit bug.
3551         * modules/load.c (m4_resident_module): Make this module resident.
3552         * module/m4.c (m4_resident_module): Ditto.
3553         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
3554         feature to mark modules as resident if they export
3555         `m4_resident_module' as TRUE.
3556         (m4_module_unload): Do not remove resident modules, and take care
3557         with symbol insertion and deletion with resident modules.
3558         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
3559         use resident modules feature.
3561 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
3563         * TODO: Updated.  Removed some cruft that has since been fixed
3564         or implemented.  Added some more entries.
3565         * NEWS: Updated.
3566         * README: Updated.
3567         * modules/README: Updated.
3568         * doc/m4.texinfo: Updated.
3570         * modules/gnu.c (builtin_functions): Make indir orthogonal to
3571         builtin, in that each is recognised as a macro only with parameters
3572         (builtin_indir): Passing 0 arguments is now an error, as with
3573         builtin.
3575         * src/main.c (usage): Added missing description of `-c' option.
3577 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
3579         Consolidate the myriad of dispersed test scripts into the
3580         tests subdirectory.  I think I now have all the file where I
3581         want them, so there shouldn't be anymore upheaval =)O|
3582         Honest!
3583         * tests/Makefile.am: Updated to run the new tests added below.
3584         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
3585         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
3586         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
3587         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
3588         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
3589         tests/other-tests/hanoi.test, tests/other-tests/include.test,
3590         tests/other-tests/indir.test, tests/other-tests/misc.test,
3591         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
3592         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
3593         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
3594         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
3595         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
3596         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
3597         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
3598         tests/other-tests/translit.test, tests/other-tests/undivert.test,
3599         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
3600         tests/other-tests/wrap.test:  New tests based on the contents
3601         of the tests removed below.
3602         * examples/Makefile.am, modules/Makefile.am:  Updated to
3603         reflect removed tests.
3604         * examples/defs,modules/defs: Removed.
3605         * examples/capitalize.test, examples/comments.test,
3606         examples/ddivert.test, examples/debug.test,
3607         examples/esyscmd.test, examples/exp.test,
3608         examples/foreach.test, examples/forloop.test,
3609         examples/fstab.test, examples/hanoi.test,
3610         examples/include.test, examples/indir.test,
3611         examples/misc.test, examples/multiquotes.test,
3612         examples/patsubst.test, examples/pushpop.test,
3613         examples/regexp.test, examples/reverse.test,
3614         examples/sysv-args.test, examples/trace.test,
3615         examples/translit.test, examples/undivert.test,
3616         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
3617         modules/modpath1.test, modules/modpath2.test,
3618         modules/modpath3.test, modules/modpath4.test,
3619         modules/modtest.test, modules/shadow.test,
3620         modules/unfrozen.m4, modules/unload.test: Removed.
3622         Move the implementation of GMP support for the mpeval() builtin
3623         into a loadable module that depends on libgmp.  mpeval() and
3624         eval() share a common parser, now in m4/evalparser.c; the code
3625         in m4/numb.c and m4/numb.h is now physically split between
3626         m4/eval.c (the eval() backend) and modules/mpeval.c (the
3627         mpeval() backend), rather than being differentiated by cpp
3628         macros and multiple inclusion.  The mpeval module is always
3629         built but will generate an diagnostic if it is used from an
3630         installation that didn't link in the gmp library.
3631         * modules/Makefile.am: build and install the new mpeval module.
3632         * modules/mpeval.c: Now contains the former parts of m4/numb.c
3633         and m4/numb.h that are required for gmp support in mpeval().
3634         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
3635         * m4/evalmp.c:  Removed.
3636         * m4/m4module.h: Removed conditional prototype for
3637         m4_mp_evaluate().
3638         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
3639         and m4/numb.h that do not rely on gmp.
3640         * m4/evalparse.c:  New file, contains the shared parts of the
3641         eval() and evalmp() parser implementations, and is no longer
3642         unencumbered by cpp magic to uncover the right parts.
3643         * m4/numb.h:  Removed.  It's former contents are split between
3644         m4/eval.c and modules/mpeval.c.
3645         * m4/numb.c: ditto.
3647         * tests/other-tests/changeword.test: New test.  Rudimentary
3648         testing of changeword builtin runs only if --wnable-changeword
3649         was used at configure time.
3650         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
3651         alternation correctly.  Split into two expressions to compensate.
3652         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
3653         * modules/Makefile.am: Build changeword module.
3654         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
3655         only when --enable-changeword was passed to configure.
3656         (builtin_changeword): If --enable-changeword was not used, then
3657         report that changeword() builtin has no support in m4 binary.
3659 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
3661         * src/main.c (main): Fixed a particularly nasty bug is
3662         user_search_path setting -- the -M flag processing must be
3663         extremely careful with search path ordering, or else the default
3664         installed module directory (possibly containing modules from a
3665         previous release) is placed earlier in the search path than any -M
3666         arguments (which are relied upon to load uninstalled modules with
3667         most of the tests in the regresion suite).
3669         * modules/load.c (builtin_load):  Nasty hack to prevent adding
3670         symbols to symtab again if a module is loaded more than once.
3671         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
3673         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
3674         possible NULL pointer dereference.
3676         * m4/module.c (m4_module_find_by_modname): Renamed from
3677         m4_module_modname_find.   Fixed all references.
3678         (m4_module_find_by_builtin):  New function.
3680         * modules/modfreeze.test: load the `load' module with each
3681         invocation.
3682         * src/freeze.c (produce_frozen_state): Simplified in light of
3683         module field in m4_symbol.  Allow a third argument for text macros
3684         to name the originating module.
3685         (reload_frozen_state): ditto.
3686         * m4/m4module.h:  Fixup prototypes.
3687         * m4/builtin.h (m4_builtin_define): Add a module argument so
3688         that symbols can be registered against the defining module.
3689         (m4_macro_define): ditto.
3690         * m4/m4private.h (m4_symbol): Make the module field const to save
3691         on casting in the rest of the code.
3692         (SYMBOL_MODULE): New macro.
3694         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
3695         symbol reference maintenance bugs when removing a symbol from the
3696         symtab.
3698         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
3700 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
3702         * configure.in (m4_cv_func_obstack): A better check for whether
3703         libc has an obstack implementation.
3704         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
3706         * configure.in (--with-modules): Changed semantics.  This
3707         option is now used to list modules to be preopened.
3708         * src/m4.h: #include "ltdl.h" unconditionally.
3709         * src/main.c: Removed all dependencies on WITH_MODULES.
3710         * src/freeze.c: ditto.
3711         * modules/Makefile.am: ditto.
3712         * m4/m4.c (builtin_m4exit): ditto.
3713         * modules/modpath1.test: ditto.
3714         * modules/modpath2.test: ditto.
3715         * modules/modpath3.test: ditto.
3716         * modules/modpath4.test: ditto.
3717         * modules/modtest.test: ditto.
3718         * modules/shadow.test: ditto.
3719         * modules/unload.test: ditto.
3721         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
3722         comes up on demand in LTLIBOBJS now.
3723         * configure.in (getopt_long):  Creating and relying on a link for
3724         getopt.h on hosts with no getopt_long() of thier own works
3725         correctly now.  This is necessary so that callers of getopt_long()
3726         can simply `#include <getopt.h>': the naive way of doing this
3727         would end up using our own getopt.h and the installed
3728         getopt_long(), which is asking for trouble!
3729         (obstack_init): A similar argument applies to obstack.h and
3730         obstack_init().
3732         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
3733         On Solaris-2.5 (at least) the native dlopen implementation
3734         gets confused about m4.o when looking for module "m4".  This
3735         version always looks for .la an .$lib_ext suffixed names first
3736         to work around the problem.  Sigh.
3738         * po/POTFILES.in: Take account of these file movements.
3739         * src/Makefile.am (m4_SOURCES): removed eval.c.
3740         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
3741         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
3742         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
3743         * modules/m4.c (builtin_eval): Use m4_evaluate().
3744         * m4/eval.c: Moved here from src/eval.c to facilitate
3745         implementation of eval() builtin as part of the `m4' loadable
3746         module.
3747         (m4_evaluate): renamed from evaluate for namespace cleanliness.
3748         * m4/numb.c: Moved here from src/numb.c, since it is #included
3749         into eval.c at compile time.
3750         * m4/m4module.h (m4_evaluate): Added prototype.
3751         * src/m4.h (evaluate): Removed prototype.
3753 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
3755         * modules/perl.c (builtin_perleval):  Use PL_na for
3756         compatibility with perl-5.6.
3758         * src/main.c (main):  It is now safe to
3759         ``m4_module_install("m4")'', without tripping over the m4
3760         binary itself!
3761         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
3762         versions having fixed the insidious module search order bug.
3764         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
3765         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
3767         * configure.in: Figure out whether to use the installed
3768         getopt.h or the supplied one.
3769         * src/Makefile.am: ditto.
3771         * po/POTFILES.in: List files in their new positions.
3773         * config/ltmain.sh:  This needs to be checked in to match the
3774         libtool macros copied to acinclude.m4 (until a released
3775         libtool copes with m4's needs).
3776         * bootstrap:  Run gettextize.
3778 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
3780         * AUTHORS:  Added my details.
3781         * TODO: updated.
3782         * NEWS: updated.
3783         * bootstrap: temporary update until released libtool catches up.
3785         * All files:  Use new GNU GPL copyright blurb with current contact
3786         address.
3788         * configure.in (LTLIBOBJS): Use canonical code for calculation of
3789         this variable.
3791         * config: renamed acm4 directory to config to be more like
3792         other autoconfiscated packages.
3794         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
3795         * config/debug.m4:  New file implementing configure macros to add
3796         suitable debug flags to the compiler invocation.
3798         * modules/load.c:  New file implementing the ``load'' and
3799         ``unload'' builtins.
3800         * tests/get-them:  Set the module search directory to the modules
3801         build directory in generated tests.
3802         * modules/shadow.test: ditto.
3803         * modules/modtest.test: ditto.
3804         * modules/modpath1.test: ditto.
3805         * modules/modpath2.test: ditto.
3806         * modules/modpath3.test: ditto.
3807         * modules/modpath4.test: ditto.
3808         * modules/modtest.test: ditto.
3809         * modules/modfreeze.test: ditto.
3810         * modules/unload.test: ditto.
3812         * modules/changeword.c:  New file implementing the ``changeword''
3813         builtin as a loadable module.
3814         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
3815         as a loadable module.
3817         * src/main.c (main):  Load the gnu module if m4 was started
3818         normally -- i.e. without the -G option.
3819         * modules/gnu.c:  New file implementing a new loadable module wuth
3820         definitions for all the gnu extension builtins.
3821         * modules/format.c:  Moved here from src/format.c.  Now included
3822         directly by gnu.c.
3824         * src/main.c (main):  Load the traditional module if m4 was
3825         started in `no_gnu_extensions' mode.
3826         * modules/traditional.c:  New file implementing the ``unix'' macro,
3827         required when m4 is executed in traditional mode, as a loadable
3828         module.
3830         * src/main.c:  Renamed from m4.c to avoid confusion with
3831         modules/m4.c.
3832         (main):  Always load the m4 module.
3833         * modules/m4.c:  New file implementing a new loadable module with
3834         definitions for all m4 builtins that are not gnu extensions.
3836         * m4/Makefile.am:  Adjusted to take new files below into account.
3837         * m4/m4module.h: Prototypes for exported functions and types moved
3838         to this directory from the src directory.
3839         * m4/m4private.h: Moved here from src/m4private.h to facilitate
3840         the migration of all builtin implementations to loadable modules.
3841         * m4/macro.c: Moved this file here from the src directory,
3842         renaming all exported symbols to use the prefix ``m4_''.
3843         * m4/builtin.c: ditto.
3844         * m4/module.c: ditto.
3845         * m4/symtab.c: ditto.
3846         * m4/debug.c: ditto.
3847         * m4/input.c: ditto.
3848         * m4/output.c: ditto.
3849         * m4/path.c: ditto.
3850         * m4/ltdl.h, m4/ltdl.c: ditto.
3851         * m4/utility.c: Odd functions moved here from files in the src
3852         directory to facilitate builtin migration.
3854 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
3856         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
3857         error message, to make translators' jobs a little easier.
3858         (builtin_builtin): ditto.
3859         (builtin_traceon): ditto.
3860         (builtin_traceoff): ditto.
3861         Reported by Akim Demaille <akim@epita.fr>
3863         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
3864         pkgincludedir instead.
3866         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
3867         it is exported globally.  Fixed all references.
3868         (lquote): ditto.
3869         (bcomm): ditto.
3870         (ecomm): ditto.
3871         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
3872         globally.  Fixed all references.
3873         (DEF_LQUOTE): ditto.
3874         (DEF_BCOMM): ditto.
3875         (DEF_ECOMM): ditto.
3877 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
3879         * NEWS: updated.
3880         * TODO: updated.
3882         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
3883         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
3885         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
3886         Removed `Prev', `Next' and `Up' fields of all @nodes now that
3887         makeinfo calculates them for us, and to make any future
3888         reorganisation easier.
3889         (Frozen files): Document format version 2.
3890         `V' now takes argument `2'.
3891         `F' can take a single argument if symbol and builtin names
3892         are the same, or 3 arguments if the builtin is from a module.
3893         New `S' specification for saving syntax table contents.
3894         New `M' specification for saving loaded module names.
3895         * src/freeze.c: Implement them.
3896         * src/input.c (syntax_code): For interpreting frozen syntax
3897         state.
3899         * examples/Makefile.am:  Add the contents of the WWW directory to
3900         the distribution.
3901         * examples/WWW/Makefile:  ditto,
3902         (%.htm): Compares file contents (not just sizes) to determine
3903         whether a change has occured.
3904         * examples/WWW/_header.htm: Bumped version number.
3905         * examples/WWW: Regenerated content.
3907         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
3908         compilers comes much easier without ansi2knr.
3909         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
3911         * m4/list.c: New generic list container type.
3912         * m4/list.h: Interface to new container type.
3913         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
3914         (libm4_la_SOURCES): compile and link list.c.
3915         * src/builtin.c (builtin_tables): Use list container.
3916         * src/module.c (symtab): ditto.
3917         * src/symtab.c (symtab): ditto.
3919         * m4/system.h: New file for common preprocessor definitions.
3920         * m4/Makefile.am (pkginc_HEADERS): install system.h.
3921         * m4/error.c: Use system.h in place of inline preprocessor.
3922         * m4/error.h: ditto.
3923         * m4/module.c: ditto.
3924         * m4/module.h: ditto.
3925         * m4/xmalloc.c: ditto.
3927         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
3928         compatibility.
3929         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
3931         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
3932         it is exported globally.  Fixed all references.
3933         (builtin): ditto.
3934         (module_init_t): ditto.
3935         (module_finish_t): ditto.
3936         (token_data): ditto.
3937         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
3938         it is exported globally.  Fixed all references.
3939         (SYNTAX_IGNORE): ditto.
3940         (SYNTAX_SPACE): ditto.
3941         (SYNTAX_OPEN): ditto.
3942         (SYNTAX_CLOSE): ditto.
3943         (SYNTAX_COMMA): ditto.
3944         (SYNTAX_DOLLAR): ditto.
3945         (SYNTAX_ACTIVE): ditto.
3946         (SYNTAX_ESCAPE): ditto.
3947         (SYNTAX_ALPHA): ditto.
3948         (SYNTAX_NUM): ditto.
3949         (SYNTAX_ALNUM): ditto.
3950         (SYNTAX_LQUOTE): ditto.
3951         (SYNTAX_RQUOTE): ditto.
3952         (SYNTAX_BCOMM): ditto.
3953         (SYNTAX_ECOMM): ditto.
3954         (SYNTAX_VALUE): ditto.
3955         (SYNTAX_MASKS): ditto.
3956         (IS_OTHER): ditto.
3957         (IS_IGNORE): ditto.
3958         (IS_SPACE): ditto.
3959         (IS_OPEN): ditto.
3960         (IS_CLOSE): ditto.
3961         (IS_COMMA): ditto.
3962         (IS_DOLLAR): ditto.
3963         (IS_ACTIVE): ditto.
3964         (IS_ESCAPE): ditto.
3965         (IS_ALPHA): ditto.
3966         (IS_NUM): ditto.
3967         (IS_ALNUM): ditto.
3968         (IS_LQUOTE): ditto.
3969         (IS_RQUOTE): ditto.
3970         (IS_BCOMM): ditto.
3971         (IS_ECOMM): ditto.
3972         (TOKEN_EOF): ditto.
3973         (TOKEN_NONE): ditto.
3974         (TOKEN_STRING): ditto.
3975         (TOKEN_SPACE): ditto.
3976         (TOKEN_WORD): ditto.
3977         (TOKEN_SIMPLE): ditto.
3978         (TOKEN_MACDEF): ditto.
3980         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
3981         consistency.  Fixed all references.
3982         (STRING): Renamed to `m4_string' for consistency, and because if
3983         is exported globally.  Fixed all references.
3984         (token_type): Renamed to `m4_token_t' for the same reasons.
3985         (token_data_type): Renamed to `m4_token_data_t' for the same
3986         reasons.
3988         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
3989         sizes.
3990         (XMALLOC): ditto.
3991         (XREALLOC): ditto.
3992         (XFREE): Wrapper macro which avoids freeing NULL pointers.
3994         * m4/m4module.h (m4_macro):  New type for module defined user
3995         macros.
3996         * modules/modtest.c (m4_macro_table):  Define module user macros.
3997         * modules/shadow.c (m4_macro_table):  ditto.
3999         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
4000         declared with M4BUILTIN.
4002         * m4/xmalloc.c: Use memset if bzero is not available when
4003         emulating calloc with malloc.
4004         (xcalloc): Fallback to malloc/bzero if calloc is not available.
4005         (xfree): Added for consistency.  Will not try to free NULL
4006         pointers.
4007         * src/m4.c (xfree):  Deleted in favour of the above.
4008         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
4009         linking with libdmalloc.
4010         * m4/xstrdup.c (WITH_DMALLOC): ditto.
4012         * modules/frozen.m4:  New test case.
4013         * modules/unfrozen.m4:  ditto.
4014         * modules/modfreeze.test:  New test.
4015         * modules/unload.test:  ditto.
4016         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
4017         (TESTS): Use them.
4018         * modules/modpath1.test:  Don't try this test if module support is
4019         not compiled in.
4020         * modules/modpath2.test: ditto.
4021         * modules/modpath3.test: ditto.
4022         * modules/modpath4.test: ditto.
4023         * modules/modtest.test: ditto.
4024         * modules/shadow.test: ditto.
4026         * modules/perl.c: New module.
4027         * modules/perl.m4: Example of using it.
4028         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
4030         * src/m4.c (main): Assume interactive mode if STDIN is connected
4031         to a tty.
4032         Changed startup sequence slightly so that syntax is not
4033         initialised from here when loading a frozen file.
4035         * src/builtin.c:  Much improved macro definition style.
4036         * src/m4private.h:  Internal structures for m4_builtin and
4037         m4_macro instances.  These are not exposed to module writers.
4038         * src/module.c (module_modname_find):  Find a module structure
4039         from the its name.
4040         (make_macro_table):  Build an internal macro table from a external
4041         definition.
4042         (make_builtin_table):  Build an internal builtin table from an
4043         external definition.
4045         * src/module.c (module_unload): Be extremely careful to remove
4046         builtins and macros that match the module being unloaded -- no
4047         longer assume that the top element can be removed incase another
4048         odule defines an identical name.
4049         * src/symtab.c (remove_table_reference_symbols): remove all symbol
4050         table entries which refer to a given builtin table.
4051         * src/builtin.c (remove_tables): Use it!
4053 2000-07-13  Thomas Tanner  <tanner@ffii.org>
4055         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
4056         * acm4/modules.m4: deleted
4057         * bootstrap: don't libtoolize libltdl!
4058         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
4059         if set, enable WITH_MODULES and add modules to DLPREOPEN
4060         * examples/misc.test: redirect standard output
4061         * lib/Makefile.am: don't use DLLDFLAGS
4062         * lib/m4module.c: include necessary headers to silence GCC -Wall
4063         * lib/m4regex.c: fixes to silence GCC -Wall
4064         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
4065           build modules conditionally
4066         * modules/shadow.c: define symbol aliases before using them
4067         * modules/test.c: define symbol aliases before using them
4068         * po/de.po: update translation
4069         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
4070         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
4071         LIBLTDL to LIBS.
4072         * src/m4.c: initialize libltdl's preloaded symbols via
4073         LTDL_SET_PRELOADED_SYMBOLS
4074         * src/module.c: libltdl's memory management must be initialized
4075         before calling lt_dlinit!, fix warnings
4077 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
4079         * README:  Caveat about nls not supported by dll architecture on
4080         Windows.
4082         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
4084         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
4085         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
4086         * modules/Makefile.am (LIBS): ditto.
4087         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
4088         $(top_srcdir)/m4 (for only <m4module.h>).
4089         * modules/shadow.test: fixed for VPATH.
4090         * modules/modtest.test: ditto.
4091         * modules/modpath4.test: ditto.
4092         * modules/modpath3.test: ditto.
4093         * modules/modpath2.test: ditto.
4094         * modules/modpath1.test: ditto.
4096         * modules/time.test: Removed due to timezone dependence,
4097         * modules/Makefile.am (TESTS): Removed time.test.
4099         * configure.in: Use $3 of AC_DEFINE so that we can,,,
4100         * acconfig.h: Remove everything except the gettext parameters.
4101         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
4102         AC_DEFINE.
4103         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
4104         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
4105         increment serial number.
4107         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
4108         src dir and immediately after libm4 is built for confidence that
4109         it doesn't rely on the src directory.
4110         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
4111         makeinfo stop the build on cygwin (because they don't work).
4113         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
4115         * m4/m4private.h: ...is not a public header, so moved to src.
4116         Add `#include <config.h>', `#define _COMPILING_M4' and
4117         `#include "m4.h".
4118         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
4119         * src/Makefile.am (noinst_HEADERS): add m4private.h.
4120         * src/builtin.c: `#include "m4private.h"' now takes care of the
4121         above.  Duplicates removed.
4122         * src/debug.c: ditto.
4123         * src/eval.c: ditto.
4124         * src/evalmp.c: ditto.
4125         * src/format.c: ditto.
4126         * src/freeze.c: ditto.
4127         * src/input.c: ditto.
4128         * src/m4.c: ditto.
4129         * src/macro.c: ditto.
4130         * src/module.c: ditto.
4131         * src/numb.h: ditto.
4132         * src/output.c: ditto.
4133         * src/path.c: ditto.
4134         * stackovf.c: ditto.
4135         * symtab.c: ditto.
4137         * po/POTFILES.in: compensate for renaming of lib/*.
4138         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
4139         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
4140         and then in $(top_srcdir)/lib (for eg. "m4private.h").
4141         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
4142         m4/libm4.la.
4143         * m4/m4error.h:  Renamed error.h, for installation to
4144         $prefix/include/m4..
4145         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
4146         * m4/m4regex.h: Renamed regex.h, for same reason.
4147         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
4148         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
4149         * m4/m4regex.c: Renamed regex.c, and fix #includes.
4151         * lib: moved to m4 to easily support header installation to
4152         $prefix/include/m4.
4153         * Makefile.am (SUBDIRS): renamed lib dir to m4.
4154         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
4155         * acm4/regex.m4: Point to m4/regex.c.
4157         * examples/foreach.m4:  Sanitise quoting.
4158         * examples/foreach.test:  New torture test.
4159         From Akim Demaille <akim@epita.fr>
4161 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
4163         * src/ltdl.c: Use access() to abort doomed module load attempts
4164         if module file does not exist.
4166         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
4167         getopt1.o will already be used if appropriate, so I moved getopt.c
4168         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
4170         * modules/modpath1.test: Use correct filename in header line.
4171         * modules/modpath2.test: ditto.
4172         * modules/modpath3.test: ditto.
4173         * modules/modpath4.test: ditto.
4175         Without these changes lt_dlopen("test") attempts to
4176         LoadLibrary("/bin/test") on Windows, which although harmless
4177         generates a spurious error message which spoils most of the tests:
4178         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
4179         (TESTS): s/test.test /modtest.test /
4180         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
4181         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
4182         * modules/modpath1.test: s/test.m4 /modtest.m4 /
4183         * modules/modpath2.test: ditto.
4184         * modules/modpath4.test: ditto.
4185         * modules/modpath3.test: s/-m test /-m modtest /
4186         * modules/shadow.m4: use {un,}loadmodule(`modtest').
4188 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
4190         * src/ltdl.c (find_file): Updated to new version with fixed memory
4191         allocation bug in `next'.
4192         * src/ltdl.h: updated to match.
4194         * modules/Makefile.am:  Cleaned up and reordered.
4196 2000-01-16  René Seindal  <rene@seindal.dk>
4198         * modules/Makefile.am (TESTS): New tests for the module system.
4200         * modules/*.test: New files.
4202         * src/m4.c (main): Added call to module_init().
4203         Treats -M and -m as the arguments -D -U and -t, ie deferred.
4205         * src/m4.h: Added declaration of module_init().
4207         * src/module.c (module_init): No longer static
4209         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
4210         Added to shut up automake about non standard libtool library
4211         names.
4213         * src/module.c: Disabled DEBUG by default.
4215         * modules/README: Changed example from unload.m4 to shadow.m4
4217         * modules/shadow.m4: Renamed from unload.m4
4219         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
4221         * src/m4.c (main): Functionality for -m and -M were reversed.
4222         Fixed.
4224 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
4226         * doc/help2man.pl: updated to version 1.020.
4228         * lib/COPYING.LIB:  updated to version 2.1.
4230         * lib/m4module.h: restructure the M4_SCOPE code to work when
4231         creating a dll which links with libm4.la and both DLL_EXPORT
4232         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
4233         both defined.
4235 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
4237         Merged the following changes from my tree:
4239         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
4241         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
4242         ported to compile shared libs.
4244         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
4245         use `__declspec(dllimport)' when linking libm4.la on win32.
4246         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
4248         * configure.in (M4OBJS): Discover whether we need the shipped
4249         implementation of getopt_long.
4250         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
4251         main binary here, as opposed to the module library in lib/libm4.la.
4253         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
4255         * modules/README: Updated to describe the improved libltdl based
4256         module scheme.
4257         * README (cygwin): Added some compilation notes for building m4
4258         correctly under cygwin.
4259         * TODO: Cleaned out the entries for the module system since they
4260         are now implemented.
4262         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
4263         all instances of __P with M4_PARAMS.
4265         * lib/getdate.h: removed unreferenced file.
4267         * lib/m4private.h: New file to define the private interface to the
4268         token_data struct, which must be shared between m4module.c, and
4269         builtin.c but not exported to modules built from the installed
4270         m4module.h since it's size changes depending on compile time
4271         options.
4273         * src/m4.h: Lots of stuff moved to lib/m4module.h.
4275         * lib/m4module.h: New file to define the interface available when
4276         compiling m4 modules.
4277         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
4278         necessary for module compilation into this new file.
4280         * lib/Makefile.am (include_HEADERS): install headers (renamed to
4281         avoid nameclash with other system headers) necessary for compiling
4282         modules.
4283         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
4284         so that modules can include the (renamed) installed headers and
4285         be guaranteed a matching implementation.
4286         * lib/m4error.h: renamed from error.h.
4287         * lib/m4obstack.h: renamed from obstack.h.
4288         * lib/m4regex.h: renamed from regex.h.
4289         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
4290         implementation, simply include the shipped version
4291         unconditionally, otherwise it is hard for a module to know
4292         whether the m4obstack.h header it is using matches the
4293         implementation it ends up linking against.
4294         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
4295         the same reason.
4297         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
4299         * examples/misc.test: Don't run this test on machines which don't
4300         have a root user in /etc/passwd (e.g. cygwin).
4302         * tests/get-them (/^@example$/): Error messages might have a
4303         ``.exe'' suffix to the program name, or else use the libtool
4304         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
4305         of these cases are now catered for when comparing error messages
4306         in generated tests.
4307         * tests/other-tests/*.test: ditto.
4308         * examples/*.test: ditto.
4310         * tests/defs (M4): use libtool execute mode.
4311         * examples/defs (M4): ditto.
4313         * tests/get-them (END): explicitly close any open file.
4314         (printthem): In a regular expression, '{' is the start of a repeat
4315         count!  Use `[{]' for a literal open brace.
4316         (/^@node /): Don't use substr on a string shorter than the trim
4317         length.
4319         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
4321         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
4322         substituted.
4323         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
4325 2000-01-10  Andreas Schwab  <schwab@suse.de>
4327         * tests/other-tests/gmp.test: Find config.sh in build directory.
4329         * configure.in: Find tests/mkconfig.sh in $srcdir.
4331         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
4332         <signal.h> (for SUS2 compliant systems).
4334         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
4335         HAVE_SIGINFO_H.
4337 2000-01-10  René Seindal  <rene@seindal.dk>
4339         * Prerelease 1.4o.
4341         * TODO, NEWS: Cleaned up and updated.
4343         * src/m4.c (main): New variable exit_status for exit status in
4344         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
4345         file cannot be read instead of EXIT_SUCCESS.
4347         * src/builtin.c (m4_indir): Changed error message to help
4348         translators (from Akim Demaille <demaille@inf.enst.fr>).
4350         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
4351         Cygnus.
4353         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
4354         from glic 2.1.2.
4356         * src/input.c (match_input): Reordering of code, to avoid multiple
4357         calls to push_string_init() from obstack_grow(), which can happen
4358         with some compilers (found and fixed by James Bonfield
4359         <jkb@mrc-lmb.cam.ac.uk>).
4361         * src/stackovf.c: Added prototypes for ultrix.
4362         (setup_stackovf_trap): Added __P to cast.
4363         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
4365 2000-01-09  René Seindal  <rene@seindal.dk>
4367         * doc/m4.texinfo (Changequote): Added comment about changing
4368         quotes when the old quote is a part of the new.
4370         * src/builtin.c (expand_ranges): Added break after trailing dash.
4371         This caused misbehavious on some systems (found and fixed by Akim
4372         Demaille <demaille@inf.enst.fr>).
4374         * AUTHORS: Thomas Tanner included
4376         * acconfig.h: Added entry for ss_sp (see below).
4378         * configure.in (use_stackovf): Added check for stack_t with member
4379         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
4380         <eggert@twinsun.com>).
4382         * doc/m4.texinfo (Frozen files): Added a simpler example for
4383         generating frozen files from several input files.
4385 1999-11-14  Paul Eggert  <eggert@twinsun.com>
4387         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
4388         lib/regex.c, lib/xmalloc.c.
4390 1999-11-10  René Seindal  <rene@seindal.dk>
4392         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
4394         * src/module.c: reindented.
4395         (module_load): return if this is a repeated load of same module.
4396         (module_init): slight change of logic to avoid repeated
4397         initialisation debug messages.
4399         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
4400         in the distribution.
4402         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
4403         automake warnings about missing lib prefix.
4404         (time_la_LDFLAGS): ditto
4405         (stdlib_la_LDFLAGS): ditto
4407 1999-11-10  Paul Eggert  <eggert@twinsun.com>
4409         * src/m4.h: Include error.h, since our macros use error.
4410         * src/m4.c: Don't need to include error.h.
4412 1999-11-09  Paul Eggert  <eggert@twinsun.com>
4414         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
4415         and zero, as Solaris 7 cc does.
4416         (bcopy): Remove macro; no longer needed with new obstack.h.
4418         * src/output.c (freeze_diversions): Don't assume that a
4419         diversion size can fit in `int'.  Check for diversion file
4420         size too large to be printed with `unsigned long'.
4422         * src/Makefile.am (CFLAGS): Omit -Wall.
4424         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
4426         * src/debug.c (trace_format):
4427         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
4429         * src/freeze.c (produce_frozen_state):
4430         Don't assume string lengths fit in int.
4432 1999-10-13  René Seindal  <rene@seindal.dk>
4434         * configure.in (ALL_LINGUAS): Added Greek translation (el).
4435         (ALL_LINGUAS): Added Czech translation (cs).
4437 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
4439         * src/builtin.c: moved module loading functions into...
4440         * src/module.c: entirely new implementation using libltdl.
4441         * po/POTFILES.in: added src/module.c.
4442         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
4443         are modules, not linktime libraries.
4444         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
4445         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
4446         avoidance on exported symbols.
4447         * modules/test.c (m4_macro_table, m4_init_module,
4448         m4_finish_module): ditto.
4449         * modules/time.c (m4_macro_table): ditto.
4451         * modules/time2.m4: new file which requires command line loading
4452         of modules.
4453         * src/m4.c (--load-module): dynamically load named runtime module
4454         into running executable before reading the source.
4455         (--module-directory): prepend a directory to the module search
4456         path.
4457         (module_init()): Do this the first time we load a module instead;
4458         if the module subsystem is broken normal m4 scripts can still run.
4459         * src/m4.h (install_builtin_table): is now exported.
4461 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
4463         * src/module.c: removed.  No longer required.
4464         * po/POTFILES.in: removed src/module.c.
4466         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
4467         the bootstrap script can recreate.
4468         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
4469         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
4470         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
4471         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
4472         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
4473         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
4474         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
4475         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
4477         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
4478         better.
4479         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
4480         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
4481         the installed gettext.m4 file when running aclocal.
4483 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
4485         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
4486         distinguish this from the last prerelease.
4487         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
4488         in its own subdirectory.
4490         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
4491         lib prefix on a module" feature.
4492         (LDFLAGS): Added `-module -avoid-version' flags to build
4493         versionless module libraries.
4494         * src/builtin.c (m4_load_module): use libltdl.
4495         (module_unload_all): use libltdl.
4496         * src/m4.c (module_init): initialise module loading on demand for
4497         better diagnostics, and so that m4 will still work even if
4498         the module code is broken.
4499         * src/m4.h (module_init): removed.  No longer relevant.
4500         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
4501         exported symbols for compatibility with dlpreopening.
4502         * modules/test.c (m4_macro_table, m4_init_module,
4503         m4_finish_module): ditto.
4504         * modules/time.c (m4_macro_table): ditto.
4506         * bootstrap: New file.  Runs all the autoutils in the right order
4507         after a fresh checkout, or a make maintainer-clean.
4509 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
4511         * src/builtin.c (dump_symbols): New function, factoring common
4512         content of m4_dumpdef and m4_symbols.
4513         (m4_dumpdef): Use it.
4514         (m4_symbols): New function, implementing `symbols'.  Use it.
4515         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
4516         file compile with modern makeinfo.
4517         (Symbols): New node, documenting symbols.
4518         (direntry): Modernize.
4520 1998-12-11  René Seindal  <rene@seindal.dk>
4522         * src/builtin.c (predefined_tab): New predefined macros
4523         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
4524         configure time options.
4526 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
4528         * src/module.c (module_try_load): Don't try to be clever and
4529         overwrite argument string.  Instead allocate all constructed
4530         strings locally, since they can have arbitrary lengths.  Make
4531         arguments pointers to const.
4532         (module_search): Simplify due to above change.
4534 1998-11-29  René Seindal  <rene@seindal.dk>
4536         * Prerelease 1.4n.
4538         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
4540         * tests/other-tests/import-environment.{m4,test}: New test.
4542         * tests/other-tests/discard-comments.{m4,test}: New test.
4544         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
4546         * src/m4.c (main): New option -c --discard-comments.
4547         New global variable discard_comments.
4549         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
4550         discarded, ie never returned from next_token().
4551         Added declaration of discard_comments.
4553         * src/input.c (next_token): Now loops until token type is not
4554         TOKEN_NONE.  Comments are now given this type when comments should
4555         be discarded.
4557         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
4558         and mpeval.
4560 1998-11-28  René Seindal  <rene@seindal.dk>
4562         * src/m4.c (main): New option --import-environment (no single
4563         letter option).
4565         * When configured with --with-gmp both the normal (fast) eval()
4566         and the gmp aware mpeval() are defined.  To restore previous
4567         bahaviour use "define(`eval', defn(`mpeval'))".
4569         * tests/other-tests/gmp.m4: Changed to use mpeval().
4571         * src/evalmp.c: New file for compiling eval.c as gmp aware.
4572         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
4574         * src/eval.c: Now includes "numb.c" directly.  Everything in this
4575         file must by static, except evaluate(), which is changed to
4576         mp_evaluate() if USE_GMP in force.
4578         * src/numb.c: Changed to be included by eval.c instead of being
4579         compiled separately.  Everything is declared static.
4581         * src/numb.h: Removed declarations of functions, as numb.c is now
4582         included by eval.c.
4584         * src/builtin.c: Declaration of m4_mpeval() added.
4585         Inserted `mpeval' in builtin table.
4586         (do_eval): New function with common code for m4_eval and m4_mpeval.
4587         (m4_mpeval): New function for gmp version of eval.
4589         * src/m4.h: Declaration of mp_evaluate().
4591         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
4592         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
4594         * src/m4.c (main): m4 --version also shows which options were used
4595         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
4597 1998-11-27  René Seindal  <rene@seindal.dk>
4599         * Error messages now always print program name before input file
4600         name as specified by GNU coding standards.  Reported by Akim
4601         Demaille <demaille@inf.enst.fr>.
4603         * doc/m4.texinfo (Include): Change due to changed error message
4604         format.
4605         (Eval): Do.
4607         * tests/get-them: Minor change to sed script due to changed error
4608         message format.
4610         * src/m4.c (print_program_name): New func used to print program
4611         name, input file and line number in error ().  Used as an
4612         error_print_progname handler.
4613         (reference_error): Removed.
4614         (main): Assigns error_print_progname.
4616         * src/m4.h (M4ERROR): Removed reference_error ().
4618 1998-11-25  René Seindal  <rene@seindal.dk>
4620         * Updated to libtool 1.2b.
4622         * src/builtin.c (install_builtin_table): Added braces to avoid
4623         warning of ambiguous 'else'.
4625         * src/module.c: Inserted search path code from path.c modified to
4626         use new interface.
4627         (module_init): Configured default path used only if M4MODPATH is
4628         not set.
4629         (module_try_load): Now reads libMODULE.la as generated by libtool
4630         for actual module name.
4631         (module_load): Gives better error messages on failure.
4633         * src/m4.h: Added declarations of structures and functions for
4634         generic search path handling.
4636         * src/path.c: Removed all module specific code and introduced new
4637         functions of more generic search path handling.
4639 1998-11-24  René Seindal  <rene@seindal.dk>
4641         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
4642         included gettext, as <libintl.h> might not be found
4643         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
4645 1998-11-22  René Seindal  <rene@seindal.dk>
4647         * src/output.c (insert_diversion): Fixed bug that might cause m4
4648         to read from standard output!  Triggered by input
4649         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
4650         so now 'undivert(0)' does nothing.
4652 1998-11-18  René Seindal  <rene@seindal.dk>
4654         * Prerelease 1.4m.
4656         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
4657         could be changed when compiling a illegal regexp, causing later
4658         use of the regexp to dump core.
4660         * src/module.c (module_load): Changed error message to conform to
4661         standards.
4663         * src/m4.c (usage): Added message about reporting bugs.
4665         * doc/m4.texinfo (Changeword): Corrected a wrong example.
4666         (Changeword): Added note about the type of regexps used.
4668         * ltconfig, ltmain.sh: New files from Libtool 1.2.
4670         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
4671         and AM_PROG_LIBTOOL.
4673         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
4674         with libtool.
4676         * modules/Makefile.am: Changed completely to compile modules using
4677         libtool.  The modules are compiled as shared libraries, and are
4678         renamed when installed.
4680         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
4681         USE_SHL_LOAD to HAVE_SHL_LOAD
4683         * src/builtin.c (shipout_string): Now tests for a NULL string.
4685         * src/module.c: New level of indirection around non-portable
4686         functions to load shared objects.  Intended to encapsulate the non
4687         portable parts better and to reduce the number of #ifdefs in the
4688         code.
4690         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
4691         directory modules/ to the distribution.
4693 1998-11-15  René Seindal  <rene@seindal.dk>
4695         * Prerelease 1.4l.
4697         * modules/stdlib.c: New module `stdlib' defining some standard
4698         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
4699         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
4701         * src/builtin.c (shipout_string): New convenience function for
4702         builtins and modules.
4704         * src/module.c (module_load): Tentative support for
4705         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
4707         * Makefile.am (SUBDIRS): Directory modules added if configured.
4709         * modules/Makefile.am: Now correctly compiles and installs
4710         modules in pkglibexecdir.
4712         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
4713         These two are now initialised by autoconf macros.
4715         * src/path.c (module_env_init): MODULE_PATH is always on the
4716         search path.
4718         * src/Makefile.am: Now generated pathconf.h which defined the
4719         default MODULE_PATH.
4721         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
4722         where modules are installed.
4724         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
4725         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
4726         build and install automatically, and it is prepared for other
4727         interfacec than dlopen().
4729         * src/builtin.c (predefined_tab): Added __m4_version__ for the
4730         current version of GNU m4.  It is a GNU extension.
4732 1998-11-14  René Seindal  <rene@seindal.dk>
4734         * tests/Makefile.am (GENERATED_TESTS): Added new
4735         generated-tests/changesy.8.test
4737         * doc/m4.texinfo (Changesyntax): Documentation for escape
4738         syntax class.
4740         * src/macro.c (expand_token): Check for escaped macro call before
4741         symbol table lookup.
4743         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
4744         characters
4746         * src/input.c: New static variable use_macro_escape, which is TRUE
4747         iff some character has code SYNTAX_ESCAPE
4748         (input_init): Added initialisation of use_macro_escape.
4749         (check_use_macro_escape): New function to synchronise
4750         use_macro_escape with the syntax table.
4751         (set_quotes): Added call to check_use_macro_escape()
4752         (set_comment): Do.
4753         (set_syntax): Do.
4754         (next_token): Added new case for IS_ESCAPE.
4756         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
4758 1998-10-13  René Seindal  <rene@seindal.dk>
4760         * Prerelease 1.4k.
4762         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
4763         generated-tests.
4765         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
4766         maintained tests in tests/other-tests.  These currently tests for
4767         8-bit transparency, multiple precision arithmetic and sync-line
4768         output.  Test for stackoverflow detection does not work.
4770         * examples/Makefile.am (TESTS): Added tests for all example files.
4772         * examples/mktests.sh: New file.  Help program for creating test
4773         files.
4775         * tests/mkconfig.sh: New file to generate tests/config.m4 and
4776         tests/config.sh.  This is for tests of configure selectable
4777         features.  Picks up all set WITH_ and ENABLE_ veriables from
4778         config.h
4780         * src/path.c (path_search): Added argument 'char **expanded_name'
4781         to return the expanded name.
4783         * src/m4.h: Added 2nd argument to declaration of path_search().
4785         * src/m4.c (main): Added 2nd argument to path_search().
4787         * src/freeze.c (reload_frozen_state): Do.
4789         * src/builtin.c (m4_undivert): Do.
4790         (include): Do.
4792 1998-10-11  René Seindal  <rene@seindal.dk>
4794         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
4796         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
4798         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
4800         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
4802         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
4804         * intl/: Updated to GNU gettext 0.10.35.
4806         * doc/m4.texinfo (Format): Documented that format is blind.
4808         * src/builtin.c (builtin_tab): Builtin format marked as blind.
4810 1998-10-07  René Seindal  <rene@seindal.dk>
4812         * Prerelease 1.4j.
4814         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
4815         .test, as the files are no longer just m4 input.
4817         * tests/get-them (FILE): Changed .m4 extension to .test.
4819         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
4820         Otherwise quoted strings with leading whitespace first in a macro
4821         argument would be eliminated.
4823         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
4824         (expand_argument): Do.
4826         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
4827         grouped together iff both quote and comment strings are single
4828         character.  Otherwise they might include a comment/quote leader.
4829         (next_token): Returns new token type TOKEN_SPACE.
4831         * src/builtin.c (push_builtin_table): New function to push a
4832         builtin_table on the stack without installing its contents.
4833         (find_builtin_by_name): Added call to push_builtin_table() if
4834         reading frozen files.  Otherwise the builtins named in the frozen
4835         files could not be found.
4836         (install_builtin_table): Changed to use push_builtin_table()
4838 1998-10-04  René Seindal  <rene@seindal.dk>
4840         * Prerelease 1.4i.
4842         * configure.in (ALL_LINGUAS): Added Polish pl.po
4844 1998-10-03  René Seindal  <rene@seindal.dk>
4846         * Many files: Incorporated changes to implement dynamic modules.
4847         Detailed comments in src/modules.c and modules/README
4849         * src/module.c: New file, implements the OS dependant parts of
4850         dynamic module loading.
4852         * src/Makefile.am (m4_SOURCES): Added module.c
4854         * src/builtin.h: New file, declares some functions from builtin.c
4855         that are of use for other modules (shipout_int, numeric_arg,
4856         skip_space, bad_argc), and the macros ARG() and DECLARE().
4858         * src/builtin.c (install_builtin_table): New function.  Each
4859         module brings in a builtin_table, which is pushed on a stack.
4860         (struct builtin_table): New struct for list of builtin_tables.
4861         (m4_loadmodule): New function to implement builtin "loadmodule".
4862         (shipout_int): No longer static, to be used by modules.
4863         (numeric_arg): do.
4864         (skip_space): do.
4865         (bad_argc): do.
4866         (builtin_init): changed to call install_builtin_table()
4867         (find_builtin_by_name): Now searches all builtin_tables
4868         (find_builtin_by_addr): do.
4870         * src/path.c: Reorganised to allow for two search paths, one for
4871         include files and one for modules.
4873         * src/m4.h: Added declarations for new functions in module.c and
4874         in path.c.
4876         * src/m4.c (main): Added call to module_init().
4878         * modules: New directory with a few demo modules.
4880         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
4881         in SUBDIRS.
4883         * configure.in: Added modules/Makefile to AC_OUTPUT.
4885         * configure.in: Added code to implement --with-modules.  Tests for
4886         <dlfcn.h> and -ldl.
4888         * acconfig.h: Added WITH_MODULES
4890 1998-10-02  René Seindal  <rene@seindal.dk>
4892         * examples/Makefile.am (pkgdata_DATA): Removed special target for
4893         check and variables TESTS.  These tests are now run from the
4894         tests/ directory.
4896         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
4897         directory.  The files stay there but the tests are run from the
4898         tests/ directory.
4900         * tests/Makefile.am (EXTRA_DIST): Added run-test.
4902         * tests/run-test: New file.  Run a test manually
4904         * tests/Makefile.am, tests/get_them: Moved automatically generated
4905         tests (from the manual) to sub directory tests/gentest/.  The
4906         tests/ directory had gotten a bit messy.
4908 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
4910         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
4911         wrap}.test: Added a few testcases.
4913 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
4915         * Prerelease 1.4h.
4917         * lib/Makefile.am (noinst_HEADERS): regex.h added
4919         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
4920         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
4922         * acm4/Makefile.am: created providing rules to create
4923         $(top_srcdir)/acinclude.m4 to be used by aclocal.
4925         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
4926         `C'. Reported by Ulrich Drepper.
4928         * Makefile.am (SUBDIRS): Removed checks directory
4929         * configure.in (AC_OUTPUT): Removed checks/Makefile
4931         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
4932         the space when m4.texinfo is edited and whitespace.el is active.
4933         (Defn,example): idem.
4935 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
4937         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
4938         ../COPYING. ../Makefile is a file which is certainly present when
4939         test is executed in testSubDir. One can't be sure that the COPYING
4940         file is in .. or ../.. in all situations, the ../Makefile is
4941         always there.
4943         * doc/m4.texinfo (Include): adjusted expected test output
4944         according to new tests, i.e. the input will always come from the
4945         file `in' created by the test.
4947         * tests/Makefile.am: Added three lines at the top to get
4948         esyscmd.1.test working.
4950         * tests/get-them: modified to generate clearer tests who will need
4951         less maintenance when new test examples are created in
4952         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
4953         need the generic file `defs') shell scripts creating `in', `ok',
4954         `out' and when apropriate `okerr' and `err' in the directory
4955         `testSubDir' when executed. The compare of `ok' and `out'
4956         (and of `okerr' and `err') will be the exit status of the test.
4957         `out' must match `ok' (and `okerr' must match `err') for the test
4958         to be succesful.
4960         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
4961         the tests generated by tests/get-them getting it input normally
4962         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
4963         (dot) before the numeric part) is reserved for all other (hand
4964         written) tests. The `+' means one or more times.
4966 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
4968         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
4969         supported short man page to refer to info documentation
4970         * helptoman.pl: added
4971         * configure.in: AC_PATH_PROG(PERL,perl)
4972         * Makefile.am (SUBDIRS): doc after src
4974         * libitized with libit 0.5 from
4975         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
4977         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
4978         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
4979          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
4980         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
4981           lib/rx.{c,h}: added
4982         * configure.in (AC_CHECK_FUNC): getopt_long
4984         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
4986         * TODO: added entry about dependencies
4988 1998-08-10  René Seindal  <rene@seindal.dk>
4990         * Prerelease 1.4f
4992         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
4993         "changesyntax".
4995         * src/builtin.c (m4_changesyntax): Added builtin macro
4996         "changesyntax" to modify the syntax table.
4998         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
4999         table.  All categories are assigned a syntax code and tokens are
5000         read according to this table.
5002 1998-08-09  René Seindal  <rene@seindal.dk>
5004         * src/numb.{c,h}: New files, implements multiple precision eval
5005         using GNU gmp.  Originally submitted by John Gerard Makecki
5006         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
5008         * doc/m4.texinfo (Eval): Added documentation for multiple
5009         precision arithmetic library support.
5011         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
5012         to accommodate multiple precision eval.
5014 1998-08-07  René Seindal  <rene@seindal.dk>
5016         * src/input.c (MATCH, match_input), src/m4.h: changed definition
5017         of comment and quote strings to `unsigned int' to allow eight bit
5018         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
5020         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
5021         patch from Mike Howard <mike@clove.com>
5023 1998-08-06  René Seindal  <rene@seindal.dk>
5025         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
5026         -lintl.
5028 1998-08-03  René Seindal  <rene@seindal.dk>
5030         * Prerelease 1.4e
5032         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
5033         and _ macro.  M4 now builds with --disable-nls.
5035         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
5036         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
5038         * configure.in (ALL_LINGUAS): Added complete list of translations:
5039         de fr it ja nl ru sv.
5041 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
5043         * Prerelease 1.4d.
5045         * src/m4.c: #include <signal.h> not <sys/signal.h>.
5047         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
5049         * checks/Makefile.am: explicit list tests in CHECKS.
5051         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
5052         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
5053         mkinstalldirs, install-sh: Added automake (1.3) support.
5055         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
5056         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
5057         Used libitize (0.4) to update.
5059         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
5060         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
5061         README accordingly.
5063         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
5064         stack overflow functionality.
5066 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
5068         * Prerelease 1.4.1.
5070         * Makefile.in (realclean-local): Delete stamp-h.in.
5072         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
5073         Localize, adapting from how it is done in sharutils.
5075         * fr.tt: New file, for French.
5077         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
5078         src/freeze.c: Rename PRODUCT to PACKAGE.
5080 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
5082         * configure.in: Check for <libintl.h> and <locale.h>.
5083         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
5084         src/stackovf.c: Rename _ to __P.
5085         * src/m4.h: Declare _ as a macro returning its argument, or else,
5086         include <libintl.h> and declare _ as gettext.
5087         * src/m4.c: Possibly include <locale.h> and call setlocale.
5088         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
5089         src/input.c, src/macro.c, src/output.c, src/path.c,
5090         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
5091         strings.
5093 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
5095         * doc/Makefile.in (stamp-vti): Use new -r option to date.
5097         * configure.in: Put --with-gmp in place, in prevision for John
5098         Gerard's work.
5099         * acconfig.h: Document WITH_GMP.
5101 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
5103         * Release 1.4.
5105         * doc/Makefile.in (realclean): Also remove stamp-vti.
5106         Reported by Eric Backus.
5108 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
5110         * src/freeze.c (produce_frozen_state): If the frozen file cannot
5111         be opened, return immediately after producing the error message.
5112         Reported by Andreas Schwab.
5114         * configure.in: Check for const only after having found possible
5115         ANSIfying compiler flags, this is of no use to check it before.
5116         Reported by Alexander Lehmann.
5118 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
5120         * src/macro.c (collect_arguments): Cast obstack arguments to
5121         (voidstar), so avoiding compiler warnings.
5122         Reported by Joseph E. Sacco.
5124         * src/freeze.c (produce_frozen_state): Cast printed lengths to
5125         (int) so they correspond to %d format items.
5126         Reported by Joseph E. Sacco.
5128         * src/m4.c (main): Cast the argument to xfree to (voidstar).
5129         * src/symtab.c (free_symbol): Idem.
5130         Reported by Karl Vogel.
5132 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
5134         * Makefile.in (DISTFILES): Distribute BACKLOG.
5136         * configure.in: Define PRODUCT and VERSION.
5137         * acconfig.h: Document PRODUCT and VERSION.
5138         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
5139         constant string m4 and variable or parameter named version.
5141 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
5143         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
5144         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
5145         defines __STDC__ to 0, for indicating it is *not* ANSI!
5146         Reported by Kaveh R. Ghazi.
5148         * configure.in: Added obsolescent tests for AIX and Minix.
5150         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
5151         which texclean does not exist anymore.
5152         Reported by Eric Backus, Jim Meyering, John David Anglin and
5153         Joseph E. Sacco.
5155 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
5157         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
5158         Reported by John David Anglin.
5160         * src/ansi2knr.c: New version, sent by Peter Deutsch.
5161         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
5162         ANSI2KNR, depending on the fact the compiler is ANSI or not.
5163         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
5164         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
5165         of $U, put underline in extensions rather than in basenames.  Use
5166         implicit rules, now that regularity makes this possible.
5167         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
5168         of ansi2knr whenever it is needed.
5169         * configure.in: Adjusted for correct STACKOVF substitution.
5170         * src/debug.c (trace_format): When not __STDC__, use (...) as a
5171         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
5172         Reported by David MacKenzie.
5174         * Makefile.in: Remove binprefix.  Use transform_name instead.
5175         Reported by David MacKenzie.
5177         * doc/Makefile.in: Create version.texi, use it, clean it.
5178         Reported by Jim Meyering.
5180 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
5182         * Makefile.in (all, install, uninstall): Depend on Makefile.
5184         * Makefile.in: For actions invoking $(MAKE) from within compound
5185         sh statements, exit non-zero if the sub-make fails.  Otherwise,
5186         the top-level make may exit successfully when it should fail.
5187         Reported by Jim Kingdon.
5189         * {,/*}Makefile.in: Use && after all cd, in case they fail.
5191         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
5192         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
5193         * configure.in: Substitute PRODUCT and VERSION.
5195         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
5197 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
5199         * Makefile.in (mostlyclean-local): Do not remove *~.
5200         * */Makefile.in (mostlyclean): Idem.
5201         Reported by Robert E. Brown and Richard Stallman.
5203 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
5205         * src/m4.h: Get rid of CONFIG_BROKETS.
5207 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
5209         * configure.in: Use AC_ARG_PROGRAM.
5210         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
5211         Reported by David MacKenzie.
5213 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
5215         * configure.in: Do not add -O to CFLAGS for GNU C, now that
5216         configure does it automatically.
5217         Reported by Jim Meyering.
5219 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
5221         * src/stackovf.c: Declare the handler_t typedef earlier in the
5222         code, use it for stackovf_handler.
5223         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
5224         casting sigsegv_handler.
5225         Reported by Robert Bernstein.
5227         * src/m4.c (main): Initialize program_name to argv[0] without
5228         basename'ing it.
5229         Reported by Karl Berry.
5231 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
5233         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
5234         Reported by Karl Berry.
5236 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
5238         * lib/Makefile.in (mostlyclean): Added.
5239         (TAGS): Make in $(srcdir).
5241         * configure.in: Use `choke me' in test, like everywhere!
5243         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
5244         unreacheable and useless.
5246         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
5248         * lib/Makefile.in (DISTFILES): Distribute TAGS.
5249         (distclean): Do not remove TAGS.
5250         (realclean): Remove it.
5251         * Makefile.in: Make TAGS in lib also, not just in src.
5252         Reported by Karl Berry.
5254         * Makefile.in (distclean, realclean): Instead of recursively
5255         calling $(MAKE) for the -local part, allow parallel execution of
5256         -recursive and -local, only delay the removal of config.status,
5257         which is repeated in both goals.
5259 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
5261         * Release 1.3.
5263         * Makefile.in: Group all *clean-recursive goals in one, using sed
5264         to remove `-recursive' while calling make recursively.  Also, use
5265         a subshell for each recursive $(MAKE).
5266         Reported by Jim Meyering.
5268         * src/m4.h (memcpy): Define with bcopy for BSD systems.
5269         Reported by Kaveh R. Ghazi.
5271         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
5272         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
5273         specify it.
5275         * configure.in: Use date instead of touch for stamp-h.
5276         * Makefile.in (stamp-h.in): Idem.
5278         * Makefile.in (distclean, realclean): Force serial execution of
5279         both goals, in case parallel makes are being used.
5280         Reported by Jim Meyering.
5282         * src/Makefile.in (DISTFILES): Distribute TAGS.
5283         (distclean): Do not remove TAGS.
5284         (realclean): Remove it.
5285         Reported by Karl Berry.
5287 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
5289         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
5290         to old names, for following Autoconf.
5292 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
5294         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
5295         ./install.sh will not be correctly referred to in sub-Makefiles.
5296         Reported by John David Anglin.
5298         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
5299         Reported by Eric Backus.
5301         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
5302         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
5303         config.status into remaking this directory's Makefile only.
5304         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
5305         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
5306         Reported by Jim Meyering.
5308 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
5310         * configure.in: Correct stack overflow detection logic, taking
5311         care of systems having only incomplete implementations (like for
5312         Pyramid 9820 OSx 5.0d).
5313         Reported by Kaveh R. Ghazi.
5315         * src/Makefile.in (TAGS): Remote -t from etags call.
5317 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
5319         * lib/Makefile.in (install): Depend on all.
5321 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
5323         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
5324         Reported by Jim Meyering and John David Anglin.
5326         * Makefile.in (distclean-local): Delete config.log.
5327         Reported by Jim Meyering.
5329         Solidify frozen files with respect to -P:
5330         * src/m4.c: Have -P set prefix_all_buitins variable instead of
5331         calling a function by that name.  Declare the variable.
5332         * src/m4.h: Adjust declaration for prefix_all_buitins.
5333         * src/builtin.c (builtin_init): Merge in functionality from
5334         previous prefix_all_buitins function, while making entries in the
5335         symbol table, but not modifying the builtin description itself.
5337         * src/freeze.c (reload_frozen_state): Add a useless `break;',
5338         because *many* compilers do not accept an empty `default:'.
5339         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
5340         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
5342         * configure.in: Use AC_TYPE_SIGNAL.
5343         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
5344         Reported by Robert Bernstein.
5346         * checks/Makefile.in (check): Modify PATH so check-them will find
5347         m4 in the src directory.
5348         * Makefile.in (check): Don't.
5349         Reported by Akiko Matsushita and Jim Meyering.
5351         * src/output.c (make_room_for, output_character_helper): New
5352         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
5353         a per buffer MAXIMUM_BUFFER_SIZE.
5355         * src/output.c (output_text): New function, for optimizing the
5356         output of strings of characters.  Use it.
5358 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
5360         * doc, src: New directories reorganizing the distribution.
5361         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
5362         files.
5363         * Makefile.in: Adjusted.
5364         * configure.in: Configure new Makefiles.
5366         * m4.h: Declare STRING typedef.  Use it for comment and quote
5367         strings, adjusting all references.  (This is the rudiments of a
5368         beginning for the eventual withdrawal of NUL terminated strings.)
5369         * output.c (shipout_text): Accept a length parameter, and use it.
5370         All callers adjusted.
5372 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
5374         * m4.h: Include <unistd.h> if it exists.
5375         * stackovf.c: Don't.
5377         Clean up for current_diversion variable:
5378         * output.c: Move current_diversion from builtin.c.
5379         * m4.h: Declare current_diversion so builtin.c can access it.
5380         * output.c (output_init, make_diversion): Initialize or update
5381         current_diversion.
5382         * builtin.c (builtin_init, m4_divert): Leave current_diversion
5383         alone.
5385         Remove limit on number of diversions:
5386         * output.c: Replace ndiversion by diversions, declare it.
5387         (output_init): Allocate only diversion 0.
5388         (make_diversion): Allocate new diversions as needed.
5389         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
5390         * m4.c: Still accept -N, but do nothing with it.
5391         Reported by David MacKenzie.
5393         Freeze diversions:
5394         * output.c (freeze_diversions): New function.
5395         * m4.h: Declare freeze_diversions.
5396         * freeze.c: Document frozen file format, revise it, call
5397         freeze_diversions to add diversions to frozen format, and code to
5398         reload them properly.
5399         * m4.c: Do not undivert automatically at end when status being
5400         frozen.  Do not call builtin_init when reloading frozen state.
5402         Speed up diversion processing:
5403         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
5404         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
5405         structure and variables, cached variables out of output_diversion,
5406         reallocate_diversion_for and OUTPUT_CHARACTER.
5407         (shipout_text, make_diversion, insert_diversion): Adapted to new
5408         structures.
5409         (insert_file): Use better buffering.
5410         Reported by David MacKenzie.
5412 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
5414         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
5415         dist works from another build directory.
5417 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
5419         * symtab.c (hack_all_symbols): Use hash_table_size instead of
5420         constant HASHMAX, for -H option to work better.
5422         * builtin.c (DECLARE): Simplify by using _ ().
5424         * freeze.c: New file.
5425         * Makefile.in: Compile it, distribute it.
5426         * m4.c: Recognize, document and process --freeze-state (-F) and
5427         --reload-state (-R) options.  Pass a true flag to builtin_init
5428         only if no reloading some state.
5429         * builtin.c (define_builtin): Remove static specifier.
5430         (find_builtin_by_name): Remove static specifier.
5431         (builtin_init): Accept and obey a flag argument.
5432         * m4.h: Add declarations for freeze.c, changes for builtin.c.
5434 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
5436         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
5437         specifier.
5439         * configure.in: Implement --with-dmalloc.
5440         * acconfig.h: Document WITH_DMALLOC.
5441         * m4.h: Add code for when WITH_DMALLOC.
5443 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
5445         * m4.c (long_options): Use "error-output", the dash was missing.
5446         Reported by Akiko Matsushita.
5448 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
5450         * m4.h: Include <sys/types.h>.
5451         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
5452         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
5453         int.
5454         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
5455         as size_t, not int.
5456         * builtin.c (dump_args): Declare len as size_t, not int.
5458         * debug.c: Prototype the forward declaration of debug_set_file.
5460         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
5461         shadowing of this variable.
5462         * output.c (insert_diversion): Idem.
5464         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
5465         (input_init): Duplicate default quote and comment strings.
5466         (set_quotes): Free previous quote strings in all cases.  Duplicate
5467         even default quote strings.
5468         (set_comment): Free previous comment strings in all cases.
5469         Duplicate even default comment strings.
5471         * configure.in: Updated for Autoconf 2.0.
5472         * Makefile.in (distclean-local): Also delete config.cache.
5474         * m4.c (usage): Reorganize the --help output by topic.  Include a
5475         description for debugging flags.
5477 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
5479         * configure.in: If sigaction is available and SA_ONSTACK defined,
5480         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
5481         defined, use sigvec.  Else don't compile stackovf.c.
5482         * stackovf.c (setup_stackovf_trap): Idem.
5483         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
5484         and Simon Leinen.
5486 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
5488         * m4.c (usage): Replace printf par fputs.
5490 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
5492         * Release 1.2
5494 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
5496         * configure.in: Check for sigaction and sigvec.  Add a new delayed
5497         check for RLIMIT_STACK, combine in the checking for getrlimit.
5498         All those things are not universally available.
5499         * stackovf.c: Split setting up the trap handler and catching
5500         signals, for better taking care of various configure outcomes.
5501         * examples/stackovf.sh: Correct a typo.
5502         Reported by Eric Backus, Jim Avera and Jim Meyering.
5504 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
5506         * ansi2knr.c: New version sent by its author, Peter Deutsch.
5508 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
5510         * Makefile.in: Modify so parallel make will not try making
5511         lib/libm4.a twice simultaneously.
5512         Reported by Jim Meyering.
5514 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
5516         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
5517         error message, for when no code possibility exists.  Even if this
5518         line is completely #ifdef'ed out, it brings a syntax error.
5519         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
5521         * Makefile.in (install): Have install depend on all too, for lib
5522         to be remade as needed.
5524         * examples/stackovf.sh: Try ksh, bsh and bash for shells
5525         providing ulimit, instead of using only ksh.
5526         Reported by Jim Avera and Joseph E. Sacco.
5528 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
5530         * Makefile.in (check): Have it depend on all instead of m4.  In
5531         this way, a change in lib will be detected and processed.
5533         * builtin.c (numeric_arg): Use strtol and verify the conversion,
5534         instead of using sscanf which stops as soon as there is a
5535         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
5536         and divert(1xyzzy) were all accepted without any warning or error
5537         messages.
5538         * m4.h: Declare strtol as long if not including stdlib.h.
5539         * configure.in: Check for limits.h, and replace strtol if missing.
5540         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
5541         * lib/strtol.c: New file, from elsewhere.
5542         Reported by Andreas Schwab.
5544 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
5546         * macro.c (expand_macro): Cast value to (boolean) prior to
5547         assigning it to traced.
5548         Reported by Tom McConnell.
5550         * Makefile.in (m4): Always make all in lib first.
5551         Reported by Jim Meyering.
5553 1994-07-06  Jim Avera <jima@netcom.com>
5555         * stackovf.c: Isolated OS-dependent sections; Improved portability,
5556         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
5557         handlers), and a default error message if the fault address is not
5558         available (when neither siginfo.h nor BSD sigcontext are supported).
5559         * configure.in: Changes for stackovf.h: Check for sigcontext,
5560         sigaction, sigstack, and define rlim_t as int if necessary.
5561         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
5562         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
5563         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
5565 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
5567         * configure.in: Use AC_SET_MAKE.
5568         * Makefile.in: Use @SET_MAKE@.
5569         Reported by Jim Meyering.
5571         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
5572         Reported by Ian Taylor.
5574 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
5576         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
5577         because siginfo.h is unrelated to standard headers, and siginfo.h
5578         is already checked for.
5579         Reported by Joseph E. Sacco.
5581         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
5582         PROTOTYPES.
5583         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
5584         AC_PROTOTYPES.
5586 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
5588         * builtin.c (substitute): Use \& to represent this part of the
5589         string which was matched by the whole regexp, instead of
5590         representing the whole string.  Any usage of \0 issues a warning
5591         and acts like \&, it will disappear in some subsequent release.
5593 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
5595         * m4.c: Complete prototype for forwarded declaration of usage.
5597         * input.c (init_macro_token): Correct own reference in error
5598         message.  Previous name get_macro_func was referred to instead.
5599         (next_char):  Correct own reference in error message.  Previous
5600         name advance_input was referred to instead.
5602         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
5603         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
5604         and_term, not_term, logical_not_term, cmp_term, shift_term,
5605         add_term, mult_term, exp_term, unary_term, simple_term): Add
5606         prototype to forwarded declarations.  Declare parameter v1 as
5607         eval_t * instead of int *.  Same for local variable v2 in dyadic
5608         functions.  Same for result in exp_term.
5609         * builtin.c (m4_eval): Declare value as eval_t instead of int.
5610         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
5611         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
5612         (shipout_int): Cast first argument of ntoa to eval_t.
5613         Reported by Thorsten Ohl.
5615         * macro.c: Complete the prototypes of forwarded expand_macro and
5616         expand_token.
5617         Reported by Thorsten Ohl.
5619         * m4.h: Define voidstar as void * or char * depending on __STDC__.
5620         The Ultrix 3.1 compiler cannot do much with void pointers.
5622         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
5623         * m4.c (xfree):  Replace void * by voidstar.
5624         Reported by Tom McConnell.
5626         * ansi2knr.1: New, from elsewhere.
5627         * Makefile.in (DISTFILES): Distribute ansi2knr.1
5629         * Makefile.in (stamp-h.in): Avoid running ./config.status if
5630         stamp-h does not exist yet.  This avoids running it a second time
5631         just after the initial ./configure.
5632         Reported by David MacKenzie and Tom McConnell.
5634         * m4.h: Replace the enum debug_info declaration with a series of
5635         #define's.  The Ultrix 3.1 compiler would otherwise need casting
5636         (int) to most references, when used in expressions.
5637         Reported by Tom McConnell.
5639 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
5641         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
5642         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
5643         calls the compiler.  Previously, FP_PROTOTYPES was only calling
5644         the preprocessor; by not being subject to CFLAGS, this was
5645         discouraging those flags asking for ANSI compilation.
5646         * acconfig.h: Document HAVE_PROTOTYPES.
5647         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
5648         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
5649         Reported by Eric Backus.
5651         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
5652         from the environment.  Default CFLAGS to -g if not set.
5653         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
5654         * lib/Makefile.in: Have CFLAGS substituted from configure.
5655         Reported by Eric Backus and Tom McConnell.
5657         * configure.in: m4_undefine changeword before using AC_ENABLE.
5659         * m4.h: Declare prototypes for error (for ANSI compilers only),
5660         prefix_all_builtins and reference_error.
5661         Reported by Tom McConnell.
5663         * input.c (set_word_regexp): Do not try to initialize the array
5664         test from a string, this does not work with non-ANSI compilers.
5665         Reported by Eric Backus.
5667         * Makefile.in (dist): Clean examples/ before saving it.
5668         (distclean-local): Also remove stamp-h.
5669         Reported by Eric Backus.
5671         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
5672         non ANSI compilers.
5673         Reported by Tom McConnell.
5675         * checks/Makefile.in (clean): Depends on mostlyclean.
5676         (mostlyclean): New goal.
5678 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
5680         * Makefile.in (DISTFILES): Distribute install.sh.
5681         * install.sh: New file, copied from elsewhere.
5682         Reported by Assar Westerlund and Kaveh R. Ghazi.
5684 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
5686         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
5687         * acconfig.h: Explain ENABLE_CHANGEWORD.
5689         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
5690         from code provided by Pete Chown]
5691         * m4.h: Add original_text field to u_t variant of union u.
5692         Declare TOKEN_DATA_FUNC macro.
5693         * builtin.c: Declare changeword.
5694         (m4_changeword): New function.
5695         * input.c: Include "regex.h", define variables with word regexps.
5696         (input_init): Initialize the word regexp.
5697         (set_word_regexp): New.
5698         (next_token): Declare local variables, use the previous code if
5699         default_word_regexp is true.  Else, match using a new code.  Save
5700         the original text.
5701         * macro.c (expand_token): Ship out original text if not a macro
5702         name.
5703         Reported by Krste Asanovic and Pete Chown.
5705         [These modifs all depend upon ENABLE_CHANGEWORD]
5706         * m4.h: Declare external user_word_regexp.
5707         * m4.c: Declare user_word_regexp, and initialize it from
5708         --word-regexp or -W, or NULL if not specified.
5709         * input.c: Use user_word_regexp if specified, instead of
5710         DEFAULT_WORD_REGEXP.
5712         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
5713         agree with it.
5715         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
5716         * checks/Makefile.in: Empty the suffix list.
5717         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
5719         * m4.c: Declare nesting_limit and initialize it to 250.
5720         Implement -LNUMBER or --nesting-limit=NUMBER to change its
5721         value.
5722         * m4.h: Declare nesting_limit as external.
5723         * macro.c (expand_macro): Stop execution whenever nesting limit
5724         is exceeded.
5725         Reported by Bengt Mertensson.
5727         * eval.c (evaluate): Diagnose excess characters in eval input.
5728         Things like `eval(08)' used to return 0 with no diagnostic.
5730         * m4.h: Capitalize first letter of all macro arguments in
5731         definitions.
5733         * m4.c: Declare warning_status, initialize it to 0.  Add new
5734         option -E, or --fatal-warnings, which sets warning_status to
5735         EXIT_FAILURE instead.
5736         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
5737         EXIT_FAILURE if not otherwise done by header files.
5738         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
5739         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
5740         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
5741         argument of all M4ERROR calls.
5742         Reported by Noah Friedman.
5744         * examples/incl-test.m4: Renamed from incl_test.m4.
5745         * examples/include.m4: Include incl-test.m4 instead of
5746         incl_test.m4.
5747         * examples/multiquotes.m4: Renamed from multi-quotes.m.
5749 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
5751         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
5752         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
5753         also tested it on a Sun Sparc workstation running SunOS 4.x.
5755         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
5756         49.format check, abusing a `union values' argument with sprintf
5757         without selecting the proper field.  Now, save the formatting type
5758         first, delaying the fetch of the corresponding argument.
5759         Reported by Joseph E. Sacco and Tom Quinn.
5761         * format.c (format): Remove const from char *fmt declaration when
5762         not HAVE_EFGCVT, because a NUL may be forced into it.
5764         * m4.h: Declare atof() when not STDC_HEADERS.
5765         Reported by Joseph E. Sacco.
5767         * Regenerate configure using Autoconf 1.11, this corrects a
5768         problem about an incorrect cpp seting on NeXT 3.1.
5769         Reported by Alexander Lehmann.
5771 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
5773         * m4.h (_): Change argument from `x' to `Args'.
5775 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
5777         * m4.h: Rename Args() to _().
5778         * m4.h: Remove extern specifier from all function declarations.
5780 1994-04-22  Jim Avera <jima@netcom.com>
5782         * stackovf.c: New file implementing stack-overflow detection.
5783         * configure.in: Check for getrlimit, sigaction.  If all of
5784         standard headers, getrlimit and sigaction, define USE_STACKOVF and
5785         substitute ${U}stackovf.o for STACKOVF.
5786         * acconfig.h: Declare USE_STACKOVF.
5787         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
5788         * m4.h: Declare setup_stackovf_trap().
5789         * m4.c: Call setup_stackovf_trap().
5790         * tests/stackovf_test.sh: New file.
5792 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
5794         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
5796         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
5798 1994-01-30    <pinard@iro.umontreal.ca>
5800         * m4.h: Remove definition of volatile, not used anymore.
5801         Reported by Jim Meyering and Joseph E. Sacco.
5803         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
5804         of `if ... else /* nothing */' for if macros.
5805         Reported by Jim Meyering.
5807         * builtin.c (m4_regexp): Reorganize the code for avoiding a
5808         warning from gcc about `repl' possibly used before defined.
5809         Reported by Jim Meyering.
5811         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
5812         Reported by Jim Meyering.
5814 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
5816         * m4.h: Move the conditional definition of volatile after the
5817         inclusion of system files, because they may define it first.
5819 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
5821         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
5822         get around a problem with Alpha make seeing a syntax error, there.
5823         Reported by Vern Paxson.
5825 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
5827         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
5828         Reported by Richard Stallman.
5830 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
5832         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
5833         instead of AC_HAVE_FUNCS.
5834         Reported by Noah Friedman.
5836 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
5838         * m4.c: Initialize show_help and show_version to zero.
5840         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
5841         Use them in exit() and usage() calls.
5843 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
5845         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
5846         syserr() macro.  Delete errref, add reference_error and M4ERROR.
5847         * m4.c: Replace errref, which was returning an input reference
5848         string, with reference_error, which prints it on standard error.
5849         * builtin.c, output.c: Use errno as second parameter to error,
5850         instead of using syserr() with %s.
5851         * *.c: Use M4ERROR instead of error: no more errref() with %s.
5852         Doing so, the program name appears after the input reference
5853         instead of before, which eases M-x next-error processing.
5855 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
5857         * checks/get-them: Escape braces with backslashes in patterns,
5858         because HPUX-9.01 awk needs this.
5859         Reported by Jim Meyering.
5861 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
5863         * builtin.c: Declare "FILE *popen ();".
5865         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
5866         macros, replace error_message_prefix() declaration by errref()'s.
5867         Declare xrealloc, for use in errref().
5868         * m4.c: Delete error_message_prefix() function, add errref().
5869         * *.c: Use error() systematically in place of all error macros,
5870         now that error() flushes stdout first.  Make needed adjustments.
5872         * m4.h: Remove const in sys_errlist[] declaration, it creates
5873         conflicts on SGI and Alpha.
5874         Reported by Kaveh R. Ghazi.
5876 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
5878         * m4.c: Include <getopt.h> instead of "getopt.h".
5880         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
5881         * acconfig.h: New, for documenting HAVE_EFGCVT.
5882         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
5883         use them wherever appropriate.  Also use -I. for compilations.
5884         * lib/Makefile.in: Use -I.. for compilations.
5885         * *.c: Include <config.h> or "config.h".
5887         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
5888         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
5890 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
5892         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
5894         * input.c (input_init): Initialize quote and comment strings
5895         explicitely instead of calling set_quotes and set_comment: by
5896         doing so, we ensure we do not free uninitialized variables.
5898         * checks/check-them: Reverse arguments to both diff, so the
5899         expected is on the left and the obtained on the right.
5901         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
5902         macros. Delete declarations for m4error, warning, fatal and
5903         internal_error, add declaration for error_message_prefix.
5904         * m4.c:  Delete m4error, warning, fatal and internal_error
5905         routines, add error_message_prefix routine.
5906         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
5907         warning with WARNING*, fatal with FATAL* and internal_error with
5908         INTERNAL_ERROR*.
5909         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
5910         this is not needed anymore.
5912         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
5913         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
5914         and debug_message, add declaration for debug_message_prefix.
5915         * debug.c: Remove static specifier for FILE *debug declaration.
5916         Delete debug_print and debug_message routines, add
5917         debug_message_prefix routine.
5918         * builtin.c, debug.c: Replace debug_print routine calls with
5919         DEBUG_PRINT* macro calls.
5920         * input.c, path.c: Replace debug_message routine calls with
5921         DEBUG_MESSAGE* macro calls.
5923         * m4.h: Remove inclusion of <varargs.h>.
5924         * debug.c: Include <stdarg.h> or <varargs.h>.
5925         (trace_format): Use stdarg instead of varargs if __STDC__.
5927         * configure.in: Remove checks for vfprintf and _doprnt.  These
5928         implementations use varargs tricks which are not portable enough.
5929         * lib/vfprintf.c: Deleted.
5930         * lib/_doprnt.c: Deleted.
5931         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
5932         Reported by Joel Sherrill.
5934         * path.c (add_include_directory): Use xstrdup.
5936         * builtin.c (find_builtin_by_name): Declare static.
5938         * *.[ch]: Add const to a few "char *" declarations.
5940         * configure.in: Remove commented tests for fileno() and fstat().
5941         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
5943         * debug.c (debug_flush_files): New.
5944         * m4.h: Declares it.
5945         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
5946         Reported by Nicolas Pioch.
5948 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
5950         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
5951         Reported by Joel Sherrill.
5953         * builtin.c (prefix_all_builtins): Instead of the table size, use
5954         the null entry at end for stopping the loop.  It was overwritten.
5955         Reported by Andreas Schwab and Jim Meyering.
5957         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
5958         Reported by Kaveh R. Ghazi.
5960         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
5961         Reported by Karl Vogel.
5963 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
5965         * m4.h: Do not define volatile if already defined.
5966         Reported by René Seindal.
5968         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
5970         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
5971         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
5973 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
5975         * m4.h: Define strchr and strrchr in terms of index and rindex,
5976         instead of the other way around.
5977         * builtin.c, m4.c, path.c: Use strchr instead of index.
5979         * input.c (next_char): Remove a "break;" after a "return ...;".
5980         Reported by Tom McConnell.
5982 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
5984         * Release 1.1
5986         * configure.in: Do not copy check files in the build hierarchy.
5987         * checks/check-them: Identify the m4 version being checked.  For
5988         finding m4, look in $PATH instead of in the parent directory.
5989         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
5990         * checks/Makefile.in (.all-stamp): Always create check files in
5991         the source hierarchy, not anymore in the build hierarchy.
5992         (check): cd to the source hierarchy before performing checks.
5993         Do not copy nor clean COPYING anymore, take it from `..'.
5994         Reported by Tom McConnell.
5996         * Makefile.in (Makefile): Use $(SHELL).
5997         (config.status): Use $(SHELL).  Use "config.status --recheck"
5998         instead of "configure --no-create", which is obsolete.
5999         Reported by Tom McConnell.
6001 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
6003         * m4.c (usage): Use "%s" instead of "m4" in format string.
6004         Reported by Jim Meyering.
6006         * Makefile.in: Distribute mkinstalldirs.
6007         Reported by Pierre Gaumond.
6008         Reported by Jim Meyering.
6009         Reported by Tom McConnell.
6010         Reported by Andreas Gustafsson.
6012         * checks/check-them: Renamed from checks/check_them.
6013         * checks/get-them: Renamed from checks/get_them.
6014         * checks/.all-stamp: Renamed from checks/.all_stamp.
6015         * checks/Makefile.in: Changed accordingly.
6016         Reported by Jim Meyering.
6018 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
6020         * lib/Makefile.in (dist): Correct permissions on files.
6022         * output.c: Declare tmpfile, some systems don't.
6024 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
6026         * checks/Makefile.in (dist): Correct permissions on files.
6028         * Makefile.in (dist): Ensure recursive linking for subdirectory
6029         `examples', also set read/write permissions on all its files.
6031         * mkinstalldirs: New, from elsewhere.
6032         * Makefile.in: Use it.
6034         * debug.c: Synchronize debug messages and regular output when
6035         the debug file and stdout are redirected to the same file.
6036         * configure.in: Add (commented) checks for fileno and fstat.
6037         Reported by Jim Avera.
6039         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
6040         etc., arguments, then ignore the superfluous one.  m4 used to
6041         diagnose missing arguments and return the empty string.
6042         Reported by Nick S. Kanakakorn.
6044 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
6046         * m4.c (main): At end of all input, ensure all undiverted text
6047         goes to the main output stream.
6048         Reported by Andreas Gustafsson.
6050         * m4.c (main): exit (0), instead of return 0.
6052         * m4.c: Implement -P and --prefix-builtins.
6053         * builtin.c: Delete const specifier on builtin_tab.
6054         (prefix_all_builtins): New.
6055         Reported by Noah Friedman.
6056         Reported by Scott Bartram.
6058         * c-boxes.el: New, from elsewhere.
6059         * Makefile.in: Distribute it.
6061         * m4.h: Do not define bcopy if <string.h> defines it.
6062         Reported by Stephen Perkins.
6064         * builtin.c (define_macro): Allow a missing second argument, in
6065         which case it is implied empty.  Affects define and pushdef.
6066         Reported by Eric Allman.
6068 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
6070         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
6071         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
6072         * builtin.c: Initialize all the blindness fields in builtin_tab.
6073         (define_builtin): Copy the blindness of a builtin into its symbol.
6074         * macro.c (expand_token): Avoid processing a blind builtin if the
6075         next character is not an opening parenthesis.
6076         Reported by David MacKenzie.
6077         Reported by Noah Friedman.
6079         * configure.in: Ensure an exit status of 0 on completion.
6080         Reported by Vivek P. Singhal.
6082         * eval.c (eval_lex): Admit both lower and upper case letters for
6083         bases greater than 10.  Only lower case letters were accepted.
6085         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
6086         Reported by Krste Asanovic.
6088         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
6089         * eval.c (logical_not_term): New name for not_term.
6090         * eval.c (xor_term): New, between or_term and and_term.
6091         * eval.c (not_term): New, between and_term and logical_not_term.
6092         * eval.c (shift_term): New, between cmp_term and add_term.
6093         Reported by Krste Asanovic: ~, ^, <<, >>.
6094         Reported by Ben A. Mesander: ** vs ^.
6096         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
6097         * m4.h: Delete xrealloc.c.
6098         * lib/xmalloc.c: New, from elsewhere.
6099         * lib/xstrdup.c: New, from elsewhere.
6100         * lib/Makefile.in: Distribute and compile them.
6102         * m4.c: Change progname to program_name.
6103         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
6104         * lib/error.c: New, from elsewhere.
6105         * lib/Makefile.in: Distribute and compile error.c.
6106         * configure.in: Check AC_VPRINTF and for strerror.
6107         * m4.c: Delete cmd_error.  Use error instead.
6108         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
6110         * m4.h: Delete #define const, let Autoconf takes care of this.
6112         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
6113         Merge parse_args into main.  Declare argv to be `char *const *',
6114         then remove superfluous casts.
6116         * m4.c: Rename --no-gnu-extensions to --traditional.
6117         Reported by Ben A. Mesander.
6119         * m4.c (usage): Add a status parameter.  Supply one in various
6120         calls.  Add --help processing.  Remove -V for --version.
6122         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
6124         * lib/Makefile.in: Have an AR=ar declaration.
6125         Reported by Eric Backus.
6126         Reported by Bjorn R. Bjornsson.
6127         Reported by Tom Tromey.
6128         Reported by Kristine Lund.
6129         Reported by Marion Hakanson.
6131 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
6133         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
6134         Reported by Noah Friedman.
6136 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
6138         * Makefile.in: Remove MDEFINES and cleanup.
6140 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
6142         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
6143         Create a gzip file.
6145 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
6147         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
6148         ensure 777 mode for directories, so older tar's will restore file
6149         modes properly.
6151 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
6153         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
6154         so the installer can override automatically configured choices.
6155         Reported by Karl Berry.
6157 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
6159         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
6160         previous version was not working properly on m68k-hp-bsd4.3.
6161         Reported by Roland McGrath.
6163         * lib/_doprnt.c: Stolen from Oleo distribution.
6164         * configure.in: Check for _doprnt.c if vfprintf.c selected.
6165         * lib/Makefile.in: Distribute _doprnt.c.
6166         Do not distribute regex.[ch].old anymore.
6168 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
6170         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
6171         Richard wants it there.
6173 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
6175         * Makefile.in: Add DEFS to MDEFINES.
6176         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
6177         (libm4.a): Remove the library before creating it.
6178         (distclean): Remove tags and TAGS too.
6180 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
6182         * Makefile.in (dvi, m4.dvi): New goals.
6184         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
6185         macro.c, output.c, path.c, symtab.c: Change Copyright from
6186         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
6188         * examples/divert.m4: Deleted, this bug has been corrected.
6190         * Makefile.in (texclean, mostlyclean): New goals.
6192         * Makefile.in (clean): Remove clutter from ansi2knr.
6193         Reported by Pierre Gaumond.
6195 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
6197         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
6198         might well use CFLAGS is s/he needs it.
6200         * Makefile.in: Allow installation of info files from a separate
6201         build directory.
6202         Reported by Jason Merrill.
6203         Reported by David MacKenzie.
6204         Reported by Skip Montanaro.
6205         Reported by Erez Zadok.
6206         Reported by Assar Westerlund.
6208 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
6210         * Release 1.0.3
6211         This is still a beta release for the future GNU m4 version 1.1.
6213         * lib/alloca.c: New, from elsewhere.
6214         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
6216         * m4.h: Do not define index/rindex if already defined.  If
6217         FALSE/TRUE are already defined, do not redefine them, but merely
6218         define boolean typedef to int.
6220         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
6221         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
6222         because some C compilers do not like connectives with #ifdef.
6223         * m4.h: Define `volatile' only if __GNUC__, instead of once for
6224         __GNUC__ and once for __STDC__.
6225         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
6227         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
6228         Makefile dependencies.  Without it, make keeps destroying and
6229         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
6231         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
6232         to diversion/DIVERSION, this was a spelling error.
6234         * m4.c: Declare version[], remove #include "version.h".
6235         * version.h: Deleted.
6236         * Makefile.in: Remove references to version.h.
6238         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
6239         production, by using a simpler and more robust algorithm.  This
6240         solves the problem of synclines sometimes written in the middle of
6241         an output line.  Delete sync_line() and output_lines variable.
6242         * m4.h: Remove sync_line prototype and output_lines declaration.
6243         * input.c (next_char), output.c (shipout_text): Remove references
6244         to output_lines.
6245         * input.c (push_file, pop_file): Merely put the value -1 in
6246         output_current_line instead of calling sync_line, for delaying a
6247         single `#line NUM FILE' before next output line.  Do not test
6248         for sync_output, because this is unnecessary clutter.
6249         * output.c (make_divertion, insert_divertion): Idem.
6250         * input.c: Rename must_advance_line to start_of_input_line, for
6251         consistency.
6253         * debug.c (trace_header): Select a new debug line format, which
6254         better complies with GNU standards for formatting error messages.
6255         With option `-dfl', M-x next-error might be used on the output.
6256         * m4.c (vmesg): Adjust format of error output to GNU standards.
6257         * m4.texinfo: Adjust examples for `make check' to work.
6259         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
6260         case for enum debug_info constants, which were all lower case.
6262         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
6263         re_search_2.
6264         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
6265         collected patches.  I tried a few times using newer regex.[ch], it
6266         mysteriously stopped aborting with this one.  Insecure feeling...
6267         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
6269 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
6271         * m4.c: Change `--no-warnings' to `--silent'.
6272         Reported by David MacKenzie.
6274         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
6275         leave it off for now.  See comment in m4.c for justification.
6276         Reported by David MacKenzie.
6278         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
6279         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
6281         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
6283         * Makefile.in: Ensure recursive cleaning is done before local
6284         cleaning for all clean goals.
6286         * builtin.c (ntoa): Ensure the value is always interpreted as a
6287         signed quantity, whatever the radix is.
6289 1992-11-18  Jim Meyering  <meyering@idefix>
6291         * builtin.c, format.c, input.c: Split long lines.
6292         * m4.c: Use typedef macro_definition instead of struct
6293         macro_definition.
6294         * symtab.c: Use typedef symbol instead of struct symbol.
6296 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
6298         * *.[ch]: Remove all trailing whitespace, in code and comments.
6300         * configure.in: Find some awk.
6301         * Makefile.in: Add $(AWK) to MDEFINES.
6302         * checks/Makefile.in: Transmit $(AWK) to get_them.
6303         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
6304         awk script when switching files, because without this, mawk runs
6305         out of file descriptors.
6307 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
6309         * Makefile.in (realclean): Delete m4.info*.
6310         Reported by Jim Meyering.
6312         * Makefile.in: Adjust and link with checks/Makefile.
6313         * checks/Makefile.in: New.
6314         * configure.in: Output checks/Makefile.
6316         * checks/get_them: Have the dnl header of each test more
6317         recognizable by next-error, also use a better message.
6319 1992-11-16  Jim Meyering  <meyering@idefix>
6321         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
6322         And use that only if __GNUC__ since we're using it's GCC-specific
6323         semantics that tell the compiler the associated function doesn't
6324         return.
6326         * builtin.c (substitute): Don't use character as an array index.
6327         (dumpdef_cmp): Make formal arguments `const void *' to avoid
6328         warnings with gcc -W -Wall on systems with qsort prototype.
6329         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
6330         from gcc -W -Wall.
6332         * eval.c (most functions): Add parentheses to assignments used
6333         as truth values go avoid warnings from gcc -Wall.
6335         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
6336         any functions that don't need external scope.
6338         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
6339         (many functions and arrays): Declare `const'.
6341 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
6343         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
6344         removing the declaration from m4.h.  Also rename false to FALSE
6345         and true to TRUE.
6347         * lib/Makefile.in (Makefile): New goal.
6349         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
6350         so heavily loaded.  It gets more easily overridable, calling make.
6351         Reported by Jim Meyering.
6353         * Makefile.in (dist): Get .fname from the current directory name,
6354         instead of from version.h.  I need updating many files manually,
6355         when the version changes, version.h is just one of them.
6357 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
6359         * m4.h: Remove the tag `boolean' on the enum introducing typedef
6360         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
6361         Reported by Tom McConnell.
6363 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
6365         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
6366         39.cleardiv, which were describing missing or spurious newlines.
6367         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
6368         do not depend on machine word size, `/bin/false' implementation,
6369         or `wc' output format.  `make check' is more dependable, now.
6371         * checks/check_them: Summarize the failed tests by listing their
6372         name, at end.  If none, issue `All checks successful'.  Output
6373         `Checking' instead of `Input file:'.
6375         * checks/get_them, checks/check_them: Reindented.
6377         * Makefile.in (dist): chmod a+r before making the tar file.
6379 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
6381         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
6383         * input.c (next_token): Reinitialize token_buttom just after using
6384         it as a watermark with obstack_free.  Or else, a future token, big
6385         enough for triggering reallocation of the obstack chunk, could
6386         void the initialized value of token_buttom, later causing panic in
6387         obstack_free.  Rename token_buttom to token_bottom everywhere.
6389         * m4.h: Before declaring errno, first include <errno.h> and
6390         ensure that it does not define errno.
6391         Reported by Richard Stallman.
6393 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
6395         * builtin.c: Define and use DECLARE macro for builtins.
6397         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
6398         argument, this is a common idiom for introducing long comments.
6400         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
6401         arguments.  The last argument was silently ignored.
6403         * m4.c (cmd_error): Add a missing semicolon before va_end().
6405 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
6407         * Makefile.in: Now handle protoized sources.  Define and use U.
6408         Compile and use ansi2knr with old compilers.  Update DISTFILES.
6409         Add `aclocal.m4' to `configure' dependencies.
6410         * ansi2knr.c: New, from Ghostscript distribution.
6411         * configure.in: Define U through FP_PROTOTYPES for old compilers.
6412         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
6413         * aclocal.m4: New, provide FP_PROTOTYPES.
6414         * m4.h: Conditionnaly protoized through Args, save for varags.
6415         * builtin.c: Protoized.  Then:
6416         Include <sys/types.h> if size_t is not defined, before "regex.h".
6417         (m4_ifelse): Fetch built-in name properly for diagnostic.
6418         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
6419         (m4_regexp): Add const to `msg' declaration.
6420         (m4_patsubst): Add const to `msg' declaration.
6421         * debug.c: Protoized, save for varargs.
6422         * eval.c: Protoized.
6423         * format.c: Protoized.
6424         * input.c: Protoized.
6425         * m4.c: Protoized, save for varargs.  Then:
6426         (xfree): Accept void * instead of char *.
6427         (xmalloc): Return void * instead of char *.
6428         (xrealloc): Accept and return void * instead of char *.
6429         * macro.c: Protoized.
6430         * output.c: Protoized.
6431         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
6432         * symtab.c: Protoized.
6434 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
6436         * m4.texinfo: Remove directory from diagnostics in 30.include,
6437         51.eval, 56.errprint and 57.m4exit tests.
6439         * m4.h: Remove declarations for int or void system functions, they
6440         cause more conflicting trouble than they make good.
6442         * configure.in: Avoid configuration header file.  Add some tests.
6443         * m4.h: Remove #include "config.h".
6444         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
6445         Then, rewritten for better compliance with GNU standards.
6447 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
6449         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
6450         because of a misplaced #endif.
6452         * Many *.[hc] files: Correct intra-line spacing here and there,
6453         according to GNU indent 1.6 advice.
6455         * configure.in: New, using Autoconf 1.2.
6456         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
6457         * Delete old configure.in, configure, etc/configure.in,
6458         etc/configure, lib/configure.in, lib/configure and config/*.
6459         Reported by Jason Merrill.
6461         * symtab.c (hash): Change (char) NULL to '\0'.
6462         Reported by Jason Merrill.
6464         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
6465         etc/nextvers.sh.  Release numbers will be edited `by hand'.
6466         * version.h: De-automatize, force value in.
6468         * m4.c: Changes in order to use a newer getopt.h.
6469         Reported by David MacKenzie.
6471         * checks/: New name for examples/.
6472         * checks/get_them: New location for etc/get_examples.
6473         * checks/check_them: New location for etc/check_examples.
6474         * Makefile.in, checks/get_them, checks/check_them: Adjust.
6475         * lib/vfprintf.c: New location for etc/vfprintf.c.
6476         * Delete empty etc/.
6477         * examples/: New name for test/.
6479 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
6481         * Makefile.in (check): Add m4 as dependency.
6483         * m4.c: Accept --no-warnings instead of --no_warnings, and
6484         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
6485         usage message more informative.
6486         Reported by David MacKenzie.
6488 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
6490         * etc/check_examples: New name for check_examples.sh.
6491         * etc/get_examples: New name for get_examples.sh.
6492         * Makefile.in, etc/Makefile.in: Use new names.
6494         * Makefile.in: Transmit $(CC) while making in lib.
6496         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
6497         code disposition by hand.
6499 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
6501         * m4.h: Delete definitions for abort() and exit().
6502         Reported by Richard Stallman.
6504         * config/hmake-unicos, config/s-unicos.h: New files.
6505         Reported by Hal Peterson.
6507         * eval.c (exp_term): Have N^0 return 1.
6508         Reported by Michael Fetterman.
6510         * eval.c, input.c, m4.h: Remove last comma in enums.
6511         Reported by Mike Lijewski.
6513         * Transfer of maintenance duties from René to François.
6515 1991-10-24  René Seindal <seindal@diku.dk>
6517         * Release 1.0.  Many thanks to those, who provided me with bug
6518         reports and feedback.
6520         * Uses GNU configure, taken from the gdb distribution.
6522         * Uses GNU getopt(), with long option names.
6524         * The -Q/+quiet option is added, which suppresses warnings about
6525         missing or superflous arguments to built-in macros.
6527         * Added default options via the M4OPTS environment variable.
6529         * The built-in format can now be configured to use sprintf as
6530         the formatting engine, for systems without [efg]cvt(3).
6532         * GNU library code is moved to the ./lib subdirectory; other
6533         utility files are now in ./etc.
6535         * Several minor bugs have been fixed.
6537 1991-07-26  René Seindal <seindal@diku.dk>
6539         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
6540         Francois Pinard and Roland H. Pesch for providing me with reports.
6542         * The builtins incr and decr are now implemented without use of
6543         eval.
6545         * The builtin indir is added, to allow for indirect macro calls
6546         (allows use of "illegal" macro names).
6548         * The debugging and tracing facilities has been enhanced
6549         considerably.  See the manual for details.
6551         * The -tMACRO option is added, marks MACRO for tracing as soon
6552         as it is defined.
6554         * Builtins are traced after renaming iff they were before.
6556         * Named files can now be undiverted.
6558         * The -Nnum option can be used to increase the number of
6559         divertions available.
6561         * Calling changecom without arguments now disables all comment
6562         handling.
6564         * The function m4_patsubst() is now consistently declared
6565         static.
6567         * A bug in dnl is fixed.
6569         * A bug in the multi-character quoting code is fixed.
6571         * Several typos in the manual has been corrected.  More probably
6572         persist.
6574         * The m4.info file is now installed along with the program.
6576 1990-11-15  René Seindal <seindal@diku.dk>
6578         * Updated and enhanced version.  Release 0.75, manual 0.07.
6580         * Implemented search path for include files (-I option and
6581         M4PATH envronment variable).
6583         * Implemented builtin "format" for printf-like formatting.
6585         * Implemented builtin "regexp" for searching for regular
6586         expressions.
6588         * Implemented builtin "patsubst" for substitution with regular
6589         expressions.
6591         * Implemented builtin "esyscmd", which expands to a shell
6592         commands output.
6594         * Implemented "__file__" and "__line__" for use in error
6595         messages.
6597         * Implemented character ranges in "translit".
6599         * Implemented control over debugging output.
6601         * Implemented multi-character quotes.
6603         * Implemented multi-character comment delimiters.
6605         * Changed predefined macro "gnu" to "__gnu__".
6607         * Changed predefined macro "unix" to "__unix__", when the -G
6608         option is not used.  With -G, "unix" is still defined.
6610         * Changed "shift", "$@" and "$*" to not insert spaces afters
6611         commas.
6613         * Added program name to error messages.
6615         * Fixed two missing null bytes bugs.
6617 1990-01-22  René Seindal <seindal@diku.dk>
6619         * Initial beta release.  Release 0.50, manual 0.05.
6622         $Revision$ $Date$