Typos in source code comments.
[m4.git] / ChangeLog
blob60c35a0b54656d8be988a1bed542196e7fc31806
1 2008-09-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3         Typos in source code comments.
4         * modules/m4.c: Fix typos in comments.
5         * m4/input.c: Likewise.
6         * src/main.c: Likewise.
8 2008-08-29  Eric Blake  <ebb9@byu.net>
10         Fix manual date information.
11         * doc/m4.texinfo: UPDATED refers to the day the manual was built,
12         not the release date of M4.
13         Based on a bison patch by Akim Demaille.
15 2008-08-27  Eric Blake  <ebb9@byu.net>
17         Tweak -d examples.
18         * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
19         matters.
20         (Dumpdef): Fix typo.
22 2008-08-23  Eric Blake  <ebb9@byu.net>
24         Allow debugmode control over whether defn(undef) warns.
25         * ltdl/m4/gnulib-cache.m4: Import verify module.
26         * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
27         New values.
28         (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
29         * m4/m4.c (m4_create): Start with debugmode = d.
30         * src/main.c (usage): Mention this.
31         (main): Let -E impact debug mode.
32         * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
33         if flag is clear.
34         * modules/gnu.c (builtin, inder): Likewise.
35         * m4/debug.c (m4_debug_decode): Parse new mode.
36         * src/freeze.c (produce_debugmode_state): Accomodate new mode.
37         * doc/m4.texinfo (Debugging options): Mention change in the
38         default behavior.
39         (Debugmode): Mention new flag d.
40         (Operation modes): Mention interaction with -E.
41         (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
42         test its effect.
43         * tests/options.at (--debugmode): Update tests.
44         * tests/freeze.at (reloading debugmode): Likewise.
45         * NEWS: Document this.
46         Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
47         incompatible with Autoconf 2.62.
49 2008-08-22  Eric Blake  <ebb9@byu.net>
51         Improve --debugmode behavior.
52         * m4/m4module.h (m4_debug_decode): Simplify interface.
53         * m4/debug.c (m4_debug_decode): Remove parameter, and handle
54         setting the new value.
55         * modules/gnu.c (debugmode): Adjust caller.
56         * src/freeze.c (reload_frozen_state): Likewise.
57         * src/main.c (main): Likewise.
58         (usage): Fix default for --debug.
59         * doc/m4.texinfo (Debugging options): Add an example.
61 2008-08-21  Eric Blake  <ebb9@byu.net>
63         Avoid regression in defn(undef).
64         * doc/m4.texinfo (Trace): Enhance test, to cover regression
65         recently fixed on the branch.
67 2008-08-18  Eric Blake  <ebb9@byu.net>
69         Remove deprecated -N option; fixes a regression from 2006-09-14.
70         * src/main.c (DIVERSIONS_OPTION): Delete.
71         (long_options, OPTSTRING, main): Remove -N/--diversions option.
72         * doc/m4.texinfo (Limits control): Remove it from the manual.
73         * NEWS: Mention that it is gone.
74         * tests/options.at (deprecated options): Update test.
76         Improve 'git diff' of manual source.
77         * .gitattributes (*.texi*): Add diff attribute.
78         * bootstrap: Tell git how to use it.
79         Inspired by Jim Meyering's similar patch for coreutils.
81 2008-08-07  Bruno Haible  <bruno@clisp.org>  (tiny change)
83         Run m4 tests prior to gnulib unit tests.
84         * Makefile.am (SUBDIRS): Swap order of directories.
86 2008-08-03  Eric Blake  <ebb9@byu.net>
88         Stage 26: Allow embedded NUL in macro definitions.
89         Clean up final few locations that did not track macro definitions
90         by length, to allow embedded NUL.  Make m4_arg_len callers aware
91         of issue of flattening builtins when determining length.
92         Memory impact: none.
93         Speed impact: none noticed.
94         * m4/m4module.h (m4_arg_len): Add parameter.
95         (M4ARGLEN): Provide default for the parameter.
96         * m4/m4private.h (includes): Share xmemdup0.h among all libm4
97         files.
98         * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
99         * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
100         * m4/symtab.c (includes): Likewise.
101         (m4_symbol_value_copy): Use xmemdup0.
102         * m4/module.c (install_macro_table): Likewise.
103         * src/freeze.c (reload_frozen_state): Likewise.
104         * tests/freeze.at (reloading nul): Enhance test.
105         * tests/null.m4: Likewise.
106         * tests/null.err: Update expected output.
107         * tests/null.out: Likewise.
109         Fix regression in commenting unbalanced quotes, from 2008-02-16.
110         * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
111         * m4/input.c (m4__next_token, m4_print_token): Supply new token
112         type for comments.
113         * m4/macro.c (expand_token): Penalize comments, as they can
114         contain unbalanced quotes; latent bug since 2007-12-07, exposed by
115         passing $@ references built from comments.
116         (expand_argument): Adjust caller.
117         * tests/others.at (Comments): Enhance test to catch it.
118         * NEWS: Mention the fix.
120 2008-07-30  Eric Blake  <ebb9@byu.net>
122         Fix regression in trace output, introduced 2008-05-08.
123         * m4/input.c (m4__push_symbol): When cloning chains, break pointer
124         back to original chain; latent bug from 2008-02-02 that did not
125         cause misbehavior until trace output read unfinished chain.
126         * tests/builtins.at (debug): Add test for this.
128 2008-07-28  Eric Blake  <ebb9@byu.net>
130         Optimize iteration examples.
131         * examples/forloop2.m4: Avoid excess indir, by passing current
132         counter value as parameter.
133         * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
134         ignored argument.
135         * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
136         documentation to match.
138 2008-07-26  Eric Blake  <ebb9@byu.net>
140         Give example for O(n) foreach on m4 1.4.x.
141         * examples/foreachq4.m4: New file.
142         * Makefile.am (dist_pkgdata_DATA): Distribute it.
143         * tests/others.at (recursion): Test it.
144         * doc/m4.texinfo (Improved foreach): Document linear foreach with
145         m4 1.4.5 and greater.
147 2008-07-19  Eric Blake  <ebb9@byu.net>
149         Resynchronize docs from branch.
150         * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
151         name, particularly since the old documentation didn't match code.
152         (Standard Modules): Add caveat about using __m4_version__.
154 2008-07-11  Eric Blake  <ebb9@byu.net>
156         Bump required automake to 1.10a; regression introduced 2008-01-22.
157         * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
158         1.10.1, since we also rely on pkglibexecdir.
159         * HACKING: Fix minimum requirement.
160         * bootstrap: Likewise.
161         * THANKS: Update.
162         Reported by Joel E. Denny.
164         Avoid bogus whitespace in @ovar, @dvar.
165         * doc/m4.texinfo (ovar, dvar): Add @c.
166         Based on patch by Ralf Wildenhues to Autoconf manual.
168 2008-06-23  Eric Blake  <ebb9@byu.net>
170         Adjust to new gnulib-tool layout.
171         * ltdl/m4/gnulib-cache.m4: Reformat.
173         Fix bootstrap comment.
174         * bootstrap: DOWNLOAD_PO was previously removed.
176 2008-06-19  Eric Blake  <ebb9@byu.net>
178         Revert speed regression from 2008-06-16.
179         * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
180         * modules/m4.c (numb_obstack): Likewise.
181         * m4/input.c (MATCH): Use fewer conditionals, and factor
182         adjustment of S...
183         (match_input): ...here for smaller code size.
184         * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
185         Supply trailing NUL to delimiters, to meet contract of faster
186         MATCH.
188 2008-06-18  Eric Blake  <ebb9@byu.net>
190         Whitespace cleanup.
191         * m4/m4module.h: Use consistent spacing for pointer parameters.
192         * m4/m4private.h: Likewise.
194         Stage 25b: Handle embedded NUL in changesyntax and friends.
195         Track quote and comment delimiters by length, to allow embedded
196         NUL.  Improve changesyntax to support assigning syntax to NUL.
197         Memory impact: none.
198         Speed impact: none noticed.
199         * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
200         Add parameter.
201         (m4_reset_syntax): New prototype.
202         * m4/syntax.c (add_syntax_set, subtract_syntax_set)
203         (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
204         handle embedded NUL.
205         (m4_set_syntax): Likewise.  Also, split code to reset the table...
206         (m4_reset_syntax): ...into a new function.
207         (m4_syntax_create): Adjust callers.
208         * m4/input.c (match_input, MATCH): Add parameter.
209         (m4__next_token, m4__next_token_is_open): Adjust callers.
210         * modules/m4.h (m4_expand_ranges_func): Add parameter.
211         * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
212         (changequote, changecom, translit, m4_expand_ranges): Track
213         delimiter length.
214         * modules/gnu.c (changesyntax): Handle embedded NUL.
215         * src/freeze.c (reload_frozen_state): Adjust callers.
216         * tests/freeze.at (reloading nul): Enhance test.
217         * tests/null.m4: Likewise.
218         * tests/null.out: Update expected output.
219         * tests/null.err: Likewise.
221 2008-06-16  Eric Blake  <ebb9@byu.net>
223         Stage 25a: Use obstack_printf for easier output.
224         Convert macro tracing and other locations to use obstack_printf
225         rather than hand-rolled equivalents.  Ensure that embedded NUL in
226         trace output does not truncate the trace string.
227         Memory impact: none.
228         Speed impact: noticeable penalty, from obstack_printf overhead.
229         * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
230         * m4/macro.c (trace_format): Delete; use obstack_printf instead.
231         (trace_header, trace_pre, trace_post): All callers updated.
232         * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
233         (m4_divert_text): Speed up syncline output.
234         * modules/m4.c (dumpdef): Handle embedded NUL.
235         (numb_obstack): Speed up eval output.
236         (maketemp): Use obstack_printf.
237         * modules/format.c (format): Likewise.
239         Add missing const qualifications.
240         * m4/resyntax.c (m4_resyntax_map): Declare array elements as
241         const.
242         * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
243         * modules/import.c (m4_builtin_table): Likewise.
244         * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
245         * modules/m4.c (m4_builtin_table): Likewise.
246         * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
247         * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
248         * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
249         * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
250         * modules/stdlib.c (m4_builtin_table): Likewise.
251         * modules/time.c (m4_builtin_table): Likewise.
252         * modules/traditional.c (m4_macro_table): Likewise.
254 2008-06-10  Eric Blake  <ebb9@byu.net>
256         Avoid corrupted frozen file if NUL appears on block boundary.
257         * m4/output.c (insert_file): Separate consecutive quotearg blocks
258         with \<newline>, in case last byte of first block was NUL.
260 2008-06-03  Eric Blake  <ebb9@byu.net>
262         Fix printf type mismatches.
263         * m4/m4module.h (m4_bad_argc): Alter parameter type.
264         * m4/m4private.h (struct m4_call_info): Alter call_id type.
265         * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
266         specifiers.
267         * m4/utility.c (m4_bad_argc): Likewise.
269         Borrow bootstrap ideas from gnulib.
270         * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
271         advertized subset of languages didn't work.  Use --skip-po
272         instead, for consistency with gnulib bootstrap.
273         (func_get_translations): Use rsync, not wget.
274         (func_update_po): Use a reference directory, to avoid changing
275         timestamps on unchanged .po files.
276         * TODO: Update accordingly.
278         Fix fallout from previous patch.
279         * doc/m4.texinfo (Builtin): Adjust expected output.
281 2008-06-02  Eric Blake  <ebb9@byu.net>
283         Stage 24c: Improve display of macro names with embedded NUL.
284         Quote instances of problematic characters in macro names when
285         presented to user.  Track location via call_info rather than
286         munging context for every expansion.
287         Memory impact: none.
288         Speed impact: slight penalty, due to more bookkeeping.
289         * m4/m4module.h (m4_push_string_init): Add parameters.
290         * m4/m4private.h (struct m4_macro_args): Remove argv0 and
291         argv0_len, now redundant with info.
292         (m4__push_wrapup_init): Add parameter.
293         * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
294         location from caller, rather than context.
295         (composite_peek, composite_read, match_input): Adjust callers.
296         * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
297         (m4_verror_at_line): Allow NUL in macro name.
298         * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
299         in trace.
300         (expand_macro): No longer munge context location.
301         (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
302         (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
303         * modules/gnu.c (builtin, indir): Likewise.
304         * tests/null.m4: Enhance test.
305         * tests/null.err: Adjust expected output.
306         * tests/null.out: Likewise.
308         Stage 24b: Allow embedded NUL in macro names.
309         Use length rather than NUL-termination when tracking macro names.
310         All APIs dealing with symbol table changed.
311         Memory impact: none.
312         Speed impact: slight penalty, due to more bookkeeping.
313         * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
314         (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
315         (m4_symbol_rename, m4_symbol_delete): Add length parameter.
316         (m4_string): New type.
317         * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
318         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
319         length.
320         * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
321         (m4__symtab_remove_module_references, symbol_destroy_CB)
322         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
323         (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
324         (m4_symbol_delete): Likewise.
325         * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
326         passing length.
327         * m4/macro.c (expand_token): Adjust all callers.
328         * m4/module.c (install_builtin_table, install_macro_table):
329         Likewise.
330         * m4/utility.c (m4_symbol_value_lookup): Likewise.
331         * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
332         * modules/m4.c (define, undefine, pushdef, popdef)
333         (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
334         (traceon, traceoff): Likewise.
335         * src/main.c (main): Likewise.
336         * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
337         * tests/freeze.at (reloading nul): Augment test.
338         * tests/null.out: Adjust expected output.
340         Stage 24a: Use full call context in error reporting.
341         Replace const char *macro_name with const m4_call_info *call, so
342         that the next patch can pass the length of macro_name with
343         embedded NUL.  Simplifies handling of global state.
344         Memory impact: none.
345         Speed impact: none noticed.
346         * m4/m4module.h (m4_error, m4_warn): Change parameter type.
347         (m4_error_at_line, m4_warn_at_line): Delete.
348         (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
349         (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
350         * m4/m4private.h (m4__next_token): Likewise.
351         * m4/utility.c (m4_verror_at_line): Alter parameter, and use
352         caller's location if caller is provided.
353         (m4_error, m4_warn): Change parameter type.
354         (m4_error_at_line, m4_warn_at_line): Delete.
355         (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
356         (m4_symbol_value_lookup): Adjust all callers.
357         * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
358         * m4/input.c (m4_skip_line, m4__next_token): Likewise.
359         * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
360         (process_macro): Likewise.
361         * modules/m4.h (m4_make_temp_func): Likewise.
362         * modules/evalparse.c (m4_evaluate): Likewise.
363         * modules/format.c (arg_int, arg_long, arg_double, format):
364         Likewise.
365         * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
366         (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
367         (renamesyms, syncoutput, regexp_compile, substitute)
368         (regexp_substitute, m4_resyntax_encode_safe): Likewise.
369         * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
370         (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
371         (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
372         Likewise.
373         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
374         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
375         Likewise.
376         * tests/options.at (--syncoutput): Add test for invalid
377         command-line argument.  Split xfailed portion...
378         (--syncoutput and diversions): ...into new test.
379         (unknown option): New test.
380         * tests/freeze.at (reloading unknown builtin): Update expected
381         output.
383         Adjust to recent gnulib change.
384         * configure.ac (AB_INIT): Delete, now that gnulib does this.
386 2008-05-28  Eric Blake  <ebb9@byu.net>
388         Improve frozen debugmode behavior.
389         * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
390         * src/main.c (main): Interleave -d with files.
391         * tests/options.at (--debugmode): Update test.
392         * tests/freeze.at (reloading debugmode): New test.
393         * doc/m4.texinfo (Debugging options, Debugmode): Document the
394         change.
395         * NEWS: Likewise.
397 2008-05-27  Eric Blake  <ebb9@byu.net>
399         Fix some testsuite failures on Solaris 8.
400         * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
401         broken.
402         * tests/others.at (stderr closed): Likewise.  Also support Solaris
403         wording for EBADF.
404         (stdin closed): Skip test if closed stdin gets reopened.
405         (stdout closed): Support Solaris wording for EBADF.
406         * tests/testsuite.at (AT_CHECK_M4): Likewise.
408         Fix configure message nesting, broken since 2001-09-20.
409         * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
410         not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
412         Support 'make dist' with BSD make.
413         * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
414         of the generated file tests/generated.at.
415         (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
416         * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
418 2008-05-24  Eric Blake  <ebb9@byu.net>
420         Test NUL in frozen files.
421         * tests/testsuite.at (AT_CHECK_M4): Add parameter.
422         * tests/freeze.at (reloading nul): New test.
423         (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
424         (reloading unknown builtin): Likewise.
426 2008-05-23  Eric Blake  <ebb9@byu.net>
428         Improve handling of frozen file errors.
429         * src/freeze.c (produce_frozen_state): Detect write failures.
430         (reload_frozen_state): Use close_stream.
431         * tests/freeze.at (freezing failure): New test.
432         * THANKS: Update.
433         Reported by Jean-Charles Longuet.
435 2008-05-19  Eric Blake  <ebb9@byu.net>
437         In frozen file, split consecutive strings with newline.
438         * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
439         (produce_frozen_state): Likewise for 'Q', 'C'.
440         (reload_frozen_state): Parse the new layout.
441         [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
442         * tests/freeze.at (loading format 2): Rewrite to new format.
443         (reloading unknown builtin): Likewise.
444         (loading format 1): Make sure backslash-newline is not
445         interpreted.
446         * doc/m4.texinfo (Frozen file format 2): Document the format.
447         * NEWS: Document this change.
449         Fix xgettext options.
450         * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
451         xgettext.
453         Fix spelling of René Seindal's name in --version output.
454         * ltdl/m4/gnulib-cache.m4: Import propername module.
455         * src/main.c (AUTHORS): Rewrite in terms of proper_name.
456         * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
457         * HACKING: Mention new prerequisite of gperf.
459 2008-05-18  Eric Blake  <ebb9@byu.net>
461         Allow freezing the trace status of macros.
462         * src/freeze.c (produce_symbol_dump): Let undefined traced macros
463         through.
464         (dump_symbol_CB): Also freeze trace state.
465         * tests/freeze.at (reloading traced macros): New test.
466         * doc/m4.texinfo (Using frozen files): Update documentation to
467         mention new state.
468         (Frozen file format 1): Improve synchronization with branch.
469         (Frozen file format 2): Reorder directives, and add `d', `t'.
470         * NEWS: Document this change.
472 2008-05-15  Eric Blake  <ebb9@byu.net>
474         Fix frozen file regression in pushdef stacks from 2001-09-01.
475         * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
476         just the current definition.
477         (reverse_symbol_value_stack): New helper method.
478         * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
479         (reloading pushdef stack): New test.
480         (reloading unknown builtin): Enhance test.
482 2008-05-13  Eric Blake  <ebb9@byu.net>
484         Fix frozen file regression in diversions from 2007-01-21.
485         * m4/output.c (insert_diversion_helper): Add parameter.
486         (m4_insert_file): Move contents...
487         (insert_file): ...to this new helper, with added parameter.
488         (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
489         Update callers.
490         * src/freeze.c (produce_mem_dump): Simplify.
491         * tests/freeze.at (large diversion): Test for this.
493         Improve error message when frozen file is invalid.
494         * src/freeze.c (decode_char): Add parameter.  Allow \<newline>
495         line continuations.
496         (reload_frozen_state): Track current line.
497         * tests/freeze.at (loading format 1, loading format 2): Update to
498         test this.
500 2008-05-10  Eric Blake  <ebb9@byu.net>
502         Detect integer overflow when loading frozen file.
503         * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
504         immediately on overflow.
505         * tests/freeze.at (loading format 2): Test this.
506         Reported by Jim Meyering.
508 2008-05-08  Eric Blake  <ebb9@byu.net>
510         Stage 23: allow tracing of indirect macro calls.
511         Track all trace information as part of the argv struct, rather
512         than temporarily resetting global state.  Teach indir to trace
513         macros that it invokes.
514         Memory impact: slight penalty, due to larger argv struct.
515         Speed impact: none noticed.
516         * m4/m4module.h (m4_input_block): Remove.
517         (m4_call_info): New opaque type.
518         (m4_trace_prepare, m4_arg_info): New prototypes.
519         (m4_macro_call, m4_push_string_finish, m4_input_print): Change
520         prototypes.
521         * m4/m4private.h (struct m4_macro_args): Add info field.
522         (struct m4_call_info): New structure.
523         (m4_arg_info): New accessor.
524         * m4/input.c (m4_input_block): Make typedef local.
525         (m4_push_string_init): Initialize length.
526         (m4_push_string_finish, m4_input_print): Change signature, so that
527         printing can be done before finalization.
528         (struct input_funcs): Add parameter to print_func.
529         (file_print, string_print, composite_print): Adjust accordingly.
530         * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
531         Change signatures for stacked trace messages, and for using call
532         context.
533         (trace_prepre): Export and rename...
534         (m4_trace_prepare): ...to this, for use by indir.  Alter signature
535         to use call context.
536         (collect_arguments): Alter signature, to manage new field.
537         (expand_macro): Change call context management.  Move tracing...
538         (m4_macro_call): ...here.  Remove redundant parameter.
539         (m4_arg_argc): New function.
540         (m4_make_argv_ref): Replace unused skip parameter with new trace
541         parameter; manage new field.
542         * modules/gnu.c (builtin, indir): Adjust callers.
543         * src/main.c (usage): Update debugmode flag summary.
544         * tests/null.m4: Enhance test.
545         * tests/null.err: Update expected output.
546         * tests/macros.at (Tracing Hanoi Towers): Likewise.
547         * doc/m4.texinfo (Trace): Mention more about trace formatting.
548         (Debugmode): Enhance description of 'c' and 'x'.  Enhance test to
549         cover line numbering details in traces.
550         (Debuglen): Enhance test to cover indir tracing.
551         * NEWS: Mention these changes.
552         Reported by Akim Demaille in the autoconf TODO file in 2000.
554 2008-05-07  Eric Blake  <ebb9@byu.net>
556         Test for traceon regression just fixed in branch-1.6.
557         * doc/m4.texinfo (Trace): Enhance test.
558         * NEWS: Port news item from branch.
560 2008-05-05  Eric Blake  <ebb9@byu.net>
562         Stage 22: allow builtin token concatenation outside $@.
563         Adjust the input and argument parsing engines to append builtins
564         alongside text.  Make define warn when builtins must be
565         flattened.
566         Memory impact: slight penalty, with fewer builtins flattened.
567         Speed impact: slight penalty, from more bookkeeping.
568         * m4/m4module.h (m4_is_arg_composite): New prototype.
569         (m4_symbol_value_copy): Change return type.
570         (m4_arg_text): Add parameter.
571         (M4ARG): Adjust callers.
572         * m4/m4private.h: Adjust comments.
573         * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
574         flattened.
575         * m4/input.c (init_builtin_token): Add parameter, and allow
576         concatenating builtins.
577         (m4__next_token): Adjust caller.
578         * m4/macro.c (m4_is_arg_composite): New function.
579         (expand_argument): Allow builtin concatenation.
580         (m4_arg_text): Add parameter.
581         (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
582         (m4_arg_equal): Fix comparison of builtin tokens.
583         * modules/m4.c (define, pushdef): Warn when flattening builtins.
584         * doc/m4.texinfo (Define): Remove dead comment.
585         (Defn): Update to reflect code changes.
586         * tests/builtins.at (defn): Remove xfail.
587         * NEWS: Document this change.
589 2008-05-03  Eric Blake  <ebb9@byu.net>
591         Document define_blind.
592         * doc/m4.texinfo (Ifelse): Add a new composite macro.
593         * THANKS: Update.
594         Suggested by Mike R.
596 2008-05-01  Eric Blake  <ebb9@byu.net>
598         Avoid -Wshadow compiler warnings.
599         * m4/output.c (threshold_diversion_CB): s/div/diversion/.
600         * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
601         (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
602         (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
603         (m4_push_arg, m4__push_arg_quote): s/index/arg/.
604         * modules/format.c (format): Likewise.
605         * modules/m4.c (ifelse): Likewise.
607         Improve debugmode testing, based on recent branch-1.6 regressions.
608         * doc/m4.texinfo (Debugmode): Enhance tests.
609         * tests/generate.awk: Run tests from stdin, not input.m4.  Support
610         stderr munging when using -I examples.
612         Fix regression in define from 2008-02-22.
613         * m4/m4module.h (m4_symbol_value_copy): Add parameter.
614         * m4/symtab.c (m4_symbol_value_copy): Support copying $@
615         back-references.
616         * m4/macro.c (expand_argument): Update callers.
617         * modules/m4.c (define, pushdef): Likewise.
618         * tests/builtins.at (define): Enhance test to catch this.
620 2008-04-21  Eric Blake  <ebb9@byu.net>
622         Simplify previous patch.
623         * tests/m4.in: Compress assignment.
624         Suggested by Gary V. Vaughan.
626         Fix --disable-shared testsuite regression from previous patch.
627         * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
628         will also work.
630         Fix spelling of attribution to Christopher Strachey.
631         * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
632         * THANKS: Update.
633         Reported by Fernando Carrijo.
635 2008-04-17  Eric Blake  <ebb9@byu.net>
637         Fix testsuite bug when SIGPIPE is ignored.
638         * tests/builtins.at (divert): Consume all of m4's output, to avoid
639         spurious write failure.
640         * src/main.c (main): In batch mode, restore default handling of
641         SIGPIPE.
642         * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
643         * THANKS: Update.
644         Reported by Bob Proulx, via his autobuilder.
646 2008-04-15  Eric Blake  <ebb9@byu.net>
648         Fix 'make installcheck' after './configure --prefix-progname'.
649         * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
650         program name.
651         (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
652         * tests/builtins.at (patsubst): Avoid space-tab.
653         (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
654         * tests/options.at (--debugfile): Likewise.
655         * tests/others.at (stdin seekable): Likewise.
656         (fstab): Avoid space-tab.
657         * Makefile.am (installcheck-local): Accomodate transformed name.
658         (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
659         during 'make distcheck'.
660         * cfg.mk: New file, borrowed from branch.
662         Update prerequisite tools to match recent releases.
663         * configure.ac (AC_PREREQ): Rely on released autoconf.
664         (LT_PREREQ): Rely on released libtool.
665         * tests/testsuite.at (m4_version_prereq): Update dependence.
666         * bootstrap: Mention prerequisites.
668         Work around OS/2 limitation of printf(1).
669         * tests/null.m4: Use m4, not printf, to generate NUL byte.
670         * tests/null.out: Check for esyscmd failure.
671         Reported by Elbert Pol.
673 2008-04-14  Eric Blake  <ebb9@byu.net>
675         Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
676         Improve arg_print to handle builtin tokens when printing to a
677         known chain, rather than always flattening builtins.  This allows
678         m4wrap and $@ back-references to handle embedded builtin tokens.
679         Memory impact: none.
680         Speed impact: slight penalty, from more bookkeeping.
681         * m4/m4module.h (m4_push_builtin): Add parameter.
682         (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
683         (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
684         * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
685         (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
686         ...to these, in some cases adding a parameter.
687         (m4__append_builtin): New prototype.
688         * m4/builtin.c (m4_builtin_print): Alter signature to print
689         builtin to a growing symbol chain.
690         * m4/symtab.c (m4__symbol_value_print): Alter signature.
691         (m4_symbol_print, dump_symbol_CB): Adjust callers.
692         * m4/input.c (builtin_peek, builtin_read, builtin_unget)
693         (builtin_print, builtin_funcs): Delete, handled via composite
694         blocks now.
695         (struct m4_input_block): Delete u.builtin member.
696         (init_builtin_token): Only use composite block.
697         (m4__append_builtin): New function.
698         (m4_push_builtin, m4__push_wrapup_init): Alter signature.
699         (m4__push_symbol): Allow builtin tokens.
700         (m4__push_wrapup_finish): Rename.
701         (composite_print, m4_print_token): Adjust callers.
702         * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
703         tokens.
704         (m4__arg_print): Alter signature.
705         (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
706         callers.
707         * modules/m4.c (m4wrap): Allow builtin tokens.
708         (defn, errprint): Adjust callers.
709         * modules/gnu.c (builtin): Likewise.
710         * doc/m4.texinfo (M4wrap): New test.
711         (Debuglen): Adjust expected output.
713         Stage 21a: Optimize checks for end of input.
714         Create a new polymorphic input block type, which always fails with
715         CHAR_EOF, so that remaining input routines no longer have to check
716         for NULL input block.
717         Memory impact: none.
718         Speed impact: noticeable improvement, from fewer conditionals.
719         * m4/input.c (eof_funcs, input_eof): New objects.
720         (eof_peek, eof_read, eof_unget): New functions.
721         (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
722         (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
723         (m4_input_exit): Use placeholder to guarantee non-NULL isp and
724         wsp.
725         (next_char): Rename retry to allow_unget, and change sense for
726         easier manipulation.  All callers changed.
728         Improve OS/2 detection.
729         * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
730         are defined, not just the first.  The testsuite ensures that
731         exactly one gets defined.
732         * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
733         what other pre-defined macros it has.
734         * THANKS: Update.
735         Reported by Elbert Pol.
737         Ensure __m4_version__ is unquoted.
738         * tests/builtins.at (__m4_@&t@version__): Augment test.
740         Avoid GNU make failure on tarball.
741         * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
743 2008-04-10  Eric Blake  <ebb9@byu.net>
745         Allow back-referenced macro names; fixes 2008-03-13 regression.
746         * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
747         * m4/utility.c (m4_symbol_value_lookup): Change signature.
748         * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
749         Adjust all callers.
750         * tests/others.at (ifndef): New test.
752         Be namespace clean for M4 version; fixes 2008-04-08 regression.
753         * configure.ac (version): Rename...
754         (M4_VERSION): ...to this, since using 'version' broke po.m4.
756 2008-04-09  Eric Blake  <ebb9@byu.net>
758         Mention 1.4.11 release.
759         * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
760         (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
761         (Format): Add test of C99 hex-float parsing.
762         * NEWS: Mention 1.4.11 release.
763         * tests/builtins.at (divert): Add additional test.
765 2008-04-08  Eric Blake  <ebb9@byu.net>
767         Overhaul inter-version releases to work with git.
768         * configure.ac (version): New variable, which has nicer version
769         contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
770         (TIMESTAMP): Delete, since CVS id expansion died with transition
771         to git.
772         (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
773         * build-aux/mkstamp: Delete, no longer used.
774         * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
775         rebuilds when timestamps don't matter.
776         (MKSTAMP): Delete, no longer used.
777         (EXTRA_DIST): No longer worry about mkstamp.
778         (.version): New rule and distributed file.
779         (doc/m4.1, tests/package.m4): Depend on .version, not
780         configure.ac, for timestamp.
781         * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
782         * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
783         * src/main.c (main): Likewise.
785 2008-03-28  Eric Blake  <ebb9@byu.net>
787         Use GNUmakefile module.
788         * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
789         * Makefile.am: Split off maintainer rules...
790         * maint.mk: ...into this new file.
792 2008-03-18  Eric Blake  <ebb9@byu.net>
794         Stage 20b: make m4wrap obey POSIX fifo ordering.
795         Improve input engine to support location changes within symbol
796         chains, then convert m4wrap to always build symbol chain.
797         Memory impact: none.
798         Speed impact: slight penalty, from more m4wrap bookkeeping.
799         * m4/m4module.h (m4_wrap_args): Add prototype.
800         * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
801         (struct m4__symbol_chain): Add struct u_l.
802         * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
803         new link type.
804         (composite_peek, composite_read, composite_clean): Handle location
805         link.
806         * m4/macro.c (m4_wrap_args): New function.
807         * modules/m4.c (m4wrap): Use it.
808         * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
809         (Extensions): Document extension of multiple arguments.
810         (Location, Improved m4wrap): Adjust example to match FIFO order.
811         * tests/builtins.at (wrap): Likewise.
812         * NEWS: Document this change.
814 2008-03-17  Eric Blake  <ebb9@byu.net>
816         Stage 20a: reduce unget's in input engine.
817         Now that out-of-range input placeholders like CHAR_BUILTIN are
818         consumed outside of next_char, next_token should always consume
819         rather than peek at the first character.  Fewer peeks results in
820         less ungetc overhead.
821         Memory impact: none.
822         Speed impact: noticeable improvement, from fewer function calls.
823         * m4/input.c (struct input_funcs): Alter read_func prototype.
824         (next_char, file_read, buildin_read, string_read, composite_read):
825         Add allow_argv parameter.
826         (init_builtin_token, init_argv_symbol): Require all prior input to
827         be consumed.
828         (m4_skip_line, match_input, consume_syntax): Adjust callers.
829         (m4__next_token): Consume first byte without peek.
831         Update for fresh bootstrap.
832         * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
834 2008-03-15  Eric Blake  <ebb9@byu.net>
836         Document join, in order to fix bug in m4wrap example.
837         * examples/join.m4: New file.
838         * examples/wraplifo2.m4: Likewise.
839         * Makefile.am (EXTRA_DIST): Add new files.
840         * doc/m4.texinfo (Improved m4wrap): New node.
841         (Defn, Location): Enhance tests.
842         (Shift): Document the composite macro join.
843         (Incompatibilities): Move documentation of LIFO vs. FIFO...
844         (M4wrap): ...here, to match improved example.
846 2008-03-13  Eric Blake  <ebb9@byu.net>
848         Stage 19c: allow builtin tokens in more macros.
849         Allow builtin tokens inside symbol chains, although for now, they
850         are not allowed inside comments or quotes.  Enable builtin token
851         handling in more macros, if only to consistently diagnose invalid
852         macro names.
853         Memory impact: none.
854         Speed impact: slight impact, due to more bookkeeping.
855         * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
856         prototypes.
857         * m4/m4private.h (enum m4__symbol_chain_type): Add
858         M4__CHAIN_FUNC.
859         (struct m4__symbol_chain): Add builtin member.
860         * m4/utility.c (m4_symbol_value_lookup): New method.
861         * m4/builtin.c (m4_builtin_print): New function.
862         * m4/symtab.c (m4_symbol_value_print): Use it.
863         * m4/input.c (builtin_print): Likewise.
864         (m4__push_symbol): Allow pushing builtin tokens.
865         (composite_peek, composite_read, composite_unget, composite_clean)
866         (composite_print): Handle builtin tokens.
867         (init_builtin_token): Allow builtin tokens from composite input.
868         (m4__next_token): Flatten builtins inside comment or string.
869         * m4/macro.c (expand_argument): Strengthen assertion.
870         (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
871         Handle builtin tokens.
872         (arg_symbol): Add parameter, and allow NULL level.
873         (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
874         (m4_arg_text): Ensure all builtins have been flattened.
875         * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
876         (undefine, m4_dump_symbols): Warn on invalid macro names.
877         (ifdef, ifelse, shift): Handle builtin tokens.
878         * modules/gnu.c (m4symbols): Likewise.
879         * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
880         behavior.
881         (Debuglen): Likewise, and remove xfail.
882         * NEWS: Mention the change.
884         Stage 19b: invert sense of bit for handling builtin tokens.
885         Pass builtin tokens by default, rather than as the exception, so
886         that the logic can consistently refer to flattening arguments.
887         Memory impact: none.
888         Speed impact: none.
889         * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
890         (M4_BUILTIN_GROKS_MACRO): Rename...
891         (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
892         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
893         (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
894         this.
895         * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
896         (m4_symbol_value_groks_macro): Likewise...
897         (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
898         this.
899         * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
900         (m4_symbol_value_flatten_args): ...to this.
901         * m4/macro.c (collect_arguments): Accomodate changed sense.
902         * m4/module.c (m4__module_open): Require arguments if flattening
903         is requested.
904         * m4/input.c (m4_push_string_finish): For now, flatten all
905         builtins pushed as back-references.
906         * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
907         * modules/import.c (m4_builtin_table): Likewise.
908         * modules/load.c (m4_builtin_table): Likewise.
909         * modules/modtest.c (m4_builtin_table): Likewise.
910         * modules/mpeval.c (m4_builtin_table): Likewise.
911         * modules/perl.c (m4_builtin_table): Likewise.
912         * modules/shadow.c (m4_builtin_table): Likewise.
913         * modules/stdlib.c (m4_builtin_table): Likewise.
914         * modules/time.c (m4_builtin_table): Likewise.
915         * modules/m4.c (m4_builtin_table): Likewise.
916         (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
917         are stringized without preprocessor expansion.
918         * doc/m4.texinfo (Defn): Update comments to match reality.
919         (Debuglen): Update test now that user macros pass builtin tokens.
921         Stage 19a: sort and cache builtins loaded by a module.
922         Rather than repeatedly using dlsym to browse the builtin table,
923         copy off the table at module load time.  Then, the input engine
924         merely refers to the copy instead of duplicating information.
925         Memory impact: slight penalty, due to more memory per module, but
926         offset by less memory in input engine.
927         Speed impact: slight improvement, due to faster builtin lookups.
928         * m4/m4module.h (m4_set_symbol_value_builtin): Delete.  Use
929         m4_builtin_find_by_* instead.
930         (m4_builtin_find_by_func): Change return type.
931         * m4/m4private.h (m4__builtin): New struct.
932         (m4_module): Add sorted list of loaded builtins.
933         (struct m4_symbol_value): Change type of builtin value.
934         (m4__set_symbol_value_builtin): New prototype and fast accessor.
935         (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
936         new field type.
937         * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
938         (m4__set_symbol_value_builtin): ...and populate additional fields,
939         based on new type.
940         (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
941         new field type.
942         * m4/module.c (install_builtin_table): Use cached table.
943         (compare_builtin_CB): New helper function.
944         (m4__module_open): Populate table.
945         (module_remove): Free table.
946         * m4/builtin.c (compare_builtin_name_CB): New helper function.
947         (m4_builtin_find_by_name): Rewrite to use sorted table.
948         (m4_builtin_find_by_func): Change return type.
949         * m4/input.c (struct m4_input_block): Simplify u_b, since most
950         fields can be determined from builtin.
951         (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
952         (m4__next_token): Alter parsing so that only init_builtin_token
953         consumes a builtin.
954         (builtin_print, m4_push_builtin): Adjust all users.
955         * tests/macros.at (Arity, defn, and freeze): Fix typo.
957         Consistently cast malloc results, for C++ compilation.
958         * m4/builtin.c (m4_builtin_find_by_name): Add cast.
959         * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
960         (m4_hash_resize, maybe_grow): Likewise.
961         * m4/m4.c (m4_create): Likewise.
962         * m4/macro.c (expand_macro): Likewise.
963         * m4/output.c (m4_tmpname): Likewise.
964         * m4/path.c (search_path_add): Likewise.
965         * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
966         (symtab_fetch): Likewise.
967         * m4/syntax.c (m4_syntax_create): Likewise.
968         * modules/gnu.c (regexp_compile): Likewise.
969         * src/main.c (main): Likewise.
970         * src/freeze.c (reload_frozen_state): Likewise.
972 2008-03-06  Eric Blake  <ebb9@byu.net>
974         Fix nested builtin(`shift',$@) regression from 2008-02-23.
975         * m4/macro.c (make_argv_ref): Don't output expansion text when
976         making wrapper for builtin or indir.
977         * tests/builtins.at (builtin): New test.
978         * NEWS: Document the fix.
979         Reported by Andreas Schwab.
981 2008-03-04  Eric Blake  <ebb9@byu.net>
983         The gnulib module free was deprecated.
984         * ltdl/m4/gnulib-cache.m4: Remove free module.
986 2008-02-29  Eric Blake  <ebb9@byu.net>
988         Import news from 1.4.10b.
989         * NEWS: Update from branch.
991 2008-02-23  Eric Blake  <ebb9@byu.net>
993         Stage 18: try harder to reuse argv in recursion.
994         When pushing arguments that contain an existing $@ ref, reuse the
995         ref rather than creating another layer of wrappers.
996         Memory impact: noticeable improvement, due to better $@ reuse.
997         Speed impact: noticeable improvement, due to O(n^2) to O(n)
998         reduction in unboxed recursion.
999         * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1000         (m4_push_args): Let make_argv_ref take care of pending data.
1001         * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1002         performance capability.
1003         * tests/others.at (recursion): Add tests to avoid performance
1004         regression.
1006 2008-02-22  Eric Blake  <ebb9@byu.net>
1008         Update NEWS.
1009         * NEWS: Document change to __gnu__ on 2008-02-11.
1011         Stage 17: pass argv through quoted strings.
1012         Allow the concatenation of $@ references with other text input
1013         inside quoted contexts, which requires distinguishing between a
1014         wrapper around many arguments vs. a reference serving as part of a
1015         single argument.  Also optimize based on whether argv contains
1016         builtin tokens that might need flattening to the empty string.
1017         Memory impact: noticeable improvement, due to O(n^2) to O(n)
1018         reduction from total reuse of $@ references.
1019         Speed impact: noticeable improvement, due to O(n^2) to O(n)
1020         reduction in boxed recursion.
1021         * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1022         (M4ARGLEN): Adjust definition.
1023         * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1024         (struct m4_symbol_value): Add wrapper and has_func members.
1025         (struct m4_macro_args): Add flatten and has_func members.
1026         * m4/input.c (append_quote_token): Return argv refs inside quoted
1027         strings.
1028         (init_argv_symbol): Populate new fields.
1029         * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1030         (m4_make_argv_ref): Likewise.
1031         (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1032         fields.
1033         (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1034         new parameter.
1035         * modules/m4.c (ifelse): Adjust caller.
1037 2008-02-22  Gary V. Vaughan  <gary@gnu.org>
1039         Fix regression in argument collection, from 2008-01-21.
1040         * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1041         undo argument collection optimisation for strings, so that
1042         m4_print_token doesn't abort when it otherwise receives an
1043         unprintable M4_SYMBOL_VOID type token.
1045 2008-02-20  Eric Blake  <ebb9@byu.net>
1047         Stage 16: cache quotes and improve m4_arg_print.
1048         Cache rather than always copying quotes when pushing $@ refs; in
1049         particular, reconstruct single-byte quotes on the fly.  Allow NUL
1050         through m4wrap.  Improve sharing of code that prints arguments.
1051         Memory impact: slight improvement, due to cached quotes.
1052         Speed impact: slight improvement, due to less copying.
1053         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
1054         (m4_arg_print): Adjust prototypes.
1055         (m4_dump_args): Delete.
1056         (m4_push_wrapup): Split...
1057         (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
1058         prototypes.
1059         * m4/m4private.h (struct m4_syntax_table): Add cached_quote
1060         member.
1061         (m4__quote_cache, m4__quote_uncache): New prototypes.
1062         * m4/syntax.c (m4_syntax_create): Initialize the cache.
1063         (m4__quote_cache): New function.
1064         (m4_set_syntax): Update caller.
1065         * m4/symtab.c (m4_symbol_value_print): Add parameter.
1066         (m4_symbol_print, dump_symbol_CB): Adjust all callers.
1067         * m4/utility.c (m4_dump_args): Delete; callers should use
1068         m4_arg_print instead.
1069         * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
1070         implementation, and allow embedded NUL.
1071         (m4_print_token, pop_input, composite_print, composite_peek):
1072         (composite_read, append_quote_token): Adjust all callers.
1073         * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
1074         Likewise.
1075         (m4_arg_print): Add parameters.
1076         (trace_pre): Rewrite in terms of m4_arg_print.
1077         * modules/m4.c (errprint): Likewise.
1078         (m4wrap): Rewrite to allow embedded NUL.
1079         (dumpdef): Adjust caller.
1080         * doc/m4.texinfo (Debuglen): Enhance debuglen test.
1081         * tests/null.m4: Test for NUL in m4wrap.
1082         * tests/null.out: Update expected output.
1084         Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
1085         * m4/utility.c (m4_verror_at_line): Properly terminate the string.
1086         Reported by Ralf Wildenhues.
1088         * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
1090 2008-02-19  Eric Blake  <ebb9@byu.net>
1092         Clean up example on filtering defined symbols.
1093         * doc/m4.texinfo (Foreach, Improved foreach): Document another
1094         shortcoming in foreach.m4, and improve filter example by using
1095         foreach2.m4.
1097         * src/main.c (usage): Fix typo.
1099 2008-02-18  Eric Blake  <ebb9@byu.net>
1101         Avoid some magic numbers.
1102         * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
1103         (CHAR_RETRY): Define in terms of UCHAR_MAX.
1104         * m4/syntax.c (m4_syntax_create, set_syntax_set)
1105         (reset_syntax_set, check_is_single_quotes)
1106         (check_is_single_comments, check_is_macro_escaped)
1107         (m4_set_quotes, m4_set_comment): Likewise.
1108         * modules/gnu.c (regexp_compile): Likewise.
1109         * modules/m4.c (translit): Likewise.
1110         * src/freeze.c (produce_syntax_dump): Likewise.
1111         Reported by Ralf Wildenhues.
1113 2008-02-16  Eric Blake  <ebb9@byu.net>
1115         Add regression test for multi-character quote recursion.
1116         * examples/foreach2.m4: Use $0 rather than spelling out name.
1117         * examples/foreachq2.m4: Likewise.
1118         * examples/forloop2.m4: Likewise.
1119         * examples/hanoi.m4: Likewise.
1120         * examples/trace.m4: Likewise.
1121         * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1122         (Improved foreach): Adjust dump from file.
1124         Stage 15: return argv refs back to collect_arguments.
1125         Collect an entire $@ reference at once rather than one argument at
1126         a time, outside of quotes (but inside quotes, $@ is still
1127         flattened for now).  The skip_last field allows concatenation of
1128         $@ with other text when collecting arguments.
1129         Memory impact: noticeable improvement, due to better reuse of $@.
1130         Speed impact: noticeable improvement, due to less parsing.
1131         * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
1132         (enum m4__token_type): Add M4_TOKEN_ARGV.
1133         (struct m4__symbol_chain): Add skip_last member to argv link.
1134         (m4__next_token): Add parameter.
1135         * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
1136         (composite_peek, m4__next_token): Add new parameter.
1137         (composite_read, append_quote_token): Support argv in quotes.
1138         (init_argv_symbol): New function.
1139         (m4__push_symbol, match_input, consume_syntax)
1140         (m4__next_token_is_open, m4_print_token): Adjust callers.
1141         * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
1142         (arg_mark, m4_arg_text, make_argv_ref): Likewise.
1143         (expand_argument, collect_arguments): Handle new token.
1144         (arg_symbol): Drill through $@ reference.
1145         * m4/syntax.c (set_quote_age): Detect disabled comments.
1146         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
1148 2008-02-15  Eric Blake  <ebb9@byu.net>
1150         * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
1152 2008-02-13  Eric Blake  <ebb9@byu.net>
1154         Fix texinfo grammar.
1155         * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
1156         (History): Use @: after abbreviations.
1157         (M4exit): Use correct Latin abbreviation.
1158         (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
1159         between sentences.
1161 2008-02-11  Eric Blake  <ebb9@byu.net>
1163         Allow builtin text macros to specify number of arguments.
1164         * m4/m4module.h (struct m4_macro): Add argument limits to builtin
1165         text macros.
1166         * m4/module.c (install_macro_table): Allow text macros to warn on
1167         extra arguments.
1168         * modules/gnu.c (m4_macro_table): Update all clients.
1169         * modules/load.c (m4_macro_table): Likewise.
1170         * modules/mpeval.c (m4_macro_table): Likewise.
1171         * modules/perl.c (m4_macro_table): Likewise.
1172         * modules/shadow.c (m4_macro_table): Likewise.
1173         * modules/traditional.c (m4_macro_table): Likewise.
1174         * modules/modtest.c (m4_macro_table): Likewise.  Also add text
1175         macros, for testing this.
1176         * doc/m4.texinfo (Standard Modules): Update text, and enhance
1177         test.
1178         * tests/modules.at (modules: text): New test.
1180         Fix regression in command line -D option, from 2006-08-25.
1181         * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
1182         * m4/m4module.h: Fix typo.
1183         * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
1184         of arguments.
1185         * tests/macros.at (Command line define): Enhance test.
1186         * tests/others.at (nul character): Enhance test.
1187         * tests/null.m4: Likewise.
1188         * tests/null.out: Likewise.
1190         Use gnulib's git-merge-changelog driver when available.
1191         * .gitattributes: Add merge attributes for ChangeLog.
1192         * bootstrap: Install driver, if not already present.
1194 2008-02-06  Eric Blake  <ebb9@byu.net>
1196         Fix security hole introduced 2007-11-23.
1197         * m4/utility.c (m4_verror_at_line): Properly escape macro names.
1198         * src/main.c (main): Manage quoteargs defaults.
1199         * doc/m4.texinfo (Indir): Document and test this.
1201         Using raw strtod is not portable.
1202         * ltdl/m4/gnulib-cache.m4: Import the strtod module.
1204 2008-02-02  Eric Blake  <ebb9@byu.net>
1206         Consistently use size_t for number of arguments.
1207         * m4/m4module.h (m4_builtin_func): Alter prototype.
1208         (struct m4_builtin): Adjust type of min_args, max_args.
1209         (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
1210         (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
1211         (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
1212         (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
1213         (m4_arg_print, m4_push_arg): Adjust all clients.
1214         * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
1215         (m4_macro_args): Adjust type of various fields.
1216         (m4__push_arg_quote): Adjust all clients.
1217         * m4/input.c (m4_pop_wrapup): Likewise.
1218         * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
1219         (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
1220         (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
1221         (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
1222         (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
1223         * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
1224         * modules/evalparse.c (m4_evaluate): Likewise.
1225         * modules/gnu.c (changesyntax): Likewise.
1226         * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
1227         (undivert, traceon, traceoff): Likewise.
1228         * modules/m4.h (m4_dump_symbols_func): Likewise.
1229         * modules/perl.c (perleval): Likewise.
1231         Stage 14b: allow pushing argv references.
1232         Push a $@ reference to the input engine in one go, rather than
1233         pushing each element.  For now, argument collection still gets one
1234         argument of a $@ at a time; but the penalties of this patch make
1235         it easier to manage $@ efficiently in future patches.
1236         Memory impact: noticeable penalty, due to larger struct and O(n)
1237         to O(n^2) on unboxed recursion.
1238         Speed impact: noticeable penalty, due to more bookkeeping.
1239         * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
1240         fields.
1241         (struct m4_macro_args): Add level field.
1242         (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
1243         * m4/input.c (m4__push_symbol, composite_peek, composite_read)
1244         (composite_unget, composite_clean, composite_print): Support $@
1245         refs.
1246         * m4/macro.c (collect_arguments): Populate new field.
1247         (expand_macro): Move argv cleanup...
1248         (m4__arg_adjust_refcount): ...to this new function.
1249         (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
1250         (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
1251         helper functions, to add parameters.
1252         (m4_push_args): Adjust caller.
1253         * m4/symtab.c (m4_symbol_value_print): Likewise.
1255         Stage 14a: allow printing argv references.
1256         Refactor symbol-value printing code for better sharing, and to
1257         allow printing a contiguous text representation of a $@ ref.
1258         Memory impact: none.
1259         Speed impact: none.
1260         * m4/m4module.h (m4_arg_print): New prototype.
1261         (m4_symbol_value_print): Alter prototype.
1262         * m4/input.c (struct input_funcs): Add parameter to peek_func.
1263         (file_peek, builtin_peek, string_peek): Ignore new parameter.
1264         (composite_peek): Ignore new parameter, for now.
1265         (composite_clean, pop_input): Rework to minimize indirection, and
1266         to avoid infinite recursion in next patch.
1267         * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
1268         (m4_arg_print): New function.
1269         * m4/symtab.c (m4_symbol_value_print): Update signature.
1270         (m4_symbol_print): Update caller.
1271         * m4/output.c (m4_shipout_string_trunc): Update comments.
1272         * m4/syntax.c (set_quote_age): Require comma as argument separator
1273         when dealing with $@ as a unit.
1274         * tests/builtins.at (ifelse): Augment test.
1275         * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
1277 2008-01-31  Eric Blake  <ebb9@byu.net>
1279         Kill hack for M4 1.4.4.
1280         * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
1281         we require new enough autoconf which in turn requires M4 1.4.5.
1283 2008-01-31  Gary V. Vaughan  <gary@gnu.org>
1284         and Eric Blake  <ebb9@byu.net>
1286         Depend on new libtool to use non-recursive build.
1287         * configure.ac (LT_PREREQ): Bump to alpha release version.
1288         (LTDL_INIT): Choose nonrecursive mode.  Perform sanity check that
1289         installed libtool has correct symbols.
1290         * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
1291         top level.
1292         (AM_CPPFLAGS): Drop directories covered by libtool.
1293         (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
1294         (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
1295         macros, used by libtool.
1296         (lib_LTLIBRARIES): Also used by libtool.
1297         (ltdl/libltdlc.la): Delete, now that libtool does this.
1298         * bootstrap: Mention new requirements.
1299         (LIBTOOLIZE): Provide default program, and run libtoolize prior to
1300         autoreconf.
1301         (autoreconf): Also neutralize libtoolize, since it is run early.
1302         * HACKING: Mention updated prerequisites.
1304 2008-01-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1306         Fix build failure if installed libltdl is used.
1307         * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
1309 2008-01-28  Eric Blake  <ebb9@byu.net>
1311         Depend on newer autoconf, for testsuite -C dir.
1312         * Makefile.am (CD_TESTDIR): Delete, no longer required.
1313         (check-local, installcheck-local, clean-local-tests): Use new -C
1314         option from autotest.
1315         * configure.ac (AC_PREREQ): Bump to 2.61a.347.
1316         * bootstrap: Mention new dependency.
1317         * HACKING: Likewise.
1319 2008-01-27  Eric Blake  <ebb9@byu.net>
1321         Stage 13: push composite text tokens.
1322         Support pushing composite tokens, allowing back-references to be
1323         reused through multiple macro expansions.  Add hueristic that
1324         avoids creating new reference when pushing existing references.
1325         Memory impact: noticeable improvement due to better reference
1326         reuse, except for O(n) to O(n^2) copying in boxed recursion.
1327         Speed impact: slight penalty, due to more bookkeeping.
1328         * m4/m4private.h (m4__push_symbol): Adjust prototype.
1329         * m4/input.c (m4__push_symbol): Add parameter, and support
1330         composite tokens.
1331         (append_quote_token): Add parameter, and support inlining of short
1332         text.
1333         (m4__next_token): Adjust caller.
1334         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1336 2008-01-26  Eric Blake  <ebb9@byu.net>
1338         Stage 12c: add macro for m4_arg_len.
1339         Make a common action easier to type.
1340         Memory impact: none.
1341         Speed impact: none.
1342         * m4/m4module.h (M4ARGLEN): New macro.
1343         * m4/macro.c (process_macro): Adjust all callers.
1344         * m4/utility.c (m4_dump_args): Likewise.
1345         * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1346         (substr): Likewise.
1347         * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1348         (renamesyms): Likewise.
1349         * modules/stdlib.c (setenv): Likewise.
1351         Stage 12b: add m4_string_pair.
1352         Make passing quote delimiters around more efficient.
1353         Memory impact: none.
1354         Speed impact: slight penalty, due to more bookkeeping.
1355         * m4/m4module.h (m4_string_pair): New type.
1356         (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1357         (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1358         Alter signature.
1359         * m4/m4private.h (struct m4_string): Delete.
1360         (struct m4_syntax_table): Combine quote and comment members.
1361         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1362         (m4_get_syntax_ecomm): Adjust accessors.
1363         (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1364         accessors.
1365         * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
1366         Alter signatures.
1367         * m4/input.c (string_print, composite_print, m4_input_print):
1368         All callers updated.
1369         * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
1370         (check_is_single_quotes, m4_set_quotes, set_quote_age)
1371         (m4_get_syntax_lquote, m4_get_syntax_rquote)
1372         (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
1373         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1374         (m4_get_syntax_comments): Likewise.
1375         * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
1376         * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
1377         Likewise.
1378         * modules/m4.c (dumpdef, m4_make_temp): Likewise.
1379         * src/freeze.c (produce_frozen_state): Likewise.
1380         * tests/freeze.at (reloading unknown builtin): Update test.
1382         Stage 12a: make m4_symbol_chain a union.
1383         Shrink size of symbol chains by using a union.
1384         Memory impact: slight improvement, due to smaller struct.
1385         Speed impact: slight improvement, due to less bookkeeping.
1386         * m4/m4private.h (enum m4__symbol_chain_type): New enum.
1387         (struct m4_symbol_chain): Rename...
1388         (struct m4__symbol_chain): ...to this, since it is internal.
1389         * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
1390         callers updated.
1391         * m4/input.c (struct m4_input_block, m4__push_symbol)
1392         (composite_peek, composite_read, composite_unget)
1393         (composite_clean, composite_print, m4__make_text_link)
1394         (append_quote_token): Likewise.
1395         * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
1396         (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
1397         (m4_push_args): Likewise.
1399 2008-01-23  Eric Blake  <ebb9@byu.net>
1401         Adjust to recent libtool interface change.
1402         * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
1403         (LT_WITH_LTDL): Delete, now that it is obsolete.
1404         (LTDL_INIT): Use new libtool macro.
1406 2008-01-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1407         and Eric Blake  <ebb9@byu.net>
1409         Rely on newer automake.
1410         * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
1411         distribution.
1412         * bootstrap: Update automake requirement.
1413         (func_version): Fix --version output, broken since 2007-08-06.
1414         * HACKING: Likewise.  Add lzma requirement.
1415         * Makefile.am (clean-local-src): Not needed any more with newest
1416         Automake.
1417         (clean-local): Adjust.
1418         * TODO: Remove completed item.
1420 2008-01-22  Eric Blake  <ebb9@byu.net>
1422         Doc tweak.
1423         * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
1424         example.
1426 2008-01-21  Eric Blake  <ebb9@byu.net>
1428         Stage 11: full circle for single argument references.
1429         Pass quoted strings through to argument collection in a single
1430         action, so that an argument can be reused throughout macro
1431         recursion if it remains unchanged.
1432         Memory impact: noticeable improvement, due to more reuse in
1433         argument collection stacks; O(n^2) to O(n) on boxed recursion.
1434         Speed impact: noticeable improvement, due to less copying.
1435         * m4/m4module.h (m4_arg_text): Add parameter.
1436         (M4ARG): Adjust.
1437         * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
1438         (m4__make_text_link): New prototype.
1439         (struct m4_symbol_chain): Add quote_age member.
1440         (struct m4_symbol_value): Add end member to chained symbol.
1441         (struct m4_macro_args): Add wrapper member.
1442         * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
1443         (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
1444         composite tokens.
1445         * m4/input.c (make_text_link): Rename...
1446         (m4__make_text_link): ...to this, and export.
1447         (m4_push_string_finish): Adjust caller.
1448         (make_text_link, m4__push_symbol): Update new field.
1449         (file_read, builtin_read, string_read, composite_read, next_char):
1450         Add parameter.
1451         (m4_skip_line, match_input, consume_syntax): Adjust callers.
1452         (append_quote_token): New function.
1453         (m4__next_token): Pass quoted strings onto argument collection.
1454         (m4_print_token) [DEBUG_INPUT]: Update.
1455         * m4/macro.c (expand_argument): Collect composite arguments.
1456         (collect_arguments): Update new field.
1457         (expand_macro): Reduce ref-count of back-references after use.
1458         (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
1459         names.
1460         (m4_is_arg_text): Also recognize composite symbols as text.
1461         (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
1462         (m4_arg_equal): Compare composite symbols.
1463         (m4_push_arg, m4_push_args): Handle composite symbols.
1464         (m4_arg_symbol): Relax assertion.
1465         (process_macro): Use single-argument references.
1466         * m4/output.c (m4_shipout_string_trunc): Update comment.
1467         * tests/macros.at (Rescanning macros): Augment test.
1469 2008-01-16  Eric Blake  <ebb9@byu.net>
1471         Stage 10: avoid extra copying of strings and comments.
1472         When collecting tokens that are immune to further expansion, avoid
1473         copying data from one obstack to another by outputting it into the
1474         destination obstack to begin with.  Also reduce copying done in
1475         format builtin.
1476         Memory impact: slight improvement, due to better obstack usage.
1477         Speed impact: noticeable improvement, due less data copying.
1478         * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
1479         modules.
1480         * m4/m4private.h (m4__token_type): Adjust prototype.
1481         * m4/input.c (m4__next_token): Support new parameter.
1482         * m4/macro.c (m4_macro_expand_input, expand_token)
1483         (expand_argument, collect_arguments): Adjust callers.
1484         * modules/m4.c (ntoa): Tighten buffer size.
1485         * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
1486         * modules/format.c (arg_int, arg_long, arg_double): New helper
1487         functions, to detect overflow or unparsed characters.
1488         (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
1489         missing or excess arguments.
1490         (format): Likewise, and also output directly into obstack if there
1491         is room.
1492         * doc/m4.texinfo (History): Update for new year.
1493         (Format): Test for new warnings.
1495 2008-01-15  Eric Blake  <ebb9@byu.net>
1497         * TODO: Update with some newer URLs.
1499         Verify linear `index'.
1500         * tests/builtins.at (index): New test.
1501         (translit): Make test take longer, to make quadratic algorithms
1502         more apparent.
1504 2007-12-20  Eric Blake  <ebb9@byu.net>
1506         Stage 9: share rather than copy single-arg refs.
1507         Use hooks of previous patch to create back-references to arguments
1508         in the input engine, and inline short text rather than always
1509         creating a FIFO link.  Also start testing embedded NUL behavior.
1510         Until the argument collection engine also shares references, the
1511         memory usage increases.
1512         Memory impact: noticeable penalty, due to longer life of argv
1513         changing O(n) to O(n^2) on boxed recursion.
1514         Speed impact: slight improvement, due less data copying.
1515         * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
1516         * m4/m4module.h (m4_arg_scratch): New prototype.
1517         * m4/m4private.h (m4__push_symbol): Add parameter.
1518         (m4_arg_scratch): Add fast accessor.
1519         (struct m4): Add expansion_level member, taken...
1520         * m4/macro.c (expansion_level): ...from here.  Adjust all users.
1521         (expand_argument): Minor cleanup.
1522         (expand_macro): Track scratch space per macro call.
1523         (m4_arg_scratch): New function.
1524         (m4_make_argv_ref): Call new function.
1525         (m4_push_arg): Push reference to $0.
1526         (m4_push_args): Rework separator usage, since separators will
1527         usually be inlined.
1528         (process_macro): Allow embedded NUL.
1529         * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
1530         (m4__push_symbol): Add parameter.  Inline short strings, and save
1531         references through rescanning.
1532         * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
1533         * modules/m4.c (errprint, index): Handle NUL transparently.
1534         (dumpdef, translit): Use scratch space, rather than expansion
1535         stack.
1536         * modules/gnu.c (renamesyms, m4symbols): Likewise.
1537         * tests/others.at (nul character): New test.
1538         (iso8859): Quote absolute file name, remove XFAIL.
1539         * tests/iso8859.m4: Avoid raw NUL in output.
1540         * tests/null.m4: New file.
1541         * tests/null.out: Likewise.
1542         * tests/null.err: Likewise.
1543         * Makefile.am (OTHER_FILES): Distribute new files.
1544         * .gitattributes: Treat new files as text.
1546 2007-12-17  Eric Blake  <ebb9@byu.net>
1548         Stage 8: extend life of references into argv.
1549         Add hooks to lengthen the lifetime of arguments reused in a macro
1550         expansion, rather than always discarding arguments at the end of
1551         expand_macro.  Rework the expand_macro obstacks to handle longer
1552         lifetimes.  For now, the hooks remain unused.
1553         Memory impact: slight penalty, due to larger structs.
1554         Speed impact: slight penalty, due to more bookkeeping.
1555         * m4/system_.h (obstack_regrow): Delete.
1556         * m4/m4private.h (struct m4_symbol_chain): Add level field.
1557         (m4__push_symbol): Adjust prototype.
1558         (m4__adjust_refcount): New prototype.
1559         (DEBUG_MACRO) [DEBUG]: New debug control.
1560         (struct m4__macro_arg_stacks): New structure.
1561         (struct m4): Add arg_stacks, stacks_count fields.
1562         * m4/m4module.h (m4_make_argv_ref): Add parameter.
1563         * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
1564         context->arg_stacks.
1565         (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
1566         conditional on M4_DEBUG_MACRO envvar.
1567         (collect_arguments): Adjust signature.
1568         (expand_macro): Rework obstack handling.
1569         (m4__adjust_refcount, arg_mark): New functions.
1570         (m4_make_argv_ref): Populate new field.
1571         (m4_push_arg, m4_push_args): Track inuse.
1572         (process_macro): One less cast.
1573         * m4/m4.c (m4_delete): Clean up arg_stacks.
1574         * m4/input.c (make_text_link): Use new field.
1575         (m4__push_symbol, file_clean): Update signature.
1576         (composite_read): Bump refcount when done with reference.
1577         (composite_clean): New function.
1578         (pop_input): Adjust caller.
1579         * m4/debug.c (m4_debug_message): Make assertion match comment.
1580         * modules/gnu.c (builtin, indir): Adjust callers.
1581         * tests/builtins.at (ifelse): New test.
1582         (exp): Move and rename...
1583         * tests/others.at (countdown): ...to this.
1584         * doc/m4.texinfo (Improved foreach): Fix tracing usage in
1585         example.
1587 2007-12-13  Eric Blake  <ebb9@byu.net>
1589         Yet more rewording.
1590         * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
1591         the previous patch.
1593         * THANKS: Update.
1595 2007-12-13  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
1597         * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
1598         example.
1599         Reported by Giovanni Toffetti.
1601 2007-12-11  Eric Blake  <ebb9@byu.net>
1603         Stage 7: use chained input support in input parser.
1604         Allow the LIFO input engine to rescan a macro expansion composed
1605         of smaller chunks of FIFO data, rather than the old approach of a
1606         monolithic string.  For now, all chunks are still copied.
1607         Memory impact: slight penalty, due to FIFO chain overhead.
1608         Speed impact: slight penalty, due to extra bookkeeping.
1609         * m4/m4private.h (m4__push_symbol): New prototype.
1610         (struct m4_symbol_chain): Add const-safety.
1611         * m4/symtab.c (m4_symbol_value_print): Simplify.
1612         (dump_symbol_CB): Update caller.
1613         * m4/input.c (struct m4_input_block): Alter u_c member, first
1614         introduced 2006-10-25, but unused until now.
1615         (composite_peek, composite_read, composite_unget)
1616         (composite_print, init_builtin_token): Rewrite accordingly.
1617         (m4_push_wrapup): No longer need trailing NUL.
1618         (m4__push_symbol, make_text_link): New functions.
1619         (m4_push_string_finish): Use them.
1620         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1621         (expand_macro): Simplify logic of nesting_limit.
1622         * src/main.c (main): Likewise.
1623         * doc/m4.texinfo (Dumpdef): Augment test.
1625 2007-12-08  Eric Blake  <ebb9@byu.net>
1627         Stage 6: convert builtins to push arg at a time.
1628         Add new methods to factor all builtins whose expansion includes an
1629         argument, making back-reference creation easier in future patches.
1630         Factor out length-limited printing to obstacks, and use -1 rather
1631         than 0 for unlimited length.
1632         Memory impact: none.
1633         Speed impact: slight improvement, due to better code sharing.
1634         * m4/m4module.h (m4_shipout_text): Rename...
1635         (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
1636         that does not worry about sync lines.
1637         (m4_shipout_string_trunc): New prototype.
1638         * m4/output.c (m4_shipout_text): Rename...
1639         (m4_divert_text): ...to this.
1640         (m4_shipout_string): Move guts...
1641         (m4_shipout_string_trunc): ...to this new function.
1642         * m4/macro.c (m4_push_arg, m4_push_args): New functions.
1643         (expand_token, process_macro): Update callers.
1644         * m4/input.c (string_print): Likewise.
1645         * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
1646         Likewise.
1647         * modules/gnu.c (patsubst): Likewise.
1648         (debuglen): Use SIZE_MAX for unlimited debug length.
1649         * src/main.c (main): Likewise.
1650         * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
1651         zero.
1653 2007-12-07  Eric Blake  <ebb9@byu.net>
1655         Minor security fix: Quote output of mkstemp.
1656         * modules/m4.c (m4_make_temp): Produce quoted output.
1657         * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
1658         tests.
1660         Stage 5: add notion of quote age.
1661         Cache the quoting rules that were in effect when a string was
1662         parsed, to avoid reparsing that string if no changequote or other
1663         quote age change took place in the meantime.  A quote_age of 0 is
1664         always safe, but does not benefit from caching.
1665         Memory impact: slight improvement, due to smaller struct in input
1666         engine.
1667         Speed impact: slight penalty, due to more bookkeeping.
1668         * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
1669         (m4_set_symbol_value_text): Adjust prototype.
1670         (m4_has_syntax): Factor out the unsigned char cast.
1671         * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
1672         quote_age members.
1673         (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
1674         functions at this point.
1675         (struct m4_symbol_value, struct m4_macro_args): Add quote_age
1676         member.
1677         (m4_set_symbol_value_text): Adjust fast accessor.
1678         (m4_get_symbol_value_quote_age): New fast accessor.
1679         * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
1680         (m4_get_symbol_value_quote_age): New function.
1681         (m4_symbol_value_copy): Adjust callers.
1682         * m4/macro.c (expand_token): Add parameter, and track quote age.
1683         (expand_argument, collect_arguments): Track quote age.
1684         (m4_macro_expand_input, process_macro, m4_make_argv_ref)
1685         (m4_macro_expand_input): Update callers.
1686         (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
1687         * m4/input.c: Comment cleanups.
1688         (struct m4_input_block): Reduce size.
1689         (m4__next_token): Report quote age.
1690         (m4_push_builtin, init_builtin_token): Update callers.
1691         * m4/utility.c (skip_space): Adjust callers.
1692         * m4/module.c (install_macro_table): Likewise.
1693         * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
1694         (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
1695         quote age.
1696         (set_quote_age): New helper function.
1697         (check_is_single_quotes, check_is_single_comments): Adjust
1698         callers.
1699         * src/freeze.c (reload_frozen_state): Likewise.
1700         * src/main.c (main): Likewise.
1701         * modules/m4.c (define, pushdef): No need to set macro text.
1702         * tests/builtins.at (changequote, defn): New tests.
1703         * examples/wrapfifo.m4: New file.
1704         * examples/wraplifo.m4: New file.
1705         * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
1707 2007-12-04  Eric Blake  <ebb9@byu.net>
1709         Fix builds with OpenBSD make.
1710         * Makefile.am (HELP2MAN): New macro.
1711         (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
1712         srcdir.
1713         * README: Update copyright.
1714         * HACKING: Mention help2man and makeinfo dependencies.
1716 2007-11-29  Eric Blake  <ebb9@byu.net>
1718         Stage 4: route indir, builtin through ref; make argv opaque.
1719         Finish making struct opaque to all but the input engine, by
1720         reworking obstack usage in expand_macro to better support creation
1721         of a $@ reference.  Canonicalize the empty argument, to allow
1722         pointer comparison optimizations.
1723         Memory impact: slight penalty, due to larger struct.
1724         Speed impact: slight improvement, due to fewer function calls.
1725         * m4/system_.h (obstack_regrow): Fix precedence.
1726         * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
1727         New prototypes.
1728         (struct m4_macro_args): Move...
1729         * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
1730         to modules.  Add has_ref member.
1731         (bool_bitfield): New helper typedef.
1732         (struct m4_symbol_chain): Add flatten and len members.
1733         * m4/macro.c (empty_symbol): New placeholder, for optimizing
1734         comparison with empty string.
1735         (m4_macro_expand_input): Initialize it.
1736         (collect_arguments): Alter signature, and populate new fields.
1737         (trace_pre, trace_post): Remove redundant parameter.
1738         (expand_macro): Alter handling of obstacks.
1739         (m4_arg_symbol): Account for wrapped argv.
1740         (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
1741         (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
1742         * modules/m4.c (ifelse, syscmd): Likewise.
1743         * modules/evalparse.c (m4_evaluate): Likewise.
1744         (undefine, popdef, m4_dump_symbols): Optimize.
1745         * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
1746         methods.
1747         (changesyntax, regexp): Optimize.
1748         * m4/output.c (diversion_storage): Use typedef.
1750         Stage 3b: cache length, rather than computing it, in modules.
1751         Use cached token length in builtins and output engine.
1752         Memory impact: none.
1753         Speed impact: noticeable improvement, due to fewer function calls.
1754         * m4/hash.c (m4_hash_remove): Avoid double free on remove
1755         failure.
1756         * m4/output.c (m4_shipout_string): Change semantics of len param.
1757         (m4_shipout_int): Use cached length.
1758         * m4/input.c (m4_push_string_finish): Likewise.
1759         * modules/m4.h (m4_make_temp_func): Add parameter.
1760         * m4/macro.c (expand_token, m4_arg_len): Use cached length.
1761         (collect_arguments, expand_macro): Alter signature.
1762         (trace_format): Don't use out-of-scope buffer.
1763         (process_macro): All callers changed.
1764         * m4/utility.c (m4_dump_args): Likewise.
1765         * m4/symtab.c (m4_symbol_value_print): Likewise.
1766         * modules/gnu.c (__file__, __program__, builtin, indir)
1767         (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
1768         renamesyms, patsubst, regexp, regexp_compile): Likewise.
1769         * modules/load.c (m4modules): Likewise.
1770         * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
1771         (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
1772         * modules/perl.c (perleval): Likewise.
1773         * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
1774         (hostname, uname, setenv): Likewise.
1775         * modules/mpeval.c (numb_obstack): Likewise.
1776         * src/freeze.c (dump_symbol_CB): Likewise.
1777         * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
1778         * tests/builtins.at (mkstemp): Likewise.
1779         * tests/others.at (iso8859): XFAIL this test, now that
1780         length-based handling allows NUL through part but not all of M4.
1782 2007-11-28  Eric Blake  <ebb9@byu.net>
1784         Stage 3a: cache length, rather than computing it, in libm4.
1785         Cache the length of a token in the input engine and symbol table,
1786         to avoid repeating lots of strlen calls.  Additionally, by using
1787         obstack length rather than strlen, the input engine can now
1788         support embedded NUL.
1789         Memory impact: slight penalty, due to larger struct.
1790         Speed impact: slight improvement, due to fewer function calls.
1791         * m4/m4module.h (struct m4_macro_args): Cache length.
1792         (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
1793         (m4_set_symbol_value_text): Change signature.
1794         * m4/m4private.h (struct m4_symbol_value): Store string length.
1795         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
1796         (m4_set_symbol_value_placeholder): Update accordingly.
1797         (m4_set_symbol_value_text): Change signature.
1798         (m4_get_symbol_value_len): New accessor.
1799         * m4/input.c (struct m4_input_block, string_peek, string_read)
1800         (string_unget, string_print, m4_push_string_finish)
1801         (m4_push_wrapup): Track length of string input.
1802         (m4__next_token): Adjust all users of symbol text to track length,
1803         too.
1804         * m4/macro.c (expand_argument, collect_arguments): Likewise.
1805         * m4/module.c (install_macro_table): Likewise.
1806         * modules/gnu.c (builtin, indir): Likewise.
1807         * modules/m4.c (define, pushdef): Likewise.
1808         * src/main.c (main): Likewise.
1809         * src/freeze.c (reload_frozen_state): Likewise.
1810         * m4/symtab.c (m4_symbol_value_copy): Likewise.
1811         (m4_get_symbol_value_len): New function.
1812         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
1813         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
1814         Adjust implementation.
1816 2007-11-27  Eric Blake  <ebb9@byu.net>
1818         Stage 2: use accessors, not direct reference, into argv.
1819         Outside of macro.c, use accessor methods rather than direct access
1820         into the argv struct.
1821         Memory impact: none.
1822         Speed impact: slight penalty, due to increased function calls.
1823         * m4/m4private.h (m4_arg_argc): New fast accessor.
1824         * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
1825         (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
1826         prototypes.
1827         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
1828         (m4_macro_call): Make argc unsigned.
1829         (M4ARG): Use new accessors.
1830         * modules/m4.c (define, pushdef): Likewise.
1831         (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
1832         (traceon, traceoff): Make argc unsigned.
1833         * modules/m4.h (m4_dump_symbols_func): Likewise.
1834         * modules/evalparse.c (m4_evaluate): Likewise.
1835         * modules/gnu.c (builtin, indir): Use new accessors.
1836         (changesyntax): Make argc unsigned.
1837         * modules/perl.c (perleval): Likewise.
1838         * m4/utility.c (m4_dump_args): Use new accessors.
1839         * m4/macro.c (trace_pre): Likewise.
1840         (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
1841         (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
1842         (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
1843         usage.
1845 2007-11-24  Eric Blake  <ebb9@byu.net>
1847         Stage 1: convert m4_symbol_value** into new object.
1848         Pass a variable-size wrapper structure instead of an array to
1849         builtins, so that subsequent optimizations in the structure need
1850         not impact every builtin client.
1851         Memory impact: slight penalty, since struct is larger than array.
1852         Speed impact: slight penalty, due to increased bookkeeping.
1853         * ltdl/m4/gnulib-cache.m4: Import flexmember module.
1854         * m4/m4module.h (m4_macro_args): New type, will be opaque to
1855         modules later.
1856         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
1857         (m4_macro_call): Alter signature to use m4_macro_args object.
1858         (M4ARG): Redefine to access new struct.
1859         * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
1860         (struct m4_symbol_chain): New type.
1861         (struct m4_symbol_value): Add chain alternative.
1862         * m4/macro.c (collect_arguments): Build new struct.
1863         (expand_macro, m4_macro_call, process_macro, trace_pre)
1864         (trace_post): Adjust implementation to use it.
1865         * m4/utility.c (m4_dump_args): Likewise.
1866         * modules/gnu.c (builtin, indir): Likewise.
1867         * modules/format.c (format): Likewise.
1868         * modules/m4.h (m4_dump_symbols_func): Likewise.
1869         * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
1870         (shift, include, errprint, m4wrap): Likewise.
1871         * modules/evalparse.c (m4_evaluate): Likewise.
1873         Pass only macro name to utility functions.
1874         * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
1875         * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
1876         implementation.
1877         * m4/macro.c (m4_macro_call): Adjust callers.
1878         * modules/gnu.c (builtin, debuglen): Likewise.
1879         * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
1880         (substr): Likewise.
1881         * modules/evalparse.c (m4_evaluate): Likewise.
1882         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
1883         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
1884         Likewise.
1886 2007-11-23  Eric Blake  <ebb9@byu.net>
1888         Add macro name to debugfile messages.
1889         * m4/m4module.h (m4_debug_set_output): Add parameter.
1890         * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
1891         name through.
1892         * modules/gnu.c (debugfile): Adjust caller.
1893         * modules/m4.c (m4exit): Likewise.
1894         * src/main.c (main): Likewise.
1896         Factor out handling of macro name in error messages.
1897         * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
1898         (m4_warn_at_line): Add new parameter.
1899         * m4/utility.c (m4_verror_at_line): New helper method.
1900         (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
1901         parameter.
1902         (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
1903         changed.
1904         * m4/debug.c: Likewise.
1905         * m4/input.c: Likewise.
1906         * m4/macro.c: Likewise.
1907         * m4/module.c: Likewise.
1908         * m4/output.c: Likewise.
1909         * m4/path.c: Likewise.
1910         * modules/evalparse.c: Likewise.
1911         * modules/format.c: Likewise.
1912         * modules/gnu.c: Likewise.
1913         * modules/load.c: Likewise.
1914         * modules/m4.c: Likewise.
1915         * modules/mpeval.c: Likewise.
1916         * src/freeze.c: Likewise.
1917         * src/main.c: Likewise.
1919 2007-11-14  Eric Blake  <ebb9@byu.net>
1921         Handle some defn corner cases differently.
1922         * doc/m4.texinfo (Defn): Update documentation; although this still
1923         doesn't match the branch, since it may be changed before 2.0.
1924         * m4/macro.c (expand_argument): Consistently ignore builtins in
1925         concatenation contexts.
1926         * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
1928 2007-11-13  Eric Blake  <ebb9@byu.net>
1930         Note: Patches titled Stage 0 through N form a series of patches
1931         which decreases the algorithmic complexity of tail recursion in
1932         macro expansions from O(n^2) to O(n) in both time and memory, then
1933         performs cleanups, such as handling of embedded NUL, made easier
1934         by the code refactoring.
1936         Stage 0: Fix memory leak in tail recursion.
1937         Free expansion text in the input engine as soon as it is parsed,
1938         rather than when the recursive expansion completes.
1939         Memory impact: noticeable improvement, due to reduction from
1940         O(n^2) to O(n) on recursion.
1941         Speed impact: minor improvement, due to better memory usage.
1942         * m4/input.c (pop_input): Add flag parameter and return type.
1943         (next_char): Adjust caller.
1944         (m4_push_string_init): Let go of memory earlier.
1946 2007-11-07  Eric Blake  <ebb9@byu.net>
1948         * tests/macros.at (Rescanning macros): Test more corner cases.
1950 2007-11-06  Eric Blake  <ebb9@byu.net>
1952         * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
1954         * Makefile.am (tests/package.m4): Work around bash bug.
1955         Reported by Ralf Wildenhues.
1957 2007-11-05  Eric Blake  <ebb9@byu.net>
1959         For consistency with other GNU projects, use build-aux directory.
1960         * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
1961         build-aux.
1962         * bootstrap (config_aux_dir): Likewise.
1963         * Makefile.am (config_aux_dir): Likewise.
1964         * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
1966 2007-11-02  Eric Blake  <ebb9@byu.net>
1968         Update some documentation about version control.
1969         * NEWS: M4 is now stored in git.
1970         * HACKING: Likewise.
1971         * README: Likewise.
1972         * bootstrap: Likewise.
1973         * commit: Delete, now that CVS commits are no longer necessary.
1974         * ltdl/config/mailnotify: No longer necessary; git's patch
1975         generation and mail capability is more powerful.
1977         Update to recent gnulib changes.
1978         * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
1979         xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
1981 2007-11-01  Eric Blake  <ebb9@byu.net>
1983         Improve error message when early end of file occurs.
1984         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
1985         (M4wrap): Adjust to new messages.
1986         (Improved capitalize): Enhance test.
1987         * m4/m4private.h (m4__next_token): Adjust prototype.
1988         * m4/input.c (m4__next_token): Add new parameter, and improve
1989         error message.
1990         * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
1991         callers.
1992         (expand_argument): Likewise, and add parameter.
1994 2007-10-31  Eric Blake  <ebb9@byu.net>
1996         Test more corner cases.
1997         * tests/macros.at (Rescanning macros): Beef up test.
1998         * doc/m4.texinfo (Changecom): Beef up test.
1999         (Improved foreach): Document alternate foreachq style.
2000         * examples/foreachq3.m4: New file.
2001         * examples/loop.m4: New file.
2002         * Makefile.am (dist_pkgdata_DATA): Distribute them.
2004 2007-10-28  Eric Blake  <ebb9@byu.net>
2006         More test coverage for autoconf usage patterns.
2007         * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2008         * tests/macros.at (Rescanning macros): New test.
2009         * tests/builtins.at (include): Augment test.
2011 2007-10-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2013         * Makefile.am: Adjust getopt handling to latest gnulib layout.
2015 2007-10-27  Eric Blake  <ebb9@byu.net>
2017         Document one use of changequote(`(',`)').
2018         * doc/m4.texinfo (Changequote): Add new test, based on recent
2019         autoconf addition of m4_expand.
2021 2007-10-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2023         * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2025 2007-10-22  Eric Blake  <ebb9@byu.net>
2027         Never let printf failures go undetected.
2028         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2029         xprintf'.
2030         * m4/system_.h: Include xprintf.h.
2031         * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2032         use of printf, xprintf.
2033         * m4/input.c [DEBUG_INPUT]: Likewise.
2034         * m4/module.c [DEBUG_MODULES]: Likewise.
2035         * m4/output.c (m4_shipout_text, m4_shipout_int)
2036         (m4_freeze_diversions): Likewise.
2037         * m4/path.c [DEBUG_INCL]: Likewise.
2038         * m4/symtab.c [DEBUG_SYM]: Likewise.
2039         * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2040         * modules/modtest.c (export_test): Likewise.
2041         * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2042         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2043         Likewise.
2044         * src/main.c (usage): Likewise.
2045         * po/POTFILES.in: Adjust to new file.
2046         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2048 2007-10-18  Eric Blake  <ebb9@byu.net>
2050         Fix 'm4 -F file -t undefined'.
2051         * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
2052         * src/freeze.c (dump_symbol_CB): Also skip void symbols.
2053         * tests/freeze.at (reloading unknown builtin): Test for this bug.
2054         * m4/m4module.h (m4_symtab_apply): Add parameter.
2055         * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
2056         requested.
2057         (m4_symtab_delete, symtab_dump): Adjust callers.
2058         * modules/m4.c (m4_dump_symbols): Likewise.
2060 2007-10-09  Eric Blake  <ebb9@byu.net>
2062         Fix regexp regression of 2007-09-29.
2063         * modules/gnu.c (substitute): Allow NULL buf when no
2064         subexpressions were present.
2065         (regexp): Handle \ escapes even with empty regex.
2066         * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
2068         Cache regex compilation for another autoconf speedup.
2069         * modules/gnu.c (gnu_buf): Replace...
2070         (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
2071         (m4_pattern_buffer): Add fields.
2072         (m4_regexp_compile): Rename...
2073         (regexp_compile): ...to this, and drop no_sub parameter.
2074         Implement caching.
2075         (M4FINISH_HANDLER): Clean up entire cache.
2076         (m4_regexp_search): Rename...
2077         (regex_search): ...to this, adjust to new struct contents, and add
2078         no_sub parameter.
2079         (m4_regexp_substitute): Rename...
2080         (regexp_substitute): ...to this.
2081         (substitute, patsubst, regexp, renamesyms): Adjust callers.
2083 2007-10-02  Eric Blake  <ebb9@byu.net>
2085         Document quoting pitfalls in capitalize.
2086         * doc/m4.texinfo (Patsubst): Use the examples directory.  Also
2087         document shortfall.
2088         (Improved capitalize): New node.
2089         * examples/capitalize.m4: Update to match manual.
2090         * examples/capitalize2.m4: New file.
2092 2007-10-01  Eric Blake  <ebb9@byu.net>
2094         Another Autoconf usage pattern optimization.
2095         * modules/m4.c (m4_index): Optimize search for one byte.
2096         * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
2097         code paths.
2099 2007-09-29  Eric Blake  <ebb9@byu.net>
2101         Optimize for Autoconf usage pattern.
2102         * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
2104         * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
2106 2007-09-24  Eric Blake  <ebb9@byu.net>
2108         Create .gitignore alongside .cvsignore.
2109         * bootstrap (version control): Update to reflect git usage.
2111 2007-09-13  Eric Blake  <ebb9@byu.net>
2113         * AUTHORS: Fix typo.
2115 2007-09-12  Gary V. Vaughan  <gary@gnu.org>
2117         Be consistent about using 'module' for m4_module types and
2118         'handle' for lt_dlhandle types:
2120         * m4/m4private.h (m4_symbol_value): Rename handle element to
2121         method.  Changed all references.
2122         (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
2123         SYMBOL_HANDLE respectively.  Changed all references.
2124         * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
2125         * m4/builtin.c (m4_builtin_find_by_name)
2126         (m4_builtin_find_by_func): Use module as the parameter name for
2127         pointers of type 'm4_module'.
2128         * m4/module.c (module_remove, m4_get_module_name)
2129         (install_builtin_table, install_macro_table)
2130         (m4_module_make_resident, m4__module_next, m4_module_refcount):
2131         Ditto.
2132         * src/freeze.c (produce_module_dump): Ditto.
2133         * m4/input.c (m4_input_block): Rename handle element to method.
2134         Changed all references.
2135         * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
2136         * modules/load.c: Use module as the variable name for pointers
2137         of type 'm4_module'.
2138         * modules/m4.c: Ditto.
2139         * modules/perl.c: Ditto.
2140         * modules/shadow.c: Ditto.
2142 2007-09-07  Eric Blake  <ebb9@byu.net>
2144         Add refcount builtin.
2145         * modules/load.c (refcount): New builtin.
2146         (m4modules): Use correct type.
2147         * doc/m4.texinfo (Refcount): New section.
2148         * m4/m4private.h (struct m4_module): Add refcount member.
2149         (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
2150         * m4/module.c (m4_module_load): Add symbols to table on first
2151         load by m4, regardless of other libltdl loads of same module.
2152         (m4_module_refcount): Use new struct member, rather than relying
2153         on libltdl count which might be inflated by unrelated loads.
2154         (m4__module_interface): Optimize.
2155         (m4__module_next, m4__module_find): Avoid assertions that could
2156         trigger with unrelated libltdl loads.
2157         (m4__module_open): Track m4 load count.
2158         (m4__module_exit): Only unload what m4 loaded.
2159         (module_remove): Track m4 unloads.
2160         * NEWS: Document new builtin.
2162         More conversion to m4_module*.
2163         * src/freeze.c (produce_module_dump, dump_symbol_CB)
2164         (reload_frozen_state): Use correct type.
2165         * m4/input.c (struct m4_input_block): Likewise.
2166         * m4/symtab.c (dump_symbol_CB): Likewise.
2168         * AUTHORS: Simplify, to match libtool and autoconf layout.
2169         * THANKS: Sync with branch.
2171 2007-09-06  Eric Blake  <ebb9@byu.net>
2173         Wrap lt_dlhandle in struct m4_module.
2174         * m4/m4module.h (includes): No longer require clients to know
2175         about lt_dlhandle.
2176         (m4_module): New opaque declaration.
2177         (m4_export): Delete unused type.
2178         (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
2179         (m4_module_finish_func, m4_module_load, m4_get_module_name)
2180         (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
2181         wrapper.
2182         (m4_module_makeresident, m4_module_refcount): New declarations.
2183         * m4/m4private.h (includes): Move <ltdl.h> here.
2184         (m4_module): New declaration.  Simple for now, but intended for
2185         growth.
2186         (m4__module_open, m4__module_next, m4__module_find)
2187         (m4__symtab_remove_module_references): Use new wrapper.
2188         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2189         Likewise.
2190         * m4/module.c (m4_get_module_name, m4_module_import)
2191         (m4_module_load): Likewise.
2192         (install_builtin_table, install_macro_table): Likewise.  Also,
2193         change return type since these always returned NULL and no one
2194         used the result.
2195         (m4_module_makeresident, m4_module_refcount): New functions.
2196         (m4_module_unload, m4__module_next, m4__module_find): Use new
2197         wrapper.
2198         (m4__module_open): Populate new wrapper, and associate it with the
2199         lt_dlhandle.
2200         (m4__module_exit): Use new wrapper.
2201         (module_remove): Likewise.  Reclaim storage on last use.
2202         (module_close): Delete, and inline into module_remove.
2203         * m4/symtab.c (m4__symtab_remove_module_references): Use new
2204         wrapper.
2205         * modules/load.c (load_init): Use new API.
2206         * modules/m4.c (m4_export_table): Kill unused declaration.
2207         (m4_init): Use new API.
2208         * modules/shadow.c (shadow_init): Use new API.
2209         * src/main.c (main): Adjust callers.
2210         * src/freeze.c (reload_frozen_state): Likewise.
2211         * tests/modules.at (unload load module): New test.
2213 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
2215         * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
2216         * src/m4/.cvsignore: Add xstrtol module sources.
2218 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
2220         Work around a bug in darwin's awk:
2222         * bootstrap (func_get_translations): Use $AWK instead of raw
2223         `awk' so that the user can use an alternative implementation
2224         if the first awk in PATH doesn't behave as expected.
2225         (func_get_translations): The first awk script mangles the last
2226         entry passed to it for at least the awk implementation shipped
2227         with Darwin 8.10.1.  Capture $3 into a variable too to work-
2228         around that problem.
2230 2007-08-29  Gary V. Vaughan  <gary@gnu.org>
2232         As gnulib xstrtol is only used by main, and unconditionally pulls
2233         in a copy of getopt, undo bootstrap change from 2007-08-11 below,
2234         and copy the xstrtol code into src/ so that main() can use it
2235         without pushing the extra code into libm4:
2237         * bootstrap (src_modules): Add getopt and xstrtol modules.
2238         * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
2239         * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
2241 2007-08-11  Eric Blake  <ebb9@byu.net>
2243         Another upstream xstrtol change.
2244         * po/POTFILES.in: Track changes in files containing messages.
2245         * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
2246         need to grab it separately.
2247         * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2248         No longer needed.
2249         (size_opt): Adjust to latest xstrtol interface.
2251 2007-08-10  Eric Blake  <ebb9@byu.net>
2253         Documentation improvements.
2254         * doc/m4.texinfo (Defn): Resync with branch.
2255         (Compatibility, Extensions): Sync with branch.
2257 2007-08-07  Eric Blake  <ebb9@byu.net>
2259         Adjust to gnulib xstrtol changes.
2260         * src/main.c (size_opt): Adjust signature, so that error strings
2261         are easier to translate.
2262         (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
2263         for tracking long options.
2264         (main): Track which long option was used.
2265         * tests/options.at (--debuglen, --nesting-limit): Adjust to change
2266         in error message.
2267         (deprecated options): Test that --arglength spelling shows up in
2268         error message.
2270 2007-08-06  Eric Blake  <ebb9@byu.net>
2272         Normalize all GPL license notices.
2273         * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
2274         at this time.
2275         * Makefile.am: Update license wording.
2276         * bootstrap: Likewise.
2277         * commit: Likewise.
2278         * configure.ac: Likewise.
2279         * ltdl/config/mailnotify: Likewise.
2280         * ltdl/config/mkstamp: Likewise.
2281         * ltdl/m4/debug.m4: Likewise.
2282         * ltdl/m4/gmp.m4: Likewise.
2283         * ltdl/m4/m4-error.m4: Likewise.
2284         * ltdl/m4/m4-getopt.m4: Likewise.
2285         * ltdl/m4/m4-gettext.m4: Likewise.
2286         * ltdl/m4/m4-obstack.m4: Likewise.
2287         * ltdl/m4/m4-regex.m4: Likewise.
2288         * ltdl/m4/stackovf.m4: Likewise.
2289         * m4/builtin.c: Likewise.
2290         * m4/debug.c: Likewise.
2291         * m4/hash.c: Likewise.
2292         * m4/hash.h: Likewise.
2293         * m4/input.c: Likewise.
2294         * m4/m4.c: Likewise.
2295         * m4/m4module.h: Likewise.
2296         * m4/m4private.h: Likewise.
2297         * m4/macro.c: Likewise.
2298         * m4/module.c: Likewise.
2299         * m4/output.c: Likewise.
2300         * m4/path.c: Likewise.
2301         * m4/resyntax.c: Likewise.
2302         * m4/symtab.c: Likewise.
2303         * m4/syntax.c: Likewise.
2304         * m4/system_.h: Likewise.
2305         * m4/utility.c: Likewise.
2306         * modules/evalparse.c: Likewise.
2307         * modules/format.c: Likewise.
2308         * modules/gnu.c: Likewise.
2309         * modules/import.c: Likewise.
2310         * modules/load.c: Likewise.
2311         * modules/m4.c: Likewise.
2312         * modules/m4.h: Likewise.
2313         * modules/modtest.c: Likewise.
2314         * modules/mpeval.c: Likewise.
2315         * modules/perl.c: Likewise.
2316         * modules/shadow.c: Likewise.
2317         * modules/stdlib.c: Likewise.
2318         * modules/time.c: Likewise.
2319         * modules/traditional.c: Likewise.
2320         * po/Makevars: Likewise.
2321         * src/freeze.c: Likewise.
2322         * src/m4.h: Likewise.
2323         * src/main.c: Likewise.
2324         * src/stackovf.c: Likewise.
2325         * tests/builtins.at: Likewise.
2326         * tests/freeze.at: Likewise.
2327         * tests/generate.awk: Likewise.
2328         * tests/m4.in: Likewise.
2329         * tests/macros.at: Likewise.
2330         * tests/modules.at: Likewise.
2331         * tests/options.at: Likewise.
2332         * tests/others.at: Likewise.
2333         * tests/stackovf.test: Likewise.
2334         * tests/testsuite.at: Likewise.
2336 2007-07-22  Eric Blake  <ebb9@byu.net>
2338         Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2339         * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2340         * tests/builtins.at (divert): Enhance test to cover this.
2341         * THANKS: Update.
2342         Reported by Thomas Klausner.
2344 2007-07-20  Eric Blake  <ebb9@byu.net>
2346         Fix 'make distcheck' issues.
2347         * bootstrap: Add more files that might be more up-to-date in
2348         gnulib.
2349         * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2350         * config/m4/gnulib-cache.m4: Update to latest gnulib.
2352 2007-07-16  Eric Blake  <ebb9@byu.net>
2354         * po/POTFILES.in: Track recent translation additions from gnulib
2355         updates.
2357 2007-07-14  Eric Blake  <ebb9@byu.net>
2359         Reflect upstream license .texi changes.
2360         * doc/m4.texinfo (Copying): Rename node...
2361         (GNU General Public License): ...to this.
2362         (GNU Free Documentation License): Adjust node location.
2363         * local/doc/gpl-3.0.texi.diff: Remove file.
2365 2007-07-10  Eric Blake  <ebb9@byu.net>
2367         Upgrade to GPLv3, and document 1.4.10.
2368         * bootstrap: Adjust to GPLv3.
2369         (func_update): Port from branch.
2370         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2371         --local-dir=local --import gpl-3.0'.
2372         * doc/m4.texinfo (History): Mention 1.4.11.
2373         (Copying This Package): New appendix.
2374         * NEWS: Document 1.4.10.
2375         * local/doc/gpl-3.0.texi.diff: New file.
2376         * Makefile.am: Update license.
2377         (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
2378         * commit: Update license.
2379         * configure.ac: Likewise.
2380         * ltdl/config/mailnotify: Likewise.
2381         * ltdl/config/mkstamp: Likewise.
2382         * ltdl/m4/debug.m4: Likewise.
2383         * ltdl/m4/gmp.m4: Likewise.
2384         * ltdl/m4/m4-error.m4: Likewise.
2385         * ltdl/m4/m4-getopt.m4: Likewise.
2386         * ltdl/m4/m4-gettext.m4: Likewise.
2387         * ltdl/m4/m4-obstack.m4: Likewise.
2388         * ltdl/m4/m4-regex.m4: Likewise.
2389         * ltdl/m4/stackovf.m4: Likewise.
2390         * m4/builtin.c: Likewise.
2391         * m4/debug.c: Likewise.
2392         * m4/hash.c: Likewise.
2393         * m4/hash.h: Likewise.
2394         * m4/input.c: Likewise.
2395         * m4/m4.c: Likewise.
2396         * m4/m4module.h: Likewise.
2397         * m4/m4private.h: Likewise.
2398         * m4/macro.c: Likewise.
2399         * m4/module.c: Likewise.
2400         * m4/output.c: Likewise.
2401         * m4/path.c: Likewise.
2402         * m4/resyntax.c: Likewise.
2403         * m4/symtab.c: Likewise.
2404         * m4/syntax.c: Likewise.
2405         * m4/system_.h: Likewise.
2406         * m4/utility.c: Likewise.
2407         * modules/evalparse.c: Likewise.
2408         * modules/format.c: Likewise.
2409         * modules/gnu.c: Likewise.
2410         * modules/import.c: Likewise.
2411         * modules/load.c: Likewise.
2412         * modules/m4.c: Likewise.
2413         * modules/m4.h: Likewise.
2414         * modules/modtest.c: Likewise.
2415         * modules/mpeval.c: Likewise.
2416         * modules/perl.c: Likewise.
2417         * modules/shadow.c: Likewise.
2418         * modules/stdlib.c: Likewise.
2419         * modules/time.c: Likewise.
2420         * modules/traditional.c: Likewise.
2421         * po/Makevars: Likewise.
2422         * src/freeze.c: Likewise.
2423         * src/m4.h: Likewise.
2424         * src/main.c: Likewise.
2425         * src/stackovf.c: Likewise.
2426         * tests/builtins.at: Likewise.
2427         * tests/freeze.at: Likewise.
2428         * tests/generate.awk: Likewise.
2429         * tests/m4.in: Likewise.
2430         * tests/macros.at: Likewise.
2431         * tests/modules.at: Likewise.
2432         * tests/options.at: Likewise.
2433         * tests/others.at: Likewise.
2434         * tests/stackovf.test: Likewise.
2435         * tests/testsuite.at: Likewise.
2437 2007-07-09  Eric Blake  <ebb9@byu.net>
2439         * modules/format.c (format): Avoid undefined behavior with %c.
2441 2007-07-01  Gary V. Vaughan  <gary@gnu.org>
2443         The translation project has moved.
2444         * bootstrap (func_get_translations): Use the new translation
2445         project url.
2446         (TP_URL): Removed.
2448 2007-06-26  Karl Berry  <karl@freefriends.org>  (tiny change)
2450         Match Free Software Directory categories.
2451         * doc/m4.texinfo (dircategory): Update.
2453 2007-05-31  Eric Blake  <ebb9@byu.net>
2455         Add extension to divert builtin.
2456         * modules/m4.c (builtin_divert): Immediately divert second
2457         argument.
2458         * m4/output.c (m4_output_text): Allow 0 length.  Fixes regression
2459         from two days ago.
2460         (m4_shipout_text): Short-circuit on zero length.
2461         * tests/freeze.at (loading format 2): Expand test to catch
2462         regression.  Also check out-of-range version.
2463         * tests/builtins.at (divert): Expand test to check corner cases
2464         of extension.
2465         * NEWS: Document the extension.
2466         Reported by Daniel Richard G.
2468 2007-05-30  Eric Blake  <ebb9@byu.net>
2470         Port format improvements from branch.
2471         * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
2472         (Format): Enhance section.
2473         * modules/format.c (format): Accept %'hhd, and issue warnings on
2474         unrecognized specifiers.
2475         * modules/gnu.c (builtin_format): Adjust how format is called.
2477 2007-05-28  Eric Blake  <ebb9@byu.net>
2479         * tests/options.at (--syncoutput): Add xfailed test.
2481         Fix sync line interaction with multiline comments.
2482         * doc/m4.texinfo (Preprocessor features): Improve documentation.
2483         (Syncoutput): Improve testsuite.
2484         (Incompatibilities): Add testcase, and document bug.
2485         * src/freeze.c (reload_frozen_state): Don't interfere with
2486         synclines when reloading state.
2487         * m4/input.c (m4__next_token): Report line where multiline tokens
2488         start.
2489         * m4/m4private.h (m4__token_type): Add parameter.
2490         * m4/m4module.h (m4_output_text): Export.
2491         (m4_shipout_text): Add parameter.
2492         * src/macro.c (m4_macro_expand_input, expand_token)
2493         (expand_argument): Adjust callers so that line is passed from
2494         input to output.
2495         * m4/output.c (output_text): Rename...
2496         (m4_output_text): ...to this, and export.
2497         (m4_insert_file, insert_diversion_helper): Update callers.
2498         (m4_shipout_text): Take new parameter for start line of token.
2499         Output at most one syncline per token.
2500         Reported by Sergey Poznyakoff.
2502         Fix large diversion corner cases.
2503         * tests/freeze.at (large diversion): New test.
2504         * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
2505         (make_room_for): Use NULL, not 0, for pointers.
2506         (m4_freeze_diversions): Allow freezing large diversions.
2507         (insert_diversion_helper): Avoid using rewind.
2509         Also run gnulib unit tests during make check.
2510         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2511         --tests-base=tests/gnu --with-tests'.
2512         * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
2513         * Makefile.am (SUBDIRS): Run gnulib tests before ours.
2515 2007-05-25  Eric Blake  <ebb9@byu.net>
2517         * m4/system_.h: Include <stdint.h>, for intmax_t.
2518         * THANKS: Update.
2519         Reported by Daniel Richard G.
2521 2007-05-24  Eric Blake  <ebb9@byu.net>
2523         Provide consistent shift semantics regardless of hardware.
2524         * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
2525         before shifting.
2526         (number, unumber): Always use [u]intmax_t.
2527         Reported by Gary V. Vaughan.
2529         Support POSIX flush semantics on all platforms.
2530         * modules/m4.c (m4_sysval_flush): Rely on gnulib.
2531         * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
2533         Work around cygwin and mingw fseeko bugs.
2534         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2535         fseeko'.
2536         * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
2538 2007-04-25  Eric Blake  <ebb9@byu.net>
2540         Test that regression in 1.4.9's eval doesn't recur.
2541         * doc/m4.texinfo (Eval): Check negative division.
2542         * THANKS: Update.
2544 2007-04-12  Eric Blake  <ebb9@byu.net>
2546         Allow for running test in sticky or setgid directory.
2547         * tests/builtins.at (mkdtemp): Adjust test.
2549         Don't test for broken sed too soon.
2550         * tests/others.at (stdin seekable): Rearrange subtests.
2552         Work around 'stdin seekable' shortcoming on glibc.
2553         * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
2554         * tests/others.at (stdin closed): Adjust to new output.
2555         * src/main.c (process_file): No need to return anything.
2556         (main): Use close_stdin instead of close_stdout.
2557         Reported by Ralf Wildenhues.
2559         Enable autobuild usage.
2560         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2561         autobuild'.
2562         * configure.ac (AB_INIT): Output autobuild information.
2564 2007-04-11  Eric Blake  <ebb9@byu.net>
2566         Address testsuite shortcoming in 'stdout full' on glibc.
2567         * tests/others.at (stdout full): Adjust expected output when more
2568         than 1k text is printed to /dev/full.
2569         Reported by Ralf Wildenhues.
2571 2007-04-10  Eric Blake  <ebb9@byu.net>
2573         * tests/macros.at (Arity and defn): Fix quoting.
2575 2007-04-09  Eric Blake  <ebb9@byu.net>
2577         Address failure of 'seekable stdin' on Mac OS X.
2578         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2579         fflush'.
2581 2007-04-07  Eric Blake  <ebb9@byu.net>
2583         Include <config.h> first in all C files, and not in headers.
2584         Fixes regression for --disable-assert builds from 2007-04-02.
2585         * src/m4.h (includes): Don't include config.h here.
2586         * m4/m4private.h (includes): Likewise.
2587         * m4/builtin.c: Include config.h before anything else.
2588         * m4/debug.c: Likewise.
2589         * m4/hash.c: Likewise.
2590         * m4/input.c: Likewise.
2591         * m4/m4.c: Likewise.
2592         * m4/macro.c: Likewise.
2593         * m4/module.c: Likewise.
2594         * m4/symtab.c: Likewise.
2595         * m4/syntax.c: Likewise.
2596         * m4/utility.c: Likewise.
2597         * src/freeze.c: Likewise.
2598         * src/stackovf.c: Likewise.
2600 2007-04-03  Eric Blake  <ebb9@byu.net>
2602         * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
2603         SIGFPE on x86 architectures.
2604         Reported by Ralf Wildenhues.
2606 2007-04-02  Eric Blake  <ebb9@byu.net>
2608         Fix warnings from last commit.
2609         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2610         fprintf-posix sprintf-posix'.
2611         * m4/macro.c (expand_macro, trace_format): Use correct specifier
2612         for size_t.
2613         (process_macro): Avoid negative array index.
2614         * src/freeze.c (produce_resyntax_dump, produce_module_dump)
2615         (dump_symbol_CB, produce_frozen_state): Use correct specifier for
2616         size_t.
2618 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
2620         Get rid of the last 'differs in signedness' compiler warnings:
2622         * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
2623         a regular 'char *', so variables to store the return address,
2624         and iterate through it should be regular 'char *' too.
2625         * m4/input.c (m4_input_block): The start and current members of
2626         the string part of this union store regular 'char *' types, so
2627         they should be regular 'char *' types too.
2629 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
2631         M4 was designed to have a small number of header files defining
2632         the interfaces to several source files each.  Keeping this in
2633         mind allows us to tidy things up considerably.  Having done this,
2634         it becomes clear that some of the installed headers reference
2635         other headers which are not installed (but that's another patch):
2637         * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
2638         here...
2639         * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
2640         ...to here, so client modules can benefit too.
2641         (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
2642         lowest level to save doing it multiple times elsewhere.
2643         * m4/debug.c (stdio.h): Removed.  The portable <gnu/stdio--.h>
2644         is already included via m4private.h.
2645         * modules/time.c (stdio.h): Ditto.
2646         * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
2647         * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
2648         and <gnu/unistd--.h>,
2649         * m4/m4private.h (m4module.h): Use angle brackets for an installed
2650         file.
2651         * m4/hash.h (system.h): Ditto.
2652         * modules/gnu.c (progname.h): Removed.
2653         * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
2654         * m4/m4private.h (assert.h, errno.h): Already included via
2655         m4/m4module.h.
2656         * m4/input.c (ctype.h): Ditto.
2657         * m4/module.c (ltdl.h): Ditto.
2658         * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
2659         (unistd.h): Ditto.
2660         * m4/path.c (config.h, stdlib.h): Ditto.
2661         * m4/utility.c (config.h): Ditto.
2662         * modules/evalparse.c (assert.h, ctype.h): Ditto.
2663         * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
2664         * modules/import.c (assert.h): Ditto.
2665         * modules/m4.c (assert.h, errno.h): Ditto.
2666         * modules/modtest.c (assert.h): Ditto.
2667         * modules/stdlib.c (sys/types.h): DittAo.
2668         * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
2669         Ditto.
2670         * src/stackovf.c (assert.h): Ditto.
2671         * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
2672         private interfaces when NDEBUG is defined.
2673         * modules/import.c (m4/m4module.h, m4private.h): Ditto.
2674         * modules/load.c (m4/m4module.h, m4private.h): Ditto.
2675         * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
2676         * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
2677         * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
2678         * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
2679         * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
2680         * modules/time.c (m4/m4module.h, m4private.h): Ditto.
2681         * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
2682         * src/m4.h (locale.h): Moved from here...
2683         * src/main.h: ...to here.
2684         (m4private.h): Already included via m4.h.
2685         * src/stackovf.c (m4private.h): Ditto.
2687 2007-03-28  Gary V. Vaughan  <gary@gnu.org>
2689         * Makefile.am (stamp-vcl): Removed.
2690         (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
2692 2007-03-28  Eric Blake  <ebb9@byu.net>
2694         * src/main.c (usage): Improve note to TRANSLATORS.
2695         * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
2697         * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
2698         empty.
2700 2007-03-24  Eric Blake  <ebb9@byu.net>
2702         * m4/output.c (m4_output_init): Update to latest gnulib.
2703         * bootstrap (ltdl/m4/.cvsignore): No longer track generated
2704         .cvsignore in CVS.
2705         * NEWS: Reflect release of 1.4.9.
2706         * THANKS: Update.
2708 2007-03-07  Eric Blake  <ebb9@byu.net>
2710         * AUTHORS: Update
2712         Exercise gnulib's new POSIX *printf modules.
2713         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2714         vasprintf-posix'.
2715         * modules/format.c (format): Support %a and %A.
2716         * doc/m4.texinfo (Format): Test this addition.
2717         * NEWS: Document this addition.
2719 2007-03-03  Eric Blake  <ebb9@byu.net>
2721         * m4/input.c (m4__next_token): Fix synclines when in batch mode.
2722         * doc/m4.texinfo (M4exit): Synch another section.
2723         (Syncoutput): Make similar to other sections.
2725 2007-03-01  Eric Blake  <ebb9@byu.net>
2727         * doc/m4.texinfo: Improve the indices.
2728         (Concept index): Rearrange to be last.
2729         (Sysval): Merge from branch.
2731         * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
2733 2007-02-28  Eric Blake  <ebb9@byu.net>
2735         POSIX XCU ERN 137 was approved.
2736         * modules/mpeval.c (numb_extension): Delete.
2737         * modules/m4.c (numb_extension): Likewise.
2738         * modules/evalparse.c (comma_term, condition_term): Always
2739         implement ?: and , operators.
2740         * m4/symtab.c: Update comment to match reality.
2741         * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
2742         dereferencing context directly when accessor exists.
2743         * src/main.c (usage): Prefer GNU_M4 over EMACS.
2744         (struct macro_definition): Rename...
2745         (struct deferred): ...to match usage.  All uses changed.
2746         * doc/m4.texinfo (Eval): Document this change.
2747         (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
2748         over emacs.
2749         (Preprocessor features, Changesyntax): Fix inaccuracies.
2750         * NEWS: Import branch NEWS items for 1.4.x series.  Document
2751         change in eval.
2753         POSIX XCU ERN 118 was approved.
2754         * modules/m4.c (define): Kill posixly_correct distinction in
2755         define behavior, since POSIX says GNU behavior complies.
2756         * tests/builtins.at (define): Restore original semantics.
2757         * doc/m4.texinfo (Pushdef): Document portability issues with
2758         define.
2759         (Incompatibilities): Clean up wording of what POSIX requires.
2760         * NEWS: Document this.
2762 2007-02-26  Eric Blake  <ebb9@byu.net>
2764         Re-enable clean bootstrap on cygwin.
2765         * Makefile.am (AM_LDFLAGS): For now, export all symbols from
2766         modules, since otherwise we run afoul of current libtool
2767         limitations on cygwin and mingw.
2769 2007-02-25  M. Levinson  <levinsm@users.sourceforge.net>  (tiny change)
2771         * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
2772         memory.  Fixes regression introduced 2007-01-20.
2774 2007-02-25  Eric Blake  <ebb9@byu.net>
2776         * tests/freeze.at (loading format 2): Augment test to catch
2777         regression introduced on 2007-01-20.
2778         * THANKS: Update.
2779         Reported by M. Levinson.
2781         * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
2782         latest gnulib.
2784 2007-02-05  Eric Blake  <ebb9@byu.net>
2786         * tests/options.at (--fatal-warnings): New test.
2787         * tests/others.at (stdin seekable): Exit on error.
2788         * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
2789         (m4_get_warnings_exit_opt): Access it.
2790         * m4/m4module.h (m4_context_opt_bit_table): Access it.
2791         * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
2792         on -EE.
2793         (m4_warn, m4_warn_at_line): Change exit status on -E, and force
2794         exit on -EE.
2795         * src/m4.c (usage): Document new -E behavior.
2796         (main): Make -E an additive option.
2797         * doc/m4.texinfo (Operation modes): Document the change.
2798         Reported by Ralf Wildenhues.
2800         * tests/others.at (stdin seekable): Fix bug in test.
2801         * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
2803         * m4/input.c (struct m4_input_block): Remove unused field traced.
2805 2007-02-03  Eric Blake  <ebb9@byu.net>
2806         and Bruno Haible  <bruno@clisp.org>  (tiny change)
2808         * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
2809         the examples.
2810         Reported by Bruno Haible.
2812 2007-01-31  Eric Blake  <ebb9@byu.net>
2814         * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
2815         failure.
2817 2007-01-26  Eric Blake  <ebb9@byu.net>
2819         * m4/symtab.c (includes): Adjust to latest gnulib.
2820         * modules/m4.c (includes): Likewise.
2822 2007-01-23  Eric Blake  <ebb9@byu.net>
2824         * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
2825         extension to make enough room.
2826         (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
2827         code in input.c special cases this category.
2828         (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
2829         for define(eleventh,${11}) extension.
2830         * m4/syntax.c: Update comments accordingly.
2831         (m4_syntax_create, m4_syntax_code): Handle { and }.
2832         * m4/input.c (m4__next_token): Likewise.
2833         * src/freeze.c (produce_frozen_state): Support new categories.
2834         (reload_frozen_state): When loading version 1, disable syntax
2835         features not present in 1.4.x.
2836         * tests/freeze.at: Sort and rename existing tests.
2837         (loading format 1): Ensure we don't break v1 frozen files that
2838         used raw ${.
2839         (loading format 2, reloading changecom, reloading changesyntax):
2840         New tests.
2841         * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
2842         the new syntax categories.
2843         (Arguments): Update the FIXME comment.
2844         (M4wrap): Merge examples from branch, before worrying about fixing
2845         m4wrap to obey POSIX.
2846         (Using frozen files): Start merging from branch.
2847         * NEWS: Update.
2849 2007-01-20  Eric Blake  <ebb9@byu.net>
2851         * src/freeze.c (produce_char_dump): Delete.  Replace with...
2852         (produce_mem_dump): ...this new function, to encode more strings.
2853         Also make the coding easier to read and slightly more compact.
2854         (produce_syntax_dump): Only dump non-default syntax codes.
2855         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2856         Encode non-ASCII characters in user-supplied strings.
2857         (GET_STRING): Accept escape sequences in version 2.
2858         * NEWS: Document this change.
2859         * TODO: Update.
2861 2007-01-16  Eric Blake  <ebb9@byu.net>
2863         Port patch from branch for stack overflow detection on BSD/OS.
2864         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
2865         * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
2866         ! HAVE_STACK_T_SS_SP]: Use this check.
2867         Reported by Chris McGuire.
2869 2007-01-15  Eric Blake  <ebb9@byu.net>
2871         * tests/builtins.at (__m4_version__): New test.
2872         * modules/traditional.c (m4_macro_table): Provide windows and os2
2873         macros, as appropriate.  Add __traditional__ macro.
2874         * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
2875         not __gmp__, to match module name.
2876         * modules/load.c (m4_macro_table): Name the macro __load__, not
2877         __modules__, to match module name.
2878         * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
2879         from the branch.
2880         (Standard Modules): Improve wording.
2881         (Incompatibilities): Move platform macros into their own node.
2882         (Load, Unload): Use actual examples.
2883         * NEWS: Document this change.
2884         * THANKS: Update.
2886 2007-01-13  Eric Blake  <ebb9@byu.net>
2888         * doc/m4.texinfo (Mpeval): Add tests.
2889         * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
2890         * tests/builtins.at (gmp): ...here.  Rename test to...
2891         (mpeval): ...this.
2892         * tests/generate.awk (new_test): Filter out mpeval tests when gmp
2893         is not available.
2894         * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
2895         no_gnu_extensions with posixly_correct_opt, since they were set in
2896         sync.
2897         * m4/m4private.h (struct m4): Remove no_gnu_extensions.
2898         * src/main.c (main): Update caller.
2899         * src/freeze.c (reload_frozen_state): Likewise.
2900         * modules/m4.c (m4wrap): Likewise.
2902 2007-01-12  Eric Blake  <ebb9@byu.net>
2904         * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
2905         POSIX, so update the comment.
2906         * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
2907         approved by POSIX, so we can always have blind macros, even when
2908         POSIXLY_CORRECT.
2909         (Ifelse): Mention the term `blind builtin'.
2911 2007-01-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2913         * doc/m4.texinfo: Fix a couple of typos.
2915 2007-01-08  Eric Blake  <ebb9@byu.net>
2917         * ltdl/m4/gnulib-cache.m4: Update for new year.
2918         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
2919         Reported by Ralf Wildenhues.
2921 2007-01-06  Eric Blake  <ebb9@byu.net>
2923         * m4/m4private.h (to_uchar): Move...
2924         * m4/m4module.h: here, so modules can use it.
2925         * src/main.c (usage, long_options): Support --posix as a synonym
2926         for --traditional.
2927         * modules/m4.c (numb_invert): Detect unsupported x**-y.
2928         (numb_incr, numb_urshift, numb_extension): New macros.
2929         (numb_obstack): Port patch from branch to support radix 1 output.
2930         * modules/mpeval.c (numb_obstack): Use \ for ratios.
2931         (numb_incr, numb_urshift, numb_extension): New macros.
2932         (mpq2mpz): Warn rather than error.
2933         * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
2934         enumerators.
2935         (eval_error): Rearrange, so that all ignorable errors are less
2936         than SYNTAX_ERROR.
2937         (eval_text, last_text): Obey C++ type safety rules.
2938         (numb_pow): Change return type.
2939         (exp_term): Adjust caller.
2940         (m4_evaluate): Fail on bad exponent.
2941         (logical_or_term, logical_and_term): Ignore failed ** in short
2942         circuit.
2943         (eval_lex): Fix typos when detecting <<= and >>=.  Use \ instead
2944         of : for ratio.  Support >>>, ,, and ?:.  Port patch from branch
2945         to parse radix 1 numbers.
2946         (condition_term, comma_term): New parse functions.
2947         (shift_term): Support >>>.
2948         (m4_evaluate): Port patch from branch to output radix 1 numbers.
2949         Warn instead of error for most parse problems.
2950         * doc/m4.texinfo (Limits control, Eval): Document these changes.
2951         * NEWS: Document new operators and new command line option.
2953 2007-01-04  Eric Blake  <ebb9@byu.net>
2955         * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
2957 2007-01-03  Eric Blake  <ebb9@byu.net>
2959         * doc/m4.texinfo (Format, Incr): More merges.
2960         (Eval): Ensure C precedence rules are met.
2961         * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
2962         (not_term, logical_not_term): Delete; these are same precedence
2963         as other unary operators.
2964         (equality_term): New; these are lower precedence than relational
2965         operators.
2966         (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
2967         operators for better error messages.
2968         (logical_or_term, logical_and_term): Short-circuit out the error
2969         of division by zero.
2970         (unary_term): Allow consecutive unary operators.
2971         * modules/m4.c (int2numb, numb2int): Delete; these potentially
2972         truncate bits.
2973         (numb_not, numb_eor, numb_ior, numb_and): Update callers.
2974         * modules/mpeval.c (reduce1, reduce2): Protect macros better.
2975         * NEWS: Document this change.
2977 2006-12-27  Eric Blake  <ebb9@byu.net>
2979         * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
2980         branch.
2981         * modules/m4.c (substr): Merge from branch.
2983 2006-12-26  Eric Blake  <ebb9@byu.net>
2985         * doc/m4.texinfo (Changesyntax): Check for regressions with
2986         changesyntax(W=...).
2988 2006-12-22  Eric Blake  <ebb9@byu.net>
2990         * m4/m4module.h (m4_set_syntax): Change signature.
2991         * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
2992         warning.
2993         (changesyntax): Likewise, and update caller.
2994         * m4/m4private.h (m4_syntax_table): Add orig member.
2995         * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
2996         Don't set is_single_quotes and is_single_comments when the begin
2997         character is shadowed by another syntax type.
2998         (m4_syntax_create): Populate default syntax table.
2999         (add_syntax_attribute): Don't lose quote assignment.
3000         (remove_syntax_attribute): Only allow removing rquote or ecomm.
3001         (add_syntax_set, subtract_syntax_set, set_syntax_set)
3002         (reset_syntax_set): New helper routines.
3003         (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3004         to default, and empty chars reverts that key to default.
3005         (check_is_single_quotes, check_is_single_comments): New helper
3006         routines.
3007         * modules/m4.c (changecom): Merge from branch.
3008         * m4/input.c (m4__next_token): Rearrange token recognition order
3009         to macro, quote, comment, in order to match traditional
3010         implementations.
3011         * src/freeze.c (reload_frozen_state): Update caller.
3012         * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3013         modifications.
3014         (Changeresyntax): Revise to match style of surrounding sections
3015         and add more examples.
3016         (Changesyntax): Likewise, and update to new semantics.
3017         * NEWS: Document this change.
3019         * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3020         (M4wrap, Eval, Errprint): Fix typos.
3021         (Divnum): Not necessary to redivert in example.
3023 2006-12-21  Eric Blake  <ebb9@byu.net>
3025         * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3026         from branch.
3028 2006-12-19  Eric Blake  <ebb9@byu.net>
3030         * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3031         * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3032         can track write errors without all other callers warning multiple
3033         times.
3034         (sysval_flush_helper): New function.
3035         (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3036         * modules/gnu.c (esyscmd): Likewise.
3037         * tests/others.at (stdout closed, stdout full): Error message
3038         update.
3040 2006-12-16  Eric Blake  <ebb9@byu.net>
3042         * src/main.c: Fix missing include.
3044         * src/main.c (main): Check for errors when closing stdin.
3045         * modules/m4.c (m4exit): Missed part of previous patch: flush
3046         stdin before a successful exit.
3047         Reported by Ralf Wildenhues.
3049 2006-12-14  Eric Blake  <ebb9@byu.net>
3051         * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
3052         required by POSIX.
3053         * tests/others.at (stdin seekable): New test.
3055 2006-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3057         * doc/m4.texinfo: Fix some typos.
3059 2006-12-04  Eric Blake  <ebb9@byu.net>
3061         * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
3062         sections.
3063         (Modules): Make style consistent.
3065 2006-11-16  Eric Blake  <ebb9@byu.net>
3067         * bootstrap: Relax m4 requirement, thanks to...
3068         * configure.ac (Gettext support): ...this workaround to the 1.4.4
3069         bug.  Undoes restriction added on 2006-11-09.
3071         * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
3072         diversions are now closed when not active.
3073         (divert): Remove check now in the manual.
3074         * tests/others.at (stderr closed): Likewise.
3075         (stdout closed): Add a check.
3076         * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
3077         more docs with branch.
3079 2006-11-14  Eric Blake  <ebb9@byu.net>
3081         Remerge sparse diversion handling from branch.
3082         * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
3083         avltree-oset.
3084         * m4/output.c (diversion_table): Change type to gl_oset_t.
3085         (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
3086         (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
3087         (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
3088         (div0, diversion_storage): New variables.
3089         (diversions, equal_diversion_CB): Deleted.
3090         (threshold_diversion_CB): New callback.
3091         (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
3092         functions.
3093         (m4_tmpfile): Move cloexec action here.
3095         * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
3096         char.
3098 2006-11-13  Eric Blake  <ebb9@byu.net>
3100         Add several new command line options.
3101         * src/main.c (usage): Update.
3102         (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
3103         --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
3104         Make --regexp-syntax argument optional.
3105         (main): Support new options.  Fix regression in interactive
3106         behavior from Nov 8.
3107         * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
3108         M4_OPT_SYNC_OUTPUT_BIT.
3109         * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
3110         syncoutput, to match option.
3111         (m4_parse_truth_arg): New prototype.
3112         * m4/utility.c (m4_parse_truth_arg): Implement it.
3113         * m4/output.c (m4_shipout_text): Adjust sync_output caller.
3114         * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
3115         m4_parse_truth_arg.
3116         * doc/m4.texinfo (Operation modes, Dynamic loading features)
3117         (Preprocessor features, Limits control, Debugging options)
3118         (Command line files): Update documentation.
3119         * tests/builtins.at (mkstemp): Simplify.
3120         * tests/macros.at (Command line pushdef): New test.
3121         (Command line define): Improve.
3122         * tests/options.at (--traceon and --traceoff, --syncoutput): New
3123         tests.
3124         (POSIXLY_CORRECT): Likewise.
3125         (deprecated options): Augment.
3126         (--regexp-syntax): Update, now that -r takes optional arg.
3127         * NEWS: Reformat.  Document new options.
3129 2006-11-11  Eric Blake  <ebb9@byu.net>
3131         One step closer to allowing C++ compilation - don't blindly
3132         convert between char* and unsigned char*.
3133         * m4/m4module.h (m4_set_syntax): Change signature.
3134         * m4/m4private.h (m4_string): Use signed char.
3135         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
3136         (m4_get_syntax_ecomm): No longer a need to cast.
3137         * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
3138         Reflect this change.
3139         * m4/macro.c (expand_argument): Simplify.
3140         (expand_token): Use proper type.
3141         * src/freeze.c (reload_frozen_state): Likewise.
3142         * m4/input.c (MATCH, match_input): Likewise.
3143         * modules/m4.c (translit): Likewise.
3144         * modules/gnu.c (substitute): Simplify.
3146         * m4/macro.c (trace_format): Use canonical type name.
3147         * m4/output.c (m4_freeze_diversions): Likewise.
3148         * src/freeze.c (produce_module_dump, dump_symbol_CB)
3149         (produce_frozen_state): Likewise.
3150         * m4/m4private.h (to_uchar): Grab from branch.
3151         * m4/input.c (string_peek, string_read): Use it.
3152         * m4/utility.c (skip_space): Likewise.
3153         * src/main.c (main): Likewise.
3154         * doc/m4.texinfo (Translit): Remerge from branch.
3155         * tests/builtins.at (translit): Test 8-bit range.
3156         * modules/m4.c (m4_expand_ranges): Merge from branch.
3158 2006-11-09  Eric Blake  <ebb9@byu.net>
3160         * bootstrap: Validate that installed M4 is powerful enough.
3161         Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
3163 2006-11-08  Eric Blake  <ebb9@byu.net>
3165         Merge deferred handling of -D option from branch.
3166         * doc/m4.texinfo (Debugging options, Preprocessor features)
3167         (Dynamic loading features, Operation modes, Invoking m4):
3168         Document this change.
3169         * src/main.c (OPTSTRING): Specify in-order processing.
3170         (process_file): New function.
3171         (main): Use it to interleave files and deferred options.
3172         * tests/macros.at (Command line define): New test.
3173         * tests/generate.awk: Allow '@comment file' as first example
3174         within a node.
3175         * tests/options.at (option grouping): Update to reflect actual
3176         POSIX semantics.
3177         (file names): New test.
3179 2006-11-07  Eric Blake  <ebb9@byu.net>
3181         * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
3182         for failure.
3184         * tests/builtins.at (m4exit): New test; failed on cygwin before
3185         this patch.
3186         * m4/output.c (cleanup_tmpfile): Close files before removing
3187         directory.
3188         (make_room_for, m4_output_exit): Ensure that atexit handler
3189         invoked from m4_error sees consistent state.
3191         * doc/m4.texinfo (Errprint): Merge another doc node.
3192         * tests/builtins.at (dumpdef, errprint): New tests.
3193         * modules/m4.c (errprint): Merge from branch: flush before
3194         printing to stderr.
3196 2006-11-02  Eric Blake  <ebb9@byu.net>
3198         * bootstrap: Update bootstrap requirement wording.
3199         Reported by Bruno Haible.
3201 2006-10-31  Eric Blake  <ebb9@byu.net>
3203         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3204         strstr'.
3205         * doc/m4.texinfo (Translit): Merge from branch.
3206         * modules/m4.c (divert, substr): Ignore excess arguments.
3207         (index, translit): Merge from branch.
3208         * tests/builtins.at (translit): Add a test.
3210 2006-10-30  Eric Blake  <ebb9@byu.net>
3212         * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
3213         checkin.
3214         * m4/symtab.c (m4_get_symbol_value_module): Likewise.
3216         * modules/m4.c (m4_make_temp): Make safe across libtool.
3217         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
3218         * configure.ac (--with-modules): Accomodate changed module
3219         location when doing './configure --enable-debug'.
3221 2006-10-28  Eric Blake  <ebb9@byu.net>
3223         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3224         config-h.'
3226 2006-10-27  Eric Blake  <ebb9@byu.net>
3228         * bootstrap (gnulib): No longer a need to patch after gnulib-tool
3229         --update.
3230         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3231         0.16, since 0.15 is incompatible with our automake requirement.
3233         * m4/macro.c (expand_argument): Fix missing initialization.
3234         * m4/m4private.h (struct m4_symbol_value): Store entire
3235         m4_builtin, not just the func.
3236         (m4_get_symbol_value_func): Update.
3237         (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
3238         fast accessors.
3239         * m4/m4module.h (m4_get_symbol_value_builtin)
3240         (m4_get_symbol_builtin): New prototypes.
3241         (m4_set_symbol_value_func): Delete, replace with...
3242         (m4_set_symbol_value_builtin): New function.
3243         (m4_builtin_find_by_name): Change signature.
3244         * m4/symtab.c (m4_symbol_value_print): Simplify.
3245         (m4_get_symbol_value_func): Update.
3246         (m4_get_symbol_value_builtin): New function.
3247         (m4_set_symbol_value_func): Delete, replace with...
3248         (m4_set_symbol_value_builtin): New function.
3249         (dump_symbol_CB) [DEBUG_SYM]: Simplify.
3250         * m4/builtin.c (m4_builtin_find_by_name): Change signature.
3251         * m4/input.c (struct m4_input_block): Remove unused trace member.
3252         (m4_push_builtin, builtin_print, init_builtin_token): Update
3253         callers.
3254         * m4/module.c (install_builtin_table): Likewise.
3255         * src/freeze.c (reload_frozen_state): Likewise.
3256         * modules/gnu.c (builtin): Make it possible to retrieve a builtin
3257         token, even after the builtin has been undefined.
3258         * doc/m4.texinfo (Builtin): Document new capability.
3259         * NEWS: Likewise.
3261         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3262         tempname'.
3263         * modules/m4.c (m4_make_temp): Use it.
3264         * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
3266 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3268         * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
3269         files.
3271 2006-10-26  Eric Blake  <ebb9@byu.net>
3273         Silence -O2 -Wall -Wwrite-strings warnings.
3274         * m4/m4private.h (m4_symbol_value): Const-ify text.
3275         * m4/m4module.h (m4_get_symbol_value_text)
3276         (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
3277         (m4_set_symbol_value_placeholder): Likewise.
3278         * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
3279         fallout.
3280         * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
3281         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
3282         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
3283         Likewise.
3284         * modules/format.c (format): Likewise.
3285         * src/main.c (main): Likewise.
3286         * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
3287         * modules/shadow.c (shadow, test): Likewise.
3288         * m4/output.c (m4_make_diversion): Don't hold on to empty
3289         diversions.
3290         (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
3291         (m4_freeze_diversions): Likewise.  Don't use uninitialized
3292         variable.
3294         Convert diversions to list instead of sparse array, part 2.
3295         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3296         avltree-list'.
3297         * m4/output.c (m4_diversion): Add next pointer and divnum members.
3298         (diversion_table): Convert to a list instead of a sparse array.
3299         (free_list): Maintain free list of reclaimed diversions.
3300         (equal_diversion_CB, cmp_diversion_CB): New functions.
3301         (m4_output_init): Set up list.
3302         (m4_output_exit): Tear down list.
3303         (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
3304         list iteration.
3305         (m4_make_diversion): Change creation of new diversions.
3306         (m4_insert_diversion_helper): New function, to avoid list
3307         searches.
3308         * tests/builtins.at (divert): The test now passes.
3309         * NEWS: Document this improvement.
3311         Convert diversions to list instead of sparse array, part 1.
3312         * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
3313         for length.
3314         * m4/output.c (diversion, total_buffer_size, output_unused):
3315         Track size in size_t.  All users changed.
3316         (struct diversion): Reduce size now, to compensate for part 2.
3317         (m4_make_diversion, make_room_for): Avoid malloc overflow.
3318         (m4_output_exit): Fix typo in assert.
3319         (m4_output_init, make_room_for, m4_make_diversion)
3320         (m4_insert_diversion, m4_freeze_diversions): Adjust users of
3321         struct m4_diversion to disambiguate the new union.
3322         * tests/builtins.at (divert): Detect this failure.
3324 2006-10-25  Eric Blake  <ebb9@byu.net>
3326         * m4/m4module.h (m4_push_builtin): Add parameter.
3327         * modules/m4.c (defn): Update caller.
3328         * m4/input.c (file_read_init, string_read_init): No longer
3329         needed.
3330         (input_funcs): Change signature of read_func, all callers
3331         updated.
3332         (composite_peek, composite_read, composite_unget),
3333         (composite_print, composite_funcs): New input type.  Not yet
3334         fully utilized, but one step closer to fixing defn.
3335         (m4_input_block): Make every input block track current file and
3336         line.  Rename some members.  Remove unused out_line.  Add support
3337         for composite input block.
3338         (input_change): New flag.
3339         (file_peek, file_read, file_clean, file_unget, file_print):
3340         Update callers.
3341         (m4_push_file, m4_push_builtin, m4_push_string_init)
3342         (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3343         (m4_skip_line, pop_input): Track input block changes.
3344         (m4_pop_wrapup): Avoid overflow.
3345         (init_builtin_token): Handle composite input.
3346         (next_char): Handle input block changes.
3347         * doc/m4.texinfo (Location): Remerge from branch.
3349         * src/m4.h (includes): Need <locale.h> after all; fixes
3350         regression from yesterday.
3352         * m4/system_.h (obstack_regrow): New macro.  Hopefully glibc will
3353         accept it someday.
3354         * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3355         Handle nesting the argc obstack.
3356         (expand_token): Avoid unnecessary malloc.
3357         (collect_arguments): Copy name before invalidating it.
3358         (argc_stack, argv_stack): New variables.
3359         (m4_macro_expand_input): Initialize argc and argv stacks once per
3360         file, instead of once per macro.
3362 2006-10-24  Eric Blake  <ebb9@byu.net>
3364         * src/m4.h (includes): Add gettext.h, for N_.  Assume setlocale.
3366 2006-10-23  Eric Blake  <ebb9@byu.net>
3368         * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
3369         from branch regarding stripped leading whitespace.
3371         * modules/m4.c (includes): Use safe headers even when configured
3372         with --enable-assert.
3373         (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
3374         #defined as mkstemp_safer.
3376 2006-10-21  Eric Blake  <ebb9@byu.net>
3378         * modules/m4.c (m4_make_temp): Change signature.
3379         (maketemp, mkstemp): Update callers.
3380         * modules/m4.h (m4_make_temp_func): New export.
3381         * modules/gnu.c (mkdtemp): New macro.
3382         * doc/m4.texinfo (Operation modes): Document interaction with
3383         --safer.
3384         (Mkdtemp): New node.
3385         * tests/builtins.at (mkdtemp): New test.
3386         (mkstemp): Check for umask effect.
3387         * NEWS: Document new builtin.
3389         * tests/generate.awk (normalize): Update recognition of trailing
3390         spaces in tests.
3391         * doc/m4.texinfo: Minor formatting fixes from branch.
3392         (Foreach, Improved foreach): Merge from branch.
3393         * examples/foreach.m4: Merge from branch.
3394         * examples/foreachq.m4: New file from branch.
3395         * examples/foreach2.m4: Likewise.
3396         * examples/foreachq2.m4: Likewise.
3398         * doc/m4.texinfo (titlepage): Add myself as author.
3399         * src/main.c (AUTHORS): Likewise.
3401 2006-10-19  Eric Blake  <ebb9@byu.net>
3403         * modules/m4.c (m4_make_temp, mkstemp): New functions.
3404         (maketemp): Add POSIX behavior and a warning.
3405         * tests/others.at (maketemp): Move this test...
3406         * tests/builtins.at (mkstemp): ...to here, and beef up.
3407         * tests/options.at (--safer): Update to new warning message.
3408         * doc/m4.texinfo (Mkstemp): Sync from branch.
3409         (Extensions): Update maketemp behavior.
3410         * NEWS: Document that maketemp now always warns.
3412         * tests/generate.awk: For ease of doc-writing, simplify selection
3413         of '-Ipath/to/examples' to '@comment examples'.
3414         * examples/forloop.m4: Simplify.
3415         * examples/forloop2.m4: New file.
3416         * examples/quote.m4: New file.
3417         * doc/m4.texinfo (Improved forloop): New node.
3418         (Manual): Clarify use of examples directory.
3419         (Shift, Forloop): Resync from branch.
3420         (Include, Location): Update to new usage of examples directory.
3422         * m4/system_.h (includes): Pick up <unistd.h> before checking for
3423         _POSIX_VERSION.
3424         (gettext_noop): Don't define here, let gettext.h do it instead.
3425         * po/POTFILES.in: Update entries to reflect gnulib imports.
3427 2006-10-16  Eric Blake  <ebb9@byu.net>
3429         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3430         configmake'.
3431         * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
3432         pkglibexecdir support.
3433         * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
3434         worry about pathconf.h, now that gnulib does it for us.
3435         (pkgmodincludedir): Simplify.
3436         (pkglibexecdir): Delete, now that automake does this.
3437         * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
3438         * src/main.c (usage): Likewise.
3439         * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
3441         * doc/m4.texinfo: Port some changes from the branch.
3442         (Invoking m4): Promote to a chapter, instead of a section of
3443         Preliminaries.
3444         (Operation modes, Dynamic loading features, Preprocessor features)
3445         (Limits control Frozen state, Debugging options)
3446         (Command line files): Subdivide into new sections.
3447         (Cleardivert): Rename from cleardiv.
3449 2006-10-14  Eric Blake  <ebb9@byu.net>
3451         * tests/others.at (stdin closed): Update to match previous patch.
3453         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
3454         is not portable.
3455         Reported by Ralf Wildenhues.
3457         * modules/m4.c (undivert): Merge from branch.
3458         * doc/m4.texinfo (Improved fatal_error): Fix typo.
3459         (Improved exch): New node, copied from branch.
3460         (Improved cleardivert): Update from branch.
3461         * THANKS: Update.
3463 2006-10-13  Eric Blake  <ebb9@byu.net>
3465         * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
3466         not config-h.in.
3467         * modules/gnu.c (builtin, indir): Transparently handle builtin
3468         tokens from defn.
3469         * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
3470         * m4/input.c (m4_pop_wrapup): Display debug message when switching
3471         to wrapped text.
3472         (m4_input_init): No need to use empty file any more.
3473         (file_print): Display correct file name.
3474         * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
3475         dereference a NULL file name.
3476         * m4/m4module.h (m4_pop_wrapup): New parameter.
3477         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
3478         prototypes.
3479         * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
3480         * m4/symtab.c (m4_symbol_value_groks_macro): New method.
3481         * src/main.c (main): Adjust caller.
3482         * tests/options.at (--debugmode): Test more output from -dV.
3484 2006-10-12  Eric Blake  <ebb9@byu.net>
3486         * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
3488         * m4/m4private.h (m4__next_token_is_open): New prototype.
3489         * m4/m4module.h (m4_push_single): Delete; push_string is an
3490         adequate interface, and removing support for this simplifies the
3491         input engine.
3492         (m4_push_wrapup): New parameter.
3493         (m4_is_syntax): Delete; m4_has_syntax is sufficient.
3494         (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
3495         start-quote and start-comment exclusive from other syntax
3496         categories.
3497         * m4/syntax.c: Likewise.
3498         * m4/input.c (input_funcs): Make polymorphic without requiring
3499         clients to know whether they are located at isp.  All users
3500         changed.
3501         (file_names): New variable.
3502         (m4_input_init): Initialize it.
3503         (m4_push_file): Use it.
3504         (m4_input_exit): Free it after use.
3505         (m4__next_token): Simplify slightly.
3506         (m4__peek_token): Rename and simplify...
3507         (m4__next_token_is_open): ... to this.  In particular, this
3508         allows us to avoid a double ungetc, which POSIX doesn't
3509         guarantee.
3510         (struct m4_input_block, m4_push_single, single_peek, single_read):
3511         Remove support for single characters, as the input engine now
3512         guarantees we don't need it.
3513         (file_unget, string_unget, m4_input_print, unget_input):
3514         Strengthen assertions.
3515         (file_init_funcs, file_read_init): New for file reading.
3516         (string_init_funcs, string_read_init): New for wrapped text.
3517         (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
3518         Support wrapped text with locations.
3519         (m4_skip_line): Support dnl across include file boundary.
3520         (peek_char): Don't pop input when peeking.
3521         (file_peek): Peek can be called at the end of the file.
3522         (string_read): Don't read beyond string bounds.
3523         * m4/macro.c (expand_token, collect_arguments): Update callers.
3524         (expand_macro): Report errors at location of open parenthesis.
3525         (expand_token, expand_argument, process_macro): Avoid negative
3526         array dereferences with m4_has_syntax.
3527         * m4/utility.c (skip_space): Likewise.
3528         * modules/m4.c (m4wrap): Update caller.
3529         * tests/builtins.at (__file__, __line__, dnl): New tests.
3530         * tests/options.at (--debugmode): Normalize the output.
3531         * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
3532         Remerge recent changes from branch.
3533         (Improved fatal_error): New node from branch.
3535 2006-10-11  Eric Blake  <ebb9@byu.net>
3537         * src/main.c (usage, long_options): Add --debugmode as an alias
3538         for --debug, to match macro name.
3539         * tests/options.at (--debugmode): Rename from --debug, and test
3540         for new alias.
3541         (--discard-comments): Augment test.
3542         * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
3543         * NEWS: Likewise.
3545 2006-10-10  Eric Blake  <ebb9@byu.net>
3547         Trace improvements: debugmode(c) was always printing the last two
3548         lines paired, combine them; and show non-text expansions.
3549         * m4/macro.c (trace_prepre): Update to show what the macro will
3550         expand to.
3551         (trace_pre): No need to special-case on debugmode(c).
3552         (trace_post): Likewise.  Also, show non-text expansions.
3553         (expand_macro): Update caller.  Collecting arguments can change
3554         debug mode, so cache values beforehand.
3555         (trace_format): Remove support for unused %l%S%r, and fix support
3556         for %z to match gcc's attribute((printf)).
3557         (trace_header): Update caller.
3558         * m4/input.c (struct m4_input_block): Rename from input_block.
3559         (struct input_funcs): Add print_func member.
3560         (file_print, builtin_unget, builtin_print, string_print)
3561         (m4_input_print): New functions.
3562         (m4_push_string_finish): Change return type.
3563         (m4_push_file): Fix missing use of close parameter.
3564         * m4/debug.c (m4_debug_decode): Don't clear pending traces.
3565         * m4/m4module.h (m4_input_print): New prototype.
3566         * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
3567         to match behavior change.
3568         * tests/options.at (--debug): Likewise.
3569         * tests/macros.at (Propagation of traceon)
3570         (Propagation of --trace): Likewise.
3571         * tests/others.at (stderr closed, stdout closed, stdin closed):
3572         Likewise.
3573         * doc/m4.texinfo (Forloop): Simplify.
3574         (Trace): Update to changed behavior.
3575         (Debugmode): Document this change.
3576         * src/main.c (usage): Likewise.
3577         * NEWS: Likewise.
3579 2006-10-09  Eric Blake  <ebb9@byu.net>
3581         * m4/path.c (m4_include_env_init): Don't alter result of getenv.
3582         Reported by Ralf Wildenhues.
3584         * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
3586 2006-10-07  Eric Blake  <ebb9@byu.net>
3588         * m4/m4module.h (m4_set_exit_failure): New prototype.
3589         * m4/utility.c (m4_set_exit_failure): New function.
3590         * modules/m4.c (m4exit): Use it to avoid yet another global
3591         variable export in libm4.
3593 2006-10-06  Eric Blake  <ebb9@byu.net>
3595         * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
3596         up.
3597         * tests/others.at (stdout closed): Fix final check.
3599         Replace uses of tmpfile with clean-temp, since tmpfile is
3600         incompatible with closeout.
3601         * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
3602         exit status of m4.
3603         * tests/others.at (stderr closed): Likewise.
3604         * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
3605         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3606         clean-temp.
3607         * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
3608         (m4_tmpfile, cleanup_tmpfile): New functions.
3609         (make_room_for, m4_insert_diversion): Use clean-temp module.
3610         * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
3611         tmpfile.
3612         * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
3614         * m4/utility.c (m4_numeric_arg): Merge from branch.
3615         * modules/gnu.c (debuglen): New builtin.
3616         * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
3617         Rename --arglength to --debuglen.
3618         * tests/options.at (--arglength): Rename to --debuglen.
3619         (deprecated options): Augment test.
3620         * doc/m4.texinfo (Invoking m4): Document the name change.
3621         (Debugmode): Rename from Debug Levels.
3622         (Debugfile): Rename from Debug Output.
3623         (Debuglen): New node.
3624         * NEWS: Document these changes.
3626         * modules/m4.c (m4exit): Fix typo.  Ensure desired exit status in
3627         case closing a module exits.
3629         * modules/m4.c (m4exit): Merge from branch.
3630         * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
3632 2006-10-05  Eric Blake  <ebb9@byu.net>
3634         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3635         closeout.
3636         * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
3637         * src/main.c (main): Close stdout on exit.
3638         * m4/debug.c (set_debug_file): Check for write failure.
3639         * m4/m4.c (m4_delete): Don't mask write failure.
3640         * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
3641         macros before calling AT_CHECK.
3642         (M4_ONE_MEG_DEFN): New helper macro.
3643         * tests/others.at (stdout full): New test.
3644         (stderr closed, stdin closed, stdout closed): Augment.
3645         * tests/builtins.at (syscmd): New test.
3646         (esyscmd): Augment.
3648 2006-10-04  Eric Blake  <ebb9@byu.net>
3650         * tests/builtins.at: Alphabetize tests.
3651         * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
3652         * tests/generate.awk (new_test): Fix underquoting.
3653         * tests/others.at (maketemp): Rename from misc.
3654         (stdin closed, stdout closed, stderr closed): New tests.
3656 2006-10-03  Eric Blake  <ebb9@byu.net>
3658         Avoid all global variables in modules, so that --disable-static
3659         can work on cygwin.
3660         * examples/incl.m4: New file, from branch.
3661         * Makefile.am (dist_pkgdata_DATA): Distribute it.
3662         * doc/m4.texinfo (Location): Merge this section from branch.
3663         (Include): Update the test.
3664         * tests/generate.awk (new_test): Allow for VPATH build
3665         pre-processing of expected __program__ output.
3666         * m4/m4module.h (m4_current_diversion, m4_output_current_line):
3667         Avoid global variables.
3668         (m4_context_field_table): Add current_diversion, output_line.
3669         (m4_output_init, m4_make_diversion): Add parameter.
3670         (m4_get_program_name, m4_set_program_name): New accessors.
3671         * m4/m4private.h (m4_get_current_diversion),
3672         (m4_set_current_diversion, m4_get_output_line)
3673         (m4_set_output_line): New accessors.
3674         * m4/utility.c (m4_get_program_name, m4_set_program_name): New
3675         methods.
3676         * modules/m4.c (divnum, divert): Adjust callers.
3677         * modules/gnu.c (__program__): Likewise.
3678         * m4/output.c (m4_output_init, m4_make_diversion)
3679         (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
3680         (m4_insert_diversion): Likewise.
3681         * m4/input.c (file_clean, m4_push_file): Likewise.
3682         * src/freeze.c (reload_frozen_state): Likewise.
3683         * src/main.c (main, usage): Likewise.
3685         Partially plug memory leak when unloading gnu module.
3686         * tests/modules.at (unload gnu module): New test.
3687         * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
3688         (m4_regexp_compile): Move static storage to module visibility.
3689         * tests/options.at (--debug): Adjust to new output.
3691 2006-09-29  Eric Blake  <ebb9@byu.net>
3693         Even when not the first option, --help can't have side effects.
3694         * tests/options.at (--debugfile): Detect bugs in this area.
3695         * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
3696         stderr.
3697         * src/main.c (main): Fix it by deferring debugfile change.  Also,
3698         defer closing streams until after module tracing is done.
3699         * modules/gnu.c (debugfile): Make message consistent with command
3700         line.
3701         * doc/m4.texinfo (Invoking m4): Touch up the documentation.
3702         * NEWS: Document this fix.
3704         * modules/m4.c (dnl): Include macro name in warning message.
3705         * m4/input.c (m4_skip_line): Add parameter.
3706         * m4/m4module.h (m4_skip_line): Likewise.
3707         * src/main.c (usage): Update wording.
3708         * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
3709         issue of blind macros vs. POSIX is resolved.
3710         (Dnl): Merge another node from branch.
3712         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3713         xstrtol.
3714         * m4/system_.h (N_): Define.
3715         * src/main.c (main): Validate numeric arguments.
3716         (size_opt): New function, idea borrowed from coreutils.
3717         * m4/macro.c (expand_macro): -L0 implies no limit.
3718         * doc/m4.texinfo (Invoking m4): Document this change.
3719         * NEWS: Likewise.
3720         * tests/options.at: (--arglength, --nesting-limit)
3721         (--regexp-syntax): New tests of argument validation.
3723 2006-09-28  Eric Blake  <ebb9@byu.net>
3725         * tests/options.at: Alphabetize the tests.
3727 2006-09-27  Eric Blake  <ebb9@byu.net>
3729         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
3730         another parameter to print module info.
3731         * m4/macro.c (trace_pre): Adjust caller.
3732         * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
3733         * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
3734         * NEWS: Document this.
3736         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3737         strnlen.
3738         * m4/symtab.c (symbol_value_print): Rename to...
3739         (m4_symbol_value_print): ...this, and...
3740         (m4_symbol_print): Update to allow -L length truncation.  Now
3741         truncation also affects dumpdef output and builtin names.
3742         * m4/m4private.h (nesting_limit, max_debug_argument_length):
3743         Switch to size_t.
3744         * m4/m4module.h (m4_symbol_print): Add parameter.
3745         (m4_symbol_value_print): New function.
3746         * modules/m4.c (dumpdef): Allow length truncation.
3747         * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
3748         repeating code.
3749         * doc/m4.texinfo (Invoking m4): Document -l better.
3750         (Dumpdef, Debug Levels): Document the effect of -l.
3751         * NEWS: Document this change.
3753         * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
3754         (m4_expand_ranges): Ensure we aren't picking up partial object on
3755         obstack.
3756         * modules/stdlib.c (setenv): Allow extra arguments.
3757         * modules/time.c (ctime): Avoid side effect in call to
3758         obstack_grow.
3759         * modules/gnu.c (m4_regexp_substitute): Likewise.
3760         (renamesyms): Avoid extra obstack_init.
3761         * src/freeze.c (reload_frozen_state): Remove debug comment.
3762         (produce_frozen_state): Simplify fprintf to puts where possible.
3763         * modules/modtest.c (modtest_init, modtest_finish): Likewise.
3764         * modules/import.c (import, symbol_fail, modules_fail): Likewise.
3765         * m4/macro.c (trace_flush): Likewise.
3766         * m4/debug.c (m4_debug_message_prefix): Likewise.
3767         * m4/path.c (include_dump): Likewise.
3768         * m4/module.c (module_remove): Likewise.
3769         (install_builtin_table): Simplify malloc and string
3770         concatenation.
3772 2006-09-26  Eric Blake  <ebb9@byu.net>
3774         * m4/m4module.h (m4_symbol_print): New prototype.
3775         (M4_DEBUG_TRACE_STACK): New enumerator.
3776         (m4_is_debug_bit): Allow use without requiring m4private.h.
3777         * m4/symtab.c (symbol_value_print, m4_symbol_print): New
3778         functions.
3779         * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
3780         callback.
3781         (dumpdef): Allow printing pushdef'd stacks.
3782         * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
3783         * src/main.c (usage): Document it.
3784         * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
3785         * NEWS: Likewise.
3787         * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
3788         gnulib headers.
3789         * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
3790         of lines during make.
3791         (AM_CPPFLAGS): Remove unneeded include path.
3792         (src_m4_CPPFLAGS): Remove redundant include path.
3793         * m4/system_.h Make preprocessor indentation consistent.
3794         (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
3795         macros.
3796         (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
3797         branch.
3798         (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
3799         (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
3800         (bool, true, false): Don't undefine here; stdbool takes care of
3801         that.
3802         * src/m4.h (includes): Assume config.h, and several standard
3803         headers.
3804         (__CYGWIN__, WIN32): Don't define here; let system.h do it.
3805         * m4/m4private.h: Assume config.h.
3806         * m4/output.c: Likewise.
3807         * m4/path.c: Likewise.
3808         * m4/resyntax.c: Likewise.
3809         * m4/utility.c: Likewise.
3810         * modules/gnu.c: Likewise.
3811         * modules/import.c: Likewise.
3812         * modules/load.c: Likewise.
3813         * modules/m4.c: Likewise.
3814         * modules/modtest.c: Likewise.
3815         * modules/mpeval.c: Likewise.
3816         * modules/perl.c: Likewise.
3817         * modules/shadow.c: Likewise.
3818         * modules/stdlib.c: Likewise.
3819         * modules/time.c: Likewise.
3820         * modules/traditional.c: Likewise.
3822 2006-09-21  Eric Blake  <ebb9@byu.net>
3824         * doc/m4.texinfo (Invoking m4): Add clarification on option
3825         processing behavior.
3826         * tests/options.at (option grouping): Test this.
3827         * THANKS: Update.
3828         Reported by Mikhail Teterin.
3830         * bootstrap: Add --force option, based on idea from coreutils.
3831         * README: Document that ./bootstrap and autoreconf are for
3832         developers, and not lightly done in tarballs.
3834 2006-09-20  Eric Blake  <ebb9@byu.net>
3836         * src/main.c (usage, OPTSTRING, main): Rename -e to -i.  Make
3837         warnings consistent.
3838         (long_options, HASHSIZE_OPTION): Warn on -H.
3839         * doc/m4.texinfo (Invoking m4): Document this.
3840         * tests/options.at (deprecated options): Update.
3842         Change the default of interactive sessions to match sh.
3843         * src/main.c (usage): Document this.
3844         (enum interactive_choice): New enum.
3845         (main): Use it to defer decision of interactive until after
3846         argument processing.
3847         * doc/m4.texinfo (Invoking m4): Document this.
3848         * NEWS: Likewise, plus add missing mention of -b.
3849         Reported by Stepan Kasal.
3851 2006-09-19  Eric Blake  <ebb9@byu.net>
3853         * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
3854         well as --error-output; the goal is to add -o/--output in some
3855         future version with semantics like gcc or autom4te.
3856         * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
3857         (Extensions): Reflect this update.
3858         (Renamesyms): Add another test.
3859         (Defn): Xfail for now, so that `make check' is happy.
3860         * NEWS: Document this change.
3861         * tests/generate.awk: Mark dynamic loading tests as such.  Allow
3862         xfailing tests.
3863         * tests/macros.at (Renamesyms collisions): New test, exposing
3864         renamesyms' coredump.
3865         * tests/options.at (--debugfile, --safer): Update to match
3866         change.
3868         * m4/debug.c (set_debug_file): Fix regression in -o when stdout
3869         and stderr are same file, introduced 2003-07-23.
3870         * tests/options.at (--debugfile): New test, to catch the bug.
3871         (deprecated options): Test --error-output.
3872         * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
3873         Deprecate --error-output, and replace it with --debugfile.
3874         * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
3875         Document this change.
3876         * NEWS: Likewise.
3878 2006-09-18  Eric Blake  <ebb9@byu.net>
3880         * modules/load.c (modules): Rename to...
3881         (m4modules): ...this, since it is an English word with 0
3882         arguments.
3883         * modules/gnu.c (symbols, m4symbols): Likewise.
3884         * doc/m4.texinfo (Listing Modules): Rename to...
3885         (M4modules): ...this.
3886         (Symbols): Rename to...
3887         (M4symbols): ...this.
3888         (Load, Foreach, Trace, Answers): Update to new spellings.
3889         * NEWS: Document this.
3891         * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
3892         such that without arguments, the global trace flag is changed
3893         rather than walking the table of all currently-defined macros.
3894         (set_trace_CB): No longer needed.
3895         * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
3896         (m4_set_symbol_traced): Delete.
3897         (m4_symtab_create): Nuke the nuke parameter.
3898         * m4/m4private.h (m4_get_symbol_value): Delete.
3899         * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
3900         (m4_set_symbol_name_traced): Free undefined entries that are no
3901         longer traced.
3902         (symbol_destroy_CB): Update caller.
3903         * m4/m4.c (m4_create): Update caller.
3904         * src/main.c (main): Likewise.
3905         (usage): Fix typo in last commit.
3906         * doc/m4.texinfo: Minor cleanups throughout.
3907         (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
3908         more nodes from branch.
3909         (Trace): Document new semantics, and how to simulate the old.
3910         * tests/builtins.at (multiquotes): Adjust to new semantics.
3911         * NEWS: Update somewhat.
3913 2006-09-14  Eric Blake  <ebb9@byu.net>
3915         Add --safer option, per debian bug 5898.
3916         * src/main.c (usage): Document new option.
3917         (SAFER_OPTION): New enumerator.
3918         (main): Set the option bit.
3919         * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
3920         accessors.
3921         * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
3922         (m4_get_safer_opt): New accessor.
3923         * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
3924         * modules/m4.c (syscmd, maketemp): Likewise.
3925         * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
3926         (Sysval, Maketemp): Add tests of this.
3927         * tests/options.at (--safer): Likewise.
3929 2006-09-13  Eric Blake  <ebb9@byu.net>
3931         * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
3932         stderr filtering.
3933         Reported by Ralf Wildenhues.
3935         Fix installcheck.
3936         * Makefile.am (check_LTLIBRARIES): Build test libraries in the
3937         tests directory, so we can be sure an installed build is not
3938         picking up uninstalled non-test libraries.
3939         (check-local, installcheck-local): Depend on test libraries.
3940         * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
3941         after file name.  Fix quoting.  Remove skipping the test, now
3942         that makefile guarantees test modules will exist.
3943         (Freezing modules, modules: shadow, modules: unload)
3944         (modules: trace): Always put test modules in module path.
3945         (modules: importing): Likewise, and rely on AT_CHECK_M4 for
3946         stderr munging.
3947         * src/main.c (usage): Document default module search path.
3948         (import_environment, frozen_file_to_read, frozen_file_to_write):
3949         Move...
3950         (main): ...here.
3951         * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
3952         * tests/m4.in: ...not here.
3953         Reported by Ralf Wildenhues.
3955 2006-09-08  Eric Blake  <ebb9@byu.net>
3957         * bootstrap: Kill unrelated copy-n-paste code from argument
3958         parsing.  Let Makefile generate testsuite.
3959         * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
3961 2006-09-07  Eric Blake  <ebb9@byu.net>
3963         * m4/m4module.h (m4_peek_input): No longer export.
3964         (m4_error_at_line, m4_warn_at_line): New prototypes.
3965         (m4_is_symbol_void): New macro.
3966         (m4_push_file): Update prototype.
3967         * m4/m4private.h (m4__peek_token): New prototype.
3968         (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
3969         * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
3970         * src/main.c (main): Allow reading from stdin twice.
3971         * modules/m4.c (include): Adjust to new prototype.
3972         * m4/input.c: General comment cleanup.
3973         (file_peek, file_read, file_unget, push_file): Set end flag on
3974         EOF, so that we don't call getc twice.
3975         (push_file, file_clean): Port fix from branch to avoid closing
3976         stdin prematurely.
3977         (pop_input): Port fix from branch to avoid reading free'd memory
3978         when input ends mid-string.
3979         (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
3980         (string_peek, string_read): Always use unsigned char.
3981         (m4_skip_line): Warn when dnl cut short by EOF.
3982         (peek_input): Rename from m4_peek_input.
3983         (match_input): Update signature, to distinguish between `(' token
3984         and multi-char quote or comment beginning with `('.
3985         (m4_input_exit): Cleanup now done in m4_pop_wrapup.
3986         (m4__peek_token): New function, ported from branch.
3987         (m4__next_token): Update to new token types.
3988         * m4/macro.c (expand_token, expand_argument): Use peek_token.
3989         * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
3990         (Invoking m4): Remerge from branch.
3992         * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
3993         (check-local): and put dependency here.
3994         Reported by Ralf Wildenhues.
3996 2006-09-05  Eric Blake  <ebb9@byu.net>
3998         * m4/m4module.h (m4_debug_message): New prototype.
3999         (M4_DEBUG_TRACE_MODULE): New debug bit.
4000         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4001         (M4_DEBUG_MESSAGE2): Delete these macros.
4002         * m4/debug.c (m4_debug_message): New method.
4003         (m4_debug_decode): Add module tracing as flag `m'.
4004         * m4/input.c (m4_push_file, file_clean): Use new method.
4005         * m4/path.c (m4_path_search): Likewise.
4006         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4007         * m4/module.c (install_builtin_table, install_macro_table)
4008         (m4__module_open, module_close, module_remove): Promote several
4009         module debug messages outside of DEBUG_MODULES.
4010         (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4011         DEBUG_MODULES with normal trace output.
4012         * src/main.c (usage): Document new flag.
4013         * doc/m4.texinfo (Debug Levels): Likewise.
4014         * Makefile.am ($(TESTSUITE)): Add missing dependency.
4015         * tests/m4.in: Neutralize platform-dependent module filenames.
4016         * tests/options.at (--debug): Update expected output.
4018 2006-09-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4020         * doc/m4.texinfo: Fix some typos.
4021         * tests/others.at: Likewise.
4023 2006-09-05  Eric Blake  <ebb9@byu.net>
4025         * m4/input.c (lex_debug): Remove dead code that broke compilation
4026         with --enable-debug.
4027         * m4/module.c (install_builtin_table, install_macro_table)
4028         (m4__module_init, m4__module_open, module_close)
4029         (module_remove): Fix compilation when --enable-debug.
4030         * m4/output.c (m4_shipout_text): Likewise.
4031         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4032         libraries when --enable-debug.
4033         * configure.ac (DYNAMIC_MODULES): New variable, to pass
4034         information to testsuite.
4035         (modules to preload): Determine modules after we know whether
4036         shared libraries are supported.
4037         * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4038         testsuite.
4039         * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4040         * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4041         (modules: shadow, modules: unload, modules: importing)
4042         (modules: trace): Use new macro.
4043         * tests/builtins.at (gmp): Likewise.
4045         * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
4046         All users updated.
4047         (expand_token): Avoid assertion just added to docs.
4048         (expand_macro): Track pending expansions, for when a symbol's
4049         definition changes during argument collection.
4050         (m4_macro_call, process_macro): Operate on symbol value, not
4051         symbol, since symbol may have changed during argument collection.
4052         * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
4053         (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
4054         (m4_get_symbol_value): Add fast macro version.
4055         * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
4056         (m4_macro_call): Adjust prototype.
4057         * m4/module.c (install_builtin_table): Check that flags are valid
4058         when creating builtin.
4059         * m4/symtab.c (m4__symtab_remove_module_references): Use
4060         m4_symbol_value_delete, rather than inlining it.
4061         (m4_symbol_value_copy): Copy placeholder text.
4062         (symbol_popval): Use m4_symbol_value_delete.
4063         (m4_symbol_value_delete): Implementation was missing when NDEBUG.
4064         Handle pending expansions.
4065         * modules/gnu.c (indir): Update to new prototype.
4066         * doc/m4.texinfo: Fix menus to be consistent with section names.
4067         (Defn): Add test that macro tokens flatten to empty string;
4068         triggered an assert before this patch.
4069         (Ifelse): Merge another node.
4070         (Loops): Split into...
4071         (Forloop, Foreach): New nodes; work is still underway on them.
4072         (Answers): Add more info on foreach macro; work is still underway.
4073         (Indir): Add test that indir collects arguments before looking up
4074         macro.
4075         * TODO: Update based on this patch.
4077 2006-09-01  Eric Blake  <ebb9@byu.net>
4079         * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
4080         * m4/hash.h (m4_free_hash_iterator): New prototype.
4081         * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
4082         ensure we don't do unsafe things while iterating.
4083         (HASH_ITER, ITER_CHAIN): New accessor macros.
4084         (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
4085         (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
4086         (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
4087         (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
4088         to catch unsafe actions.
4089         (m4_free_hash_iterator): New function, to avoid memory leaks, and
4090         when debugging, to track safe actions.
4091         (m4_hash_apply): Avoid memory leak.
4092         * m4/symtab.c (m4_symtab_apply): Likewise.
4093         * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
4094         in manually to src/ for now.
4095         * tests/builtins.at (gmp): Add keyword module.
4096         * tests/modules.at (Freezing modules, modules: shadow)
4097         (modules: unload, modules: importing, modules: trace): Likewise.
4099 2006-08-30  Eric Blake  <ebb9@byu.net>
4101         * m4/utility.c (m4_warn): Factor "Warning" out of messages into
4102         here.
4103         (m4_bad_argc, m4_numeric_arg): Update all callers.
4104         * m4/macro.c (m4_macro_call): Likewise.
4105         * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
4106         (Indir, Builtin, Ifdef): More doc merges.
4107         (Loops): Mention that documenting foreach would be nice.
4108         (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
4109         (Include, Eval, Location, M4exit): s/input.m4/stdin/.
4110         * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
4111         (substitute, syncoutput): Update all m4_warn callers.
4112         * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
4113         (traceon, traceoff): Make warning message consistent.
4114         (define, pushdef): Update all m4_warn callers.
4115         * tests/generate.awk: Choose file name so that documentation can
4116         show command-line behavior.
4117         * tests/builtins.at (define): Update to new wording.
4118         * tests/macros.at (pushdef/popdef): Likewise.
4119         * tests/freeze.at (loading format 1): Likewise.
4120         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4122         * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
4123         the branch.
4124         (Defn): Add failing test case for mixing text and builtin.
4125         (Renamesyms): Improve wording, and identify core dump that needs
4126         fixing.
4128 2006-08-29  Eric Blake  <ebb9@byu.net>
4130         * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
4131         (Arguments, Pseudo Arguments): More doc merges from the branch.
4132         (Macro expansion): Turn example into test.
4133         (Pseudo Arguments): Add example of avoiding argument.
4134         * modules/m4.c (undefine, popdef): Accept multiple arguments.
4135         (define, pushdef): Warn on non-text macro name.
4136         (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
4137         warning/error messages.
4138         (ifdef): Ignore extra arguments.
4139         * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
4140         (m4__symtab_remove_module_references): Check that there is no leak.
4141         * tests/macros.at (pushdef/popdef): Update to new message.
4142         * tests/builtins.at (define): Likewise.
4143         * tests/freeze.at (loading format 1): Likewise.
4144         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4146         * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
4147         (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
4148         as accessor function, to avoid compiler warning.
4149         * m4/module.c (m4__module_open): Move declaration of variable to
4150         avoid compiler warning.
4151         * src/main.c (main): Avoid shadowing a global variable.
4152         * src/freeze.c (produce_symbol_dump): Avoid unused variable
4153         warning when NDEBUG.
4154         * tests/options.at (--discard-comments, --import-environment)
4155         (--debug, --prepend-include, --help and --version): Rename tests
4156         to name option tested.
4158 2006-08-28  Eric Blake  <ebb9@byu.net>
4160         * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
4161         * m4/module.c (install_builtin_table): ...to here, and add
4162         assertion that blind macros require arguments.
4163         * m4/m4module.h (struct m4_builtin): Document restrictions that
4164         must be met during module loading.
4165         * modules/gnu.c (changeresyntax, changesyntax): These are blind,
4166         so require an argument to avoid triggering assertion.
4167         (debugfile): Tweak error message.
4169 2006-08-25  Eric Blake  <ebb9@byu.net>
4171         * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
4172         (M4_BUILTIN_SIDE_EFFECT): New enumerators.
4173         (struct m4_builtin): New member flags replaces groks_macro_args,
4174         blind_if_no_args.  min_args and max_args are now 0-based.
4175         Rearrange members to reduce size on platforms where function
4176         pointers are 64 bits but regular pointers are 32.
4177         (m4_bad_argc): Add argument.
4178         * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
4179         * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
4180         effect into account.
4181         * m4/module.c (install_builtin_table): Adjust all users affected
4182         by this API change.
4183         * m4/macro.c (m4_macro_call): Likewise.
4184         * src/freeze.c (reload_frozen_state): Likewise.
4185         * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
4186         * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
4187         * modules/import.c (builtin_functions): Likewise.
4188         * modules/load.c (builtin_functions): Likewise.
4189         * modules/modtest.c (builtin_functions): Likewise.
4190         * modules/mpeval.c (builtin_functions): Likewise.
4191         * modules/perl.c (builtin_functions): Likewise.
4192         * modules/shadow.c (builtin_functions): Likewise.
4193         * modules/stdlib.c (builtin_functions): Likewise.
4194         * modules/time.c (builtin_functions, mktime_functions)
4195         (strftime_functions): Likewise.
4196         * doc/m4.texinfo (Loops): Update test now that shift is blind.
4197         (Macro Arguments): Fix typo in test.
4198         (Patsubst): Fix typo in test.
4199         * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
4200         end of string.  Fix return value when ignore_duplicates.
4201         * tests/builtins.at (patsubst): Fix typo in test.
4203         * tests/options.at (debug-flags): Update to reflect new message.
4204         (deprecated options, prepend-include, help and version): New
4205         tests.
4206         * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
4207         test omits an input file name.
4208         * src/main.c (long_options, main): Add -B/--prepend-include.
4209         (usage): Document it.
4210         (main): `m4 --help --version' now displays help, not version.
4211         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4212         dirname filenamecat.
4213         * m4/m4module.h (m4_add_include_directory): Add parameter.
4214         * m4/m4private.h (m4__include_init): New prototype.
4215         * m4/m4.c (m4_create): Put `.' on path before options are
4216         collected.
4217         * m4/path.c (includes): Assume C89.  Use gnulib for file name
4218         management.
4219         (m4__include_init): New function.
4220         (search_path_add): Allow prepending.
4221         (m4_add_include_directory, search_path_env_init): Adjust callers.
4222         (m4_path_search): Relative names now invoke path search, since
4223         `.' might not be first.
4224         * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
4226 2006-08-25  Bruno Haible  <bruno@clisp.org>  (tiny change)
4227         and Eric Blake  <ebb9@byu.net>
4229         * bootstrap: Run autopoint before gnulib-tool, since autopoint
4230         0.15 installs macros obsoleted by current gnulib.
4232 2006-08-25  Eric Blake  <ebb9@byu.net>
4234         * doc/m4.texinfo (Macro Arguments): Another section merged;
4235         testsuite failures now exposed.
4237 2006-08-23  Eric Blake  <ebb9@byu.net>
4239         * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
4240         (Input processing): More doc merges from the branch.
4241         (Regular expression syntax): Add introductory text.
4242         (Inhibiting Invocation): More doc merges from the branch.
4243         (Other tokens): Reorder after comments.
4244         * tests/generate.awk: Allow passing options to doc examples.
4246 2006-08-22  Eric Blake  <ebb9@byu.net>
4248         * tests/options.at (debug-flags): New test.
4249         * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
4250         not negative, to distinguish failure in m4_debug_decode.
4251         (m4_debug_decode): Add new parameter.
4252         * modules/gnu.c (regexp): Slight cleanup.
4253         (renamesyms): Ignore excess arguments.
4254         (syncoutput): Make case-insensitive, warn on bad argument.
4255         (debugmode): Factor -+ handling out to...
4256         * m4/debug.c (m4_debug_decode): ...here.
4257         (m4_debug_message_prefix): Fix spacing.
4258         * src/main.c (main): Let -d option adjust flags.
4259         * m4/input.c (file_clean): Avoid printing empty file name.
4260         * doc/m4.texinfo (Syncoutput): Document new range of input.
4261         (Invoking m4): Document use of multiple -d flags.
4263         Start porting various fixes from the branch that use gnulib.
4264         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4265         binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
4266         regexprops-generic stdlib-safer unlocked-io.
4267         * m4/debug.c (m4_debug_set_output): Close debug file on exec.
4268         * m4/path.c (m4_path_search): Close input file on exec, reject
4269         empty file name, fix parameter naming.
4270         * m4/output.c (make_room_for): Close diversion file on exec.
4271         (includes): Assume C89 headers.
4272         (tmpfile): For now, we don't want tmpfile-safer, because we want
4273         clean-temp later.
4274         * m4/m4private.h (includes): Use various gnulib headers.
4275         * doc/regexprops-generic.texi: Use gnulib's copy.
4277         * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
4278         * AUTHORS: Add copyright.
4279         * ChangeLog: Likewise.
4280         * README: Likewise.  Require automake 1.9b or later.
4281         * HACKING: New file.
4282         * README-alpha: Add copyright.
4283         * THANKS: Likewise.  Update.
4284         * doc/STYLE: Add copyright, and tweak for changed directories.
4285         * modules/README: Add copyright, and tweak for libtool version.
4286         * examples/COPYING: New file.
4287         * examples/WWW/COPYING: Likewise.
4288         * examples/WWW/m4lib/COPYING: Likewise.
4289         * modules/shadow.m4: Add copyright.
4290         * modules/perl.m4: Likewise.
4291         * modules/modtest.m4: Likewise.
4292         * modules/stdlib.m4: Likewise.
4293         * modules/time.m4: Likewise.
4294         * modules/time2.m4: Likewise.
4295         * po/Makevars: Likewise.
4296         * tests/iso8859.m4: Likewise.
4297         * tests/m4.in: Likewise.
4298         * NEWS: Add (C) to copyright.
4299         * TODO: Likewise.
4300         * m4/system_.h: Likewise.
4301         * tests/atlocal.in: Likewise.
4302         * tests/builtins.at: Likewise.
4303         * tests/freeze.at: Likewise.
4304         * tests/generate.awk: Likewise.
4305         * tests/macros.at: Likewise.
4306         * tests/modules.at: Likewise.
4307         * tests/options.at: Likewise.
4308         * tests/others.at: Likewise.
4309         * tests/testsuite.at: Likewise.
4310         * m4/utility.c: Spell out copyright years.
4311         * src/main.c: Likewise.
4313         * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
4315 2006-08-21  Eric Blake  <ebb9@byu.net>
4317         * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
4318         * modules/gnu.c (esyscmd): Use -1 for failure.  Set sysval to 0
4319         when no arguments are given, but without losing warning about 0
4320         arguments.
4321         * modules/m4.c (syscmd): Likewise.
4322         (includes): Assume C89.
4323         (m4_sysval): Make static.
4324         (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
4325         (sysval): Port calculation from branch.
4327 2006-08-20  Eric Blake  <ebb9@byu.net>
4329         * m4/macro.c (expand_macro): Move argument check...
4330         (m4_macro_call): ...to here, so indir will warn.
4331         * modules/gnu.c (__program__): New macro, ported from branch.
4332         (builtin): Perform argument check.
4333         (changesyntax): Avoid out-of-bounds read.
4335         * modules/gnu.c (includes): Assume stdlib.h, errno.
4336         (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4337         (substitute): Add caller parameter, avoid out-of-bounds memory
4338         references.
4339         (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4340         callers.
4342 2006-08-16  Eric Blake  <ebb9@byu.net>
4344         * po/POTFILES.in: Add more files that contain translatable
4345         strings.
4346         * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4347         information to translators.
4348         (USE_MSGCTXT): New var for gettext 0.15.
4349         * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4350         debug/trace messages in lower case.
4351         * m4/macro.c (expand_argument): Likewise.
4352         * m4/path.c (m4_path_search): Likewise.
4353         * src/main.c (main): Likewise.
4355 2006-08-14  Eric Blake  <ebb9@byu.net>
4357         * src/main.c (usage): Document --import-environment.
4358         * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4360 2006-08-11  Eric Blake  <ebb9@byu.net>
4362         * bootstrap (func_get_translations): Only remove files when doing
4363         full update.
4364         (func_update_po): Avoid CDPATH problems.
4366 2006-08-10  Eric Blake  <ebb9@byu.net>
4368         * bootstrap (func_get_translations): New function.
4369         (func_update_po): Borrow ideas from tar to correctly pull in
4370         translations from newer location.
4372 2006-08-09  Eric Blake  <ebb9@byu.net>
4374         * bootstrap: Recent gnulib no longer has jm_* macros to worry
4375         about.
4376         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4377         verror.
4378         * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
4379         (m4_error, m4_warn): ... these new prototypes.
4380         (m4_current_file, m4_current_line): Move into context, rather
4381         than leaving as globals.
4382         (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
4383         (m4_undivert_all, m4_input_init): Now takes context.
4384         * m4/utility.c (m4_error, m4_warn): New functions.
4385         * m4/m4private.h: Assume errno exists.
4386         (struct m4): Move warning_status to a bit flag,
4387         and add exit_status.  Adjust accessors accordingly.
4388         * src/main.c (print_program_name_CB): No longer needed.
4389         (main): Use new m4_get_fatal_warnings_opt.
4390         * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
4391         instead of issuing "INTERNAL ERROR".  Pass context when needed,
4392         and use new accessors.
4393         * m4/input.c: Likewise.
4394         * m4/macro.c: Likewise.
4395         * m4/output.c: Likewise.
4396         * m4/utility.c: Likewise.
4397         * modules/evalparse.c: Likewise.
4398         * modules/gnu.c: Likewise.
4399         * modules/load.c: Likewise.
4400         * modules/m4.c: Likewise.
4401         * modules/mpeval.c: Likewise.
4402         * src/freeze.c: Likewise.
4403         * src/main.c: Likewise.
4404         * tests/macros.at: Adjust to new message format.
4405         * tests/builtins.at: Likewise.
4406         * tests/freeze.at: Likewise.
4407         * tests/modules.at: Likewise.
4408         * doc/m4.texinfo: Likewise.
4410         * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
4411         newer gettext 0.15.
4413 2006-08-03  Eric Blake  <ebb9@byu.net>
4415         * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
4416         gracefully handle ENOSYS.
4417         * TODO: Update.
4418         * THANKS: Update.
4420 2006-07-28  Eric Blake  <ebb9@byu.net>
4422         * src/freeze.c (reload_frozen_state): Copy string when creating
4423         placeholder, to avoid memory corruption.
4424         * m4/symtab.c (symbol_popval): Avoid memory leak.
4425         (m4_symbol_rename): Avoid shadowing rename function.
4426         (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
4427         * tests/freeze.at (reloading unknown builtin): Add test.
4428         * tests/generate.awk: Capture m4.texinfo line number in
4429         testsuite.log, not just generated.at.
4431         Port idea from branch that a frozen file can request an unknown
4432         builtin without producing a warning unless the builtin is
4433         actually used.
4434         * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
4435         (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
4436         (m4_set_symbol_value_placeholder): New accessors.
4437         * m4/m4module.h (m4_is_symbol_placeholder),
4438         (m4_get_symbol_value_placeholder),
4439         (m4_set_symbol_value_placeholder),
4440         (m4_get_symbol_placeholder): Likewise.
4441         * m4/symtab.c (m4_is_symbol_value_placeholder),
4442         (m4_get_symbol_value_placeholder),
4443         (m4_set_symbol_value_placeholder): Likewise.
4444         (dump_symbol_CB): Handle new symbol type.
4445         * m4/macro.c (trace_pre): Likewise.
4446         (m4_macro_call): Warn when invoking a placeholder.
4447         * modules/m4.c (dumpdef): Handle dumping a placeholder.
4448         (defn): Warn when referencing a placeholder.
4449         * src/freeze.c (dump_symbol_CB): Ignore placeholder when
4450         freezing.
4451         (reload_frozen_state): When reloading unknown builtin, install a
4452         placeholder instead of warning.
4453         * tests/freeze.at (loading format 1): Allow warning when
4454         popdef'ing undefined function.
4456 2006-07-27  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
4458         * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
4459         function. Shift by 7, not 3, for consistency with
4460         gnulib/lib/hash.c. Don't assume hash word is 32 bits.
4462 2006-07-27  Eric Blake  <ebb9@byu.net>
4464         * src/main.c (usage): Update to match branch.
4465         (main): Update --version info to distinguish between program name
4466         `m4' and package name `GNU M4'.
4467         (AUTHORS): Translate René Seindal's name.
4468         * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
4469         * Makefile.am (doc/m4.1): Update to match branch.
4470         * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
4471         branch.
4473         * m4/system_.h (EXIT_MISMATCH): Define.
4474         * src/main.c (main): Don't clear syntax table for version 1.
4475         (usage): Document exit status.
4476         * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
4477         branch, and require V directive to appear first in file.  Fix
4478         broken logic for detecting F and T in version 1 files.
4480 2006-07-22  Eric Blake  <ebb9@byu.net>
4482         * src/main.c (stackovf_handler): Document the problems in our
4483         overflow handler.
4484         * src/stackovf.c: Forward port changes in branch to use POSIX
4485         sa_sigaction when available.
4486         (process_sigsegv): Avoid buffer overrun when error string is
4487         translated, although the fact that we translate in a signal
4488         handler is still a bug.
4489         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
4490         from branch to modernize checks.
4492         * modules/format.c (format): Avoid compiler warning that str may
4493         be used uninitialized.
4495         * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
4496         spelling.
4497         (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
4498         (DEBUG_MACRO): Remove unused macro.
4499         * src/stackovf.c: Avoid compiler warnings.
4500         * m4/input.c: Likewise.
4501         * m4/module.c: Likewise.
4502         * m4/output.c: Likewise.
4503         * m4/path.c: Likewise.
4504         * m4/symtab.c: Likewise.
4505         * m4/syntax.c: Likewise.
4507 2006-07-20  Eric Blake  <ebb9@byu.net>
4509         * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
4510         Regenerate to explicitly ask for --assume-autoconf=2.60.
4512 2006-07-19  Eric Blake  <ebb9@byu.net>
4514         * po/ChangeLog: Merge into main ChangeLog, then delete file.
4515         * THANKS: Update.
4517         * doc/m4.texinfo (copying): Relax restriction on front-cover and
4518         back-cover texts.
4520 2006-07-17  Eric Blake  <ebb9@byu.net>
4522         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
4523         0.14.5.
4525         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
4526         xvasprintf'.
4527         * modules/format.c (includes): Use xvasprintf.h.
4528         (format): Make static.  Avoid buffer overflow, that can lead to
4529         arbitrary code execution exploit.  Only pass unsigned char to
4530         is*().  Support F, g, and G specifiers.
4531         * doc/m4.texinfo (Format): Expose buffer overrun bug.  Document
4532         new specifiers.
4534 2006-07-17  Gary V. Vaughan  <gary@gnu.org>
4536         Ensure M4 compiles correctly with -DDEBUG, and use a single
4537         consistent definition of various /DEBUG_[A-Z]+/ symbols:
4539         * m4/input.c: Have commented out out DEBUG_INPUT only by default.
4540         (m4_print_token): Use m4_get_symbol_value_text and
4541         m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
4542         and VALUE_FUNC respectively.
4543         (m4__next_token): Use m4_print_token call instead of obsolescent
4544         print_token symbol.
4545         * m4/module.c: Have commented out out DEBUG_MODULE only by default.
4546         * m4/output.c: Similarly for DEBUG_OUTPUT.
4547         * m4/path.c: Similarly for DEBUG_INCL.
4548         * m4/symtax.c: Similarly for DEBUG_SYM.
4549         * m4/syntax.c: Similarly for DEBUG_SYNTAX.
4550         * src/stackovf.c: Similarly for DEBUG_STACKOVF.
4551         * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
4552         preprocessor macros defined with -DDEBUG compiles.
4554 2006-07-17  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
4556         * bootstrap: Correct typo in --download-po argument parsing.
4558 2006-07-15  Eric Blake  <ebb9@byu.net>
4560         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
4561         gendocs fdl'.
4562         * tests/generate.awk (normalize): Recognize @tabchar.
4563         * doc/m4.texinfo (Top): Start merging from branch.  Remove tabs.
4564         Fix menus.  Upgrade FDL license from 1.1 to 1.2.  Fix overfull
4565         hboxes.
4566         (Index macro, Shell commands, Incompatiblities): Rename nodes
4567         from Index, UNIX commands, Other incompat.
4568         (Platform macros, Using frozen files, Frozen file format 1)
4569         (Frozen file format 2, Copying This Manual, Indices): New nodes.
4570         * Makefile.am (EXTRA_DIST): Distribute gendocs.
4571         (MAINTAINERCLEANFILES): Clean up files from gnulib.
4572         (doc_m4_TEXINFOS): Depend on fdl.texi.
4573         (web-manual): New maintainer target.
4575 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
4577         * doc/m4.texinfo (Modules):  RMS asked me for an explanation of
4578         the modular architecture of M4.  The result is paraphrased here
4579         for the benefit of future readers of the manual.
4581 2006-07-14  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
4583         * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
4585 2006-07-14  Eric Blake  <ebb9@byu.net>
4587         * src/main.c (main): Avoid compiler warning.
4588         * modules/gnu.c (renamesyms): Remove unused variable.
4590 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
4592         * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
4593         (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
4594         new functions for managing regexp syntax options.
4595         * m4/m4private.h (m4): Add regexp_syntax field.
4596         * m4/resyntax.c: New file implements the above.
4597         * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
4598         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
4599         (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
4600         (m4_patsubst_do, m4_renamesyms_do): Removed.
4601         (builtin_changeresyntax): New builtin to change regular expression
4602         syntax.
4603         (m4_resyntax_encode_safe): Factor out diagnostics code.
4604         * src/freeze.c (produce_resyntax_dump): New function to dump
4605         default regexp syntax specifier to frozen file.
4606         (reload_frozen_state): Updated to action 'R' directive.
4607         * src/main.c (usage): Describe new -r option.
4608         (long_options, OPTSTRING): Declare it.
4609         (main): Encode and store cli regexp syntax option argument.
4610         * tests/freeze.at (regexp syntax): New test that regexp syntax
4611         survives freezing.
4612         * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
4613         * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
4614         (Epatsubst and Patsubst): Renamed to...
4615         (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
4616         documentation and added new examples.
4617         (Changeresyntax): New section describing changeresyntax builtin,
4618         and regexp syntax names.
4619         (Regular expression syntax): New section describing differences
4620         between various regular expression syntaxes.
4621         (Frozen files): Document 'R' directive.
4622         * NEWS: Updated.
4624 2006-07-13  Gary V. Vaughan  <gary@gnu.org>
4626         * bootstrap: Enhanced to work more like our other scripts:
4627         Add a copyright statement; support --version and --help; accept a
4628         --download-po option with argument as a substitute for DOWNLOAD_PO
4629         in the environment.
4631 2006-07-11  Eric Blake  <ebb9@byu.net>
4633         * Makefile.am (doc/m4.1): Port patch from branch that avoids
4634         intermediate file.
4635         * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
4636         changed.
4638 2006-07-10  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
4640         * tests/builtin.at (patsubst, regexp):  Adjust these tests, now
4641         that `\0' is no longer accepted.
4643         * src/main.c (usage): Alphabetize options within their sections.
4645         * modules/gnu.c (m4_regexp_search, regsub, substitute)
4646         (esyscmd):  Improve comments.
4648         * modules/gnu.c (substitute): Remove old warning for \0.
4649         (substitute_warned): No longer required.  Removed.
4651         * modules/gnu.c: Put macro definitions into alphabetical order.
4653 2006-07-07  Eric Blake  <ebb9@byu.net>
4655         * tests/freeze.at (loading format 1): New file, with new test.
4656         * tests/testsuite.at: Include it.
4657         * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
4658         * tests/modules.at (Freezing modules): Likewise.
4660         * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
4661         (AC_CHECK_HEADERS): Assume signal.h.
4662         (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
4663         (AC_CHECK_FUNCS_ONCE): Likewise.
4664         * src/m4.h (includes): Assume signal.h.
4666 2006-07-05  Eric Blake  <ebb9@byu.net>
4668         Fix all testsuite failures on cygwin.
4669         * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
4670         branch-1_4.  Solves testsuite failure when uninstalled m4 is
4671         shadowed by redefinition of PATH in libtool wrapper.
4672         * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
4673         contains the -no-undefined required by cygwin.
4674         (TESTS_ENVIRONMENT): Export abs_top_builddir.
4675         * tests/others.at (misc): Port to platforms where /etc/passwd
4676         does not exist or does not contain user named root.
4677         * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
4678         directory.
4679         * tests/builtins.at (define, divert): Avoid overquoting.
4680         * tests/generate.awk (new_group): Likewise.
4682 2006-07-05  Gary V. Vaughan  <gary@gnu.org>
4684         The regs_allocated field in a struct re_pattern_buffer refers
4685         to the state of a particular re_registers struct when used in
4686         successive matches using the same compiled pattern.  Avoid a
4687         SEGV in `renamesyms' resulting from using a new re_registers
4688         with an existing re_pattern_buffer:
4690         * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
4691         pattern buffer and registers.
4692         (m4_regexp_search): New function to call re_regexp_search with
4693         correctly matched pattern buffer and register instantiations.
4694         (m4_regexp_compile): Return an m4_pattern_buffer.  Adust all
4695         callers.
4697 2006-07-04  Gary V. Vaughan  <gary@gnu.org>
4699         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
4700         changes to gnulib getopt.m4 since last build.
4701         * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
4702         if the system getopt fails M4_GETOPT tests.
4704 2006-06-22  Eric Blake  <ebb9@byu.net>
4706         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
4707         Reported by Bruno Haible.
4709 2006-06-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4711         * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
4713 2006-06-19  Eric Blake  <ebb9@byu.net>
4715         * THANKS: Update.
4717 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4719         * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
4720         (clean-local): Split into and depend upon...
4721         (clean-local-tests, clean-local-src): ...these two.  The latter
4722         removes the libtool object directory below `src', to work around
4723         a buglet in Automake, failing to list it.
4724         (EXTRA_DIST): Distribute modules/perl.c.
4726 2006-06-19  Eric Blake  <ebb9@byu.net>
4728         * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
4729         right side of dependency; VPATH does that.
4730         (stamp-vcl): Update to use libtool's algorithm.
4731         (EXTRA_DIST): Distribute stamp-vcl.
4732         Reported by Ralf Wildenhues.
4733         (TESTSUITE): Revert earlier change that used absolute path, as
4734         that broke 'make dist' in VPATH.  Stick with $(srcdir) instead.
4735         (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
4736         (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
4737         atlocal takes care of it instead.
4738         (check-local, installcheck-local, clean-local): Inline absolute
4739         path to testsuite here, rather than relative path to testsuite
4740         elsewhere.
4742 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4744         * m4/m4private.h (DELETE): Cast away const here...
4745         * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
4746         * src/freeze.c (reload_frozen_state): Avoid uninitialized
4747         variable warning.
4749 2006-06-19  Eric Blake  <ebb9@byu.net>
4751         * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
4752         .info pages are built.
4753         Reported by Ralf Wildenhues.
4754         (EXTRA_DIST): Inline definition of testsuite, so that make dist
4755         works again.
4757 2006-06-16  Eric Blake  <ebb9@byu.net>
4759         Follow recommendations from autoconf manual for autotest.
4760         * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
4761         turn it into an absolute path until autotest provides an option
4762         that allows us to avoid changing directories.  Properly quote
4763         throughout.
4764         (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
4765         (check-recursive): Delete unused target.
4766         ($(TESTSUITE)): Atomically update testsuite.
4767         (CD_TESTDIR): Simplify.
4768         (m4__cd): Delete unused macro.
4769         (check-local): Let TESTSUITEFLAGS influence the run.
4770         (installcheck-local): Let TESTSUITEFLAGS override
4771         AUTOTEST_PATH.  Add dependencies.
4772         (clean-local): Clean up.
4773         (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
4774         * README: Document how to use the testsuite.
4776 2006-06-15  Eric Blake  <ebb9@byu.net>
4778         * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
4780         * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
4781         clashes with m4sugar.
4782         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
4783         * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
4784         * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
4785         * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
4786         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
4787         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
4788         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
4789         * configure.ac: Likewise.
4790         (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
4791         * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
4792         conditional.
4793         * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
4795         Reduce compiler warnings.  Inside GMP, mpq_t is an array type, so
4796         const mpq_t is not assignable from plain mpq_t.  Avoid
4797         type-punning warnings caused trying to mix these types.
4798         * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
4799         (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
4800         * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
4801         (mult_term, exp_term): Remove type-punning casts.
4802         (numb_pow): Remove const qualifier.
4803         * src/freeze.c (reload_frozen_state): Fix typo in messages.
4804         Fix variables that can be used uninitialized, which fixes
4805         security hole where malicious frozen file can execute arbitrary
4806         code.
4808 2006-06-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4810         * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
4812 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4813         and Eric Blake  <ebb9@byu.net>
4815         Allow `make dist' to work again.
4816         * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
4817         (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
4818         (cvs-dist): Fix typo.
4819         * NEWS: Match current version number.
4821 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4823         * Makefile.am (AM_CPPFLAGS):  Add $(LTDLINCL), so the right
4824         ltdl.h is used.
4826         * bootstrap: Do not run libtoolize manually, this is done
4827         correctly by autoreconf.  Invoke autoreconf with --no-recursive
4828         to avoid unnecessary rerunning of autotools for libltdl.
4830 2006-06-13  Eric Blake  <ebb9@byu.net>
4832         * THANKS: Update.
4834 2006-06-12  Eric Blake  <ebb9@byu.net>
4836         * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
4837         bother with mktemp.
4838         * src/m4.h: Don't declare mktemp.
4839         * m4/input.c (m4__next_token): Avoid bzero.
4840         * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
4841         * Makefile.am (doc/m4.1): Depend on installed help2man, rather
4842         than distributing outdated helptoman.pl.
4843         * doc/helptoman.pl: Delete.
4845 2006-06-10  Eric Blake  <ebb9@byu.net>
4847         * README (Patches): Document the current dependence on CVS
4848         builds of autotools.
4849         * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
4850         * configure.ac: Use consistent quoting throughout.
4851         (AC_PREREQ): Bump to 2.59d.
4852         (AC_INIT): Package name begins with uppercase.
4853         (AC_ARG_WITH): Use AS_HELP_STRING.
4854         (AM_INIT_AUTOMAKE): Enable gnits mode.
4855         (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
4856         (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
4857         (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
4858         done by gnulib or automake, or which autoconf has declared
4859         obsolete.
4860         * m4/m4private.h (Includes): Assume C89 or better, and use errno
4861         unconditionally.
4862         * m4/output.c (Includes): Likewise.
4863         * modules/gnu.c (Includes): Likewise.
4864         * modules/m4.c (Includes): Likewise.
4865         * src/m4.h (Includes): Likewise.
4867         * README-alpha: Update web address.
4868         * README: Likewise. Change encoding to ASCII.  Remove old advice
4869         about cygwin.  Document bootstrapping dependency.
4870         * AUTHORS: Update from branch-1_4.
4871         * THANKS: Likewise.  Change encoding to UTF-8.
4872         * BACKLOG: Delete.  This file is too old and unmaintained to be
4873         worthwhile.
4874         * ChangeLog: Change encoding to UTF-8.
4876         Avoid compiler warnings.
4877         * m4/macro.c (trace_format): Don't mark this as a printf format,
4878         since we don't accept the same set of modifiers as printf.  It
4879         would be nice if gcc let us specify a custom format archetype.
4880         * src/main.c (main): Cast away const.
4882 2006-06-10  Andreas Schwab  <schwab@suse.de>  (tiny change)
4883             Eric Blake  <ebb9@byu.net>
4885         * modules/time.c (ctime): Pass correctly typed variable to
4886         m4_numeric_arg.
4887         (gmtime): Likewise.
4888         (localtime): Likewise.
4889         (strftime): Likewise.
4890         * m4/utility.c (m4_numeric_arg): For now, document arbitrary
4891         limit inherent in this interface.
4893 2006-05-08  Bruno Haible  <bruno@clisp.org>  (tiny change)
4895         * modules/m4.c (WEXITSTATUS): Provide fallback definition.
4896         (sysval): Use WEXITSTATUS.
4897         * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
4898         big-endian and little-endian wait status definitions.
4900 2006-05-06  Eric Blake  <ebb9@byu.net>
4902         * po/Makevars (MSGID_BUGS_ADDRESS): Add.
4903         * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
4904         in src, not gnu.
4906 2006-05-06  Eric Blake  <ebb9@byu.net>
4908         * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
4909         subdirectory to use.
4910         (support for -pipe): Move after LT_INIT, since it relies on
4911         libtool internals.
4913 2006-05-05  Eric Blake  <ebb9@byu.net>
4915         * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
4917         * THANKS: Update.
4919 2006-05-05  Bruno Haible  <bruno@clisp.org>
4920         and Eric Blake  <ebb9@byu.net>
4922         * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
4923         * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
4924         usage pattern.
4925         * bootstrap: Update usage of gnulib-tool.
4927 2006-05-04  Eric Blake  <ebb9@byu.net>
4929         * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
4930         Cleanup whitespace.
4932 2005-12-05  Gary V. Vaughan  <gary@gnu.org>
4934         * bootstrap (func_update_po): Synch with CVS GNU tar.  wget 1.9.x
4935         and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
4936         Reported by Eric Blake <ebb9@byu.net>
4938 2005-12-04  Gary V. Vaughan  <gary@gnu.org>
4940         * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
4941         http caching as -C is no longer supported by wget 1.10.x.
4942         Reported by Eric Blake <ebb9@byu.net>
4944 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
4946         * m4/module.c (caller_id): To match libtool-2.0 interface, changed
4947         to ...
4948         (iface_id): ...an lt_dlinterface_id type.
4949         (m4__module_find): New abstraction for lt_dlhandle_fetch.  Use
4950         throughout, instead of calling obsolete lt_dlhandle_find directly.
4951         (m4__module_next): Use multiloader-safe lt_dlhandle_iterate.  Use
4952         throughout, instead of calling obsolete lt_dlhandle_next.
4953         * m4/m4private.h (m4__module_find): Declare it.
4954         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
4955         Use m4__module_next instead of obsolete lt_dlhandle_next.
4957 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
4959         * bootstrap (func_update_po): Update pofiles directly from the
4960         translation project.
4961         * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
4962         po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
4963         these files under source control anymore.
4964         Suggested by Eric Blake <ebb9@byu.net>
4966 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
4968         * ltdl/m4/m4-gnulib.m4: Update FSF contact address.  Somehow this
4969         file escaped the address updates on 2005-05-01.
4971 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
4973         * bootstrap: Allow user overriding of gnulib-tool location, and
4974         correctly determine module source directories whether gnulib-tool
4975         is given as a relative or absolute path, or is found by searching
4976         PATH.
4977         Reported by Eric Blake <ebb9@byu.net>
4979 2005-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4981         * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
4982         and $RM are defined for various versions of
4983         AC_LIBTOOL_COMPILER_OPTION.
4985         * bootstrap (AUTORECONF): New variable to allow user overriding of
4986         autoreconf path.
4988 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
4990         * doc/m4.texinfo (History): Add better notes on the ancestory of
4991         GNU m4, and other historical interest.
4993 2005-05-08  Gary V. Vaughan  <gary@gnu.org>
4995         * m4/symtab.c (m4_symbol_rename): New function that performs a low
4996         level symbol rename.
4997         * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
4998         * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
4999         (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5000         regsub...
5001         (erenamesyms, renamesyms): ...builtins that use these to implement
5002         macro renaming by regular expression.
5003         * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5004         * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5005         to stop the new generated tests from choking.
5007 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
5009         Since most of the build is handled from a single Makefile.am now,
5010         we can teach make about the dependencies between the m4 binary and
5011         the preopened modules it is built against:
5013         * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5014         preopened modules.
5015         * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5016         of the preopened modules have changed.
5018 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
5020         * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5021         have a native implementation.
5023 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
5025         * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed.  These are
5026         handled already by gnu/exit.h.
5028         * configure.ac (gl_MODULES): Add assert to support a
5029         --disable-assert configure time option for NDEBUG setting.
5031         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5032         * bootstrap (src_modules): Add version-etc-fsf.
5033         * src/main.c (version_etc_copyright): Removed.
5035         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5037 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5039         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5040         recognition macros.
5041         * src/freeze.c (produce_frozen_state): Use \n line-endings even
5042         on Windows, so that the frozen file reader will work.
5043         Reported by Josef T. Burger <bolo@bolo.com>
5045 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
5047         Forward port of a patch that allowed m4-1.4.2 to compile on
5048         QNX 6.3:
5050         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
5051         sys/signal.h.
5052         * src/m4.h: And include them as appropriate.
5053         * src/main.c, src/stackovf.h: Don't include signal.h literally;
5054         m4.h will include the correct file.
5056 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5058         * m4/m4private.h: Make errno visible for the sources patched
5059         below.
5061 2005-05-04  Paul Eggert  <eggert@twinsun.com>
5063         * src/main.c (print_program_name_CB): Preserve errno, since
5064         M4ERROR relies on this.
5065         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
5066         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
5067         * m4/path.c (m4_path_search): Don't let "free" trash errno when
5068         returning NULL.
5070         * m4/output.c (m4_insert_file): Don't assume errno has a valid
5071         value simply because fread returns zero.  This fixes a
5072         portability bug reported by Marion Hakanson in
5073         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
5075 2005-05-04  Santiago Vila  <sanvila@debian.org>
5077         * tests/stackovf.test: Use tempfile if available.
5079 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
5081         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
5082         * m4/output.c (m4_insert_file): Do not mix buffered and
5083         unbuffered I/O, as this breaks on the Hurd.
5085 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5087         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
5088         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
5089         and libtoolize does a better job of ltdl importing now too, so
5090         take advantage of that while updating the tree:
5092         * acm4, config: Moved from here...
5093         * ltdl/m4, ltdl/config: ...to here.
5094         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
5095         src/Makefile.am, tests/Makefile.am: Removed...
5096         * Makefile.am: ...and migrated to here, with adjustments to
5097         compensate for relative path differences.
5098         * commit: Adjust relative paths.
5099         * configure.ac: Adjust relative paths.
5100         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
5101         patch.
5102         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
5103         the meanwhile, CVS HEAD libtool is needed.
5104         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
5105         stricly new enough, we also need a patch.
5106         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
5107         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
5108         (gl_MODULES): Don't list getopt and version-etc, as they don't
5109         belong in libm4.
5110         * bootstrap: After running gnulib-tool to import the listed
5111         modules, fetch getopt and version-etc into src manually.
5112         (ltdldir): Change to ltdl.
5113         * src/main.c: Adjust for changes in version-etc API.
5114         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
5115         but works when the getopt module isn't to be included in the lib.
5116         * README: Add note about patching autoconf and automake to
5117         bootstrap CVS m4.
5119 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
5121         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
5122         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
5123         empty file rather than to a nonexistent file.  This closes a
5124         common security hole.
5125         * modules/m4.c (m4_maketemp): Implement the above, by using
5126         mkstemp rather than mktemp.
5128 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
5130         The FSF are moving offices today.  Changed their contact address
5131         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
5132         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
5134 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
5136         * tests/Makefile (clean-local): Ignore testsuite cleanup
5137         failures.
5139 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
5141         * tests/Makefile (clean-local): Only run the testsuite cleanup
5142         if the testsuite has been generated.
5144 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
5146         * TODO: slight clarification of the example of qindir usage.
5148 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
5150         * TODO: Add qindir requirement, and defn bug.
5151         From Stepan Kasal  <kasal@ucw.cz>
5153 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
5155         * TODO: Add ``execution stack'', fix a typo.
5156         * doc/m4.texinfo: Typos.
5158 2004-12-24  Eric Blake  <ebb9@byu.net>
5160         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
5161         to the gnu subdirectory.
5162         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
5163         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
5164         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
5165         * m4/system_.h: Likewise, in non-configured includes.
5167 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
5168             Gary V. Vaughan  <gary@gnu.org>
5170         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
5171         Protect definitions from macro expansion under -DNDEBUG by
5172         parenthesising the expanded function names.
5173         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5174         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5175         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5176         (m4_is_syntax_macro_escaped): Similarly protect function
5177         definitions from macro expansion under -DNDEBUG by #undefing the
5178         matching macro names before each definition.  Also, move all the
5179         function definitions to the end of the file so that any
5180         invocations in the rest of the file pick up the fast macro
5181         versions.
5182         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
5183         (m4_set_debug_file, m4_set_trace_messages)
5184         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5185         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5186         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
5187         option setter functions.
5189 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
5191         * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
5192         to gnu.
5194 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
5196         * src/main.c: Include gnulib files from the correct directory.
5198         * gnulib/*: Don't store any of the gnulib files in arch, as they
5199         generate spurious changes.
5200         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
5201         gnulib macros now share our macro directory.
5202         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
5203         * bootstrap: Call gnulib-tool to import from the gnulib tree.
5204         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
5205         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
5206         the gettext macros from autopoint that overwrite the gnulib-tool
5207         imported versions.  Import sources and Makefile.am into the `gnu'
5208         directory.  Changed all callers.
5209         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
5210         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
5211         for imported modules.
5212         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
5213         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
5214         hardcoding the gnulib macros they wrap.
5216 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
5218         Latest CVS libtool can preload modules in libraries, including
5219         its own module loaders!  Tweak m4 so that it doesn't try to treat
5220         libltdl's module loaders as m4 modules when freezing and on exit:
5222         * gnulib/acm4/*.m4: Don't store these files in arch since they
5223         generate spurious changes.
5224         * bootstrap: Simplify initial libtoolize call, since CVS
5225         libtoolize is smarter these days.
5226         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
5227         build.
5228         * m4/module.h (m4__module_exit): Missing declaration.
5229         * m4/m4private.h (m4__module_next): New function declaration.
5230         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
5231         encapsulation.  Changed all callers.
5232         (m4__module_interface): New function to verify m4 loadable module
5233         interfaces.
5234         (m4__module_init): Register the interface validator.
5235         (m4__module_exit): Only close my own modules.
5236         * modules/m4.c (unistd.h): Provide missing declaration.
5237         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
5238         (m4_expand_ranges): More missing declarations.
5239         * modules/modtest.c (export_test): Ditto.
5240         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
5241         * src/main.c (main): Bump copyright year.
5242         * tests/modules.at: Fix sed syntax error.
5245 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
5247         Tweaking to enable compilation with latest CVS libtool and
5248         libltdl.  We can't just dump the library files directly into the
5249         m4 directory anymore now that libltdl is built from pieces itself:
5251         * bootstrap: Rewritten to use latest libtoolize sanely, and to
5252         set up libltdl subdirectory.
5253         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
5254         gnulib subdirectory's config.
5255         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
5256         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
5257         macros from gnulib.
5258         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
5259         configure.ac, so use AC_WITH_LTDL instead.
5260         * Makefile.am (SUBDIRS): Add libltdl.
5261         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
5262         gl_INCLUDED_REGEX.
5263         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
5264         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
5265         (libm4_la_LIBADD): Add LIBLTDL.
5266         * m4/ltdl.c, m4/ltdl.h: Removed.
5267         * m4/m4module.h: Include canonical ltdl.h.
5268         * po/*.po: Updated.
5270 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
5272         * gnulib/import: Now updates makefile fragments, and configure.ac.
5273         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
5274         * gnulib/m4/Makefile.am: include it.
5275         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
5276         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
5277         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
5278         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
5279         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
5280         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
5281         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
5282         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
5283         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5284         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5285         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5286         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
5287         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
5288         import.
5289         * gnulib/m4/getopt_int.h: New source file from latest gnulib
5290         import.
5291         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
5292         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
5293         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
5294         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
5295         Updated source files from latest gnulib.
5297 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
5299         * config/mailnotify: New file for mailing commit notifications,
5300         imported from cvs-utils.
5301         * commit: Updated from cvs-utils and tweaked for m4.
5303 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
5305         * config/mkstamp: Updated from CVS libtool.
5306         * configure.ac: Generate a gnu coding standards compliant version
5307         number, and use it for the banner.
5308         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
5309         mhen the TIMESTAMP changes in ChangeLog, but the file modification
5310         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
5311         contain the previous version number.
5312         * src/main.c: Make --version output conform to the GNU standard.
5314         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
5315         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
5316         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
5317         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
5318         time_la_SOURCES): ...so that these are defaulted correctly, and
5319         can be removed from this file.
5320         (AM_LDFLAGS): Add -module...
5321         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
5322         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
5323         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
5324         the individual settings can be removed.
5325         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
5326         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
5327         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
5328         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
5329         time_la_LIBADD): ...so that these are picked up as a deplib of
5330         libm4 and don't need to be set explicitly.
5332 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
5334         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
5335         from the standard build.  It is too fragile.
5337         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5338         CVS libtool after merging m4 changes across to libtool.
5340         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5341         * m4/path.c (search_path_add): Ditto.
5343 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5345         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5346         libtool tags we don't use in configure.  This reduces the size
5347         of the script from over 1Mb to under 700Kb.
5349 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5351         The import script was not written properly, and the last gnulib
5352         import was incomplete.  Fixed that problem, and reimport our
5353         gnulib dependencies, which picks up the address calculation
5354         overflow checks described by Paul below.  Also tweak the clients
5355         of the gnulib xalloc module not to use deprecated macros:
5357         * gnulib/import: Recurse through module dependencies rather than
5358         naively descending only one level.
5359         * configure.ac: Add calls to gnulib's strnlen and extension module
5360         macros.
5361         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5362         extension modules.
5363         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5364         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5365         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
5366         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
5367         gnulib.
5368         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
5369         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
5370         place of `xcalloc (1, S)'.
5371         * m4/m4.c (m4_create): Likewise.
5372         * m4/m4private.h (m4_symbol_value_create): Likewise.
5373         * m4/symtab.c (symtab_fetch): Likewise.
5374         * m4/syntax.c (m4_syntax_create): Likewise.
5375         * src/freeze.c (reload_frozen_state): Likewise.
5376         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
5377         macro.
5378         * m4/symtab.c (m4_symtab_create): Likewise.
5380 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5382         * tests/module.at: Comment typo.
5384 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
5386         * tests/modules.at (modules: importing): Apply some lateral
5387         thinking, and use AT_CHECK to compare the output of a sed pass
5388         over stderr against the canonical strerror string.
5390         * tests/modules.at (modules: importing): Edit the generated stderr
5391         output to canonicalize strerror output, before a comparison.
5393 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
5395         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
5396         careful not to trip over the mess:
5398         * modules/perl.c: Some builds of perl install headers that contain
5399         `#define try __builtin_try'.  Be sure to undefine that macro
5400         before `m4/hash.h' gets included, which uses the `try' symbol.
5401         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
5402         `false' before including `stdbool.h'.
5403         (DELETE):  This symbol is not in m4's namespace, and is in any
5404         case only used internally...
5405         * m4/m4private.h (DELETE): ...so move it to here.
5406         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
5408 2003-10-08  Paul Eggert  <eggert@twinsun.com>
5410         Don't use XMALLOC and XCALLOC.  Once we install the
5411         corresponding patch into gnulib, this will fix some
5412         address-calculation overflow bugs on hosts where calloc (A, B)
5413         returns garbage when A*B overflows.
5415         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
5416         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
5417         xmalloc, XCALLOC with xcalloc.
5418         * m4/m4.c (m4_create): Likewise.
5419         * m4/m4private.h (m4_symbol_value_create): Likewise.
5420         * m4/output.c (m4_output_init): Likewise.
5421         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
5422         * m4/syntax.c (remove_syntax_attribute): Likewise.
5423         * src/freeze.c (reload_frozen_state): Likewise.
5424         * src/main.c (main): Likewise.
5426 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
5428         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
5429         gnulib/acm4 directories for aclocal m4 macros.
5430         * gnulib/Makefile.am (EXTRA_DIST): Removed.
5431         (MAINTAINERCLEANFILES): Add Makefile.in.
5432         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
5433         modules we use.
5434         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
5435         * gnulib/import: New file.  Temporary script for updating gnulib
5436         imported files, until gnulib-tool is working.
5437         * gnulib/config/codeset.m4, gnulib/config/error.m4,
5438         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
5439         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
5440         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5441         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
5442         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5443         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5444         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5445         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
5446         gnulib/config/nls.m4, gnulib/config/obstack.m4,
5447         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
5448         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
5449         gnulib/config/regex.m4, gnulib/config/restrict.m4.
5450         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
5451         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
5452         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
5453         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
5454         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
5455         gnulib/config/xstrndup.m4: Removed.
5456         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
5457         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
5458         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
5459         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
5460         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
5461         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
5462         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
5463         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
5464         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
5465         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
5466         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
5467         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
5468         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
5469         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
5470         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5471         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
5472         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
5473         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5474         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5475         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
5476         gnulib/import script.
5477         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
5478         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
5479         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5480         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
5481         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
5482         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
5483         gnulib with gnulib/import script.
5484         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
5485         guards ready for gnulib-tool to autoupdate on import.
5486         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
5487         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
5488         config/stackovf.m4: Moved from here...
5489         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
5490         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
5491         acm4/stackovf.m4: ...to here, to separate aclocal macros from
5492         configure time helper scripts.
5493         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
5494         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
5495         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
5496         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
5497         gnulib xalloc.h.
5498         * src/main.c (version_etc_copyright): Only output the current
5499         year.
5500         (version_etc): Call with new variadic API.
5502 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
5504         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
5505         version-etc module from CVS gnulib.
5506         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
5507         * src/Makefile.am: Build it.
5508         * src/main.c: Use it.
5510         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
5511         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
5512         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
5513         exit.h instead.
5515 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
5516             Gary V. Vaughan  <gary@gnu.org>
5518         * bootstrap: Separate options.
5519         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
5520         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
5521         not set.
5522         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
5523         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
5524         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
5525         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
5526         $(LTLIBINTL) for gettext support on cygwin.
5527         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
5528         have $(LTLIBINTL) from the preloaded module la files.
5529         * README: Remove the warning about using --disable-nls on Windows
5530         machines.
5532 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
5534         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
5535         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
5536         is required.
5538 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
5540         * doc/STYLE: Document the gnulib header naming conventions, and
5541         #include policy.
5542         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
5543         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
5544         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
5545         respectively.
5546         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
5548         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
5549         module from CVS gnulib.
5550         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
5551         (gl_FUNC_STRTOL): In favour of the module macro.
5553 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
5555         Replace the getopt code with CVS gnulib getopt.  The source files
5556         detect whether they are in a glibc environment and preprocess away
5557         all of the code if there is a system getopt, so we can compile
5558         them into the m4 executable unconditionally:
5560         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
5561         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
5562         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
5563         macros.
5564         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
5565         version.
5566         * src/Makefile.am: Adjust.
5567         * src/main.c: Always include our shipped getopt.h.
5568         * po/POTFILES.in: Use new location of getopt.c.
5570 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
5572         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
5573         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
5574         in this directory automatically.
5575         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
5577         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
5578         isn't set yet.
5579         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
5580         inline.
5581         * modules/Makefile.am (pkglibexecdir): Set it here.
5582         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
5584         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
5585         Import regex module from CVS gnulib.
5586         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
5587         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
5588         do extra substitutions for Makefile.
5589         * configure.ac: Use it.
5590         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
5591         from regex_.h if necessary.
5592         * m4/system_.h: Include the correct version of regex.h.
5593         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
5594         version.
5595         * po/POTFILES.in: Use new location of regex.c.
5597         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
5598         realloc.c: automake distributes these files already.
5600 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
5602         Replace the xstrzdup code by importing the xstrndup module from
5603         CVS gnulib, along with its dependencies: strndup and strnlen:
5605         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
5606         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
5607         gnulib.
5608         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
5609         gnulib/config/strndup.m4: Ditto wrt strndup.
5610         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
5611         strnlen.
5612         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
5613         However, contrary to gnulib, we install xstrndup.h.
5614         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
5615         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
5616         is an artifact of the old m4 portability layer.
5617         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
5618         * m4/system_.h: Include xstrndup.h.
5619         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
5621 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
5623         Reimport the latest xalloc module from CVS gnulib, and adjust the
5624         m4 sources to take advantage of xalloc xfree.  Also create a new
5625         macro DELETE with the same semantics as the old m4 XFREE macro,
5626         and carefully tweak callers:
5628         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
5629         gnulib.
5630         * m4/utility.c (xfree): Removed.  This function is now supplied by
5631         gnulib xalloc.
5632         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
5633         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
5634         * m4/symtab.c (m4_symtab_create): Ditto.
5635         * m4/system_.h: Removed XFREE redefine.
5636         (DELETE): New macro with same functionality as the original m4
5637         XFREE macro, but based on xalloc.h now.  Changed all callers.
5638         * src/main.c (main): Use XMALLOC macro.
5639         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
5640         instead of XFREE.
5641         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
5643 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
5645         Import the xalloc module from CVS gnulib, along with its
5646         dependencies: exitfail, malloc and realloc. We had different
5647         semantics for our XFREE and a function xfree() not supplied by
5648         gnulib, so also a bit of work to keep everything running
5649         smoothly:
5651         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
5652         (gl_XALLOC): Use gnulib equivalents.
5653         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
5654         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
5655         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
5656         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
5657         realloc.
5658         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
5659         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
5660         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
5661         imported modules.
5662         (pkgincdir): Removed.  Use pkgincludedir instead.
5663         * m4/m4private.h (XFREE): xfree already checks for NULL.
5664         * m4/system_.h: Use xalloc module, and remove macros already
5665         supplied by xalloc.h.
5666         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
5667         moved the old definition from m4/xmalloc.c to here for now.
5669 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
5671         Import the error and progname modules from CVS gnulib.  Our old
5672         error.c subsumed the functionality of both, so a little adjustment
5673         was required to accomodate the split in sources.  Also added more
5674         wrapper macros to choose between a system installed error.h or our
5675         shipped gnulib error module:
5677         * m4/error.c, m4/error.h: Removed.
5678         * m4/Makefile.am: Adjust.
5679         (pkgincdir): Removed.  Use pkgincludedir instead.
5680         * m4/module.h, src/main.c: Don't include `m4/error.h'.
5681         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
5682         error.h.
5683         * gnulib/m4/progname.c: Imported from CVS gnulib.
5684         * gnulib/m4/progname.h: Ditto.
5685         * src/main.c: Adjust to use progname module.
5686         * gnulib/m4/error.c: Imported from CVS gnulib.
5687         * gnulib/m4/error_.h: Ditto.
5688         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
5689         if appropriate, and link a local error.h if the system version is
5690         missing.
5691         (libgnu_la_SOURCES) Add progname module sources.
5692         * gnulib/config/error.m4: Imported from CVS gnulib.
5693         * gnulib/config/strerror_r.m4: Ditto.
5694         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
5695         to have ERROR_H for Makefile substitutions and tell system.h
5696         whether the system error.h should be used, or a locally installed
5697         version.
5698         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
5700 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
5702         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
5703         s/gettext_.h/gettext.h/.
5705         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
5706         automake have been fixed.
5708         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
5709         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
5710         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
5711         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
5713 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
5715         The gnulib obstack module requires the gnulib gettext module for
5716         systems that do not have GNU gettext installed.  Because we use
5717         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
5718         that directory incase it clashes with the system gettext.h.  This
5719         delta uses gettext_.h and extra rules in the Makefile to make a
5720         link to gettext.h when needed:
5722         * Makefile.am (auxdir): Removed.  No longer used.
5723         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
5724         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
5725         moved.
5726         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
5727         Makefile based build.
5728         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
5729         of the macros are kept.
5730         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
5731         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
5732         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
5733         distributes these automatically.
5734         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
5735         warning from automake-1.7a.
5736         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
5737         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
5738         all callers.
5739         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
5740         wrt. m4_FUNC_OBSTACK.
5741         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
5742         wrt. m4_sys_STACKOVF.
5743         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
5744         wrt. _m4_LIB_GMP, m4_LIB_GMP.
5745         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
5746         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
5747         respectively.
5748         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
5749         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
5750         gettext.h link on deficient systems.
5751         (pkginc_HEADERS): Mention $(GETTEXT_H).
5752         (EXTRA_HEADERS): Mention gettext.h.
5753         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
5754         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
5755         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5756         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
5757         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5758         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5759         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5760         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
5761         gnulib/config/po.m4, gnulib/config/progtest.m4,
5762         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
5763         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
5765 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
5767         We can't mirror the gnulib directory structure here, since we need
5768         to be able to eg. `#include <m4/obstack.h>' from our source files,
5769         which is much easier if the local obstack.h is created in a
5770         directory named m4.  Rather than trying to symlink everything into
5771         the m4 directory, now we build a libtool convenience library from
5772         the sources we get from gnulib and link that with libm4.la:
5774         * gnulib/config/extensions.m4: Imported from CVS gnulib.
5775         * gnulib/config/unlocked-io.m4: Ditto.
5776         * gnulib/m4/unlocked-io.h: Ditto.
5777         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
5778         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
5779         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
5780         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
5781         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
5782         * m4/Makefile.am: Adjust.
5783         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
5784         macros we redistribute.
5785         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
5786         library among others.
5787         (GNULIB_SRCS, GNULIB_MACROS): Removed.
5788         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
5789         * config/m4-obstack.m4: Adjust.
5790         * po/POTFILES.in: Adjust.
5791         * configure.ac: Reformatting.  Call newly imported gnulib macros.
5792         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
5793         bogus calls of `#include "m4.h"'.
5794         * Makefile.am: INCLUDES has been deprecated in favour of
5795         AM_CPPFLAGS.
5796         * m4/Makefile.am: Ditto.
5797         * modules/Makefile.am: Ditto.
5798         * src/Makefile.am: Ditto.
5800 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
5802         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
5804 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
5806         Migrate the obstack support into the gnulib directories for easy
5807         synchronisation with upstream files in gnulib:
5809         * config/gnu-obstack.m4: Moved from here...
5810         * config/m4-obstack.m4: ...to here.
5811         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
5812         * m4/obstack.c, m4/obstack_.h: Moved from here...
5813         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
5814         * po/POTFILES.in: Adjust.
5815         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
5816         * m4/Makefile.am: Add a whole new section to link the obstack
5817         sources from the gnulib tree if necessary.
5818         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
5819         from gnulib.
5820         * config/m4-obstack.m4: Rewrite as a wrapper for
5821         gnulib/m4/obstack.m4.
5823 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
5825         GNU M4 currently builds with a number of files adapted from
5826         upstream sources.  Recently the gnulib project on savannah.gnu.org
5827         has pulled together a great many of these externally maintained
5828         files.  This delta is the beginnings of isolating those files
5829         maintained in gnulib to make it easy to synchronise M4 with the
5830         upstream files prior to releases.
5832         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
5833         directory.
5834         (SUBDIRS): Added new gnulib subdirectory.
5835         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
5836         * config/stdbool.m4: Moved from here...
5837         * gnulib/m4/stdbool.m4: ...to here.
5838         * m4/stdbool_.h: Moved from here...
5839         * gnulib/lib/stdbool_.h: ...to here.
5840         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
5841         distributed.
5842         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
5843         code to work with new stdbool_.h location.
5844         (gnulib_srcdir): New.
5846 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
5848         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
5849         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
5850         builds to work.
5851         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
5852         (EXTRA_DIST): Use it.
5854         * bootstrap: CVS autoreconf leaves file droppings.  Remove
5855         aclocal.m4t incase autoreconf doesn't.
5857 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
5859         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
5860         the other gnulib imports, renamed to m4/obstack_.h.
5861         * m4/obstack.c: Updated from CVS gnulib.
5862         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
5863         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
5864         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
5865         about vpath already, and $top_srcdir upsets CVS Automake, so the
5866         $top_srcdir reference was removed.
5868         * m4/system-h.in: For consistency with the gnulib imports, renamed
5869         to m4/system_.h.
5870         * m4/Makefile (EXTRA_HEADERS): Adjust.
5871         * configure.ac (AC_CONFIG_FILES): Adjust.
5873         * m4/stdbool_.h: New file from gnulib for systems without their
5874         own.
5875         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
5876         * config/stdbool.m4: New file.  Macros from gnulib for same.
5877         * configure.ac: Use it.
5879 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
5881         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
5882         * config/gmp.m4: Ditto.
5883         * config/gnu-obstack.m4: Ditto.
5884         * config/stackovf.m4: Ditto.
5885         * m4/builtin.c: Ditto.
5886         * m4/debug.c: Ditto.
5887         * m4/error.c: Ditto.
5888         * m4/error.h: Ditto.
5889         * m4/gnu-obstack.h: Ditto.
5890         * m4/hash.c: Ditto.
5891         * m4/hash.h: Ditto.
5892         * m4/input.c: Ditto.
5893         * m4/m4.c: Ditto.
5894         * m4/m4module.h: Ditto.
5895         * m4/m4private.h: Ditto.
5896         * m4/macro.c: Ditto.
5897         * m4/module.c: Ditto.
5898         * m4/obstack.c: Ditto.
5899         * m4/output.c: Ditto.
5900         * m4/path.c: Ditto.
5901         * m4/regex.c: Ditto.
5902         * m4/regex.h: Ditto.
5903         * m4/strtol.c: Ditto.
5904         * m4/symtab.c: Ditto.
5905         * m4/syntax.c: Ditto.
5906         * m4/utility.c: Ditto.
5907         * m4/xmalloc.c: Ditto.
5908         * m4/xstrdup.c: Ditto.
5909         * m4/xstrzdup.c: Ditto.
5910         * modules/evalparse.c: Ditto.
5911         * modules/format.c: Ditto.
5912         * modules/gnu.c: Ditto.
5913         * modules/import.c: Ditto.
5914         * modules/load.c: Ditto.
5915         * modules/m4.c: Ditto.
5916         * modules/m4.h: Ditto.
5917         * modules/modtest.c: Ditto.
5918         * modules/mpeval.c: Ditto.
5919         * modules/perl.c: Ditto.
5920         * modules/shadow.c: Ditto.
5921         * modules/stdlib.c: Ditto.
5922         * modules/time.c: Ditto.
5923         * modules/traditional.c: Ditto.
5924         * src/freeze.c: Ditto.
5925         * src/getopt.c: Ditto.
5926         * src/getopt1.c: Ditto.
5927         * src/m4.h: Ditto.
5928         * src/main.c: Ditto.
5929         * src/stackovf.c: Ditto.
5931         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
5932         ac_default_headers is an autoconf internal variable.
5933         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
5934         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
5936         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
5937         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
5938         delta.
5940 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
5942         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
5943         C99 bool.
5944         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
5945         possible or faking one with a typedef.  Changed all callers.
5947 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
5949         Still cleaning up the users' module API, by taking out the stuff
5950         that isn't used by any existing modules, and moving specialised
5951         functions out of libm4 and into the module they are used by.
5953         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
5954         * m4/utility.c (m4_skip_space): ...to here the home of its only
5955         use, made static and renamed to `skip_space'.  Changed all
5956         callers.
5957         * m4/m4module.h (m4_expand_ranges): Removed prototype.
5958         * m4/utility.c (m4_expand_ranges): Moved definition from here...
5959         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
5960         ltdl.
5961         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
5962         casting .
5963         * modules/gnu.c (builtin_syntax): Import and use in this
5964         builtin implementation.
5965         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
5966         Not used.  Deleted.
5967         * m4/macro.c (trace_flush): Except here where the macro is now
5968         manually inlined.
5969         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
5970         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
5971         moved...
5972         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
5973         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
5975 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
5977         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
5978         compiler based AC_CHECK_HEADER that was introduced in
5979         autoconf-2.56.
5980         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
5981         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
5982         * configure.ac: Use renamed M4_AC_LIB_GMP.
5984         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
5985         macro that requires arguments! This stops the shell's bad
5986         substitution error at configure time.
5988         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
5989         variables to the testsuite shell.  Set the value of USE_GMP so
5990         that the gmp test will run!
5991         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
5993 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
5995         Libltdl already has an excellent mechanism for accessing C symbols
5996         in modules.  Lets use that!  Remove all the exporting cruft and
5997         just use lt_dlsym in conjunction with a few conventions to
5998         simplify module writers' jobs.  Also removed the table address
5999         caching code and otherwise simplified the module loader quite a
6000         bit.  To access exported symbols in other modules, first the
6001         exporting module must name the symbols <modname>_LTX_<symname>,
6002         and the importing module must define a function type called
6003         <symname>_func.  The importer then adds
6004         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6005         that wishes to call out to the exported functions.  Care must be
6006         taken that <symname> is non-NULL in the importing module incase
6007         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6008         definition was in the importers source.  Study
6009         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
6010         m4_module_import will attempt to automatically load a module
6011         required for symbol access if it is not loaded already.
6013         * TODO: Removed the items fixed in this delta.
6014         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6015         module name.
6016         * m4/ltdl.h (lt_dlhandle_find): Declare it.
6017         * m4/module.c (m4_module_unload): Use it.
6018         * src/freeze.c (reload_frozen_state): Ditto.
6019         * m4/m4module.h (m4_export): Deleted.  Removed all references.
6020         (M4_MODULE_IMPORT): New user convenience macro for importing
6021         arbitrary symbols from other modules.
6022         * m4/module.c (m4_module_import): New function to service
6023         M4_MODULE_IMPORT macro.
6024         (module_data): Removed.  Looking up the tables on demand with
6025         lt_dlsym, rather than caching their addresses here simplifies the
6026         code substantially.
6027         (m4_get_module_builtin_table, m4_get_module_macro_table):
6028         Removed.  Changed all callers.
6029         (set_module_macro_table, set_module_builtin_table): Renamed to
6030         install_macro_table and install_builtin_table respectively, and
6031         simplified now that the cache is no more.
6032         * modules/gnu.c (builtin_symbols): Use this new mechanism to
6033         import m4_dump_symbols from the m4 module.
6034         (builtin_esyscmd): Likewise for m4_set_sysval and
6035         m4_sysval_flush.
6036         * modules/m4.c (m4_export_table): Removed.  Functions are
6037         addressed with the new mechanism which doesn't need this.
6038         (m4_set_sysval): New exported accessor function to prevent
6039         problems with variable access on inferior architectures.
6040         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6041         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6042         that we can have some type safety.
6043         * modules/modtest.c (export_test): C level exported function for
6044         testing the new import mechanism.
6045         * modules/import.c: New file for the import end of the test.
6046         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
6047         * tests/modules.at: New test cases for intermodule symbol
6048         importing.
6050 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
6052         * m4/m4module.c (m4_string): Moved from here...
6053         * m4/m4private.c (m4_string): ...to here.
6055         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
6057 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
6059         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
6060         already available to module writers through
6061         m4_{get,set}_nesting_limit_opt(), so moved from here...
6062         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
6063         (m4_create): Use it.
6065 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
6067         Aside from auditing path.c for m4module.h api obfuscation, this
6068         delta introduces the concept of private struct members in opaque
6069         data types to GNU m4: See the STYLE file for details.
6071         * TODO: Remind ourselves that a rewrite of path.c is needed.
6072         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
6073         Moved from here...
6074         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
6075         here and renamed.  These type definitions are for internal api use
6076         only.  Changed all callers.
6077         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
6078         Moved from here...
6079         * m4/path.c (search_path_env_init, search_path_add): ...to here
6080         and renamed.  These calls were never used outside this file.
6081         Changed all callers.
6082         (dirpath): Moved functionality of this static declaration...
6083         * m4/m4private.h (struct m4): ...to this new internal only
6084         search_path field.  Changed all callers.
6085         (m4__get_search_path): Added new internal api accessor.
6086         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
6087         (m4_include_init): Removed...
6088         * m4/m4.c (m4_create): ...because the new m4 field is now
6089         initialised here.
6090         (m4_delete): Recycle search_path memory.
6091         * src/main.c (main): Don't call m4_include_init now that it's
6092         gone!
6093         * doc/STYLE: Document convention for private fields in opaque
6094         ADTs.
6096 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6098         Sometimes exporting the address of a symbol from a module isn't
6099         enough for other modules to call that symbol correctly.  If
6100         custom data types are used for function parameters, they need to
6101         be known to the caller.  This change introduces the concept of
6102         $(prefix)/include/modules/$(modulename).h to declare those
6103         structures.  Also we move m4_dump_symbols from libm4 to the m4
6104         module to show this concept in action.
6106         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
6107         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
6108         exporting data structures from modules/m4.c.
6109         * modules/m4.c, modules/gnu.c: Include it.
6110         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
6111         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
6112         prototypes.
6113         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
6114         Moved from here...
6115         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
6116         ...to here, with slight renaming.
6117         (m4_export_table): Prototype and add m4_dump_symbols.
6118         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
6119         definition of m4_dump_symbols.
6120         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
6121         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
6123 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6125         Create an export table in modules/m4.c in readiness for beefing up
6126         the module loader to track module exports and imports.
6128         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
6129         * m4/debug.c (m4_debug_flush_files): Moved...
6130         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
6131         * modules/gnu.c (builtin_esysval): Use it.
6132         * m4/m4module.h (m4_export): New type for declaring module symbols
6133         for export.
6134         * modules/m4.c (m4_export_table): List symbols exported from this
6135         module for use by other modules.
6137 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6139         An experiment: There is loads of code in libm4 which should be in
6140         the m4 module, but is also used by another module. Just because
6141         some linkers won't cope with calls across dynamic runtime loaded
6142         objects I initially left the code in libm4.  It will tidy the
6143         module api immensely if this code moves to the right place, I just
6144         need to remember to invent a suitable calling mechanism at some
6145         point.  For now, only modules that are statically linked and
6146         preloaded will get this treatment, so the only platforms that will
6147         break are those that require all symbols to be resolved at link
6148         time.
6150         * TODO: Reminder that what I am doing could reduce portability
6151         unless I do something more robust later.
6152         * m4/m4module.h (m4_sysval): No longer exported from libm4.
6153         * m4/utility.c (m4_sysval): No longer declared in libm4.
6154         * modules/Makefile.am: Reformatting.
6155         * modules/m4.c (m4_sysval): Declare it at place of use.
6156         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
6158 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
6160         * m4/m4module.h: Reformatting and rearranging lines a bit.
6161         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
6162         all users.
6163         (m4_call_macro, m4_expand_input): Renamed...
6164         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
6165         callers.
6166         (m4_expansion_level, m4_process_macro): Moved...
6167         * m4/macro.c (expansion_level, process_macro): ...to here, and
6168         made static.
6170         * m4/m4module.h (program_name): Not used by modules at all, so
6171         moved...
6172         * src/main.c (program_name): ...to here.
6173         (print_program_name): Renamed...
6174         (print_program_name_CB): ...to conform to the STYLE guide.
6176 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
6178         More refactoring of the m4module.h API.  Replace #defines with an
6179         enum, and move non-public functions out of the public API.
6181         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
6182         inclusion.
6183         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
6184         * m4/debug.c (m4_debug, trace): Moved...
6185         * m4/m4private.h (struct m4): ...to fields of this struct.
6186         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
6187         for the new fields.
6188         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
6189         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
6190         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
6191         * m4/m4module.h (m4_context_field_table): Add entries for new
6192         debug_file and trace_messages fields.
6193         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
6194         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
6195         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
6196         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
6197         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
6198         (m4_is_debug_bit): New macro to simplfy checks against the debug
6199         bits above.
6200         (m4_trace_format, m4_trace_header, m4_trace_flush)
6201         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
6202         prototypes.
6203         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
6204         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
6205         * m4/macro.c (trace_format, trace_header, trace_flush)
6206         (trace_prepre, trace_pre, trace_post): ...to these newly static
6207         functions, since they are only ever used from this file.  Changed
6208         all callers.
6210 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
6212         Change the macros for checking syntax so that matching against
6213         multiple possible syntax classes can be done with a single
6214         comparison some of the time.  The various classes are now bits of
6215         an int that can be checked with bitwise logic operators.
6217         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
6218         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
6219         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
6220         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
6221         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
6222         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
6223         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
6224         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
6225         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
6226         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
6227         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
6228         Replace all calls with invocations of these...
6229         (m4_is_syntax, m4_has_syntax): ...New macros.
6230         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
6231         is no longer required with new macros.  Changed all callers.
6233 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
6235         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
6236         values are returned as part of the internal interface, so they
6237         need to be moved...
6238         * m4/private.h: ...to here.
6239         * m4/macro.c (expand_token): Check for out of range
6240         m4_peek_input() results before looking up in the syntax table.
6241         (collect_arguments): Ditto.
6243         * NEWS: Note `$' syntax class.
6245 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
6246             Gary V. Vaughan  <gary@gnu.org>
6248         Conform to POSIX if the POSIXLY_CORRECT environment is set.
6249         --traditional `define' now smashes all the definitions.
6251         * NEWS: Explain this.
6252         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
6253         (Extensions): Explain that extensions that are incompatible with
6254         POSIX are disabled if POSIXLY_CORRECT is set.
6255         (Incompatibilities): Remove.
6256         (Define, Other Incompat): Explain difference
6257         between GNU and POSIX behavior of define, pushdef, popdef.
6258         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
6259         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
6260         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
6261         (m4_get_posixly_correct_opt): New macro.
6262         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
6263         POSIXLY_CORRECT.
6264         * modules/m4.c (builtin_functions): defn now takes any number of args.
6265         (builtin_define): Smash all the definitions if
6266         POSIXLY_CORRECT.
6267         (builtin_defn)): Allow any number of arguments.
6268         (builtin_undivert): Do not allow nonnumeric arguments
6269         if POSIXLY_CORRECT.
6270         * src/main.c (main): Set posixly-correct behavior if either
6271         POSIXLY_CORRECT is set, or if -G is given.
6272         * tests/builtins.at: New test for smashed definitions.
6274 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
6276         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
6277         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
6278         not to slow the parser down.
6279         (M4__IS_STRING): New macro to test string syntax class membership.
6280         * m4/syntax.c: Adjust docucomment.
6281         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
6282         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
6283         * m4/input.c (init_builtin_token): Comment typo.
6284         (m4__next_token): Comment typo.
6285         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
6286         by using the new M4__IS_STRING macro.
6287         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
6288         variable references in macro expansions.
6290         * doc/m4.texinfo (Eregexp and Regexp): Typo.
6291         (Epatsubst and Patsubst): Typo.
6292         (Eval): Typo.
6294 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
6296         Move the global variables that pertain to syntax to a new `struct
6297         m4_syntax_table', and then add one of these to `struct m4'.  The
6298         ripple effect through the code to both change formerly global
6299         references, and make sure a suitable context is available in
6300         lexical scope is disproportionately large compared to the size of
6301         the change proper.  This change is a large part of decoupling
6302         syntax.c from the rest of the code that uses it.
6304         * m4/m4private.h (struct m4): Add a syntax field.
6305         * m4/m4.c (m4_create): Initialise it,
6306         (m4_delete): Recycle it.
6307         (m4_get_symtab): Remove hand coded version...
6308         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
6309         callers.
6310         * m4/m4module.h (m4_context_field_table): Add an extra field so we
6311         can generate m4_get_symbol_table.  Add a new row for
6312         m4_get_syntax_table.
6313         (M4SYNTAX): Syntactic sugar for module writers.
6314         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
6315         (m4_syntax_table): New home for syntax related formerly global
6316         variables.
6317         * m4/m4private.h (struct m4_syntax_table): Define it.
6318         * m4/input.c (m4_input_init): Initialisation of these formerly
6319         global variables moved...
6320         * m4/syntax.c (m4_syntax_create): ...to here.
6321         * m4/input.c (m4_input_exit): And similarly, recycling of the
6322         memory used by those values moved...
6323         * m4/syntax.c (m4_syntax_delete): ...to here.
6324         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
6325         Moved to m4/m4private.h.
6326         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6327         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6328         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6329         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
6330         objects.  Changed all callers that used to directly access the
6331         global equivalents.
6332         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
6333         Removed and incorporated into m4_syntax_table structure.
6334         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
6335         * m4/syntax.c (m4_set_syntax): Now returns an error status,
6336         instead of requiring a `struct m4' to generate its own errors.
6337         Changed all callers.
6338         * src/main.c (main): Now that the syntax table is initialised as
6339         part of m4_create, we have to manually wipe the syntax entries if
6340         we are about to read a frozen file.
6342 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
6344         * doc/STYLE: Added notes on callback naming schemes.
6346         * m4/module.c (m4_set_module_macro_table)
6347         (m4_set_module_builtin_table): Declarations weren't changed when
6348         definitions were renamed on 2003-06-19.
6350         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
6351         neither used nor particularly appropriate since it exposes the
6352         internal workings of the hash module.  I haven't yet decided
6353         whether to remove it entirely.
6355 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
6357         Two related changes, and a huge knockon effect throughout the
6358         source: Moved the option variables out of global space and into
6359         `struct m4'; made `m4_symtab' a real datatype, so that its api
6360         is not marred passing `struct m4' around just so it can decide
6361         whether to keep traced symbol names or not.  Added setters and
6362         getters for the formerly global option variables, and obviously
6363         changed a vast number of functions to take a `struct m4' and use
6364         the getter funcs to find option values.
6366         * m4/utility.c (interactive, sync_output, debug_level)
6367         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
6368         (max_debug_argument_length, warning_status, nesting_limit)
6369         (discard_comments): Removed.
6370         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
6371         (debug_level, max_debug_argument_length, prefix_all_builtins)
6372         (suppress_warnings, discard_comments, interactive, sync_output):
6373         Removed from here...
6374         * m4/m4private.h (struct m4): ...and equivalent fields added to
6375         this structure.
6376         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6377         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6378         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6379         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6380         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
6381         macros for the new fields.
6382         * m4/m4module.h (m4_context_field_table)
6383         (m4_context_opt_bit_table): Helper macros used to generate
6384         prototypes, setters and getters for new option fields
6385         consistently.
6386         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6387         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6388         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6389         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6390         (m4_get_interactive_opt, m4_get_sync_output_opt)
6391         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6392         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6393         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
6394         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
6395         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
6396         setter and getter functions generated by cpp from
6397         m4_context_field_table and m4_context_opt_bit_table, exported as
6398         part of the module api.  Changed all callers.
6399         * m4/symtab (struct m4_symtab): Used as the concrete type for
6400         m4_symtab now.
6401         (m4_symtab_create): Allocate and initialise a new struct.
6402         (m4_symtab_apply): New function that works like m4_hash_apply, but
6403         with different callbacks specific to symbol tables.  Changed all
6404         callers.
6405         (symbol_destroy, arg_destroy, arg_copy): Renamed
6406         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
6407         they have unused parameters for a reason!
6408         (dump_symbol_CB): New callback to dump the contents of a single
6409         symbol.
6410         (symtob_dump): Rewritten in terms of dump_symbol_CB.
6411         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
6412         Changed all callers.
6413         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
6414         of the contained `m4_symtab' at the `no_gnu_extensions' field.
6415         Although I'm not convinced these semantics are correct, they are
6416         at least consistent with how things were before this delta.  Also
6417         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
6419 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
6421         Tie down the interface to libm4 some more.  Make more structures
6422         opaque to modules by moving them to m4private.h, and writing
6423         setters and getters.  To win back the speed penalty for doing this
6424         also wrote macroized versions that do know about structure layout
6425         in m4private.h and #include that file into modules when NDEBUG is
6426         defined at compile time.  There are still some accessor macros in
6427         m4private.h that need to go, but that is not necessary to clean
6428         the module api up.
6430         * m4/m4module.h (m4_symbol_type): Moved...
6431         * m4/m4private.h (m4__symbol_type): ...to here.
6432         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
6433         (m4_set_symbol_traced, m4_set_symbol_name_traced)
6434         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6435         (m4_get_symbol_func, m4_symbol_value_create)
6436         (m4_symbol_value_delete, m4_set_symbol_value_text)
6437         (m4_set_symbol_value_func): New exported api to symbols.
6438         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
6439         and m4_is_symbol_value_func.
6440         * m4/m4module.h: Prototype these guys.
6441         * m4/module.c (m4_set_module_macro_table)
6442         (m4_set_module_builtin_table): Make these static, there is no
6443         reason to pollute the api with them.
6444         * m4/m4private.h: Reformatting.
6445         (m4_get_symtab): Only define when NDEBUG is defined.
6446         (m4_get_symbol_value, m4_get_symbol_traced)
6447         (m4_set_symbol_traced, m4_set_symbol_name_traced)
6448         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6449         (m4_get_symbol_func, m4_symbol_value_create)
6450         (m4_symbol_value_delete, m4_set_symbol_value_text)
6451         (m4_set_symbol_value_func): Macro implementations of the new
6452         functions when NDEBUG is defined.
6453         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
6454         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
6455         Superceded by the above.  All callers changed.
6456         (M4ARG): Removed.  This is no longer different to the
6457         m4/m4module.h definition.
6458         * modules/gnu.c, modules/m4.c: Only include m4private.h when
6459         NDEBUG is defined.  That way we exercise the same (albeit slower)
6460         api that external modules must use.
6462 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
6464         Renamed some of the types and their accessors to make more sense.
6465         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
6466         has a stack of SYMBOL_VALUEs.
6468         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
6469         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
6470         m4_get_symbol_value_type,  m4_get_symbol_value_text,
6471         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
6472         Changed all callers.
6473         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
6474         (m4_get_token_type): Renamed
6475         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
6476         to the internal api.
6477         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
6478         s/TOKEN_/VALUE_/
6479         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
6480         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
6481         (m4__token_type): Moved here from m4module.h.
6482         (m4__next_token): Renamed from m4_next_token.
6483         * m4/symtab.c: Removed some of the parameterised macro support
6484         functions for modularisation later.
6485         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
6486         m4_hash_dup to perform a true deep copy of the SRC.
6487         (arg_copy): Callback for m4_symbol_value_copy.
6488         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
6489         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
6490         m4_get_symbol_value_func.  Changed all callers.
6492 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
6494         Tidy up style of hash.[ch] in accordance with doc/STYLE.
6496         * m4/hash.c: Internal symbol renaming and formatting.
6497         (m4_hash_dup): New function to facilitate deep copies of hash
6498         tables.
6499         (m4_hash_apply_func): Returns a void* now, which is a richer type
6500         for returning exceptions (NULL means keep going).
6501         (m4_hash_apply): Ditto.
6502         * m4/hash.h: Declare exported symbols with an explicit extern.
6503         Reformated.
6505 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
6507         Still refactoring furiously.  This delta represents a change in
6508         semantics to symtab.c.  Instead of building temporary m4_tokens
6509         in the caller, and copying fields in the methods, we now create
6510         the actual m4_token for hashing in the caller so the methods just
6511         slot them in directly.  Also, this means that we don't lookup a
6512         symbol and get back an allocated but VOID token to copy fields
6513         into, we create the token we want to push and pass that to
6514         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
6515         a few other small changes to stop knowledge of the implementation
6516         of symtab.c leaking out into other files.
6518         * m4/macro.c (expand_argument): Comment typo corrected.
6519         * m4/symtab.c (symtab_fetch): New function to fetch the address of
6520         an interned symbol.
6521         (m4_symbol_pushdef): Take an extra value parameter and use this
6522         directly as the new top of the value stack.  All callers changed
6523         to build a token and pass responsibility for memory in, rather
6524         than copying as we used to.
6525         (m4_symbol_define): Also use the new value parameter directly as a
6526         replacement for the top of the value stack.  All callers changed
6527         to build a token as above.
6528         (m4_set_symbol_traced): New function to set the traced bit on the
6529         named symbol, creating it if necessary.
6530         (symbol_popval): The guts of the old m4_symbol_popdef.
6531         (m4_symbol_popdef): Use it.
6532         * m4/builtin.c (m4_symbol_set_token): Removed,
6533         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
6534         replaced...
6535         * m4/module.c (m4_set_module_builtin_table)
6536         (m4_set_module_macro_table): ...with these more orthogonal
6537         functions.
6538         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
6539         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
6540         required.
6541         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
6542         (m4_arg_signature_parse): Moved...
6543         * m4/symtab.c: ...to here.
6544         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
6545         screw something up. Moved...
6546         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
6547         actually does a proper deep copy of source to dest.
6549 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
6551         Further refactoring to stabilise the module API.  Renaming some
6552         functions for orthogonality, and judicious definition migration to
6553         move things out of the set of exported symbols.
6555         * doc/STYLE: New file.  Notes on coding style.
6556         * m4/m4module.c: Updated bitrotted docucomment at the top of the
6557         file.
6558         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
6559         m4_get_module_name, m4_get_module_builtin_table,
6560         m4_get_module_macro_table which are verb phrases.  Changed all
6561         callers.
6562         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
6563         Moved to...
6564         * m4/module.c (m4_set_module_builtin_table)
6565         (m4_set_module_macro_table): ...here, and renamed. Changed all
6566         callers.
6567         * m4/m4module.c (m4_module_data): This...
6568         * m4/m4private.c (struct m4_module_data): ...and this...
6569         * m4/module.c (module_data) ...consolidated here and no longer
6570         exported.  Changed all callers.
6572 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
6574         Begin work on lifting the curse of the global variables.  To start
6575         with create a `struct m4' context container, and replace
6576         `m4__symtab' with `context->symtab' throughout.  This means
6577         initialising a context container in main, and adjusting many
6578         functions between main and the module entry points so that the
6579         container gets passed through.  It would have been nice to
6580         defer this until after 1.5, but it has a major effect on the
6581         user's module writing ABI, so it needs to be addressed now - at
6582         least in the areas that impact the ABI.  An interrelated change
6583         in the symtab API removes the dependency on a global symbol table,
6584         and instead focuses on a passed table (from the context
6585         container).
6587         * TODO: Reminders for finishing context functionality.
6588         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
6589         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
6590         global variables and eventually allow m4 to be reentrant.
6591         * m4/m4private.h (m4): Define the new structure here...
6592         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
6593         don't carry the overhead of a function call.
6594         * m4/m4module.h: Prototype extern functions from m4/m4.c.
6595         (m4): Declare type for new struct m4 objects.
6596         (M4SYMTAB): User macro to ease finding the symbol table for the
6597         current context for module developers.
6598         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
6599         verb.
6600         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
6601         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
6602         (m4_call_macro, m4_dump_symbols, m4_expand_input)
6603         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
6604         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
6605         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
6606         m4* context parameter. Changed definitions and all callers.
6607         (m4_symtab): Alias for m4_hash to decouple the
6608         m4_symtab api from m4_hash.
6609         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
6610         m4_hash.
6611         (m4_symtab_create): New function to return an initialised
6612         m4_symtab.
6613         (m4_symtab_delete): New function to delete an m4_symtab's memory.
6614         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
6615         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
6616         instead of simply using the global m4__symtab.  Changed
6617         definitions and all callers.
6618         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
6619         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
6620         * src/main.c (main): Create a context and use that instead of the
6621         former global m4__symtab.
6623 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
6625         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
6626         to the callback.  Callbacks should not need to hardcode the
6627         hashtable they are working from, nor should we have to waste the
6628         userdata parameter to pass the table in.
6629         * m4/hash.h (m4_hash_apply_func): Require the initial table
6630         parameter.
6631         * m4/symtab.c (symtab_destroy): Use the passed table instead
6632         of hardcoding m4__symtab.
6633         (m4_symbol_popdef): Don't use the userdata parameter to pass the
6634         table to arg_destroy.
6635         (arg_destroy): Use the hash parameter, ignore userdata.
6636         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
6637         prototype.
6638         (traceon, traceoff): Call set_trace with the extra initial
6639         parameter.
6641 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
6643         More refactoring to stabilise the module api, this time for
6644         symtab.c.  Additionally, start to pay attention to function names
6645         that don't contain a verb like they should.
6647         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
6648         wrapper for m4_hash_apply to decouple the symtab module from the
6649         hash module.
6650         (m4_symbol_builtin, m4_symbol_macro): Renamed to
6651         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
6652         callers.
6653         (m4_symbol_delete): Create a macro version to save a function
6654         call.
6655         (m4_token_t, m4_data_t): These violate the POSIX reserved
6656         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
6657         all callers.
6658         (m4_token_type): Renamed to m4_token_get_type.
6659         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
6660         (m4_symtab_exit): Removed from the exported module
6661         api...
6662         * m4/m4private.h (m4__symtab, m4__symtab_init)
6663         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
6664         renamed and added to the internal api. Changed all callers.
6665         (m4_symtab_apply): A faster macro version of the function for
6666         users of the internal api.
6667         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
6668         symbol_destroy and arg_destroy.
6669         (symtab_debug): Added a prototype.
6670         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
6671         so that callers in this file get the faster macro versions from
6672         m4/m4private.h.
6674 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
6676         Refactoring modules to rationalise the API into an external
6677         documented (eventually!) API for use by modules in the `m4_'
6678         namespace declared in m4/m4module.h, an internal API between the
6679         source files we ship (including our shipped modules) in the `m4__'
6680         namespace declared in m4/m4private.h and making the rest as
6681         cohesive as possible with liberal use of the `static' keyword.
6682         This change represents an audit to m4/module.c along these
6683         guidelines.
6685         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
6686         Removed.  No longer used.
6687         (m4_module_close): Removed prototypes.
6688         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
6689         from the exported module api...
6690         * m4/m4private.h (m4__module_init, m4__module_open)
6691         (m4__module_exit): ...and renamed and added to the internal api.
6692         Changed all callers.
6693         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
6694         Centralised definitions after renaming...
6695         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
6696         (M4_FINISH_SYMBOL): ...and removing from here.
6697         (m4_module_dlerror, m4_module_remove, m4_module_close)
6698         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
6699         module_remove, module_close and caller_id.
6700         (MODULE_SELF_NAME): New macro to make reporting self errors
6701         easier.
6702         (m4_module_load, module_close, module_remove): Use it.
6703         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
6704         name.
6705         * src/main.c (main): Use it.
6707 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
6709         * README: Remove references to --enable-changeword, which has been
6710         removed from the code.
6712 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
6714         Getting rid of the annoying bug with configure --enable-debug,
6715         which spewed -e: command not found errors.  This was an interaction
6716         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
6717         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
6718         branch-1-5) to get the full fix.
6720         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
6721         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
6722         and then use the probed value of $SED.
6723         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
6724         this, it messes up the AC_REQUIRE stack.
6726 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
6728         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
6729         the destroy callback.
6730         (m4_arg_destroy): Use the hash address to free the hash node key
6731         field.
6733 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
6735         First cut at formal parameters in macros.
6737         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
6738         * m4/xstrzdup.c: New file.
6739         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
6740         associative array of parameter names to details.
6741         (m4_symbol_token): Capture macro names with parameter lists.
6742         (m4_arg_signature_parse): And build an associative array to hang
6743         from the symbol structure to map names to details.
6744         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
6745         m4_hash_resize idiom.  Now that we potentially add a little hash
6746         table to many of the entries in the symbol table, added an extra
6747         arg to set the initial size.  Changed all callers.
6748         (m4_hash_apply): New function that is basically a generalised
6749         version of...
6750         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
6751         all callers to call m4_hash_apply instead.
6752         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
6753         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
6754         m4_arg_signature association that might be attached to the symbol,
6755         * m4/hash.h (m4_hash_apply_func): Replacement type for...
6756         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
6757         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
6758         parameter lists.
6759         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
6760         (M4_IS_IDENT): Detect characters that can be safely used in
6761         parameter names.
6762         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
6763         * m4/macro.c: Corrected grammar in some comments.  Use `token'
6764         rather than `td' for m4_token variables.
6765         (m4_process_macro): If we find a dollar followed by some
6766         M4_IS_IDENT characters, replace that with the contents of the argv
6767         entry with offset stored in the m4_token_arg associated with the
6768         collected identifier.
6770 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
6772         Begin preparations for supporting formal parameters in m4 macros.
6774         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
6775         the details of a formal parameter.
6776         (m4_token): Add an arg_signature member to hold a hash table for
6777         looking up formal parameters.
6778         * m4/input.c: Update more bitrotted comments.
6779         (m4_push_builtin): Initialise arg_signature member.
6780         (init_builtin_token): Copy arg_signature member.
6781         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
6782         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
6783         replace...
6784         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
6785         (m4_macro_pushdef, m4_macro_define): ...these, And...
6786         (m4_symbol_token): ...wrapped around this new function, which
6787         vastly simplifies the arguments required by the functions it
6788         replaces.
6789         Changed all callers.
6791 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
6793         * m4/macro.c: Format changes.
6795 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
6797         * m4/input.c: Updated various bitrotted comments.
6798         (m4_push_builtin): Just pass the whole m4_token, rather than
6799         extracting all the fields in the caller.  This also allows us to
6800         check the token type for consistency.
6801         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
6802         Renamed to builtin_funcs, builtin_peek, builtin_read,
6803         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
6804         the code.  Changed all callers.
6805         (struct input_block): Similarly renamed u_m member to u_b, and
6806         changed all callers.
6807         (m4_next_token): Use bzero to initialise the data fields.
6808         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
6810 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
6812         These changes were necessary to get m4 to build on my iBook
6813         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
6814         (GCC) 3.1 20020420 (prerelease)":
6816         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
6817         inclusion of module loader headers.
6818         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
6819         * m4/Makefile.am: Ditto.
6820         (libm4_la_LIBADD): Added $(LTLIBINTL).
6821         * m4/utility.c (program_name): Removed declaration in favour of
6822         the one already in error.c!
6823         * m4/m4module.h (program_name): Define to program_invocation_name
6824         when using GNU C library. Use an explicit extern declaration.
6825         (interactive, sync_output, debug_level, hash_table_size)
6826         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
6827         (suppress_warnings, warning_status, nesting_limit, discard_comments)
6828         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
6829         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
6830         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
6831         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
6832         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
6833         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
6834         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
6835         (m4_current_line, m4_current_diversion, m4_output_current_line):
6836         Don't rely on default, use an explicit extern.
6837         * m4/error.h (error, error_at_line, error_print_progname)
6838         (error_message_count, error_one_per_line): Ditto.
6839         * m4/ltdl.c: Update from CVS libtool.
6840         * m4/ltdl.h: Ditto.
6841         * commit: Update from CVS cvs-utils.
6843 2002-11-04  gettextize  <bug-gnu-gettext@gnu.org>
6845         * po/Makefile.in.in: Upgrade to gettext-0.11.5.
6846         * po/boldquot.sed: New file, from gettext-0.11.5.
6847         * po/en@boldquot.header: New file, from gettext-0.11.5.
6848         * po/en@quot.header: New file, from gettext-0.11.5.
6849         * po/insert-header.sin: New file, from gettext-0.11.5.
6850         * po/quot.sed: New file, from gettext-0.11.5.
6851         * po/remove-potcdate.sin: New file, from gettext-0.11.5.
6852         * po/Rules-quot: New file, from gettext-0.11.5.
6854 2002-11-04  Akim Demaille  <akim@epita.fr>
6856         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
6857         running m4 itself.
6858         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
6860 2002-11-04  Akim Demaille  <akim@epita.fr>
6862         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
6864 2002-11-04  Akim Demaille  <akim@epita.fr>
6866         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
6867         used as `external', and Libtool 1.4.3.
6868         (LINGUAS): Remove.
6869         (LTLIBOBJS): Don't play with it.
6870         * intl/: Remove.
6871         * Makefile.am (SUBDIRS): Remove intl.
6872         (ACLOCAL_AMFLAGS): Add -I config.
6873         (EXTRA_DIST): Add config/config.rpath.
6874         * po/LINGUAS: New.
6875         * po/Makevars: New.
6876         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
6878 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
6880         Preparations for refactoring syntax tables to allow reverse
6881         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
6882         speed of normal lookups in an array of unsigned short.
6884         * m4/input.c (single_quotes, single_comments, use_macro_escape):
6885         Moved from here...
6886         * m4/m4private.h (m4__single_quotes, m4__single_comments,
6887         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
6888         is for internal symbols which unavoidably pollute the global
6889         namespace, but are not published APIs.
6890         Adjusted all callers.
6891         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
6892         m4_set_comment, m4_set_syntax, set_syntax_internal,
6893         unset_syntax_attribute): Moved from this file...
6894         * m4/syntax.c: New. ...to this file.
6895         Also added an m4_syntax_exit stub for orthogonality.
6896         * src/main.c (main): Use it.
6897         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
6898         * m4/m4module.h: Reformatting.  New prototypes.
6900 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
6902         * bootstrap (aclocal_apiversion): The aclocal apiversion is
6903         distinct from the automake release number (in that the apiversion
6904         apparently has no micro-version-component).
6905         (aclocal_apilibdir): Use it.
6907 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
6909         * m4/hash.c (m4_hash_resize): New function.
6910         * m4/hash.h: Add prototype.
6911         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
6912         benchmarking to find a good value for, say, autoconf.  This is
6913         already a little quicker than before for me.
6915         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
6916         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
6917         and reenamed.
6918         * m4/hash.h: Adjust prototypes.
6920 2002-01-22  Akim Demaille  <akim@epita.fr>
6922         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
6923         APIVERSION scheme.
6924         * tests/Makefile.am (package.m4): New.
6925         * tests/atlocal.in: Adjust to CVS Autotest.
6926         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
6927         * configure.ac: LIBOBJ is a forbidden string.
6928         Simplify AM_INIT_AUTOMAKE invocation.
6929         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
6930         options.m4.
6932 2002-01-21  gettextize  <bug-gnu-utils@gnu.org>
6934         * po/Makefile.in.in: Upgrade to gettext-0.10.40.
6936 2001-10-19  Akim Demaille  <akim@epita.fr>
6938         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
6940 2001-10-19  Akim Demaille  <akim@epita.fr>
6942         * m4/input.c (m4_next_token): Display where was opened what is
6943         not closed.
6945 2001-10-19  Akim Demaille  <akim@epita.fr>
6947         * m4/macro.c (expand_argument): Display where was opened what is
6948         not closed.
6950 2001-10-18  Akim Demaille  <akim@epita.fr>
6952         * m4/input.c, modules/m4.c: Formatting changes.
6954 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
6956         * bootstrap: s/configure.in/configure.ac/
6958 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
6960         * m4/symtab.c (m4_symbol_destroy): This function calls
6961         m4_symbol_popdef, which recycles a symbols memory when the last
6962         definition is popped.  Since we were passing the address of the
6963         symbol name found in the symbol table, and it was being removed
6964         partway through m4_symbol_destroy() we were referencing freed
6965         memory for the balance of the function.  Now we take a copy of the
6966         symbol name tring and use that as a key into the symbol
6967         table... that way if the original symbol name is freed, the copy
6968         is still valid.
6970 2001-10-13  Akim Demaille  <akim@epita.fr>
6972         * m4/ltdl.c: Update.
6974 2001-10-13  Akim Demaille  <akim@epita.fr>
6976         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
6977         Don't gettextize internal error messages.
6979 2001-10-13  Akim Demaille  <akim@epita.fr>
6981         * tests/macros.at (Arity and defn): New failing test.
6982         (Arity, defn, and freeze): New.
6984         Fix `Arity and defn'.
6986         * m4/input.c (m4_push_macro): Don't forget the arity.
6987         * modules/m4.c (defn): Likewise.
6989 2001-10-13  Akim Demaille  <akim@epita.fr>
6991         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
6992         to...
6993         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
6994         (Propagation of traceon, Propagation of --trace): this new file.
6996 2001-10-13  Akim Demaille  <akim@epita.fr>
6998         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
6999         interface instead of (name, argc...).
7000         Upon failure, specify which argument was guilty.
7001         Adjust callers.
7003 2001-10-13  Akim Demaille  <akim@epita.fr>
7005         * modules/evalparse.c: Save translators' time: don't translate
7006         internal error messages.
7007         (m4_evaluate): Simplify/normalize error messages.
7008         * doc/m4.texinfo (Eval): Adjust.
7010 2001-10-13  Akim Demaille  <akim@epita.fr>
7012         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7013         where no checking is needed.
7014         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7015         interface instead of (name, argc...).
7016         Adjust callers.
7017         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7018         elsewhere.
7020 2001-10-13  Akim Demaille  <akim@epita.fr>
7022         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7023         exclude the builtin name from the count.
7024         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7025         calling ifelse with a single argument is valid.
7026         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7027         with 1 and 2 args, mostly to strengthen the test suite.
7029 2001-10-13  Akim Demaille  <akim@epita.fr>
7031         * m4/output.c (m4_make_diversion, m4_insert_file)
7032         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7034 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
7036         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
7037         since we call these things builtins in the rest of the code!
7039         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7041 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
7043         Rather than forcing each builtin definition to manage its own
7044         argument range checking, tabulate the maxima and minima for all
7045         builtins in each module.  This forces us to consider what the
7046         valid ranges for each builtin should be, and moves the checking
7047         code out of each builtin implementation and into the builtin
7048         caller infrastructure.
7050         * m4/m4module.h (struct m4_builtin): Add argument minima and
7051         maxima.
7052         * m4/m4private.h (struct m4_token): Reflect them here too.
7053         * m4/input.c (struct input_block): ...and here.
7054         (m4_token_copy): New function for token copying.
7055         (init_macro_token): Copy them from a token to the input stack.
7056         (m4_next_token): Don't forget to initialise them for text
7057         macros.
7058         * m4/macro.c (expand_argument): Use m4_token_copy, and also
7059         check argument counts before calling the builtin handler.
7060         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
7061         (m4_symbol_macro): Likewise.
7062         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
7063         parameters.  Updated all callers.
7064         (m4_builtin_define): Ditto.
7065         (m4_macro_pushdef, m4_macro_define): Ditto.
7066         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
7067         * modules/evalparse.c:  Declare argument counts for defined
7068         builtins and remove explicit calls to m4_bad_argc().
7069         * modules/gnu.c: Ditto.
7070         * modules/load.c: Ditto.
7071         * modules/m4.c: Ditto.
7072         * modules/modtest.c: Ditto.
7073         * modules/mpeval.c: Ditto.
7074         * modules/perl.c: Ditto.
7075         * modules/shadow.c: Ditto.
7076         * modules/stdlib.c: Ditto.
7077         * modules/time.c: Ditto.
7078         * TODO: Updated.
7080 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
7082         The trace semantics now attach the trace bit to a symbol name.
7083         For as long as a traceon(`foo') is active, calls to foo will be
7084         traced regardless of intervening undefines or module unloads.
7085         Fixed the flag propogation issues differently to the fixes
7086         reverted with the last attempt at nailing down trace:
7088         * m4/m4private.h:  This file is not visible outside of the m4
7089         source tree, so I removed all the `M4_' and `m4_' prefixes to save
7090         on typing.  Updated all clients.
7091         (m4_token): New typedef contains the fields that need to be passed
7092         around with the low level tokeniser.
7093         (m4_token_data):  Removed.
7094         (m4_symbol): Now contains the traced flag again.
7095         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
7096         the trace bit set.  This change is contained entirely within this
7097         module and doesn't leak out into the callers.  Updated all
7098         clients.
7099         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
7100         new fields in m4_token.  Updated all clients.
7101         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
7102         that `groks_macro_args' and `blind_if_no_args' flags are retained
7103         when defn() results are passed around in m4 code.  Updated all
7104         callers.
7105         (m4_builtin_define): Ditto.
7106         (m4_macro_pushdef, m4_macro_define): Ditto.
7107         * m4/input.c (struct input_block): Add a flags field to facilitate
7108         the above.
7109         (m4_push_macro):  ...use it.
7110         (init_macro_token):  Retrieve it.
7111         (m4_next_token): Initialise it.
7112         * m4/macro.c (expand_argument):  Copy it.
7113         * m4/m4module.h: Adjust.
7114         * tests/builtins.at:  Adjust the expected output of the trace
7115         tests to reflect the change in semantics.
7116         * tests/modules.at (modules: trace):  Check that unloading a
7117         module which supplies a traced symbol definition doesn't lose te
7118         trace bit.
7120 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
7122         * modules/gnu.c (m4_macro_table): Display the timetamp when
7123         expanding __m4_version__.
7125         * configure.ac (--with-modules): Forgot a comma in the
7126         AC_HELP_STRING parameter list.
7128 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
7130         * bootstrap: Remove aclocal.m4t when it is no longer required.
7132 2001-10-05  Akim Demaille  <akim@epita.fr>
7134         * tests/Makefile.am: Adjust for gnuprog2.
7135         * tests/m4.in: There can be a leading path.
7136         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
7137         * tests/testsuite.at: Adjust to the most recent Autotest.
7138         (AT_CHECK_M4_FILTER): Fix and rename as...
7139         (AT_TEST_M4): this.
7140         * tests/others.at: Use it.
7142         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
7143         variable in shell scripts, one uses `$'...
7145 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
7147         * configure.ac: `rm -f $m4_getopt_h' was lost.
7149 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
7151         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
7152         time.  Define it for config.h in order to...
7153         * src/main.c (main): ...display the timestamp for --version.
7155 2001-10-04  Akim Demaille  <akim@epita.fr>
7157         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
7158         previous builtins `regexp' and `patsubst'.
7159         (regexp, patsubst): Use them.
7160         (eregexp, epatsubst): New builtins.
7161         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
7162         (Epatsubst and Patsubst, Eregexp and Regexp): these.
7163         (Extensions): More info on REs.
7165 2001-10-04  Akim Demaille  <akim@epita.fr>
7167         * modules/modtest.c (init_handler): Consistently output to stderr.
7168         (finish_handler): New.
7169         (test): The `if' is an `assert'.
7170         * tests/modules.at: Adjust.
7172 2001-10-04  Akim Demaille  <akim@epita.fr>
7174         * m4/utility.c (m4_bad_argc): Detail the mismatches.
7176 2001-10-01  Akim Demaille  <akim@epita.fr>
7178         * tests/generate.awk: Tag the tests with `documentation'.
7179         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
7180         Use the make the existing modtest tests more uniform, and complete
7181         the set of possibilities.
7183 2001-10-01  Akim Demaille  <akim@epita.fr>
7185         * config/gmp.m4: Consult the user before using GMP: use
7186         --without-gmp.
7187         * configure.ac: Adjust.
7188         * modules/gmp.c: No protection needed as the module is not built
7189         if GMP is not used.
7191 2001-10-01  Akim Demaille  <akim@epita.fr>
7193         * tests/generate.awk: Remove debugging code.
7194         (fatal): Specify the current location.
7196         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
7197         * modules/gnu.c, modules/m4.c: Use M4ARG.
7199 2001-10-01  Akim Demaille  <akim@epita.fr>
7201         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
7202         (m4_regexp_compile): New.
7203         (regexp, patsubst): Use it.
7205 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7207         Reinstate the memory handling improvements from the patch I just
7208         reverted.  Relevant ChangeLog entries repeated here:
7210         * m4/module.c (m4_module_remove): New function that holds the core
7211         of the old m4_module_unload.
7212         (m4_module_unload): Use it.
7213         (m4_module_unload_all): When we know the modules will never be
7214         used again (i.e. on exit), free up as much module memory as
7215         possible.  There are still some artifacts from resident modules
7216         living inside ltdl.c, but everything else is freed.
7217         * m4/debug.c (m4_debug_exit): Free memory allocated in
7218         m4_debug_init().
7219         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7220         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7221         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7222         * m4/m4module.h: Updated prototypes.
7223         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7224         * m4/hash.h: Updated prototypes.
7225         * src/main.c (main): Use all these new functions to clean up as
7226         much memory as possible before exit.
7228 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7230         Reverted my large patch for removing the old m4_symbol
7231         structure on 2001-09-20.  We are still not happy about the way
7232         trace works in conjunction with defn and undefine, and leaving
7233         the reverted patch active prevents us from moving the traced
7234         bit from the definition back to the symbol.
7236 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7238         * configure.in: Moved to...
7239         * configure.ac: ...here.  Added a libtool like timestamped
7240         banner, and tidied up the libltdl cruft.
7241         * config/mkstamp: Script to extract a timestamp from ChangeLog.
7242         * modules/Makefile.am (INCLTDL):  Removed.  This is required
7243         only when libltdl is configured in a subdirectory.
7244         * src/Makefile.am: Ditto.
7245         (LIBADD_DL):  No need to add this again, libtool already knows
7246         that libm4.la depends on it.
7247         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
7248         them.
7250         * TODO: stackovf.c is basically broken.
7251         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
7253 2001-09-28  Akim Demaille  <akim@epita.fr>
7255         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
7257 2001-09-27  Akim Demaille  <akim@epita.fr>
7259         * tests/m4.in: Don't use short options.
7260         Simplify the stderr signature normalization.
7262 2001-09-27  Akim Demaille  <akim@epita.fr>
7264         tests/m4 shall be position independent.
7266         * tests/m4.in: New.
7267         * tests/m4: Remove.
7268         * tests/testsuite.at: No args to AT_INIT.
7269         * configure.in, tests/Makefile.am: Adjust.
7271 2001-09-22  Akim Demaille  <akim@epita.fr>
7273         Autotest has changed again.
7275         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
7276         (package.m4): Remove.
7277         * configure.in: Adjust to LIBADD_GMP.
7279 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
7281         * config/gmp.m4 (AC_ARG_WITH): Removed.
7282         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
7283         (AC_LIB_GMP): When performing a test compile against libgmp,
7284         include the header gmp.h if possible, and link against -lgmp.  If
7285         they both work define USE_GMP.
7286         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
7287         (mpeval_LTX_init_func): Complain on load that there was no libgmp
7288         at compile time.
7290 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
7292         * m4/evalparse.c: Moved to...
7293         * modules/evalparse.c:  ...here.  This code is shared between
7294         modules/mpeval.c and modules/m4.c, so there is no need to pollute
7295         the libm4 API with its details.  Moderately rewritten to interface
7296         into its clients more simply.
7297         * m4/eval.c: Deleted.  Migrated functionality to...
7298         * modules/m4.c: ...here.
7299         (builtin_eval):  Implemented in terms of the new interface style.
7300         * modules/mpeval.c (builtin_mpeval): Ditto.
7301         * m4/m4module.h: Removed references to the former m4/eval.c.
7302         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
7303         (EXTRA_libm4_la_SOURCES): Deleted.
7304         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
7305         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
7307 2001-09-20  Akim Demaille  <akim@epita.fr>
7309         * config/gmp.m4 (AM_WITH_GMP): Rename as...
7310         (AC_LIB_GMP): this.
7311         By default, use gmp.
7312         Massive revamping.
7313         * configure.in: Adjust.
7314         Use Automake conditionals for USE_GMP.
7315         Always compute sizeof (long long int).
7316         This was a bug BTW, as `eval' (not `mpeval') depends on it:
7317         before, it was used _only_ if mpeval was not activated.
7318         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
7319         (mpeval_la_LIBADD): New macros.
7320         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
7321         Indent.
7322         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
7323         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
7324         WITH_GMP.
7326 2001-09-20  Akim Demaille  <akim@epita.fr>
7328         * tests/Makefile.am (package.m4): New.
7329         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
7331 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
7333         More cleanup.  After the last patch, m4_symbol holds nothing but
7334         the head of a chain of m4_token_data.  So I have removed the old
7335         m4_symbol, so that m4_token_data chains are stored directly in the
7336         value cell of a hash table node.  But there's more... m4_symbol
7337         was a more natural name for the symbol value cell, and now that it
7338         is gone I have renamed the former m4_token_data structure to
7339         m4_symbol.  This change turned out to be a pig to get right, since
7340         the original code didn't need to modify the value cell itself,
7341         since changing the chain happened inside the m4_symbol that used
7342         to be returned -- I had to pass the address of the value cell
7343         across various function calls, incase the head value changed.  I
7344         also tightened up the memory management to help me find a nasty
7345         memory corruption bug that took me all night to track down...
7347         * m4/m4private.h (struct m4_symbol): Removed.
7348         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
7349         all references.
7350         * m4/hash.c (m4_hash_iterator_value): Return the address of the
7351         value cell.  Updated all callers.
7352         * m4/symtab.c: Took advantage of the simplification in the data
7353         structures to rewrite a lot of this file more simply.  There is
7354         still some room for optimisation here, but we should tackle that
7355         systematically closer to the release.
7357         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7358         revealed.  This version is ahead of CVS libtool until I get chance
7359         to flush my changes.
7360         * m4/module.c (m4_module_remove): New function that holds the core
7361         of the old m4_module_unload.
7362         (m4_module_unload): Use it.
7363         (m4_module_unload_all): When we know the modules will never be
7364         used again (i.e. on exit), free up as much module memory as
7365         possible.  There are still some artifacts from resident modules
7366         living inside ltdl.c, but everything else is freed.
7367         * m4/debug.c (m4_debug_exit): Free memory allocated in
7368         m4_debug_init().
7369         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7370         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7371         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7372         * m4/m4module.h: Updated prototypes.
7373         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7374         * m4/hash.h: Updated prototypes.
7375         * src/main.c (main): Use all these new functions to clean up as
7376         much memory as possible before exit.
7378 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
7380         The `traced' flag needs to be attached to the definition of a
7381         symbol rather than the current symbol containing the definition.
7382         Implementing this showed up some long standing post 1.4 bugs in
7383         flag propogation which I also fixed.
7385         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
7386         (struct m4_token_data): And add it back in here.
7387         * m4/input.c (init_macro_token): Propogate the traced flag
7388         correctly.
7389         * m4/macro.c (expand_argument): Ditto.
7390         * tests/builtins.at (trace2, trace3): New tests based on Akim's
7391         sadistic email ;-)
7393 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7395         * m4/m4private.h (struct m4_token_data): Simplified by removing
7396         the redundant `traced' flag, and one level of structure nesting.
7397         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
7398         * m4/input.c (init_macro_token): No need to initialise removed
7399         `traced' field.
7400         * m4/macro.c (expand_argument): No need to copy it either.
7401         * m4/utility.c (m4_token_data_func_traced): Or provide an access
7402         function.
7404         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
7405         dependant on multiple symbols with the same key, so preserving
7406         relative symbol order in each bucket during resizing is no longer
7407         required.  The resize function is considerably faster as a result.
7409         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
7410         s/m4_symbol_insert/m4_symbol_define/g;
7411         s/m4_builtin_insert/m4_builtin_define/g;
7412         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
7414 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7416         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
7417         commits, the m4_lookup_symbol dispatch function is split into
7418         specialised functions that must be called directly.
7420         * m4/m4module.h (m4_symbol_lookup_t): Removed.
7421         * m4/symtab.c (m4_lookup_symbol): Removed.
7422         (m4_symbol_builtin, m4_symbol_macro): New functions.
7423         * m4/builtin.c (m4_builtin_define): Split into...
7424         (m4_builtin_pushdef, m4_builtin_insert): ...these.
7425         (m4_macro_define): Split into...
7426         (m4_macro_pushdef, m4_macro_insert): ...these.
7427         * src/main.c (main): Set command line macros from `-D' parameters
7428         using `m4_macro_define'.
7430 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7432         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
7433         this from m4_remove_table_reference_symbols().
7434         * m4/m4module.h, m4/module.c: Updated all references.
7436 2001-09-07  Akim Demaille  <akim@epita.fr>
7438         * modules/stdlib.c, modules/times.c: Misc cleanups.
7440 2001-09-07  Akim Demaille  <akim@epita.fr>
7442         * configure.in: We now need Autoconf 2.52e.
7443         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
7444         and `M4_SYMBOL_DELETE'.
7445         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
7446         * src/main.c (main): Adjust.
7448 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
7450         Fix the obstack.h problem once and for all!  At configure time we
7451         can test for a system supplied obstack.h:  depending on the
7452         result, we now generate system.h with an #include of the correct
7453         header.  As a bonus, I've also added a --with-included-obstack,
7454         incase the user doesn't like the system obstack for some
7455         reason... and also we can test the shipped obstack on a system
7456         that has oe of its own.  We also now need to be careful to add
7457         build directories to the include search path, since the generated
7458         system.h will be in the build tree.
7460         * configure.in (AC_CONFIG_FILES): Generate system.h from
7461         system-h.in.
7462         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
7463         include the system obstack header or the copy shipped with M4.
7464         Allow the user to override configure and force the build to use
7465         the shipped version.
7466         * m4/system-h.in: New file, template for...
7467         * m4/system.h: ...this.  Now deleted.
7468         * m4/m4module.h: Include system.h before everything else.
7469         * src/freeze.c: Ditto.
7470         * m4/Makefile.am (dist-hook): Remove generated system.h.
7471         (INCLUDES): Check builddir for generated headers before checking
7472         srcdir.
7473         * modules/Makefile.am (INCLUDES): Ditto.
7474         * src/Makefile.am (INCLUDES): Ditto.
7476 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
7478         * TODO: Remove the items that have been addressed already.
7480 2001-09-05  Akim Demaille  <akim@epita.fr>
7482         * src/main.c (main): Standardize --version.
7484 2001-09-05  Akim Demaille  <akim@epita.fr>
7486         * modules/format.c (format): Have a bigger `str'.
7488 2001-09-05  Akim Demaille  <akim@epita.fr>
7490         Rationalize warnings, reporting the macro name as if it were a
7491         program name, and assertions.
7493         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
7494         (M4WARN): New.
7495         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
7496         (m4_symbol_delete):
7497         Use assert for internal errors.
7498         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
7499         M4WARN.
7500         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
7501         M4WARN and assert.
7502         * tests/builtins.at (pushpop): Adjust.
7504 2001-09-05  Akim Demaille  <akim@epita.fr>
7506         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
7507         with pointers.
7509 2001-09-05  Akim Demaille  <akim@epita.fr>
7511         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
7512         * m4/macro.c, m4/symtab.c: Adjust.
7514 2001-09-05  Akim Demaille  <akim@epita.fr>
7516         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
7517         (m4_symbol_pop, m4_symbol_del): this.
7518         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
7519         (m4_symbol_popdef, m4_symbol_delete): New.
7520         (m4_lookup_symbol): Adjust.
7521         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
7523 2001-09-05  Akim Demaille  <akim@epita.fr>
7525         * m4/m4module.h (m4_symbol_lookup): Rename as...
7526         (m4_symbol_lookup_t): this.
7528 2001-09-05  Akim Demaille  <akim@epita.fr>
7530         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
7531         unused.
7532         * m4/symtab.c (m4_lookup_symbol): Adjust.
7534 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
7536         Bootstrap will now work with Libtool 1.4.1 or higher:
7537         * bootstrap: Remove stale autom4te.cache files when
7538         rebootstrapping.
7539         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
7540         libtool.m4.
7541         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
7542         libtool.m4 directly.
7543         Run libtoolize to refresh ltmain.sh.
7544         * config/ltmain.sh:  Deleted.
7545         * acinclude.m4: Deleted.
7546         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
7548         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
7549         implementation for the cvs impaired libtool user.
7551 2001-09-03  Akim Demaille  <akim@epita.fr>
7553         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
7554         internal errors.
7555         Avoid using `default' in switch, as it hides useful compiler
7556         warnings when a case is forgotten.
7558 2001-09-03  Akim Demaille  <akim@epita.fr>
7560         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
7561         is no such thing as `WITH_MODULES'.
7563 2001-09-03  Akim Demaille  <akim@epita.fr>
7565         Improve the test suite's selfcontainedness.
7567         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
7568         (Include, Undivert): Tag the other input files.
7569         * tests/generate.awk: Catch `@comment file:'.
7570         `-I $src' is no longer needed.
7571         `next' is really like `return': the rest is skipped.
7572         Adjust to `input.m4'.
7573         (fatal): New function.
7574         * tests/foo, tests/incl.m4: Remove.
7576 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
7578         The shadowing mechanism and, infact, the whole symbol table
7579         implementation was creaking under the weight of the features piled
7580         on top of it.  We now have a separate hash table module which will
7581         dynamically resize to keep symbol density withing good performace
7582         limits, and a new symtab module layered above it.  Symbol lookups
7583         are now marginally more efficient (since the shadowed flag is no
7584         longer required) and symbol removal, such as on module unload, is
7585         considerably faster due to a reorganisation of the data structures
7586         used in symtab.c.
7588         * src/main.c (main):  Don't mention `-H'.
7589         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
7590         effect.
7591         * NEWS: Updated.
7592         * m4/hash.c: New generalised dynamic hash table data structure
7593         management module.
7594         * m4/hash.h: Public interface.
7595         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
7596         (libm4_la_SOURCES): Add hash.c.
7597         * m4/symtab.c: More or less rewritten from scratch, within the
7598         bounds of the previous API.
7599         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
7600         call.  Updated all callers.
7601         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
7602         declarations to reflect API changes.
7603         (M4INIT): Generate a declaration too, to avoid the warning with
7604         --enable-debug builds.
7605         (M4FINISH): Ditto.
7606         (HASHMAX): Removed.
7607         * m4/utility.c (hash_table_size):  Removed.
7608         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
7609         names, which are then looked up by builtin_dumpdef() as necessary.
7610         This implies a small speedup in builtin_symbols(), which discarded
7611         all of the symbol info under the old call.
7612         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
7613         shadowing is implicit in respect to the new data structures.
7614         symbol names are no longer duplicated here, they are stored in the
7615         key field of the hash table.
7616         Moved macro_args and blind_no_args...
7617         (m4_token_data): ...to here.
7618         m4/macro.c (expand_macro):  Added a name argument since the symbol
7619         name is no longer copied into each struct m4_symbol.  Modified all
7620         callers.
7621         (collect_arguments):  Ditto.
7622         * modules/m4.c (set_trace): Ditto.
7623         * modules/gnu.c (builtin_symbols): Updated.
7624         * src/freeze.c (produce_symbol_dump): Much improved in light of
7625         the improved symbol table layout.
7627 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
7629         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
7630         to M4_SYMBOL_NEXT.
7631         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
7632         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
7633         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
7634         SYMBOL_HANDLE): Ditto.
7635         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
7636         modules/gnu.c, modules/m4.c, src/freeze.c,
7637         src/main.c:  Updated all references.
7639         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
7640         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
7641         already listed in m4_LDADD... how did that ever used to work?
7642         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
7643         link.
7644         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
7645         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
7647         * tests/m4: Don't call the m4 wrapper script with libtool, it
7648         works fine all by itself.
7650 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
7652         The experimental `changeword' feature never took off, and has
7653         no obvious advantages over `changesyntax' to compensate the
7654         enormous speed penalty it carries:
7655         * configure.in (ENABLE_CHANGEWORD): Removed.
7656         * m4/m4module.h (m4_set_word_regexp): Removed.
7657         * m4/m4private.h (m4_token_data): Removed original_text field.
7658         * m4/utility.c (m4_token_data_orig_text): Removed.
7659         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
7660         * m4/macro.c: Ditto.
7661         * src/main.c: Ditto.
7662         * modules/Makefile.am (changeword.la): Removed.
7663         * modules/changeword.c: File removed.
7664         * doc/m4.texinfo: References to changeword and --word-regexp
7665         removed.
7666         * po/POTFILES.in: modules/changeword.c removed.
7667         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
7668         * tests/builtins.at (changeword): Test removed.
7670 2001-08-30  Akim Demaille  <akim@epita.fr>
7672         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
7673         This also help having a single list of m4 files: in
7674         config/Makefile.am.
7675         * config/Makefile.am (STANDARD_MACROS): Rename as...
7676         (ACLOCAL_MACROS): this.
7677         (list-standard-macros): Remove.
7678         (spy): New.
7680 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
7682         In an attempt to moderate my egomania...
7683         * tests/modules.at: Remove attributions.
7685         * tests/generate.awk: When making substitutions to "@&t@", either
7686         "&" or "\&" in the substitution string argument to gsub refer back
7687         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
7688         67 now pass for me.
7690 2001-08-29  Akim Demaille  <akim@epita.fr>
7692         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
7693         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
7694         (sync-lines, trace, translit, undivert, wrap): Move to...
7695         * tests/builtins.at: this new file.
7696         * tests/others.at (Discard comments, import-environment): Move to...
7697         * tests/options.at: this new file.
7699 2001-08-29  Akim Demaille  <akim@epita.fr>
7701         * tests/others.at (Freezing modules)
7702         (--module-directory: absolute path, modpath2, modpath3)
7703         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
7704         * tests/modules.at: here, new file.
7705         * tests/others.at, tests/generate.awk: Add a banner.
7706         * tests/testsuite.at: Adjust.
7707         (AT_CHECK_M4_FILTER): New, but unused.
7709 2001-08-29  Akim Demaille  <akim@epita.fr>
7711         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
7712         handle that.
7713         * tests/others.at (wrap): Inline wrap.m4.
7714         (shadow): Inline shadow.m4.
7715         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
7716         * tests/m4: Simplify.
7718 2001-08-29  Akim Demaille  <akim@epita.fr>
7720         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
7721         --language.
7723 2001-08-29  Akim Demaille  <akim@epita.fr>
7725         * tests/generate.awk (normalize): s/@__@/@&t@/.
7727 2001-08-28  Akim Demaille  <akim@epita.fr>
7729         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
7731 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
7733         * bootstrap (generate.awk): Generate test cases with new script.
7735 2001-08-27  Akim Demaille  <akim@epita.fr>
7737         * tests/Makefile.am (installcheck-local): Don't use
7738         `dc_install_base' which is not visible here, but `exec_prefix'
7739         which is clearly the RT anyway.
7740         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
7741         related to testing a now installed m4.
7742         * tests/m4: Do it here.
7744 2001-08-27  Akim Demaille  <akim@epita.fr>
7746         * tests/others.at (indir): Formatting change.
7748 2001-08-27  Akim Demaille  <akim@epita.fr>
7750         * tests/Makefile.am (installcheck-local): New.
7751         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
7752         the test suite.
7753         Prefer options over envvars.
7754         * src/main.c (main): First bug caught by the test suite (yeah!):
7755         --batch lacked a `break' which resulted in an accidental
7756         invocation of --discard-comments.
7758 2001-08-27  Akim Demaille  <akim@epita.fr>
7760         * tests/others.at (capitalize, changeword, comments, ddivert)
7761         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
7762         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
7763         (sysv-args, trace, translit, undivert): Don't rely on files in
7764         examples/: AT_DATA them.
7766 2001-08-27  Akim Demaille  <akim@epita.fr>
7768         Let the test suite use a wrapper around the not installed m4 to
7769         pretend it is (installed).
7771         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
7772         such a way that m4 does not process them.
7773         * configure.in: The package name seems to be `m4', not `M4'.
7774         * tests/m4: New.
7775         * tests/atlocal.in (at_package, M4): Remove.
7776         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
7778 2001-08-27  Akim Demaille  <akim@epita.fr>
7780         * tests/Makefile.am (CLEANFILES): Remove.
7781         (DISTCLEANFILES, clean-local): New.
7782         * examples/mktests.sh: Remove.
7784 2001-08-27  Akim Demaille  <akim@epita.fr>
7786         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
7787         Don't use aclocal: it's written by hand.
7788         * aclocal.m4: m4_include all the files instead of being built by
7789         aclocal.
7790         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
7791         until it reads the traces by itself.
7792         * configure.in: Require Autoconf 2.42c as we are now using
7793         AC_CONFIG_TESTDIR instead of AT_CONFIG.
7794         Catch unexpanded `jm_' macros.
7795         * config/atconfig.m4: Remove.
7796         * config/error.m4: new.
7797         * config/Makefile.am: Ship the files included by aclocal.m4.
7798         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
7799         (TESTSUITE_AT): this, to please Automake.
7800         (TESTSUITE): This target uses autotest/autotest.m4, not
7801         autotest/general.m4.
7802         * tests/testsuite.at: Prereq Autotest 2.52c.
7803         * examples/Makefile.am (pkgdata_DATA): Rename as...
7804         (dist_pkgdata_DATA): this.
7805         * doc/Makefile.am (man_MANS): Rename as...
7806         (dist_man_mans): this.
7808 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
7810         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
7811         Robert Collins, building on Cygwin no longer requires Windows
7812         import and export symbol decorations.
7813         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
7814         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
7815         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7816         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7817         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7818         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7819         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7820         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7821         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7822         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
7823         anymore.
7824         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
7825         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
7827 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
7829         Ansify the source.  Previously we had a mix, where my code was
7830         in a K&R compatible style, and the preexisting code was in ANSI
7831         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
7832         and now the code base is much cleaner.
7834         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
7835         VOID macro and all users.
7836         * m4/m4module.h:  Ansify function prototypes and headers.
7837         * m4/builtin.c:  Ditto.
7838         * m4/evalparse.c:  Ditto.
7839         * m4/input.c:  Ditto.
7840         * m4/macro.c:  Ditto.
7841         * m4/module.c:  Ditto.
7842         * m4/output.c:  Ditto.
7843         * m4/path.c:  Ditto.
7844         * m4/symtab.c:  Ditto.
7845         * m4/utility.c:  Ditto.
7846         * modules/format.c:  Ditto.
7847         * modules/gnu.c:  Ditto.
7848         * modules/m4.c:  Ditto.
7849         * modules/mpeval.c:  Ditto.
7850         * src/freeze.c:  Ditto.
7851         * src/m4.h:  Ditto.
7852         * src/main.c:  Ditto.
7854 2001-08-20  Akim Demaille  <akim@epita.fr>
7856         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
7857         generated with stock 2.52.
7859 2001-08-20  Akim Demaille  <akim@epita.fr>
7861         * config/atconfig.m4: New, until part of Autoconf per se.
7862         * configure.in (AT_CONFIG): Use it.
7863         Adjust.
7864         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
7865         * tests/atlocal.in: New.
7866         * tests/generate.awk: For the time being, the empty quadrigraph is
7867         `@__@'.
7868         * tests/others.at (changeword, gmp): Check the configuration
7869         variable against `yes'.
7870         * tests/testsuite.at (dnl): Allow it, as it's used all over the
7871         place.
7873 2001-08-20  Akim Demaille  <akim@epita.fr>
7875         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
7876         * modules/m4.c (undivert): Disable the possibility of undiverting
7877         several files at once: it is not documented, it is inconsistent
7878         with the other macros, it can be straightforwardly mocked by
7879         several invocations, and most importantly, it prevents the
7880         possibility of other kinds of extension.
7881         Use `m4_numeric_arg'.
7883 2001-08-20  Akim Demaille  <akim@epita.fr>
7885         * examples/include.m4: Typo.
7886         * tests/generate.awk: Really add it.
7887         * tests/Makefile.am: Adjust.
7888         * tests/others.at (Discard comments): It sure fails without `-c'.
7889         (include, undivert): Add -I examples/.
7891 2001-08-20  Akim Demaille  <akim@epita.fr>
7893         Use sprintf, not ecft and friends since it is standard, portable,
7894         simplifies the code, and since the latter is even deprecated
7895         according to the GNU libc documentation.
7897         * modules/format.c: Drop evct support.
7899 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
7901         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
7902         for `-pipe' here...
7903         * configure.in: ...do it here instead.
7905         * c-boxes.el: Deleted.
7906         * m4/builtin.c: Reformat box comments to be closer to GNU
7907         standards.
7908         * m4/debug.c:  Ditto.
7909         * m4/eval.c:  Ditto.
7910         * m4/evalparse.c:  Ditto.
7911         * m4/input.c:  Ditto.
7912         * m4/m4module.h:  Ditto.
7913         * m4/macro.c:  Ditto.
7914         * m4/output.c:  Ditto.
7915         * m4/symtab.c:  Ditto.
7916         * m4/utility.c:  Ditto.
7917         * modules/changeword.c:  Ditto.
7918         * modules/format.c:  Ditto.
7919         * modules/gnu.c:  Ditto.
7920         * modules/load.c:  Ditto.
7921         * modules/m4.c:  Ditto.
7922         * modules/modtest.c:  Ditto.
7923         * modules/mpeval.c:  Ditto.
7924         * modules/perl.c:  Ditto.
7925         * modules/shadow.c:  Ditto.
7926         * modules/stdlib.c:  Ditto.
7927         * modules/time.c:  Ditto.
7928         * src/freeze.c:  Ditto.
7929         * src/main.c:  Ditto.
7931 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
7933         * m4/module.c: Fixup some errors in the description comment.
7935 2001-08-17  Akim Demaille  <akim@epita.fr>
7937         * tests/others.at (iso8859): Specify the path to the M4 test file.
7938         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
7939         files in error messages.
7941 2001-08-17  Akim Demaille  <akim@epita.fr>
7943         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
7944         * tests/others.at: Adjust input files paths.
7945         * tests/atconfig.in: Set top_builddir.
7946         * tests/Makefile.am: Adjust.
7947         `testsuite' is in src, not build.
7949 2001-08-17  Akim Demaille  <akim@epita.fr>
7951         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
7952         (generate.at): Install a temporary hack until the actual
7953         generate.awk is added to the repository.
7954         * tests/atconfig.in: New.
7956 2001-08-17  Akim Demaille  <akim@epita.fr>
7958         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
7960 2001-08-17  Akim Demaille  <akim@epita.fr>
7962         * doc/m4.texinfo: Promote proper quotation.
7964 2001-08-17  Akim Demaille  <akim@epita.fr>
7966         Remove the non Autotest tests.
7968         * tests/other-tests/capitalize.test,
7969         * tests/other-tests/changeword.test,
7970         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
7971         * tests/other-tests/debug.test,
7972         * tests/other-tests/discard-comments.m4,
7973         * tests/other-tests/discard-comments.test,
7974         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
7975         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
7976         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
7977         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
7978         * tests/other-tests/hanoi.test,
7979         * tests/other-tests/import-environment.m4,
7980         * tests/other-tests/import-environment.test,
7981         * tests/other-tests/include.test, tests/other-tests/indir.test,
7982         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
7983         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
7984         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
7985         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
7986         * tests/other-tests/modtest.test,
7987         * tests/other-tests/multiquotes.test,
7988         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
7989         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
7990         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
7991         * tests/other-tests/sync-lines.m4,
7992         * tests/other-tests/sync-lines.test,
7993         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
7994         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
7995         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
7996         * tests/other-tests/wrap.test: Remove.
7998         * tests/run-test, tests/get-them: Remove.
7999         * tests/Makefile.am: Adjust.
8001 2001-08-17  Akim Demaille  <akim@epita.fr>
8003         others.at no longer depends on other-tests/.
8005         * tests/others.at (stackovf): You're actually...
8006         (sync-lines): this.
8007         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8008         (unload.test): Keep their authorship.
8009         (discard-comments, gmp, import-environment, modfreeze)
8010         (sync-lines): Embed the input files.
8011         * tests/stackovf.test: Copy from other-tests/stackovf.test.
8012         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8014 2001-08-17  Akim Demaille  <akim@epita.fr>
8016         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8017         (M4exit): Tag the exit status of the example.
8018         * tests/get-them: Adjust.
8019         * tests/generate.awk: New, based on get-them.
8020         * tests/Makefile.am: Adjust to generate `generated.at'.
8021         * tests/testsuite.at: Adjust.
8022         (AT_CHECK_M4): Don't overquote.  Blush...
8024 2001-08-17  Akim Demaille  <akim@epita.fr>
8026         Start using Autotest.  atconfig creation is still lacking.
8028         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8029         * examples/reverse.m4, tests/other-tests/import-environment.m4,
8030         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8031         * tests/other-tests/import-environment.test: Don't check LANGUAGE
8032         as it might be `unset', or set to `C'.
8033         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
8034         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8035         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8036         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
8037         * tests/other-tests/shadow.test: Adjust.
8038         * tests/testsuite.at, tests/others.at: New.
8039         * tests/Makefile.am: Adjust.
8041 2001-08-17  Akim Demaille  <akim@epita.fr>
8043         Drop Autoconf 2.13 compatibility.
8045         * configure.in (changeword): No need to undefine it, as anyway if
8046         it's defined, M4sugar moved it as m4_changeword.
8047         And anyway, proper quotation is enough.
8048         (m4_pattern_allow): As it exists in 2.50, just use it.
8049         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
8050         Don't handle Gettext's duties, let it handle them.
8051         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
8053 2001-08-17  Akim Demaille  <akim@epita.fr>
8055         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
8056         (m4_errprint): Use fputs.
8057         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
8058         dumpdef are not concerned.
8059         (Dumpdef, Errprint): Emphasize their insensitivity to
8060         --error-output.
8061         * doc/Makefile.am: Add `TAGS' support.
8062         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
8063         in `config/' now.
8064         * config/Makefile.am (MAINTAINERCLEANFILES): New.
8066 2001-08-17  Akim Demaille  <akim@epita.fr>
8068         * modules/Makefile.am (ETAGS_ARGS): New.
8070 2001-08-17  Akim Demaille  <akim@epita.fr>
8072         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
8073         changes.
8075 2001-08-17  Akim Demaille  <akim@epita.fr>
8077         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
8079 2001-08-17  Akim Demaille  <akim@epita.fr>
8081         * m4/m4module.h (m4/list.h): Don't include it.
8083 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
8085         m4_modules are no more, we use lt_dlhandles directly and let
8086         latest libltdl features manage the list of loaded modules.
8087         * acinclude.m4: Regenerated.
8088         * m4/ltdl.c: Updated from master copy.
8089         * m4/module.c: Reimplemented to take advantage of advances in
8090         libltdl.
8091         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
8092         list with lt_dlhandle_next.
8093         (m4_builtin_find_by_func): Ditto.
8094         (m4_builtin_table_install): Use lt_dlhandle.
8095         (m4_macro_define): Ditto.
8096         (m4_macro_table_install): Ditto.
8097         m4/module.h: Prototype new module management API.
8098         (m4_modules): No longer required.
8099         (m4_module_init_t, m4_module_finish_t): POSIX namespace
8100         violations, renamed to...
8101         (m4_module_init_func, m4_module_finish_func): ...these,
8102         respectively.
8103         (M4INIT_HANDLER): Clean way to declare init functions in modules.
8104         (M4FINISH_HANDLER):  And similarly for finish functions.
8105         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
8106         -- Add indirection to the CONC macro so that arguments are
8107         correctly expanded.
8108         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
8109         * modules/shadow.c (m4_init_module):  Ditto.
8110         Due to new init function semantics, be careful to perform the
8111         initialisation only on first load.
8112         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
8113         (m4_finish_module): Replaced with M4FINISH_HANDLER.
8114         Due to new finish function semantics, be careful to perform the
8115         finalisation only on first load.
8116         * m4/m4private.h (m4_module): Removed in favour of...
8117         (m4_module_data): ...structure without all the wrapper fields.
8118         Instances of this new structure are stored associated lt_dlhandles
8119         with lt_dlcaller_data_set().
8120         * m4/builtin.c (m4_builtin_define): Takes a handle argument
8121         instead of the old module argument.
8122         (m4_builtin_table_install): Ditto.
8123         * modules/load.c (m4_resident_module):  Removed.  This is no
8124         longer implemented as a magic symbol...
8125         * modules/m4.c (m4_resident_module): Ditto.
8126         * modules/load.c (M4INIT_HANDLER): ...the module init function now
8127         uses the ltdl api to make the module resident.
8128         * modules/m4.c (M4INIT_HANDLER): Ditto.
8129         * modules/load.c (builtin_modules): Traverse the loaded module
8130         list with lt_dlhandle_next.
8131         (builtin_load): Much simplified in light of the reimplemented
8132         module loader.
8133         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
8134         light of the m4/module.c rewrite.
8135         (produce_symbol_dump): Ditto.
8136         (reload_frozen_state): Ditto.
8137         * m4/list.c, m4/list.h: Files deleted.  No longer required.
8138         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
8139         (libm4_la_SOURCES): Delete list.c reference.
8140         * m4/m4private.h (m4_token_data):  Add a handle field.  This
8141         eliminates many of the searches to find the handle associated with
8142         various tokens that are passed between functions.
8143         (struct m4_symbol):  Removed the module field.  The
8144         module association does not belong with the symbol...
8145         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
8146         that the module implementation code is from.  Added a handle
8147         field.
8148         (m4_push_macro): Add a `handle' argument.  Changed all callers.
8149         (init_macro_token):  Set the `handle' field for the
8150         m4_token_data.
8151         * m4/macro.c (expand_argument): Copy the new handle field during
8152         reassignment.
8153         * modules/m4.c (macro_install): Use the new handle field to
8154         optimise the search for the correct builtin structure, and pass
8155         the handle details to m4_builtin_define.
8157 2001-08-15  Akim Demaille  <akim@epita.fr>
8159         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
8160         when creating `m4/obstack.h'.
8161         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
8162         top_builddir.
8163         * tests/defs: Make them absolute.
8164         (CDPATH) Neutralize.
8165         * tests/gethem: Use them.
8167 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
8169         * config/ltmain.sh: Doh!  Import again for a quoting fix that
8170         prevented any regression test from passing.
8172         * m4/m4module.h (obstack.h): Choose between installed version
8173         and shipped version based on configure tests.
8174         * src/freeze.c (obstack.h): Ditto.
8176         * acconfig.h: Removed.  No longer required.
8178         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
8179         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
8180         them to AC_INIT and AM_INIT_AUTOMAKE.
8181         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
8182         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
8183         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
8184         shell variable m4_cv_func_obstack_h.
8185         * tests/defs (M4): Be more careful about relative path to libtool
8186         script and m4 binary by using $srcdir.
8188         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
8189         optargs to the existing libltdl search path.
8190         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
8191         * m4/ltdl.c: Updated.
8192         * m4/ltdl.h: Ditto.
8193         * config/ltmain.sh: Ditto.
8195 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
8197         * src/main.c (main): Add `-b' (for `batch') mode switch to force
8198         interactive mode off.
8200 2001-08-10  Akim Demaille  <akim@epita.fr>
8202         * configure.in: Require Autoconf 2.52.
8203         (AC_ARG_PROGRAM): Remove, handled by Automake.
8204         (m4_getopt): Rename as...
8205         (m4_getopt_h): this.
8206         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
8207         Undefine `changeword' only if defined.
8208         * config/gnu-obstack.m4: Require Autoconf 2.52.
8209         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
8210         Allow this token.
8212 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
8214         * doc/m4.texinfo: Fix some typos, and apply some small
8215         clarifications.
8217 2001-08-09  Andreas Schwab  <schwab@suse.de>
8219         * src/main.c (main): Fix improper uses of error (missing format
8220         string).
8222 2001-08-07  Akim Demaille  <akim@epita.fr>
8224         Improve `make distcheck'.
8226         * configure.in: Be sure to be able to run `mkconfig.sh' when src
8227         != build.
8228         * Makefile.am (dist-hook): Remove, as it is no longer needed.
8229         * doc/m4.texinfo (Include): Add missing blank.
8230         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
8231         obstack.c.
8233 2001-08-07  Akim Demaille  <akim@epita.fr>
8235         * m4/evalparse.c: A better introductory comment.
8236         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
8237         * m4/macro.c: Adjust old comments.
8238         * modules/README: Typo.
8240 2001-08-07  Akim Demaille  <akim@epita.fr>
8242         * config/gnu-obstack.m4: New.
8244 2001-08-07  Akim Demaille  <akim@epita.fr>
8246         * config/Makefile.am, config/stackovf.m4: New.
8247         * configure.in, Makefile.am: Adjust.
8249 2001-08-05  gettextize  <bug-gnu-utils@gnu.org>
8251         * po/Makefile.in.in: Upgrade to gettext-0.10.39.
8252         * po/cat-id-tbl.c: Remove file.
8253         * po/stamp-cat-id: Remove file.
8255 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
8257         * modules/format.c (format):  Formatting for %f was not
8258         interpreting the position of the decimal point correctly for
8259         whole numbers.
8261 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
8263         * TODO:  Removed m4exit bug.
8264         * modules/load.c (m4_resident_module): Make this module resident.
8265         * module/m4.c (m4_resident_module): Ditto.
8266         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
8267         feature to mark modules as resident if they export
8268         `m4_resident_module' as TRUE.
8269         (m4_module_unload): Do not remove resident modules, and take care
8270         with symbol insertion and deletion with resident modules.
8271         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
8272         use resident modules feature.
8274 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
8276         * TODO: Updated.  Removed some cruft that has since been fixed
8277         or implemented.  Added some more entries.
8278         * NEWS: Updated.
8279         * README: Updated.
8280         * modules/README: Updated.
8281         * doc/m4.texinfo: Updated.
8283         * modules/gnu.c (builtin_functions): Make indir orthogonal to
8284         builtin, in that each is recognised as a macro only with parameters
8285         (builtin_indir): Passing 0 arguments is now an error, as with
8286         builtin.
8288         * src/main.c (usage): Added missing description of `-c' option.
8290 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
8292         Consolidate the myriad of dispersed test scripts into the
8293         tests subdirectory.  I think I now have all the file where I
8294         want them, so there shouldn't be anymore upheaval =)O|
8295         Honest!
8296         * tests/Makefile.am: Updated to run the new tests added below.
8297         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
8298         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
8299         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8300         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8301         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8302         tests/other-tests/hanoi.test, tests/other-tests/include.test,
8303         tests/other-tests/indir.test, tests/other-tests/misc.test,
8304         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
8305         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8306         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8307         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
8308         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
8309         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
8310         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8311         tests/other-tests/translit.test, tests/other-tests/undivert.test,
8312         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8313         tests/other-tests/wrap.test:  New tests based on the contents
8314         of the tests removed below.
8315         * examples/Makefile.am, modules/Makefile.am:  Updated to
8316         reflect removed tests.
8317         * examples/defs,modules/defs: Removed.
8318         * examples/capitalize.test, examples/comments.test,
8319         examples/ddivert.test, examples/debug.test,
8320         examples/esyscmd.test, examples/exp.test,
8321         examples/foreach.test, examples/forloop.test,
8322         examples/fstab.test, examples/hanoi.test,
8323         examples/include.test, examples/indir.test,
8324         examples/misc.test, examples/multiquotes.test,
8325         examples/patsubst.test, examples/pushpop.test,
8326         examples/regexp.test, examples/reverse.test,
8327         examples/sysv-args.test, examples/trace.test,
8328         examples/translit.test, examples/undivert.test,
8329         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
8330         modules/modpath1.test, modules/modpath2.test,
8331         modules/modpath3.test, modules/modpath4.test,
8332         modules/modtest.test, modules/shadow.test,
8333         modules/unfrozen.m4, modules/unload.test: Removed.
8335         Move the implementation of GMP support for the mpeval() builtin
8336         into a loadable module that depends on libgmp.  mpeval() and
8337         eval() share a common parser, now in m4/evalparser.c; the code
8338         in m4/numb.c and m4/numb.h is now physically split between
8339         m4/eval.c (the eval() backend) and modules/mpeval.c (the
8340         mpeval() backend), rather than being differentiated by cpp
8341         macros and multiple inclusion.  The mpeval module is always
8342         built but will generate an diagnostic if it is used from an
8343         installation that didn't link in the gmp library.
8344         * modules/Makefile.am: build and install the new mpeval module.
8345         * modules/mpeval.c: Now contains the former parts of m4/numb.c
8346         and m4/numb.h that are required for gmp support in mpeval().
8347         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8348         * m4/evalmp.c:  Removed.
8349         * m4/m4module.h: Removed conditional prototype for
8350         m4_mp_evaluate().
8351         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
8352         and m4/numb.h that do not rely on gmp.
8353         * m4/evalparse.c:  New file, contains the shared parts of the
8354         eval() and evalmp() parser implementations, and is no longer
8355         unencumbered by cpp magic to uncover the right parts.
8356         * m4/numb.h:  Removed.  It's former contents are split between
8357         m4/eval.c and modules/mpeval.c.
8358         * m4/numb.c: ditto.
8360         * tests/other-tests/changeword.test: New test.  Rudimentary
8361         testing of changeword builtin runs only if --wnable-changeword
8362         was used at configure time.
8363         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8364         alternation correctly.  Split into two expressions to compensate.
8365         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
8366         * modules/Makefile.am: Build changeword module.
8367         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
8368         only when --enable-changeword was passed to configure.
8369         (builtin_changeword): If --enable-changeword was not used, then
8370         report that changeword() builtin has no support in m4 binary.
8372 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
8374         * src/main.c (main): Fixed a particularly nasty bug is
8375         user_search_path setting -- the -M flag processing must be
8376         extremely careful with search path ordering, or else the default
8377         installed module directory (possibly containing modules from a
8378         previous release) is placed earlier in the search path than any -M
8379         arguments (which are relied upon to load uninstalled modules with
8380         most of the tests in the regresion suite).
8382         * modules/load.c (builtin_load):  Nasty hack to prevent adding
8383         symbols to symtab again if a module is loaded more than once.
8384         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
8386         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
8387         possible NULL pointer dereference.
8389         * m4/module.c (m4_module_find_by_modname): Renamed from
8390         m4_module_modname_find.   Fixed all references.
8391         (m4_module_find_by_builtin):  New function.
8393         * modules/modfreeze.test: load the `load' module with each
8394         invocation.
8395         * src/freeze.c (produce_frozen_state): Simplified in light of
8396         module field in m4_symbol.  Allow a third argument for text macros
8397         to name the originating module.
8398         (reload_frozen_state): ditto.
8399         * m4/m4module.h:  Fixup prototypes.
8400         * m4/builtin.h (m4_builtin_define): Add a module argument so
8401         that symbols can be registered against the defining module.
8402         (m4_macro_define): ditto.
8403         * m4/m4private.h (m4_symbol): Make the module field const to save
8404         on casting in the rest of the code.
8405         (SYMBOL_MODULE): New macro.
8407         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
8408         symbol reference maintenance bugs when removing a symbol from the
8409         symtab.
8411         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
8413 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
8415         * configure.in (m4_cv_func_obstack): A better check for whether
8416         libc has an obstack implementation.
8417         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
8419         * configure.in (--with-modules): Changed semantics.  This
8420         option is now used to list modules to be preopened.
8421         * src/m4.h: #include "ltdl.h" unconditionally.
8422         * src/main.c: Removed all dependencies on WITH_MODULES.
8423         * src/freeze.c: ditto.
8424         * modules/Makefile.am: ditto.
8425         * m4/m4.c (builtin_m4exit): ditto.
8426         * modules/modpath1.test: ditto.
8427         * modules/modpath2.test: ditto.
8428         * modules/modpath3.test: ditto.
8429         * modules/modpath4.test: ditto.
8430         * modules/modtest.test: ditto.
8431         * modules/shadow.test: ditto.
8432         * modules/unload.test: ditto.
8434         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
8435         comes up on demand in LTLIBOBJS now.
8436         * configure.in (getopt_long):  Creating and relying on a link for
8437         getopt.h on hosts with no getopt_long() of thier own works
8438         correctly now.  This is necessary so that callers of getopt_long()
8439         can simply `#include <getopt.h>': the naive way of doing this
8440         would end up using our own getopt.h and the installed
8441         getopt_long(), which is asking for trouble!
8442         (obstack_init): A similar argument applies to obstack.h and
8443         obstack_init().
8445         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
8446         On Solaris-2.5 (at least) the native dlopen implementation
8447         gets confused about m4.o when looking for module "m4".  This
8448         version always looks for .la an .$lib_ext suffixed names first
8449         to work around the problem.  Sigh.
8451         * po/POTFILES.in: Take account of these file movements.
8452         * src/Makefile.am (m4_SOURCES): removed eval.c.
8453         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
8454         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
8455         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
8456         * modules/m4.c (builtin_eval): Use m4_evaluate().
8457         * m4/eval.c: Moved here from src/eval.c to facilitate
8458         implementation of eval() builtin as part of the `m4' loadable
8459         module.
8460         (m4_evaluate): renamed from evaluate for namespace cleanliness.
8461         * m4/numb.c: Moved here from src/numb.c, since it is #included
8462         into eval.c at compile time.
8463         * m4/m4module.h (m4_evaluate): Added prototype.
8464         * src/m4.h (evaluate): Removed prototype.
8466 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
8468         * modules/perl.c (builtin_perleval):  Use PL_na for
8469         compatibility with perl-5.6.
8471         * src/main.c (main):  It is now safe to
8472         ``m4_module_install("m4")'', without tripping over the m4
8473         binary itself!
8474         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
8475         versions having fixed the insidious module search order bug.
8477         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
8478         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
8480         * configure.in: Figure out whether to use the installed
8481         getopt.h or the supplied one.
8482         * src/Makefile.am: ditto.
8484         * po/POTFILES.in: List files in their new positions.
8486         * config/ltmain.sh:  This needs to be checked in to match the
8487         libtool macros copied to acinclude.m4 (until a released
8488         libtool copes with m4's needs).
8489         * bootstrap:  Run gettextize.
8491 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
8493         * AUTHORS:  Added my details.
8494         * TODO: updated.
8495         * NEWS: updated.
8496         * bootstrap: temporary update until released libtool catches up.
8498         * All files:  Use new GNU GPL copyright blurb with current contact
8499         address.
8501         * configure.in (LTLIBOBJS): Use canonical code for calculation of
8502         this variable.
8504         * config: renamed acm4 directory to config to be more like
8505         other autoconfiscated packages.
8507         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
8508         * config/debug.m4:  New file implementing configure macros to add
8509         suitable debug flags to the compiler invocation.
8511         * modules/load.c:  New file implementing the ``load'' and
8512         ``unload'' builtins.
8513         * tests/get-them:  Set the module search directory to the modules
8514         build directory in generated tests.
8515         * modules/shadow.test: ditto.
8516         * modules/modtest.test: ditto.
8517         * modules/modpath1.test: ditto.
8518         * modules/modpath2.test: ditto.
8519         * modules/modpath3.test: ditto.
8520         * modules/modpath4.test: ditto.
8521         * modules/modtest.test: ditto.
8522         * modules/modfreeze.test: ditto.
8523         * modules/unload.test: ditto.
8525         * modules/changeword.c:  New file implementing the ``changeword''
8526         builtin as a loadable module.
8527         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
8528         as a loadable module.
8530         * src/main.c (main):  Load the gnu module if m4 was started
8531         normally -- i.e. without the -G option.
8532         * modules/gnu.c:  New file implementing a new loadable module wuth
8533         definitions for all the gnu extension builtins.
8534         * modules/format.c:  Moved here from src/format.c.  Now included
8535         directly by gnu.c.
8537         * src/main.c (main):  Load the traditional module if m4 was
8538         started in `no_gnu_extensions' mode.
8539         * modules/traditional.c:  New file implementing the ``unix'' macro,
8540         required when m4 is executed in traditional mode, as a loadable
8541         module.
8543         * src/main.c:  Renamed from m4.c to avoid confusion with
8544         modules/m4.c.
8545         (main):  Always load the m4 module.
8546         * modules/m4.c:  New file implementing a new loadable module with
8547         definitions for all m4 builtins that are not gnu extensions.
8549         * m4/Makefile.am:  Adjusted to take new files below into account.
8550         * m4/m4module.h: Prototypes for exported functions and types moved
8551         to this directory from the src directory.
8552         * m4/m4private.h: Moved here from src/m4private.h to facilitate
8553         the migration of all builtin implementations to loadable modules.
8554         * m4/macro.c: Moved this file here from the src directory,
8555         renaming all exported symbols to use the prefix ``m4_''.
8556         * m4/builtin.c: ditto.
8557         * m4/module.c: ditto.
8558         * m4/symtab.c: ditto.
8559         * m4/debug.c: ditto.
8560         * m4/input.c: ditto.
8561         * m4/output.c: ditto.
8562         * m4/path.c: ditto.
8563         * m4/ltdl.h, m4/ltdl.c: ditto.
8564         * m4/utility.c: Odd functions moved here from files in the src
8565         directory to facilitate builtin migration.
8567 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
8569         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
8570         error message, to make translators' jobs a little easier.
8571         (builtin_builtin): ditto.
8572         (builtin_traceon): ditto.
8573         (builtin_traceoff): ditto.
8574         Reported by Akim Demaille <akim@epita.fr>
8576         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
8577         pkgincludedir instead.
8579         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
8580         it is exported globally.  Fixed all references.
8581         (lquote): ditto.
8582         (bcomm): ditto.
8583         (ecomm): ditto.
8584         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
8585         globally.  Fixed all references.
8586         (DEF_LQUOTE): ditto.
8587         (DEF_BCOMM): ditto.
8588         (DEF_ECOMM): ditto.
8590 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
8592         * NEWS: updated.
8593         * TODO: updated.
8595         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
8596         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
8598         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
8599         Removed `Prev', `Next' and `Up' fields of all @nodes now that
8600         makeinfo calculates them for us, and to make any future
8601         reorganisation easier.
8602         (Frozen files): Document format version 2.
8603         `V' now takes argument `2'.
8604         `F' can take a single argument if symbol and builtin names
8605         are the same, or 3 arguments if the builtin is from a module.
8606         New `S' specification for saving syntax table contents.
8607         New `M' specification for saving loaded module names.
8608         * src/freeze.c: Implement them.
8609         * src/input.c (syntax_code): For interpreting frozen syntax
8610         state.
8612         * examples/Makefile.am:  Add the contents of the WWW directory to
8613         the distribution.
8614         * examples/WWW/Makefile:  ditto,
8615         (%.htm): Compares file contents (not just sizes) to determine
8616         whether a change has occured.
8617         * examples/WWW/_header.htm: Bumped version number.
8618         * examples/WWW: Regenerated content.
8620         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
8621         compilers comes much easier without ansi2knr.
8622         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
8624         * m4/list.c: New generic list container type.
8625         * m4/list.h: Interface to new container type.
8626         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
8627         (libm4_la_SOURCES): compile and link list.c.
8628         * src/builtin.c (builtin_tables): Use list container.
8629         * src/module.c (symtab): ditto.
8630         * src/symtab.c (symtab): ditto.
8632         * m4/system.h: New file for common preprocessor definitions.
8633         * m4/Makefile.am (pkginc_HEADERS): install system.h.
8634         * m4/error.c: Use system.h in place of inline preprocessor.
8635         * m4/error.h: ditto.
8636         * m4/module.c: ditto.
8637         * m4/module.h: ditto.
8638         * m4/xmalloc.c: ditto.
8640         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
8641         compatibility.
8642         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
8644         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
8645         it is exported globally.  Fixed all references.
8646         (builtin): ditto.
8647         (module_init_t): ditto.
8648         (module_finish_t): ditto.
8649         (token_data): ditto.
8650         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
8651         it is exported globally.  Fixed all references.
8652         (SYNTAX_IGNORE): ditto.
8653         (SYNTAX_SPACE): ditto.
8654         (SYNTAX_OPEN): ditto.
8655         (SYNTAX_CLOSE): ditto.
8656         (SYNTAX_COMMA): ditto.
8657         (SYNTAX_DOLLAR): ditto.
8658         (SYNTAX_ACTIVE): ditto.
8659         (SYNTAX_ESCAPE): ditto.
8660         (SYNTAX_ALPHA): ditto.
8661         (SYNTAX_NUM): ditto.
8662         (SYNTAX_ALNUM): ditto.
8663         (SYNTAX_LQUOTE): ditto.
8664         (SYNTAX_RQUOTE): ditto.
8665         (SYNTAX_BCOMM): ditto.
8666         (SYNTAX_ECOMM): ditto.
8667         (SYNTAX_VALUE): ditto.
8668         (SYNTAX_MASKS): ditto.
8669         (IS_OTHER): ditto.
8670         (IS_IGNORE): ditto.
8671         (IS_SPACE): ditto.
8672         (IS_OPEN): ditto.
8673         (IS_CLOSE): ditto.
8674         (IS_COMMA): ditto.
8675         (IS_DOLLAR): ditto.
8676         (IS_ACTIVE): ditto.
8677         (IS_ESCAPE): ditto.
8678         (IS_ALPHA): ditto.
8679         (IS_NUM): ditto.
8680         (IS_ALNUM): ditto.
8681         (IS_LQUOTE): ditto.
8682         (IS_RQUOTE): ditto.
8683         (IS_BCOMM): ditto.
8684         (IS_ECOMM): ditto.
8685         (TOKEN_EOF): ditto.
8686         (TOKEN_NONE): ditto.
8687         (TOKEN_STRING): ditto.
8688         (TOKEN_SPACE): ditto.
8689         (TOKEN_WORD): ditto.
8690         (TOKEN_SIMPLE): ditto.
8691         (TOKEN_MACDEF): ditto.
8693         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
8694         consistency.  Fixed all references.
8695         (STRING): Renamed to `m4_string' for consistency, and because if
8696         is exported globally.  Fixed all references.
8697         (token_type): Renamed to `m4_token_t' for the same reasons.
8698         (token_data_type): Renamed to `m4_token_data_t' for the same
8699         reasons.
8701         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
8702         sizes.
8703         (XMALLOC): ditto.
8704         (XREALLOC): ditto.
8705         (XFREE): Wrapper macro which avoids freeing NULL pointers.
8707         * m4/m4module.h (m4_macro):  New type for module defined user
8708         macros.
8709         * modules/modtest.c (m4_macro_table):  Define module user macros.
8710         * modules/shadow.c (m4_macro_table):  ditto.
8712         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
8713         declared with M4BUILTIN.
8715         * m4/xmalloc.c: Use memset if bzero is not available when
8716         emulating calloc with malloc.
8717         (xcalloc): Fallback to malloc/bzero if calloc is not available.
8718         (xfree): Added for consistency.  Will not try to free NULL
8719         pointers.
8720         * src/m4.c (xfree):  Deleted in favour of the above.
8721         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
8722         linking with libdmalloc.
8723         * m4/xstrdup.c (WITH_DMALLOC): ditto.
8725         * modules/frozen.m4:  New test case.
8726         * modules/unfrozen.m4:  ditto.
8727         * modules/modfreeze.test:  New test.
8728         * modules/unload.test:  ditto.
8729         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
8730         (TESTS): Use them.
8731         * modules/modpath1.test:  Don't try this test if module support is
8732         not compiled in.
8733         * modules/modpath2.test: ditto.
8734         * modules/modpath3.test: ditto.
8735         * modules/modpath4.test: ditto.
8736         * modules/modtest.test: ditto.
8737         * modules/shadow.test: ditto.
8739         * modules/perl.c: New module.
8740         * modules/perl.m4: Example of using it.
8741         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
8743         * src/m4.c (main): Assume interactive mode if STDIN is connected
8744         to a tty.
8745         Changed startup sequence slightly so that syntax is not
8746         initialised from here when loading a frozen file.
8748         * src/builtin.c:  Much improved macro definition style.
8749         * src/m4private.h:  Internal structures for m4_builtin and
8750         m4_macro instances.  These are not exposed to module writers.
8751         * src/module.c (module_modname_find):  Find a module structure
8752         from the its name.
8753         (make_macro_table):  Build an internal macro table from a external
8754         definition.
8755         (make_builtin_table):  Build an internal builtin table from an
8756         external definition.
8758         * src/module.c (module_unload): Be extremely careful to remove
8759         builtins and macros that match the module being unloaded -- no
8760         longer assume that the top element can be removed incase another
8761         odule defines an identical name.
8762         * src/symtab.c (remove_table_reference_symbols): remove all symbol
8763         table entries which refer to a given builtin table.
8764         * src/builtin.c (remove_tables): Use it!
8766 2000-07-13  Thomas Tanner  <tanner@ffii.org>
8768         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
8769         * acm4/modules.m4: deleted
8770         * bootstrap: don't libtoolize libltdl!
8771         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
8772         if set, enable WITH_MODULES and add modules to DLPREOPEN
8773         * examples/misc.test: redirect standard output
8774         * lib/Makefile.am: don't use DLLDFLAGS
8775         * lib/m4module.c: include necessary headers to silence GCC -Wall
8776         * lib/m4regex.c: fixes to silence GCC -Wall
8777         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
8778           build modules conditionally
8779         * modules/shadow.c: define symbol aliases before using them
8780         * modules/test.c: define symbol aliases before using them
8781         * po/de.po: update translation
8782         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
8783         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
8784         LIBLTDL to LIBS.
8785         * src/m4.c: initialize libltdl's preloaded symbols via
8786         LTDL_SET_PRELOADED_SYMBOLS
8787         * src/module.c: libltdl's memory management must be initialized
8788         before calling lt_dlinit!, fix warnings
8790 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
8792         * README:  Caveat about nls not supported by dll architecture on
8793         Windows.
8795         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
8797         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
8798         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
8799         * modules/Makefile.am (LIBS): ditto.
8800         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
8801         $(top_srcdir)/m4 (for only <m4module.h>).
8802         * modules/shadow.test: fixed for VPATH.
8803         * modules/modtest.test: ditto.
8804         * modules/modpath4.test: ditto.
8805         * modules/modpath3.test: ditto.
8806         * modules/modpath2.test: ditto.
8807         * modules/modpath1.test: ditto.
8809         * modules/time.test: Removed due to timezone dependence,
8810         * modules/Makefile.am (TESTS): Removed time.test.
8812         * configure.in: Use $3 of AC_DEFINE so that we can,,,
8813         * acconfig.h: Remove everything except the gettext parameters.
8814         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
8815         AC_DEFINE.
8816         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
8817         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
8818         increment serial number.
8820         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
8821         src dir and immediately after libm4 is built for confidence that
8822         it doesn't rely on the src directory.
8823         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
8824         makeinfo stop the build on cygwin (because they don't work).
8826         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
8828         * m4/m4private.h: ...is not a public header, so moved to src.
8829         Add `#include <config.h>', `#define _COMPILING_M4' and
8830         `#include "m4.h".
8831         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
8832         * src/Makefile.am (noinst_HEADERS): add m4private.h.
8833         * src/builtin.c: `#include "m4private.h"' now takes care of the
8834         above.  Duplicates removed.
8835         * src/debug.c: ditto.
8836         * src/eval.c: ditto.
8837         * src/evalmp.c: ditto.
8838         * src/format.c: ditto.
8839         * src/freeze.c: ditto.
8840         * src/input.c: ditto.
8841         * src/m4.c: ditto.
8842         * src/macro.c: ditto.
8843         * src/module.c: ditto.
8844         * src/numb.h: ditto.
8845         * src/output.c: ditto.
8846         * src/path.c: ditto.
8847         * stackovf.c: ditto.
8848         * symtab.c: ditto.
8850         * po/POTFILES.in: compensate for renaming of lib/*.
8851         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
8852         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
8853         and then in $(top_srcdir)/lib (for eg. "m4private.h").
8854         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
8855         m4/libm4.la.
8856         * m4/m4error.h:  Renamed error.h, for installation to
8857         $prefix/include/m4..
8858         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
8859         * m4/m4regex.h: Renamed regex.h, for same reason.
8860         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
8861         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
8862         * m4/m4regex.c: Renamed regex.c, and fix #includes.
8864         * lib: moved to m4 to easily support header installation to
8865         $prefix/include/m4.
8866         * Makefile.am (SUBDIRS): renamed lib dir to m4.
8867         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
8868         * acm4/regex.m4: Point to m4/regex.c.
8870         * examples/foreach.m4:  Sanitise quoting.
8871         * examples/foreach.test:  New torture test.
8872         From Akim Demaille <akim@epita.fr>
8874 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
8876         * src/ltdl.c: Use access() to abort doomed module load attempts
8877         if module file does not exist.
8879         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
8880         getopt1.o will already be used if appropriate, so I moved getopt.c
8881         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
8883         * modules/modpath1.test: Use correct filename in header line.
8884         * modules/modpath2.test: ditto.
8885         * modules/modpath3.test: ditto.
8886         * modules/modpath4.test: ditto.
8888         Without these changes lt_dlopen("test") attempts to
8889         LoadLibrary("/bin/test") on Windows, which although harmless
8890         generates a spurious error message which spoils most of the tests:
8891         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
8892         (TESTS): s/test.test /modtest.test /
8893         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
8894         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
8895         * modules/modpath1.test: s/test.m4 /modtest.m4 /
8896         * modules/modpath2.test: ditto.
8897         * modules/modpath4.test: ditto.
8898         * modules/modpath3.test: s/-m test /-m modtest /
8899         * modules/shadow.m4: use {un,}loadmodule(`modtest').
8901 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
8903         * src/ltdl.c (find_file): Updated to new version with fixed memory
8904         allocation bug in `next'.
8905         * src/ltdl.h: updated to match.
8907         * modules/Makefile.am:  Cleaned up and reordered.
8909 2000-01-16  René Seindal  <rene@seindal.dk>
8911         * modules/Makefile.am (TESTS): New tests for the module system.
8913         * modules/*.test: New files.
8915         * src/m4.c (main): Added call to module_init().
8916         Treats -M and -m as the arguments -D -U and -t, ie deferred.
8918         * src/m4.h: Added declaration of module_init().
8920         * src/module.c (module_init): No longer static
8922         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
8923         Added to shut up automake about non standard libtool library
8924         names.
8926         * src/module.c: Disabled DEBUG by default.
8928         * modules/README: Changed example from unload.m4 to shadow.m4
8930         * modules/shadow.m4: Renamed from unload.m4
8932         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
8934         * src/m4.c (main): Functionality for -m and -M were reversed.
8935         Fixed.
8937 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
8939         * doc/help2man.pl: updated to version 1.020.
8941         * lib/COPYING.LIB:  updated to version 2.1.
8943         * lib/m4module.h: restructure the M4_SCOPE code to work when
8944         creating a dll which links with libm4.la and both DLL_EXPORT
8945         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
8946         both defined.
8948 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
8950         Merged the following changes from my tree:
8952         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
8954         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
8955         ported to compile shared libs.
8957         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
8958         use `__declspec(dllimport)' when linking libm4.la on win32.
8959         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
8961         * configure.in (M4OBJS): Discover whether we need the shipped
8962         implementation of getopt_long.
8963         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
8964         main binary here, as opposed to the module library in lib/libm4.la.
8966         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
8968         * modules/README: Updated to describe the improved libltdl based
8969         module scheme.
8970         * README (cygwin): Added some compilation notes for building m4
8971         correctly under cygwin.
8972         * TODO: Cleaned out the entries for the module system since they
8973         are now implemented.
8975         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
8976         all instances of __P with M4_PARAMS.
8978         * lib/getdate.h: removed unreferenced file.
8980         * lib/m4private.h: New file to define the private interface to the
8981         token_data struct, which must be shared between m4module.c, and
8982         builtin.c but not exported to modules built from the installed
8983         m4module.h since it's size changes depending on compile time
8984         options.
8986         * src/m4.h: Lots of stuff moved to lib/m4module.h.
8988         * lib/m4module.h: New file to define the interface available when
8989         compiling m4 modules.
8990         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
8991         necessary for module compilation into this new file.
8993         * lib/Makefile.am (include_HEADERS): install headers (renamed to
8994         avoid nameclash with other system headers) necessary for compiling
8995         modules.
8996         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
8997         so that modules can include the (renamed) installed headers and
8998         be guaranteed a matching implementation.
8999         * lib/m4error.h: renamed from error.h.
9000         * lib/m4obstack.h: renamed from obstack.h.
9001         * lib/m4regex.h: renamed from regex.h.
9002         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
9003         implementation, simply include the shipped version
9004         unconditionally, otherwise it is hard for a module to know
9005         whether the m4obstack.h header it is using matches the
9006         implementation it ends up linking against.
9007         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
9008         the same reason.
9010         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
9012         * examples/misc.test: Don't run this test on machines which don't
9013         have a root user in /etc/passwd (e.g. cygwin).
9015         * tests/get-them (/^@example$/): Error messages might have a
9016         ``.exe'' suffix to the program name, or else use the libtool
9017         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
9018         of these cases are now catered for when comparing error messages
9019         in generated tests.
9020         * tests/other-tests/*.test: ditto.
9021         * examples/*.test: ditto.
9023         * tests/defs (M4): use libtool execute mode.
9024         * examples/defs (M4): ditto.
9026         * tests/get-them (END): explicitly close any open file.
9027         (printthem): In a regular expression, '{' is the start of a repeat
9028         count!  Use `[{]' for a literal open brace.
9029         (/^@node /): Don't use substr on a string shorter than the trim
9030         length.
9032         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
9034         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9035         substituted.
9036         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9038 2000-01-10  Andreas Schwab  <schwab@suse.de>
9040         * tests/other-tests/gmp.test: Find config.sh in build directory.
9042         * configure.in: Find tests/mkconfig.sh in $srcdir.
9044         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9045         <signal.h> (for SUS2 compliant systems).
9047         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
9048         HAVE_SIGINFO_H.
9050 2000-01-10  René Seindal  <rene@seindal.dk>
9052         * Prerelease 1.4o.
9054         * TODO, NEWS: Cleaned up and updated.
9056         * src/m4.c (main): New variable exit_status for exit status in
9057         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
9058         file cannot be read instead of EXIT_SUCCESS.
9060         * src/builtin.c (m4_indir): Changed error message to help
9061         translators (from Akim Demaille <demaille@inf.enst.fr>).
9063         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
9064         Cygnus.
9066         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
9067         from glic 2.1.2.
9069         * src/input.c (match_input): Reordering of code, to avoid multiple
9070         calls to push_string_init() from obstack_grow(), which can happen
9071         with some compilers (found and fixed by James Bonfield
9072         <jkb@mrc-lmb.cam.ac.uk>).
9074         * src/stackovf.c: Added prototypes for ultrix.
9075         (setup_stackovf_trap): Added __P to cast.
9076         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
9078 2000-01-09  René Seindal  <rene@seindal.dk>
9080         * doc/m4.texinfo (Changequote): Added comment about changing
9081         quotes when the old quote is a part of the new.
9083         * src/builtin.c (expand_ranges): Added break after trailing dash.
9084         This caused misbehavious on some systems (found and fixed by Akim
9085         Demaille <demaille@inf.enst.fr>).
9087         * AUTHORS: Thomas Tanner included
9089         * acconfig.h: Added entry for ss_sp (see below).
9091         * configure.in (use_stackovf): Added check for stack_t with member
9092         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
9093         <eggert@twinsun.com>).
9095         * doc/m4.texinfo (Frozen files): Added a simpler example for
9096         generating frozen files from several input files.
9098 1999-11-14  Paul Eggert  <eggert@twinsun.com>
9100         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
9101         lib/regex.c, lib/xmalloc.c.
9103 1999-11-10  René Seindal  <rene@seindal.dk>
9105         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
9107         * src/module.c: reindented.
9108         (module_load): return if this is a repeated load of same module.
9109         (module_init): slight change of logic to avoid repeated
9110         initialisation debug messages.
9112         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
9113         in the distribution.
9115         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
9116         automake warnings about missing lib prefix.
9117         (time_la_LDFLAGS): ditto
9118         (stdlib_la_LDFLAGS): ditto
9120 1999-11-10  Paul Eggert  <eggert@twinsun.com>
9122         * src/m4.h: Include error.h, since our macros use error.
9123         * src/m4.c: Don't need to include error.h.
9125 1999-11-09  Paul Eggert  <eggert@twinsun.com>
9127         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
9128         and zero, as Solaris 7 cc does.
9129         (bcopy): Remove macro; no longer needed with new obstack.h.
9131         * src/output.c (freeze_diversions): Don't assume that a
9132         diversion size can fit in `int'.  Check for diversion file
9133         size too large to be printed with `unsigned long'.
9135         * src/Makefile.am (CFLAGS): Omit -Wall.
9137         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
9139         * src/debug.c (trace_format):
9140         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
9142         * src/freeze.c (produce_frozen_state):
9143         Don't assume string lengths fit in int.
9145 1999-10-13  René Seindal  <rene@seindal.dk>
9147         * po/cs.po: Czech translation added.
9149         * po/sv.po: Updated Swedish translation.
9151         * po/ru.po: Updated Russian translation.
9153         * po/pl.po: Updated Polish translation.
9155         * po/el.po: Greek translation added.
9157 1999-10-13  René Seindal  <rene@seindal.dk>
9159         * configure.in (ALL_LINGUAS): Added Greek translation (el).
9160         (ALL_LINGUAS): Added Czech translation (cs).
9162 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
9164         * src/builtin.c: moved module loading functions into...
9165         * src/module.c: entirely new implementation using libltdl.
9166         * po/POTFILES.in: added src/module.c.
9167         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
9168         are modules, not linktime libraries.
9169         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
9170         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
9171         avoidance on exported symbols.
9172         * modules/test.c (m4_macro_table, m4_init_module,
9173         m4_finish_module): ditto.
9174         * modules/time.c (m4_macro_table): ditto.
9176         * modules/time2.m4: new file which requires command line loading
9177         of modules.
9178         * src/m4.c (--load-module): dynamically load named runtime module
9179         into running executable before reading the source.
9180         (--module-directory): prepend a directory to the module search
9181         path.
9182         (module_init()): Do this the first time we load a module instead;
9183         if the module subsystem is broken normal m4 scripts can still run.
9184         * src/m4.h (install_builtin_table): is now exported.
9186 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
9188         * src/module.c: removed.  No longer required.
9189         * po/POTFILES.in: removed src/module.c.
9191         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
9192         the bootstrap script can recreate.
9193         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
9194         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
9195         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
9196         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
9197         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
9198         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
9199         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
9200         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
9202         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
9203         better.
9204         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
9205         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
9206         the installed gettext.m4 file when running aclocal.
9208 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
9210         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
9211         distinguish this from the last prerelease.
9212         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
9213         in its own subdirectory.
9215         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
9216         lib prefix on a module" feature.
9217         (LDFLAGS): Added `-module -avoid-version' flags to build
9218         versionless module libraries.
9219         * src/builtin.c (m4_load_module): use libltdl.
9220         (module_unload_all): use libltdl.
9221         * src/m4.c (module_init): initialise module loading on demand for
9222         better diagnostics, and so that m4 will still work even if
9223         the module code is broken.
9224         * src/m4.h (module_init): removed.  No longer relevant.
9225         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
9226         exported symbols for compatibility with dlpreopening.
9227         * modules/test.c (m4_macro_table, m4_init_module,
9228         m4_finish_module): ditto.
9229         * modules/time.c (m4_macro_table): ditto.
9231         * bootstrap: New file.  Runs all the autoutils in the right order
9232         after a fresh checkout, or a make maintainer-clean.
9234 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
9236         * src/builtin.c (dump_symbols): New function, factoring common
9237         content of m4_dumpdef and m4_symbols.
9238         (m4_dumpdef): Use it.
9239         (m4_symbols): New function, implementing `symbols'.  Use it.
9240         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
9241         file compile with modern makeinfo.
9242         (Symbols): New node, documenting symbols.
9243         (direntry): Modernize.
9245 1998-12-11  René Seindal  <rene@seindal.dk>
9247         * src/builtin.c (predefined_tab): New predefined macros
9248         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
9249         configure time options.
9251 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
9253         * src/module.c (module_try_load): Don't try to be clever and
9254         overwrite argument string.  Instead allocate all constructed
9255         strings locally, since they can have arbitrary lengths.  Make
9256         arguments pointers to const.
9257         (module_search): Simplify due to above change.
9259 1998-11-29  René Seindal  <rene@seindal.dk>
9261         * Prerelease 1.4n.
9263         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
9265         * tests/other-tests/import-environment.{m4,test}: New test.
9267         * tests/other-tests/discard-comments.{m4,test}: New test.
9269         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
9271         * src/m4.c (main): New option -c --discard-comments.
9272         New global variable discard_comments.
9274         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
9275         discarded, ie never returned from next_token().
9276         Added declaration of discard_comments.
9278         * src/input.c (next_token): Now loops until token type is not
9279         TOKEN_NONE.  Comments are now given this type when comments should
9280         be discarded.
9282         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
9283         and mpeval.
9285 1998-11-28  René Seindal  <rene@seindal.dk>
9287         * src/m4.c (main): New option --import-environment (no single
9288         letter option).
9290         * When configured with --with-gmp both the normal (fast) eval()
9291         and the gmp aware mpeval() are defined.  To restore previous
9292         bahaviour use "define(`eval', defn(`mpeval'))".
9294         * tests/other-tests/gmp.m4: Changed to use mpeval().
9296         * src/evalmp.c: New file for compiling eval.c as gmp aware.
9297         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
9299         * src/eval.c: Now includes "numb.c" directly.  Everything in this
9300         file must by static, except evaluate(), which is changed to
9301         mp_evaluate() if USE_GMP in force.
9303         * src/numb.c: Changed to be included by eval.c instead of being
9304         compiled separately.  Everything is declared static.
9306         * src/numb.h: Removed declarations of functions, as numb.c is now
9307         included by eval.c.
9309         * src/builtin.c: Declaration of m4_mpeval() added.
9310         Inserted `mpeval' in builtin table.
9311         (do_eval): New function with common code for m4_eval and m4_mpeval.
9312         (m4_mpeval): New function for gmp version of eval.
9314         * src/m4.h: Declaration of mp_evaluate().
9316         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
9317         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
9319         * src/m4.c (main): m4 --version also shows which options were used
9320         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
9322 1998-11-27  René Seindal  <rene@seindal.dk>
9324         * Error messages now always print program name before input file
9325         name as specified by GNU coding standards.  Reported by Akim
9326         Demaille <demaille@inf.enst.fr>.
9328         * doc/m4.texinfo (Include): Change due to changed error message
9329         format.
9330         (Eval): Do.
9332         * tests/get-them: Minor change to sed script due to changed error
9333         message format.
9335         * src/m4.c (print_program_name): New func used to print program
9336         name, input file and line number in error ().  Used as an
9337         error_print_progname handler.
9338         (reference_error): Removed.
9339         (main): Assigns error_print_progname.
9341         * src/m4.h (M4ERROR): Removed reference_error ().
9343 1998-11-25  René Seindal  <rene@seindal.dk>
9345         * Updated to libtool 1.2b.
9347         * src/builtin.c (install_builtin_table): Added braces to avoid
9348         warning of ambiguous 'else'.
9350         * src/module.c: Inserted search path code from path.c modified to
9351         use new interface.
9352         (module_init): Configured default path used only if M4MODPATH is
9353         not set.
9354         (module_try_load): Now reads libMODULE.la as generated by libtool
9355         for actual module name.
9356         (module_load): Gives better error messages on failure.
9358         * src/m4.h: Added declarations of structures and functions for
9359         generic search path handling.
9361         * src/path.c: Removed all module specific code and introduced new
9362         functions of more generic search path handling.
9364 1998-11-24  René Seindal  <rene@seindal.dk>
9366         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
9367         included gettext, as <libintl.h> might not be found
9368         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
9370 1998-11-22  René Seindal  <rene@seindal.dk>
9372         * src/output.c (insert_diversion): Fixed bug that might cause m4
9373         to read from standard output!  Triggered by input
9374         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
9375         so now 'undivert(0)' does nothing.
9377 1998-11-18  René Seindal  <rene@seindal.dk>
9379         * Prerelease 1.4m.
9381         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
9382         could be changed when compiling a illegal regexp, causing later
9383         use of the regexp to dump core.
9385         * src/module.c (module_load): Changed error message to conform to
9386         standards.
9388         * src/m4.c (usage): Added message about reporting bugs.
9390         * doc/m4.texinfo (Changeword): Corrected a wrong example.
9391         (Changeword): Added note about the type of regexps used.
9393         * ltconfig, ltmain.sh: New files from Libtool 1.2.
9395         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
9396         and AM_PROG_LIBTOOL.
9398         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
9399         with libtool.
9401         * modules/Makefile.am: Changed completely to compile modules using
9402         libtool.  The modules are compiled as shared libraries, and are
9403         renamed when installed.
9405         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
9406         USE_SHL_LOAD to HAVE_SHL_LOAD
9408         * src/builtin.c (shipout_string): Now tests for a NULL string.
9410         * src/module.c: New level of indirection around non-portable
9411         functions to load shared objects.  Intended to encapsulate the non
9412         portable parts better and to reduce the number of #ifdefs in the
9413         code.
9415         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
9416         directory modules/ to the distribution.
9418 1998-11-15  René Seindal  <rene@seindal.dk>
9420         * Prerelease 1.4l.
9422         * modules/stdlib.c: New module `stdlib' defining some standard
9423         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
9424         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
9426         * src/builtin.c (shipout_string): New convenience function for
9427         builtins and modules.
9429         * src/module.c (module_load): Tentative support for
9430         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
9432         * Makefile.am (SUBDIRS): Directory modules added if configured.
9434         * modules/Makefile.am: Now correctly compiles and installs
9435         modules in pkglibexecdir.
9437         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
9438         These two are now initialised by autoconf macros.
9440         * src/path.c (module_env_init): MODULE_PATH is always on the
9441         search path.
9443         * src/Makefile.am: Now generated pathconf.h which defined the
9444         default MODULE_PATH.
9446         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
9447         where modules are installed.
9449         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
9450         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
9451         build and install automatically, and it is prepared for other
9452         interfacec than dlopen().
9454         * src/builtin.c (predefined_tab): Added __m4_version__ for the
9455         current version of GNU m4.  It is a GNU extension.
9457 1998-11-14  René Seindal  <rene@seindal.dk>
9459         * tests/Makefile.am (GENERATED_TESTS): Added new
9460         generated-tests/changesy.8.test
9462         * doc/m4.texinfo (Changesyntax): Documentation for escape
9463         syntax class.
9465         * src/macro.c (expand_token): Check for escaped macro call before
9466         symbol table lookup.
9468         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
9469         characters
9471         * src/input.c: New static variable use_macro_escape, which is TRUE
9472         iff some character has code SYNTAX_ESCAPE
9473         (input_init): Added initialisation of use_macro_escape.
9474         (check_use_macro_escape): New function to synchronise
9475         use_macro_escape with the syntax table.
9476         (set_quotes): Added call to check_use_macro_escape()
9477         (set_comment): Do.
9478         (set_syntax): Do.
9479         (next_token): Added new case for IS_ESCAPE.
9481         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
9483 1998-10-13  René Seindal  <rene@seindal.dk>
9485         * Prerelease 1.4k.
9487         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
9488         generated-tests.
9490         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
9491         maintained tests in tests/other-tests.  These currently tests for
9492         8-bit transparency, multiple precision arithmetic and sync-line
9493         output.  Test for stackoverflow detection does not work.
9495         * examples/Makefile.am (TESTS): Added tests for all example files.
9497         * examples/mktests.sh: New file.  Help program for creating test
9498         files.
9500         * tests/mkconfig.sh: New file to generate tests/config.m4 and
9501         tests/config.sh.  This is for tests of configure selectable
9502         features.  Picks up all set WITH_ and ENABLE_ veriables from
9503         config.h
9505         * src/path.c (path_search): Added argument 'char **expanded_name'
9506         to return the expanded name.
9508         * src/m4.h: Added 2nd argument to declaration of path_search().
9510         * src/m4.c (main): Added 2nd argument to path_search().
9512         * src/freeze.c (reload_frozen_state): Do.
9514         * src/builtin.c (m4_undivert): Do.
9515         (include): Do.
9517 1998-10-11  René Seindal  <rene@seindal.dk>
9519         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
9521         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
9523         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
9525         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
9527         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
9529         * intl/: Updated to GNU gettext 0.10.35.
9531         * doc/m4.texinfo (Format): Documented that format is blind.
9533         * src/builtin.c (builtin_tab): Builtin format marked as blind.
9535 1998-10-07  René Seindal  <rene@seindal.dk>
9537         * Prerelease 1.4j.
9539         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
9540         .test, as the files are no longer just m4 input.
9542         * tests/get-them (FILE): Changed .m4 extension to .test.
9544         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
9545         Otherwise quoted strings with leading whitespace first in a macro
9546         argument would be eliminated.
9548         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
9549         (expand_argument): Do.
9551         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
9552         grouped together iff both quote and comment strings are single
9553         character.  Otherwise they might include a comment/quote leader.
9554         (next_token): Returns new token type TOKEN_SPACE.
9556         * src/builtin.c (push_builtin_table): New function to push a
9557         builtin_table on the stack without installing its contents.
9558         (find_builtin_by_name): Added call to push_builtin_table() if
9559         reading frozen files.  Otherwise the builtins named in the frozen
9560         files could not be found.
9561         (install_builtin_table): Changed to use push_builtin_table()
9563 1998-10-04  René Seindal  <rene@seindal.dk>
9565         * po/pl.po: Polish translation added.
9567         * po/POTFILES.in: src/module.c added.
9569 1998-10-04  René Seindal  <rene@seindal.dk>
9571         * Prerelease 1.4i.
9573         * configure.in (ALL_LINGUAS): Added Polish pl.po
9575 1998-10-03  René Seindal  <rene@seindal.dk>
9577         * Many files: Incorporated changes to implement dynamic modules.
9578         Detailed comments in src/modules.c and modules/README
9580         * src/module.c: New file, implements the OS dependant parts of
9581         dynamic module loading.
9583         * src/Makefile.am (m4_SOURCES): Added module.c
9585         * src/builtin.h: New file, declares some functions from builtin.c
9586         that are of use for other modules (shipout_int, numeric_arg,
9587         skip_space, bad_argc), and the macros ARG() and DECLARE().
9589         * src/builtin.c (install_builtin_table): New function.  Each
9590         module brings in a builtin_table, which is pushed on a stack.
9591         (struct builtin_table): New struct for list of builtin_tables.
9592         (m4_loadmodule): New function to implement builtin "loadmodule".
9593         (shipout_int): No longer static, to be used by modules.
9594         (numeric_arg): do.
9595         (skip_space): do.
9596         (bad_argc): do.
9597         (builtin_init): changed to call install_builtin_table()
9598         (find_builtin_by_name): Now searches all builtin_tables
9599         (find_builtin_by_addr): do.
9601         * src/path.c: Reorganised to allow for two search paths, one for
9602         include files and one for modules.
9604         * src/m4.h: Added declarations for new functions in module.c and
9605         in path.c.
9607         * src/m4.c (main): Added call to module_init().
9609         * modules: New directory with a few demo modules.
9611         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
9612         in SUBDIRS.
9614         * configure.in: Added modules/Makefile to AC_OUTPUT.
9616         * configure.in: Added code to implement --with-modules.  Tests for
9617         <dlfcn.h> and -ldl.
9619         * acconfig.h: Added WITH_MODULES
9621 1998-10-02  René Seindal  <rene@seindal.dk>
9623         * examples/Makefile.am (pkgdata_DATA): Removed special target for
9624         check and variables TESTS.  These tests are now run from the
9625         tests/ directory.
9627         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
9628         directory.  The files stay there but the tests are run from the
9629         tests/ directory.
9631         * tests/Makefile.am (EXTRA_DIST): Added run-test.
9633         * tests/run-test: New file.  Run a test manually
9635         * tests/Makefile.am, tests/get_them: Moved automatically generated
9636         tests (from the manual) to sub directory tests/gentest/.  The
9637         tests/ directory had gotten a bit messy.
9639 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9641         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
9642         wrap}.test: Added a few testcases.
9644 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9646         * Prerelease 1.4h.
9648         * lib/Makefile.am (noinst_HEADERS): regex.h added
9650         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
9651         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
9653         * acm4/Makefile.am: created providing rules to create
9654         $(top_srcdir)/acinclude.m4 to be used by aclocal.
9656         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
9657         `C'. Reported by Ulrich Drepper.
9659         * Makefile.am (SUBDIRS): Removed checks directory
9660         * configure.in (AC_OUTPUT): Removed checks/Makefile
9662         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
9663         the space when m4.texinfo is edited and whitespace.el is active.
9664         (Defn,example): idem.
9666 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9668         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
9669         ../COPYING. ../Makefile is a file which is certainly present when
9670         test is executed in testSubDir. One can't be sure that the COPYING
9671         file is in .. or ../.. in all situations, the ../Makefile is
9672         always there.
9674         * doc/m4.texinfo (Include): adjusted expected test output
9675         according to new tests, i.e. the input will always come from the
9676         file `in' created by the test.
9678         * tests/Makefile.am: Added three lines at the top to get
9679         esyscmd.1.test working.
9681         * tests/get-them: modified to generate clearer tests who will need
9682         less maintenance when new test examples are created in
9683         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
9684         need the generic file `defs') shell scripts creating `in', `ok',
9685         `out' and when apropriate `okerr' and `err' in the directory
9686         `testSubDir' when executed. The compare of `ok' and `out'
9687         (and of `okerr' and `err') will be the exit status of the test.
9688         `out' must match `ok' (and `okerr' must match `err') for the test
9689         to be succesful.
9691         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
9692         the tests generated by tests/get-them getting it input normally
9693         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
9694         (dot) before the numeric part) is reserved for all other (hand
9695         written) tests. The `+' means one or more times.
9697 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9699         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
9700         supported short man page to refer to info documentation
9701         * helptoman.pl: added
9702         * configure.in: AC_PATH_PROG(PERL,perl)
9703         * Makefile.am (SUBDIRS): doc after src
9705         * libitized with libit 0.5 from
9706         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
9708         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
9709         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
9710          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
9711         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
9712           lib/rx.{c,h}: added
9713         * configure.in (AC_CHECK_FUNC): getopt_long
9715         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
9717         * TODO: added entry about dependencies
9719 1998-08-10  René Seindal  <rene@seindal.dk>
9721         * Prerelease 1.4f
9723         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
9724         "changesyntax".
9726         * src/builtin.c (m4_changesyntax): Added builtin macro
9727         "changesyntax" to modify the syntax table.
9729         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
9730         table.  All categories are assigned a syntax code and tokens are
9731         read according to this table.
9733 1998-08-09  René Seindal  <rene@seindal.dk>
9735         * src/numb.{c,h}: New files, implements multiple precision eval
9736         using GNU gmp.  Originally submitted by John Gerard Makecki
9737         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
9739         * doc/m4.texinfo (Eval): Added documentation for multiple
9740         precision arithmetic library support.
9742         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
9743         to accommodate multiple precision eval.
9745 1998-08-07  René Seindal  <rene@seindal.dk>
9747         * src/input.c (MATCH, match_input), src/m4.h: changed definition
9748         of comment and quote strings to `unsigned int' to allow eight bit
9749         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
9751         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
9752         patch from Mike Howard <mike@clove.com>
9754 1998-08-06  René Seindal  <rene@seindal.dk>
9756         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
9757         -lintl.
9759 1998-08-03  René Seindal  <rene@seindal.dk>
9761         * Prerelease 1.4e
9763         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
9764         and _ macro.  M4 now builds with --disable-nls.
9766         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
9767         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
9769         * configure.in (ALL_LINGUAS): Added complete list of translations:
9770         de fr it ja nl ru sv.
9772 1998-05-23  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9774         * po/nl.po: Dutch translation by Erick Branderhorst.
9776         * po/fr.po: French translation by Erick Branderhorst, based on the
9777         translations by François Pinard in fr.msg and m4.cod.
9779 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9781         * Prerelease 1.4d.
9783         * src/m4.c: #include <signal.h> not <sys/signal.h>.
9785         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
9787         * checks/Makefile.am: explicit list tests in CHECKS.
9789         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
9790         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
9791         mkinstalldirs, install-sh: Added automake (1.3) support.
9793         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
9794         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
9795         Used libitize (0.4) to update.
9797         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
9798         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
9799         README accordingly.
9801         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
9802         stack overflow functionality.
9804 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
9806         * Prerelease 1.4.1.
9808         * Makefile.in (realclean-local): Delete stamp-h.in.
9810         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
9811         Localize, adapting from how it is done in sharutils.
9813         * fr.tt: New file, for French.
9815         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
9816         src/freeze.c: Rename PRODUCT to PACKAGE.
9818 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
9820         * configure.in: Check for <libintl.h> and <locale.h>.
9821         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
9822         src/stackovf.c: Rename _ to __P.
9823         * src/m4.h: Declare _ as a macro returning its argument, or else,
9824         include <libintl.h> and declare _ as gettext.
9825         * src/m4.c: Possibly include <locale.h> and call setlocale.
9826         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
9827         src/input.c, src/macro.c, src/output.c, src/path.c,
9828         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
9829         strings.
9831 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
9833         * doc/Makefile.in (stamp-vti): Use new -r option to date.
9835         * configure.in: Put --with-gmp in place, in prevision for John
9836         Gerard's work.
9837         * acconfig.h: Document WITH_GMP.
9839 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
9841         * Release 1.4.
9843         * doc/Makefile.in (realclean): Also remove stamp-vti.
9844         Reported by Eric Backus.
9846 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
9848         * src/freeze.c (produce_frozen_state): If the frozen file cannot
9849         be opened, return immediately after producing the error message.
9850         Reported by Andreas Schwab.
9852         * configure.in: Check for const only after having found possible
9853         ANSIfying compiler flags, this is of no use to check it before.
9854         Reported by Alexander Lehmann.
9856 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
9858         * src/macro.c (collect_arguments): Cast obstack arguments to
9859         (voidstar), so avoiding compiler warnings.
9860         Reported by Joseph E. Sacco.
9862         * src/freeze.c (produce_frozen_state): Cast printed lengths to
9863         (int) so they correspond to %d format items.
9864         Reported by Joseph E. Sacco.
9866         * src/m4.c (main): Cast the argument to xfree to (voidstar).
9867         * src/symtab.c (free_symbol): Idem.
9868         Reported by Karl Vogel.
9870 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
9872         * Makefile.in (DISTFILES): Distribute BACKLOG.
9874         * configure.in: Define PRODUCT and VERSION.
9875         * acconfig.h: Document PRODUCT and VERSION.
9876         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
9877         constant string m4 and variable or parameter named version.
9879 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
9881         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
9882         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
9883         defines __STDC__ to 0, for indicating it is *not* ANSI!
9884         Reported by Kaveh R. Ghazi.
9886         * configure.in: Added obsolescent tests for AIX and Minix.
9888         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
9889         which texclean does not exist anymore.
9890         Reported by Eric Backus, Jim Meyering, John David Anglin and
9891         Joseph E. Sacco.
9893 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
9895         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
9896         Reported by John David Anglin.
9898         * src/ansi2knr.c: New version, sent by Peter Deutsch.
9899         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
9900         ANSI2KNR, depending on the fact the compiler is ANSI or not.
9901         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
9902         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
9903         of $U, put underline in extensions rather than in basenames.  Use
9904         implicit rules, now that regularity makes this possible.
9905         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
9906         of ansi2knr whenever it is needed.
9907         * configure.in: Adjusted for correct STACKOVF substitution.
9908         * src/debug.c (trace_format): When not __STDC__, use (...) as a
9909         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
9910         Reported by David MacKenzie.
9912         * Makefile.in: Remove binprefix.  Use transform_name instead.
9913         Reported by David MacKenzie.
9915         * doc/Makefile.in: Create version.texi, use it, clean it.
9916         Reported by Jim Meyering.
9918 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
9920         * Makefile.in (all, install, uninstall): Depend on Makefile.
9922         * Makefile.in: For actions invoking $(MAKE) from within compound
9923         sh statements, exit non-zero if the sub-make fails.  Otherwise,
9924         the top-level make may exit successfully when it should fail.
9925         Reported by Jim Kingdon.
9927         * {,/*}Makefile.in: Use && after all cd, in case they fail.
9929         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
9930         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
9931         * configure.in: Substitute PRODUCT and VERSION.
9933         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
9935 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
9937         * Makefile.in (mostlyclean-local): Do not remove *~.
9938         * */Makefile.in (mostlyclean): Idem.
9939         Reported by Robert E. Brown and Richard Stallman.
9941 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
9943         * src/m4.h: Get rid of CONFIG_BROKETS.
9945 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
9947         * configure.in: Use AC_ARG_PROGRAM.
9948         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
9949         Reported by David MacKenzie.
9951 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
9953         * configure.in: Do not add -O to CFLAGS for GNU C, now that
9954         configure does it automatically.
9955         Reported by Jim Meyering.
9957 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
9959         * src/stackovf.c: Declare the handler_t typedef earlier in the
9960         code, use it for stackovf_handler.
9961         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
9962         casting sigsegv_handler.
9963         Reported by Robert Bernstein.
9965         * src/m4.c (main): Initialize program_name to argv[0] without
9966         basename'ing it.
9967         Reported by Karl Berry.
9969 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
9971         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
9972         Reported by Karl Berry.
9974 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
9976         * lib/Makefile.in (mostlyclean): Added.
9977         (TAGS): Make in $(srcdir).
9979         * configure.in: Use `choke me' in test, like everywhere!
9981         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
9982         unreacheable and useless.
9984         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
9986         * lib/Makefile.in (DISTFILES): Distribute TAGS.
9987         (distclean): Do not remove TAGS.
9988         (realclean): Remove it.
9989         * Makefile.in: Make TAGS in lib also, not just in src.
9990         Reported by Karl Berry.
9992         * Makefile.in (distclean, realclean): Instead of recursively
9993         calling $(MAKE) for the -local part, allow parallel execution of
9994         -recursive and -local, only delay the removal of config.status,
9995         which is repeated in both goals.
9997 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
9999         * Release 1.3.
10001         * Makefile.in: Group all *clean-recursive goals in one, using sed
10002         to remove `-recursive' while calling make recursively.  Also, use
10003         a subshell for each recursive $(MAKE).
10004         Reported by Jim Meyering.
10006         * src/m4.h (memcpy): Define with bcopy for BSD systems.
10007         Reported by Kaveh R. Ghazi.
10009         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10010         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10011         specify it.
10013         * configure.in: Use date instead of touch for stamp-h.
10014         * Makefile.in (stamp-h.in): Idem.
10016         * Makefile.in (distclean, realclean): Force serial execution of
10017         both goals, in case parallel makes are being used.
10018         Reported by Jim Meyering.
10020         * src/Makefile.in (DISTFILES): Distribute TAGS.
10021         (distclean): Do not remove TAGS.
10022         (realclean): Remove it.
10023         Reported by Karl Berry.
10025 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
10027         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
10028         to old names, for following Autoconf.
10030 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
10032         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10033         ./install.sh will not be correctly referred to in sub-Makefiles.
10034         Reported by John David Anglin.
10036         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10037         Reported by Eric Backus.
10039         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10040         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10041         config.status into remaking this directory's Makefile only.
10042         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10043         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10044         Reported by Jim Meyering.
10046 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
10048         * configure.in: Correct stack overflow detection logic, taking
10049         care of systems having only incomplete implementations (like for
10050         Pyramid 9820 OSx 5.0d).
10051         Reported by Kaveh R. Ghazi.
10053         * src/Makefile.in (TAGS): Remote -t from etags call.
10055 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
10057         * lib/Makefile.in (install): Depend on all.
10059 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
10061         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
10062         Reported by Jim Meyering and John David Anglin.
10064         * Makefile.in (distclean-local): Delete config.log.
10065         Reported by Jim Meyering.
10067         Solidify frozen files with respect to -P:
10068         * src/m4.c: Have -P set prefix_all_buitins variable instead of
10069         calling a function by that name.  Declare the variable.
10070         * src/m4.h: Adjust declaration for prefix_all_buitins.
10071         * src/builtin.c (builtin_init): Merge in functionality from
10072         previous prefix_all_buitins function, while making entries in the
10073         symbol table, but not modifying the builtin description itself.
10075         * src/freeze.c (reload_frozen_state): Add a useless `break;',
10076         because *many* compilers do not accept an empty `default:'.
10077         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
10078         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
10080         * configure.in: Use AC_TYPE_SIGNAL.
10081         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
10082         Reported by Robert Bernstein.
10084         * checks/Makefile.in (check): Modify PATH so check-them will find
10085         m4 in the src directory.
10086         * Makefile.in (check): Don't.
10087         Reported by Akiko Matsushita and Jim Meyering.
10089         * src/output.c (make_room_for, output_character_helper): New
10090         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
10091         a per buffer MAXIMUM_BUFFER_SIZE.
10093         * src/output.c (output_text): New function, for optimizing the
10094         output of strings of characters.  Use it.
10096 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
10098         * doc, src: New directories reorganizing the distribution.
10099         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
10100         files.
10101         * Makefile.in: Adjusted.
10102         * configure.in: Configure new Makefiles.
10104         * m4.h: Declare STRING typedef.  Use it for comment and quote
10105         strings, adjusting all references.  (This is the rudiments of a
10106         beginning for the eventual withdrawal of NUL terminated strings.)
10107         * output.c (shipout_text): Accept a length parameter, and use it.
10108         All callers adjusted.
10110 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
10112         * m4.h: Include <unistd.h> if it exists.
10113         * stackovf.c: Don't.
10115         Clean up for current_diversion variable:
10116         * output.c: Move current_diversion from builtin.c.
10117         * m4.h: Declare current_diversion so builtin.c can access it.
10118         * output.c (output_init, make_diversion): Initialize or update
10119         current_diversion.
10120         * builtin.c (builtin_init, m4_divert): Leave current_diversion
10121         alone.
10123         Remove limit on number of diversions:
10124         * output.c: Replace ndiversion by diversions, declare it.
10125         (output_init): Allocate only diversion 0.
10126         (make_diversion): Allocate new diversions as needed.
10127         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
10128         * m4.c: Still accept -N, but do nothing with it.
10129         Reported by David MacKenzie.
10131         Freeze diversions:
10132         * output.c (freeze_diversions): New function.
10133         * m4.h: Declare freeze_diversions.
10134         * freeze.c: Document frozen file format, revise it, call
10135         freeze_diversions to add diversions to frozen format, and code to
10136         reload them properly.
10137         * m4.c: Do not undivert automatically at end when status being
10138         frozen.  Do not call builtin_init when reloading frozen state.
10140         Speed up diversion processing:
10141         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
10142         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
10143         structure and variables, cached variables out of output_diversion,
10144         reallocate_diversion_for and OUTPUT_CHARACTER.
10145         (shipout_text, make_diversion, insert_diversion): Adapted to new
10146         structures.
10147         (insert_file): Use better buffering.
10148         Reported by David MacKenzie.
10150 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
10152         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
10153         dist works from another build directory.
10155 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
10157         * symtab.c (hack_all_symbols): Use hash_table_size instead of
10158         constant HASHMAX, for -H option to work better.
10160         * builtin.c (DECLARE): Simplify by using _ ().
10162         * freeze.c: New file.
10163         * Makefile.in: Compile it, distribute it.
10164         * m4.c: Recognize, document and process --freeze-state (-F) and
10165         --reload-state (-R) options.  Pass a true flag to builtin_init
10166         only if no reloading some state.
10167         * builtin.c (define_builtin): Remove static specifier.
10168         (find_builtin_by_name): Remove static specifier.
10169         (builtin_init): Accept and obey a flag argument.
10170         * m4.h: Add declarations for freeze.c, changes for builtin.c.
10172 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
10174         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
10175         specifier.
10177         * configure.in: Implement --with-dmalloc.
10178         * acconfig.h: Document WITH_DMALLOC.
10179         * m4.h: Add code for when WITH_DMALLOC.
10181 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
10183         * m4.c (long_options): Use "error-output", the dash was missing.
10184         Reported by Akiko Matsushita.
10186 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
10188         * m4.h: Include <sys/types.h>.
10189         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
10190         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
10191         int.
10192         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
10193         as size_t, not int.
10194         * builtin.c (dump_args): Declare len as size_t, not int.
10196         * debug.c: Prototype the forward declaration of debug_set_file.
10198         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
10199         shadowing of this variable.
10200         * output.c (insert_diversion): Idem.
10202         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
10203         (input_init): Duplicate default quote and comment strings.
10204         (set_quotes): Free previous quote strings in all cases.  Duplicate
10205         even default quote strings.
10206         (set_comment): Free previous comment strings in all cases.
10207         Duplicate even default comment strings.
10209         * configure.in: Updated for Autoconf 2.0.
10210         * Makefile.in (distclean-local): Also delete config.cache.
10212         * m4.c (usage): Reorganize the --help output by topic.  Include a
10213         description for debugging flags.
10215 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
10217         * configure.in: If sigaction is available and SA_ONSTACK defined,
10218         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
10219         defined, use sigvec.  Else don't compile stackovf.c.
10220         * stackovf.c (setup_stackovf_trap): Idem.
10221         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
10222         and Simon Leinen.
10224 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
10226         * m4.c (usage): Replace printf par fputs.
10228 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
10230         * Release 1.2
10232 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
10234         * configure.in: Check for sigaction and sigvec.  Add a new delayed
10235         check for RLIMIT_STACK, combine in the checking for getrlimit.
10236         All those things are not universally available.
10237         * stackovf.c: Split setting up the trap handler and catching
10238         signals, for better taking care of various configure outcomes.
10239         * examples/stackovf.sh: Correct a typo.
10240         Reported by Eric Backus, Jim Avera and Jim Meyering.
10242 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
10244         * ansi2knr.c: New version sent by its author, Peter Deutsch.
10246 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
10248         * Makefile.in: Modify so parallel make will not try making
10249         lib/libm4.a twice simultaneously.
10250         Reported by Jim Meyering.
10252 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
10254         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
10255         error message, for when no code possibility exists.  Even if this
10256         line is completely #ifdef'ed out, it brings a syntax error.
10257         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
10259         * Makefile.in (install): Have install depend on all too, for lib
10260         to be remade as needed.
10262         * examples/stackovf.sh: Try ksh, bsh and bash for shells
10263         providing ulimit, instead of using only ksh.
10264         Reported by Jim Avera and Joseph E. Sacco.
10266 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
10268         * Makefile.in (check): Have it depend on all instead of m4.  In
10269         this way, a change in lib will be detected and processed.
10271         * builtin.c (numeric_arg): Use strtol and verify the conversion,
10272         instead of using sscanf which stops as soon as there is a
10273         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
10274         and divert(1xyzzy) were all accepted without any warning or error
10275         messages.
10276         * m4.h: Declare strtol as long if not including stdlib.h.
10277         * configure.in: Check for limits.h, and replace strtol if missing.
10278         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
10279         * lib/strtol.c: New file, from elsewhere.
10280         Reported by Andreas Schwab.
10282 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
10284         * macro.c (expand_macro): Cast value to (boolean) prior to
10285         assigning it to traced.
10286         Reported by Tom McConnell.
10288         * Makefile.in (m4): Always make all in lib first.
10289         Reported by Jim Meyering.
10291 1994-07-06  Jim Avera <jima@netcom.com>
10293         * stackovf.c: Isolated OS-dependent sections; Improved portability,
10294         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
10295         handlers), and a default error message if the fault address is not
10296         available (when neither siginfo.h nor BSD sigcontext are supported).
10297         * configure.in: Changes for stackovf.h: Check for sigcontext,
10298         sigaction, sigstack, and define rlim_t as int if necessary.
10299         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
10300         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
10301         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
10303 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
10305         * configure.in: Use AC_SET_MAKE.
10306         * Makefile.in: Use @SET_MAKE@.
10307         Reported by Jim Meyering.
10309         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
10310         Reported by Ian Taylor.
10312 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
10314         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
10315         because siginfo.h is unrelated to standard headers, and siginfo.h
10316         is already checked for.
10317         Reported by Joseph E. Sacco.
10319         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
10320         PROTOTYPES.
10321         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
10322         AC_PROTOTYPES.
10324 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
10326         * builtin.c (substitute): Use \& to represent this part of the
10327         string which was matched by the whole regexp, instead of
10328         representing the whole string.  Any usage of \0 issues a warning
10329         and acts like \&, it will disappear in some subsequent release.
10331 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
10333         * m4.c: Complete prototype for forwarded declaration of usage.
10335         * input.c (init_macro_token): Correct own reference in error
10336         message.  Previous name get_macro_func was referred to instead.
10337         (next_char):  Correct own reference in error message.  Previous
10338         name advance_input was referred to instead.
10340         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10341         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10342         and_term, not_term, logical_not_term, cmp_term, shift_term,
10343         add_term, mult_term, exp_term, unary_term, simple_term): Add
10344         prototype to forwarded declarations.  Declare parameter v1 as
10345         eval_t * instead of int *.  Same for local variable v2 in dyadic
10346         functions.  Same for result in exp_term.
10347         * builtin.c (m4_eval): Declare value as eval_t instead of int.
10348         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
10349         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
10350         (shipout_int): Cast first argument of ntoa to eval_t.
10351         Reported by Thorsten Ohl.
10353         * macro.c: Complete the prototypes of forwarded expand_macro and
10354         expand_token.
10355         Reported by Thorsten Ohl.
10357         * m4.h: Define voidstar as void * or char * depending on __STDC__.
10358         The Ultrix 3.1 compiler cannot do much with void pointers.
10360         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10361         * m4.c (xfree):  Replace void * by voidstar.
10362         Reported by Tom McConnell.
10364         * ansi2knr.1: New, from elsewhere.
10365         * Makefile.in (DISTFILES): Distribute ansi2knr.1
10367         * Makefile.in (stamp-h.in): Avoid running ./config.status if
10368         stamp-h does not exist yet.  This avoids running it a second time
10369         just after the initial ./configure.
10370         Reported by David MacKenzie and Tom McConnell.
10372         * m4.h: Replace the enum debug_info declaration with a series of
10373         #define's.  The Ultrix 3.1 compiler would otherwise need casting
10374         (int) to most references, when used in expressions.
10375         Reported by Tom McConnell.
10377 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
10379         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
10380         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
10381         calls the compiler.  Previously, FP_PROTOTYPES was only calling
10382         the preprocessor; by not being subject to CFLAGS, this was
10383         discouraging those flags asking for ANSI compilation.
10384         * acconfig.h: Document HAVE_PROTOTYPES.
10385         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
10386         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
10387         Reported by Eric Backus.
10389         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
10390         from the environment.  Default CFLAGS to -g if not set.
10391         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
10392         * lib/Makefile.in: Have CFLAGS substituted from configure.
10393         Reported by Eric Backus and Tom McConnell.
10395         * configure.in: m4_undefine changeword before using AC_ENABLE.
10397         * m4.h: Declare prototypes for error (for ANSI compilers only),
10398         prefix_all_builtins and reference_error.
10399         Reported by Tom McConnell.
10401         * input.c (set_word_regexp): Do not try to initialize the array
10402         test from a string, this does not work with non-ANSI compilers.
10403         Reported by Eric Backus.
10405         * Makefile.in (dist): Clean examples/ before saving it.
10406         (distclean-local): Also remove stamp-h.
10407         Reported by Eric Backus.
10409         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
10410         non ANSI compilers.
10411         Reported by Tom McConnell.
10413         * checks/Makefile.in (clean): Depends on mostlyclean.
10414         (mostlyclean): New goal.
10416 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
10418         * Makefile.in (DISTFILES): Distribute install.sh.
10419         * install.sh: New file, copied from elsewhere.
10420         Reported by Assar Westerlund and Kaveh R. Ghazi.
10422 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
10424         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
10425         * acconfig.h: Explain ENABLE_CHANGEWORD.
10427         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
10428         from code provided by Pete Chown]
10429         * m4.h: Add original_text field to u_t variant of union u.
10430         Declare TOKEN_DATA_FUNC macro.
10431         * builtin.c: Declare changeword.
10432         (m4_changeword): New function.
10433         * input.c: Include "regex.h", define variables with word regexps.
10434         (input_init): Initialize the word regexp.
10435         (set_word_regexp): New.
10436         (next_token): Declare local variables, use the previous code if
10437         default_word_regexp is true.  Else, match using a new code.  Save
10438         the original text.
10439         * macro.c (expand_token): Ship out original text if not a macro
10440         name.
10441         Reported by Krste Asanovic and Pete Chown.
10443         [These modifs all depend upon ENABLE_CHANGEWORD]
10444         * m4.h: Declare external user_word_regexp.
10445         * m4.c: Declare user_word_regexp, and initialize it from
10446         --word-regexp or -W, or NULL if not specified.
10447         * input.c: Use user_word_regexp if specified, instead of
10448         DEFAULT_WORD_REGEXP.
10450         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
10451         agree with it.
10453         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
10454         * checks/Makefile.in: Empty the suffix list.
10455         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
10457         * m4.c: Declare nesting_limit and initialize it to 250.
10458         Implement -LNUMBER or --nesting-limit=NUMBER to change its
10459         value.
10460         * m4.h: Declare nesting_limit as external.
10461         * macro.c (expand_macro): Stop execution whenever nesting limit
10462         is exceeded.
10463         Reported by Bengt Mertensson.
10465         * eval.c (evaluate): Diagnose excess characters in eval input.
10466         Things like `eval(08)' used to return 0 with no diagnostic.
10468         * m4.h: Capitalize first letter of all macro arguments in
10469         definitions.
10471         * m4.c: Declare warning_status, initialize it to 0.  Add new
10472         option -E, or --fatal-warnings, which sets warning_status to
10473         EXIT_FAILURE instead.
10474         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
10475         EXIT_FAILURE if not otherwise done by header files.
10476         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
10477         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
10478         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
10479         argument of all M4ERROR calls.
10480         Reported by Noah Friedman.
10482         * examples/incl-test.m4: Renamed from incl_test.m4.
10483         * examples/include.m4: Include incl-test.m4 instead of
10484         incl_test.m4.
10485         * examples/multiquotes.m4: Renamed from multi-quotes.m.
10487 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
10489         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
10490         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
10491         also tested it on a Sun Sparc workstation running SunOS 4.x.
10493         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
10494         49.format check, abusing a `union values' argument with sprintf
10495         without selecting the proper field.  Now, save the formatting type
10496         first, delaying the fetch of the corresponding argument.
10497         Reported by Joseph E. Sacco and Tom Quinn.
10499         * format.c (format): Remove const from char *fmt declaration when
10500         not HAVE_EFGCVT, because a NUL may be forced into it.
10502         * m4.h: Declare atof() when not STDC_HEADERS.
10503         Reported by Joseph E. Sacco.
10505         * Regenerate configure using Autoconf 1.11, this corrects a
10506         problem about an incorrect cpp seting on NeXT 3.1.
10507         Reported by Alexander Lehmann.
10509 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
10511         * m4.h (_): Change argument from `x' to `Args'.
10513 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
10515         * m4.h: Rename Args() to _().
10516         * m4.h: Remove extern specifier from all function declarations.
10518 1994-04-22  Jim Avera <jima@netcom.com>
10520         * stackovf.c: New file implementing stack-overflow detection.
10521         * configure.in: Check for getrlimit, sigaction.  If all of
10522         standard headers, getrlimit and sigaction, define USE_STACKOVF and
10523         substitute ${U}stackovf.o for STACKOVF.
10524         * acconfig.h: Declare USE_STACKOVF.
10525         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
10526         * m4.h: Declare setup_stackovf_trap().
10527         * m4.c: Call setup_stackovf_trap().
10528         * tests/stackovf_test.sh: New file.
10530 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
10532         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
10534         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
10536 1994-01-30  François Pinard  <pinard@iro.umontreal.ca>
10538         * m4.h: Remove definition of volatile, not used anymore.
10539         Reported by Jim Meyering and Joseph E. Sacco.
10541         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
10542         of `if ... else /* nothing */' for if macros.
10543         Reported by Jim Meyering.
10545         * builtin.c (m4_regexp): Reorganize the code for avoiding a
10546         warning from gcc about `repl' possibly used before defined.
10547         Reported by Jim Meyering.
10549         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
10550         Reported by Jim Meyering.
10552 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
10554         * m4.h: Move the conditional definition of volatile after the
10555         inclusion of system files, because they may define it first.
10557 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
10559         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
10560         get around a problem with Alpha make seeing a syntax error, there.
10561         Reported by Vern Paxson.
10563 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
10565         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
10566         Reported by Richard Stallman.
10568 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
10570         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
10571         instead of AC_HAVE_FUNCS.
10572         Reported by Noah Friedman.
10574 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
10576         * m4.c: Initialize show_help and show_version to zero.
10578         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
10579         Use them in exit() and usage() calls.
10581 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
10583         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
10584         syserr() macro.  Delete errref, add reference_error and M4ERROR.
10585         * m4.c: Replace errref, which was returning an input reference
10586         string, with reference_error, which prints it on standard error.
10587         * builtin.c, output.c: Use errno as second parameter to error,
10588         instead of using syserr() with %s.
10589         * *.c: Use M4ERROR instead of error: no more errref() with %s.
10590         Doing so, the program name appears after the input reference
10591         instead of before, which eases M-x next-error processing.
10593 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
10595         * checks/get-them: Escape braces with backslashes in patterns,
10596         because HPUX-9.01 awk needs this.
10597         Reported by Jim Meyering.
10599 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
10601         * builtin.c: Declare "FILE *popen ();".
10603         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
10604         macros, replace error_message_prefix() declaration by errref()'s.
10605         Declare xrealloc, for use in errref().
10606         * m4.c: Delete error_message_prefix() function, add errref().
10607         * *.c: Use error() systematically in place of all error macros,
10608         now that error() flushes stdout first.  Make needed adjustments.
10610         * m4.h: Remove const in sys_errlist[] declaration, it creates
10611         conflicts on SGI and Alpha.
10612         Reported by Kaveh R. Ghazi.
10614 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
10616         * m4.c: Include <getopt.h> instead of "getopt.h".
10618         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
10619         * acconfig.h: New, for documenting HAVE_EFGCVT.
10620         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
10621         use them wherever appropriate.  Also use -I. for compilations.
10622         * lib/Makefile.in: Use -I.. for compilations.
10623         * *.c: Include <config.h> or "config.h".
10625         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
10626         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
10628 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
10630         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
10632         * input.c (input_init): Initialize quote and comment strings
10633         explicitely instead of calling set_quotes and set_comment: by
10634         doing so, we ensure we do not free uninitialized variables.
10636         * checks/check-them: Reverse arguments to both diff, so the
10637         expected is on the left and the obtained on the right.
10639         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
10640         macros. Delete declarations for m4error, warning, fatal and
10641         internal_error, add declaration for error_message_prefix.
10642         * m4.c:  Delete m4error, warning, fatal and internal_error
10643         routines, add error_message_prefix routine.
10644         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
10645         warning with WARNING*, fatal with FATAL* and internal_error with
10646         INTERNAL_ERROR*.
10647         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
10648         this is not needed anymore.
10650         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
10651         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
10652         and debug_message, add declaration for debug_message_prefix.
10653         * debug.c: Remove static specifier for FILE *debug declaration.
10654         Delete debug_print and debug_message routines, add
10655         debug_message_prefix routine.
10656         * builtin.c, debug.c: Replace debug_print routine calls with
10657         DEBUG_PRINT* macro calls.
10658         * input.c, path.c: Replace debug_message routine calls with
10659         DEBUG_MESSAGE* macro calls.
10661         * m4.h: Remove inclusion of <varargs.h>.
10662         * debug.c: Include <stdarg.h> or <varargs.h>.
10663         (trace_format): Use stdarg instead of varargs if __STDC__.
10665         * configure.in: Remove checks for vfprintf and _doprnt.  These
10666         implementations use varargs tricks which are not portable enough.
10667         * lib/vfprintf.c: Deleted.
10668         * lib/_doprnt.c: Deleted.
10669         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
10670         Reported by Joel Sherrill.
10672         * path.c (add_include_directory): Use xstrdup.
10674         * builtin.c (find_builtin_by_name): Declare static.
10676         * *.[ch]: Add const to a few "char *" declarations.
10678         * configure.in: Remove commented tests for fileno() and fstat().
10679         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
10681         * debug.c (debug_flush_files): New.
10682         * m4.h: Declares it.
10683         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
10684         Reported by Nicolas Pioch.
10686 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
10688         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
10689         Reported by Joel Sherrill.
10691         * builtin.c (prefix_all_builtins): Instead of the table size, use
10692         the null entry at end for stopping the loop.  It was overwritten.
10693         Reported by Andreas Schwab and Jim Meyering.
10695         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
10696         Reported by Kaveh R. Ghazi.
10698         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
10699         Reported by Karl Vogel.
10701 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
10703         * m4.h: Do not define volatile if already defined.
10704         Reported by René Seindal.
10706         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
10708         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
10709         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
10711 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
10713         * m4.h: Define strchr and strrchr in terms of index and rindex,
10714         instead of the other way around.
10715         * builtin.c, m4.c, path.c: Use strchr instead of index.
10717         * input.c (next_char): Remove a "break;" after a "return ...;".
10718         Reported by Tom McConnell.
10720 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
10722         * Release 1.1
10724         * configure.in: Do not copy check files in the build hierarchy.
10725         * checks/check-them: Identify the m4 version being checked.  For
10726         finding m4, look in $PATH instead of in the parent directory.
10727         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
10728         * checks/Makefile.in (.all-stamp): Always create check files in
10729         the source hierarchy, not anymore in the build hierarchy.
10730         (check): cd to the source hierarchy before performing checks.
10731         Do not copy nor clean COPYING anymore, take it from `..'.
10732         Reported by Tom McConnell.
10734         * Makefile.in (Makefile): Use $(SHELL).
10735         (config.status): Use $(SHELL).  Use "config.status --recheck"
10736         instead of "configure --no-create", which is obsolete.
10737         Reported by Tom McConnell.
10739 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
10741         * m4.c (usage): Use "%s" instead of "m4" in format string.
10742         Reported by Jim Meyering.
10744         * Makefile.in: Distribute mkinstalldirs.
10745         Reported by Pierre Gaumond.
10746         Reported by Jim Meyering.
10747         Reported by Tom McConnell.
10748         Reported by Andreas Gustafsson.
10750         * checks/check-them: Renamed from checks/check_them.
10751         * checks/get-them: Renamed from checks/get_them.
10752         * checks/.all-stamp: Renamed from checks/.all_stamp.
10753         * checks/Makefile.in: Changed accordingly.
10754         Reported by Jim Meyering.
10756 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
10758         * lib/Makefile.in (dist): Correct permissions on files.
10760         * output.c: Declare tmpfile, some systems don't.
10762 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
10764         * checks/Makefile.in (dist): Correct permissions on files.
10766         * Makefile.in (dist): Ensure recursive linking for subdirectory
10767         `examples', also set read/write permissions on all its files.
10769         * mkinstalldirs: New, from elsewhere.
10770         * Makefile.in: Use it.
10772         * debug.c: Synchronize debug messages and regular output when
10773         the debug file and stdout are redirected to the same file.
10774         * configure.in: Add (commented) checks for fileno and fstat.
10775         Reported by Jim Avera.
10777         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
10778         etc., arguments, then ignore the superfluous one.  m4 used to
10779         diagnose missing arguments and return the empty string.
10780         Reported by Nick S. Kanakakorn.
10782 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
10784         * m4.c (main): At end of all input, ensure all undiverted text
10785         goes to the main output stream.
10786         Reported by Andreas Gustafsson.
10788         * m4.c (main): exit (0), instead of return 0.
10790         * m4.c: Implement -P and --prefix-builtins.
10791         * builtin.c: Delete const specifier on builtin_tab.
10792         (prefix_all_builtins): New.
10793         Reported by Noah Friedman.
10794         Reported by Scott Bartram.
10796         * c-boxes.el: New, from elsewhere.
10797         * Makefile.in: Distribute it.
10799         * m4.h: Do not define bcopy if <string.h> defines it.
10800         Reported by Stephen Perkins.
10802         * builtin.c (define_macro): Allow a missing second argument, in
10803         which case it is implied empty.  Affects define and pushdef.
10804         Reported by Eric Allman.
10806 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
10808         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
10809         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
10810         * builtin.c: Initialize all the blindness fields in builtin_tab.
10811         (define_builtin): Copy the blindness of a builtin into its symbol.
10812         * macro.c (expand_token): Avoid processing a blind builtin if the
10813         next character is not an opening parenthesis.
10814         Reported by David MacKenzie.
10815         Reported by Noah Friedman.
10817         * configure.in: Ensure an exit status of 0 on completion.
10818         Reported by Vivek P. Singhal.
10820         * eval.c (eval_lex): Admit both lower and upper case letters for
10821         bases greater than 10.  Only lower case letters were accepted.
10823         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
10824         Reported by Krste Asanovic.
10826         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
10827         * eval.c (logical_not_term): New name for not_term.
10828         * eval.c (xor_term): New, between or_term and and_term.
10829         * eval.c (not_term): New, between and_term and logical_not_term.
10830         * eval.c (shift_term): New, between cmp_term and add_term.
10831         Reported by Krste Asanovic: ~, ^, <<, >>.
10832         Reported by Ben A. Mesander: ** vs ^.
10834         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
10835         * m4.h: Delete xrealloc.c.
10836         * lib/xmalloc.c: New, from elsewhere.
10837         * lib/xstrdup.c: New, from elsewhere.
10838         * lib/Makefile.in: Distribute and compile them.
10840         * m4.c: Change progname to program_name.
10841         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
10842         * lib/error.c: New, from elsewhere.
10843         * lib/Makefile.in: Distribute and compile error.c.
10844         * configure.in: Check AC_VPRINTF and for strerror.
10845         * m4.c: Delete cmd_error.  Use error instead.
10846         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
10848         * m4.h: Delete #define const, let Autoconf takes care of this.
10850         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
10851         Merge parse_args into main.  Declare argv to be `char *const *',
10852         then remove superfluous casts.
10854         * m4.c: Rename --no-gnu-extensions to --traditional.
10855         Reported by Ben A. Mesander.
10857         * m4.c (usage): Add a status parameter.  Supply one in various
10858         calls.  Add --help processing.  Remove -V for --version.
10860         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
10862         * lib/Makefile.in: Have an AR=ar declaration.
10863         Reported by Eric Backus.
10864         Reported by Bjorn R. Bjornsson.
10865         Reported by Tom Tromey.
10866         Reported by Kristine Lund.
10867         Reported by Marion Hakanson.
10869 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
10871         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
10872         Reported by Noah Friedman.
10874 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
10876         * Makefile.in: Remove MDEFINES and cleanup.
10878 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
10880         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
10881         Create a gzip file.
10883 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
10885         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
10886         ensure 777 mode for directories, so older tar's will restore file
10887         modes properly.
10889 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
10891         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
10892         so the installer can override automatically configured choices.
10893         Reported by Karl Berry.
10895 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
10897         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
10898         previous version was not working properly on m68k-hp-bsd4.3.
10899         Reported by Roland McGrath.
10901         * lib/_doprnt.c: Stolen from Oleo distribution.
10902         * configure.in: Check for _doprnt.c if vfprintf.c selected.
10903         * lib/Makefile.in: Distribute _doprnt.c.
10904         Do not distribute regex.[ch].old anymore.
10906 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
10908         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
10909         Richard wants it there.
10911 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
10913         * Makefile.in: Add DEFS to MDEFINES.
10914         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
10915         (libm4.a): Remove the library before creating it.
10916         (distclean): Remove tags and TAGS too.
10918 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
10920         * Makefile.in (dvi, m4.dvi): New goals.
10922         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
10923         macro.c, output.c, path.c, symtab.c: Change Copyright from
10924         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
10926         * examples/divert.m4: Deleted, this bug has been corrected.
10928         * Makefile.in (texclean, mostlyclean): New goals.
10930         * Makefile.in (clean): Remove clutter from ansi2knr.
10931         Reported by Pierre Gaumond.
10933 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
10935         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
10936         might well use CFLAGS is s/he needs it.
10938         * Makefile.in: Allow installation of info files from a separate
10939         build directory.
10940         Reported by Jason Merrill.
10941         Reported by David MacKenzie.
10942         Reported by Skip Montanaro.
10943         Reported by Erez Zadok.
10944         Reported by Assar Westerlund.
10946 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
10948         * Release 1.0.3
10949         This is still a beta release for the future GNU m4 version 1.1.
10951         * lib/alloca.c: New, from elsewhere.
10952         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
10954         * m4.h: Do not define index/rindex if already defined.  If
10955         FALSE/TRUE are already defined, do not redefine them, but merely
10956         define boolean typedef to int.
10958         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
10959         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
10960         because some C compilers do not like connectives with #ifdef.
10961         * m4.h: Define `volatile' only if __GNUC__, instead of once for
10962         __GNUC__ and once for __STDC__.
10963         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
10965         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
10966         Makefile dependencies.  Without it, make keeps destroying and
10967         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
10969         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
10970         to diversion/DIVERSION, this was a spelling error.
10972         * m4.c: Declare version[], remove #include "version.h".
10973         * version.h: Deleted.
10974         * Makefile.in: Remove references to version.h.
10976         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
10977         production, by using a simpler and more robust algorithm.  This
10978         solves the problem of synclines sometimes written in the middle of
10979         an output line.  Delete sync_line() and output_lines variable.
10980         * m4.h: Remove sync_line prototype and output_lines declaration.
10981         * input.c (next_char), output.c (shipout_text): Remove references
10982         to output_lines.
10983         * input.c (push_file, pop_file): Merely put the value -1 in
10984         output_current_line instead of calling sync_line, for delaying a
10985         single `#line NUM FILE' before next output line.  Do not test
10986         for sync_output, because this is unnecessary clutter.
10987         * output.c (make_divertion, insert_divertion): Idem.
10988         * input.c: Rename must_advance_line to start_of_input_line, for
10989         consistency.
10991         * debug.c (trace_header): Select a new debug line format, which
10992         better complies with GNU standards for formatting error messages.
10993         With option `-dfl', M-x next-error might be used on the output.
10994         * m4.c (vmesg): Adjust format of error output to GNU standards.
10995         * m4.texinfo: Adjust examples for `make check' to work.
10997         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
10998         case for enum debug_info constants, which were all lower case.
11000         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11001         re_search_2.
11002         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11003         collected patches.  I tried a few times using newer regex.[ch], it
11004         mysteriously stopped aborting with this one.  Insecure feeling...
11005         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11007 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
11009         * m4.c: Change `--no-warnings' to `--silent'.
11010         Reported by David MacKenzie.
11012         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11013         leave it off for now.  See comment in m4.c for justification.
11014         Reported by David MacKenzie.
11016         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11017         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11019         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
11021         * Makefile.in: Ensure recursive cleaning is done before local
11022         cleaning for all clean goals.
11024         * builtin.c (ntoa): Ensure the value is always interpreted as a
11025         signed quantity, whatever the radix is.
11027 1992-11-18  Jim Meyering  <meyering@idefix>
11029         * builtin.c, format.c, input.c: Split long lines.
11030         * m4.c: Use typedef macro_definition instead of struct
11031         macro_definition.
11032         * symtab.c: Use typedef symbol instead of struct symbol.
11034 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
11036         * *.[ch]: Remove all trailing whitespace, in code and comments.
11038         * configure.in: Find some awk.
11039         * Makefile.in: Add $(AWK) to MDEFINES.
11040         * checks/Makefile.in: Transmit $(AWK) to get_them.
11041         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
11042         awk script when switching files, because without this, mawk runs
11043         out of file descriptors.
11045 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
11047         * Makefile.in (realclean): Delete m4.info*.
11048         Reported by Jim Meyering.
11050         * Makefile.in: Adjust and link with checks/Makefile.
11051         * checks/Makefile.in: New.
11052         * configure.in: Output checks/Makefile.
11054         * checks/get_them: Have the dnl header of each test more
11055         recognizable by next-error, also use a better message.
11057 1992-11-16  Jim Meyering  <meyering@idefix>
11059         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
11060         And use that only if __GNUC__ since we're using it's GCC-specific
11061         semantics that tell the compiler the associated function doesn't
11062         return.
11064         * builtin.c (substitute): Don't use character as an array index.
11065         (dumpdef_cmp): Make formal arguments `const void *' to avoid
11066         warnings with gcc -W -Wall on systems with qsort prototype.
11067         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
11068         from gcc -W -Wall.
11070         * eval.c (most functions): Add parentheses to assignments used
11071         as truth values go avoid warnings from gcc -Wall.
11073         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
11074         any functions that don't need external scope.
11076         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
11077         (many functions and arrays): Declare `const'.
11079 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
11081         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
11082         removing the declaration from m4.h.  Also rename false to FALSE
11083         and true to TRUE.
11085         * lib/Makefile.in (Makefile): New goal.
11087         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
11088         so heavily loaded.  It gets more easily overridable, calling make.
11089         Reported by Jim Meyering.
11091         * Makefile.in (dist): Get .fname from the current directory name,
11092         instead of from version.h.  I need updating many files manually,
11093         when the version changes, version.h is just one of them.
11095 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
11097         * m4.h: Remove the tag `boolean' on the enum introducing typedef
11098         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
11099         Reported by Tom McConnell.
11101 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
11103         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
11104         39.cleardiv, which were describing missing or spurious newlines.
11105         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
11106         do not depend on machine word size, `/bin/false' implementation,
11107         or `wc' output format.  `make check' is more dependable, now.
11109         * checks/check_them: Summarize the failed tests by listing their
11110         name, at end.  If none, issue `All checks successful'.  Output
11111         `Checking' instead of `Input file:'.
11113         * checks/get_them, checks/check_them: Reindented.
11115         * Makefile.in (dist): chmod a+r before making the tar file.
11117 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
11119         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
11121         * input.c (next_token): Reinitialize token_buttom just after using
11122         it as a watermark with obstack_free.  Or else, a future token, big
11123         enough for triggering reallocation of the obstack chunk, could
11124         void the initialized value of token_buttom, later causing panic in
11125         obstack_free.  Rename token_buttom to token_bottom everywhere.
11127         * m4.h: Before declaring errno, first include <errno.h> and
11128         ensure that it does not define errno.
11129         Reported by Richard Stallman.
11131 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
11133         * builtin.c: Define and use DECLARE macro for builtins.
11135         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
11136         argument, this is a common idiom for introducing long comments.
11138         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
11139         arguments.  The last argument was silently ignored.
11141         * m4.c (cmd_error): Add a missing semicolon before va_end().
11143 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
11145         * Makefile.in: Now handle protoized sources.  Define and use U.
11146         Compile and use ansi2knr with old compilers.  Update DISTFILES.
11147         Add `aclocal.m4' to `configure' dependencies.
11148         * ansi2knr.c: New, from Ghostscript distribution.
11149         * configure.in: Define U through FP_PROTOTYPES for old compilers.
11150         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
11151         * aclocal.m4: New, provide FP_PROTOTYPES.
11152         * m4.h: Conditionnaly protoized through Args, save for varags.
11153         * builtin.c: Protoized.  Then:
11154         Include <sys/types.h> if size_t is not defined, before "regex.h".
11155         (m4_ifelse): Fetch built-in name properly for diagnostic.
11156         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
11157         (m4_regexp): Add const to `msg' declaration.
11158         (m4_patsubst): Add const to `msg' declaration.
11159         * debug.c: Protoized, save for varargs.
11160         * eval.c: Protoized.
11161         * format.c: Protoized.
11162         * input.c: Protoized.
11163         * m4.c: Protoized, save for varargs.  Then:
11164         (xfree): Accept void * instead of char *.
11165         (xmalloc): Return void * instead of char *.
11166         (xrealloc): Accept and return void * instead of char *.
11167         * macro.c: Protoized.
11168         * output.c: Protoized.
11169         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
11170         * symtab.c: Protoized.
11172 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
11174         * m4.texinfo: Remove directory from diagnostics in 30.include,
11175         51.eval, 56.errprint and 57.m4exit tests.
11177         * m4.h: Remove declarations for int or void system functions, they
11178         cause more conflicting trouble than they make good.
11180         * configure.in: Avoid configuration header file.  Add some tests.
11181         * m4.h: Remove #include "config.h".
11182         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
11183         Then, rewritten for better compliance with GNU standards.
11185 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
11187         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
11188         because of a misplaced #endif.
11190         * Many *.[hc] files: Correct intra-line spacing here and there,
11191         according to GNU indent 1.6 advice.
11193         * configure.in: New, using Autoconf 1.2.
11194         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
11195         * Delete old configure.in, configure, etc/configure.in,
11196         etc/configure, lib/configure.in, lib/configure and config/*.
11197         Reported by Jason Merrill.
11199         * symtab.c (hash): Change (char) NULL to '\0'.
11200         Reported by Jason Merrill.
11202         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
11203         etc/nextvers.sh.  Release numbers will be edited `by hand'.
11204         * version.h: De-automatize, force value in.
11206         * m4.c: Changes in order to use a newer getopt.h.
11207         Reported by David MacKenzie.
11209         * checks/: New name for examples/.
11210         * checks/get_them: New location for etc/get_examples.
11211         * checks/check_them: New location for etc/check_examples.
11212         * Makefile.in, checks/get_them, checks/check_them: Adjust.
11213         * lib/vfprintf.c: New location for etc/vfprintf.c.
11214         * Delete empty etc/.
11215         * examples/: New name for test/.
11217 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
11219         * Makefile.in (check): Add m4 as dependency.
11221         * m4.c: Accept --no-warnings instead of --no_warnings, and
11222         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
11223         usage message more informative.
11224         Reported by David MacKenzie.
11226 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
11228         * etc/check_examples: New name for check_examples.sh.
11229         * etc/get_examples: New name for get_examples.sh.
11230         * Makefile.in, etc/Makefile.in: Use new names.
11232         * Makefile.in: Transmit $(CC) while making in lib.
11234         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
11235         code disposition by hand.
11237 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
11239         * m4.h: Delete definitions for abort() and exit().
11240         Reported by Richard Stallman.
11242         * config/hmake-unicos, config/s-unicos.h: New files.
11243         Reported by Hal Peterson.
11245         * eval.c (exp_term): Have N^0 return 1.
11246         Reported by Michael Fetterman.
11248         * eval.c, input.c, m4.h: Remove last comma in enums.
11249         Reported by Mike Lijewski.
11251         * Transfer of maintenance duties from René to François.
11253 1991-10-24  René Seindal <seindal@diku.dk>
11255         * Release 1.0.  Many thanks to those, who provided me with bug
11256         reports and feedback.
11258         * Uses GNU configure, taken from the gdb distribution.
11260         * Uses GNU getopt(), with long option names.
11262         * The -Q/+quiet option is added, which suppresses warnings about
11263         missing or superflous arguments to built-in macros.
11265         * Added default options via the M4OPTS environment variable.
11267         * The built-in format can now be configured to use sprintf as
11268         the formatting engine, for systems without [efg]cvt(3).
11270         * GNU library code is moved to the ./lib subdirectory; other
11271         utility files are now in ./etc.
11273         * Several minor bugs have been fixed.
11275 1991-07-26  René Seindal <seindal@diku.dk>
11277         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
11278         François Pinard and Roland H. Pesch for providing me with reports.
11280         * The builtins incr and decr are now implemented without use of
11281         eval.
11283         * The builtin indir is added, to allow for indirect macro calls
11284         (allows use of "illegal" macro names).
11286         * The debugging and tracing facilities has been enhanced
11287         considerably.  See the manual for details.
11289         * The -tMACRO option is added, marks MACRO for tracing as soon
11290         as it is defined.
11292         * Builtins are traced after renaming iff they were before.
11294         * Named files can now be undiverted.
11296         * The -Nnum option can be used to increase the number of
11297         divertions available.
11299         * Calling changecom without arguments now disables all comment
11300         handling.
11302         * The function m4_patsubst() is now consistently declared
11303         static.
11305         * A bug in dnl is fixed.
11307         * A bug in the multi-character quoting code is fixed.
11309         * Several typos in the manual has been corrected.  More probably
11310         persist.
11312         * The m4.info file is now installed along with the program.
11314 1990-11-15  René Seindal <seindal@diku.dk>
11316         * Updated and enhanced version.  Release 0.75, manual 0.07.
11318         * Implemented search path for include files (-I option and
11319         M4PATH envronment variable).
11321         * Implemented builtin "format" for printf-like formatting.
11323         * Implemented builtin "regexp" for searching for regular
11324         expressions.
11326         * Implemented builtin "patsubst" for substitution with regular
11327         expressions.
11329         * Implemented builtin "esyscmd", which expands to a shell
11330         commands output.
11332         * Implemented "__file__" and "__line__" for use in error
11333         messages.
11335         * Implemented character ranges in "translit".
11337         * Implemented control over debugging output.
11339         * Implemented multi-character quotes.
11341         * Implemented multi-character comment delimiters.
11343         * Changed predefined macro "gnu" to "__gnu__".
11345         * Changed predefined macro "unix" to "__unix__", when the -G
11346         option is not used.  With -G, "unix" is still defined.
11348         * Changed "shift", "$@" and "$*" to not insert spaces afters
11349         commas.
11351         * Added program name to error messages.
11353         * Fixed two missing null bytes bugs.
11355 1990-01-22  René Seindal <seindal@diku.dk>
11357         * Initial beta release.  Release 0.50, manual 0.05.
11360         -----
11362         Local Variables:
11363         coding: utf-8
11364         End:
11366         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
11367         2005, 2006, 2007, 2008 Free Software Foundation, Inc.
11369         Copying and distribution of this file, with or without
11370         modification, are permitted provided the copyright notice
11371         and this notice are preserved.