Fix manual date information.
[m4.git] / ChangeLog
blob305b51c1b80bd36cee0cda62b9f90920d847d151
1 2008-08-29  Eric Blake  <ebb9@byu.net>
3         Fix manual date information.
4         * doc/m4.texinfo: UPDATED refers to the day the manual was built,
5         not the release date of M4.
6         Based on a bison patch by Akim Demaille.
8 2008-08-27  Eric Blake  <ebb9@byu.net>
10         Tweak -d examples.
11         * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
12         matters.
13         (Dumpdef): Fix typo.
15 2008-08-23  Eric Blake  <ebb9@byu.net>
17         Allow debugmode control over whether defn(undef) warns.
18         * ltdl/m4/gnulib-cache.m4: Import verify module.
19         * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
20         New values.
21         (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
22         * m4/m4.c (m4_create): Start with debugmode = d.
23         * src/main.c (usage): Mention this.
24         (main): Let -E impact debug mode.
25         * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
26         if flag is clear.
27         * modules/gnu.c (builtin, inder): Likewise.
28         * m4/debug.c (m4_debug_decode): Parse new mode.
29         * src/freeze.c (produce_debugmode_state): Accomodate new mode.
30         * doc/m4.texinfo (Debugging options): Mention change in the
31         default behavior.
32         (Debugmode): Mention new flag d.
33         (Operation modes): Mention interaction with -E.
34         (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
35         test its effect.
36         * tests/options.at (--debugmode): Update tests.
37         * tests/freeze.at (reloading debugmode): Likewise.
38         * NEWS: Document this.
39         Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
40         incompatible with Autoconf 2.62.
42 2008-08-22  Eric Blake  <ebb9@byu.net>
44         Improve --debugmode behavior.
45         * m4/m4module.h (m4_debug_decode): Simplify interface.
46         * m4/debug.c (m4_debug_decode): Remove parameter, and handle
47         setting the new value.
48         * modules/gnu.c (debugmode): Adjust caller.
49         * src/freeze.c (reload_frozen_state): Likewise.
50         * src/main.c (main): Likewise.
51         (usage): Fix default for --debug.
52         * doc/m4.texinfo (Debugging options): Add an example.
54 2008-08-21  Eric Blake  <ebb9@byu.net>
56         Avoid regression in defn(undef).
57         * doc/m4.texinfo (Trace): Enhance test, to cover regression
58         recently fixed on the branch.
60 2008-08-18  Eric Blake  <ebb9@byu.net>
62         Remove deprecated -N option; fixes a regression from 2006-09-14.
63         * src/main.c (DIVERSIONS_OPTION): Delete.
64         (long_options, OPTSTRING, main): Remove -N/--diversions option.
65         * doc/m4.texinfo (Limits control): Remove it from the manual.
66         * NEWS: Mention that it is gone.
67         * tests/options.at (deprecated options): Update test.
69         Improve 'git diff' of manual source.
70         * .gitattributes (*.texi*): Add diff attribute.
71         * bootstrap: Tell git how to use it.
72         Inspired by Jim Meyering's similar patch for coreutils.
74 2008-08-07  Bruno Haible  <bruno@clisp.org>  (tiny change)
76         Run m4 tests prior to gnulib unit tests.
77         * Makefile.am (SUBDIRS): Swap order of directories.
79 2008-08-03  Eric Blake  <ebb9@byu.net>
81         Stage 26: Allow embedded NUL in macro definitions.
82         Clean up final few locations that did not track macro definitions
83         by length, to allow embedded NUL.  Make m4_arg_len callers aware
84         of issue of flattening builtins when determining length.
85         Memory impact: none.
86         Speed impact: none noticed.
87         * m4/m4module.h (m4_arg_len): Add parameter.
88         (M4ARGLEN): Provide default for the parameter.
89         * m4/m4private.h (includes): Share xmemdup0.h among all libm4
90         files.
91         * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
92         * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
93         * m4/symtab.c (includes): Likewise.
94         (m4_symbol_value_copy): Use xmemdup0.
95         * m4/module.c (install_macro_table): Likewise.
96         * src/freeze.c (reload_frozen_state): Likewise.
97         * tests/freeze.at (reloading nul): Enhance test.
98         * tests/null.m4: Likewise.
99         * tests/null.err: Update expected output.
100         * tests/null.out: Likewise.
102         Fix regression in commenting unbalanced quotes, from 2008-02-16.
103         * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
104         * m4/input.c (m4__next_token, m4_print_token): Supply new token
105         type for comments.
106         * m4/macro.c (expand_token): Penalize comments, as they can
107         contain unbalanced quotes; latent bug since 2007-12-07, exposed by
108         passing $@ references built from comments.
109         (expand_argument): Adjust caller.
110         * tests/others.at (Comments): Enhance test to catch it.
111         * NEWS: Mention the fix.
113 2008-07-30  Eric Blake  <ebb9@byu.net>
115         Fix regression in trace output, introduced 2008-05-08.
116         * m4/input.c (m4__push_symbol): When cloning chains, break pointer
117         back to original chain; latent bug from 2008-02-02 that did not
118         cause misbehavior until trace output read unfinished chain.
119         * tests/builtins.at (debug): Add test for this.
121 2008-07-28  Eric Blake  <ebb9@byu.net>
123         Optimize iteration examples.
124         * examples/forloop2.m4: Avoid excess indir, by passing current
125         counter value as parameter.
126         * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
127         ignored argument.
128         * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
129         documentation to match.
131 2008-07-26  Eric Blake  <ebb9@byu.net>
133         Give example for O(n) foreach on m4 1.4.x.
134         * examples/foreachq4.m4: New file.
135         * Makefile.am (dist_pkgdata_DATA): Distribute it.
136         * tests/others.at (recursion): Test it.
137         * doc/m4.texinfo (Improved foreach): Document linear foreach with
138         m4 1.4.5 and greater.
140 2008-07-19  Eric Blake  <ebb9@byu.net>
142         Resynchronize docs from branch.
143         * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
144         name, particularly since the old documentation didn't match code.
145         (Standard Modules): Add caveat about using __m4_version__.
147 2008-07-11  Eric Blake  <ebb9@byu.net>
149         Bump required automake to 1.10a; regression introduced 2008-01-22.
150         * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
151         1.10.1, since we also rely on pkglibexecdir.
152         * HACKING: Fix minimum requirement.
153         * bootstrap: Likewise.
154         * THANKS: Update.
155         Reported by Joel E. Denny.
157         Avoid bogus whitespace in @ovar, @dvar.
158         * doc/m4.texinfo (ovar, dvar): Add @c.
159         Based on patch by Ralf Wildenhues to Autoconf manual.
161 2008-06-23  Eric Blake  <ebb9@byu.net>
163         Adjust to new gnulib-tool layout.
164         * ltdl/m4/gnulib-cache.m4: Reformat.
166         Fix bootstrap comment.
167         * bootstrap: DOWNLOAD_PO was previously removed.
169 2008-06-19  Eric Blake  <ebb9@byu.net>
171         Revert speed regression from 2008-06-16.
172         * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
173         * modules/m4.c (numb_obstack): Likewise.
174         * m4/input.c (MATCH): Use fewer conditionals, and factor
175         adjustment of S...
176         (match_input): ...here for smaller code size.
177         * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
178         Supply trailing NUL to delimiters, to meet contract of faster
179         MATCH.
181 2008-06-18  Eric Blake  <ebb9@byu.net>
183         Whitespace cleanup.
184         * m4/m4module.h: Use consistent spacing for pointer parameters.
185         * m4/m4private.h: Likewise.
187         Stage 25b: Handle embedded NUL in changesyntax and friends.
188         Track quote and comment delimiters by length, to allow embedded
189         NUL.  Improve changesyntax to support assigning syntax to NUL.
190         Memory impact: none.
191         Speed impact: none noticed.
192         * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
193         Add parameter.
194         (m4_reset_syntax): New prototype.
195         * m4/syntax.c (add_syntax_set, subtract_syntax_set)
196         (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
197         handle embedded NUL.
198         (m4_set_syntax): Likewise.  Also, split code to reset the table...
199         (m4_reset_syntax): ...into a new function.
200         (m4_syntax_create): Adjust callers.
201         * m4/input.c (match_input, MATCH): Add parameter.
202         (m4__next_token, m4__next_token_is_open): Adjust callers.
203         * modules/m4.h (m4_expand_ranges_func): Add parameter.
204         * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
205         (changequote, changecom, translit, m4_expand_ranges): Track
206         delimiter length.
207         * modules/gnu.c (changesyntax): Handle embedded NUL.
208         * src/freeze.c (reload_frozen_state): Adjust callers.
209         * tests/freeze.at (reloading nul): Enhance test.
210         * tests/null.m4: Likewise.
211         * tests/null.out: Update expected output.
212         * tests/null.err: Likewise.
214 2008-06-16  Eric Blake  <ebb9@byu.net>
216         Stage 25a: Use obstack_printf for easier output.
217         Convert macro tracing and other locations to use obstack_printf
218         rather than hand-rolled equivalents.  Ensure that embedded NUL in
219         trace output does not truncate the trace string.
220         Memory impact: none.
221         Speed impact: noticeable penalty, from obstack_printf overhead.
222         * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
223         * m4/macro.c (trace_format): Delete; use obstack_printf instead.
224         (trace_header, trace_pre, trace_post): All callers updated.
225         * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
226         (m4_divert_text): Speed up syncline output.
227         * modules/m4.c (dumpdef): Handle embedded NUL.
228         (numb_obstack): Speed up eval output.
229         (maketemp): Use obstack_printf.
230         * modules/format.c (format): Likewise.
232         Add missing const qualifications.
233         * m4/resyntax.c (m4_resyntax_map): Declare array elements as
234         const.
235         * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
236         * modules/import.c (m4_builtin_table): Likewise.
237         * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
238         * modules/m4.c (m4_builtin_table): Likewise.
239         * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
240         * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
241         * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
242         * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
243         * modules/stdlib.c (m4_builtin_table): Likewise.
244         * modules/time.c (m4_builtin_table): Likewise.
245         * modules/traditional.c (m4_macro_table): Likewise.
247 2008-06-10  Eric Blake  <ebb9@byu.net>
249         Avoid corrupted frozen file if NUL appears on block boundary.
250         * m4/output.c (insert_file): Separate consecutive quotearg blocks
251         with \<newline>, in case last byte of first block was NUL.
253 2008-06-03  Eric Blake  <ebb9@byu.net>
255         Fix printf type mismatches.
256         * m4/m4module.h (m4_bad_argc): Alter parameter type.
257         * m4/m4private.h (struct m4_call_info): Alter call_id type.
258         * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
259         specifiers.
260         * m4/utility.c (m4_bad_argc): Likewise.
262         Borrow bootstrap ideas from gnulib.
263         * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
264         advertized subset of languages didn't work.  Use --skip-po
265         instead, for consistency with gnulib bootstrap.
266         (func_get_translations): Use rsync, not wget.
267         (func_update_po): Use a reference directory, to avoid changing
268         timestamps on unchanged .po files.
269         * TODO: Update accordingly.
271         Fix fallout from previous patch.
272         * doc/m4.texinfo (Builtin): Adjust expected output.
274 2008-06-02  Eric Blake  <ebb9@byu.net>
276         Stage 24c: Improve display of macro names with embedded NUL.
277         Quote instances of problematic characters in macro names when
278         presented to user.  Track location via call_info rather than
279         munging context for every expansion.
280         Memory impact: none.
281         Speed impact: slight penalty, due to more bookkeeping.
282         * m4/m4module.h (m4_push_string_init): Add parameters.
283         * m4/m4private.h (struct m4_macro_args): Remove argv0 and
284         argv0_len, now redundant with info.
285         (m4__push_wrapup_init): Add parameter.
286         * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
287         location from caller, rather than context.
288         (composite_peek, composite_read, match_input): Adjust callers.
289         * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
290         (m4_verror_at_line): Allow NUL in macro name.
291         * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
292         in trace.
293         (expand_macro): No longer munge context location.
294         (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
295         (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
296         * modules/gnu.c (builtin, indir): Likewise.
297         * tests/null.m4: Enhance test.
298         * tests/null.err: Adjust expected output.
299         * tests/null.out: Likewise.
301         Stage 24b: Allow embedded NUL in macro names.
302         Use length rather than NUL-termination when tracking macro names.
303         All APIs dealing with symbol table changed.
304         Memory impact: none.
305         Speed impact: slight penalty, due to more bookkeeping.
306         * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
307         (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
308         (m4_symbol_rename, m4_symbol_delete): Add length parameter.
309         (m4_string): New type.
310         * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
311         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
312         length.
313         * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
314         (m4__symtab_remove_module_references, symbol_destroy_CB)
315         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
316         (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
317         (m4_symbol_delete): Likewise.
318         * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
319         passing length.
320         * m4/macro.c (expand_token): Adjust all callers.
321         * m4/module.c (install_builtin_table, install_macro_table):
322         Likewise.
323         * m4/utility.c (m4_symbol_value_lookup): Likewise.
324         * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
325         * modules/m4.c (define, undefine, pushdef, popdef)
326         (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
327         (traceon, traceoff): Likewise.
328         * src/main.c (main): Likewise.
329         * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
330         * tests/freeze.at (reloading nul): Augment test.
331         * tests/null.out: Adjust expected output.
333         Stage 24a: Use full call context in error reporting.
334         Replace const char *macro_name with const m4_call_info *call, so
335         that the next patch can pass the length of macro_name with
336         embedded NUL.  Simplifies handling of global state.
337         Memory impact: none.
338         Speed impact: none noticed.
339         * m4/m4module.h (m4_error, m4_warn): Change parameter type.
340         (m4_error_at_line, m4_warn_at_line): Delete.
341         (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
342         (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
343         * m4/m4private.h (m4__next_token): Likewise.
344         * m4/utility.c (m4_verror_at_line): Alter parameter, and use
345         caller's location if caller is provided.
346         (m4_error, m4_warn): Change parameter type.
347         (m4_error_at_line, m4_warn_at_line): Delete.
348         (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
349         (m4_symbol_value_lookup): Adjust all callers.
350         * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
351         * m4/input.c (m4_skip_line, m4__next_token): Likewise.
352         * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
353         (process_macro): Likewise.
354         * modules/m4.h (m4_make_temp_func): Likewise.
355         * modules/evalparse.c (m4_evaluate): Likewise.
356         * modules/format.c (arg_int, arg_long, arg_double, format):
357         Likewise.
358         * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
359         (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
360         (renamesyms, syncoutput, regexp_compile, substitute)
361         (regexp_substitute, m4_resyntax_encode_safe): Likewise.
362         * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
363         (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
364         (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
365         Likewise.
366         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
367         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
368         Likewise.
369         * tests/options.at (--syncoutput): Add test for invalid
370         command-line argument.  Split xfailed portion...
371         (--syncoutput and diversions): ...into new test.
372         (unknown option): New test.
373         * tests/freeze.at (reloading unknown builtin): Update expected
374         output.
376         Adjust to recent gnulib change.
377         * configure.ac (AB_INIT): Delete, now that gnulib does this.
379 2008-05-28  Eric Blake  <ebb9@byu.net>
381         Improve frozen debugmode behavior.
382         * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
383         * src/main.c (main): Interleave -d with files.
384         * tests/options.at (--debugmode): Update test.
385         * tests/freeze.at (reloading debugmode): New test.
386         * doc/m4.texinfo (Debugging options, Debugmode): Document the
387         change.
388         * NEWS: Likewise.
390 2008-05-27  Eric Blake  <ebb9@byu.net>
392         Fix some testsuite failures on Solaris 8.
393         * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
394         broken.
395         * tests/others.at (stderr closed): Likewise.  Also support Solaris
396         wording for EBADF.
397         (stdin closed): Skip test if closed stdin gets reopened.
398         (stdout closed): Support Solaris wording for EBADF.
399         * tests/testsuite.at (AT_CHECK_M4): Likewise.
401         Fix configure message nesting, broken since 2001-09-20.
402         * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
403         not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
405         Support 'make dist' with BSD make.
406         * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
407         of the generated file tests/generated.at.
408         (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
409         * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
411 2008-05-24  Eric Blake  <ebb9@byu.net>
413         Test NUL in frozen files.
414         * tests/testsuite.at (AT_CHECK_M4): Add parameter.
415         * tests/freeze.at (reloading nul): New test.
416         (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
417         (reloading unknown builtin): Likewise.
419 2008-05-23  Eric Blake  <ebb9@byu.net>
421         Improve handling of frozen file errors.
422         * src/freeze.c (produce_frozen_state): Detect write failures.
423         (reload_frozen_state): Use close_stream.
424         * tests/freeze.at (freezing failure): New test.
425         * THANKS: Update.
426         Reported by Jean-Charles Longuet.
428 2008-05-19  Eric Blake  <ebb9@byu.net>
430         In frozen file, split consecutive strings with newline.
431         * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
432         (produce_frozen_state): Likewise for 'Q', 'C'.
433         (reload_frozen_state): Parse the new layout.
434         [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
435         * tests/freeze.at (loading format 2): Rewrite to new format.
436         (reloading unknown builtin): Likewise.
437         (loading format 1): Make sure backslash-newline is not
438         interpreted.
439         * doc/m4.texinfo (Frozen file format 2): Document the format.
440         * NEWS: Document this change.
442         Fix xgettext options.
443         * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
444         xgettext.
446         Fix spelling of René Seindal's name in --version output.
447         * ltdl/m4/gnulib-cache.m4: Import propername module.
448         * src/main.c (AUTHORS): Rewrite in terms of proper_name.
449         * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
450         * HACKING: Mention new prerequisite of gperf.
452 2008-05-18  Eric Blake  <ebb9@byu.net>
454         Allow freezing the trace status of macros.
455         * src/freeze.c (produce_symbol_dump): Let undefined traced macros
456         through.
457         (dump_symbol_CB): Also freeze trace state.
458         * tests/freeze.at (reloading traced macros): New test.
459         * doc/m4.texinfo (Using frozen files): Update documentation to
460         mention new state.
461         (Frozen file format 1): Improve synchronization with branch.
462         (Frozen file format 2): Reorder directives, and add `d', `t'.
463         * NEWS: Document this change.
465 2008-05-15  Eric Blake  <ebb9@byu.net>
467         Fix frozen file regression in pushdef stacks from 2001-09-01.
468         * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
469         just the current definition.
470         (reverse_symbol_value_stack): New helper method.
471         * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
472         (reloading pushdef stack): New test.
473         (reloading unknown builtin): Enhance test.
475 2008-05-13  Eric Blake  <ebb9@byu.net>
477         Fix frozen file regression in diversions from 2007-01-21.
478         * m4/output.c (insert_diversion_helper): Add parameter.
479         (m4_insert_file): Move contents...
480         (insert_file): ...to this new helper, with added parameter.
481         (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
482         Update callers.
483         * src/freeze.c (produce_mem_dump): Simplify.
484         * tests/freeze.at (large diversion): Test for this.
486         Improve error message when frozen file is invalid.
487         * src/freeze.c (decode_char): Add parameter.  Allow \<newline>
488         line continuations.
489         (reload_frozen_state): Track current line.
490         * tests/freeze.at (loading format 1, loading format 2): Update to
491         test this.
493 2008-05-10  Eric Blake  <ebb9@byu.net>
495         Detect integer overflow when loading frozen file.
496         * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
497         immediately on overflow.
498         * tests/freeze.at (loading format 2): Test this.
499         Reported by Jim Meyering.
501 2008-05-08  Eric Blake  <ebb9@byu.net>
503         Stage 23: allow tracing of indirect macro calls.
504         Track all trace information as part of the argv struct, rather
505         than temporarily resetting global state.  Teach indir to trace
506         macros that it invokes.
507         Memory impact: slight penalty, due to larger argv struct.
508         Speed impact: none noticed.
509         * m4/m4module.h (m4_input_block): Remove.
510         (m4_call_info): New opaque type.
511         (m4_trace_prepare, m4_arg_info): New prototypes.
512         (m4_macro_call, m4_push_string_finish, m4_input_print): Change
513         prototypes.
514         * m4/m4private.h (struct m4_macro_args): Add info field.
515         (struct m4_call_info): New structure.
516         (m4_arg_info): New accessor.
517         * m4/input.c (m4_input_block): Make typedef local.
518         (m4_push_string_init): Initialize length.
519         (m4_push_string_finish, m4_input_print): Change signature, so that
520         printing can be done before finalization.
521         (struct input_funcs): Add parameter to print_func.
522         (file_print, string_print, composite_print): Adjust accordingly.
523         * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
524         Change signatures for stacked trace messages, and for using call
525         context.
526         (trace_prepre): Export and rename...
527         (m4_trace_prepare): ...to this, for use by indir.  Alter signature
528         to use call context.
529         (collect_arguments): Alter signature, to manage new field.
530         (expand_macro): Change call context management.  Move tracing...
531         (m4_macro_call): ...here.  Remove redundant parameter.
532         (m4_arg_argc): New function.
533         (m4_make_argv_ref): Replace unused skip parameter with new trace
534         parameter; manage new field.
535         * modules/gnu.c (builtin, indir): Adjust callers.
536         * src/main.c (usage): Update debugmode flag summary.
537         * tests/null.m4: Enhance test.
538         * tests/null.err: Update expected output.
539         * tests/macros.at (Tracing Hanoi Towers): Likewise.
540         * doc/m4.texinfo (Trace): Mention more about trace formatting.
541         (Debugmode): Enhance description of 'c' and 'x'.  Enhance test to
542         cover line numbering details in traces.
543         (Debuglen): Enhance test to cover indir tracing.
544         * NEWS: Mention these changes.
545         Reported by Akim Demaille in the autoconf TODO file in 2000.
547 2008-05-07  Eric Blake  <ebb9@byu.net>
549         Test for traceon regression just fixed in branch-1.6.
550         * doc/m4.texinfo (Trace): Enhance test.
551         * NEWS: Port news item from branch.
553 2008-05-05  Eric Blake  <ebb9@byu.net>
555         Stage 22: allow builtin token concatenation outside $@.
556         Adjust the input and argument parsing engines to append builtins
557         alongside text.  Make define warn when builtins must be
558         flattened.
559         Memory impact: slight penalty, with fewer builtins flattened.
560         Speed impact: slight penalty, from more bookkeeping.
561         * m4/m4module.h (m4_is_arg_composite): New prototype.
562         (m4_symbol_value_copy): Change return type.
563         (m4_arg_text): Add parameter.
564         (M4ARG): Adjust callers.
565         * m4/m4private.h: Adjust comments.
566         * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
567         flattened.
568         * m4/input.c (init_builtin_token): Add parameter, and allow
569         concatenating builtins.
570         (m4__next_token): Adjust caller.
571         * m4/macro.c (m4_is_arg_composite): New function.
572         (expand_argument): Allow builtin concatenation.
573         (m4_arg_text): Add parameter.
574         (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
575         (m4_arg_equal): Fix comparison of builtin tokens.
576         * modules/m4.c (define, pushdef): Warn when flattening builtins.
577         * doc/m4.texinfo (Define): Remove dead comment.
578         (Defn): Update to reflect code changes.
579         * tests/builtins.at (defn): Remove xfail.
580         * NEWS: Document this change.
582 2008-05-03  Eric Blake  <ebb9@byu.net>
584         Document define_blind.
585         * doc/m4.texinfo (Ifelse): Add a new composite macro.
586         * THANKS: Update.
587         Suggested by Mike R.
589 2008-05-01  Eric Blake  <ebb9@byu.net>
591         Avoid -Wshadow compiler warnings.
592         * m4/output.c (threshold_diversion_CB): s/div/diversion/.
593         * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
594         (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
595         (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
596         (m4_push_arg, m4__push_arg_quote): s/index/arg/.
597         * modules/format.c (format): Likewise.
598         * modules/m4.c (ifelse): Likewise.
600         Improve debugmode testing, based on recent branch-1.6 regressions.
601         * doc/m4.texinfo (Debugmode): Enhance tests.
602         * tests/generate.awk: Run tests from stdin, not input.m4.  Support
603         stderr munging when using -I examples.
605         Fix regression in define from 2008-02-22.
606         * m4/m4module.h (m4_symbol_value_copy): Add parameter.
607         * m4/symtab.c (m4_symbol_value_copy): Support copying $@
608         back-references.
609         * m4/macro.c (expand_argument): Update callers.
610         * modules/m4.c (define, pushdef): Likewise.
611         * tests/builtins.at (define): Enhance test to catch this.
613 2008-04-21  Eric Blake  <ebb9@byu.net>
615         Simplify previous patch.
616         * tests/m4.in: Compress assignment.
617         Suggested by Gary V. Vaughan.
619         Fix --disable-shared testsuite regression from previous patch.
620         * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
621         will also work.
623         Fix spelling of attribution to Christopher Strachey.
624         * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
625         * THANKS: Update.
626         Reported by Fernando Carrijo.
628 2008-04-17  Eric Blake  <ebb9@byu.net>
630         Fix testsuite bug when SIGPIPE is ignored.
631         * tests/builtins.at (divert): Consume all of m4's output, to avoid
632         spurious write failure.
633         * src/main.c (main): In batch mode, restore default handling of
634         SIGPIPE.
635         * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
636         * THANKS: Update.
637         Reported by Bob Proulx, via his autobuilder.
639 2008-04-15  Eric Blake  <ebb9@byu.net>
641         Fix 'make installcheck' after './configure --prefix-progname'.
642         * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
643         program name.
644         (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
645         * tests/builtins.at (patsubst): Avoid space-tab.
646         (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
647         * tests/options.at (--debugfile): Likewise.
648         * tests/others.at (stdin seekable): Likewise.
649         (fstab): Avoid space-tab.
650         * Makefile.am (installcheck-local): Accomodate transformed name.
651         (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
652         during 'make distcheck'.
653         * cfg.mk: New file, borrowed from branch.
655         Update prerequisite tools to match recent releases.
656         * configure.ac (AC_PREREQ): Rely on released autoconf.
657         (LT_PREREQ): Rely on released libtool.
658         * tests/testsuite.at (m4_version_prereq): Update dependence.
659         * bootstrap: Mention prerequisites.
661         Work around OS/2 limitation of printf(1).
662         * tests/null.m4: Use m4, not printf, to generate NUL byte.
663         * tests/null.out: Check for esyscmd failure.
664         Reported by Elbert Pol.
666 2008-04-14  Eric Blake  <ebb9@byu.net>
668         Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
669         Improve arg_print to handle builtin tokens when printing to a
670         known chain, rather than always flattening builtins.  This allows
671         m4wrap and $@ back-references to handle embedded builtin tokens.
672         Memory impact: none.
673         Speed impact: slight penalty, from more bookkeeping.
674         * m4/m4module.h (m4_push_builtin): Add parameter.
675         (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
676         (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
677         * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
678         (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
679         ...to these, in some cases adding a parameter.
680         (m4__append_builtin): New prototype.
681         * m4/builtin.c (m4_builtin_print): Alter signature to print
682         builtin to a growing symbol chain.
683         * m4/symtab.c (m4__symbol_value_print): Alter signature.
684         (m4_symbol_print, dump_symbol_CB): Adjust callers.
685         * m4/input.c (builtin_peek, builtin_read, builtin_unget)
686         (builtin_print, builtin_funcs): Delete, handled via composite
687         blocks now.
688         (struct m4_input_block): Delete u.builtin member.
689         (init_builtin_token): Only use composite block.
690         (m4__append_builtin): New function.
691         (m4_push_builtin, m4__push_wrapup_init): Alter signature.
692         (m4__push_symbol): Allow builtin tokens.
693         (m4__push_wrapup_finish): Rename.
694         (composite_print, m4_print_token): Adjust callers.
695         * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
696         tokens.
697         (m4__arg_print): Alter signature.
698         (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
699         callers.
700         * modules/m4.c (m4wrap): Allow builtin tokens.
701         (defn, errprint): Adjust callers.
702         * modules/gnu.c (builtin): Likewise.
703         * doc/m4.texinfo (M4wrap): New test.
704         (Debuglen): Adjust expected output.
706         Stage 21a: Optimize checks for end of input.
707         Create a new polymorphic input block type, which always fails with
708         CHAR_EOF, so that remaining input routines no longer have to check
709         for NULL input block.
710         Memory impact: none.
711         Speed impact: noticeable improvement, from fewer conditionals.
712         * m4/input.c (eof_funcs, input_eof): New objects.
713         (eof_peek, eof_read, eof_unget): New functions.
714         (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
715         (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
716         (m4_input_exit): Use placeholder to guarantee non-NULL isp and
717         wsp.
718         (next_char): Rename retry to allow_unget, and change sense for
719         easier manipulation.  All callers changed.
721         Improve OS/2 detection.
722         * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
723         are defined, not just the first.  The testsuite ensures that
724         exactly one gets defined.
725         * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
726         what other pre-defined macros it has.
727         * THANKS: Update.
728         Reported by Elbert Pol.
730         Ensure __m4_version__ is unquoted.
731         * tests/builtins.at (__m4_@&t@version__): Augment test.
733         Avoid GNU make failure on tarball.
734         * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
736 2008-04-10  Eric Blake  <ebb9@byu.net>
738         Allow back-referenced macro names; fixes 2008-03-13 regression.
739         * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
740         * m4/utility.c (m4_symbol_value_lookup): Change signature.
741         * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
742         Adjust all callers.
743         * tests/others.at (ifndef): New test.
745         Be namespace clean for M4 version; fixes 2008-04-08 regression.
746         * configure.ac (version): Rename...
747         (M4_VERSION): ...to this, since using 'version' broke po.m4.
749 2008-04-09  Eric Blake  <ebb9@byu.net>
751         Mention 1.4.11 release.
752         * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
753         (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
754         (Format): Add test of C99 hex-float parsing.
755         * NEWS: Mention 1.4.11 release.
756         * tests/builtins.at (divert): Add additional test.
758 2008-04-08  Eric Blake  <ebb9@byu.net>
760         Overhaul inter-version releases to work with git.
761         * configure.ac (version): New variable, which has nicer version
762         contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
763         (TIMESTAMP): Delete, since CVS id expansion died with transition
764         to git.
765         (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
766         * build-aux/mkstamp: Delete, no longer used.
767         * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
768         rebuilds when timestamps don't matter.
769         (MKSTAMP): Delete, no longer used.
770         (EXTRA_DIST): No longer worry about mkstamp.
771         (.version): New rule and distributed file.
772         (doc/m4.1, tests/package.m4): Depend on .version, not
773         configure.ac, for timestamp.
774         * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
775         * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
776         * src/main.c (main): Likewise.
778 2008-03-28  Eric Blake  <ebb9@byu.net>
780         Use GNUmakefile module.
781         * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
782         * Makefile.am: Split off maintainer rules...
783         * maint.mk: ...into this new file.
785 2008-03-18  Eric Blake  <ebb9@byu.net>
787         Stage 20b: make m4wrap obey POSIX fifo ordering.
788         Improve input engine to support location changes within symbol
789         chains, then convert m4wrap to always build symbol chain.
790         Memory impact: none.
791         Speed impact: slight penalty, from more m4wrap bookkeeping.
792         * m4/m4module.h (m4_wrap_args): Add prototype.
793         * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
794         (struct m4__symbol_chain): Add struct u_l.
795         * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
796         new link type.
797         (composite_peek, composite_read, composite_clean): Handle location
798         link.
799         * m4/macro.c (m4_wrap_args): New function.
800         * modules/m4.c (m4wrap): Use it.
801         * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
802         (Extensions): Document extension of multiple arguments.
803         (Location, Improved m4wrap): Adjust example to match FIFO order.
804         * tests/builtins.at (wrap): Likewise.
805         * NEWS: Document this change.
807 2008-03-17  Eric Blake  <ebb9@byu.net>
809         Stage 20a: reduce unget's in input engine.
810         Now that out-of-range input placeholders like CHAR_BUILTIN are
811         consumed outside of next_char, next_token should always consume
812         rather than peek at the first character.  Fewer peeks results in
813         less ungetc overhead.
814         Memory impact: none.
815         Speed impact: noticeable improvement, from fewer function calls.
816         * m4/input.c (struct input_funcs): Alter read_func prototype.
817         (next_char, file_read, buildin_read, string_read, composite_read):
818         Add allow_argv parameter.
819         (init_builtin_token, init_argv_symbol): Require all prior input to
820         be consumed.
821         (m4_skip_line, match_input, consume_syntax): Adjust callers.
822         (m4__next_token): Consume first byte without peek.
824         Update for fresh bootstrap.
825         * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
827 2008-03-15  Eric Blake  <ebb9@byu.net>
829         Document join, in order to fix bug in m4wrap example.
830         * examples/join.m4: New file.
831         * examples/wraplifo2.m4: Likewise.
832         * Makefile.am (EXTRA_DIST): Add new files.
833         * doc/m4.texinfo (Improved m4wrap): New node.
834         (Defn, Location): Enhance tests.
835         (Shift): Document the composite macro join.
836         (Incompatibilities): Move documentation of LIFO vs. FIFO...
837         (M4wrap): ...here, to match improved example.
839 2008-03-13  Eric Blake  <ebb9@byu.net>
841         Stage 19c: allow builtin tokens in more macros.
842         Allow builtin tokens inside symbol chains, although for now, they
843         are not allowed inside comments or quotes.  Enable builtin token
844         handling in more macros, if only to consistently diagnose invalid
845         macro names.
846         Memory impact: none.
847         Speed impact: slight impact, due to more bookkeeping.
848         * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
849         prototypes.
850         * m4/m4private.h (enum m4__symbol_chain_type): Add
851         M4__CHAIN_FUNC.
852         (struct m4__symbol_chain): Add builtin member.
853         * m4/utility.c (m4_symbol_value_lookup): New method.
854         * m4/builtin.c (m4_builtin_print): New function.
855         * m4/symtab.c (m4_symbol_value_print): Use it.
856         * m4/input.c (builtin_print): Likewise.
857         (m4__push_symbol): Allow pushing builtin tokens.
858         (composite_peek, composite_read, composite_unget, composite_clean)
859         (composite_print): Handle builtin tokens.
860         (init_builtin_token): Allow builtin tokens from composite input.
861         (m4__next_token): Flatten builtins inside comment or string.
862         * m4/macro.c (expand_argument): Strengthen assertion.
863         (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
864         Handle builtin tokens.
865         (arg_symbol): Add parameter, and allow NULL level.
866         (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
867         (m4_arg_text): Ensure all builtins have been flattened.
868         * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
869         (undefine, m4_dump_symbols): Warn on invalid macro names.
870         (ifdef, ifelse, shift): Handle builtin tokens.
871         * modules/gnu.c (m4symbols): Likewise.
872         * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
873         behavior.
874         (Debuglen): Likewise, and remove xfail.
875         * NEWS: Mention the change.
877         Stage 19b: invert sense of bit for handling builtin tokens.
878         Pass builtin tokens by default, rather than as the exception, so
879         that the logic can consistently refer to flattening arguments.
880         Memory impact: none.
881         Speed impact: none.
882         * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
883         (M4_BUILTIN_GROKS_MACRO): Rename...
884         (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
885         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
886         (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
887         this.
888         * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
889         (m4_symbol_value_groks_macro): Likewise...
890         (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
891         this.
892         * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
893         (m4_symbol_value_flatten_args): ...to this.
894         * m4/macro.c (collect_arguments): Accomodate changed sense.
895         * m4/module.c (m4__module_open): Require arguments if flattening
896         is requested.
897         * m4/input.c (m4_push_string_finish): For now, flatten all
898         builtins pushed as back-references.
899         * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
900         * modules/import.c (m4_builtin_table): Likewise.
901         * modules/load.c (m4_builtin_table): Likewise.
902         * modules/modtest.c (m4_builtin_table): Likewise.
903         * modules/mpeval.c (m4_builtin_table): Likewise.
904         * modules/perl.c (m4_builtin_table): Likewise.
905         * modules/shadow.c (m4_builtin_table): Likewise.
906         * modules/stdlib.c (m4_builtin_table): Likewise.
907         * modules/time.c (m4_builtin_table): Likewise.
908         * modules/m4.c (m4_builtin_table): Likewise.
909         (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
910         are stringized without preprocessor expansion.
911         * doc/m4.texinfo (Defn): Update comments to match reality.
912         (Debuglen): Update test now that user macros pass builtin tokens.
914         Stage 19a: sort and cache builtins loaded by a module.
915         Rather than repeatedly using dlsym to browse the builtin table,
916         copy off the table at module load time.  Then, the input engine
917         merely refers to the copy instead of duplicating information.
918         Memory impact: slight penalty, due to more memory per module, but
919         offset by less memory in input engine.
920         Speed impact: slight improvement, due to faster builtin lookups.
921         * m4/m4module.h (m4_set_symbol_value_builtin): Delete.  Use
922         m4_builtin_find_by_* instead.
923         (m4_builtin_find_by_func): Change return type.
924         * m4/m4private.h (m4__builtin): New struct.
925         (m4_module): Add sorted list of loaded builtins.
926         (struct m4_symbol_value): Change type of builtin value.
927         (m4__set_symbol_value_builtin): New prototype and fast accessor.
928         (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
929         new field type.
930         * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
931         (m4__set_symbol_value_builtin): ...and populate additional fields,
932         based on new type.
933         (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
934         new field type.
935         * m4/module.c (install_builtin_table): Use cached table.
936         (compare_builtin_CB): New helper function.
937         (m4__module_open): Populate table.
938         (module_remove): Free table.
939         * m4/builtin.c (compare_builtin_name_CB): New helper function.
940         (m4_builtin_find_by_name): Rewrite to use sorted table.
941         (m4_builtin_find_by_func): Change return type.
942         * m4/input.c (struct m4_input_block): Simplify u_b, since most
943         fields can be determined from builtin.
944         (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
945         (m4__next_token): Alter parsing so that only init_builtin_token
946         consumes a builtin.
947         (builtin_print, m4_push_builtin): Adjust all users.
948         * tests/macros.at (Arity, defn, and freeze): Fix typo.
950         Consistently cast malloc results, for C++ compilation.
951         * m4/builtin.c (m4_builtin_find_by_name): Add cast.
952         * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
953         (m4_hash_resize, maybe_grow): Likewise.
954         * m4/m4.c (m4_create): Likewise.
955         * m4/macro.c (expand_macro): Likewise.
956         * m4/output.c (m4_tmpname): Likewise.
957         * m4/path.c (search_path_add): Likewise.
958         * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
959         (symtab_fetch): Likewise.
960         * m4/syntax.c (m4_syntax_create): Likewise.
961         * modules/gnu.c (regexp_compile): Likewise.
962         * src/main.c (main): Likewise.
963         * src/freeze.c (reload_frozen_state): Likewise.
965 2008-03-06  Eric Blake  <ebb9@byu.net>
967         Fix nested builtin(`shift',$@) regression from 2008-02-23.
968         * m4/macro.c (make_argv_ref): Don't output expansion text when
969         making wrapper for builtin or indir.
970         * tests/builtins.at (builtin): New test.
971         * NEWS: Document the fix.
972         Reported by Andreas Schwab.
974 2008-03-04  Eric Blake  <ebb9@byu.net>
976         The gnulib module free was deprecated.
977         * ltdl/m4/gnulib-cache.m4: Remove free module.
979 2008-02-29  Eric Blake  <ebb9@byu.net>
981         Import news from 1.4.10b.
982         * NEWS: Update from branch.
984 2008-02-23  Eric Blake  <ebb9@byu.net>
986         Stage 18: try harder to reuse argv in recursion.
987         When pushing arguments that contain an existing $@ ref, reuse the
988         ref rather than creating another layer of wrappers.
989         Memory impact: noticeable improvement, due to better $@ reuse.
990         Speed impact: noticeable improvement, due to O(n^2) to O(n)
991         reduction in unboxed recursion.
992         * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
993         (m4_push_args): Let make_argv_ref take care of pending data.
994         * doc/m4.texinfo (Improved foreach): Tweak wording to match new
995         performance capability.
996         * tests/others.at (recursion): Add tests to avoid performance
997         regression.
999 2008-02-22  Eric Blake  <ebb9@byu.net>
1001         Update NEWS.
1002         * NEWS: Document change to __gnu__ on 2008-02-11.
1004         Stage 17: pass argv through quoted strings.
1005         Allow the concatenation of $@ references with other text input
1006         inside quoted contexts, which requires distinguishing between a
1007         wrapper around many arguments vs. a reference serving as part of a
1008         single argument.  Also optimize based on whether argv contains
1009         builtin tokens that might need flattening to the empty string.
1010         Memory impact: noticeable improvement, due to O(n^2) to O(n)
1011         reduction from total reuse of $@ references.
1012         Speed impact: noticeable improvement, due to O(n^2) to O(n)
1013         reduction in boxed recursion.
1014         * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1015         (M4ARGLEN): Adjust definition.
1016         * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1017         (struct m4_symbol_value): Add wrapper and has_func members.
1018         (struct m4_macro_args): Add flatten and has_func members.
1019         * m4/input.c (append_quote_token): Return argv refs inside quoted
1020         strings.
1021         (init_argv_symbol): Populate new fields.
1022         * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1023         (m4_make_argv_ref): Likewise.
1024         (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1025         fields.
1026         (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1027         new parameter.
1028         * modules/m4.c (ifelse): Adjust caller.
1030 2008-02-22  Gary V. Vaughan  <gary@gnu.org>
1032         Fix regression in argument collection, from 2008-01-21.
1033         * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1034         undo argument collection optimisation for strings, so that
1035         m4_print_token doesn't abort when it otherwise receives an
1036         unprintable M4_SYMBOL_VOID type token.
1038 2008-02-20  Eric Blake  <ebb9@byu.net>
1040         Stage 16: cache quotes and improve m4_arg_print.
1041         Cache rather than always copying quotes when pushing $@ refs; in
1042         particular, reconstruct single-byte quotes on the fly.  Allow NUL
1043         through m4wrap.  Improve sharing of code that prints arguments.
1044         Memory impact: slight improvement, due to cached quotes.
1045         Speed impact: slight improvement, due to less copying.
1046         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
1047         (m4_arg_print): Adjust prototypes.
1048         (m4_dump_args): Delete.
1049         (m4_push_wrapup): Split...
1050         (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
1051         prototypes.
1052         * m4/m4private.h (struct m4_syntax_table): Add cached_quote
1053         member.
1054         (m4__quote_cache, m4__quote_uncache): New prototypes.
1055         * m4/syntax.c (m4_syntax_create): Initialize the cache.
1056         (m4__quote_cache): New function.
1057         (m4_set_syntax): Update caller.
1058         * m4/symtab.c (m4_symbol_value_print): Add parameter.
1059         (m4_symbol_print, dump_symbol_CB): Adjust all callers.
1060         * m4/utility.c (m4_dump_args): Delete; callers should use
1061         m4_arg_print instead.
1062         * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
1063         implementation, and allow embedded NUL.
1064         (m4_print_token, pop_input, composite_print, composite_peek):
1065         (composite_read, append_quote_token): Adjust all callers.
1066         * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
1067         Likewise.
1068         (m4_arg_print): Add parameters.
1069         (trace_pre): Rewrite in terms of m4_arg_print.
1070         * modules/m4.c (errprint): Likewise.
1071         (m4wrap): Rewrite to allow embedded NUL.
1072         (dumpdef): Adjust caller.
1073         * doc/m4.texinfo (Debuglen): Enhance debuglen test.
1074         * tests/null.m4: Test for NUL in m4wrap.
1075         * tests/null.out: Update expected output.
1077         Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
1078         * m4/utility.c (m4_verror_at_line): Properly terminate the string.
1079         Reported by Ralf Wildenhues.
1081         * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
1083 2008-02-19  Eric Blake  <ebb9@byu.net>
1085         Clean up example on filtering defined symbols.
1086         * doc/m4.texinfo (Foreach, Improved foreach): Document another
1087         shortcoming in foreach.m4, and improve filter example by using
1088         foreach2.m4.
1090         * src/main.c (usage): Fix typo.
1092 2008-02-18  Eric Blake  <ebb9@byu.net>
1094         Avoid some magic numbers.
1095         * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
1096         (CHAR_RETRY): Define in terms of UCHAR_MAX.
1097         * m4/syntax.c (m4_syntax_create, set_syntax_set)
1098         (reset_syntax_set, check_is_single_quotes)
1099         (check_is_single_comments, check_is_macro_escaped)
1100         (m4_set_quotes, m4_set_comment): Likewise.
1101         * modules/gnu.c (regexp_compile): Likewise.
1102         * modules/m4.c (translit): Likewise.
1103         * src/freeze.c (produce_syntax_dump): Likewise.
1104         Reported by Ralf Wildenhues.
1106 2008-02-16  Eric Blake  <ebb9@byu.net>
1108         Add regression test for multi-character quote recursion.
1109         * examples/foreach2.m4: Use $0 rather than spelling out name.
1110         * examples/foreachq2.m4: Likewise.
1111         * examples/forloop2.m4: Likewise.
1112         * examples/hanoi.m4: Likewise.
1113         * examples/trace.m4: Likewise.
1114         * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1115         (Improved foreach): Adjust dump from file.
1117         Stage 15: return argv refs back to collect_arguments.
1118         Collect an entire $@ reference at once rather than one argument at
1119         a time, outside of quotes (but inside quotes, $@ is still
1120         flattened for now).  The skip_last field allows concatenation of
1121         $@ with other text when collecting arguments.
1122         Memory impact: noticeable improvement, due to better reuse of $@.
1123         Speed impact: noticeable improvement, due to less parsing.
1124         * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
1125         (enum m4__token_type): Add M4_TOKEN_ARGV.
1126         (struct m4__symbol_chain): Add skip_last member to argv link.
1127         (m4__next_token): Add parameter.
1128         * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
1129         (composite_peek, m4__next_token): Add new parameter.
1130         (composite_read, append_quote_token): Support argv in quotes.
1131         (init_argv_symbol): New function.
1132         (m4__push_symbol, match_input, consume_syntax)
1133         (m4__next_token_is_open, m4_print_token): Adjust callers.
1134         * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
1135         (arg_mark, m4_arg_text, make_argv_ref): Likewise.
1136         (expand_argument, collect_arguments): Handle new token.
1137         (arg_symbol): Drill through $@ reference.
1138         * m4/syntax.c (set_quote_age): Detect disabled comments.
1139         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
1141 2008-02-15  Eric Blake  <ebb9@byu.net>
1143         * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
1145 2008-02-13  Eric Blake  <ebb9@byu.net>
1147         Fix texinfo grammar.
1148         * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
1149         (History): Use @: after abbreviations.
1150         (M4exit): Use correct Latin abbreviation.
1151         (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
1152         between sentences.
1154 2008-02-11  Eric Blake  <ebb9@byu.net>
1156         Allow builtin text macros to specify number of arguments.
1157         * m4/m4module.h (struct m4_macro): Add argument limits to builtin
1158         text macros.
1159         * m4/module.c (install_macro_table): Allow text macros to warn on
1160         extra arguments.
1161         * modules/gnu.c (m4_macro_table): Update all clients.
1162         * modules/load.c (m4_macro_table): Likewise.
1163         * modules/mpeval.c (m4_macro_table): Likewise.
1164         * modules/perl.c (m4_macro_table): Likewise.
1165         * modules/shadow.c (m4_macro_table): Likewise.
1166         * modules/traditional.c (m4_macro_table): Likewise.
1167         * modules/modtest.c (m4_macro_table): Likewise.  Also add text
1168         macros, for testing this.
1169         * doc/m4.texinfo (Standard Modules): Update text, and enhance
1170         test.
1171         * tests/modules.at (modules: text): New test.
1173         Fix regression in command line -D option, from 2006-08-25.
1174         * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
1175         * m4/m4module.h: Fix typo.
1176         * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
1177         of arguments.
1178         * tests/macros.at (Command line define): Enhance test.
1179         * tests/others.at (nul character): Enhance test.
1180         * tests/null.m4: Likewise.
1181         * tests/null.out: Likewise.
1183         Use gnulib's git-merge-changelog driver when available.
1184         * .gitattributes: Add merge attributes for ChangeLog.
1185         * bootstrap: Install driver, if not already present.
1187 2008-02-06  Eric Blake  <ebb9@byu.net>
1189         Fix security hole introduced 2007-11-23.
1190         * m4/utility.c (m4_verror_at_line): Properly escape macro names.
1191         * src/main.c (main): Manage quoteargs defaults.
1192         * doc/m4.texinfo (Indir): Document and test this.
1194         Using raw strtod is not portable.
1195         * ltdl/m4/gnulib-cache.m4: Import the strtod module.
1197 2008-02-02  Eric Blake  <ebb9@byu.net>
1199         Consistently use size_t for number of arguments.
1200         * m4/m4module.h (m4_builtin_func): Alter prototype.
1201         (struct m4_builtin): Adjust type of min_args, max_args.
1202         (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
1203         (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
1204         (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
1205         (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
1206         (m4_arg_print, m4_push_arg): Adjust all clients.
1207         * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
1208         (m4_macro_args): Adjust type of various fields.
1209         (m4__push_arg_quote): Adjust all clients.
1210         * m4/input.c (m4_pop_wrapup): Likewise.
1211         * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
1212         (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
1213         (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
1214         (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
1215         (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
1216         * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
1217         * modules/evalparse.c (m4_evaluate): Likewise.
1218         * modules/gnu.c (changesyntax): Likewise.
1219         * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
1220         (undivert, traceon, traceoff): Likewise.
1221         * modules/m4.h (m4_dump_symbols_func): Likewise.
1222         * modules/perl.c (perleval): Likewise.
1224         Stage 14b: allow pushing argv references.
1225         Push a $@ reference to the input engine in one go, rather than
1226         pushing each element.  For now, argument collection still gets one
1227         argument of a $@ at a time; but the penalties of this patch make
1228         it easier to manage $@ efficiently in future patches.
1229         Memory impact: noticeable penalty, due to larger struct and O(n)
1230         to O(n^2) on unboxed recursion.
1231         Speed impact: noticeable penalty, due to more bookkeeping.
1232         * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
1233         fields.
1234         (struct m4_macro_args): Add level field.
1235         (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
1236         * m4/input.c (m4__push_symbol, composite_peek, composite_read)
1237         (composite_unget, composite_clean, composite_print): Support $@
1238         refs.
1239         * m4/macro.c (collect_arguments): Populate new field.
1240         (expand_macro): Move argv cleanup...
1241         (m4__arg_adjust_refcount): ...to this new function.
1242         (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
1243         (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
1244         helper functions, to add parameters.
1245         (m4_push_args): Adjust caller.
1246         * m4/symtab.c (m4_symbol_value_print): Likewise.
1248         Stage 14a: allow printing argv references.
1249         Refactor symbol-value printing code for better sharing, and to
1250         allow printing a contiguous text representation of a $@ ref.
1251         Memory impact: none.
1252         Speed impact: none.
1253         * m4/m4module.h (m4_arg_print): New prototype.
1254         (m4_symbol_value_print): Alter prototype.
1255         * m4/input.c (struct input_funcs): Add parameter to peek_func.
1256         (file_peek, builtin_peek, string_peek): Ignore new parameter.
1257         (composite_peek): Ignore new parameter, for now.
1258         (composite_clean, pop_input): Rework to minimize indirection, and
1259         to avoid infinite recursion in next patch.
1260         * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
1261         (m4_arg_print): New function.
1262         * m4/symtab.c (m4_symbol_value_print): Update signature.
1263         (m4_symbol_print): Update caller.
1264         * m4/output.c (m4_shipout_string_trunc): Update comments.
1265         * m4/syntax.c (set_quote_age): Require comma as argument separator
1266         when dealing with $@ as a unit.
1267         * tests/builtins.at (ifelse): Augment test.
1268         * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
1270 2008-01-31  Eric Blake  <ebb9@byu.net>
1272         Kill hack for M4 1.4.4.
1273         * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
1274         we require new enough autoconf which in turn requires M4 1.4.5.
1276 2008-01-31  Gary V. Vaughan  <gary@gnu.org>
1277         and Eric Blake  <ebb9@byu.net>
1279         Depend on new libtool to use non-recursive build.
1280         * configure.ac (LT_PREREQ): Bump to alpha release version.
1281         (LTDL_INIT): Choose nonrecursive mode.  Perform sanity check that
1282         installed libtool has correct symbols.
1283         * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
1284         top level.
1285         (AM_CPPFLAGS): Drop directories covered by libtool.
1286         (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
1287         (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
1288         macros, used by libtool.
1289         (lib_LTLIBRARIES): Also used by libtool.
1290         (ltdl/libltdlc.la): Delete, now that libtool does this.
1291         * bootstrap: Mention new requirements.
1292         (LIBTOOLIZE): Provide default program, and run libtoolize prior to
1293         autoreconf.
1294         (autoreconf): Also neutralize libtoolize, since it is run early.
1295         * HACKING: Mention updated prerequisites.
1297 2008-01-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1299         Fix build failure if installed libltdl is used.
1300         * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
1302 2008-01-28  Eric Blake  <ebb9@byu.net>
1304         Depend on newer autoconf, for testsuite -C dir.
1305         * Makefile.am (CD_TESTDIR): Delete, no longer required.
1306         (check-local, installcheck-local, clean-local-tests): Use new -C
1307         option from autotest.
1308         * configure.ac (AC_PREREQ): Bump to 2.61a.347.
1309         * bootstrap: Mention new dependency.
1310         * HACKING: Likewise.
1312 2008-01-27  Eric Blake  <ebb9@byu.net>
1314         Stage 13: push composite text tokens.
1315         Support pushing composite tokens, allowing back-references to be
1316         reused through multiple macro expansions.  Add hueristic that
1317         avoids creating new reference when pushing existing references.
1318         Memory impact: noticeable improvement due to better reference
1319         reuse, except for O(n) to O(n^2) copying in boxed recursion.
1320         Speed impact: slight penalty, due to more bookkeeping.
1321         * m4/m4private.h (m4__push_symbol): Adjust prototype.
1322         * m4/input.c (m4__push_symbol): Add parameter, and support
1323         composite tokens.
1324         (append_quote_token): Add parameter, and support inlining of short
1325         text.
1326         (m4__next_token): Adjust caller.
1327         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1329 2008-01-26  Eric Blake  <ebb9@byu.net>
1331         Stage 12c: add macro for m4_arg_len.
1332         Make a common action easier to type.
1333         Memory impact: none.
1334         Speed impact: none.
1335         * m4/m4module.h (M4ARGLEN): New macro.
1336         * m4/macro.c (process_macro): Adjust all callers.
1337         * m4/utility.c (m4_dump_args): Likewise.
1338         * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1339         (substr): Likewise.
1340         * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1341         (renamesyms): Likewise.
1342         * modules/stdlib.c (setenv): Likewise.
1344         Stage 12b: add m4_string_pair.
1345         Make passing quote delimiters around more efficient.
1346         Memory impact: none.
1347         Speed impact: slight penalty, due to more bookkeeping.
1348         * m4/m4module.h (m4_string_pair): New type.
1349         (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1350         (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1351         Alter signature.
1352         * m4/m4private.h (struct m4_string): Delete.
1353         (struct m4_syntax_table): Combine quote and comment members.
1354         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1355         (m4_get_syntax_ecomm): Adjust accessors.
1356         (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1357         accessors.
1358         * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
1359         Alter signatures.
1360         * m4/input.c (string_print, composite_print, m4_input_print):
1361         All callers updated.
1362         * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
1363         (check_is_single_quotes, m4_set_quotes, set_quote_age)
1364         (m4_get_syntax_lquote, m4_get_syntax_rquote)
1365         (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
1366         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1367         (m4_get_syntax_comments): Likewise.
1368         * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
1369         * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
1370         Likewise.
1371         * modules/m4.c (dumpdef, m4_make_temp): Likewise.
1372         * src/freeze.c (produce_frozen_state): Likewise.
1373         * tests/freeze.at (reloading unknown builtin): Update test.
1375         Stage 12a: make m4_symbol_chain a union.
1376         Shrink size of symbol chains by using a union.
1377         Memory impact: slight improvement, due to smaller struct.
1378         Speed impact: slight improvement, due to less bookkeeping.
1379         * m4/m4private.h (enum m4__symbol_chain_type): New enum.
1380         (struct m4_symbol_chain): Rename...
1381         (struct m4__symbol_chain): ...to this, since it is internal.
1382         * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
1383         callers updated.
1384         * m4/input.c (struct m4_input_block, m4__push_symbol)
1385         (composite_peek, composite_read, composite_unget)
1386         (composite_clean, composite_print, m4__make_text_link)
1387         (append_quote_token): Likewise.
1388         * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
1389         (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
1390         (m4_push_args): Likewise.
1392 2008-01-23  Eric Blake  <ebb9@byu.net>
1394         Adjust to recent libtool interface change.
1395         * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
1396         (LT_WITH_LTDL): Delete, now that it is obsolete.
1397         (LTDL_INIT): Use new libtool macro.
1399 2008-01-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1400         and Eric Blake  <ebb9@byu.net>
1402         Rely on newer automake.
1403         * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
1404         distribution.
1405         * bootstrap: Update automake requirement.
1406         (func_version): Fix --version output, broken since 2007-08-06.
1407         * HACKING: Likewise.  Add lzma requirement.
1408         * Makefile.am (clean-local-src): Not needed any more with newest
1409         Automake.
1410         (clean-local): Adjust.
1411         * TODO: Remove completed item.
1413 2008-01-22  Eric Blake  <ebb9@byu.net>
1415         Doc tweak.
1416         * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
1417         example.
1419 2008-01-21  Eric Blake  <ebb9@byu.net>
1421         Stage 11: full circle for single argument references.
1422         Pass quoted strings through to argument collection in a single
1423         action, so that an argument can be reused throughout macro
1424         recursion if it remains unchanged.
1425         Memory impact: noticeable improvement, due to more reuse in
1426         argument collection stacks; O(n^2) to O(n) on boxed recursion.
1427         Speed impact: noticeable improvement, due to less copying.
1428         * m4/m4module.h (m4_arg_text): Add parameter.
1429         (M4ARG): Adjust.
1430         * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
1431         (m4__make_text_link): New prototype.
1432         (struct m4_symbol_chain): Add quote_age member.
1433         (struct m4_symbol_value): Add end member to chained symbol.
1434         (struct m4_macro_args): Add wrapper member.
1435         * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
1436         (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
1437         composite tokens.
1438         * m4/input.c (make_text_link): Rename...
1439         (m4__make_text_link): ...to this, and export.
1440         (m4_push_string_finish): Adjust caller.
1441         (make_text_link, m4__push_symbol): Update new field.
1442         (file_read, builtin_read, string_read, composite_read, next_char):
1443         Add parameter.
1444         (m4_skip_line, match_input, consume_syntax): Adjust callers.
1445         (append_quote_token): New function.
1446         (m4__next_token): Pass quoted strings onto argument collection.
1447         (m4_print_token) [DEBUG_INPUT]: Update.
1448         * m4/macro.c (expand_argument): Collect composite arguments.
1449         (collect_arguments): Update new field.
1450         (expand_macro): Reduce ref-count of back-references after use.
1451         (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
1452         names.
1453         (m4_is_arg_text): Also recognize composite symbols as text.
1454         (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
1455         (m4_arg_equal): Compare composite symbols.
1456         (m4_push_arg, m4_push_args): Handle composite symbols.
1457         (m4_arg_symbol): Relax assertion.
1458         (process_macro): Use single-argument references.
1459         * m4/output.c (m4_shipout_string_trunc): Update comment.
1460         * tests/macros.at (Rescanning macros): Augment test.
1462 2008-01-16  Eric Blake  <ebb9@byu.net>
1464         Stage 10: avoid extra copying of strings and comments.
1465         When collecting tokens that are immune to further expansion, avoid
1466         copying data from one obstack to another by outputting it into the
1467         destination obstack to begin with.  Also reduce copying done in
1468         format builtin.
1469         Memory impact: slight improvement, due to better obstack usage.
1470         Speed impact: noticeable improvement, due less data copying.
1471         * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
1472         modules.
1473         * m4/m4private.h (m4__token_type): Adjust prototype.
1474         * m4/input.c (m4__next_token): Support new parameter.
1475         * m4/macro.c (m4_macro_expand_input, expand_token)
1476         (expand_argument, collect_arguments): Adjust callers.
1477         * modules/m4.c (ntoa): Tighten buffer size.
1478         * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
1479         * modules/format.c (arg_int, arg_long, arg_double): New helper
1480         functions, to detect overflow or unparsed characters.
1481         (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
1482         missing or excess arguments.
1483         (format): Likewise, and also output directly into obstack if there
1484         is room.
1485         * doc/m4.texinfo (History): Update for new year.
1486         (Format): Test for new warnings.
1488 2008-01-15  Eric Blake  <ebb9@byu.net>
1490         * TODO: Update with some newer URLs.
1492         Verify linear `index'.
1493         * tests/builtins.at (index): New test.
1494         (translit): Make test take longer, to make quadratic algorithms
1495         more apparent.
1497 2007-12-20  Eric Blake  <ebb9@byu.net>
1499         Stage 9: share rather than copy single-arg refs.
1500         Use hooks of previous patch to create back-references to arguments
1501         in the input engine, and inline short text rather than always
1502         creating a FIFO link.  Also start testing embedded NUL behavior.
1503         Until the argument collection engine also shares references, the
1504         memory usage increases.
1505         Memory impact: noticeable penalty, due to longer life of argv
1506         changing O(n) to O(n^2) on boxed recursion.
1507         Speed impact: slight improvement, due less data copying.
1508         * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
1509         * m4/m4module.h (m4_arg_scratch): New prototype.
1510         * m4/m4private.h (m4__push_symbol): Add parameter.
1511         (m4_arg_scratch): Add fast accessor.
1512         (struct m4): Add expansion_level member, taken...
1513         * m4/macro.c (expansion_level): ...from here.  Adjust all users.
1514         (expand_argument): Minor cleanup.
1515         (expand_macro): Track scratch space per macro call.
1516         (m4_arg_scratch): New function.
1517         (m4_make_argv_ref): Call new function.
1518         (m4_push_arg): Push reference to $0.
1519         (m4_push_args): Rework separator usage, since separators will
1520         usually be inlined.
1521         (process_macro): Allow embedded NUL.
1522         * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
1523         (m4__push_symbol): Add parameter.  Inline short strings, and save
1524         references through rescanning.
1525         * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
1526         * modules/m4.c (errprint, index): Handle NUL transparently.
1527         (dumpdef, translit): Use scratch space, rather than expansion
1528         stack.
1529         * modules/gnu.c (renamesyms, m4symbols): Likewise.
1530         * tests/others.at (nul character): New test.
1531         (iso8859): Quote absolute file name, remove XFAIL.
1532         * tests/iso8859.m4: Avoid raw NUL in output.
1533         * tests/null.m4: New file.
1534         * tests/null.out: Likewise.
1535         * tests/null.err: Likewise.
1536         * Makefile.am (OTHER_FILES): Distribute new files.
1537         * .gitattributes: Treat new files as text.
1539 2007-12-17  Eric Blake  <ebb9@byu.net>
1541         Stage 8: extend life of references into argv.
1542         Add hooks to lengthen the lifetime of arguments reused in a macro
1543         expansion, rather than always discarding arguments at the end of
1544         expand_macro.  Rework the expand_macro obstacks to handle longer
1545         lifetimes.  For now, the hooks remain unused.
1546         Memory impact: slight penalty, due to larger structs.
1547         Speed impact: slight penalty, due to more bookkeeping.
1548         * m4/system_.h (obstack_regrow): Delete.
1549         * m4/m4private.h (struct m4_symbol_chain): Add level field.
1550         (m4__push_symbol): Adjust prototype.
1551         (m4__adjust_refcount): New prototype.
1552         (DEBUG_MACRO) [DEBUG]: New debug control.
1553         (struct m4__macro_arg_stacks): New structure.
1554         (struct m4): Add arg_stacks, stacks_count fields.
1555         * m4/m4module.h (m4_make_argv_ref): Add parameter.
1556         * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
1557         context->arg_stacks.
1558         (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
1559         conditional on M4_DEBUG_MACRO envvar.
1560         (collect_arguments): Adjust signature.
1561         (expand_macro): Rework obstack handling.
1562         (m4__adjust_refcount, arg_mark): New functions.
1563         (m4_make_argv_ref): Populate new field.
1564         (m4_push_arg, m4_push_args): Track inuse.
1565         (process_macro): One less cast.
1566         * m4/m4.c (m4_delete): Clean up arg_stacks.
1567         * m4/input.c (make_text_link): Use new field.
1568         (m4__push_symbol, file_clean): Update signature.
1569         (composite_read): Bump refcount when done with reference.
1570         (composite_clean): New function.
1571         (pop_input): Adjust caller.
1572         * m4/debug.c (m4_debug_message): Make assertion match comment.
1573         * modules/gnu.c (builtin, indir): Adjust callers.
1574         * tests/builtins.at (ifelse): New test.
1575         (exp): Move and rename...
1576         * tests/others.at (countdown): ...to this.
1577         * doc/m4.texinfo (Improved foreach): Fix tracing usage in
1578         example.
1580 2007-12-13  Eric Blake  <ebb9@byu.net>
1582         Yet more rewording.
1583         * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
1584         the previous patch.
1586         * THANKS: Update.
1588 2007-12-13  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
1590         * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
1591         example.
1592         Reported by Giovanni Toffetti.
1594 2007-12-11  Eric Blake  <ebb9@byu.net>
1596         Stage 7: use chained input support in input parser.
1597         Allow the LIFO input engine to rescan a macro expansion composed
1598         of smaller chunks of FIFO data, rather than the old approach of a
1599         monolithic string.  For now, all chunks are still copied.
1600         Memory impact: slight penalty, due to FIFO chain overhead.
1601         Speed impact: slight penalty, due to extra bookkeeping.
1602         * m4/m4private.h (m4__push_symbol): New prototype.
1603         (struct m4_symbol_chain): Add const-safety.
1604         * m4/symtab.c (m4_symbol_value_print): Simplify.
1605         (dump_symbol_CB): Update caller.
1606         * m4/input.c (struct m4_input_block): Alter u_c member, first
1607         introduced 2006-10-25, but unused until now.
1608         (composite_peek, composite_read, composite_unget)
1609         (composite_print, init_builtin_token): Rewrite accordingly.
1610         (m4_push_wrapup): No longer need trailing NUL.
1611         (m4__push_symbol, make_text_link): New functions.
1612         (m4_push_string_finish): Use them.
1613         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1614         (expand_macro): Simplify logic of nesting_limit.
1615         * src/main.c (main): Likewise.
1616         * doc/m4.texinfo (Dumpdef): Augment test.
1618 2007-12-08  Eric Blake  <ebb9@byu.net>
1620         Stage 6: convert builtins to push arg at a time.
1621         Add new methods to factor all builtins whose expansion includes an
1622         argument, making back-reference creation easier in future patches.
1623         Factor out length-limited printing to obstacks, and use -1 rather
1624         than 0 for unlimited length.
1625         Memory impact: none.
1626         Speed impact: slight improvement, due to better code sharing.
1627         * m4/m4module.h (m4_shipout_text): Rename...
1628         (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
1629         that does not worry about sync lines.
1630         (m4_shipout_string_trunc): New prototype.
1631         * m4/output.c (m4_shipout_text): Rename...
1632         (m4_divert_text): ...to this.
1633         (m4_shipout_string): Move guts...
1634         (m4_shipout_string_trunc): ...to this new function.
1635         * m4/macro.c (m4_push_arg, m4_push_args): New functions.
1636         (expand_token, process_macro): Update callers.
1637         * m4/input.c (string_print): Likewise.
1638         * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
1639         Likewise.
1640         * modules/gnu.c (patsubst): Likewise.
1641         (debuglen): Use SIZE_MAX for unlimited debug length.
1642         * src/main.c (main): Likewise.
1643         * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
1644         zero.
1646 2007-12-07  Eric Blake  <ebb9@byu.net>
1648         Minor security fix: Quote output of mkstemp.
1649         * modules/m4.c (m4_make_temp): Produce quoted output.
1650         * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
1651         tests.
1653         Stage 5: add notion of quote age.
1654         Cache the quoting rules that were in effect when a string was
1655         parsed, to avoid reparsing that string if no changequote or other
1656         quote age change took place in the meantime.  A quote_age of 0 is
1657         always safe, but does not benefit from caching.
1658         Memory impact: slight improvement, due to smaller struct in input
1659         engine.
1660         Speed impact: slight penalty, due to more bookkeeping.
1661         * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
1662         (m4_set_symbol_value_text): Adjust prototype.
1663         (m4_has_syntax): Factor out the unsigned char cast.
1664         * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
1665         quote_age members.
1666         (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
1667         functions at this point.
1668         (struct m4_symbol_value, struct m4_macro_args): Add quote_age
1669         member.
1670         (m4_set_symbol_value_text): Adjust fast accessor.
1671         (m4_get_symbol_value_quote_age): New fast accessor.
1672         * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
1673         (m4_get_symbol_value_quote_age): New function.
1674         (m4_symbol_value_copy): Adjust callers.
1675         * m4/macro.c (expand_token): Add parameter, and track quote age.
1676         (expand_argument, collect_arguments): Track quote age.
1677         (m4_macro_expand_input, process_macro, m4_make_argv_ref)
1678         (m4_macro_expand_input): Update callers.
1679         (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
1680         * m4/input.c: Comment cleanups.
1681         (struct m4_input_block): Reduce size.
1682         (m4__next_token): Report quote age.
1683         (m4_push_builtin, init_builtin_token): Update callers.
1684         * m4/utility.c (skip_space): Adjust callers.
1685         * m4/module.c (install_macro_table): Likewise.
1686         * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
1687         (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
1688         quote age.
1689         (set_quote_age): New helper function.
1690         (check_is_single_quotes, check_is_single_comments): Adjust
1691         callers.
1692         * src/freeze.c (reload_frozen_state): Likewise.
1693         * src/main.c (main): Likewise.
1694         * modules/m4.c (define, pushdef): No need to set macro text.
1695         * tests/builtins.at (changequote, defn): New tests.
1696         * examples/wrapfifo.m4: New file.
1697         * examples/wraplifo.m4: New file.
1698         * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
1700 2007-12-04  Eric Blake  <ebb9@byu.net>
1702         Fix builds with OpenBSD make.
1703         * Makefile.am (HELP2MAN): New macro.
1704         (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
1705         srcdir.
1706         * README: Update copyright.
1707         * HACKING: Mention help2man and makeinfo dependencies.
1709 2007-11-29  Eric Blake  <ebb9@byu.net>
1711         Stage 4: route indir, builtin through ref; make argv opaque.
1712         Finish making struct opaque to all but the input engine, by
1713         reworking obstack usage in expand_macro to better support creation
1714         of a $@ reference.  Canonicalize the empty argument, to allow
1715         pointer comparison optimizations.
1716         Memory impact: slight penalty, due to larger struct.
1717         Speed impact: slight improvement, due to fewer function calls.
1718         * m4/system_.h (obstack_regrow): Fix precedence.
1719         * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
1720         New prototypes.
1721         (struct m4_macro_args): Move...
1722         * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
1723         to modules.  Add has_ref member.
1724         (bool_bitfield): New helper typedef.
1725         (struct m4_symbol_chain): Add flatten and len members.
1726         * m4/macro.c (empty_symbol): New placeholder, for optimizing
1727         comparison with empty string.
1728         (m4_macro_expand_input): Initialize it.
1729         (collect_arguments): Alter signature, and populate new fields.
1730         (trace_pre, trace_post): Remove redundant parameter.
1731         (expand_macro): Alter handling of obstacks.
1732         (m4_arg_symbol): Account for wrapped argv.
1733         (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
1734         (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
1735         * modules/m4.c (ifelse, syscmd): Likewise.
1736         * modules/evalparse.c (m4_evaluate): Likewise.
1737         (undefine, popdef, m4_dump_symbols): Optimize.
1738         * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
1739         methods.
1740         (changesyntax, regexp): Optimize.
1741         * m4/output.c (diversion_storage): Use typedef.
1743         Stage 3b: cache length, rather than computing it, in modules.
1744         Use cached token length in builtins and output engine.
1745         Memory impact: none.
1746         Speed impact: noticeable improvement, due to fewer function calls.
1747         * m4/hash.c (m4_hash_remove): Avoid double free on remove
1748         failure.
1749         * m4/output.c (m4_shipout_string): Change semantics of len param.
1750         (m4_shipout_int): Use cached length.
1751         * m4/input.c (m4_push_string_finish): Likewise.
1752         * modules/m4.h (m4_make_temp_func): Add parameter.
1753         * m4/macro.c (expand_token, m4_arg_len): Use cached length.
1754         (collect_arguments, expand_macro): Alter signature.
1755         (trace_format): Don't use out-of-scope buffer.
1756         (process_macro): All callers changed.
1757         * m4/utility.c (m4_dump_args): Likewise.
1758         * m4/symtab.c (m4_symbol_value_print): Likewise.
1759         * modules/gnu.c (__file__, __program__, builtin, indir)
1760         (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
1761         renamesyms, patsubst, regexp, regexp_compile): Likewise.
1762         * modules/load.c (m4modules): Likewise.
1763         * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
1764         (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
1765         * modules/perl.c (perleval): Likewise.
1766         * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
1767         (hostname, uname, setenv): Likewise.
1768         * modules/mpeval.c (numb_obstack): Likewise.
1769         * src/freeze.c (dump_symbol_CB): Likewise.
1770         * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
1771         * tests/builtins.at (mkstemp): Likewise.
1772         * tests/others.at (iso8859): XFAIL this test, now that
1773         length-based handling allows NUL through part but not all of M4.
1775 2007-11-28  Eric Blake  <ebb9@byu.net>
1777         Stage 3a: cache length, rather than computing it, in libm4.
1778         Cache the length of a token in the input engine and symbol table,
1779         to avoid repeating lots of strlen calls.  Additionally, by using
1780         obstack length rather than strlen, the input engine can now
1781         support embedded NUL.
1782         Memory impact: slight penalty, due to larger struct.
1783         Speed impact: slight improvement, due to fewer function calls.
1784         * m4/m4module.h (struct m4_macro_args): Cache length.
1785         (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
1786         (m4_set_symbol_value_text): Change signature.
1787         * m4/m4private.h (struct m4_symbol_value): Store string length.
1788         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
1789         (m4_set_symbol_value_placeholder): Update accordingly.
1790         (m4_set_symbol_value_text): Change signature.
1791         (m4_get_symbol_value_len): New accessor.
1792         * m4/input.c (struct m4_input_block, string_peek, string_read)
1793         (string_unget, string_print, m4_push_string_finish)
1794         (m4_push_wrapup): Track length of string input.
1795         (m4__next_token): Adjust all users of symbol text to track length,
1796         too.
1797         * m4/macro.c (expand_argument, collect_arguments): Likewise.
1798         * m4/module.c (install_macro_table): Likewise.
1799         * modules/gnu.c (builtin, indir): Likewise.
1800         * modules/m4.c (define, pushdef): Likewise.
1801         * src/main.c (main): Likewise.
1802         * src/freeze.c (reload_frozen_state): Likewise.
1803         * m4/symtab.c (m4_symbol_value_copy): Likewise.
1804         (m4_get_symbol_value_len): New function.
1805         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
1806         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
1807         Adjust implementation.
1809 2007-11-27  Eric Blake  <ebb9@byu.net>
1811         Stage 2: use accessors, not direct reference, into argv.
1812         Outside of macro.c, use accessor methods rather than direct access
1813         into the argv struct.
1814         Memory impact: none.
1815         Speed impact: slight penalty, due to increased function calls.
1816         * m4/m4private.h (m4_arg_argc): New fast accessor.
1817         * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
1818         (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
1819         prototypes.
1820         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
1821         (m4_macro_call): Make argc unsigned.
1822         (M4ARG): Use new accessors.
1823         * modules/m4.c (define, pushdef): Likewise.
1824         (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
1825         (traceon, traceoff): Make argc unsigned.
1826         * modules/m4.h (m4_dump_symbols_func): Likewise.
1827         * modules/evalparse.c (m4_evaluate): Likewise.
1828         * modules/gnu.c (builtin, indir): Use new accessors.
1829         (changesyntax): Make argc unsigned.
1830         * modules/perl.c (perleval): Likewise.
1831         * m4/utility.c (m4_dump_args): Use new accessors.
1832         * m4/macro.c (trace_pre): Likewise.
1833         (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
1834         (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
1835         (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
1836         usage.
1838 2007-11-24  Eric Blake  <ebb9@byu.net>
1840         Stage 1: convert m4_symbol_value** into new object.
1841         Pass a variable-size wrapper structure instead of an array to
1842         builtins, so that subsequent optimizations in the structure need
1843         not impact every builtin client.
1844         Memory impact: slight penalty, since struct is larger than array.
1845         Speed impact: slight penalty, due to increased bookkeeping.
1846         * ltdl/m4/gnulib-cache.m4: Import flexmember module.
1847         * m4/m4module.h (m4_macro_args): New type, will be opaque to
1848         modules later.
1849         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
1850         (m4_macro_call): Alter signature to use m4_macro_args object.
1851         (M4ARG): Redefine to access new struct.
1852         * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
1853         (struct m4_symbol_chain): New type.
1854         (struct m4_symbol_value): Add chain alternative.
1855         * m4/macro.c (collect_arguments): Build new struct.
1856         (expand_macro, m4_macro_call, process_macro, trace_pre)
1857         (trace_post): Adjust implementation to use it.
1858         * m4/utility.c (m4_dump_args): Likewise.
1859         * modules/gnu.c (builtin, indir): Likewise.
1860         * modules/format.c (format): Likewise.
1861         * modules/m4.h (m4_dump_symbols_func): Likewise.
1862         * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
1863         (shift, include, errprint, m4wrap): Likewise.
1864         * modules/evalparse.c (m4_evaluate): Likewise.
1866         Pass only macro name to utility functions.
1867         * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
1868         * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
1869         implementation.
1870         * m4/macro.c (m4_macro_call): Adjust callers.
1871         * modules/gnu.c (builtin, debuglen): Likewise.
1872         * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
1873         (substr): Likewise.
1874         * modules/evalparse.c (m4_evaluate): Likewise.
1875         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
1876         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
1877         Likewise.
1879 2007-11-23  Eric Blake  <ebb9@byu.net>
1881         Add macro name to debugfile messages.
1882         * m4/m4module.h (m4_debug_set_output): Add parameter.
1883         * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
1884         name through.
1885         * modules/gnu.c (debugfile): Adjust caller.
1886         * modules/m4.c (m4exit): Likewise.
1887         * src/main.c (main): Likewise.
1889         Factor out handling of macro name in error messages.
1890         * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
1891         (m4_warn_at_line): Add new parameter.
1892         * m4/utility.c (m4_verror_at_line): New helper method.
1893         (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
1894         parameter.
1895         (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
1896         changed.
1897         * m4/debug.c: Likewise.
1898         * m4/input.c: Likewise.
1899         * m4/macro.c: Likewise.
1900         * m4/module.c: Likewise.
1901         * m4/output.c: Likewise.
1902         * m4/path.c: Likewise.
1903         * modules/evalparse.c: Likewise.
1904         * modules/format.c: Likewise.
1905         * modules/gnu.c: Likewise.
1906         * modules/load.c: Likewise.
1907         * modules/m4.c: Likewise.
1908         * modules/mpeval.c: Likewise.
1909         * src/freeze.c: Likewise.
1910         * src/main.c: Likewise.
1912 2007-11-14  Eric Blake  <ebb9@byu.net>
1914         Handle some defn corner cases differently.
1915         * doc/m4.texinfo (Defn): Update documentation; although this still
1916         doesn't match the branch, since it may be changed before 2.0.
1917         * m4/macro.c (expand_argument): Consistently ignore builtins in
1918         concatenation contexts.
1919         * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
1921 2007-11-13  Eric Blake  <ebb9@byu.net>
1923         Note: Patches titled Stage 0 through N form a series of patches
1924         which decreases the algorithmic complexity of tail recursion in
1925         macro expansions from O(n^2) to O(n) in both time and memory, then
1926         performs cleanups, such as handling of embedded NUL, made easier
1927         by the code refactoring.
1929         Stage 0: Fix memory leak in tail recursion.
1930         Free expansion text in the input engine as soon as it is parsed,
1931         rather than when the recursive expansion completes.
1932         Memory impact: noticeable improvement, due to reduction from
1933         O(n^2) to O(n) on recursion.
1934         Speed impact: minor improvement, due to better memory usage.
1935         * m4/input.c (pop_input): Add flag parameter and return type.
1936         (next_char): Adjust caller.
1937         (m4_push_string_init): Let go of memory earlier.
1939 2007-11-07  Eric Blake  <ebb9@byu.net>
1941         * tests/macros.at (Rescanning macros): Test more corner cases.
1943 2007-11-06  Eric Blake  <ebb9@byu.net>
1945         * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
1947         * Makefile.am (tests/package.m4): Work around bash bug.
1948         Reported by Ralf Wildenhues.
1950 2007-11-05  Eric Blake  <ebb9@byu.net>
1952         For consistency with other GNU projects, use build-aux directory.
1953         * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
1954         build-aux.
1955         * bootstrap (config_aux_dir): Likewise.
1956         * Makefile.am (config_aux_dir): Likewise.
1957         * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
1959 2007-11-02  Eric Blake  <ebb9@byu.net>
1961         Update some documentation about version control.
1962         * NEWS: M4 is now stored in git.
1963         * HACKING: Likewise.
1964         * README: Likewise.
1965         * bootstrap: Likewise.
1966         * commit: Delete, now that CVS commits are no longer necessary.
1967         * ltdl/config/mailnotify: No longer necessary; git's patch
1968         generation and mail capability is more powerful.
1970         Update to recent gnulib changes.
1971         * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
1972         xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
1974 2007-11-01  Eric Blake  <ebb9@byu.net>
1976         Improve error message when early end of file occurs.
1977         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
1978         (M4wrap): Adjust to new messages.
1979         (Improved capitalize): Enhance test.
1980         * m4/m4private.h (m4__next_token): Adjust prototype.
1981         * m4/input.c (m4__next_token): Add new parameter, and improve
1982         error message.
1983         * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
1984         callers.
1985         (expand_argument): Likewise, and add parameter.
1987 2007-10-31  Eric Blake  <ebb9@byu.net>
1989         Test more corner cases.
1990         * tests/macros.at (Rescanning macros): Beef up test.
1991         * doc/m4.texinfo (Changecom): Beef up test.
1992         (Improved foreach): Document alternate foreachq style.
1993         * examples/foreachq3.m4: New file.
1994         * examples/loop.m4: New file.
1995         * Makefile.am (dist_pkgdata_DATA): Distribute them.
1997 2007-10-28  Eric Blake  <ebb9@byu.net>
1999         More test coverage for autoconf usage patterns.
2000         * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2001         * tests/macros.at (Rescanning macros): New test.
2002         * tests/builtins.at (include): Augment test.
2004 2007-10-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2006         * Makefile.am: Adjust getopt handling to latest gnulib layout.
2008 2007-10-27  Eric Blake  <ebb9@byu.net>
2010         Document one use of changequote(`(',`)').
2011         * doc/m4.texinfo (Changequote): Add new test, based on recent
2012         autoconf addition of m4_expand.
2014 2007-10-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2016         * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2018 2007-10-22  Eric Blake  <ebb9@byu.net>
2020         Never let printf failures go undetected.
2021         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2022         xprintf'.
2023         * m4/system_.h: Include xprintf.h.
2024         * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2025         use of printf, xprintf.
2026         * m4/input.c [DEBUG_INPUT]: Likewise.
2027         * m4/module.c [DEBUG_MODULES]: Likewise.
2028         * m4/output.c (m4_shipout_text, m4_shipout_int)
2029         (m4_freeze_diversions): Likewise.
2030         * m4/path.c [DEBUG_INCL]: Likewise.
2031         * m4/symtab.c [DEBUG_SYM]: Likewise.
2032         * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2033         * modules/modtest.c (export_test): Likewise.
2034         * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2035         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2036         Likewise.
2037         * src/main.c (usage): Likewise.
2038         * po/POTFILES.in: Adjust to new file.
2039         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2041 2007-10-18  Eric Blake  <ebb9@byu.net>
2043         Fix 'm4 -F file -t undefined'.
2044         * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
2045         * src/freeze.c (dump_symbol_CB): Also skip void symbols.
2046         * tests/freeze.at (reloading unknown builtin): Test for this bug.
2047         * m4/m4module.h (m4_symtab_apply): Add parameter.
2048         * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
2049         requested.
2050         (m4_symtab_delete, symtab_dump): Adjust callers.
2051         * modules/m4.c (m4_dump_symbols): Likewise.
2053 2007-10-09  Eric Blake  <ebb9@byu.net>
2055         Fix regexp regression of 2007-09-29.
2056         * modules/gnu.c (substitute): Allow NULL buf when no
2057         subexpressions were present.
2058         (regexp): Handle \ escapes even with empty regex.
2059         * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
2061         Cache regex compilation for another autoconf speedup.
2062         * modules/gnu.c (gnu_buf): Replace...
2063         (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
2064         (m4_pattern_buffer): Add fields.
2065         (m4_regexp_compile): Rename...
2066         (regexp_compile): ...to this, and drop no_sub parameter.
2067         Implement caching.
2068         (M4FINISH_HANDLER): Clean up entire cache.
2069         (m4_regexp_search): Rename...
2070         (regex_search): ...to this, adjust to new struct contents, and add
2071         no_sub parameter.
2072         (m4_regexp_substitute): Rename...
2073         (regexp_substitute): ...to this.
2074         (substitute, patsubst, regexp, renamesyms): Adjust callers.
2076 2007-10-02  Eric Blake  <ebb9@byu.net>
2078         Document quoting pitfalls in capitalize.
2079         * doc/m4.texinfo (Patsubst): Use the examples directory.  Also
2080         document shortfall.
2081         (Improved capitalize): New node.
2082         * examples/capitalize.m4: Update to match manual.
2083         * examples/capitalize2.m4: New file.
2085 2007-10-01  Eric Blake  <ebb9@byu.net>
2087         Another Autoconf usage pattern optimization.
2088         * modules/m4.c (m4_index): Optimize search for one byte.
2089         * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
2090         code paths.
2092 2007-09-29  Eric Blake  <ebb9@byu.net>
2094         Optimize for Autoconf usage pattern.
2095         * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
2097         * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
2099 2007-09-24  Eric Blake  <ebb9@byu.net>
2101         Create .gitignore alongside .cvsignore.
2102         * bootstrap (version control): Update to reflect git usage.
2104 2007-09-13  Eric Blake  <ebb9@byu.net>
2106         * AUTHORS: Fix typo.
2108 2007-09-12  Gary V. Vaughan  <gary@gnu.org>
2110         Be consistent about using 'module' for m4_module types and
2111         'handle' for lt_dlhandle types:
2113         * m4/m4private.h (m4_symbol_value): Rename handle element to
2114         method.  Changed all references.
2115         (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
2116         SYMBOL_HANDLE respectively.  Changed all references.
2117         * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
2118         * m4/builtin.c (m4_builtin_find_by_name)
2119         (m4_builtin_find_by_func): Use module as the parameter name for
2120         pointers of type 'm4_module'.
2121         * m4/module.c (module_remove, m4_get_module_name)
2122         (install_builtin_table, install_macro_table)
2123         (m4_module_make_resident, m4__module_next, m4_module_refcount):
2124         Ditto.
2125         * src/freeze.c (produce_module_dump): Ditto.
2126         * m4/input.c (m4_input_block): Rename handle element to method.
2127         Changed all references.
2128         * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
2129         * modules/load.c: Use module as the variable name for pointers
2130         of type 'm4_module'.
2131         * modules/m4.c: Ditto.
2132         * modules/perl.c: Ditto.
2133         * modules/shadow.c: Ditto.
2135 2007-09-07  Eric Blake  <ebb9@byu.net>
2137         Add refcount builtin.
2138         * modules/load.c (refcount): New builtin.
2139         (m4modules): Use correct type.
2140         * doc/m4.texinfo (Refcount): New section.
2141         * m4/m4private.h (struct m4_module): Add refcount member.
2142         (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
2143         * m4/module.c (m4_module_load): Add symbols to table on first
2144         load by m4, regardless of other libltdl loads of same module.
2145         (m4_module_refcount): Use new struct member, rather than relying
2146         on libltdl count which might be inflated by unrelated loads.
2147         (m4__module_interface): Optimize.
2148         (m4__module_next, m4__module_find): Avoid assertions that could
2149         trigger with unrelated libltdl loads.
2150         (m4__module_open): Track m4 load count.
2151         (m4__module_exit): Only unload what m4 loaded.
2152         (module_remove): Track m4 unloads.
2153         * NEWS: Document new builtin.
2155         More conversion to m4_module*.
2156         * src/freeze.c (produce_module_dump, dump_symbol_CB)
2157         (reload_frozen_state): Use correct type.
2158         * m4/input.c (struct m4_input_block): Likewise.
2159         * m4/symtab.c (dump_symbol_CB): Likewise.
2161         * AUTHORS: Simplify, to match libtool and autoconf layout.
2162         * THANKS: Sync with branch.
2164 2007-09-06  Eric Blake  <ebb9@byu.net>
2166         Wrap lt_dlhandle in struct m4_module.
2167         * m4/m4module.h (includes): No longer require clients to know
2168         about lt_dlhandle.
2169         (m4_module): New opaque declaration.
2170         (m4_export): Delete unused type.
2171         (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
2172         (m4_module_finish_func, m4_module_load, m4_get_module_name)
2173         (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
2174         wrapper.
2175         (m4_module_makeresident, m4_module_refcount): New declarations.
2176         * m4/m4private.h (includes): Move <ltdl.h> here.
2177         (m4_module): New declaration.  Simple for now, but intended for
2178         growth.
2179         (m4__module_open, m4__module_next, m4__module_find)
2180         (m4__symtab_remove_module_references): Use new wrapper.
2181         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2182         Likewise.
2183         * m4/module.c (m4_get_module_name, m4_module_import)
2184         (m4_module_load): Likewise.
2185         (install_builtin_table, install_macro_table): Likewise.  Also,
2186         change return type since these always returned NULL and no one
2187         used the result.
2188         (m4_module_makeresident, m4_module_refcount): New functions.
2189         (m4_module_unload, m4__module_next, m4__module_find): Use new
2190         wrapper.
2191         (m4__module_open): Populate new wrapper, and associate it with the
2192         lt_dlhandle.
2193         (m4__module_exit): Use new wrapper.
2194         (module_remove): Likewise.  Reclaim storage on last use.
2195         (module_close): Delete, and inline into module_remove.
2196         * m4/symtab.c (m4__symtab_remove_module_references): Use new
2197         wrapper.
2198         * modules/load.c (load_init): Use new API.
2199         * modules/m4.c (m4_export_table): Kill unused declaration.
2200         (m4_init): Use new API.
2201         * modules/shadow.c (shadow_init): Use new API.
2202         * src/main.c (main): Adjust callers.
2203         * src/freeze.c (reload_frozen_state): Likewise.
2204         * tests/modules.at (unload load module): New test.
2206 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
2208         * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
2209         * src/m4/.cvsignore: Add xstrtol module sources.
2211 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
2213         Work around a bug in darwin's awk:
2215         * bootstrap (func_get_translations): Use $AWK instead of raw
2216         `awk' so that the user can use an alternative implementation
2217         if the first awk in PATH doesn't behave as expected.
2218         (func_get_translations): The first awk script mangles the last
2219         entry passed to it for at least the awk implementation shipped
2220         with Darwin 8.10.1.  Capture $3 into a variable too to work-
2221         around that problem.
2223 2007-08-29  Gary V. Vaughan  <gary@gnu.org>
2225         As gnulib xstrtol is only used by main, and unconditionally pulls
2226         in a copy of getopt, undo bootstrap change from 2007-08-11 below,
2227         and copy the xstrtol code into src/ so that main() can use it
2228         without pushing the extra code into libm4:
2230         * bootstrap (src_modules): Add getopt and xstrtol modules.
2231         * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
2232         * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
2234 2007-08-11  Eric Blake  <ebb9@byu.net>
2236         Another upstream xstrtol change.
2237         * po/POTFILES.in: Track changes in files containing messages.
2238         * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
2239         need to grab it separately.
2240         * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2241         No longer needed.
2242         (size_opt): Adjust to latest xstrtol interface.
2244 2007-08-10  Eric Blake  <ebb9@byu.net>
2246         Documentation improvements.
2247         * doc/m4.texinfo (Defn): Resync with branch.
2248         (Compatibility, Extensions): Sync with branch.
2250 2007-08-07  Eric Blake  <ebb9@byu.net>
2252         Adjust to gnulib xstrtol changes.
2253         * src/main.c (size_opt): Adjust signature, so that error strings
2254         are easier to translate.
2255         (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
2256         for tracking long options.
2257         (main): Track which long option was used.
2258         * tests/options.at (--debuglen, --nesting-limit): Adjust to change
2259         in error message.
2260         (deprecated options): Test that --arglength spelling shows up in
2261         error message.
2263 2007-08-06  Eric Blake  <ebb9@byu.net>
2265         Normalize all GPL license notices.
2266         * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
2267         at this time.
2268         * Makefile.am: Update license wording.
2269         * bootstrap: Likewise.
2270         * commit: Likewise.
2271         * configure.ac: Likewise.
2272         * ltdl/config/mailnotify: Likewise.
2273         * ltdl/config/mkstamp: Likewise.
2274         * ltdl/m4/debug.m4: Likewise.
2275         * ltdl/m4/gmp.m4: Likewise.
2276         * ltdl/m4/m4-error.m4: Likewise.
2277         * ltdl/m4/m4-getopt.m4: Likewise.
2278         * ltdl/m4/m4-gettext.m4: Likewise.
2279         * ltdl/m4/m4-obstack.m4: Likewise.
2280         * ltdl/m4/m4-regex.m4: Likewise.
2281         * ltdl/m4/stackovf.m4: Likewise.
2282         * m4/builtin.c: Likewise.
2283         * m4/debug.c: Likewise.
2284         * m4/hash.c: Likewise.
2285         * m4/hash.h: Likewise.
2286         * m4/input.c: Likewise.
2287         * m4/m4.c: Likewise.
2288         * m4/m4module.h: Likewise.
2289         * m4/m4private.h: Likewise.
2290         * m4/macro.c: Likewise.
2291         * m4/module.c: Likewise.
2292         * m4/output.c: Likewise.
2293         * m4/path.c: Likewise.
2294         * m4/resyntax.c: Likewise.
2295         * m4/symtab.c: Likewise.
2296         * m4/syntax.c: Likewise.
2297         * m4/system_.h: Likewise.
2298         * m4/utility.c: Likewise.
2299         * modules/evalparse.c: Likewise.
2300         * modules/format.c: Likewise.
2301         * modules/gnu.c: Likewise.
2302         * modules/import.c: Likewise.
2303         * modules/load.c: Likewise.
2304         * modules/m4.c: Likewise.
2305         * modules/m4.h: Likewise.
2306         * modules/modtest.c: Likewise.
2307         * modules/mpeval.c: Likewise.
2308         * modules/perl.c: Likewise.
2309         * modules/shadow.c: Likewise.
2310         * modules/stdlib.c: Likewise.
2311         * modules/time.c: Likewise.
2312         * modules/traditional.c: Likewise.
2313         * po/Makevars: Likewise.
2314         * src/freeze.c: Likewise.
2315         * src/m4.h: Likewise.
2316         * src/main.c: Likewise.
2317         * src/stackovf.c: Likewise.
2318         * tests/builtins.at: Likewise.
2319         * tests/freeze.at: Likewise.
2320         * tests/generate.awk: Likewise.
2321         * tests/m4.in: Likewise.
2322         * tests/macros.at: Likewise.
2323         * tests/modules.at: Likewise.
2324         * tests/options.at: Likewise.
2325         * tests/others.at: Likewise.
2326         * tests/stackovf.test: Likewise.
2327         * tests/testsuite.at: Likewise.
2329 2007-07-22  Eric Blake  <ebb9@byu.net>
2331         Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2332         * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2333         * tests/builtins.at (divert): Enhance test to cover this.
2334         * THANKS: Update.
2335         Reported by Thomas Klausner.
2337 2007-07-20  Eric Blake  <ebb9@byu.net>
2339         Fix 'make distcheck' issues.
2340         * bootstrap: Add more files that might be more up-to-date in
2341         gnulib.
2342         * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2343         * config/m4/gnulib-cache.m4: Update to latest gnulib.
2345 2007-07-16  Eric Blake  <ebb9@byu.net>
2347         * po/POTFILES.in: Track recent translation additions from gnulib
2348         updates.
2350 2007-07-14  Eric Blake  <ebb9@byu.net>
2352         Reflect upstream license .texi changes.
2353         * doc/m4.texinfo (Copying): Rename node...
2354         (GNU General Public License): ...to this.
2355         (GNU Free Documentation License): Adjust node location.
2356         * local/doc/gpl-3.0.texi.diff: Remove file.
2358 2007-07-10  Eric Blake  <ebb9@byu.net>
2360         Upgrade to GPLv3, and document 1.4.10.
2361         * bootstrap: Adjust to GPLv3.
2362         (func_update): Port from branch.
2363         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2364         --local-dir=local --import gpl-3.0'.
2365         * doc/m4.texinfo (History): Mention 1.4.11.
2366         (Copying This Package): New appendix.
2367         * NEWS: Document 1.4.10.
2368         * local/doc/gpl-3.0.texi.diff: New file.
2369         * Makefile.am: Update license.
2370         (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
2371         * commit: Update license.
2372         * configure.ac: Likewise.
2373         * ltdl/config/mailnotify: Likewise.
2374         * ltdl/config/mkstamp: Likewise.
2375         * ltdl/m4/debug.m4: Likewise.
2376         * ltdl/m4/gmp.m4: Likewise.
2377         * ltdl/m4/m4-error.m4: Likewise.
2378         * ltdl/m4/m4-getopt.m4: Likewise.
2379         * ltdl/m4/m4-gettext.m4: Likewise.
2380         * ltdl/m4/m4-obstack.m4: Likewise.
2381         * ltdl/m4/m4-regex.m4: Likewise.
2382         * ltdl/m4/stackovf.m4: Likewise.
2383         * m4/builtin.c: Likewise.
2384         * m4/debug.c: Likewise.
2385         * m4/hash.c: Likewise.
2386         * m4/hash.h: Likewise.
2387         * m4/input.c: Likewise.
2388         * m4/m4.c: Likewise.
2389         * m4/m4module.h: Likewise.
2390         * m4/m4private.h: Likewise.
2391         * m4/macro.c: Likewise.
2392         * m4/module.c: Likewise.
2393         * m4/output.c: Likewise.
2394         * m4/path.c: Likewise.
2395         * m4/resyntax.c: Likewise.
2396         * m4/symtab.c: Likewise.
2397         * m4/syntax.c: Likewise.
2398         * m4/system_.h: Likewise.
2399         * m4/utility.c: Likewise.
2400         * modules/evalparse.c: Likewise.
2401         * modules/format.c: Likewise.
2402         * modules/gnu.c: Likewise.
2403         * modules/import.c: Likewise.
2404         * modules/load.c: Likewise.
2405         * modules/m4.c: Likewise.
2406         * modules/m4.h: Likewise.
2407         * modules/modtest.c: Likewise.
2408         * modules/mpeval.c: Likewise.
2409         * modules/perl.c: Likewise.
2410         * modules/shadow.c: Likewise.
2411         * modules/stdlib.c: Likewise.
2412         * modules/time.c: Likewise.
2413         * modules/traditional.c: Likewise.
2414         * po/Makevars: Likewise.
2415         * src/freeze.c: Likewise.
2416         * src/m4.h: Likewise.
2417         * src/main.c: Likewise.
2418         * src/stackovf.c: Likewise.
2419         * tests/builtins.at: Likewise.
2420         * tests/freeze.at: Likewise.
2421         * tests/generate.awk: Likewise.
2422         * tests/m4.in: Likewise.
2423         * tests/macros.at: Likewise.
2424         * tests/modules.at: Likewise.
2425         * tests/options.at: Likewise.
2426         * tests/others.at: Likewise.
2427         * tests/stackovf.test: Likewise.
2428         * tests/testsuite.at: Likewise.
2430 2007-07-09  Eric Blake  <ebb9@byu.net>
2432         * modules/format.c (format): Avoid undefined behavior with %c.
2434 2007-07-01  Gary V. Vaughan  <gary@gnu.org>
2436         The translation project has moved.
2437         * bootstrap (func_get_translations): Use the new translation
2438         project url.
2439         (TP_URL): Removed.
2441 2007-06-26  Karl Berry  <karl@freefriends.org>  (tiny change)
2443         Match Free Software Directory categories.
2444         * doc/m4.texinfo (dircategory): Update.
2446 2007-05-31  Eric Blake  <ebb9@byu.net>
2448         Add extension to divert builtin.
2449         * modules/m4.c (builtin_divert): Immediately divert second
2450         argument.
2451         * m4/output.c (m4_output_text): Allow 0 length.  Fixes regression
2452         from two days ago.
2453         (m4_shipout_text): Short-circuit on zero length.
2454         * tests/freeze.at (loading format 2): Expand test to catch
2455         regression.  Also check out-of-range version.
2456         * tests/builtins.at (divert): Expand test to check corner cases
2457         of extension.
2458         * NEWS: Document the extension.
2459         Reported by Daniel Richard G.
2461 2007-05-30  Eric Blake  <ebb9@byu.net>
2463         Port format improvements from branch.
2464         * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
2465         (Format): Enhance section.
2466         * modules/format.c (format): Accept %'hhd, and issue warnings on
2467         unrecognized specifiers.
2468         * modules/gnu.c (builtin_format): Adjust how format is called.
2470 2007-05-28  Eric Blake  <ebb9@byu.net>
2472         * tests/options.at (--syncoutput): Add xfailed test.
2474         Fix sync line interaction with multiline comments.
2475         * doc/m4.texinfo (Preprocessor features): Improve documentation.
2476         (Syncoutput): Improve testsuite.
2477         (Incompatibilities): Add testcase, and document bug.
2478         * src/freeze.c (reload_frozen_state): Don't interfere with
2479         synclines when reloading state.
2480         * m4/input.c (m4__next_token): Report line where multiline tokens
2481         start.
2482         * m4/m4private.h (m4__token_type): Add parameter.
2483         * m4/m4module.h (m4_output_text): Export.
2484         (m4_shipout_text): Add parameter.
2485         * src/macro.c (m4_macro_expand_input, expand_token)
2486         (expand_argument): Adjust callers so that line is passed from
2487         input to output.
2488         * m4/output.c (output_text): Rename...
2489         (m4_output_text): ...to this, and export.
2490         (m4_insert_file, insert_diversion_helper): Update callers.
2491         (m4_shipout_text): Take new parameter for start line of token.
2492         Output at most one syncline per token.
2493         Reported by Sergey Poznyakoff.
2495         Fix large diversion corner cases.
2496         * tests/freeze.at (large diversion): New test.
2497         * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
2498         (make_room_for): Use NULL, not 0, for pointers.
2499         (m4_freeze_diversions): Allow freezing large diversions.
2500         (insert_diversion_helper): Avoid using rewind.
2502         Also run gnulib unit tests during make check.
2503         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2504         --tests-base=tests/gnu --with-tests'.
2505         * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
2506         * Makefile.am (SUBDIRS): Run gnulib tests before ours.
2508 2007-05-25  Eric Blake  <ebb9@byu.net>
2510         * m4/system_.h: Include <stdint.h>, for intmax_t.
2511         * THANKS: Update.
2512         Reported by Daniel Richard G.
2514 2007-05-24  Eric Blake  <ebb9@byu.net>
2516         Provide consistent shift semantics regardless of hardware.
2517         * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
2518         before shifting.
2519         (number, unumber): Always use [u]intmax_t.
2520         Reported by Gary V. Vaughan.
2522         Support POSIX flush semantics on all platforms.
2523         * modules/m4.c (m4_sysval_flush): Rely on gnulib.
2524         * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
2526         Work around cygwin and mingw fseeko bugs.
2527         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2528         fseeko'.
2529         * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
2531 2007-04-25  Eric Blake  <ebb9@byu.net>
2533         Test that regression in 1.4.9's eval doesn't recur.
2534         * doc/m4.texinfo (Eval): Check negative division.
2535         * THANKS: Update.
2537 2007-04-12  Eric Blake  <ebb9@byu.net>
2539         Allow for running test in sticky or setgid directory.
2540         * tests/builtins.at (mkdtemp): Adjust test.
2542         Don't test for broken sed too soon.
2543         * tests/others.at (stdin seekable): Rearrange subtests.
2545         Work around 'stdin seekable' shortcoming on glibc.
2546         * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
2547         * tests/others.at (stdin closed): Adjust to new output.
2548         * src/main.c (process_file): No need to return anything.
2549         (main): Use close_stdin instead of close_stdout.
2550         Reported by Ralf Wildenhues.
2552         Enable autobuild usage.
2553         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2554         autobuild'.
2555         * configure.ac (AB_INIT): Output autobuild information.
2557 2007-04-11  Eric Blake  <ebb9@byu.net>
2559         Address testsuite shortcoming in 'stdout full' on glibc.
2560         * tests/others.at (stdout full): Adjust expected output when more
2561         than 1k text is printed to /dev/full.
2562         Reported by Ralf Wildenhues.
2564 2007-04-10  Eric Blake  <ebb9@byu.net>
2566         * tests/macros.at (Arity and defn): Fix quoting.
2568 2007-04-09  Eric Blake  <ebb9@byu.net>
2570         Address failure of 'seekable stdin' on Mac OS X.
2571         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2572         fflush'.
2574 2007-04-07  Eric Blake  <ebb9@byu.net>
2576         Include <config.h> first in all C files, and not in headers.
2577         Fixes regression for --disable-assert builds from 2007-04-02.
2578         * src/m4.h (includes): Don't include config.h here.
2579         * m4/m4private.h (includes): Likewise.
2580         * m4/builtin.c: Include config.h before anything else.
2581         * m4/debug.c: Likewise.
2582         * m4/hash.c: Likewise.
2583         * m4/input.c: Likewise.
2584         * m4/m4.c: Likewise.
2585         * m4/macro.c: Likewise.
2586         * m4/module.c: Likewise.
2587         * m4/symtab.c: Likewise.
2588         * m4/syntax.c: Likewise.
2589         * m4/utility.c: Likewise.
2590         * src/freeze.c: Likewise.
2591         * src/stackovf.c: Likewise.
2593 2007-04-03  Eric Blake  <ebb9@byu.net>
2595         * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
2596         SIGFPE on x86 architectures.
2597         Reported by Ralf Wildenhues.
2599 2007-04-02  Eric Blake  <ebb9@byu.net>
2601         Fix warnings from last commit.
2602         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2603         fprintf-posix sprintf-posix'.
2604         * m4/macro.c (expand_macro, trace_format): Use correct specifier
2605         for size_t.
2606         (process_macro): Avoid negative array index.
2607         * src/freeze.c (produce_resyntax_dump, produce_module_dump)
2608         (dump_symbol_CB, produce_frozen_state): Use correct specifier for
2609         size_t.
2611 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
2613         Get rid of the last 'differs in signedness' compiler warnings:
2615         * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
2616         a regular 'char *', so variables to store the return address,
2617         and iterate through it should be regular 'char *' too.
2618         * m4/input.c (m4_input_block): The start and current members of
2619         the string part of this union store regular 'char *' types, so
2620         they should be regular 'char *' types too.
2622 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
2624         M4 was designed to have a small number of header files defining
2625         the interfaces to several source files each.  Keeping this in
2626         mind allows us to tidy things up considerably.  Having done this,
2627         it becomes clear that some of the installed headers reference
2628         other headers which are not installed (but that's another patch):
2630         * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
2631         here...
2632         * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
2633         ...to here, so client modules can benefit too.
2634         (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
2635         lowest level to save doing it multiple times elsewhere.
2636         * m4/debug.c (stdio.h): Removed.  The portable <gnu/stdio--.h>
2637         is already included via m4private.h.
2638         * modules/time.c (stdio.h): Ditto.
2639         * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
2640         * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
2641         and <gnu/unistd--.h>,
2642         * m4/m4private.h (m4module.h): Use angle brackets for an installed
2643         file.
2644         * m4/hash.h (system.h): Ditto.
2645         * modules/gnu.c (progname.h): Removed.
2646         * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
2647         * m4/m4private.h (assert.h, errno.h): Already included via
2648         m4/m4module.h.
2649         * m4/input.c (ctype.h): Ditto.
2650         * m4/module.c (ltdl.h): Ditto.
2651         * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
2652         (unistd.h): Ditto.
2653         * m4/path.c (config.h, stdlib.h): Ditto.
2654         * m4/utility.c (config.h): Ditto.
2655         * modules/evalparse.c (assert.h, ctype.h): Ditto.
2656         * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
2657         * modules/import.c (assert.h): Ditto.
2658         * modules/m4.c (assert.h, errno.h): Ditto.
2659         * modules/modtest.c (assert.h): Ditto.
2660         * modules/stdlib.c (sys/types.h): DittAo.
2661         * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
2662         Ditto.
2663         * src/stackovf.c (assert.h): Ditto.
2664         * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
2665         private interfaces when NDEBUG is defined.
2666         * modules/import.c (m4/m4module.h, m4private.h): Ditto.
2667         * modules/load.c (m4/m4module.h, m4private.h): Ditto.
2668         * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
2669         * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
2670         * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
2671         * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
2672         * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
2673         * modules/time.c (m4/m4module.h, m4private.h): Ditto.
2674         * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
2675         * src/m4.h (locale.h): Moved from here...
2676         * src/main.h: ...to here.
2677         (m4private.h): Already included via m4.h.
2678         * src/stackovf.c (m4private.h): Ditto.
2680 2007-03-28  Gary V. Vaughan  <gary@gnu.org>
2682         * Makefile.am (stamp-vcl): Removed.
2683         (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
2685 2007-03-28  Eric Blake  <ebb9@byu.net>
2687         * src/main.c (usage): Improve note to TRANSLATORS.
2688         * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
2690         * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
2691         empty.
2693 2007-03-24  Eric Blake  <ebb9@byu.net>
2695         * m4/output.c (m4_output_init): Update to latest gnulib.
2696         * bootstrap (ltdl/m4/.cvsignore): No longer track generated
2697         .cvsignore in CVS.
2698         * NEWS: Reflect release of 1.4.9.
2699         * THANKS: Update.
2701 2007-03-07  Eric Blake  <ebb9@byu.net>
2703         * AUTHORS: Update
2705         Exercise gnulib's new POSIX *printf modules.
2706         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2707         vasprintf-posix'.
2708         * modules/format.c (format): Support %a and %A.
2709         * doc/m4.texinfo (Format): Test this addition.
2710         * NEWS: Document this addition.
2712 2007-03-03  Eric Blake  <ebb9@byu.net>
2714         * m4/input.c (m4__next_token): Fix synclines when in batch mode.
2715         * doc/m4.texinfo (M4exit): Synch another section.
2716         (Syncoutput): Make similar to other sections.
2718 2007-03-01  Eric Blake  <ebb9@byu.net>
2720         * doc/m4.texinfo: Improve the indices.
2721         (Concept index): Rearrange to be last.
2722         (Sysval): Merge from branch.
2724         * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
2726 2007-02-28  Eric Blake  <ebb9@byu.net>
2728         POSIX XCU ERN 137 was approved.
2729         * modules/mpeval.c (numb_extension): Delete.
2730         * modules/m4.c (numb_extension): Likewise.
2731         * modules/evalparse.c (comma_term, condition_term): Always
2732         implement ?: and , operators.
2733         * m4/symtab.c: Update comment to match reality.
2734         * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
2735         dereferencing context directly when accessor exists.
2736         * src/main.c (usage): Prefer GNU_M4 over EMACS.
2737         (struct macro_definition): Rename...
2738         (struct deferred): ...to match usage.  All uses changed.
2739         * doc/m4.texinfo (Eval): Document this change.
2740         (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
2741         over emacs.
2742         (Preprocessor features, Changesyntax): Fix inaccuracies.
2743         * NEWS: Import branch NEWS items for 1.4.x series.  Document
2744         change in eval.
2746         POSIX XCU ERN 118 was approved.
2747         * modules/m4.c (define): Kill posixly_correct distinction in
2748         define behavior, since POSIX says GNU behavior complies.
2749         * tests/builtins.at (define): Restore original semantics.
2750         * doc/m4.texinfo (Pushdef): Document portability issues with
2751         define.
2752         (Incompatibilities): Clean up wording of what POSIX requires.
2753         * NEWS: Document this.
2755 2007-02-26  Eric Blake  <ebb9@byu.net>
2757         Re-enable clean bootstrap on cygwin.
2758         * Makefile.am (AM_LDFLAGS): For now, export all symbols from
2759         modules, since otherwise we run afoul of current libtool
2760         limitations on cygwin and mingw.
2762 2007-02-25  M. Levinson  <levinsm@users.sourceforge.net>  (tiny change)
2764         * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
2765         memory.  Fixes regression introduced 2007-01-20.
2767 2007-02-25  Eric Blake  <ebb9@byu.net>
2769         * tests/freeze.at (loading format 2): Augment test to catch
2770         regression introduced on 2007-01-20.
2771         * THANKS: Update.
2772         Reported by M. Levinson.
2774         * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
2775         latest gnulib.
2777 2007-02-05  Eric Blake  <ebb9@byu.net>
2779         * tests/options.at (--fatal-warnings): New test.
2780         * tests/others.at (stdin seekable): Exit on error.
2781         * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
2782         (m4_get_warnings_exit_opt): Access it.
2783         * m4/m4module.h (m4_context_opt_bit_table): Access it.
2784         * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
2785         on -EE.
2786         (m4_warn, m4_warn_at_line): Change exit status on -E, and force
2787         exit on -EE.
2788         * src/m4.c (usage): Document new -E behavior.
2789         (main): Make -E an additive option.
2790         * doc/m4.texinfo (Operation modes): Document the change.
2791         Reported by Ralf Wildenhues.
2793         * tests/others.at (stdin seekable): Fix bug in test.
2794         * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
2796         * m4/input.c (struct m4_input_block): Remove unused field traced.
2798 2007-02-03  Eric Blake  <ebb9@byu.net>
2799         and Bruno Haible  <bruno@clisp.org>  (tiny change)
2801         * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
2802         the examples.
2803         Reported by Bruno Haible.
2805 2007-01-31  Eric Blake  <ebb9@byu.net>
2807         * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
2808         failure.
2810 2007-01-26  Eric Blake  <ebb9@byu.net>
2812         * m4/symtab.c (includes): Adjust to latest gnulib.
2813         * modules/m4.c (includes): Likewise.
2815 2007-01-23  Eric Blake  <ebb9@byu.net>
2817         * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
2818         extension to make enough room.
2819         (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
2820         code in input.c special cases this category.
2821         (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
2822         for define(eleventh,${11}) extension.
2823         * m4/syntax.c: Update comments accordingly.
2824         (m4_syntax_create, m4_syntax_code): Handle { and }.
2825         * m4/input.c (m4__next_token): Likewise.
2826         * src/freeze.c (produce_frozen_state): Support new categories.
2827         (reload_frozen_state): When loading version 1, disable syntax
2828         features not present in 1.4.x.
2829         * tests/freeze.at: Sort and rename existing tests.
2830         (loading format 1): Ensure we don't break v1 frozen files that
2831         used raw ${.
2832         (loading format 2, reloading changecom, reloading changesyntax):
2833         New tests.
2834         * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
2835         the new syntax categories.
2836         (Arguments): Update the FIXME comment.
2837         (M4wrap): Merge examples from branch, before worrying about fixing
2838         m4wrap to obey POSIX.
2839         (Using frozen files): Start merging from branch.
2840         * NEWS: Update.
2842 2007-01-20  Eric Blake  <ebb9@byu.net>
2844         * src/freeze.c (produce_char_dump): Delete.  Replace with...
2845         (produce_mem_dump): ...this new function, to encode more strings.
2846         Also make the coding easier to read and slightly more compact.
2847         (produce_syntax_dump): Only dump non-default syntax codes.
2848         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2849         Encode non-ASCII characters in user-supplied strings.
2850         (GET_STRING): Accept escape sequences in version 2.
2851         * NEWS: Document this change.
2852         * TODO: Update.
2854 2007-01-16  Eric Blake  <ebb9@byu.net>
2856         Port patch from branch for stack overflow detection on BSD/OS.
2857         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
2858         * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
2859         ! HAVE_STACK_T_SS_SP]: Use this check.
2860         Reported by Chris McGuire.
2862 2007-01-15  Eric Blake  <ebb9@byu.net>
2864         * tests/builtins.at (__m4_version__): New test.
2865         * modules/traditional.c (m4_macro_table): Provide windows and os2
2866         macros, as appropriate.  Add __traditional__ macro.
2867         * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
2868         not __gmp__, to match module name.
2869         * modules/load.c (m4_macro_table): Name the macro __load__, not
2870         __modules__, to match module name.
2871         * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
2872         from the branch.
2873         (Standard Modules): Improve wording.
2874         (Incompatibilities): Move platform macros into their own node.
2875         (Load, Unload): Use actual examples.
2876         * NEWS: Document this change.
2877         * THANKS: Update.
2879 2007-01-13  Eric Blake  <ebb9@byu.net>
2881         * doc/m4.texinfo (Mpeval): Add tests.
2882         * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
2883         * tests/builtins.at (gmp): ...here.  Rename test to...
2884         (mpeval): ...this.
2885         * tests/generate.awk (new_test): Filter out mpeval tests when gmp
2886         is not available.
2887         * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
2888         no_gnu_extensions with posixly_correct_opt, since they were set in
2889         sync.
2890         * m4/m4private.h (struct m4): Remove no_gnu_extensions.
2891         * src/main.c (main): Update caller.
2892         * src/freeze.c (reload_frozen_state): Likewise.
2893         * modules/m4.c (m4wrap): Likewise.
2895 2007-01-12  Eric Blake  <ebb9@byu.net>
2897         * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
2898         POSIX, so update the comment.
2899         * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
2900         approved by POSIX, so we can always have blind macros, even when
2901         POSIXLY_CORRECT.
2902         (Ifelse): Mention the term `blind builtin'.
2904 2007-01-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2906         * doc/m4.texinfo: Fix a couple of typos.
2908 2007-01-08  Eric Blake  <ebb9@byu.net>
2910         * ltdl/m4/gnulib-cache.m4: Update for new year.
2911         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
2912         Reported by Ralf Wildenhues.
2914 2007-01-06  Eric Blake  <ebb9@byu.net>
2916         * m4/m4private.h (to_uchar): Move...
2917         * m4/m4module.h: here, so modules can use it.
2918         * src/main.c (usage, long_options): Support --posix as a synonym
2919         for --traditional.
2920         * modules/m4.c (numb_invert): Detect unsupported x**-y.
2921         (numb_incr, numb_urshift, numb_extension): New macros.
2922         (numb_obstack): Port patch from branch to support radix 1 output.
2923         * modules/mpeval.c (numb_obstack): Use \ for ratios.
2924         (numb_incr, numb_urshift, numb_extension): New macros.
2925         (mpq2mpz): Warn rather than error.
2926         * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
2927         enumerators.
2928         (eval_error): Rearrange, so that all ignorable errors are less
2929         than SYNTAX_ERROR.
2930         (eval_text, last_text): Obey C++ type safety rules.
2931         (numb_pow): Change return type.
2932         (exp_term): Adjust caller.
2933         (m4_evaluate): Fail on bad exponent.
2934         (logical_or_term, logical_and_term): Ignore failed ** in short
2935         circuit.
2936         (eval_lex): Fix typos when detecting <<= and >>=.  Use \ instead
2937         of : for ratio.  Support >>>, ,, and ?:.  Port patch from branch
2938         to parse radix 1 numbers.
2939         (condition_term, comma_term): New parse functions.
2940         (shift_term): Support >>>.
2941         (m4_evaluate): Port patch from branch to output radix 1 numbers.
2942         Warn instead of error for most parse problems.
2943         * doc/m4.texinfo (Limits control, Eval): Document these changes.
2944         * NEWS: Document new operators and new command line option.
2946 2007-01-04  Eric Blake  <ebb9@byu.net>
2948         * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
2950 2007-01-03  Eric Blake  <ebb9@byu.net>
2952         * doc/m4.texinfo (Format, Incr): More merges.
2953         (Eval): Ensure C precedence rules are met.
2954         * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
2955         (not_term, logical_not_term): Delete; these are same precedence
2956         as other unary operators.
2957         (equality_term): New; these are lower precedence than relational
2958         operators.
2959         (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
2960         operators for better error messages.
2961         (logical_or_term, logical_and_term): Short-circuit out the error
2962         of division by zero.
2963         (unary_term): Allow consecutive unary operators.
2964         * modules/m4.c (int2numb, numb2int): Delete; these potentially
2965         truncate bits.
2966         (numb_not, numb_eor, numb_ior, numb_and): Update callers.
2967         * modules/mpeval.c (reduce1, reduce2): Protect macros better.
2968         * NEWS: Document this change.
2970 2006-12-27  Eric Blake  <ebb9@byu.net>
2972         * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
2973         branch.
2974         * modules/m4.c (substr): Merge from branch.
2976 2006-12-26  Eric Blake  <ebb9@byu.net>
2978         * doc/m4.texinfo (Changesyntax): Check for regressions with
2979         changesyntax(W=...).
2981 2006-12-22  Eric Blake  <ebb9@byu.net>
2983         * m4/m4module.h (m4_set_syntax): Change signature.
2984         * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
2985         warning.
2986         (changesyntax): Likewise, and update caller.
2987         * m4/m4private.h (m4_syntax_table): Add orig member.
2988         * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
2989         Don't set is_single_quotes and is_single_comments when the begin
2990         character is shadowed by another syntax type.
2991         (m4_syntax_create): Populate default syntax table.
2992         (add_syntax_attribute): Don't lose quote assignment.
2993         (remove_syntax_attribute): Only allow removing rquote or ecomm.
2994         (add_syntax_set, subtract_syntax_set, set_syntax_set)
2995         (reset_syntax_set): New helper routines.
2996         (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
2997         to default, and empty chars reverts that key to default.
2998         (check_is_single_quotes, check_is_single_comments): New helper
2999         routines.
3000         * modules/m4.c (changecom): Merge from branch.
3001         * m4/input.c (m4__next_token): Rearrange token recognition order
3002         to macro, quote, comment, in order to match traditional
3003         implementations.
3004         * src/freeze.c (reload_frozen_state): Update caller.
3005         * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3006         modifications.
3007         (Changeresyntax): Revise to match style of surrounding sections
3008         and add more examples.
3009         (Changesyntax): Likewise, and update to new semantics.
3010         * NEWS: Document this change.
3012         * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3013         (M4wrap, Eval, Errprint): Fix typos.
3014         (Divnum): Not necessary to redivert in example.
3016 2006-12-21  Eric Blake  <ebb9@byu.net>
3018         * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3019         from branch.
3021 2006-12-19  Eric Blake  <ebb9@byu.net>
3023         * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3024         * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3025         can track write errors without all other callers warning multiple
3026         times.
3027         (sysval_flush_helper): New function.
3028         (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3029         * modules/gnu.c (esyscmd): Likewise.
3030         * tests/others.at (stdout closed, stdout full): Error message
3031         update.
3033 2006-12-16  Eric Blake  <ebb9@byu.net>
3035         * src/main.c: Fix missing include.
3037         * src/main.c (main): Check for errors when closing stdin.
3038         * modules/m4.c (m4exit): Missed part of previous patch: flush
3039         stdin before a successful exit.
3040         Reported by Ralf Wildenhues.
3042 2006-12-14  Eric Blake  <ebb9@byu.net>
3044         * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
3045         required by POSIX.
3046         * tests/others.at (stdin seekable): New test.
3048 2006-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3050         * doc/m4.texinfo: Fix some typos.
3052 2006-12-04  Eric Blake  <ebb9@byu.net>
3054         * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
3055         sections.
3056         (Modules): Make style consistent.
3058 2006-11-16  Eric Blake  <ebb9@byu.net>
3060         * bootstrap: Relax m4 requirement, thanks to...
3061         * configure.ac (Gettext support): ...this workaround to the 1.4.4
3062         bug.  Undoes restriction added on 2006-11-09.
3064         * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
3065         diversions are now closed when not active.
3066         (divert): Remove check now in the manual.
3067         * tests/others.at (stderr closed): Likewise.
3068         (stdout closed): Add a check.
3069         * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
3070         more docs with branch.
3072 2006-11-14  Eric Blake  <ebb9@byu.net>
3074         Remerge sparse diversion handling from branch.
3075         * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
3076         avltree-oset.
3077         * m4/output.c (diversion_table): Change type to gl_oset_t.
3078         (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
3079         (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
3080         (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
3081         (div0, diversion_storage): New variables.
3082         (diversions, equal_diversion_CB): Deleted.
3083         (threshold_diversion_CB): New callback.
3084         (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
3085         functions.
3086         (m4_tmpfile): Move cloexec action here.
3088         * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
3089         char.
3091 2006-11-13  Eric Blake  <ebb9@byu.net>
3093         Add several new command line options.
3094         * src/main.c (usage): Update.
3095         (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
3096         --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
3097         Make --regexp-syntax argument optional.
3098         (main): Support new options.  Fix regression in interactive
3099         behavior from Nov 8.
3100         * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
3101         M4_OPT_SYNC_OUTPUT_BIT.
3102         * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
3103         syncoutput, to match option.
3104         (m4_parse_truth_arg): New prototype.
3105         * m4/utility.c (m4_parse_truth_arg): Implement it.
3106         * m4/output.c (m4_shipout_text): Adjust sync_output caller.
3107         * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
3108         m4_parse_truth_arg.
3109         * doc/m4.texinfo (Operation modes, Dynamic loading features)
3110         (Preprocessor features, Limits control, Debugging options)
3111         (Command line files): Update documentation.
3112         * tests/builtins.at (mkstemp): Simplify.
3113         * tests/macros.at (Command line pushdef): New test.
3114         (Command line define): Improve.
3115         * tests/options.at (--traceon and --traceoff, --syncoutput): New
3116         tests.
3117         (POSIXLY_CORRECT): Likewise.
3118         (deprecated options): Augment.
3119         (--regexp-syntax): Update, now that -r takes optional arg.
3120         * NEWS: Reformat.  Document new options.
3122 2006-11-11  Eric Blake  <ebb9@byu.net>
3124         One step closer to allowing C++ compilation - don't blindly
3125         convert between char* and unsigned char*.
3126         * m4/m4module.h (m4_set_syntax): Change signature.
3127         * m4/m4private.h (m4_string): Use signed char.
3128         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
3129         (m4_get_syntax_ecomm): No longer a need to cast.
3130         * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
3131         Reflect this change.
3132         * m4/macro.c (expand_argument): Simplify.
3133         (expand_token): Use proper type.
3134         * src/freeze.c (reload_frozen_state): Likewise.
3135         * m4/input.c (MATCH, match_input): Likewise.
3136         * modules/m4.c (translit): Likewise.
3137         * modules/gnu.c (substitute): Simplify.
3139         * m4/macro.c (trace_format): Use canonical type name.
3140         * m4/output.c (m4_freeze_diversions): Likewise.
3141         * src/freeze.c (produce_module_dump, dump_symbol_CB)
3142         (produce_frozen_state): Likewise.
3143         * m4/m4private.h (to_uchar): Grab from branch.
3144         * m4/input.c (string_peek, string_read): Use it.
3145         * m4/utility.c (skip_space): Likewise.
3146         * src/main.c (main): Likewise.
3147         * doc/m4.texinfo (Translit): Remerge from branch.
3148         * tests/builtins.at (translit): Test 8-bit range.
3149         * modules/m4.c (m4_expand_ranges): Merge from branch.
3151 2006-11-09  Eric Blake  <ebb9@byu.net>
3153         * bootstrap: Validate that installed M4 is powerful enough.
3154         Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
3156 2006-11-08  Eric Blake  <ebb9@byu.net>
3158         Merge deferred handling of -D option from branch.
3159         * doc/m4.texinfo (Debugging options, Preprocessor features)
3160         (Dynamic loading features, Operation modes, Invoking m4):
3161         Document this change.
3162         * src/main.c (OPTSTRING): Specify in-order processing.
3163         (process_file): New function.
3164         (main): Use it to interleave files and deferred options.
3165         * tests/macros.at (Command line define): New test.
3166         * tests/generate.awk: Allow '@comment file' as first example
3167         within a node.
3168         * tests/options.at (option grouping): Update to reflect actual
3169         POSIX semantics.
3170         (file names): New test.
3172 2006-11-07  Eric Blake  <ebb9@byu.net>
3174         * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
3175         for failure.
3177         * tests/builtins.at (m4exit): New test; failed on cygwin before
3178         this patch.
3179         * m4/output.c (cleanup_tmpfile): Close files before removing
3180         directory.
3181         (make_room_for, m4_output_exit): Ensure that atexit handler
3182         invoked from m4_error sees consistent state.
3184         * doc/m4.texinfo (Errprint): Merge another doc node.
3185         * tests/builtins.at (dumpdef, errprint): New tests.
3186         * modules/m4.c (errprint): Merge from branch: flush before
3187         printing to stderr.
3189 2006-11-02  Eric Blake  <ebb9@byu.net>
3191         * bootstrap: Update bootstrap requirement wording.
3192         Reported by Bruno Haible.
3194 2006-10-31  Eric Blake  <ebb9@byu.net>
3196         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3197         strstr'.
3198         * doc/m4.texinfo (Translit): Merge from branch.
3199         * modules/m4.c (divert, substr): Ignore excess arguments.
3200         (index, translit): Merge from branch.
3201         * tests/builtins.at (translit): Add a test.
3203 2006-10-30  Eric Blake  <ebb9@byu.net>
3205         * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
3206         checkin.
3207         * m4/symtab.c (m4_get_symbol_value_module): Likewise.
3209         * modules/m4.c (m4_make_temp): Make safe across libtool.
3210         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
3211         * configure.ac (--with-modules): Accomodate changed module
3212         location when doing './configure --enable-debug'.
3214 2006-10-28  Eric Blake  <ebb9@byu.net>
3216         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3217         config-h.'
3219 2006-10-27  Eric Blake  <ebb9@byu.net>
3221         * bootstrap (gnulib): No longer a need to patch after gnulib-tool
3222         --update.
3223         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3224         0.16, since 0.15 is incompatible with our automake requirement.
3226         * m4/macro.c (expand_argument): Fix missing initialization.
3227         * m4/m4private.h (struct m4_symbol_value): Store entire
3228         m4_builtin, not just the func.
3229         (m4_get_symbol_value_func): Update.
3230         (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
3231         fast accessors.
3232         * m4/m4module.h (m4_get_symbol_value_builtin)
3233         (m4_get_symbol_builtin): New prototypes.
3234         (m4_set_symbol_value_func): Delete, replace with...
3235         (m4_set_symbol_value_builtin): New function.
3236         (m4_builtin_find_by_name): Change signature.
3237         * m4/symtab.c (m4_symbol_value_print): Simplify.
3238         (m4_get_symbol_value_func): Update.
3239         (m4_get_symbol_value_builtin): New function.
3240         (m4_set_symbol_value_func): Delete, replace with...
3241         (m4_set_symbol_value_builtin): New function.
3242         (dump_symbol_CB) [DEBUG_SYM]: Simplify.
3243         * m4/builtin.c (m4_builtin_find_by_name): Change signature.
3244         * m4/input.c (struct m4_input_block): Remove unused trace member.
3245         (m4_push_builtin, builtin_print, init_builtin_token): Update
3246         callers.
3247         * m4/module.c (install_builtin_table): Likewise.
3248         * src/freeze.c (reload_frozen_state): Likewise.
3249         * modules/gnu.c (builtin): Make it possible to retrieve a builtin
3250         token, even after the builtin has been undefined.
3251         * doc/m4.texinfo (Builtin): Document new capability.
3252         * NEWS: Likewise.
3254         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3255         tempname'.
3256         * modules/m4.c (m4_make_temp): Use it.
3257         * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
3259 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3261         * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
3262         files.
3264 2006-10-26  Eric Blake  <ebb9@byu.net>
3266         Silence -O2 -Wall -Wwrite-strings warnings.
3267         * m4/m4private.h (m4_symbol_value): Const-ify text.
3268         * m4/m4module.h (m4_get_symbol_value_text)
3269         (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
3270         (m4_set_symbol_value_placeholder): Likewise.
3271         * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
3272         fallout.
3273         * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
3274         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
3275         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
3276         Likewise.
3277         * modules/format.c (format): Likewise.
3278         * src/main.c (main): Likewise.
3279         * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
3280         * modules/shadow.c (shadow, test): Likewise.
3281         * m4/output.c (m4_make_diversion): Don't hold on to empty
3282         diversions.
3283         (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
3284         (m4_freeze_diversions): Likewise.  Don't use uninitialized
3285         variable.
3287         Convert diversions to list instead of sparse array, part 2.
3288         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3289         avltree-list'.
3290         * m4/output.c (m4_diversion): Add next pointer and divnum members.
3291         (diversion_table): Convert to a list instead of a sparse array.
3292         (free_list): Maintain free list of reclaimed diversions.
3293         (equal_diversion_CB, cmp_diversion_CB): New functions.
3294         (m4_output_init): Set up list.
3295         (m4_output_exit): Tear down list.
3296         (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
3297         list iteration.
3298         (m4_make_diversion): Change creation of new diversions.
3299         (m4_insert_diversion_helper): New function, to avoid list
3300         searches.
3301         * tests/builtins.at (divert): The test now passes.
3302         * NEWS: Document this improvement.
3304         Convert diversions to list instead of sparse array, part 1.
3305         * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
3306         for length.
3307         * m4/output.c (diversion, total_buffer_size, output_unused):
3308         Track size in size_t.  All users changed.
3309         (struct diversion): Reduce size now, to compensate for part 2.
3310         (m4_make_diversion, make_room_for): Avoid malloc overflow.
3311         (m4_output_exit): Fix typo in assert.
3312         (m4_output_init, make_room_for, m4_make_diversion)
3313         (m4_insert_diversion, m4_freeze_diversions): Adjust users of
3314         struct m4_diversion to disambiguate the new union.
3315         * tests/builtins.at (divert): Detect this failure.
3317 2006-10-25  Eric Blake  <ebb9@byu.net>
3319         * m4/m4module.h (m4_push_builtin): Add parameter.
3320         * modules/m4.c (defn): Update caller.
3321         * m4/input.c (file_read_init, string_read_init): No longer
3322         needed.
3323         (input_funcs): Change signature of read_func, all callers
3324         updated.
3325         (composite_peek, composite_read, composite_unget),
3326         (composite_print, composite_funcs): New input type.  Not yet
3327         fully utilized, but one step closer to fixing defn.
3328         (m4_input_block): Make every input block track current file and
3329         line.  Rename some members.  Remove unused out_line.  Add support
3330         for composite input block.
3331         (input_change): New flag.
3332         (file_peek, file_read, file_clean, file_unget, file_print):
3333         Update callers.
3334         (m4_push_file, m4_push_builtin, m4_push_string_init)
3335         (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3336         (m4_skip_line, pop_input): Track input block changes.
3337         (m4_pop_wrapup): Avoid overflow.
3338         (init_builtin_token): Handle composite input.
3339         (next_char): Handle input block changes.
3340         * doc/m4.texinfo (Location): Remerge from branch.
3342         * src/m4.h (includes): Need <locale.h> after all; fixes
3343         regression from yesterday.
3345         * m4/system_.h (obstack_regrow): New macro.  Hopefully glibc will
3346         accept it someday.
3347         * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3348         Handle nesting the argc obstack.
3349         (expand_token): Avoid unnecessary malloc.
3350         (collect_arguments): Copy name before invalidating it.
3351         (argc_stack, argv_stack): New variables.
3352         (m4_macro_expand_input): Initialize argc and argv stacks once per
3353         file, instead of once per macro.
3355 2006-10-24  Eric Blake  <ebb9@byu.net>
3357         * src/m4.h (includes): Add gettext.h, for N_.  Assume setlocale.
3359 2006-10-23  Eric Blake  <ebb9@byu.net>
3361         * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
3362         from branch regarding stripped leading whitespace.
3364         * modules/m4.c (includes): Use safe headers even when configured
3365         with --enable-assert.
3366         (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
3367         #defined as mkstemp_safer.
3369 2006-10-21  Eric Blake  <ebb9@byu.net>
3371         * modules/m4.c (m4_make_temp): Change signature.
3372         (maketemp, mkstemp): Update callers.
3373         * modules/m4.h (m4_make_temp_func): New export.
3374         * modules/gnu.c (mkdtemp): New macro.
3375         * doc/m4.texinfo (Operation modes): Document interaction with
3376         --safer.
3377         (Mkdtemp): New node.
3378         * tests/builtins.at (mkdtemp): New test.
3379         (mkstemp): Check for umask effect.
3380         * NEWS: Document new builtin.
3382         * tests/generate.awk (normalize): Update recognition of trailing
3383         spaces in tests.
3384         * doc/m4.texinfo: Minor formatting fixes from branch.
3385         (Foreach, Improved foreach): Merge from branch.
3386         * examples/foreach.m4: Merge from branch.
3387         * examples/foreachq.m4: New file from branch.
3388         * examples/foreach2.m4: Likewise.
3389         * examples/foreachq2.m4: Likewise.
3391         * doc/m4.texinfo (titlepage): Add myself as author.
3392         * src/main.c (AUTHORS): Likewise.
3394 2006-10-19  Eric Blake  <ebb9@byu.net>
3396         * modules/m4.c (m4_make_temp, mkstemp): New functions.
3397         (maketemp): Add POSIX behavior and a warning.
3398         * tests/others.at (maketemp): Move this test...
3399         * tests/builtins.at (mkstemp): ...to here, and beef up.
3400         * tests/options.at (--safer): Update to new warning message.
3401         * doc/m4.texinfo (Mkstemp): Sync from branch.
3402         (Extensions): Update maketemp behavior.
3403         * NEWS: Document that maketemp now always warns.
3405         * tests/generate.awk: For ease of doc-writing, simplify selection
3406         of '-Ipath/to/examples' to '@comment examples'.
3407         * examples/forloop.m4: Simplify.
3408         * examples/forloop2.m4: New file.
3409         * examples/quote.m4: New file.
3410         * doc/m4.texinfo (Improved forloop): New node.
3411         (Manual): Clarify use of examples directory.
3412         (Shift, Forloop): Resync from branch.
3413         (Include, Location): Update to new usage of examples directory.
3415         * m4/system_.h (includes): Pick up <unistd.h> before checking for
3416         _POSIX_VERSION.
3417         (gettext_noop): Don't define here, let gettext.h do it instead.
3418         * po/POTFILES.in: Update entries to reflect gnulib imports.
3420 2006-10-16  Eric Blake  <ebb9@byu.net>
3422         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3423         configmake'.
3424         * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
3425         pkglibexecdir support.
3426         * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
3427         worry about pathconf.h, now that gnulib does it for us.
3428         (pkgmodincludedir): Simplify.
3429         (pkglibexecdir): Delete, now that automake does this.
3430         * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
3431         * src/main.c (usage): Likewise.
3432         * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
3434         * doc/m4.texinfo: Port some changes from the branch.
3435         (Invoking m4): Promote to a chapter, instead of a section of
3436         Preliminaries.
3437         (Operation modes, Dynamic loading features, Preprocessor features)
3438         (Limits control Frozen state, Debugging options)
3439         (Command line files): Subdivide into new sections.
3440         (Cleardivert): Rename from cleardiv.
3442 2006-10-14  Eric Blake  <ebb9@byu.net>
3444         * tests/others.at (stdin closed): Update to match previous patch.
3446         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
3447         is not portable.
3448         Reported by Ralf Wildenhues.
3450         * modules/m4.c (undivert): Merge from branch.
3451         * doc/m4.texinfo (Improved fatal_error): Fix typo.
3452         (Improved exch): New node, copied from branch.
3453         (Improved cleardivert): Update from branch.
3454         * THANKS: Update.
3456 2006-10-13  Eric Blake  <ebb9@byu.net>
3458         * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
3459         not config-h.in.
3460         * modules/gnu.c (builtin, indir): Transparently handle builtin
3461         tokens from defn.
3462         * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
3463         * m4/input.c (m4_pop_wrapup): Display debug message when switching
3464         to wrapped text.
3465         (m4_input_init): No need to use empty file any more.
3466         (file_print): Display correct file name.
3467         * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
3468         dereference a NULL file name.
3469         * m4/m4module.h (m4_pop_wrapup): New parameter.
3470         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
3471         prototypes.
3472         * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
3473         * m4/symtab.c (m4_symbol_value_groks_macro): New method.
3474         * src/main.c (main): Adjust caller.
3475         * tests/options.at (--debugmode): Test more output from -dV.
3477 2006-10-12  Eric Blake  <ebb9@byu.net>
3479         * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
3481         * m4/m4private.h (m4__next_token_is_open): New prototype.
3482         * m4/m4module.h (m4_push_single): Delete; push_string is an
3483         adequate interface, and removing support for this simplifies the
3484         input engine.
3485         (m4_push_wrapup): New parameter.
3486         (m4_is_syntax): Delete; m4_has_syntax is sufficient.
3487         (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
3488         start-quote and start-comment exclusive from other syntax
3489         categories.
3490         * m4/syntax.c: Likewise.
3491         * m4/input.c (input_funcs): Make polymorphic without requiring
3492         clients to know whether they are located at isp.  All users
3493         changed.
3494         (file_names): New variable.
3495         (m4_input_init): Initialize it.
3496         (m4_push_file): Use it.
3497         (m4_input_exit): Free it after use.
3498         (m4__next_token): Simplify slightly.
3499         (m4__peek_token): Rename and simplify...
3500         (m4__next_token_is_open): ... to this.  In particular, this
3501         allows us to avoid a double ungetc, which POSIX doesn't
3502         guarantee.
3503         (struct m4_input_block, m4_push_single, single_peek, single_read):
3504         Remove support for single characters, as the input engine now
3505         guarantees we don't need it.
3506         (file_unget, string_unget, m4_input_print, unget_input):
3507         Strengthen assertions.
3508         (file_init_funcs, file_read_init): New for file reading.
3509         (string_init_funcs, string_read_init): New for wrapped text.
3510         (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
3511         Support wrapped text with locations.
3512         (m4_skip_line): Support dnl across include file boundary.
3513         (peek_char): Don't pop input when peeking.
3514         (file_peek): Peek can be called at the end of the file.
3515         (string_read): Don't read beyond string bounds.
3516         * m4/macro.c (expand_token, collect_arguments): Update callers.
3517         (expand_macro): Report errors at location of open parenthesis.
3518         (expand_token, expand_argument, process_macro): Avoid negative
3519         array dereferences with m4_has_syntax.
3520         * m4/utility.c (skip_space): Likewise.
3521         * modules/m4.c (m4wrap): Update caller.
3522         * tests/builtins.at (__file__, __line__, dnl): New tests.
3523         * tests/options.at (--debugmode): Normalize the output.
3524         * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
3525         Remerge recent changes from branch.
3526         (Improved fatal_error): New node from branch.
3528 2006-10-11  Eric Blake  <ebb9@byu.net>
3530         * src/main.c (usage, long_options): Add --debugmode as an alias
3531         for --debug, to match macro name.
3532         * tests/options.at (--debugmode): Rename from --debug, and test
3533         for new alias.
3534         (--discard-comments): Augment test.
3535         * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
3536         * NEWS: Likewise.
3538 2006-10-10  Eric Blake  <ebb9@byu.net>
3540         Trace improvements: debugmode(c) was always printing the last two
3541         lines paired, combine them; and show non-text expansions.
3542         * m4/macro.c (trace_prepre): Update to show what the macro will
3543         expand to.
3544         (trace_pre): No need to special-case on debugmode(c).
3545         (trace_post): Likewise.  Also, show non-text expansions.
3546         (expand_macro): Update caller.  Collecting arguments can change
3547         debug mode, so cache values beforehand.
3548         (trace_format): Remove support for unused %l%S%r, and fix support
3549         for %z to match gcc's attribute((printf)).
3550         (trace_header): Update caller.
3551         * m4/input.c (struct m4_input_block): Rename from input_block.
3552         (struct input_funcs): Add print_func member.
3553         (file_print, builtin_unget, builtin_print, string_print)
3554         (m4_input_print): New functions.
3555         (m4_push_string_finish): Change return type.
3556         (m4_push_file): Fix missing use of close parameter.
3557         * m4/debug.c (m4_debug_decode): Don't clear pending traces.
3558         * m4/m4module.h (m4_input_print): New prototype.
3559         * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
3560         to match behavior change.
3561         * tests/options.at (--debug): Likewise.
3562         * tests/macros.at (Propagation of traceon)
3563         (Propagation of --trace): Likewise.
3564         * tests/others.at (stderr closed, stdout closed, stdin closed):
3565         Likewise.
3566         * doc/m4.texinfo (Forloop): Simplify.
3567         (Trace): Update to changed behavior.
3568         (Debugmode): Document this change.
3569         * src/main.c (usage): Likewise.
3570         * NEWS: Likewise.
3572 2006-10-09  Eric Blake  <ebb9@byu.net>
3574         * m4/path.c (m4_include_env_init): Don't alter result of getenv.
3575         Reported by Ralf Wildenhues.
3577         * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
3579 2006-10-07  Eric Blake  <ebb9@byu.net>
3581         * m4/m4module.h (m4_set_exit_failure): New prototype.
3582         * m4/utility.c (m4_set_exit_failure): New function.
3583         * modules/m4.c (m4exit): Use it to avoid yet another global
3584         variable export in libm4.
3586 2006-10-06  Eric Blake  <ebb9@byu.net>
3588         * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
3589         up.
3590         * tests/others.at (stdout closed): Fix final check.
3592         Replace uses of tmpfile with clean-temp, since tmpfile is
3593         incompatible with closeout.
3594         * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
3595         exit status of m4.
3596         * tests/others.at (stderr closed): Likewise.
3597         * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
3598         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3599         clean-temp.
3600         * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
3601         (m4_tmpfile, cleanup_tmpfile): New functions.
3602         (make_room_for, m4_insert_diversion): Use clean-temp module.
3603         * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
3604         tmpfile.
3605         * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
3607         * m4/utility.c (m4_numeric_arg): Merge from branch.
3608         * modules/gnu.c (debuglen): New builtin.
3609         * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
3610         Rename --arglength to --debuglen.
3611         * tests/options.at (--arglength): Rename to --debuglen.
3612         (deprecated options): Augment test.
3613         * doc/m4.texinfo (Invoking m4): Document the name change.
3614         (Debugmode): Rename from Debug Levels.
3615         (Debugfile): Rename from Debug Output.
3616         (Debuglen): New node.
3617         * NEWS: Document these changes.
3619         * modules/m4.c (m4exit): Fix typo.  Ensure desired exit status in
3620         case closing a module exits.
3622         * modules/m4.c (m4exit): Merge from branch.
3623         * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
3625 2006-10-05  Eric Blake  <ebb9@byu.net>
3627         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3628         closeout.
3629         * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
3630         * src/main.c (main): Close stdout on exit.
3631         * m4/debug.c (set_debug_file): Check for write failure.
3632         * m4/m4.c (m4_delete): Don't mask write failure.
3633         * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
3634         macros before calling AT_CHECK.
3635         (M4_ONE_MEG_DEFN): New helper macro.
3636         * tests/others.at (stdout full): New test.
3637         (stderr closed, stdin closed, stdout closed): Augment.
3638         * tests/builtins.at (syscmd): New test.
3639         (esyscmd): Augment.
3641 2006-10-04  Eric Blake  <ebb9@byu.net>
3643         * tests/builtins.at: Alphabetize tests.
3644         * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
3645         * tests/generate.awk (new_test): Fix underquoting.
3646         * tests/others.at (maketemp): Rename from misc.
3647         (stdin closed, stdout closed, stderr closed): New tests.
3649 2006-10-03  Eric Blake  <ebb9@byu.net>
3651         Avoid all global variables in modules, so that --disable-static
3652         can work on cygwin.
3653         * examples/incl.m4: New file, from branch.
3654         * Makefile.am (dist_pkgdata_DATA): Distribute it.
3655         * doc/m4.texinfo (Location): Merge this section from branch.
3656         (Include): Update the test.
3657         * tests/generate.awk (new_test): Allow for VPATH build
3658         pre-processing of expected __program__ output.
3659         * m4/m4module.h (m4_current_diversion, m4_output_current_line):
3660         Avoid global variables.
3661         (m4_context_field_table): Add current_diversion, output_line.
3662         (m4_output_init, m4_make_diversion): Add parameter.
3663         (m4_get_program_name, m4_set_program_name): New accessors.
3664         * m4/m4private.h (m4_get_current_diversion),
3665         (m4_set_current_diversion, m4_get_output_line)
3666         (m4_set_output_line): New accessors.
3667         * m4/utility.c (m4_get_program_name, m4_set_program_name): New
3668         methods.
3669         * modules/m4.c (divnum, divert): Adjust callers.
3670         * modules/gnu.c (__program__): Likewise.
3671         * m4/output.c (m4_output_init, m4_make_diversion)
3672         (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
3673         (m4_insert_diversion): Likewise.
3674         * m4/input.c (file_clean, m4_push_file): Likewise.
3675         * src/freeze.c (reload_frozen_state): Likewise.
3676         * src/main.c (main, usage): Likewise.
3678         Partially plug memory leak when unloading gnu module.
3679         * tests/modules.at (unload gnu module): New test.
3680         * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
3681         (m4_regexp_compile): Move static storage to module visibility.
3682         * tests/options.at (--debug): Adjust to new output.
3684 2006-09-29  Eric Blake  <ebb9@byu.net>
3686         Even when not the first option, --help can't have side effects.
3687         * tests/options.at (--debugfile): Detect bugs in this area.
3688         * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
3689         stderr.
3690         * src/main.c (main): Fix it by deferring debugfile change.  Also,
3691         defer closing streams until after module tracing is done.
3692         * modules/gnu.c (debugfile): Make message consistent with command
3693         line.
3694         * doc/m4.texinfo (Invoking m4): Touch up the documentation.
3695         * NEWS: Document this fix.
3697         * modules/m4.c (dnl): Include macro name in warning message.
3698         * m4/input.c (m4_skip_line): Add parameter.
3699         * m4/m4module.h (m4_skip_line): Likewise.
3700         * src/main.c (usage): Update wording.
3701         * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
3702         issue of blind macros vs. POSIX is resolved.
3703         (Dnl): Merge another node from branch.
3705         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3706         xstrtol.
3707         * m4/system_.h (N_): Define.
3708         * src/main.c (main): Validate numeric arguments.
3709         (size_opt): New function, idea borrowed from coreutils.
3710         * m4/macro.c (expand_macro): -L0 implies no limit.
3711         * doc/m4.texinfo (Invoking m4): Document this change.
3712         * NEWS: Likewise.
3713         * tests/options.at: (--arglength, --nesting-limit)
3714         (--regexp-syntax): New tests of argument validation.
3716 2006-09-28  Eric Blake  <ebb9@byu.net>
3718         * tests/options.at: Alphabetize the tests.
3720 2006-09-27  Eric Blake  <ebb9@byu.net>
3722         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
3723         another parameter to print module info.
3724         * m4/macro.c (trace_pre): Adjust caller.
3725         * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
3726         * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
3727         * NEWS: Document this.
3729         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3730         strnlen.
3731         * m4/symtab.c (symbol_value_print): Rename to...
3732         (m4_symbol_value_print): ...this, and...
3733         (m4_symbol_print): Update to allow -L length truncation.  Now
3734         truncation also affects dumpdef output and builtin names.
3735         * m4/m4private.h (nesting_limit, max_debug_argument_length):
3736         Switch to size_t.
3737         * m4/m4module.h (m4_symbol_print): Add parameter.
3738         (m4_symbol_value_print): New function.
3739         * modules/m4.c (dumpdef): Allow length truncation.
3740         * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
3741         repeating code.
3742         * doc/m4.texinfo (Invoking m4): Document -l better.
3743         (Dumpdef, Debug Levels): Document the effect of -l.
3744         * NEWS: Document this change.
3746         * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
3747         (m4_expand_ranges): Ensure we aren't picking up partial object on
3748         obstack.
3749         * modules/stdlib.c (setenv): Allow extra arguments.
3750         * modules/time.c (ctime): Avoid side effect in call to
3751         obstack_grow.
3752         * modules/gnu.c (m4_regexp_substitute): Likewise.
3753         (renamesyms): Avoid extra obstack_init.
3754         * src/freeze.c (reload_frozen_state): Remove debug comment.
3755         (produce_frozen_state): Simplify fprintf to puts where possible.
3756         * modules/modtest.c (modtest_init, modtest_finish): Likewise.
3757         * modules/import.c (import, symbol_fail, modules_fail): Likewise.
3758         * m4/macro.c (trace_flush): Likewise.
3759         * m4/debug.c (m4_debug_message_prefix): Likewise.
3760         * m4/path.c (include_dump): Likewise.
3761         * m4/module.c (module_remove): Likewise.
3762         (install_builtin_table): Simplify malloc and string
3763         concatenation.
3765 2006-09-26  Eric Blake  <ebb9@byu.net>
3767         * m4/m4module.h (m4_symbol_print): New prototype.
3768         (M4_DEBUG_TRACE_STACK): New enumerator.
3769         (m4_is_debug_bit): Allow use without requiring m4private.h.
3770         * m4/symtab.c (symbol_value_print, m4_symbol_print): New
3771         functions.
3772         * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
3773         callback.
3774         (dumpdef): Allow printing pushdef'd stacks.
3775         * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
3776         * src/main.c (usage): Document it.
3777         * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
3778         * NEWS: Likewise.
3780         * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
3781         gnulib headers.
3782         * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
3783         of lines during make.
3784         (AM_CPPFLAGS): Remove unneeded include path.
3785         (src_m4_CPPFLAGS): Remove redundant include path.
3786         * m4/system_.h Make preprocessor indentation consistent.
3787         (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
3788         macros.
3789         (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
3790         branch.
3791         (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
3792         (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
3793         (bool, true, false): Don't undefine here; stdbool takes care of
3794         that.
3795         * src/m4.h (includes): Assume config.h, and several standard
3796         headers.
3797         (__CYGWIN__, WIN32): Don't define here; let system.h do it.
3798         * m4/m4private.h: Assume config.h.
3799         * m4/output.c: Likewise.
3800         * m4/path.c: Likewise.
3801         * m4/resyntax.c: Likewise.
3802         * m4/utility.c: Likewise.
3803         * modules/gnu.c: Likewise.
3804         * modules/import.c: Likewise.
3805         * modules/load.c: Likewise.
3806         * modules/m4.c: Likewise.
3807         * modules/modtest.c: Likewise.
3808         * modules/mpeval.c: Likewise.
3809         * modules/perl.c: Likewise.
3810         * modules/shadow.c: Likewise.
3811         * modules/stdlib.c: Likewise.
3812         * modules/time.c: Likewise.
3813         * modules/traditional.c: Likewise.
3815 2006-09-21  Eric Blake  <ebb9@byu.net>
3817         * doc/m4.texinfo (Invoking m4): Add clarification on option
3818         processing behavior.
3819         * tests/options.at (option grouping): Test this.
3820         * THANKS: Update.
3821         Reported by Mikhail Teterin.
3823         * bootstrap: Add --force option, based on idea from coreutils.
3824         * README: Document that ./bootstrap and autoreconf are for
3825         developers, and not lightly done in tarballs.
3827 2006-09-20  Eric Blake  <ebb9@byu.net>
3829         * src/main.c (usage, OPTSTRING, main): Rename -e to -i.  Make
3830         warnings consistent.
3831         (long_options, HASHSIZE_OPTION): Warn on -H.
3832         * doc/m4.texinfo (Invoking m4): Document this.
3833         * tests/options.at (deprecated options): Update.
3835         Change the default of interactive sessions to match sh.
3836         * src/main.c (usage): Document this.
3837         (enum interactive_choice): New enum.
3838         (main): Use it to defer decision of interactive until after
3839         argument processing.
3840         * doc/m4.texinfo (Invoking m4): Document this.
3841         * NEWS: Likewise, plus add missing mention of -b.
3842         Reported by Stepan Kasal.
3844 2006-09-19  Eric Blake  <ebb9@byu.net>
3846         * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
3847         well as --error-output; the goal is to add -o/--output in some
3848         future version with semantics like gcc or autom4te.
3849         * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
3850         (Extensions): Reflect this update.
3851         (Renamesyms): Add another test.
3852         (Defn): Xfail for now, so that `make check' is happy.
3853         * NEWS: Document this change.
3854         * tests/generate.awk: Mark dynamic loading tests as such.  Allow
3855         xfailing tests.
3856         * tests/macros.at (Renamesyms collisions): New test, exposing
3857         renamesyms' coredump.
3858         * tests/options.at (--debugfile, --safer): Update to match
3859         change.
3861         * m4/debug.c (set_debug_file): Fix regression in -o when stdout
3862         and stderr are same file, introduced 2003-07-23.
3863         * tests/options.at (--debugfile): New test, to catch the bug.
3864         (deprecated options): Test --error-output.
3865         * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
3866         Deprecate --error-output, and replace it with --debugfile.
3867         * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
3868         Document this change.
3869         * NEWS: Likewise.
3871 2006-09-18  Eric Blake  <ebb9@byu.net>
3873         * modules/load.c (modules): Rename to...
3874         (m4modules): ...this, since it is an English word with 0
3875         arguments.
3876         * modules/gnu.c (symbols, m4symbols): Likewise.
3877         * doc/m4.texinfo (Listing Modules): Rename to...
3878         (M4modules): ...this.
3879         (Symbols): Rename to...
3880         (M4symbols): ...this.
3881         (Load, Foreach, Trace, Answers): Update to new spellings.
3882         * NEWS: Document this.
3884         * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
3885         such that without arguments, the global trace flag is changed
3886         rather than walking the table of all currently-defined macros.
3887         (set_trace_CB): No longer needed.
3888         * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
3889         (m4_set_symbol_traced): Delete.
3890         (m4_symtab_create): Nuke the nuke parameter.
3891         * m4/m4private.h (m4_get_symbol_value): Delete.
3892         * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
3893         (m4_set_symbol_name_traced): Free undefined entries that are no
3894         longer traced.
3895         (symbol_destroy_CB): Update caller.
3896         * m4/m4.c (m4_create): Update caller.
3897         * src/main.c (main): Likewise.
3898         (usage): Fix typo in last commit.
3899         * doc/m4.texinfo: Minor cleanups throughout.
3900         (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
3901         more nodes from branch.
3902         (Trace): Document new semantics, and how to simulate the old.
3903         * tests/builtins.at (multiquotes): Adjust to new semantics.
3904         * NEWS: Update somewhat.
3906 2006-09-14  Eric Blake  <ebb9@byu.net>
3908         Add --safer option, per debian bug 5898.
3909         * src/main.c (usage): Document new option.
3910         (SAFER_OPTION): New enumerator.
3911         (main): Set the option bit.
3912         * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
3913         accessors.
3914         * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
3915         (m4_get_safer_opt): New accessor.
3916         * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
3917         * modules/m4.c (syscmd, maketemp): Likewise.
3918         * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
3919         (Sysval, Maketemp): Add tests of this.
3920         * tests/options.at (--safer): Likewise.
3922 2006-09-13  Eric Blake  <ebb9@byu.net>
3924         * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
3925         stderr filtering.
3926         Reported by Ralf Wildenhues.
3928         Fix installcheck.
3929         * Makefile.am (check_LTLIBRARIES): Build test libraries in the
3930         tests directory, so we can be sure an installed build is not
3931         picking up uninstalled non-test libraries.
3932         (check-local, installcheck-local): Depend on test libraries.
3933         * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
3934         after file name.  Fix quoting.  Remove skipping the test, now
3935         that makefile guarantees test modules will exist.
3936         (Freezing modules, modules: shadow, modules: unload)
3937         (modules: trace): Always put test modules in module path.
3938         (modules: importing): Likewise, and rely on AT_CHECK_M4 for
3939         stderr munging.
3940         * src/main.c (usage): Document default module search path.
3941         (import_environment, frozen_file_to_read, frozen_file_to_write):
3942         Move...
3943         (main): ...here.
3944         * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
3945         * tests/m4.in: ...not here.
3946         Reported by Ralf Wildenhues.
3948 2006-09-08  Eric Blake  <ebb9@byu.net>
3950         * bootstrap: Kill unrelated copy-n-paste code from argument
3951         parsing.  Let Makefile generate testsuite.
3952         * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
3954 2006-09-07  Eric Blake  <ebb9@byu.net>
3956         * m4/m4module.h (m4_peek_input): No longer export.
3957         (m4_error_at_line, m4_warn_at_line): New prototypes.
3958         (m4_is_symbol_void): New macro.
3959         (m4_push_file): Update prototype.
3960         * m4/m4private.h (m4__peek_token): New prototype.
3961         (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
3962         * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
3963         * src/main.c (main): Allow reading from stdin twice.
3964         * modules/m4.c (include): Adjust to new prototype.
3965         * m4/input.c: General comment cleanup.
3966         (file_peek, file_read, file_unget, push_file): Set end flag on
3967         EOF, so that we don't call getc twice.
3968         (push_file, file_clean): Port fix from branch to avoid closing
3969         stdin prematurely.
3970         (pop_input): Port fix from branch to avoid reading free'd memory
3971         when input ends mid-string.
3972         (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
3973         (string_peek, string_read): Always use unsigned char.
3974         (m4_skip_line): Warn when dnl cut short by EOF.
3975         (peek_input): Rename from m4_peek_input.
3976         (match_input): Update signature, to distinguish between `(' token
3977         and multi-char quote or comment beginning with `('.
3978         (m4_input_exit): Cleanup now done in m4_pop_wrapup.
3979         (m4__peek_token): New function, ported from branch.
3980         (m4__next_token): Update to new token types.
3981         * m4/macro.c (expand_token, expand_argument): Use peek_token.
3982         * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
3983         (Invoking m4): Remerge from branch.
3985         * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
3986         (check-local): and put dependency here.
3987         Reported by Ralf Wildenhues.
3989 2006-09-05  Eric Blake  <ebb9@byu.net>
3991         * m4/m4module.h (m4_debug_message): New prototype.
3992         (M4_DEBUG_TRACE_MODULE): New debug bit.
3993         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
3994         (M4_DEBUG_MESSAGE2): Delete these macros.
3995         * m4/debug.c (m4_debug_message): New method.
3996         (m4_debug_decode): Add module tracing as flag `m'.
3997         * m4/input.c (m4_push_file, file_clean): Use new method.
3998         * m4/path.c (m4_path_search): Likewise.
3999         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4000         * m4/module.c (install_builtin_table, install_macro_table)
4001         (m4__module_open, module_close, module_remove): Promote several
4002         module debug messages outside of DEBUG_MODULES.
4003         (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4004         DEBUG_MODULES with normal trace output.
4005         * src/main.c (usage): Document new flag.
4006         * doc/m4.texinfo (Debug Levels): Likewise.
4007         * Makefile.am ($(TESTSUITE)): Add missing dependency.
4008         * tests/m4.in: Neutralize platform-dependent module filenames.
4009         * tests/options.at (--debug): Update expected output.
4011 2006-09-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4013         * doc/m4.texinfo: Fix some typos.
4014         * tests/others.at: Likewise.
4016 2006-09-05  Eric Blake  <ebb9@byu.net>
4018         * m4/input.c (lex_debug): Remove dead code that broke compilation
4019         with --enable-debug.
4020         * m4/module.c (install_builtin_table, install_macro_table)
4021         (m4__module_init, m4__module_open, module_close)
4022         (module_remove): Fix compilation when --enable-debug.
4023         * m4/output.c (m4_shipout_text): Likewise.
4024         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4025         libraries when --enable-debug.
4026         * configure.ac (DYNAMIC_MODULES): New variable, to pass
4027         information to testsuite.
4028         (modules to preload): Determine modules after we know whether
4029         shared libraries are supported.
4030         * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4031         testsuite.
4032         * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4033         * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4034         (modules: shadow, modules: unload, modules: importing)
4035         (modules: trace): Use new macro.
4036         * tests/builtins.at (gmp): Likewise.
4038         * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
4039         All users updated.
4040         (expand_token): Avoid assertion just added to docs.
4041         (expand_macro): Track pending expansions, for when a symbol's
4042         definition changes during argument collection.
4043         (m4_macro_call, process_macro): Operate on symbol value, not
4044         symbol, since symbol may have changed during argument collection.
4045         * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
4046         (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
4047         (m4_get_symbol_value): Add fast macro version.
4048         * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
4049         (m4_macro_call): Adjust prototype.
4050         * m4/module.c (install_builtin_table): Check that flags are valid
4051         when creating builtin.
4052         * m4/symtab.c (m4__symtab_remove_module_references): Use
4053         m4_symbol_value_delete, rather than inlining it.
4054         (m4_symbol_value_copy): Copy placeholder text.
4055         (symbol_popval): Use m4_symbol_value_delete.
4056         (m4_symbol_value_delete): Implementation was missing when NDEBUG.
4057         Handle pending expansions.
4058         * modules/gnu.c (indir): Update to new prototype.
4059         * doc/m4.texinfo: Fix menus to be consistent with section names.
4060         (Defn): Add test that macro tokens flatten to empty string;
4061         triggered an assert before this patch.
4062         (Ifelse): Merge another node.
4063         (Loops): Split into...
4064         (Forloop, Foreach): New nodes; work is still underway on them.
4065         (Answers): Add more info on foreach macro; work is still underway.
4066         (Indir): Add test that indir collects arguments before looking up
4067         macro.
4068         * TODO: Update based on this patch.
4070 2006-09-01  Eric Blake  <ebb9@byu.net>
4072         * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
4073         * m4/hash.h (m4_free_hash_iterator): New prototype.
4074         * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
4075         ensure we don't do unsafe things while iterating.
4076         (HASH_ITER, ITER_CHAIN): New accessor macros.
4077         (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
4078         (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
4079         (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
4080         (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
4081         to catch unsafe actions.
4082         (m4_free_hash_iterator): New function, to avoid memory leaks, and
4083         when debugging, to track safe actions.
4084         (m4_hash_apply): Avoid memory leak.
4085         * m4/symtab.c (m4_symtab_apply): Likewise.
4086         * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
4087         in manually to src/ for now.
4088         * tests/builtins.at (gmp): Add keyword module.
4089         * tests/modules.at (Freezing modules, modules: shadow)
4090         (modules: unload, modules: importing, modules: trace): Likewise.
4092 2006-08-30  Eric Blake  <ebb9@byu.net>
4094         * m4/utility.c (m4_warn): Factor "Warning" out of messages into
4095         here.
4096         (m4_bad_argc, m4_numeric_arg): Update all callers.
4097         * m4/macro.c (m4_macro_call): Likewise.
4098         * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
4099         (Indir, Builtin, Ifdef): More doc merges.
4100         (Loops): Mention that documenting foreach would be nice.
4101         (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
4102         (Include, Eval, Location, M4exit): s/input.m4/stdin/.
4103         * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
4104         (substitute, syncoutput): Update all m4_warn callers.
4105         * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
4106         (traceon, traceoff): Make warning message consistent.
4107         (define, pushdef): Update all m4_warn callers.
4108         * tests/generate.awk: Choose file name so that documentation can
4109         show command-line behavior.
4110         * tests/builtins.at (define): Update to new wording.
4111         * tests/macros.at (pushdef/popdef): Likewise.
4112         * tests/freeze.at (loading format 1): Likewise.
4113         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4115         * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
4116         the branch.
4117         (Defn): Add failing test case for mixing text and builtin.
4118         (Renamesyms): Improve wording, and identify core dump that needs
4119         fixing.
4121 2006-08-29  Eric Blake  <ebb9@byu.net>
4123         * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
4124         (Arguments, Pseudo Arguments): More doc merges from the branch.
4125         (Macro expansion): Turn example into test.
4126         (Pseudo Arguments): Add example of avoiding argument.
4127         * modules/m4.c (undefine, popdef): Accept multiple arguments.
4128         (define, pushdef): Warn on non-text macro name.
4129         (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
4130         warning/error messages.
4131         (ifdef): Ignore extra arguments.
4132         * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
4133         (m4__symtab_remove_module_references): Check that there is no leak.
4134         * tests/macros.at (pushdef/popdef): Update to new message.
4135         * tests/builtins.at (define): Likewise.
4136         * tests/freeze.at (loading format 1): Likewise.
4137         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4139         * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
4140         (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
4141         as accessor function, to avoid compiler warning.
4142         * m4/module.c (m4__module_open): Move declaration of variable to
4143         avoid compiler warning.
4144         * src/main.c (main): Avoid shadowing a global variable.
4145         * src/freeze.c (produce_symbol_dump): Avoid unused variable
4146         warning when NDEBUG.
4147         * tests/options.at (--discard-comments, --import-environment)
4148         (--debug, --prepend-include, --help and --version): Rename tests
4149         to name option tested.
4151 2006-08-28  Eric Blake  <ebb9@byu.net>
4153         * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
4154         * m4/module.c (install_builtin_table): ...to here, and add
4155         assertion that blind macros require arguments.
4156         * m4/m4module.h (struct m4_builtin): Document restrictions that
4157         must be met during module loading.
4158         * modules/gnu.c (changeresyntax, changesyntax): These are blind,
4159         so require an argument to avoid triggering assertion.
4160         (debugfile): Tweak error message.
4162 2006-08-25  Eric Blake  <ebb9@byu.net>
4164         * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
4165         (M4_BUILTIN_SIDE_EFFECT): New enumerators.
4166         (struct m4_builtin): New member flags replaces groks_macro_args,
4167         blind_if_no_args.  min_args and max_args are now 0-based.
4168         Rearrange members to reduce size on platforms where function
4169         pointers are 64 bits but regular pointers are 32.
4170         (m4_bad_argc): Add argument.
4171         * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
4172         * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
4173         effect into account.
4174         * m4/module.c (install_builtin_table): Adjust all users affected
4175         by this API change.
4176         * m4/macro.c (m4_macro_call): Likewise.
4177         * src/freeze.c (reload_frozen_state): Likewise.
4178         * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
4179         * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
4180         * modules/import.c (builtin_functions): Likewise.
4181         * modules/load.c (builtin_functions): Likewise.
4182         * modules/modtest.c (builtin_functions): Likewise.
4183         * modules/mpeval.c (builtin_functions): Likewise.
4184         * modules/perl.c (builtin_functions): Likewise.
4185         * modules/shadow.c (builtin_functions): Likewise.
4186         * modules/stdlib.c (builtin_functions): Likewise.
4187         * modules/time.c (builtin_functions, mktime_functions)
4188         (strftime_functions): Likewise.
4189         * doc/m4.texinfo (Loops): Update test now that shift is blind.
4190         (Macro Arguments): Fix typo in test.
4191         (Patsubst): Fix typo in test.
4192         * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
4193         end of string.  Fix return value when ignore_duplicates.
4194         * tests/builtins.at (patsubst): Fix typo in test.
4196         * tests/options.at (debug-flags): Update to reflect new message.
4197         (deprecated options, prepend-include, help and version): New
4198         tests.
4199         * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
4200         test omits an input file name.
4201         * src/main.c (long_options, main): Add -B/--prepend-include.
4202         (usage): Document it.
4203         (main): `m4 --help --version' now displays help, not version.
4204         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4205         dirname filenamecat.
4206         * m4/m4module.h (m4_add_include_directory): Add parameter.
4207         * m4/m4private.h (m4__include_init): New prototype.
4208         * m4/m4.c (m4_create): Put `.' on path before options are
4209         collected.
4210         * m4/path.c (includes): Assume C89.  Use gnulib for file name
4211         management.
4212         (m4__include_init): New function.
4213         (search_path_add): Allow prepending.
4214         (m4_add_include_directory, search_path_env_init): Adjust callers.
4215         (m4_path_search): Relative names now invoke path search, since
4216         `.' might not be first.
4217         * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
4219 2006-08-25  Bruno Haible  <bruno@clisp.org>  (tiny change)
4220         and Eric Blake  <ebb9@byu.net>
4222         * bootstrap: Run autopoint before gnulib-tool, since autopoint
4223         0.15 installs macros obsoleted by current gnulib.
4225 2006-08-25  Eric Blake  <ebb9@byu.net>
4227         * doc/m4.texinfo (Macro Arguments): Another section merged;
4228         testsuite failures now exposed.
4230 2006-08-23  Eric Blake  <ebb9@byu.net>
4232         * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
4233         (Input processing): More doc merges from the branch.
4234         (Regular expression syntax): Add introductory text.
4235         (Inhibiting Invocation): More doc merges from the branch.
4236         (Other tokens): Reorder after comments.
4237         * tests/generate.awk: Allow passing options to doc examples.
4239 2006-08-22  Eric Blake  <ebb9@byu.net>
4241         * tests/options.at (debug-flags): New test.
4242         * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
4243         not negative, to distinguish failure in m4_debug_decode.
4244         (m4_debug_decode): Add new parameter.
4245         * modules/gnu.c (regexp): Slight cleanup.
4246         (renamesyms): Ignore excess arguments.
4247         (syncoutput): Make case-insensitive, warn on bad argument.
4248         (debugmode): Factor -+ handling out to...
4249         * m4/debug.c (m4_debug_decode): ...here.
4250         (m4_debug_message_prefix): Fix spacing.
4251         * src/main.c (main): Let -d option adjust flags.
4252         * m4/input.c (file_clean): Avoid printing empty file name.
4253         * doc/m4.texinfo (Syncoutput): Document new range of input.
4254         (Invoking m4): Document use of multiple -d flags.
4256         Start porting various fixes from the branch that use gnulib.
4257         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4258         binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
4259         regexprops-generic stdlib-safer unlocked-io.
4260         * m4/debug.c (m4_debug_set_output): Close debug file on exec.
4261         * m4/path.c (m4_path_search): Close input file on exec, reject
4262         empty file name, fix parameter naming.
4263         * m4/output.c (make_room_for): Close diversion file on exec.
4264         (includes): Assume C89 headers.
4265         (tmpfile): For now, we don't want tmpfile-safer, because we want
4266         clean-temp later.
4267         * m4/m4private.h (includes): Use various gnulib headers.
4268         * doc/regexprops-generic.texi: Use gnulib's copy.
4270         * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
4271         * AUTHORS: Add copyright.
4272         * ChangeLog: Likewise.
4273         * README: Likewise.  Require automake 1.9b or later.
4274         * HACKING: New file.
4275         * README-alpha: Add copyright.
4276         * THANKS: Likewise.  Update.
4277         * doc/STYLE: Add copyright, and tweak for changed directories.
4278         * modules/README: Add copyright, and tweak for libtool version.
4279         * examples/COPYING: New file.
4280         * examples/WWW/COPYING: Likewise.
4281         * examples/WWW/m4lib/COPYING: Likewise.
4282         * modules/shadow.m4: Add copyright.
4283         * modules/perl.m4: Likewise.
4284         * modules/modtest.m4: Likewise.
4285         * modules/stdlib.m4: Likewise.
4286         * modules/time.m4: Likewise.
4287         * modules/time2.m4: Likewise.
4288         * po/Makevars: Likewise.
4289         * tests/iso8859.m4: Likewise.
4290         * tests/m4.in: Likewise.
4291         * NEWS: Add (C) to copyright.
4292         * TODO: Likewise.
4293         * m4/system_.h: Likewise.
4294         * tests/atlocal.in: Likewise.
4295         * tests/builtins.at: Likewise.
4296         * tests/freeze.at: Likewise.
4297         * tests/generate.awk: Likewise.
4298         * tests/macros.at: Likewise.
4299         * tests/modules.at: Likewise.
4300         * tests/options.at: Likewise.
4301         * tests/others.at: Likewise.
4302         * tests/testsuite.at: Likewise.
4303         * m4/utility.c: Spell out copyright years.
4304         * src/main.c: Likewise.
4306         * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
4308 2006-08-21  Eric Blake  <ebb9@byu.net>
4310         * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
4311         * modules/gnu.c (esyscmd): Use -1 for failure.  Set sysval to 0
4312         when no arguments are given, but without losing warning about 0
4313         arguments.
4314         * modules/m4.c (syscmd): Likewise.
4315         (includes): Assume C89.
4316         (m4_sysval): Make static.
4317         (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
4318         (sysval): Port calculation from branch.
4320 2006-08-20  Eric Blake  <ebb9@byu.net>
4322         * m4/macro.c (expand_macro): Move argument check...
4323         (m4_macro_call): ...to here, so indir will warn.
4324         * modules/gnu.c (__program__): New macro, ported from branch.
4325         (builtin): Perform argument check.
4326         (changesyntax): Avoid out-of-bounds read.
4328         * modules/gnu.c (includes): Assume stdlib.h, errno.
4329         (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4330         (substitute): Add caller parameter, avoid out-of-bounds memory
4331         references.
4332         (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4333         callers.
4335 2006-08-16  Eric Blake  <ebb9@byu.net>
4337         * po/POTFILES.in: Add more files that contain translatable
4338         strings.
4339         * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4340         information to translators.
4341         (USE_MSGCTXT): New var for gettext 0.15.
4342         * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4343         debug/trace messages in lower case.
4344         * m4/macro.c (expand_argument): Likewise.
4345         * m4/path.c (m4_path_search): Likewise.
4346         * src/main.c (main): Likewise.
4348 2006-08-14  Eric Blake  <ebb9@byu.net>
4350         * src/main.c (usage): Document --import-environment.
4351         * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4353 2006-08-11  Eric Blake  <ebb9@byu.net>
4355         * bootstrap (func_get_translations): Only remove files when doing
4356         full update.
4357         (func_update_po): Avoid CDPATH problems.
4359 2006-08-10  Eric Blake  <ebb9@byu.net>
4361         * bootstrap (func_get_translations): New function.
4362         (func_update_po): Borrow ideas from tar to correctly pull in
4363         translations from newer location.
4365 2006-08-09  Eric Blake  <ebb9@byu.net>
4367         * bootstrap: Recent gnulib no longer has jm_* macros to worry
4368         about.
4369         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4370         verror.
4371         * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
4372         (m4_error, m4_warn): ... these new prototypes.
4373         (m4_current_file, m4_current_line): Move into context, rather
4374         than leaving as globals.
4375         (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
4376         (m4_undivert_all, m4_input_init): Now takes context.
4377         * m4/utility.c (m4_error, m4_warn): New functions.
4378         * m4/m4private.h: Assume errno exists.
4379         (struct m4): Move warning_status to a bit flag,
4380         and add exit_status.  Adjust accessors accordingly.
4381         * src/main.c (print_program_name_CB): No longer needed.
4382         (main): Use new m4_get_fatal_warnings_opt.
4383         * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
4384         instead of issuing "INTERNAL ERROR".  Pass context when needed,
4385         and use new accessors.
4386         * m4/input.c: Likewise.
4387         * m4/macro.c: Likewise.
4388         * m4/output.c: Likewise.
4389         * m4/utility.c: Likewise.
4390         * modules/evalparse.c: Likewise.
4391         * modules/gnu.c: Likewise.
4392         * modules/load.c: Likewise.
4393         * modules/m4.c: Likewise.
4394         * modules/mpeval.c: Likewise.
4395         * src/freeze.c: Likewise.
4396         * src/main.c: Likewise.
4397         * tests/macros.at: Adjust to new message format.
4398         * tests/builtins.at: Likewise.
4399         * tests/freeze.at: Likewise.
4400         * tests/modules.at: Likewise.
4401         * doc/m4.texinfo: Likewise.
4403         * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
4404         newer gettext 0.15.
4406 2006-08-03  Eric Blake  <ebb9@byu.net>
4408         * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
4409         gracefully handle ENOSYS.
4410         * TODO: Update.
4411         * THANKS: Update.
4413 2006-07-28  Eric Blake  <ebb9@byu.net>
4415         * src/freeze.c (reload_frozen_state): Copy string when creating
4416         placeholder, to avoid memory corruption.
4417         * m4/symtab.c (symbol_popval): Avoid memory leak.
4418         (m4_symbol_rename): Avoid shadowing rename function.
4419         (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
4420         * tests/freeze.at (reloading unknown builtin): Add test.
4421         * tests/generate.awk: Capture m4.texinfo line number in
4422         testsuite.log, not just generated.at.
4424         Port idea from branch that a frozen file can request an unknown
4425         builtin without producing a warning unless the builtin is
4426         actually used.
4427         * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
4428         (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
4429         (m4_set_symbol_value_placeholder): New accessors.
4430         * m4/m4module.h (m4_is_symbol_placeholder),
4431         (m4_get_symbol_value_placeholder),
4432         (m4_set_symbol_value_placeholder),
4433         (m4_get_symbol_placeholder): Likewise.
4434         * m4/symtab.c (m4_is_symbol_value_placeholder),
4435         (m4_get_symbol_value_placeholder),
4436         (m4_set_symbol_value_placeholder): Likewise.
4437         (dump_symbol_CB): Handle new symbol type.
4438         * m4/macro.c (trace_pre): Likewise.
4439         (m4_macro_call): Warn when invoking a placeholder.
4440         * modules/m4.c (dumpdef): Handle dumping a placeholder.
4441         (defn): Warn when referencing a placeholder.
4442         * src/freeze.c (dump_symbol_CB): Ignore placeholder when
4443         freezing.
4444         (reload_frozen_state): When reloading unknown builtin, install a
4445         placeholder instead of warning.
4446         * tests/freeze.at (loading format 1): Allow warning when
4447         popdef'ing undefined function.
4449 2006-07-27  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
4451         * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
4452         function. Shift by 7, not 3, for consistency with
4453         gnulib/lib/hash.c. Don't assume hash word is 32 bits.
4455 2006-07-27  Eric Blake  <ebb9@byu.net>
4457         * src/main.c (usage): Update to match branch.
4458         (main): Update --version info to distinguish between program name
4459         `m4' and package name `GNU M4'.
4460         (AUTHORS): Translate René Seindal's name.
4461         * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
4462         * Makefile.am (doc/m4.1): Update to match branch.
4463         * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
4464         branch.
4466         * m4/system_.h (EXIT_MISMATCH): Define.
4467         * src/main.c (main): Don't clear syntax table for version 1.
4468         (usage): Document exit status.
4469         * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
4470         branch, and require V directive to appear first in file.  Fix
4471         broken logic for detecting F and T in version 1 files.
4473 2006-07-22  Eric Blake  <ebb9@byu.net>
4475         * src/main.c (stackovf_handler): Document the problems in our
4476         overflow handler.
4477         * src/stackovf.c: Forward port changes in branch to use POSIX
4478         sa_sigaction when available.
4479         (process_sigsegv): Avoid buffer overrun when error string is
4480         translated, although the fact that we translate in a signal
4481         handler is still a bug.
4482         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
4483         from branch to modernize checks.
4485         * modules/format.c (format): Avoid compiler warning that str may
4486         be used uninitialized.
4488         * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
4489         spelling.
4490         (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
4491         (DEBUG_MACRO): Remove unused macro.
4492         * src/stackovf.c: Avoid compiler warnings.
4493         * m4/input.c: Likewise.
4494         * m4/module.c: Likewise.
4495         * m4/output.c: Likewise.
4496         * m4/path.c: Likewise.
4497         * m4/symtab.c: Likewise.
4498         * m4/syntax.c: Likewise.
4500 2006-07-20  Eric Blake  <ebb9@byu.net>
4502         * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
4503         Regenerate to explicitly ask for --assume-autoconf=2.60.
4505 2006-07-19  Eric Blake  <ebb9@byu.net>
4507         * po/ChangeLog: Merge into main ChangeLog, then delete file.
4508         * THANKS: Update.
4510         * doc/m4.texinfo (copying): Relax restriction on front-cover and
4511         back-cover texts.
4513 2006-07-17  Eric Blake  <ebb9@byu.net>
4515         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
4516         0.14.5.
4518         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
4519         xvasprintf'.
4520         * modules/format.c (includes): Use xvasprintf.h.
4521         (format): Make static.  Avoid buffer overflow, that can lead to
4522         arbitrary code execution exploit.  Only pass unsigned char to
4523         is*().  Support F, g, and G specifiers.
4524         * doc/m4.texinfo (Format): Expose buffer overrun bug.  Document
4525         new specifiers.
4527 2006-07-17  Gary V. Vaughan  <gary@gnu.org>
4529         Ensure M4 compiles correctly with -DDEBUG, and use a single
4530         consistent definition of various /DEBUG_[A-Z]+/ symbols:
4532         * m4/input.c: Have commented out out DEBUG_INPUT only by default.
4533         (m4_print_token): Use m4_get_symbol_value_text and
4534         m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
4535         and VALUE_FUNC respectively.
4536         (m4__next_token): Use m4_print_token call instead of obsolescent
4537         print_token symbol.
4538         * m4/module.c: Have commented out out DEBUG_MODULE only by default.
4539         * m4/output.c: Similarly for DEBUG_OUTPUT.
4540         * m4/path.c: Similarly for DEBUG_INCL.
4541         * m4/symtax.c: Similarly for DEBUG_SYM.
4542         * m4/syntax.c: Similarly for DEBUG_SYNTAX.
4543         * src/stackovf.c: Similarly for DEBUG_STACKOVF.
4544         * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
4545         preprocessor macros defined with -DDEBUG compiles.
4547 2006-07-17  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
4549         * bootstrap: Correct typo in --download-po argument parsing.
4551 2006-07-15  Eric Blake  <ebb9@byu.net>
4553         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
4554         gendocs fdl'.
4555         * tests/generate.awk (normalize): Recognize @tabchar.
4556         * doc/m4.texinfo (Top): Start merging from branch.  Remove tabs.
4557         Fix menus.  Upgrade FDL license from 1.1 to 1.2.  Fix overfull
4558         hboxes.
4559         (Index macro, Shell commands, Incompatiblities): Rename nodes
4560         from Index, UNIX commands, Other incompat.
4561         (Platform macros, Using frozen files, Frozen file format 1)
4562         (Frozen file format 2, Copying This Manual, Indices): New nodes.
4563         * Makefile.am (EXTRA_DIST): Distribute gendocs.
4564         (MAINTAINERCLEANFILES): Clean up files from gnulib.
4565         (doc_m4_TEXINFOS): Depend on fdl.texi.
4566         (web-manual): New maintainer target.
4568 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
4570         * doc/m4.texinfo (Modules):  RMS asked me for an explanation of
4571         the modular architecture of M4.  The result is paraphrased here
4572         for the benefit of future readers of the manual.
4574 2006-07-14  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
4576         * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
4578 2006-07-14  Eric Blake  <ebb9@byu.net>
4580         * src/main.c (main): Avoid compiler warning.
4581         * modules/gnu.c (renamesyms): Remove unused variable.
4583 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
4585         * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
4586         (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
4587         new functions for managing regexp syntax options.
4588         * m4/m4private.h (m4): Add regexp_syntax field.
4589         * m4/resyntax.c: New file implements the above.
4590         * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
4591         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
4592         (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
4593         (m4_patsubst_do, m4_renamesyms_do): Removed.
4594         (builtin_changeresyntax): New builtin to change regular expression
4595         syntax.
4596         (m4_resyntax_encode_safe): Factor out diagnostics code.
4597         * src/freeze.c (produce_resyntax_dump): New function to dump
4598         default regexp syntax specifier to frozen file.
4599         (reload_frozen_state): Updated to action 'R' directive.
4600         * src/main.c (usage): Describe new -r option.
4601         (long_options, OPTSTRING): Declare it.
4602         (main): Encode and store cli regexp syntax option argument.
4603         * tests/freeze.at (regexp syntax): New test that regexp syntax
4604         survives freezing.
4605         * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
4606         * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
4607         (Epatsubst and Patsubst): Renamed to...
4608         (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
4609         documentation and added new examples.
4610         (Changeresyntax): New section describing changeresyntax builtin,
4611         and regexp syntax names.
4612         (Regular expression syntax): New section describing differences
4613         between various regular expression syntaxes.
4614         (Frozen files): Document 'R' directive.
4615         * NEWS: Updated.
4617 2006-07-13  Gary V. Vaughan  <gary@gnu.org>
4619         * bootstrap: Enhanced to work more like our other scripts:
4620         Add a copyright statement; support --version and --help; accept a
4621         --download-po option with argument as a substitute for DOWNLOAD_PO
4622         in the environment.
4624 2006-07-11  Eric Blake  <ebb9@byu.net>
4626         * Makefile.am (doc/m4.1): Port patch from branch that avoids
4627         intermediate file.
4628         * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
4629         changed.
4631 2006-07-10  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
4633         * tests/builtin.at (patsubst, regexp):  Adjust these tests, now
4634         that `\0' is no longer accepted.
4636         * src/main.c (usage): Alphabetize options within their sections.
4638         * modules/gnu.c (m4_regexp_search, regsub, substitute)
4639         (esyscmd):  Improve comments.
4641         * modules/gnu.c (substitute): Remove old warning for \0.
4642         (substitute_warned): No longer required.  Removed.
4644         * modules/gnu.c: Put macro definitions into alphabetical order.
4646 2006-07-07  Eric Blake  <ebb9@byu.net>
4648         * tests/freeze.at (loading format 1): New file, with new test.
4649         * tests/testsuite.at: Include it.
4650         * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
4651         * tests/modules.at (Freezing modules): Likewise.
4653         * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
4654         (AC_CHECK_HEADERS): Assume signal.h.
4655         (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
4656         (AC_CHECK_FUNCS_ONCE): Likewise.
4657         * src/m4.h (includes): Assume signal.h.
4659 2006-07-05  Eric Blake  <ebb9@byu.net>
4661         Fix all testsuite failures on cygwin.
4662         * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
4663         branch-1_4.  Solves testsuite failure when uninstalled m4 is
4664         shadowed by redefinition of PATH in libtool wrapper.
4665         * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
4666         contains the -no-undefined required by cygwin.
4667         (TESTS_ENVIRONMENT): Export abs_top_builddir.
4668         * tests/others.at (misc): Port to platforms where /etc/passwd
4669         does not exist or does not contain user named root.
4670         * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
4671         directory.
4672         * tests/builtins.at (define, divert): Avoid overquoting.
4673         * tests/generate.awk (new_group): Likewise.
4675 2006-07-05  Gary V. Vaughan  <gary@gnu.org>
4677         The regs_allocated field in a struct re_pattern_buffer refers
4678         to the state of a particular re_registers struct when used in
4679         successive matches using the same compiled pattern.  Avoid a
4680         SEGV in `renamesyms' resulting from using a new re_registers
4681         with an existing re_pattern_buffer:
4683         * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
4684         pattern buffer and registers.
4685         (m4_regexp_search): New function to call re_regexp_search with
4686         correctly matched pattern buffer and register instantiations.
4687         (m4_regexp_compile): Return an m4_pattern_buffer.  Adust all
4688         callers.
4690 2006-07-04  Gary V. Vaughan  <gary@gnu.org>
4692         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
4693         changes to gnulib getopt.m4 since last build.
4694         * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
4695         if the system getopt fails M4_GETOPT tests.
4697 2006-06-22  Eric Blake  <ebb9@byu.net>
4699         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
4700         Reported by Bruno Haible.
4702 2006-06-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4704         * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
4706 2006-06-19  Eric Blake  <ebb9@byu.net>
4708         * THANKS: Update.
4710 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4712         * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
4713         (clean-local): Split into and depend upon...
4714         (clean-local-tests, clean-local-src): ...these two.  The latter
4715         removes the libtool object directory below `src', to work around
4716         a buglet in Automake, failing to list it.
4717         (EXTRA_DIST): Distribute modules/perl.c.
4719 2006-06-19  Eric Blake  <ebb9@byu.net>
4721         * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
4722         right side of dependency; VPATH does that.
4723         (stamp-vcl): Update to use libtool's algorithm.
4724         (EXTRA_DIST): Distribute stamp-vcl.
4725         Reported by Ralf Wildenhues.
4726         (TESTSUITE): Revert earlier change that used absolute path, as
4727         that broke 'make dist' in VPATH.  Stick with $(srcdir) instead.
4728         (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
4729         (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
4730         atlocal takes care of it instead.
4731         (check-local, installcheck-local, clean-local): Inline absolute
4732         path to testsuite here, rather than relative path to testsuite
4733         elsewhere.
4735 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4737         * m4/m4private.h (DELETE): Cast away const here...
4738         * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
4739         * src/freeze.c (reload_frozen_state): Avoid uninitialized
4740         variable warning.
4742 2006-06-19  Eric Blake  <ebb9@byu.net>
4744         * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
4745         .info pages are built.
4746         Reported by Ralf Wildenhues.
4747         (EXTRA_DIST): Inline definition of testsuite, so that make dist
4748         works again.
4750 2006-06-16  Eric Blake  <ebb9@byu.net>
4752         Follow recommendations from autoconf manual for autotest.
4753         * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
4754         turn it into an absolute path until autotest provides an option
4755         that allows us to avoid changing directories.  Properly quote
4756         throughout.
4757         (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
4758         (check-recursive): Delete unused target.
4759         ($(TESTSUITE)): Atomically update testsuite.
4760         (CD_TESTDIR): Simplify.
4761         (m4__cd): Delete unused macro.
4762         (check-local): Let TESTSUITEFLAGS influence the run.
4763         (installcheck-local): Let TESTSUITEFLAGS override
4764         AUTOTEST_PATH.  Add dependencies.
4765         (clean-local): Clean up.
4766         (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
4767         * README: Document how to use the testsuite.
4769 2006-06-15  Eric Blake  <ebb9@byu.net>
4771         * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
4773         * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
4774         clashes with m4sugar.
4775         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
4776         * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
4777         * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
4778         * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
4779         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
4780         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
4781         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
4782         * configure.ac: Likewise.
4783         (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
4784         * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
4785         conditional.
4786         * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
4788         Reduce compiler warnings.  Inside GMP, mpq_t is an array type, so
4789         const mpq_t is not assignable from plain mpq_t.  Avoid
4790         type-punning warnings caused trying to mix these types.
4791         * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
4792         (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
4793         * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
4794         (mult_term, exp_term): Remove type-punning casts.
4795         (numb_pow): Remove const qualifier.
4796         * src/freeze.c (reload_frozen_state): Fix typo in messages.
4797         Fix variables that can be used uninitialized, which fixes
4798         security hole where malicious frozen file can execute arbitrary
4799         code.
4801 2006-06-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4803         * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
4805 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4806         and Eric Blake  <ebb9@byu.net>
4808         Allow `make dist' to work again.
4809         * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
4810         (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
4811         (cvs-dist): Fix typo.
4812         * NEWS: Match current version number.
4814 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4816         * Makefile.am (AM_CPPFLAGS):  Add $(LTDLINCL), so the right
4817         ltdl.h is used.
4819         * bootstrap: Do not run libtoolize manually, this is done
4820         correctly by autoreconf.  Invoke autoreconf with --no-recursive
4821         to avoid unnecessary rerunning of autotools for libltdl.
4823 2006-06-13  Eric Blake  <ebb9@byu.net>
4825         * THANKS: Update.
4827 2006-06-12  Eric Blake  <ebb9@byu.net>
4829         * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
4830         bother with mktemp.
4831         * src/m4.h: Don't declare mktemp.
4832         * m4/input.c (m4__next_token): Avoid bzero.
4833         * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
4834         * Makefile.am (doc/m4.1): Depend on installed help2man, rather
4835         than distributing outdated helptoman.pl.
4836         * doc/helptoman.pl: Delete.
4838 2006-06-10  Eric Blake  <ebb9@byu.net>
4840         * README (Patches): Document the current dependence on CVS
4841         builds of autotools.
4842         * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
4843         * configure.ac: Use consistent quoting throughout.
4844         (AC_PREREQ): Bump to 2.59d.
4845         (AC_INIT): Package name begins with uppercase.
4846         (AC_ARG_WITH): Use AS_HELP_STRING.
4847         (AM_INIT_AUTOMAKE): Enable gnits mode.
4848         (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
4849         (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
4850         (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
4851         done by gnulib or automake, or which autoconf has declared
4852         obsolete.
4853         * m4/m4private.h (Includes): Assume C89 or better, and use errno
4854         unconditionally.
4855         * m4/output.c (Includes): Likewise.
4856         * modules/gnu.c (Includes): Likewise.
4857         * modules/m4.c (Includes): Likewise.
4858         * src/m4.h (Includes): Likewise.
4860         * README-alpha: Update web address.
4861         * README: Likewise. Change encoding to ASCII.  Remove old advice
4862         about cygwin.  Document bootstrapping dependency.
4863         * AUTHORS: Update from branch-1_4.
4864         * THANKS: Likewise.  Change encoding to UTF-8.
4865         * BACKLOG: Delete.  This file is too old and unmaintained to be
4866         worthwhile.
4867         * ChangeLog: Change encoding to UTF-8.
4869         Avoid compiler warnings.
4870         * m4/macro.c (trace_format): Don't mark this as a printf format,
4871         since we don't accept the same set of modifiers as printf.  It
4872         would be nice if gcc let us specify a custom format archetype.
4873         * src/main.c (main): Cast away const.
4875 2006-06-10  Andreas Schwab  <schwab@suse.de>  (tiny change)
4876             Eric Blake  <ebb9@byu.net>
4878         * modules/time.c (ctime): Pass correctly typed variable to
4879         m4_numeric_arg.
4880         (gmtime): Likewise.
4881         (localtime): Likewise.
4882         (strftime): Likewise.
4883         * m4/utility.c (m4_numeric_arg): For now, document arbitrary
4884         limit inherent in this interface.
4886 2006-05-08  Bruno Haible  <bruno@clisp.org>  (tiny change)
4888         * modules/m4.c (WEXITSTATUS): Provide fallback definition.
4889         (sysval): Use WEXITSTATUS.
4890         * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
4891         big-endian and little-endian wait status definitions.
4893 2006-05-06  Eric Blake  <ebb9@byu.net>
4895         * po/Makevars (MSGID_BUGS_ADDRESS): Add.
4896         * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
4897         in src, not gnu.
4899 2006-05-06  Eric Blake  <ebb9@byu.net>
4901         * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
4902         subdirectory to use.
4903         (support for -pipe): Move after LT_INIT, since it relies on
4904         libtool internals.
4906 2006-05-05  Eric Blake  <ebb9@byu.net>
4908         * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
4910         * THANKS: Update.
4912 2006-05-05  Bruno Haible  <bruno@clisp.org>
4913         and Eric Blake  <ebb9@byu.net>
4915         * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
4916         * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
4917         usage pattern.
4918         * bootstrap: Update usage of gnulib-tool.
4920 2006-05-04  Eric Blake  <ebb9@byu.net>
4922         * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
4923         Cleanup whitespace.
4925 2005-12-05  Gary V. Vaughan  <gary@gnu.org>
4927         * bootstrap (func_update_po): Synch with CVS GNU tar.  wget 1.9.x
4928         and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
4929         Reported by Eric Blake <ebb9@byu.net>
4931 2005-12-04  Gary V. Vaughan  <gary@gnu.org>
4933         * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
4934         http caching as -C is no longer supported by wget 1.10.x.
4935         Reported by Eric Blake <ebb9@byu.net>
4937 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
4939         * m4/module.c (caller_id): To match libtool-2.0 interface, changed
4940         to ...
4941         (iface_id): ...an lt_dlinterface_id type.
4942         (m4__module_find): New abstraction for lt_dlhandle_fetch.  Use
4943         throughout, instead of calling obsolete lt_dlhandle_find directly.
4944         (m4__module_next): Use multiloader-safe lt_dlhandle_iterate.  Use
4945         throughout, instead of calling obsolete lt_dlhandle_next.
4946         * m4/m4private.h (m4__module_find): Declare it.
4947         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
4948         Use m4__module_next instead of obsolete lt_dlhandle_next.
4950 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
4952         * bootstrap (func_update_po): Update pofiles directly from the
4953         translation project.
4954         * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
4955         po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
4956         these files under source control anymore.
4957         Suggested by Eric Blake <ebb9@byu.net>
4959 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
4961         * ltdl/m4/m4-gnulib.m4: Update FSF contact address.  Somehow this
4962         file escaped the address updates on 2005-05-01.
4964 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
4966         * bootstrap: Allow user overriding of gnulib-tool location, and
4967         correctly determine module source directories whether gnulib-tool
4968         is given as a relative or absolute path, or is found by searching
4969         PATH.
4970         Reported by Eric Blake <ebb9@byu.net>
4972 2005-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4974         * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
4975         and $RM are defined for various versions of
4976         AC_LIBTOOL_COMPILER_OPTION.
4978         * bootstrap (AUTORECONF): New variable to allow user overriding of
4979         autoreconf path.
4981 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
4983         * doc/m4.texinfo (History): Add better notes on the ancestory of
4984         GNU m4, and other historical interest.
4986 2005-05-08  Gary V. Vaughan  <gary@gnu.org>
4988         * m4/symtab.c (m4_symbol_rename): New function that performs a low
4989         level symbol rename.
4990         * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
4991         * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
4992         (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
4993         regsub...
4994         (erenamesyms, renamesyms): ...builtins that use these to implement
4995         macro renaming by regular expression.
4996         * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
4997         * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
4998         to stop the new generated tests from choking.
5000 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
5002         Since most of the build is handled from a single Makefile.am now,
5003         we can teach make about the dependencies between the m4 binary and
5004         the preopened modules it is built against:
5006         * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5007         preopened modules.
5008         * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5009         of the preopened modules have changed.
5011 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
5013         * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5014         have a native implementation.
5016 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
5018         * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed.  These are
5019         handled already by gnu/exit.h.
5021         * configure.ac (gl_MODULES): Add assert to support a
5022         --disable-assert configure time option for NDEBUG setting.
5024         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5025         * bootstrap (src_modules): Add version-etc-fsf.
5026         * src/main.c (version_etc_copyright): Removed.
5028         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5030 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5032         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5033         recognition macros.
5034         * src/freeze.c (produce_frozen_state): Use \n line-endings even
5035         on Windows, so that the frozen file reader will work.
5036         Reported by Josef T. Burger <bolo@bolo.com>
5038 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
5040         Forward port of a patch that allowed m4-1.4.2 to compile on
5041         QNX 6.3:
5043         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
5044         sys/signal.h.
5045         * src/m4.h: And include them as appropriate.
5046         * src/main.c, src/stackovf.h: Don't include signal.h literally;
5047         m4.h will include the correct file.
5049 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5051         * m4/m4private.h: Make errno visible for the sources patched
5052         below.
5054 2005-05-04  Paul Eggert  <eggert@twinsun.com>
5056         * src/main.c (print_program_name_CB): Preserve errno, since
5057         M4ERROR relies on this.
5058         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
5059         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
5060         * m4/path.c (m4_path_search): Don't let "free" trash errno when
5061         returning NULL.
5063         * m4/output.c (m4_insert_file): Don't assume errno has a valid
5064         value simply because fread returns zero.  This fixes a
5065         portability bug reported by Marion Hakanson in
5066         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
5068 2005-05-04  Santiago Vila  <sanvila@debian.org>
5070         * tests/stackovf.test: Use tempfile if available.
5072 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
5074         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
5075         * m4/output.c (m4_insert_file): Do not mix buffered and
5076         unbuffered I/O, as this breaks on the Hurd.
5078 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5080         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
5081         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
5082         and libtoolize does a better job of ltdl importing now too, so
5083         take advantage of that while updating the tree:
5085         * acm4, config: Moved from here...
5086         * ltdl/m4, ltdl/config: ...to here.
5087         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
5088         src/Makefile.am, tests/Makefile.am: Removed...
5089         * Makefile.am: ...and migrated to here, with adjustments to
5090         compensate for relative path differences.
5091         * commit: Adjust relative paths.
5092         * configure.ac: Adjust relative paths.
5093         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
5094         patch.
5095         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
5096         the meanwhile, CVS HEAD libtool is needed.
5097         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
5098         stricly new enough, we also need a patch.
5099         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
5100         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
5101         (gl_MODULES): Don't list getopt and version-etc, as they don't
5102         belong in libm4.
5103         * bootstrap: After running gnulib-tool to import the listed
5104         modules, fetch getopt and version-etc into src manually.
5105         (ltdldir): Change to ltdl.
5106         * src/main.c: Adjust for changes in version-etc API.
5107         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
5108         but works when the getopt module isn't to be included in the lib.
5109         * README: Add note about patching autoconf and automake to
5110         bootstrap CVS m4.
5112 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
5114         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
5115         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
5116         empty file rather than to a nonexistent file.  This closes a
5117         common security hole.
5118         * modules/m4.c (m4_maketemp): Implement the above, by using
5119         mkstemp rather than mktemp.
5121 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
5123         The FSF are moving offices today.  Changed their contact address
5124         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
5125         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
5127 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
5129         * tests/Makefile (clean-local): Ignore testsuite cleanup
5130         failures.
5132 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
5134         * tests/Makefile (clean-local): Only run the testsuite cleanup
5135         if the testsuite has been generated.
5137 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
5139         * TODO: slight clarification of the example of qindir usage.
5141 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
5143         * TODO: Add qindir requirement, and defn bug.
5144         From Stepan Kasal  <kasal@ucw.cz>
5146 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
5148         * TODO: Add ``execution stack'', fix a typo.
5149         * doc/m4.texinfo: Typos.
5151 2004-12-24  Eric Blake  <ebb9@byu.net>
5153         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
5154         to the gnu subdirectory.
5155         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
5156         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
5157         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
5158         * m4/system_.h: Likewise, in non-configured includes.
5160 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
5161             Gary V. Vaughan  <gary@gnu.org>
5163         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
5164         Protect definitions from macro expansion under -DNDEBUG by
5165         parenthesising the expanded function names.
5166         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5167         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5168         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5169         (m4_is_syntax_macro_escaped): Similarly protect function
5170         definitions from macro expansion under -DNDEBUG by #undefing the
5171         matching macro names before each definition.  Also, move all the
5172         function definitions to the end of the file so that any
5173         invocations in the rest of the file pick up the fast macro
5174         versions.
5175         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
5176         (m4_set_debug_file, m4_set_trace_messages)
5177         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5178         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5179         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
5180         option setter functions.
5182 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
5184         * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
5185         to gnu.
5187 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
5189         * src/main.c: Include gnulib files from the correct directory.
5191         * gnulib/*: Don't store any of the gnulib files in arch, as they
5192         generate spurious changes.
5193         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
5194         gnulib macros now share our macro directory.
5195         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
5196         * bootstrap: Call gnulib-tool to import from the gnulib tree.
5197         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
5198         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
5199         the gettext macros from autopoint that overwrite the gnulib-tool
5200         imported versions.  Import sources and Makefile.am into the `gnu'
5201         directory.  Changed all callers.
5202         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
5203         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
5204         for imported modules.
5205         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
5206         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
5207         hardcoding the gnulib macros they wrap.
5209 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
5211         Latest CVS libtool can preload modules in libraries, including
5212         its own module loaders!  Tweak m4 so that it doesn't try to treat
5213         libltdl's module loaders as m4 modules when freezing and on exit:
5215         * gnulib/acm4/*.m4: Don't store these files in arch since they
5216         generate spurious changes.
5217         * bootstrap: Simplify initial libtoolize call, since CVS
5218         libtoolize is smarter these days.
5219         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
5220         build.
5221         * m4/module.h (m4__module_exit): Missing declaration.
5222         * m4/m4private.h (m4__module_next): New function declaration.
5223         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
5224         encapsulation.  Changed all callers.
5225         (m4__module_interface): New function to verify m4 loadable module
5226         interfaces.
5227         (m4__module_init): Register the interface validator.
5228         (m4__module_exit): Only close my own modules.
5229         * modules/m4.c (unistd.h): Provide missing declaration.
5230         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
5231         (m4_expand_ranges): More missing declarations.
5232         * modules/modtest.c (export_test): Ditto.
5233         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
5234         * src/main.c (main): Bump copyright year.
5235         * tests/modules.at: Fix sed syntax error.
5238 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
5240         Tweaking to enable compilation with latest CVS libtool and
5241         libltdl.  We can't just dump the library files directly into the
5242         m4 directory anymore now that libltdl is built from pieces itself:
5244         * bootstrap: Rewritten to use latest libtoolize sanely, and to
5245         set up libltdl subdirectory.
5246         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
5247         gnulib subdirectory's config.
5248         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
5249         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
5250         macros from gnulib.
5251         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
5252         configure.ac, so use AC_WITH_LTDL instead.
5253         * Makefile.am (SUBDIRS): Add libltdl.
5254         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
5255         gl_INCLUDED_REGEX.
5256         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
5257         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
5258         (libm4_la_LIBADD): Add LIBLTDL.
5259         * m4/ltdl.c, m4/ltdl.h: Removed.
5260         * m4/m4module.h: Include canonical ltdl.h.
5261         * po/*.po: Updated.
5263 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
5265         * gnulib/import: Now updates makefile fragments, and configure.ac.
5266         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
5267         * gnulib/m4/Makefile.am: include it.
5268         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
5269         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
5270         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
5271         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
5272         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
5273         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
5274         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
5275         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
5276         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5277         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5278         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5279         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
5280         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
5281         import.
5282         * gnulib/m4/getopt_int.h: New source file from latest gnulib
5283         import.
5284         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
5285         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
5286         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
5287         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
5288         Updated source files from latest gnulib.
5290 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
5292         * config/mailnotify: New file for mailing commit notifications,
5293         imported from cvs-utils.
5294         * commit: Updated from cvs-utils and tweaked for m4.
5296 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
5298         * config/mkstamp: Updated from CVS libtool.
5299         * configure.ac: Generate a gnu coding standards compliant version
5300         number, and use it for the banner.
5301         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
5302         mhen the TIMESTAMP changes in ChangeLog, but the file modification
5303         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
5304         contain the previous version number.
5305         * src/main.c: Make --version output conform to the GNU standard.
5307         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
5308         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
5309         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
5310         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
5311         time_la_SOURCES): ...so that these are defaulted correctly, and
5312         can be removed from this file.
5313         (AM_LDFLAGS): Add -module...
5314         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
5315         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
5316         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
5317         the individual settings can be removed.
5318         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
5319         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
5320         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
5321         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
5322         time_la_LIBADD): ...so that these are picked up as a deplib of
5323         libm4 and don't need to be set explicitly.
5325 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
5327         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
5328         from the standard build.  It is too fragile.
5330         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5331         CVS libtool after merging m4 changes across to libtool.
5333         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5334         * m4/path.c (search_path_add): Ditto.
5336 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5338         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5339         libtool tags we don't use in configure.  This reduces the size
5340         of the script from over 1Mb to under 700Kb.
5342 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5344         The import script was not written properly, and the last gnulib
5345         import was incomplete.  Fixed that problem, and reimport our
5346         gnulib dependencies, which picks up the address calculation
5347         overflow checks described by Paul below.  Also tweak the clients
5348         of the gnulib xalloc module not to use deprecated macros:
5350         * gnulib/import: Recurse through module dependencies rather than
5351         naively descending only one level.
5352         * configure.ac: Add calls to gnulib's strnlen and extension module
5353         macros.
5354         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5355         extension modules.
5356         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5357         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5358         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
5359         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
5360         gnulib.
5361         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
5362         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
5363         place of `xcalloc (1, S)'.
5364         * m4/m4.c (m4_create): Likewise.
5365         * m4/m4private.h (m4_symbol_value_create): Likewise.
5366         * m4/symtab.c (symtab_fetch): Likewise.
5367         * m4/syntax.c (m4_syntax_create): Likewise.
5368         * src/freeze.c (reload_frozen_state): Likewise.
5369         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
5370         macro.
5371         * m4/symtab.c (m4_symtab_create): Likewise.
5373 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5375         * tests/module.at: Comment typo.
5377 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
5379         * tests/modules.at (modules: importing): Apply some lateral
5380         thinking, and use AT_CHECK to compare the output of a sed pass
5381         over stderr against the canonical strerror string.
5383         * tests/modules.at (modules: importing): Edit the generated stderr
5384         output to canonicalize strerror output, before a comparison.
5386 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
5388         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
5389         careful not to trip over the mess:
5391         * modules/perl.c: Some builds of perl install headers that contain
5392         `#define try __builtin_try'.  Be sure to undefine that macro
5393         before `m4/hash.h' gets included, which uses the `try' symbol.
5394         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
5395         `false' before including `stdbool.h'.
5396         (DELETE):  This symbol is not in m4's namespace, and is in any
5397         case only used internally...
5398         * m4/m4private.h (DELETE): ...so move it to here.
5399         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
5401 2003-10-08  Paul Eggert  <eggert@twinsun.com>
5403         Don't use XMALLOC and XCALLOC.  Once we install the
5404         corresponding patch into gnulib, this will fix some
5405         address-calculation overflow bugs on hosts where calloc (A, B)
5406         returns garbage when A*B overflows.
5408         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
5409         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
5410         xmalloc, XCALLOC with xcalloc.
5411         * m4/m4.c (m4_create): Likewise.
5412         * m4/m4private.h (m4_symbol_value_create): Likewise.
5413         * m4/output.c (m4_output_init): Likewise.
5414         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
5415         * m4/syntax.c (remove_syntax_attribute): Likewise.
5416         * src/freeze.c (reload_frozen_state): Likewise.
5417         * src/main.c (main): Likewise.
5419 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
5421         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
5422         gnulib/acm4 directories for aclocal m4 macros.
5423         * gnulib/Makefile.am (EXTRA_DIST): Removed.
5424         (MAINTAINERCLEANFILES): Add Makefile.in.
5425         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
5426         modules we use.
5427         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
5428         * gnulib/import: New file.  Temporary script for updating gnulib
5429         imported files, until gnulib-tool is working.
5430         * gnulib/config/codeset.m4, gnulib/config/error.m4,
5431         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
5432         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
5433         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5434         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
5435         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5436         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5437         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5438         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
5439         gnulib/config/nls.m4, gnulib/config/obstack.m4,
5440         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
5441         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
5442         gnulib/config/regex.m4, gnulib/config/restrict.m4.
5443         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
5444         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
5445         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
5446         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
5447         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
5448         gnulib/config/xstrndup.m4: Removed.
5449         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
5450         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
5451         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
5452         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
5453         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
5454         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
5455         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
5456         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
5457         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
5458         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
5459         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
5460         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
5461         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
5462         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
5463         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5464         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
5465         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
5466         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5467         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5468         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
5469         gnulib/import script.
5470         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
5471         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
5472         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5473         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
5474         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
5475         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
5476         gnulib with gnulib/import script.
5477         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
5478         guards ready for gnulib-tool to autoupdate on import.
5479         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
5480         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
5481         config/stackovf.m4: Moved from here...
5482         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
5483         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
5484         acm4/stackovf.m4: ...to here, to separate aclocal macros from
5485         configure time helper scripts.
5486         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
5487         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
5488         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
5489         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
5490         gnulib xalloc.h.
5491         * src/main.c (version_etc_copyright): Only output the current
5492         year.
5493         (version_etc): Call with new variadic API.
5495 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
5497         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
5498         version-etc module from CVS gnulib.
5499         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
5500         * src/Makefile.am: Build it.
5501         * src/main.c: Use it.
5503         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
5504         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
5505         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
5506         exit.h instead.
5508 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
5509             Gary V. Vaughan  <gary@gnu.org>
5511         * bootstrap: Separate options.
5512         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
5513         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
5514         not set.
5515         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
5516         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
5517         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
5518         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
5519         $(LTLIBINTL) for gettext support on cygwin.
5520         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
5521         have $(LTLIBINTL) from the preloaded module la files.
5522         * README: Remove the warning about using --disable-nls on Windows
5523         machines.
5525 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
5527         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
5528         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
5529         is required.
5531 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
5533         * doc/STYLE: Document the gnulib header naming conventions, and
5534         #include policy.
5535         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
5536         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
5537         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
5538         respectively.
5539         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
5541         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
5542         module from CVS gnulib.
5543         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
5544         (gl_FUNC_STRTOL): In favour of the module macro.
5546 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
5548         Replace the getopt code with CVS gnulib getopt.  The source files
5549         detect whether they are in a glibc environment and preprocess away
5550         all of the code if there is a system getopt, so we can compile
5551         them into the m4 executable unconditionally:
5553         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
5554         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
5555         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
5556         macros.
5557         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
5558         version.
5559         * src/Makefile.am: Adjust.
5560         * src/main.c: Always include our shipped getopt.h.
5561         * po/POTFILES.in: Use new location of getopt.c.
5563 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
5565         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
5566         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
5567         in this directory automatically.
5568         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
5570         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
5571         isn't set yet.
5572         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
5573         inline.
5574         * modules/Makefile.am (pkglibexecdir): Set it here.
5575         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
5577         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
5578         Import regex module from CVS gnulib.
5579         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
5580         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
5581         do extra substitutions for Makefile.
5582         * configure.ac: Use it.
5583         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
5584         from regex_.h if necessary.
5585         * m4/system_.h: Include the correct version of regex.h.
5586         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
5587         version.
5588         * po/POTFILES.in: Use new location of regex.c.
5590         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
5591         realloc.c: automake distributes these files already.
5593 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
5595         Replace the xstrzdup code by importing the xstrndup module from
5596         CVS gnulib, along with its dependencies: strndup and strnlen:
5598         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
5599         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
5600         gnulib.
5601         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
5602         gnulib/config/strndup.m4: Ditto wrt strndup.
5603         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
5604         strnlen.
5605         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
5606         However, contrary to gnulib, we install xstrndup.h.
5607         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
5608         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
5609         is an artifact of the old m4 portability layer.
5610         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
5611         * m4/system_.h: Include xstrndup.h.
5612         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
5614 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
5616         Reimport the latest xalloc module from CVS gnulib, and adjust the
5617         m4 sources to take advantage of xalloc xfree.  Also create a new
5618         macro DELETE with the same semantics as the old m4 XFREE macro,
5619         and carefully tweak callers:
5621         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
5622         gnulib.
5623         * m4/utility.c (xfree): Removed.  This function is now supplied by
5624         gnulib xalloc.
5625         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
5626         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
5627         * m4/symtab.c (m4_symtab_create): Ditto.
5628         * m4/system_.h: Removed XFREE redefine.
5629         (DELETE): New macro with same functionality as the original m4
5630         XFREE macro, but based on xalloc.h now.  Changed all callers.
5631         * src/main.c (main): Use XMALLOC macro.
5632         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
5633         instead of XFREE.
5634         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
5636 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
5638         Import the xalloc module from CVS gnulib, along with its
5639         dependencies: exitfail, malloc and realloc. We had different
5640         semantics for our XFREE and a function xfree() not supplied by
5641         gnulib, so also a bit of work to keep everything running
5642         smoothly:
5644         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
5645         (gl_XALLOC): Use gnulib equivalents.
5646         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
5647         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
5648         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
5649         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
5650         realloc.
5651         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
5652         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
5653         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
5654         imported modules.
5655         (pkgincdir): Removed.  Use pkgincludedir instead.
5656         * m4/m4private.h (XFREE): xfree already checks for NULL.
5657         * m4/system_.h: Use xalloc module, and remove macros already
5658         supplied by xalloc.h.
5659         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
5660         moved the old definition from m4/xmalloc.c to here for now.
5662 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
5664         Import the error and progname modules from CVS gnulib.  Our old
5665         error.c subsumed the functionality of both, so a little adjustment
5666         was required to accomodate the split in sources.  Also added more
5667         wrapper macros to choose between a system installed error.h or our
5668         shipped gnulib error module:
5670         * m4/error.c, m4/error.h: Removed.
5671         * m4/Makefile.am: Adjust.
5672         (pkgincdir): Removed.  Use pkgincludedir instead.
5673         * m4/module.h, src/main.c: Don't include `m4/error.h'.
5674         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
5675         error.h.
5676         * gnulib/m4/progname.c: Imported from CVS gnulib.
5677         * gnulib/m4/progname.h: Ditto.
5678         * src/main.c: Adjust to use progname module.
5679         * gnulib/m4/error.c: Imported from CVS gnulib.
5680         * gnulib/m4/error_.h: Ditto.
5681         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
5682         if appropriate, and link a local error.h if the system version is
5683         missing.
5684         (libgnu_la_SOURCES) Add progname module sources.
5685         * gnulib/config/error.m4: Imported from CVS gnulib.
5686         * gnulib/config/strerror_r.m4: Ditto.
5687         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
5688         to have ERROR_H for Makefile substitutions and tell system.h
5689         whether the system error.h should be used, or a locally installed
5690         version.
5691         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
5693 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
5695         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
5696         s/gettext_.h/gettext.h/.
5698         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
5699         automake have been fixed.
5701         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
5702         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
5703         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
5704         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
5706 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
5708         The gnulib obstack module requires the gnulib gettext module for
5709         systems that do not have GNU gettext installed.  Because we use
5710         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
5711         that directory incase it clashes with the system gettext.h.  This
5712         delta uses gettext_.h and extra rules in the Makefile to make a
5713         link to gettext.h when needed:
5715         * Makefile.am (auxdir): Removed.  No longer used.
5716         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
5717         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
5718         moved.
5719         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
5720         Makefile based build.
5721         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
5722         of the macros are kept.
5723         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
5724         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
5725         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
5726         distributes these automatically.
5727         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
5728         warning from automake-1.7a.
5729         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
5730         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
5731         all callers.
5732         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
5733         wrt. m4_FUNC_OBSTACK.
5734         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
5735         wrt. m4_sys_STACKOVF.
5736         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
5737         wrt. _m4_LIB_GMP, m4_LIB_GMP.
5738         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
5739         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
5740         respectively.
5741         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
5742         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
5743         gettext.h link on deficient systems.
5744         (pkginc_HEADERS): Mention $(GETTEXT_H).
5745         (EXTRA_HEADERS): Mention gettext.h.
5746         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
5747         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
5748         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5749         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
5750         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5751         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5752         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5753         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
5754         gnulib/config/po.m4, gnulib/config/progtest.m4,
5755         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
5756         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
5758 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
5760         We can't mirror the gnulib directory structure here, since we need
5761         to be able to eg. `#include <m4/obstack.h>' from our source files,
5762         which is much easier if the local obstack.h is created in a
5763         directory named m4.  Rather than trying to symlink everything into
5764         the m4 directory, now we build a libtool convenience library from
5765         the sources we get from gnulib and link that with libm4.la:
5767         * gnulib/config/extensions.m4: Imported from CVS gnulib.
5768         * gnulib/config/unlocked-io.m4: Ditto.
5769         * gnulib/m4/unlocked-io.h: Ditto.
5770         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
5771         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
5772         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
5773         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
5774         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
5775         * m4/Makefile.am: Adjust.
5776         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
5777         macros we redistribute.
5778         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
5779         library among others.
5780         (GNULIB_SRCS, GNULIB_MACROS): Removed.
5781         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
5782         * config/m4-obstack.m4: Adjust.
5783         * po/POTFILES.in: Adjust.
5784         * configure.ac: Reformatting.  Call newly imported gnulib macros.
5785         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
5786         bogus calls of `#include "m4.h"'.
5787         * Makefile.am: INCLUDES has been deprecated in favour of
5788         AM_CPPFLAGS.
5789         * m4/Makefile.am: Ditto.
5790         * modules/Makefile.am: Ditto.
5791         * src/Makefile.am: Ditto.
5793 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
5795         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
5797 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
5799         Migrate the obstack support into the gnulib directories for easy
5800         synchronisation with upstream files in gnulib:
5802         * config/gnu-obstack.m4: Moved from here...
5803         * config/m4-obstack.m4: ...to here.
5804         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
5805         * m4/obstack.c, m4/obstack_.h: Moved from here...
5806         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
5807         * po/POTFILES.in: Adjust.
5808         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
5809         * m4/Makefile.am: Add a whole new section to link the obstack
5810         sources from the gnulib tree if necessary.
5811         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
5812         from gnulib.
5813         * config/m4-obstack.m4: Rewrite as a wrapper for
5814         gnulib/m4/obstack.m4.
5816 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
5818         GNU M4 currently builds with a number of files adapted from
5819         upstream sources.  Recently the gnulib project on savannah.gnu.org
5820         has pulled together a great many of these externally maintained
5821         files.  This delta is the beginnings of isolating those files
5822         maintained in gnulib to make it easy to synchronise M4 with the
5823         upstream files prior to releases.
5825         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
5826         directory.
5827         (SUBDIRS): Added new gnulib subdirectory.
5828         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
5829         * config/stdbool.m4: Moved from here...
5830         * gnulib/m4/stdbool.m4: ...to here.
5831         * m4/stdbool_.h: Moved from here...
5832         * gnulib/lib/stdbool_.h: ...to here.
5833         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
5834         distributed.
5835         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
5836         code to work with new stdbool_.h location.
5837         (gnulib_srcdir): New.
5839 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
5841         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
5842         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
5843         builds to work.
5844         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
5845         (EXTRA_DIST): Use it.
5847         * bootstrap: CVS autoreconf leaves file droppings.  Remove
5848         aclocal.m4t incase autoreconf doesn't.
5850 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
5852         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
5853         the other gnulib imports, renamed to m4/obstack_.h.
5854         * m4/obstack.c: Updated from CVS gnulib.
5855         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
5856         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
5857         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
5858         about vpath already, and $top_srcdir upsets CVS Automake, so the
5859         $top_srcdir reference was removed.
5861         * m4/system-h.in: For consistency with the gnulib imports, renamed
5862         to m4/system_.h.
5863         * m4/Makefile (EXTRA_HEADERS): Adjust.
5864         * configure.ac (AC_CONFIG_FILES): Adjust.
5866         * m4/stdbool_.h: New file from gnulib for systems without their
5867         own.
5868         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
5869         * config/stdbool.m4: New file.  Macros from gnulib for same.
5870         * configure.ac: Use it.
5872 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
5874         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
5875         * config/gmp.m4: Ditto.
5876         * config/gnu-obstack.m4: Ditto.
5877         * config/stackovf.m4: Ditto.
5878         * m4/builtin.c: Ditto.
5879         * m4/debug.c: Ditto.
5880         * m4/error.c: Ditto.
5881         * m4/error.h: Ditto.
5882         * m4/gnu-obstack.h: Ditto.
5883         * m4/hash.c: Ditto.
5884         * m4/hash.h: Ditto.
5885         * m4/input.c: Ditto.
5886         * m4/m4.c: Ditto.
5887         * m4/m4module.h: Ditto.
5888         * m4/m4private.h: Ditto.
5889         * m4/macro.c: Ditto.
5890         * m4/module.c: Ditto.
5891         * m4/obstack.c: Ditto.
5892         * m4/output.c: Ditto.
5893         * m4/path.c: Ditto.
5894         * m4/regex.c: Ditto.
5895         * m4/regex.h: Ditto.
5896         * m4/strtol.c: Ditto.
5897         * m4/symtab.c: Ditto.
5898         * m4/syntax.c: Ditto.
5899         * m4/utility.c: Ditto.
5900         * m4/xmalloc.c: Ditto.
5901         * m4/xstrdup.c: Ditto.
5902         * m4/xstrzdup.c: Ditto.
5903         * modules/evalparse.c: Ditto.
5904         * modules/format.c: Ditto.
5905         * modules/gnu.c: Ditto.
5906         * modules/import.c: Ditto.
5907         * modules/load.c: Ditto.
5908         * modules/m4.c: Ditto.
5909         * modules/m4.h: Ditto.
5910         * modules/modtest.c: Ditto.
5911         * modules/mpeval.c: Ditto.
5912         * modules/perl.c: Ditto.
5913         * modules/shadow.c: Ditto.
5914         * modules/stdlib.c: Ditto.
5915         * modules/time.c: Ditto.
5916         * modules/traditional.c: Ditto.
5917         * src/freeze.c: Ditto.
5918         * src/getopt.c: Ditto.
5919         * src/getopt1.c: Ditto.
5920         * src/m4.h: Ditto.
5921         * src/main.c: Ditto.
5922         * src/stackovf.c: Ditto.
5924         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
5925         ac_default_headers is an autoconf internal variable.
5926         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
5927         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
5929         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
5930         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
5931         delta.
5933 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
5935         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
5936         C99 bool.
5937         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
5938         possible or faking one with a typedef.  Changed all callers.
5940 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
5942         Still cleaning up the users' module API, by taking out the stuff
5943         that isn't used by any existing modules, and moving specialised
5944         functions out of libm4 and into the module they are used by.
5946         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
5947         * m4/utility.c (m4_skip_space): ...to here the home of its only
5948         use, made static and renamed to `skip_space'.  Changed all
5949         callers.
5950         * m4/m4module.h (m4_expand_ranges): Removed prototype.
5951         * m4/utility.c (m4_expand_ranges): Moved definition from here...
5952         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
5953         ltdl.
5954         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
5955         casting .
5956         * modules/gnu.c (builtin_syntax): Import and use in this
5957         builtin implementation.
5958         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
5959         Not used.  Deleted.
5960         * m4/macro.c (trace_flush): Except here where the macro is now
5961         manually inlined.
5962         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
5963         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
5964         moved...
5965         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
5966         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
5968 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
5970         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
5971         compiler based AC_CHECK_HEADER that was introduced in
5972         autoconf-2.56.
5973         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
5974         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
5975         * configure.ac: Use renamed M4_AC_LIB_GMP.
5977         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
5978         macro that requires arguments! This stops the shell's bad
5979         substitution error at configure time.
5981         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
5982         variables to the testsuite shell.  Set the value of USE_GMP so
5983         that the gmp test will run!
5984         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
5986 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
5988         Libltdl already has an excellent mechanism for accessing C symbols
5989         in modules.  Lets use that!  Remove all the exporting cruft and
5990         just use lt_dlsym in conjunction with a few conventions to
5991         simplify module writers' jobs.  Also removed the table address
5992         caching code and otherwise simplified the module loader quite a
5993         bit.  To access exported symbols in other modules, first the
5994         exporting module must name the symbols <modname>_LTX_<symname>,
5995         and the importing module must define a function type called
5996         <symname>_func.  The importer then adds
5997         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
5998         that wishes to call out to the exported functions.  Care must be
5999         taken that <symname> is non-NULL in the importing module incase
6000         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6001         definition was in the importers source.  Study
6002         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
6003         m4_module_import will attempt to automatically load a module
6004         required for symbol access if it is not loaded already.
6006         * TODO: Removed the items fixed in this delta.
6007         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6008         module name.
6009         * m4/ltdl.h (lt_dlhandle_find): Declare it.
6010         * m4/module.c (m4_module_unload): Use it.
6011         * src/freeze.c (reload_frozen_state): Ditto.
6012         * m4/m4module.h (m4_export): Deleted.  Removed all references.
6013         (M4_MODULE_IMPORT): New user convenience macro for importing
6014         arbitrary symbols from other modules.
6015         * m4/module.c (m4_module_import): New function to service
6016         M4_MODULE_IMPORT macro.
6017         (module_data): Removed.  Looking up the tables on demand with
6018         lt_dlsym, rather than caching their addresses here simplifies the
6019         code substantially.
6020         (m4_get_module_builtin_table, m4_get_module_macro_table):
6021         Removed.  Changed all callers.
6022         (set_module_macro_table, set_module_builtin_table): Renamed to
6023         install_macro_table and install_builtin_table respectively, and
6024         simplified now that the cache is no more.
6025         * modules/gnu.c (builtin_symbols): Use this new mechanism to
6026         import m4_dump_symbols from the m4 module.
6027         (builtin_esyscmd): Likewise for m4_set_sysval and
6028         m4_sysval_flush.
6029         * modules/m4.c (m4_export_table): Removed.  Functions are
6030         addressed with the new mechanism which doesn't need this.
6031         (m4_set_sysval): New exported accessor function to prevent
6032         problems with variable access on inferior architectures.
6033         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6034         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6035         that we can have some type safety.
6036         * modules/modtest.c (export_test): C level exported function for
6037         testing the new import mechanism.
6038         * modules/import.c: New file for the import end of the test.
6039         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
6040         * tests/modules.at: New test cases for intermodule symbol
6041         importing.
6043 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
6045         * m4/m4module.c (m4_string): Moved from here...
6046         * m4/m4private.c (m4_string): ...to here.
6048         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
6050 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
6052         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
6053         already available to module writers through
6054         m4_{get,set}_nesting_limit_opt(), so moved from here...
6055         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
6056         (m4_create): Use it.
6058 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
6060         Aside from auditing path.c for m4module.h api obfuscation, this
6061         delta introduces the concept of private struct members in opaque
6062         data types to GNU m4: See the STYLE file for details.
6064         * TODO: Remind ourselves that a rewrite of path.c is needed.
6065         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
6066         Moved from here...
6067         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
6068         here and renamed.  These type definitions are for internal api use
6069         only.  Changed all callers.
6070         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
6071         Moved from here...
6072         * m4/path.c (search_path_env_init, search_path_add): ...to here
6073         and renamed.  These calls were never used outside this file.
6074         Changed all callers.
6075         (dirpath): Moved functionality of this static declaration...
6076         * m4/m4private.h (struct m4): ...to this new internal only
6077         search_path field.  Changed all callers.
6078         (m4__get_search_path): Added new internal api accessor.
6079         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
6080         (m4_include_init): Removed...
6081         * m4/m4.c (m4_create): ...because the new m4 field is now
6082         initialised here.
6083         (m4_delete): Recycle search_path memory.
6084         * src/main.c (main): Don't call m4_include_init now that it's
6085         gone!
6086         * doc/STYLE: Document convention for private fields in opaque
6087         ADTs.
6089 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6091         Sometimes exporting the address of a symbol from a module isn't
6092         enough for other modules to call that symbol correctly.  If
6093         custom data types are used for function parameters, they need to
6094         be known to the caller.  This change introduces the concept of
6095         $(prefix)/include/modules/$(modulename).h to declare those
6096         structures.  Also we move m4_dump_symbols from libm4 to the m4
6097         module to show this concept in action.
6099         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
6100         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
6101         exporting data structures from modules/m4.c.
6102         * modules/m4.c, modules/gnu.c: Include it.
6103         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
6104         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
6105         prototypes.
6106         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
6107         Moved from here...
6108         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
6109         ...to here, with slight renaming.
6110         (m4_export_table): Prototype and add m4_dump_symbols.
6111         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
6112         definition of m4_dump_symbols.
6113         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
6114         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
6116 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6118         Create an export table in modules/m4.c in readiness for beefing up
6119         the module loader to track module exports and imports.
6121         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
6122         * m4/debug.c (m4_debug_flush_files): Moved...
6123         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
6124         * modules/gnu.c (builtin_esysval): Use it.
6125         * m4/m4module.h (m4_export): New type for declaring module symbols
6126         for export.
6127         * modules/m4.c (m4_export_table): List symbols exported from this
6128         module for use by other modules.
6130 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6132         An experiment: There is loads of code in libm4 which should be in
6133         the m4 module, but is also used by another module. Just because
6134         some linkers won't cope with calls across dynamic runtime loaded
6135         objects I initially left the code in libm4.  It will tidy the
6136         module api immensely if this code moves to the right place, I just
6137         need to remember to invent a suitable calling mechanism at some
6138         point.  For now, only modules that are statically linked and
6139         preloaded will get this treatment, so the only platforms that will
6140         break are those that require all symbols to be resolved at link
6141         time.
6143         * TODO: Reminder that what I am doing could reduce portability
6144         unless I do something more robust later.
6145         * m4/m4module.h (m4_sysval): No longer exported from libm4.
6146         * m4/utility.c (m4_sysval): No longer declared in libm4.
6147         * modules/Makefile.am: Reformatting.
6148         * modules/m4.c (m4_sysval): Declare it at place of use.
6149         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
6151 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
6153         * m4/m4module.h: Reformatting and rearranging lines a bit.
6154         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
6155         all users.
6156         (m4_call_macro, m4_expand_input): Renamed...
6157         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
6158         callers.
6159         (m4_expansion_level, m4_process_macro): Moved...
6160         * m4/macro.c (expansion_level, process_macro): ...to here, and
6161         made static.
6163         * m4/m4module.h (program_name): Not used by modules at all, so
6164         moved...
6165         * src/main.c (program_name): ...to here.
6166         (print_program_name): Renamed...
6167         (print_program_name_CB): ...to conform to the STYLE guide.
6169 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
6171         More refactoring of the m4module.h API.  Replace #defines with an
6172         enum, and move non-public functions out of the public API.
6174         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
6175         inclusion.
6176         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
6177         * m4/debug.c (m4_debug, trace): Moved...
6178         * m4/m4private.h (struct m4): ...to fields of this struct.
6179         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
6180         for the new fields.
6181         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
6182         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
6183         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
6184         * m4/m4module.h (m4_context_field_table): Add entries for new
6185         debug_file and trace_messages fields.
6186         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
6187         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
6188         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
6189         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
6190         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
6191         (m4_is_debug_bit): New macro to simplfy checks against the debug
6192         bits above.
6193         (m4_trace_format, m4_trace_header, m4_trace_flush)
6194         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
6195         prototypes.
6196         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
6197         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
6198         * m4/macro.c (trace_format, trace_header, trace_flush)
6199         (trace_prepre, trace_pre, trace_post): ...to these newly static
6200         functions, since they are only ever used from this file.  Changed
6201         all callers.
6203 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
6205         Change the macros for checking syntax so that matching against
6206         multiple possible syntax classes can be done with a single
6207         comparison some of the time.  The various classes are now bits of
6208         an int that can be checked with bitwise logic operators.
6210         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
6211         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
6212         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
6213         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
6214         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
6215         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
6216         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
6217         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
6218         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
6219         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
6220         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
6221         Replace all calls with invocations of these...
6222         (m4_is_syntax, m4_has_syntax): ...New macros.
6223         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
6224         is no longer required with new macros.  Changed all callers.
6226 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
6228         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
6229         values are returned as part of the internal interface, so they
6230         need to be moved...
6231         * m4/private.h: ...to here.
6232         * m4/macro.c (expand_token): Check for out of range
6233         m4_peek_input() results before looking up in the syntax table.
6234         (collect_arguments): Ditto.
6236         * NEWS: Note `$' syntax class.
6238 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
6239             Gary V. Vaughan  <gary@gnu.org>
6241         Conform to POSIX if the POSIXLY_CORRECT environment is set.
6242         --traditional `define' now smashes all the definitions.
6244         * NEWS: Explain this.
6245         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
6246         (Extensions): Explain that extensions that are incompatible with
6247         POSIX are disabled if POSIXLY_CORRECT is set.
6248         (Incompatibilities): Remove.
6249         (Define, Other Incompat): Explain difference
6250         between GNU and POSIX behavior of define, pushdef, popdef.
6251         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
6252         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
6253         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
6254         (m4_get_posixly_correct_opt): New macro.
6255         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
6256         POSIXLY_CORRECT.
6257         * modules/m4.c (builtin_functions): defn now takes any number of args.
6258         (builtin_define): Smash all the definitions if
6259         POSIXLY_CORRECT.
6260         (builtin_defn)): Allow any number of arguments.
6261         (builtin_undivert): Do not allow nonnumeric arguments
6262         if POSIXLY_CORRECT.
6263         * src/main.c (main): Set posixly-correct behavior if either
6264         POSIXLY_CORRECT is set, or if -G is given.
6265         * tests/builtins.at: New test for smashed definitions.
6267 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
6269         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
6270         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
6271         not to slow the parser down.
6272         (M4__IS_STRING): New macro to test string syntax class membership.
6273         * m4/syntax.c: Adjust docucomment.
6274         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
6275         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
6276         * m4/input.c (init_builtin_token): Comment typo.
6277         (m4__next_token): Comment typo.
6278         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
6279         by using the new M4__IS_STRING macro.
6280         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
6281         variable references in macro expansions.
6283         * doc/m4.texinfo (Eregexp and Regexp): Typo.
6284         (Epatsubst and Patsubst): Typo.
6285         (Eval): Typo.
6287 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
6289         Move the global variables that pertain to syntax to a new `struct
6290         m4_syntax_table', and then add one of these to `struct m4'.  The
6291         ripple effect through the code to both change formerly global
6292         references, and make sure a suitable context is available in
6293         lexical scope is disproportionately large compared to the size of
6294         the change proper.  This change is a large part of decoupling
6295         syntax.c from the rest of the code that uses it.
6297         * m4/m4private.h (struct m4): Add a syntax field.
6298         * m4/m4.c (m4_create): Initialise it,
6299         (m4_delete): Recycle it.
6300         (m4_get_symtab): Remove hand coded version...
6301         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
6302         callers.
6303         * m4/m4module.h (m4_context_field_table): Add an extra field so we
6304         can generate m4_get_symbol_table.  Add a new row for
6305         m4_get_syntax_table.
6306         (M4SYNTAX): Syntactic sugar for module writers.
6307         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
6308         (m4_syntax_table): New home for syntax related formerly global
6309         variables.
6310         * m4/m4private.h (struct m4_syntax_table): Define it.
6311         * m4/input.c (m4_input_init): Initialisation of these formerly
6312         global variables moved...
6313         * m4/syntax.c (m4_syntax_create): ...to here.
6314         * m4/input.c (m4_input_exit): And similarly, recycling of the
6315         memory used by those values moved...
6316         * m4/syntax.c (m4_syntax_delete): ...to here.
6317         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
6318         Moved to m4/m4private.h.
6319         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6320         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6321         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6322         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
6323         objects.  Changed all callers that used to directly access the
6324         global equivalents.
6325         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
6326         Removed and incorporated into m4_syntax_table structure.
6327         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
6328         * m4/syntax.c (m4_set_syntax): Now returns an error status,
6329         instead of requiring a `struct m4' to generate its own errors.
6330         Changed all callers.
6331         * src/main.c (main): Now that the syntax table is initialised as
6332         part of m4_create, we have to manually wipe the syntax entries if
6333         we are about to read a frozen file.
6335 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
6337         * doc/STYLE: Added notes on callback naming schemes.
6339         * m4/module.c (m4_set_module_macro_table)
6340         (m4_set_module_builtin_table): Declarations weren't changed when
6341         definitions were renamed on 2003-06-19.
6343         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
6344         neither used nor particularly appropriate since it exposes the
6345         internal workings of the hash module.  I haven't yet decided
6346         whether to remove it entirely.
6348 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
6350         Two related changes, and a huge knockon effect throughout the
6351         source: Moved the option variables out of global space and into
6352         `struct m4'; made `m4_symtab' a real datatype, so that its api
6353         is not marred passing `struct m4' around just so it can decide
6354         whether to keep traced symbol names or not.  Added setters and
6355         getters for the formerly global option variables, and obviously
6356         changed a vast number of functions to take a `struct m4' and use
6357         the getter funcs to find option values.
6359         * m4/utility.c (interactive, sync_output, debug_level)
6360         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
6361         (max_debug_argument_length, warning_status, nesting_limit)
6362         (discard_comments): Removed.
6363         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
6364         (debug_level, max_debug_argument_length, prefix_all_builtins)
6365         (suppress_warnings, discard_comments, interactive, sync_output):
6366         Removed from here...
6367         * m4/m4private.h (struct m4): ...and equivalent fields added to
6368         this structure.
6369         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6370         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6371         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6372         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6373         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
6374         macros for the new fields.
6375         * m4/m4module.h (m4_context_field_table)
6376         (m4_context_opt_bit_table): Helper macros used to generate
6377         prototypes, setters and getters for new option fields
6378         consistently.
6379         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6380         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6381         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6382         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6383         (m4_get_interactive_opt, m4_get_sync_output_opt)
6384         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6385         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6386         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
6387         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
6388         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
6389         setter and getter functions generated by cpp from
6390         m4_context_field_table and m4_context_opt_bit_table, exported as
6391         part of the module api.  Changed all callers.
6392         * m4/symtab (struct m4_symtab): Used as the concrete type for
6393         m4_symtab now.
6394         (m4_symtab_create): Allocate and initialise a new struct.
6395         (m4_symtab_apply): New function that works like m4_hash_apply, but
6396         with different callbacks specific to symbol tables.  Changed all
6397         callers.
6398         (symbol_destroy, arg_destroy, arg_copy): Renamed
6399         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
6400         they have unused parameters for a reason!
6401         (dump_symbol_CB): New callback to dump the contents of a single
6402         symbol.
6403         (symtob_dump): Rewritten in terms of dump_symbol_CB.
6404         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
6405         Changed all callers.
6406         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
6407         of the contained `m4_symtab' at the `no_gnu_extensions' field.
6408         Although I'm not convinced these semantics are correct, they are
6409         at least consistent with how things were before this delta.  Also
6410         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
6412 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
6414         Tie down the interface to libm4 some more.  Make more structures
6415         opaque to modules by moving them to m4private.h, and writing
6416         setters and getters.  To win back the speed penalty for doing this
6417         also wrote macroized versions that do know about structure layout
6418         in m4private.h and #include that file into modules when NDEBUG is
6419         defined at compile time.  There are still some accessor macros in
6420         m4private.h that need to go, but that is not necessary to clean
6421         the module api up.
6423         * m4/m4module.h (m4_symbol_type): Moved...
6424         * m4/m4private.h (m4__symbol_type): ...to here.
6425         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
6426         (m4_set_symbol_traced, m4_set_symbol_name_traced)
6427         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6428         (m4_get_symbol_func, m4_symbol_value_create)
6429         (m4_symbol_value_delete, m4_set_symbol_value_text)
6430         (m4_set_symbol_value_func): New exported api to symbols.
6431         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
6432         and m4_is_symbol_value_func.
6433         * m4/m4module.h: Prototype these guys.
6434         * m4/module.c (m4_set_module_macro_table)
6435         (m4_set_module_builtin_table): Make these static, there is no
6436         reason to pollute the api with them.
6437         * m4/m4private.h: Reformatting.
6438         (m4_get_symtab): Only define when NDEBUG is defined.
6439         (m4_get_symbol_value, m4_get_symbol_traced)
6440         (m4_set_symbol_traced, m4_set_symbol_name_traced)
6441         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6442         (m4_get_symbol_func, m4_symbol_value_create)
6443         (m4_symbol_value_delete, m4_set_symbol_value_text)
6444         (m4_set_symbol_value_func): Macro implementations of the new
6445         functions when NDEBUG is defined.
6446         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
6447         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
6448         Superceded by the above.  All callers changed.
6449         (M4ARG): Removed.  This is no longer different to the
6450         m4/m4module.h definition.
6451         * modules/gnu.c, modules/m4.c: Only include m4private.h when
6452         NDEBUG is defined.  That way we exercise the same (albeit slower)
6453         api that external modules must use.
6455 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
6457         Renamed some of the types and their accessors to make more sense.
6458         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
6459         has a stack of SYMBOL_VALUEs.
6461         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
6462         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
6463         m4_get_symbol_value_type,  m4_get_symbol_value_text,
6464         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
6465         Changed all callers.
6466         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
6467         (m4_get_token_type): Renamed
6468         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
6469         to the internal api.
6470         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
6471         s/TOKEN_/VALUE_/
6472         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
6473         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
6474         (m4__token_type): Moved here from m4module.h.
6475         (m4__next_token): Renamed from m4_next_token.
6476         * m4/symtab.c: Removed some of the parameterised macro support
6477         functions for modularisation later.
6478         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
6479         m4_hash_dup to perform a true deep copy of the SRC.
6480         (arg_copy): Callback for m4_symbol_value_copy.
6481         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
6482         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
6483         m4_get_symbol_value_func.  Changed all callers.
6485 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
6487         Tidy up style of hash.[ch] in accordance with doc/STYLE.
6489         * m4/hash.c: Internal symbol renaming and formatting.
6490         (m4_hash_dup): New function to facilitate deep copies of hash
6491         tables.
6492         (m4_hash_apply_func): Returns a void* now, which is a richer type
6493         for returning exceptions (NULL means keep going).
6494         (m4_hash_apply): Ditto.
6495         * m4/hash.h: Declare exported symbols with an explicit extern.
6496         Reformated.
6498 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
6500         Still refactoring furiously.  This delta represents a change in
6501         semantics to symtab.c.  Instead of building temporary m4_tokens
6502         in the caller, and copying fields in the methods, we now create
6503         the actual m4_token for hashing in the caller so the methods just
6504         slot them in directly.  Also, this means that we don't lookup a
6505         symbol and get back an allocated but VOID token to copy fields
6506         into, we create the token we want to push and pass that to
6507         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
6508         a few other small changes to stop knowledge of the implementation
6509         of symtab.c leaking out into other files.
6511         * m4/macro.c (expand_argument): Comment typo corrected.
6512         * m4/symtab.c (symtab_fetch): New function to fetch the address of
6513         an interned symbol.
6514         (m4_symbol_pushdef): Take an extra value parameter and use this
6515         directly as the new top of the value stack.  All callers changed
6516         to build a token and pass responsibility for memory in, rather
6517         than copying as we used to.
6518         (m4_symbol_define): Also use the new value parameter directly as a
6519         replacement for the top of the value stack.  All callers changed
6520         to build a token as above.
6521         (m4_set_symbol_traced): New function to set the traced bit on the
6522         named symbol, creating it if necessary.
6523         (symbol_popval): The guts of the old m4_symbol_popdef.
6524         (m4_symbol_popdef): Use it.
6525         * m4/builtin.c (m4_symbol_set_token): Removed,
6526         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
6527         replaced...
6528         * m4/module.c (m4_set_module_builtin_table)
6529         (m4_set_module_macro_table): ...with these more orthogonal
6530         functions.
6531         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
6532         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
6533         required.
6534         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
6535         (m4_arg_signature_parse): Moved...
6536         * m4/symtab.c: ...to here.
6537         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
6538         screw something up. Moved...
6539         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
6540         actually does a proper deep copy of source to dest.
6542 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
6544         Further refactoring to stabilise the module API.  Renaming some
6545         functions for orthogonality, and judicious definition migration to
6546         move things out of the set of exported symbols.
6548         * doc/STYLE: New file.  Notes on coding style.
6549         * m4/m4module.c: Updated bitrotted docucomment at the top of the
6550         file.
6551         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
6552         m4_get_module_name, m4_get_module_builtin_table,
6553         m4_get_module_macro_table which are verb phrases.  Changed all
6554         callers.
6555         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
6556         Moved to...
6557         * m4/module.c (m4_set_module_builtin_table)
6558         (m4_set_module_macro_table): ...here, and renamed. Changed all
6559         callers.
6560         * m4/m4module.c (m4_module_data): This...
6561         * m4/m4private.c (struct m4_module_data): ...and this...
6562         * m4/module.c (module_data) ...consolidated here and no longer
6563         exported.  Changed all callers.
6565 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
6567         Begin work on lifting the curse of the global variables.  To start
6568         with create a `struct m4' context container, and replace
6569         `m4__symtab' with `context->symtab' throughout.  This means
6570         initialising a context container in main, and adjusting many
6571         functions between main and the module entry points so that the
6572         container gets passed through.  It would have been nice to
6573         defer this until after 1.5, but it has a major effect on the
6574         user's module writing ABI, so it needs to be addressed now - at
6575         least in the areas that impact the ABI.  An interrelated change
6576         in the symtab API removes the dependency on a global symbol table,
6577         and instead focuses on a passed table (from the context
6578         container).
6580         * TODO: Reminders for finishing context functionality.
6581         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
6582         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
6583         global variables and eventually allow m4 to be reentrant.
6584         * m4/m4private.h (m4): Define the new structure here...
6585         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
6586         don't carry the overhead of a function call.
6587         * m4/m4module.h: Prototype extern functions from m4/m4.c.
6588         (m4): Declare type for new struct m4 objects.
6589         (M4SYMTAB): User macro to ease finding the symbol table for the
6590         current context for module developers.
6591         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
6592         verb.
6593         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
6594         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
6595         (m4_call_macro, m4_dump_symbols, m4_expand_input)
6596         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
6597         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
6598         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
6599         m4* context parameter. Changed definitions and all callers.
6600         (m4_symtab): Alias for m4_hash to decouple the
6601         m4_symtab api from m4_hash.
6602         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
6603         m4_hash.
6604         (m4_symtab_create): New function to return an initialised
6605         m4_symtab.
6606         (m4_symtab_delete): New function to delete an m4_symtab's memory.
6607         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
6608         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
6609         instead of simply using the global m4__symtab.  Changed
6610         definitions and all callers.
6611         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
6612         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
6613         * src/main.c (main): Create a context and use that instead of the
6614         former global m4__symtab.
6616 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
6618         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
6619         to the callback.  Callbacks should not need to hardcode the
6620         hashtable they are working from, nor should we have to waste the
6621         userdata parameter to pass the table in.
6622         * m4/hash.h (m4_hash_apply_func): Require the initial table
6623         parameter.
6624         * m4/symtab.c (symtab_destroy): Use the passed table instead
6625         of hardcoding m4__symtab.
6626         (m4_symbol_popdef): Don't use the userdata parameter to pass the
6627         table to arg_destroy.
6628         (arg_destroy): Use the hash parameter, ignore userdata.
6629         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
6630         prototype.
6631         (traceon, traceoff): Call set_trace with the extra initial
6632         parameter.
6634 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
6636         More refactoring to stabilise the module api, this time for
6637         symtab.c.  Additionally, start to pay attention to function names
6638         that don't contain a verb like they should.
6640         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
6641         wrapper for m4_hash_apply to decouple the symtab module from the
6642         hash module.
6643         (m4_symbol_builtin, m4_symbol_macro): Renamed to
6644         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
6645         callers.
6646         (m4_symbol_delete): Create a macro version to save a function
6647         call.
6648         (m4_token_t, m4_data_t): These violate the POSIX reserved
6649         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
6650         all callers.
6651         (m4_token_type): Renamed to m4_token_get_type.
6652         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
6653         (m4_symtab_exit): Removed from the exported module
6654         api...
6655         * m4/m4private.h (m4__symtab, m4__symtab_init)
6656         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
6657         renamed and added to the internal api. Changed all callers.
6658         (m4_symtab_apply): A faster macro version of the function for
6659         users of the internal api.
6660         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
6661         symbol_destroy and arg_destroy.
6662         (symtab_debug): Added a prototype.
6663         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
6664         so that callers in this file get the faster macro versions from
6665         m4/m4private.h.
6667 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
6669         Refactoring modules to rationalise the API into an external
6670         documented (eventually!) API for use by modules in the `m4_'
6671         namespace declared in m4/m4module.h, an internal API between the
6672         source files we ship (including our shipped modules) in the `m4__'
6673         namespace declared in m4/m4private.h and making the rest as
6674         cohesive as possible with liberal use of the `static' keyword.
6675         This change represents an audit to m4/module.c along these
6676         guidelines.
6678         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
6679         Removed.  No longer used.
6680         (m4_module_close): Removed prototypes.
6681         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
6682         from the exported module api...
6683         * m4/m4private.h (m4__module_init, m4__module_open)
6684         (m4__module_exit): ...and renamed and added to the internal api.
6685         Changed all callers.
6686         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
6687         Centralised definitions after renaming...
6688         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
6689         (M4_FINISH_SYMBOL): ...and removing from here.
6690         (m4_module_dlerror, m4_module_remove, m4_module_close)
6691         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
6692         module_remove, module_close and caller_id.
6693         (MODULE_SELF_NAME): New macro to make reporting self errors
6694         easier.
6695         (m4_module_load, module_close, module_remove): Use it.
6696         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
6697         name.
6698         * src/main.c (main): Use it.
6700 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
6702         * README: Remove references to --enable-changeword, which has been
6703         removed from the code.
6705 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
6707         Getting rid of the annoying bug with configure --enable-debug,
6708         which spewed -e: command not found errors.  This was an interaction
6709         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
6710         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
6711         branch-1-5) to get the full fix.
6713         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
6714         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
6715         and then use the probed value of $SED.
6716         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
6717         this, it messes up the AC_REQUIRE stack.
6719 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
6721         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
6722         the destroy callback.
6723         (m4_arg_destroy): Use the hash address to free the hash node key
6724         field.
6726 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
6728         First cut at formal parameters in macros.
6730         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
6731         * m4/xstrzdup.c: New file.
6732         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
6733         associative array of parameter names to details.
6734         (m4_symbol_token): Capture macro names with parameter lists.
6735         (m4_arg_signature_parse): And build an associative array to hang
6736         from the symbol structure to map names to details.
6737         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
6738         m4_hash_resize idiom.  Now that we potentially add a little hash
6739         table to many of the entries in the symbol table, added an extra
6740         arg to set the initial size.  Changed all callers.
6741         (m4_hash_apply): New function that is basically a generalised
6742         version of...
6743         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
6744         all callers to call m4_hash_apply instead.
6745         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
6746         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
6747         m4_arg_signature association that might be attached to the symbol,
6748         * m4/hash.h (m4_hash_apply_func): Replacement type for...
6749         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
6750         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
6751         parameter lists.
6752         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
6753         (M4_IS_IDENT): Detect characters that can be safely used in
6754         parameter names.
6755         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
6756         * m4/macro.c: Corrected grammar in some comments.  Use `token'
6757         rather than `td' for m4_token variables.
6758         (m4_process_macro): If we find a dollar followed by some
6759         M4_IS_IDENT characters, replace that with the contents of the argv
6760         entry with offset stored in the m4_token_arg associated with the
6761         collected identifier.
6763 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
6765         Begin preparations for supporting formal parameters in m4 macros.
6767         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
6768         the details of a formal parameter.
6769         (m4_token): Add an arg_signature member to hold a hash table for
6770         looking up formal parameters.
6771         * m4/input.c: Update more bitrotted comments.
6772         (m4_push_builtin): Initialise arg_signature member.
6773         (init_builtin_token): Copy arg_signature member.
6774         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
6775         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
6776         replace...
6777         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
6778         (m4_macro_pushdef, m4_macro_define): ...these, And...
6779         (m4_symbol_token): ...wrapped around this new function, which
6780         vastly simplifies the arguments required by the functions it
6781         replaces.
6782         Changed all callers.
6784 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
6786         * m4/macro.c: Format changes.
6788 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
6790         * m4/input.c: Updated various bitrotted comments.
6791         (m4_push_builtin): Just pass the whole m4_token, rather than
6792         extracting all the fields in the caller.  This also allows us to
6793         check the token type for consistency.
6794         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
6795         Renamed to builtin_funcs, builtin_peek, builtin_read,
6796         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
6797         the code.  Changed all callers.
6798         (struct input_block): Similarly renamed u_m member to u_b, and
6799         changed all callers.
6800         (m4_next_token): Use bzero to initialise the data fields.
6801         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
6803 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
6805         These changes were necessary to get m4 to build on my iBook
6806         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
6807         (GCC) 3.1 20020420 (prerelease)":
6809         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
6810         inclusion of module loader headers.
6811         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
6812         * m4/Makefile.am: Ditto.
6813         (libm4_la_LIBADD): Added $(LTLIBINTL).
6814         * m4/utility.c (program_name): Removed declaration in favour of
6815         the one already in error.c!
6816         * m4/m4module.h (program_name): Define to program_invocation_name
6817         when using GNU C library. Use an explicit extern declaration.
6818         (interactive, sync_output, debug_level, hash_table_size)
6819         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
6820         (suppress_warnings, warning_status, nesting_limit, discard_comments)
6821         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
6822         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
6823         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
6824         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
6825         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
6826         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
6827         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
6828         (m4_current_line, m4_current_diversion, m4_output_current_line):
6829         Don't rely on default, use an explicit extern.
6830         * m4/error.h (error, error_at_line, error_print_progname)
6831         (error_message_count, error_one_per_line): Ditto.
6832         * m4/ltdl.c: Update from CVS libtool.
6833         * m4/ltdl.h: Ditto.
6834         * commit: Update from CVS cvs-utils.
6836 2002-11-04  gettextize  <bug-gnu-gettext@gnu.org>
6838         * po/Makefile.in.in: Upgrade to gettext-0.11.5.
6839         * po/boldquot.sed: New file, from gettext-0.11.5.
6840         * po/en@boldquot.header: New file, from gettext-0.11.5.
6841         * po/en@quot.header: New file, from gettext-0.11.5.
6842         * po/insert-header.sin: New file, from gettext-0.11.5.
6843         * po/quot.sed: New file, from gettext-0.11.5.
6844         * po/remove-potcdate.sin: New file, from gettext-0.11.5.
6845         * po/Rules-quot: New file, from gettext-0.11.5.
6847 2002-11-04  Akim Demaille  <akim@epita.fr>
6849         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
6850         running m4 itself.
6851         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
6853 2002-11-04  Akim Demaille  <akim@epita.fr>
6855         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
6857 2002-11-04  Akim Demaille  <akim@epita.fr>
6859         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
6860         used as `external', and Libtool 1.4.3.
6861         (LINGUAS): Remove.
6862         (LTLIBOBJS): Don't play with it.
6863         * intl/: Remove.
6864         * Makefile.am (SUBDIRS): Remove intl.
6865         (ACLOCAL_AMFLAGS): Add -I config.
6866         (EXTRA_DIST): Add config/config.rpath.
6867         * po/LINGUAS: New.
6868         * po/Makevars: New.
6869         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
6871 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
6873         Preparations for refactoring syntax tables to allow reverse
6874         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
6875         speed of normal lookups in an array of unsigned short.
6877         * m4/input.c (single_quotes, single_comments, use_macro_escape):
6878         Moved from here...
6879         * m4/m4private.h (m4__single_quotes, m4__single_comments,
6880         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
6881         is for internal symbols which unavoidably pollute the global
6882         namespace, but are not published APIs.
6883         Adjusted all callers.
6884         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
6885         m4_set_comment, m4_set_syntax, set_syntax_internal,
6886         unset_syntax_attribute): Moved from this file...
6887         * m4/syntax.c: New. ...to this file.
6888         Also added an m4_syntax_exit stub for orthogonality.
6889         * src/main.c (main): Use it.
6890         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
6891         * m4/m4module.h: Reformatting.  New prototypes.
6893 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
6895         * bootstrap (aclocal_apiversion): The aclocal apiversion is
6896         distinct from the automake release number (in that the apiversion
6897         apparently has no micro-version-component).
6898         (aclocal_apilibdir): Use it.
6900 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
6902         * m4/hash.c (m4_hash_resize): New function.
6903         * m4/hash.h: Add prototype.
6904         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
6905         benchmarking to find a good value for, say, autoconf.  This is
6906         already a little quicker than before for me.
6908         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
6909         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
6910         and reenamed.
6911         * m4/hash.h: Adjust prototypes.
6913 2002-01-22  Akim Demaille  <akim@epita.fr>
6915         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
6916         APIVERSION scheme.
6917         * tests/Makefile.am (package.m4): New.
6918         * tests/atlocal.in: Adjust to CVS Autotest.
6919         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
6920         * configure.ac: LIBOBJ is a forbidden string.
6921         Simplify AM_INIT_AUTOMAKE invocation.
6922         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
6923         options.m4.
6925 2002-01-21  gettextize  <bug-gnu-utils@gnu.org>
6927         * po/Makefile.in.in: Upgrade to gettext-0.10.40.
6929 2001-10-19  Akim Demaille  <akim@epita.fr>
6931         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
6933 2001-10-19  Akim Demaille  <akim@epita.fr>
6935         * m4/input.c (m4_next_token): Display where was opened what is
6936         not closed.
6938 2001-10-19  Akim Demaille  <akim@epita.fr>
6940         * m4/macro.c (expand_argument): Display where was opened what is
6941         not closed.
6943 2001-10-18  Akim Demaille  <akim@epita.fr>
6945         * m4/input.c, modules/m4.c: Formatting changes.
6947 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
6949         * bootstrap: s/configure.in/configure.ac/
6951 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
6953         * m4/symtab.c (m4_symbol_destroy): This function calls
6954         m4_symbol_popdef, which recycles a symbols memory when the last
6955         definition is popped.  Since we were passing the address of the
6956         symbol name found in the symbol table, and it was being removed
6957         partway through m4_symbol_destroy() we were referencing freed
6958         memory for the balance of the function.  Now we take a copy of the
6959         symbol name tring and use that as a key into the symbol
6960         table... that way if the original symbol name is freed, the copy
6961         is still valid.
6963 2001-10-13  Akim Demaille  <akim@epita.fr>
6965         * m4/ltdl.c: Update.
6967 2001-10-13  Akim Demaille  <akim@epita.fr>
6969         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
6970         Don't gettextize internal error messages.
6972 2001-10-13  Akim Demaille  <akim@epita.fr>
6974         * tests/macros.at (Arity and defn): New failing test.
6975         (Arity, defn, and freeze): New.
6977         Fix `Arity and defn'.
6979         * m4/input.c (m4_push_macro): Don't forget the arity.
6980         * modules/m4.c (defn): Likewise.
6982 2001-10-13  Akim Demaille  <akim@epita.fr>
6984         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
6985         to...
6986         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
6987         (Propagation of traceon, Propagation of --trace): this new file.
6989 2001-10-13  Akim Demaille  <akim@epita.fr>
6991         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
6992         interface instead of (name, argc...).
6993         Upon failure, specify which argument was guilty.
6994         Adjust callers.
6996 2001-10-13  Akim Demaille  <akim@epita.fr>
6998         * modules/evalparse.c: Save translators' time: don't translate
6999         internal error messages.
7000         (m4_evaluate): Simplify/normalize error messages.
7001         * doc/m4.texinfo (Eval): Adjust.
7003 2001-10-13  Akim Demaille  <akim@epita.fr>
7005         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7006         where no checking is needed.
7007         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7008         interface instead of (name, argc...).
7009         Adjust callers.
7010         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7011         elsewhere.
7013 2001-10-13  Akim Demaille  <akim@epita.fr>
7015         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7016         exclude the builtin name from the count.
7017         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7018         calling ifelse with a single argument is valid.
7019         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7020         with 1 and 2 args, mostly to strengthen the test suite.
7022 2001-10-13  Akim Demaille  <akim@epita.fr>
7024         * m4/output.c (m4_make_diversion, m4_insert_file)
7025         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7027 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
7029         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
7030         since we call these things builtins in the rest of the code!
7032         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7034 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
7036         Rather than forcing each builtin definition to manage its own
7037         argument range checking, tabulate the maxima and minima for all
7038         builtins in each module.  This forces us to consider what the
7039         valid ranges for each builtin should be, and moves the checking
7040         code out of each builtin implementation and into the builtin
7041         caller infrastructure.
7043         * m4/m4module.h (struct m4_builtin): Add argument minima and
7044         maxima.
7045         * m4/m4private.h (struct m4_token): Reflect them here too.
7046         * m4/input.c (struct input_block): ...and here.
7047         (m4_token_copy): New function for token copying.
7048         (init_macro_token): Copy them from a token to the input stack.
7049         (m4_next_token): Don't forget to initialise them for text
7050         macros.
7051         * m4/macro.c (expand_argument): Use m4_token_copy, and also
7052         check argument counts before calling the builtin handler.
7053         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
7054         (m4_symbol_macro): Likewise.
7055         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
7056         parameters.  Updated all callers.
7057         (m4_builtin_define): Ditto.
7058         (m4_macro_pushdef, m4_macro_define): Ditto.
7059         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
7060         * modules/evalparse.c:  Declare argument counts for defined
7061         builtins and remove explicit calls to m4_bad_argc().
7062         * modules/gnu.c: Ditto.
7063         * modules/load.c: Ditto.
7064         * modules/m4.c: Ditto.
7065         * modules/modtest.c: Ditto.
7066         * modules/mpeval.c: Ditto.
7067         * modules/perl.c: Ditto.
7068         * modules/shadow.c: Ditto.
7069         * modules/stdlib.c: Ditto.
7070         * modules/time.c: Ditto.
7071         * TODO: Updated.
7073 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
7075         The trace semantics now attach the trace bit to a symbol name.
7076         For as long as a traceon(`foo') is active, calls to foo will be
7077         traced regardless of intervening undefines or module unloads.
7078         Fixed the flag propogation issues differently to the fixes
7079         reverted with the last attempt at nailing down trace:
7081         * m4/m4private.h:  This file is not visible outside of the m4
7082         source tree, so I removed all the `M4_' and `m4_' prefixes to save
7083         on typing.  Updated all clients.
7084         (m4_token): New typedef contains the fields that need to be passed
7085         around with the low level tokeniser.
7086         (m4_token_data):  Removed.
7087         (m4_symbol): Now contains the traced flag again.
7088         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
7089         the trace bit set.  This change is contained entirely within this
7090         module and doesn't leak out into the callers.  Updated all
7091         clients.
7092         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
7093         new fields in m4_token.  Updated all clients.
7094         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
7095         that `groks_macro_args' and `blind_if_no_args' flags are retained
7096         when defn() results are passed around in m4 code.  Updated all
7097         callers.
7098         (m4_builtin_define): Ditto.
7099         (m4_macro_pushdef, m4_macro_define): Ditto.
7100         * m4/input.c (struct input_block): Add a flags field to facilitate
7101         the above.
7102         (m4_push_macro):  ...use it.
7103         (init_macro_token):  Retrieve it.
7104         (m4_next_token): Initialise it.
7105         * m4/macro.c (expand_argument):  Copy it.
7106         * m4/m4module.h: Adjust.
7107         * tests/builtins.at:  Adjust the expected output of the trace
7108         tests to reflect the change in semantics.
7109         * tests/modules.at (modules: trace):  Check that unloading a
7110         module which supplies a traced symbol definition doesn't lose te
7111         trace bit.
7113 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
7115         * modules/gnu.c (m4_macro_table): Display the timetamp when
7116         expanding __m4_version__.
7118         * configure.ac (--with-modules): Forgot a comma in the
7119         AC_HELP_STRING parameter list.
7121 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
7123         * bootstrap: Remove aclocal.m4t when it is no longer required.
7125 2001-10-05  Akim Demaille  <akim@epita.fr>
7127         * tests/Makefile.am: Adjust for gnuprog2.
7128         * tests/m4.in: There can be a leading path.
7129         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
7130         * tests/testsuite.at: Adjust to the most recent Autotest.
7131         (AT_CHECK_M4_FILTER): Fix and rename as...
7132         (AT_TEST_M4): this.
7133         * tests/others.at: Use it.
7135         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
7136         variable in shell scripts, one uses `$'...
7138 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
7140         * configure.ac: `rm -f $m4_getopt_h' was lost.
7142 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
7144         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
7145         time.  Define it for config.h in order to...
7146         * src/main.c (main): ...display the timestamp for --version.
7148 2001-10-04  Akim Demaille  <akim@epita.fr>
7150         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
7151         previous builtins `regexp' and `patsubst'.
7152         (regexp, patsubst): Use them.
7153         (eregexp, epatsubst): New builtins.
7154         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
7155         (Epatsubst and Patsubst, Eregexp and Regexp): these.
7156         (Extensions): More info on REs.
7158 2001-10-04  Akim Demaille  <akim@epita.fr>
7160         * modules/modtest.c (init_handler): Consistently output to stderr.
7161         (finish_handler): New.
7162         (test): The `if' is an `assert'.
7163         * tests/modules.at: Adjust.
7165 2001-10-04  Akim Demaille  <akim@epita.fr>
7167         * m4/utility.c (m4_bad_argc): Detail the mismatches.
7169 2001-10-01  Akim Demaille  <akim@epita.fr>
7171         * tests/generate.awk: Tag the tests with `documentation'.
7172         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
7173         Use the make the existing modtest tests more uniform, and complete
7174         the set of possibilities.
7176 2001-10-01  Akim Demaille  <akim@epita.fr>
7178         * config/gmp.m4: Consult the user before using GMP: use
7179         --without-gmp.
7180         * configure.ac: Adjust.
7181         * modules/gmp.c: No protection needed as the module is not built
7182         if GMP is not used.
7184 2001-10-01  Akim Demaille  <akim@epita.fr>
7186         * tests/generate.awk: Remove debugging code.
7187         (fatal): Specify the current location.
7189         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
7190         * modules/gnu.c, modules/m4.c: Use M4ARG.
7192 2001-10-01  Akim Demaille  <akim@epita.fr>
7194         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
7195         (m4_regexp_compile): New.
7196         (regexp, patsubst): Use it.
7198 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7200         Reinstate the memory handling improvements from the patch I just
7201         reverted.  Relevant ChangeLog entries repeated here:
7203         * m4/module.c (m4_module_remove): New function that holds the core
7204         of the old m4_module_unload.
7205         (m4_module_unload): Use it.
7206         (m4_module_unload_all): When we know the modules will never be
7207         used again (i.e. on exit), free up as much module memory as
7208         possible.  There are still some artifacts from resident modules
7209         living inside ltdl.c, but everything else is freed.
7210         * m4/debug.c (m4_debug_exit): Free memory allocated in
7211         m4_debug_init().
7212         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7213         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7214         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7215         * m4/m4module.h: Updated prototypes.
7216         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7217         * m4/hash.h: Updated prototypes.
7218         * src/main.c (main): Use all these new functions to clean up as
7219         much memory as possible before exit.
7221 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7223         Reverted my large patch for removing the old m4_symbol
7224         structure on 2001-09-20.  We are still not happy about the way
7225         trace works in conjunction with defn and undefine, and leaving
7226         the reverted patch active prevents us from moving the traced
7227         bit from the definition back to the symbol.
7229 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7231         * configure.in: Moved to...
7232         * configure.ac: ...here.  Added a libtool like timestamped
7233         banner, and tidied up the libltdl cruft.
7234         * config/mkstamp: Script to extract a timestamp from ChangeLog.
7235         * modules/Makefile.am (INCLTDL):  Removed.  This is required
7236         only when libltdl is configured in a subdirectory.
7237         * src/Makefile.am: Ditto.
7238         (LIBADD_DL):  No need to add this again, libtool already knows
7239         that libm4.la depends on it.
7240         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
7241         them.
7243         * TODO: stackovf.c is basically broken.
7244         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
7246 2001-09-28  Akim Demaille  <akim@epita.fr>
7248         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
7250 2001-09-27  Akim Demaille  <akim@epita.fr>
7252         * tests/m4.in: Don't use short options.
7253         Simplify the stderr signature normalization.
7255 2001-09-27  Akim Demaille  <akim@epita.fr>
7257         tests/m4 shall be position independent.
7259         * tests/m4.in: New.
7260         * tests/m4: Remove.
7261         * tests/testsuite.at: No args to AT_INIT.
7262         * configure.in, tests/Makefile.am: Adjust.
7264 2001-09-22  Akim Demaille  <akim@epita.fr>
7266         Autotest has changed again.
7268         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
7269         (package.m4): Remove.
7270         * configure.in: Adjust to LIBADD_GMP.
7272 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
7274         * config/gmp.m4 (AC_ARG_WITH): Removed.
7275         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
7276         (AC_LIB_GMP): When performing a test compile against libgmp,
7277         include the header gmp.h if possible, and link against -lgmp.  If
7278         they both work define USE_GMP.
7279         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
7280         (mpeval_LTX_init_func): Complain on load that there was no libgmp
7281         at compile time.
7283 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
7285         * m4/evalparse.c: Moved to...
7286         * modules/evalparse.c:  ...here.  This code is shared between
7287         modules/mpeval.c and modules/m4.c, so there is no need to pollute
7288         the libm4 API with its details.  Moderately rewritten to interface
7289         into its clients more simply.
7290         * m4/eval.c: Deleted.  Migrated functionality to...
7291         * modules/m4.c: ...here.
7292         (builtin_eval):  Implemented in terms of the new interface style.
7293         * modules/mpeval.c (builtin_mpeval): Ditto.
7294         * m4/m4module.h: Removed references to the former m4/eval.c.
7295         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
7296         (EXTRA_libm4_la_SOURCES): Deleted.
7297         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
7298         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
7300 2001-09-20  Akim Demaille  <akim@epita.fr>
7302         * config/gmp.m4 (AM_WITH_GMP): Rename as...
7303         (AC_LIB_GMP): this.
7304         By default, use gmp.
7305         Massive revamping.
7306         * configure.in: Adjust.
7307         Use Automake conditionals for USE_GMP.
7308         Always compute sizeof (long long int).
7309         This was a bug BTW, as `eval' (not `mpeval') depends on it:
7310         before, it was used _only_ if mpeval was not activated.
7311         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
7312         (mpeval_la_LIBADD): New macros.
7313         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
7314         Indent.
7315         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
7316         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
7317         WITH_GMP.
7319 2001-09-20  Akim Demaille  <akim@epita.fr>
7321         * tests/Makefile.am (package.m4): New.
7322         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
7324 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
7326         More cleanup.  After the last patch, m4_symbol holds nothing but
7327         the head of a chain of m4_token_data.  So I have removed the old
7328         m4_symbol, so that m4_token_data chains are stored directly in the
7329         value cell of a hash table node.  But there's more... m4_symbol
7330         was a more natural name for the symbol value cell, and now that it
7331         is gone I have renamed the former m4_token_data structure to
7332         m4_symbol.  This change turned out to be a pig to get right, since
7333         the original code didn't need to modify the value cell itself,
7334         since changing the chain happened inside the m4_symbol that used
7335         to be returned -- I had to pass the address of the value cell
7336         across various function calls, incase the head value changed.  I
7337         also tightened up the memory management to help me find a nasty
7338         memory corruption bug that took me all night to track down...
7340         * m4/m4private.h (struct m4_symbol): Removed.
7341         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
7342         all references.
7343         * m4/hash.c (m4_hash_iterator_value): Return the address of the
7344         value cell.  Updated all callers.
7345         * m4/symtab.c: Took advantage of the simplification in the data
7346         structures to rewrite a lot of this file more simply.  There is
7347         still some room for optimisation here, but we should tackle that
7348         systematically closer to the release.
7350         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7351         revealed.  This version is ahead of CVS libtool until I get chance
7352         to flush my changes.
7353         * m4/module.c (m4_module_remove): New function that holds the core
7354         of the old m4_module_unload.
7355         (m4_module_unload): Use it.
7356         (m4_module_unload_all): When we know the modules will never be
7357         used again (i.e. on exit), free up as much module memory as
7358         possible.  There are still some artifacts from resident modules
7359         living inside ltdl.c, but everything else is freed.
7360         * m4/debug.c (m4_debug_exit): Free memory allocated in
7361         m4_debug_init().
7362         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7363         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7364         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7365         * m4/m4module.h: Updated prototypes.
7366         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7367         * m4/hash.h: Updated prototypes.
7368         * src/main.c (main): Use all these new functions to clean up as
7369         much memory as possible before exit.
7371 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
7373         The `traced' flag needs to be attached to the definition of a
7374         symbol rather than the current symbol containing the definition.
7375         Implementing this showed up some long standing post 1.4 bugs in
7376         flag propogation which I also fixed.
7378         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
7379         (struct m4_token_data): And add it back in here.
7380         * m4/input.c (init_macro_token): Propogate the traced flag
7381         correctly.
7382         * m4/macro.c (expand_argument): Ditto.
7383         * tests/builtins.at (trace2, trace3): New tests based on Akim's
7384         sadistic email ;-)
7386 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7388         * m4/m4private.h (struct m4_token_data): Simplified by removing
7389         the redundant `traced' flag, and one level of structure nesting.
7390         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
7391         * m4/input.c (init_macro_token): No need to initialise removed
7392         `traced' field.
7393         * m4/macro.c (expand_argument): No need to copy it either.
7394         * m4/utility.c (m4_token_data_func_traced): Or provide an access
7395         function.
7397         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
7398         dependant on multiple symbols with the same key, so preserving
7399         relative symbol order in each bucket during resizing is no longer
7400         required.  The resize function is considerably faster as a result.
7402         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
7403         s/m4_symbol_insert/m4_symbol_define/g;
7404         s/m4_builtin_insert/m4_builtin_define/g;
7405         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
7407 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7409         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
7410         commits, the m4_lookup_symbol dispatch function is split into
7411         specialised functions that must be called directly.
7413         * m4/m4module.h (m4_symbol_lookup_t): Removed.
7414         * m4/symtab.c (m4_lookup_symbol): Removed.
7415         (m4_symbol_builtin, m4_symbol_macro): New functions.
7416         * m4/builtin.c (m4_builtin_define): Split into...
7417         (m4_builtin_pushdef, m4_builtin_insert): ...these.
7418         (m4_macro_define): Split into...
7419         (m4_macro_pushdef, m4_macro_insert): ...these.
7420         * src/main.c (main): Set command line macros from `-D' parameters
7421         using `m4_macro_define'.
7423 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7425         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
7426         this from m4_remove_table_reference_symbols().
7427         * m4/m4module.h, m4/module.c: Updated all references.
7429 2001-09-07  Akim Demaille  <akim@epita.fr>
7431         * modules/stdlib.c, modules/times.c: Misc cleanups.
7433 2001-09-07  Akim Demaille  <akim@epita.fr>
7435         * configure.in: We now need Autoconf 2.52e.
7436         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
7437         and `M4_SYMBOL_DELETE'.
7438         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
7439         * src/main.c (main): Adjust.
7441 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
7443         Fix the obstack.h problem once and for all!  At configure time we
7444         can test for a system supplied obstack.h:  depending on the
7445         result, we now generate system.h with an #include of the correct
7446         header.  As a bonus, I've also added a --with-included-obstack,
7447         incase the user doesn't like the system obstack for some
7448         reason... and also we can test the shipped obstack on a system
7449         that has oe of its own.  We also now need to be careful to add
7450         build directories to the include search path, since the generated
7451         system.h will be in the build tree.
7453         * configure.in (AC_CONFIG_FILES): Generate system.h from
7454         system-h.in.
7455         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
7456         include the system obstack header or the copy shipped with M4.
7457         Allow the user to override configure and force the build to use
7458         the shipped version.
7459         * m4/system-h.in: New file, template for...
7460         * m4/system.h: ...this.  Now deleted.
7461         * m4/m4module.h: Include system.h before everything else.
7462         * src/freeze.c: Ditto.
7463         * m4/Makefile.am (dist-hook): Remove generated system.h.
7464         (INCLUDES): Check builddir for generated headers before checking
7465         srcdir.
7466         * modules/Makefile.am (INCLUDES): Ditto.
7467         * src/Makefile.am (INCLUDES): Ditto.
7469 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
7471         * TODO: Remove the items that have been addressed already.
7473 2001-09-05  Akim Demaille  <akim@epita.fr>
7475         * src/main.c (main): Standardize --version.
7477 2001-09-05  Akim Demaille  <akim@epita.fr>
7479         * modules/format.c (format): Have a bigger `str'.
7481 2001-09-05  Akim Demaille  <akim@epita.fr>
7483         Rationalize warnings, reporting the macro name as if it were a
7484         program name, and assertions.
7486         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
7487         (M4WARN): New.
7488         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
7489         (m4_symbol_delete):
7490         Use assert for internal errors.
7491         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
7492         M4WARN.
7493         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
7494         M4WARN and assert.
7495         * tests/builtins.at (pushpop): Adjust.
7497 2001-09-05  Akim Demaille  <akim@epita.fr>
7499         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
7500         with pointers.
7502 2001-09-05  Akim Demaille  <akim@epita.fr>
7504         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
7505         * m4/macro.c, m4/symtab.c: Adjust.
7507 2001-09-05  Akim Demaille  <akim@epita.fr>
7509         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
7510         (m4_symbol_pop, m4_symbol_del): this.
7511         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
7512         (m4_symbol_popdef, m4_symbol_delete): New.
7513         (m4_lookup_symbol): Adjust.
7514         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
7516 2001-09-05  Akim Demaille  <akim@epita.fr>
7518         * m4/m4module.h (m4_symbol_lookup): Rename as...
7519         (m4_symbol_lookup_t): this.
7521 2001-09-05  Akim Demaille  <akim@epita.fr>
7523         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
7524         unused.
7525         * m4/symtab.c (m4_lookup_symbol): Adjust.
7527 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
7529         Bootstrap will now work with Libtool 1.4.1 or higher:
7530         * bootstrap: Remove stale autom4te.cache files when
7531         rebootstrapping.
7532         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
7533         libtool.m4.
7534         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
7535         libtool.m4 directly.
7536         Run libtoolize to refresh ltmain.sh.
7537         * config/ltmain.sh:  Deleted.
7538         * acinclude.m4: Deleted.
7539         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
7541         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
7542         implementation for the cvs impaired libtool user.
7544 2001-09-03  Akim Demaille  <akim@epita.fr>
7546         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
7547         internal errors.
7548         Avoid using `default' in switch, as it hides useful compiler
7549         warnings when a case is forgotten.
7551 2001-09-03  Akim Demaille  <akim@epita.fr>
7553         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
7554         is no such thing as `WITH_MODULES'.
7556 2001-09-03  Akim Demaille  <akim@epita.fr>
7558         Improve the test suite's selfcontainedness.
7560         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
7561         (Include, Undivert): Tag the other input files.
7562         * tests/generate.awk: Catch `@comment file:'.
7563         `-I $src' is no longer needed.
7564         `next' is really like `return': the rest is skipped.
7565         Adjust to `input.m4'.
7566         (fatal): New function.
7567         * tests/foo, tests/incl.m4: Remove.
7569 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
7571         The shadowing mechanism and, infact, the whole symbol table
7572         implementation was creaking under the weight of the features piled
7573         on top of it.  We now have a separate hash table module which will
7574         dynamically resize to keep symbol density withing good performace
7575         limits, and a new symtab module layered above it.  Symbol lookups
7576         are now marginally more efficient (since the shadowed flag is no
7577         longer required) and symbol removal, such as on module unload, is
7578         considerably faster due to a reorganisation of the data structures
7579         used in symtab.c.
7581         * src/main.c (main):  Don't mention `-H'.
7582         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
7583         effect.
7584         * NEWS: Updated.
7585         * m4/hash.c: New generalised dynamic hash table data structure
7586         management module.
7587         * m4/hash.h: Public interface.
7588         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
7589         (libm4_la_SOURCES): Add hash.c.
7590         * m4/symtab.c: More or less rewritten from scratch, within the
7591         bounds of the previous API.
7592         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
7593         call.  Updated all callers.
7594         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
7595         declarations to reflect API changes.
7596         (M4INIT): Generate a declaration too, to avoid the warning with
7597         --enable-debug builds.
7598         (M4FINISH): Ditto.
7599         (HASHMAX): Removed.
7600         * m4/utility.c (hash_table_size):  Removed.
7601         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
7602         names, which are then looked up by builtin_dumpdef() as necessary.
7603         This implies a small speedup in builtin_symbols(), which discarded
7604         all of the symbol info under the old call.
7605         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
7606         shadowing is implicit in respect to the new data structures.
7607         symbol names are no longer duplicated here, they are stored in the
7608         key field of the hash table.
7609         Moved macro_args and blind_no_args...
7610         (m4_token_data): ...to here.
7611         m4/macro.c (expand_macro):  Added a name argument since the symbol
7612         name is no longer copied into each struct m4_symbol.  Modified all
7613         callers.
7614         (collect_arguments):  Ditto.
7615         * modules/m4.c (set_trace): Ditto.
7616         * modules/gnu.c (builtin_symbols): Updated.
7617         * src/freeze.c (produce_symbol_dump): Much improved in light of
7618         the improved symbol table layout.
7620 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
7622         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
7623         to M4_SYMBOL_NEXT.
7624         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
7625         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
7626         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
7627         SYMBOL_HANDLE): Ditto.
7628         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
7629         modules/gnu.c, modules/m4.c, src/freeze.c,
7630         src/main.c:  Updated all references.
7632         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
7633         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
7634         already listed in m4_LDADD... how did that ever used to work?
7635         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
7636         link.
7637         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
7638         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
7640         * tests/m4: Don't call the m4 wrapper script with libtool, it
7641         works fine all by itself.
7643 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
7645         The experimental `changeword' feature never took off, and has
7646         no obvious advantages over `changesyntax' to compensate the
7647         enormous speed penalty it carries:
7648         * configure.in (ENABLE_CHANGEWORD): Removed.
7649         * m4/m4module.h (m4_set_word_regexp): Removed.
7650         * m4/m4private.h (m4_token_data): Removed original_text field.
7651         * m4/utility.c (m4_token_data_orig_text): Removed.
7652         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
7653         * m4/macro.c: Ditto.
7654         * src/main.c: Ditto.
7655         * modules/Makefile.am (changeword.la): Removed.
7656         * modules/changeword.c: File removed.
7657         * doc/m4.texinfo: References to changeword and --word-regexp
7658         removed.
7659         * po/POTFILES.in: modules/changeword.c removed.
7660         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
7661         * tests/builtins.at (changeword): Test removed.
7663 2001-08-30  Akim Demaille  <akim@epita.fr>
7665         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
7666         This also help having a single list of m4 files: in
7667         config/Makefile.am.
7668         * config/Makefile.am (STANDARD_MACROS): Rename as...
7669         (ACLOCAL_MACROS): this.
7670         (list-standard-macros): Remove.
7671         (spy): New.
7673 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
7675         In an attempt to moderate my egomania...
7676         * tests/modules.at: Remove attributions.
7678         * tests/generate.awk: When making substitutions to "@&t@", either
7679         "&" or "\&" in the substitution string argument to gsub refer back
7680         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
7681         67 now pass for me.
7683 2001-08-29  Akim Demaille  <akim@epita.fr>
7685         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
7686         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
7687         (sync-lines, trace, translit, undivert, wrap): Move to...
7688         * tests/builtins.at: this new file.
7689         * tests/others.at (Discard comments, import-environment): Move to...
7690         * tests/options.at: this new file.
7692 2001-08-29  Akim Demaille  <akim@epita.fr>
7694         * tests/others.at (Freezing modules)
7695         (--module-directory: absolute path, modpath2, modpath3)
7696         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
7697         * tests/modules.at: here, new file.
7698         * tests/others.at, tests/generate.awk: Add a banner.
7699         * tests/testsuite.at: Adjust.
7700         (AT_CHECK_M4_FILTER): New, but unused.
7702 2001-08-29  Akim Demaille  <akim@epita.fr>
7704         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
7705         handle that.
7706         * tests/others.at (wrap): Inline wrap.m4.
7707         (shadow): Inline shadow.m4.
7708         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
7709         * tests/m4: Simplify.
7711 2001-08-29  Akim Demaille  <akim@epita.fr>
7713         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
7714         --language.
7716 2001-08-29  Akim Demaille  <akim@epita.fr>
7718         * tests/generate.awk (normalize): s/@__@/@&t@/.
7720 2001-08-28  Akim Demaille  <akim@epita.fr>
7722         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
7724 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
7726         * bootstrap (generate.awk): Generate test cases with new script.
7728 2001-08-27  Akim Demaille  <akim@epita.fr>
7730         * tests/Makefile.am (installcheck-local): Don't use
7731         `dc_install_base' which is not visible here, but `exec_prefix'
7732         which is clearly the RT anyway.
7733         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
7734         related to testing a now installed m4.
7735         * tests/m4: Do it here.
7737 2001-08-27  Akim Demaille  <akim@epita.fr>
7739         * tests/others.at (indir): Formatting change.
7741 2001-08-27  Akim Demaille  <akim@epita.fr>
7743         * tests/Makefile.am (installcheck-local): New.
7744         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
7745         the test suite.
7746         Prefer options over envvars.
7747         * src/main.c (main): First bug caught by the test suite (yeah!):
7748         --batch lacked a `break' which resulted in an accidental
7749         invocation of --discard-comments.
7751 2001-08-27  Akim Demaille  <akim@epita.fr>
7753         * tests/others.at (capitalize, changeword, comments, ddivert)
7754         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
7755         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
7756         (sysv-args, trace, translit, undivert): Don't rely on files in
7757         examples/: AT_DATA them.
7759 2001-08-27  Akim Demaille  <akim@epita.fr>
7761         Let the test suite use a wrapper around the not installed m4 to
7762         pretend it is (installed).
7764         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
7765         such a way that m4 does not process them.
7766         * configure.in: The package name seems to be `m4', not `M4'.
7767         * tests/m4: New.
7768         * tests/atlocal.in (at_package, M4): Remove.
7769         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
7771 2001-08-27  Akim Demaille  <akim@epita.fr>
7773         * tests/Makefile.am (CLEANFILES): Remove.
7774         (DISTCLEANFILES, clean-local): New.
7775         * examples/mktests.sh: Remove.
7777 2001-08-27  Akim Demaille  <akim@epita.fr>
7779         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
7780         Don't use aclocal: it's written by hand.
7781         * aclocal.m4: m4_include all the files instead of being built by
7782         aclocal.
7783         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
7784         until it reads the traces by itself.
7785         * configure.in: Require Autoconf 2.42c as we are now using
7786         AC_CONFIG_TESTDIR instead of AT_CONFIG.
7787         Catch unexpanded `jm_' macros.
7788         * config/atconfig.m4: Remove.
7789         * config/error.m4: new.
7790         * config/Makefile.am: Ship the files included by aclocal.m4.
7791         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
7792         (TESTSUITE_AT): this, to please Automake.
7793         (TESTSUITE): This target uses autotest/autotest.m4, not
7794         autotest/general.m4.
7795         * tests/testsuite.at: Prereq Autotest 2.52c.
7796         * examples/Makefile.am (pkgdata_DATA): Rename as...
7797         (dist_pkgdata_DATA): this.
7798         * doc/Makefile.am (man_MANS): Rename as...
7799         (dist_man_mans): this.
7801 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
7803         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
7804         Robert Collins, building on Cygwin no longer requires Windows
7805         import and export symbol decorations.
7806         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
7807         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
7808         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7809         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7810         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7811         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7812         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7813         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7814         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
7815         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
7816         anymore.
7817         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
7818         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
7820 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
7822         Ansify the source.  Previously we had a mix, where my code was
7823         in a K&R compatible style, and the preexisting code was in ANSI
7824         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
7825         and now the code base is much cleaner.
7827         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
7828         VOID macro and all users.
7829         * m4/m4module.h:  Ansify function prototypes and headers.
7830         * m4/builtin.c:  Ditto.
7831         * m4/evalparse.c:  Ditto.
7832         * m4/input.c:  Ditto.
7833         * m4/macro.c:  Ditto.
7834         * m4/module.c:  Ditto.
7835         * m4/output.c:  Ditto.
7836         * m4/path.c:  Ditto.
7837         * m4/symtab.c:  Ditto.
7838         * m4/utility.c:  Ditto.
7839         * modules/format.c:  Ditto.
7840         * modules/gnu.c:  Ditto.
7841         * modules/m4.c:  Ditto.
7842         * modules/mpeval.c:  Ditto.
7843         * src/freeze.c:  Ditto.
7844         * src/m4.h:  Ditto.
7845         * src/main.c:  Ditto.
7847 2001-08-20  Akim Demaille  <akim@epita.fr>
7849         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
7850         generated with stock 2.52.
7852 2001-08-20  Akim Demaille  <akim@epita.fr>
7854         * config/atconfig.m4: New, until part of Autoconf per se.
7855         * configure.in (AT_CONFIG): Use it.
7856         Adjust.
7857         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
7858         * tests/atlocal.in: New.
7859         * tests/generate.awk: For the time being, the empty quadrigraph is
7860         `@__@'.
7861         * tests/others.at (changeword, gmp): Check the configuration
7862         variable against `yes'.
7863         * tests/testsuite.at (dnl): Allow it, as it's used all over the
7864         place.
7866 2001-08-20  Akim Demaille  <akim@epita.fr>
7868         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
7869         * modules/m4.c (undivert): Disable the possibility of undiverting
7870         several files at once: it is not documented, it is inconsistent
7871         with the other macros, it can be straightforwardly mocked by
7872         several invocations, and most importantly, it prevents the
7873         possibility of other kinds of extension.
7874         Use `m4_numeric_arg'.
7876 2001-08-20  Akim Demaille  <akim@epita.fr>
7878         * examples/include.m4: Typo.
7879         * tests/generate.awk: Really add it.
7880         * tests/Makefile.am: Adjust.
7881         * tests/others.at (Discard comments): It sure fails without `-c'.
7882         (include, undivert): Add -I examples/.
7884 2001-08-20  Akim Demaille  <akim@epita.fr>
7886         Use sprintf, not ecft and friends since it is standard, portable,
7887         simplifies the code, and since the latter is even deprecated
7888         according to the GNU libc documentation.
7890         * modules/format.c: Drop evct support.
7892 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
7894         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
7895         for `-pipe' here...
7896         * configure.in: ...do it here instead.
7898         * c-boxes.el: Deleted.
7899         * m4/builtin.c: Reformat box comments to be closer to GNU
7900         standards.
7901         * m4/debug.c:  Ditto.
7902         * m4/eval.c:  Ditto.
7903         * m4/evalparse.c:  Ditto.
7904         * m4/input.c:  Ditto.
7905         * m4/m4module.h:  Ditto.
7906         * m4/macro.c:  Ditto.
7907         * m4/output.c:  Ditto.
7908         * m4/symtab.c:  Ditto.
7909         * m4/utility.c:  Ditto.
7910         * modules/changeword.c:  Ditto.
7911         * modules/format.c:  Ditto.
7912         * modules/gnu.c:  Ditto.
7913         * modules/load.c:  Ditto.
7914         * modules/m4.c:  Ditto.
7915         * modules/modtest.c:  Ditto.
7916         * modules/mpeval.c:  Ditto.
7917         * modules/perl.c:  Ditto.
7918         * modules/shadow.c:  Ditto.
7919         * modules/stdlib.c:  Ditto.
7920         * modules/time.c:  Ditto.
7921         * src/freeze.c:  Ditto.
7922         * src/main.c:  Ditto.
7924 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
7926         * m4/module.c: Fixup some errors in the description comment.
7928 2001-08-17  Akim Demaille  <akim@epita.fr>
7930         * tests/others.at (iso8859): Specify the path to the M4 test file.
7931         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
7932         files in error messages.
7934 2001-08-17  Akim Demaille  <akim@epita.fr>
7936         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
7937         * tests/others.at: Adjust input files paths.
7938         * tests/atconfig.in: Set top_builddir.
7939         * tests/Makefile.am: Adjust.
7940         `testsuite' is in src, not build.
7942 2001-08-17  Akim Demaille  <akim@epita.fr>
7944         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
7945         (generate.at): Install a temporary hack until the actual
7946         generate.awk is added to the repository.
7947         * tests/atconfig.in: New.
7949 2001-08-17  Akim Demaille  <akim@epita.fr>
7951         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
7953 2001-08-17  Akim Demaille  <akim@epita.fr>
7955         * doc/m4.texinfo: Promote proper quotation.
7957 2001-08-17  Akim Demaille  <akim@epita.fr>
7959         Remove the non Autotest tests.
7961         * tests/other-tests/capitalize.test,
7962         * tests/other-tests/changeword.test,
7963         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
7964         * tests/other-tests/debug.test,
7965         * tests/other-tests/discard-comments.m4,
7966         * tests/other-tests/discard-comments.test,
7967         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
7968         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
7969         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
7970         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
7971         * tests/other-tests/hanoi.test,
7972         * tests/other-tests/import-environment.m4,
7973         * tests/other-tests/import-environment.test,
7974         * tests/other-tests/include.test, tests/other-tests/indir.test,
7975         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
7976         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
7977         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
7978         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
7979         * tests/other-tests/modtest.test,
7980         * tests/other-tests/multiquotes.test,
7981         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
7982         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
7983         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
7984         * tests/other-tests/sync-lines.m4,
7985         * tests/other-tests/sync-lines.test,
7986         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
7987         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
7988         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
7989         * tests/other-tests/wrap.test: Remove.
7991         * tests/run-test, tests/get-them: Remove.
7992         * tests/Makefile.am: Adjust.
7994 2001-08-17  Akim Demaille  <akim@epita.fr>
7996         others.at no longer depends on other-tests/.
7998         * tests/others.at (stackovf): You're actually...
7999         (sync-lines): this.
8000         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8001         (unload.test): Keep their authorship.
8002         (discard-comments, gmp, import-environment, modfreeze)
8003         (sync-lines): Embed the input files.
8004         * tests/stackovf.test: Copy from other-tests/stackovf.test.
8005         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8007 2001-08-17  Akim Demaille  <akim@epita.fr>
8009         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8010         (M4exit): Tag the exit status of the example.
8011         * tests/get-them: Adjust.
8012         * tests/generate.awk: New, based on get-them.
8013         * tests/Makefile.am: Adjust to generate `generated.at'.
8014         * tests/testsuite.at: Adjust.
8015         (AT_CHECK_M4): Don't overquote.  Blush...
8017 2001-08-17  Akim Demaille  <akim@epita.fr>
8019         Start using Autotest.  atconfig creation is still lacking.
8021         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8022         * examples/reverse.m4, tests/other-tests/import-environment.m4,
8023         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8024         * tests/other-tests/import-environment.test: Don't check LANGUAGE
8025         as it might be `unset', or set to `C'.
8026         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
8027         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8028         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8029         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
8030         * tests/other-tests/shadow.test: Adjust.
8031         * tests/testsuite.at, tests/others.at: New.
8032         * tests/Makefile.am: Adjust.
8034 2001-08-17  Akim Demaille  <akim@epita.fr>
8036         Drop Autoconf 2.13 compatibility.
8038         * configure.in (changeword): No need to undefine it, as anyway if
8039         it's defined, M4sugar moved it as m4_changeword.
8040         And anyway, proper quotation is enough.
8041         (m4_pattern_allow): As it exists in 2.50, just use it.
8042         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
8043         Don't handle Gettext's duties, let it handle them.
8044         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
8046 2001-08-17  Akim Demaille  <akim@epita.fr>
8048         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
8049         (m4_errprint): Use fputs.
8050         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
8051         dumpdef are not concerned.
8052         (Dumpdef, Errprint): Emphasize their insensitivity to
8053         --error-output.
8054         * doc/Makefile.am: Add `TAGS' support.
8055         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
8056         in `config/' now.
8057         * config/Makefile.am (MAINTAINERCLEANFILES): New.
8059 2001-08-17  Akim Demaille  <akim@epita.fr>
8061         * modules/Makefile.am (ETAGS_ARGS): New.
8063 2001-08-17  Akim Demaille  <akim@epita.fr>
8065         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
8066         changes.
8068 2001-08-17  Akim Demaille  <akim@epita.fr>
8070         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
8072 2001-08-17  Akim Demaille  <akim@epita.fr>
8074         * m4/m4module.h (m4/list.h): Don't include it.
8076 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
8078         m4_modules are no more, we use lt_dlhandles directly and let
8079         latest libltdl features manage the list of loaded modules.
8080         * acinclude.m4: Regenerated.
8081         * m4/ltdl.c: Updated from master copy.
8082         * m4/module.c: Reimplemented to take advantage of advances in
8083         libltdl.
8084         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
8085         list with lt_dlhandle_next.
8086         (m4_builtin_find_by_func): Ditto.
8087         (m4_builtin_table_install): Use lt_dlhandle.
8088         (m4_macro_define): Ditto.
8089         (m4_macro_table_install): Ditto.
8090         m4/module.h: Prototype new module management API.
8091         (m4_modules): No longer required.
8092         (m4_module_init_t, m4_module_finish_t): POSIX namespace
8093         violations, renamed to...
8094         (m4_module_init_func, m4_module_finish_func): ...these,
8095         respectively.
8096         (M4INIT_HANDLER): Clean way to declare init functions in modules.
8097         (M4FINISH_HANDLER):  And similarly for finish functions.
8098         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
8099         -- Add indirection to the CONC macro so that arguments are
8100         correctly expanded.
8101         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
8102         * modules/shadow.c (m4_init_module):  Ditto.
8103         Due to new init function semantics, be careful to perform the
8104         initialisation only on first load.
8105         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
8106         (m4_finish_module): Replaced with M4FINISH_HANDLER.
8107         Due to new finish function semantics, be careful to perform the
8108         finalisation only on first load.
8109         * m4/m4private.h (m4_module): Removed in favour of...
8110         (m4_module_data): ...structure without all the wrapper fields.
8111         Instances of this new structure are stored associated lt_dlhandles
8112         with lt_dlcaller_data_set().
8113         * m4/builtin.c (m4_builtin_define): Takes a handle argument
8114         instead of the old module argument.
8115         (m4_builtin_table_install): Ditto.
8116         * modules/load.c (m4_resident_module):  Removed.  This is no
8117         longer implemented as a magic symbol...
8118         * modules/m4.c (m4_resident_module): Ditto.
8119         * modules/load.c (M4INIT_HANDLER): ...the module init function now
8120         uses the ltdl api to make the module resident.
8121         * modules/m4.c (M4INIT_HANDLER): Ditto.
8122         * modules/load.c (builtin_modules): Traverse the loaded module
8123         list with lt_dlhandle_next.
8124         (builtin_load): Much simplified in light of the reimplemented
8125         module loader.
8126         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
8127         light of the m4/module.c rewrite.
8128         (produce_symbol_dump): Ditto.
8129         (reload_frozen_state): Ditto.
8130         * m4/list.c, m4/list.h: Files deleted.  No longer required.
8131         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
8132         (libm4_la_SOURCES): Delete list.c reference.
8133         * m4/m4private.h (m4_token_data):  Add a handle field.  This
8134         eliminates many of the searches to find the handle associated with
8135         various tokens that are passed between functions.
8136         (struct m4_symbol):  Removed the module field.  The
8137         module association does not belong with the symbol...
8138         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
8139         that the module implementation code is from.  Added a handle
8140         field.
8141         (m4_push_macro): Add a `handle' argument.  Changed all callers.
8142         (init_macro_token):  Set the `handle' field for the
8143         m4_token_data.
8144         * m4/macro.c (expand_argument): Copy the new handle field during
8145         reassignment.
8146         * modules/m4.c (macro_install): Use the new handle field to
8147         optimise the search for the correct builtin structure, and pass
8148         the handle details to m4_builtin_define.
8150 2001-08-15  Akim Demaille  <akim@epita.fr>
8152         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
8153         when creating `m4/obstack.h'.
8154         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
8155         top_builddir.
8156         * tests/defs: Make them absolute.
8157         (CDPATH) Neutralize.
8158         * tests/gethem: Use them.
8160 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
8162         * config/ltmain.sh: Doh!  Import again for a quoting fix that
8163         prevented any regression test from passing.
8165         * m4/m4module.h (obstack.h): Choose between installed version
8166         and shipped version based on configure tests.
8167         * src/freeze.c (obstack.h): Ditto.
8169         * acconfig.h: Removed.  No longer required.
8171         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
8172         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
8173         them to AC_INIT and AM_INIT_AUTOMAKE.
8174         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
8175         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
8176         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
8177         shell variable m4_cv_func_obstack_h.
8178         * tests/defs (M4): Be more careful about relative path to libtool
8179         script and m4 binary by using $srcdir.
8181         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
8182         optargs to the existing libltdl search path.
8183         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
8184         * m4/ltdl.c: Updated.
8185         * m4/ltdl.h: Ditto.
8186         * config/ltmain.sh: Ditto.
8188 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
8190         * src/main.c (main): Add `-b' (for `batch') mode switch to force
8191         interactive mode off.
8193 2001-08-10  Akim Demaille  <akim@epita.fr>
8195         * configure.in: Require Autoconf 2.52.
8196         (AC_ARG_PROGRAM): Remove, handled by Automake.
8197         (m4_getopt): Rename as...
8198         (m4_getopt_h): this.
8199         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
8200         Undefine `changeword' only if defined.
8201         * config/gnu-obstack.m4: Require Autoconf 2.52.
8202         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
8203         Allow this token.
8205 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
8207         * doc/m4.texinfo: Fix some typos, and apply some small
8208         clarifications.
8210 2001-08-09  Andreas Schwab  <schwab@suse.de>
8212         * src/main.c (main): Fix improper uses of error (missing format
8213         string).
8215 2001-08-07  Akim Demaille  <akim@epita.fr>
8217         Improve `make distcheck'.
8219         * configure.in: Be sure to be able to run `mkconfig.sh' when src
8220         != build.
8221         * Makefile.am (dist-hook): Remove, as it is no longer needed.
8222         * doc/m4.texinfo (Include): Add missing blank.
8223         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
8224         obstack.c.
8226 2001-08-07  Akim Demaille  <akim@epita.fr>
8228         * m4/evalparse.c: A better introductory comment.
8229         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
8230         * m4/macro.c: Adjust old comments.
8231         * modules/README: Typo.
8233 2001-08-07  Akim Demaille  <akim@epita.fr>
8235         * config/gnu-obstack.m4: New.
8237 2001-08-07  Akim Demaille  <akim@epita.fr>
8239         * config/Makefile.am, config/stackovf.m4: New.
8240         * configure.in, Makefile.am: Adjust.
8242 2001-08-05  gettextize  <bug-gnu-utils@gnu.org>
8244         * po/Makefile.in.in: Upgrade to gettext-0.10.39.
8245         * po/cat-id-tbl.c: Remove file.
8246         * po/stamp-cat-id: Remove file.
8248 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
8250         * modules/format.c (format):  Formatting for %f was not
8251         interpreting the position of the decimal point correctly for
8252         whole numbers.
8254 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
8256         * TODO:  Removed m4exit bug.
8257         * modules/load.c (m4_resident_module): Make this module resident.
8258         * module/m4.c (m4_resident_module): Ditto.
8259         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
8260         feature to mark modules as resident if they export
8261         `m4_resident_module' as TRUE.
8262         (m4_module_unload): Do not remove resident modules, and take care
8263         with symbol insertion and deletion with resident modules.
8264         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
8265         use resident modules feature.
8267 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
8269         * TODO: Updated.  Removed some cruft that has since been fixed
8270         or implemented.  Added some more entries.
8271         * NEWS: Updated.
8272         * README: Updated.
8273         * modules/README: Updated.
8274         * doc/m4.texinfo: Updated.
8276         * modules/gnu.c (builtin_functions): Make indir orthogonal to
8277         builtin, in that each is recognised as a macro only with parameters
8278         (builtin_indir): Passing 0 arguments is now an error, as with
8279         builtin.
8281         * src/main.c (usage): Added missing description of `-c' option.
8283 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
8285         Consolidate the myriad of dispersed test scripts into the
8286         tests subdirectory.  I think I now have all the file where I
8287         want them, so there shouldn't be anymore upheaval =)O|
8288         Honest!
8289         * tests/Makefile.am: Updated to run the new tests added below.
8290         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
8291         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
8292         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8293         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8294         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8295         tests/other-tests/hanoi.test, tests/other-tests/include.test,
8296         tests/other-tests/indir.test, tests/other-tests/misc.test,
8297         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
8298         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8299         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8300         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
8301         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
8302         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
8303         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8304         tests/other-tests/translit.test, tests/other-tests/undivert.test,
8305         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8306         tests/other-tests/wrap.test:  New tests based on the contents
8307         of the tests removed below.
8308         * examples/Makefile.am, modules/Makefile.am:  Updated to
8309         reflect removed tests.
8310         * examples/defs,modules/defs: Removed.
8311         * examples/capitalize.test, examples/comments.test,
8312         examples/ddivert.test, examples/debug.test,
8313         examples/esyscmd.test, examples/exp.test,
8314         examples/foreach.test, examples/forloop.test,
8315         examples/fstab.test, examples/hanoi.test,
8316         examples/include.test, examples/indir.test,
8317         examples/misc.test, examples/multiquotes.test,
8318         examples/patsubst.test, examples/pushpop.test,
8319         examples/regexp.test, examples/reverse.test,
8320         examples/sysv-args.test, examples/trace.test,
8321         examples/translit.test, examples/undivert.test,
8322         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
8323         modules/modpath1.test, modules/modpath2.test,
8324         modules/modpath3.test, modules/modpath4.test,
8325         modules/modtest.test, modules/shadow.test,
8326         modules/unfrozen.m4, modules/unload.test: Removed.
8328         Move the implementation of GMP support for the mpeval() builtin
8329         into a loadable module that depends on libgmp.  mpeval() and
8330         eval() share a common parser, now in m4/evalparser.c; the code
8331         in m4/numb.c and m4/numb.h is now physically split between
8332         m4/eval.c (the eval() backend) and modules/mpeval.c (the
8333         mpeval() backend), rather than being differentiated by cpp
8334         macros and multiple inclusion.  The mpeval module is always
8335         built but will generate an diagnostic if it is used from an
8336         installation that didn't link in the gmp library.
8337         * modules/Makefile.am: build and install the new mpeval module.
8338         * modules/mpeval.c: Now contains the former parts of m4/numb.c
8339         and m4/numb.h that are required for gmp support in mpeval().
8340         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8341         * m4/evalmp.c:  Removed.
8342         * m4/m4module.h: Removed conditional prototype for
8343         m4_mp_evaluate().
8344         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
8345         and m4/numb.h that do not rely on gmp.
8346         * m4/evalparse.c:  New file, contains the shared parts of the
8347         eval() and evalmp() parser implementations, and is no longer
8348         unencumbered by cpp magic to uncover the right parts.
8349         * m4/numb.h:  Removed.  It's former contents are split between
8350         m4/eval.c and modules/mpeval.c.
8351         * m4/numb.c: ditto.
8353         * tests/other-tests/changeword.test: New test.  Rudimentary
8354         testing of changeword builtin runs only if --wnable-changeword
8355         was used at configure time.
8356         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8357         alternation correctly.  Split into two expressions to compensate.
8358         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
8359         * modules/Makefile.am: Build changeword module.
8360         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
8361         only when --enable-changeword was passed to configure.
8362         (builtin_changeword): If --enable-changeword was not used, then
8363         report that changeword() builtin has no support in m4 binary.
8365 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
8367         * src/main.c (main): Fixed a particularly nasty bug is
8368         user_search_path setting -- the -M flag processing must be
8369         extremely careful with search path ordering, or else the default
8370         installed module directory (possibly containing modules from a
8371         previous release) is placed earlier in the search path than any -M
8372         arguments (which are relied upon to load uninstalled modules with
8373         most of the tests in the regresion suite).
8375         * modules/load.c (builtin_load):  Nasty hack to prevent adding
8376         symbols to symtab again if a module is loaded more than once.
8377         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
8379         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
8380         possible NULL pointer dereference.
8382         * m4/module.c (m4_module_find_by_modname): Renamed from
8383         m4_module_modname_find.   Fixed all references.
8384         (m4_module_find_by_builtin):  New function.
8386         * modules/modfreeze.test: load the `load' module with each
8387         invocation.
8388         * src/freeze.c (produce_frozen_state): Simplified in light of
8389         module field in m4_symbol.  Allow a third argument for text macros
8390         to name the originating module.
8391         (reload_frozen_state): ditto.
8392         * m4/m4module.h:  Fixup prototypes.
8393         * m4/builtin.h (m4_builtin_define): Add a module argument so
8394         that symbols can be registered against the defining module.
8395         (m4_macro_define): ditto.
8396         * m4/m4private.h (m4_symbol): Make the module field const to save
8397         on casting in the rest of the code.
8398         (SYMBOL_MODULE): New macro.
8400         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
8401         symbol reference maintenance bugs when removing a symbol from the
8402         symtab.
8404         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
8406 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
8408         * configure.in (m4_cv_func_obstack): A better check for whether
8409         libc has an obstack implementation.
8410         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
8412         * configure.in (--with-modules): Changed semantics.  This
8413         option is now used to list modules to be preopened.
8414         * src/m4.h: #include "ltdl.h" unconditionally.
8415         * src/main.c: Removed all dependencies on WITH_MODULES.
8416         * src/freeze.c: ditto.
8417         * modules/Makefile.am: ditto.
8418         * m4/m4.c (builtin_m4exit): ditto.
8419         * modules/modpath1.test: ditto.
8420         * modules/modpath2.test: ditto.
8421         * modules/modpath3.test: ditto.
8422         * modules/modpath4.test: ditto.
8423         * modules/modtest.test: ditto.
8424         * modules/shadow.test: ditto.
8425         * modules/unload.test: ditto.
8427         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
8428         comes up on demand in LTLIBOBJS now.
8429         * configure.in (getopt_long):  Creating and relying on a link for
8430         getopt.h on hosts with no getopt_long() of thier own works
8431         correctly now.  This is necessary so that callers of getopt_long()
8432         can simply `#include <getopt.h>': the naive way of doing this
8433         would end up using our own getopt.h and the installed
8434         getopt_long(), which is asking for trouble!
8435         (obstack_init): A similar argument applies to obstack.h and
8436         obstack_init().
8438         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
8439         On Solaris-2.5 (at least) the native dlopen implementation
8440         gets confused about m4.o when looking for module "m4".  This
8441         version always looks for .la an .$lib_ext suffixed names first
8442         to work around the problem.  Sigh.
8444         * po/POTFILES.in: Take account of these file movements.
8445         * src/Makefile.am (m4_SOURCES): removed eval.c.
8446         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
8447         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
8448         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
8449         * modules/m4.c (builtin_eval): Use m4_evaluate().
8450         * m4/eval.c: Moved here from src/eval.c to facilitate
8451         implementation of eval() builtin as part of the `m4' loadable
8452         module.
8453         (m4_evaluate): renamed from evaluate for namespace cleanliness.
8454         * m4/numb.c: Moved here from src/numb.c, since it is #included
8455         into eval.c at compile time.
8456         * m4/m4module.h (m4_evaluate): Added prototype.
8457         * src/m4.h (evaluate): Removed prototype.
8459 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
8461         * modules/perl.c (builtin_perleval):  Use PL_na for
8462         compatibility with perl-5.6.
8464         * src/main.c (main):  It is now safe to
8465         ``m4_module_install("m4")'', without tripping over the m4
8466         binary itself!
8467         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
8468         versions having fixed the insidious module search order bug.
8470         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
8471         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
8473         * configure.in: Figure out whether to use the installed
8474         getopt.h or the supplied one.
8475         * src/Makefile.am: ditto.
8477         * po/POTFILES.in: List files in their new positions.
8479         * config/ltmain.sh:  This needs to be checked in to match the
8480         libtool macros copied to acinclude.m4 (until a released
8481         libtool copes with m4's needs).
8482         * bootstrap:  Run gettextize.
8484 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
8486         * AUTHORS:  Added my details.
8487         * TODO: updated.
8488         * NEWS: updated.
8489         * bootstrap: temporary update until released libtool catches up.
8491         * All files:  Use new GNU GPL copyright blurb with current contact
8492         address.
8494         * configure.in (LTLIBOBJS): Use canonical code for calculation of
8495         this variable.
8497         * config: renamed acm4 directory to config to be more like
8498         other autoconfiscated packages.
8500         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
8501         * config/debug.m4:  New file implementing configure macros to add
8502         suitable debug flags to the compiler invocation.
8504         * modules/load.c:  New file implementing the ``load'' and
8505         ``unload'' builtins.
8506         * tests/get-them:  Set the module search directory to the modules
8507         build directory in generated tests.
8508         * modules/shadow.test: ditto.
8509         * modules/modtest.test: ditto.
8510         * modules/modpath1.test: ditto.
8511         * modules/modpath2.test: ditto.
8512         * modules/modpath3.test: ditto.
8513         * modules/modpath4.test: ditto.
8514         * modules/modtest.test: ditto.
8515         * modules/modfreeze.test: ditto.
8516         * modules/unload.test: ditto.
8518         * modules/changeword.c:  New file implementing the ``changeword''
8519         builtin as a loadable module.
8520         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
8521         as a loadable module.
8523         * src/main.c (main):  Load the gnu module if m4 was started
8524         normally -- i.e. without the -G option.
8525         * modules/gnu.c:  New file implementing a new loadable module wuth
8526         definitions for all the gnu extension builtins.
8527         * modules/format.c:  Moved here from src/format.c.  Now included
8528         directly by gnu.c.
8530         * src/main.c (main):  Load the traditional module if m4 was
8531         started in `no_gnu_extensions' mode.
8532         * modules/traditional.c:  New file implementing the ``unix'' macro,
8533         required when m4 is executed in traditional mode, as a loadable
8534         module.
8536         * src/main.c:  Renamed from m4.c to avoid confusion with
8537         modules/m4.c.
8538         (main):  Always load the m4 module.
8539         * modules/m4.c:  New file implementing a new loadable module with
8540         definitions for all m4 builtins that are not gnu extensions.
8542         * m4/Makefile.am:  Adjusted to take new files below into account.
8543         * m4/m4module.h: Prototypes for exported functions and types moved
8544         to this directory from the src directory.
8545         * m4/m4private.h: Moved here from src/m4private.h to facilitate
8546         the migration of all builtin implementations to loadable modules.
8547         * m4/macro.c: Moved this file here from the src directory,
8548         renaming all exported symbols to use the prefix ``m4_''.
8549         * m4/builtin.c: ditto.
8550         * m4/module.c: ditto.
8551         * m4/symtab.c: ditto.
8552         * m4/debug.c: ditto.
8553         * m4/input.c: ditto.
8554         * m4/output.c: ditto.
8555         * m4/path.c: ditto.
8556         * m4/ltdl.h, m4/ltdl.c: ditto.
8557         * m4/utility.c: Odd functions moved here from files in the src
8558         directory to facilitate builtin migration.
8560 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
8562         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
8563         error message, to make translators' jobs a little easier.
8564         (builtin_builtin): ditto.
8565         (builtin_traceon): ditto.
8566         (builtin_traceoff): ditto.
8567         Reported by Akim Demaille <akim@epita.fr>
8569         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
8570         pkgincludedir instead.
8572         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
8573         it is exported globally.  Fixed all references.
8574         (lquote): ditto.
8575         (bcomm): ditto.
8576         (ecomm): ditto.
8577         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
8578         globally.  Fixed all references.
8579         (DEF_LQUOTE): ditto.
8580         (DEF_BCOMM): ditto.
8581         (DEF_ECOMM): ditto.
8583 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
8585         * NEWS: updated.
8586         * TODO: updated.
8588         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
8589         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
8591         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
8592         Removed `Prev', `Next' and `Up' fields of all @nodes now that
8593         makeinfo calculates them for us, and to make any future
8594         reorganisation easier.
8595         (Frozen files): Document format version 2.
8596         `V' now takes argument `2'.
8597         `F' can take a single argument if symbol and builtin names
8598         are the same, or 3 arguments if the builtin is from a module.
8599         New `S' specification for saving syntax table contents.
8600         New `M' specification for saving loaded module names.
8601         * src/freeze.c: Implement them.
8602         * src/input.c (syntax_code): For interpreting frozen syntax
8603         state.
8605         * examples/Makefile.am:  Add the contents of the WWW directory to
8606         the distribution.
8607         * examples/WWW/Makefile:  ditto,
8608         (%.htm): Compares file contents (not just sizes) to determine
8609         whether a change has occured.
8610         * examples/WWW/_header.htm: Bumped version number.
8611         * examples/WWW: Regenerated content.
8613         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
8614         compilers comes much easier without ansi2knr.
8615         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
8617         * m4/list.c: New generic list container type.
8618         * m4/list.h: Interface to new container type.
8619         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
8620         (libm4_la_SOURCES): compile and link list.c.
8621         * src/builtin.c (builtin_tables): Use list container.
8622         * src/module.c (symtab): ditto.
8623         * src/symtab.c (symtab): ditto.
8625         * m4/system.h: New file for common preprocessor definitions.
8626         * m4/Makefile.am (pkginc_HEADERS): install system.h.
8627         * m4/error.c: Use system.h in place of inline preprocessor.
8628         * m4/error.h: ditto.
8629         * m4/module.c: ditto.
8630         * m4/module.h: ditto.
8631         * m4/xmalloc.c: ditto.
8633         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
8634         compatibility.
8635         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
8637         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
8638         it is exported globally.  Fixed all references.
8639         (builtin): ditto.
8640         (module_init_t): ditto.
8641         (module_finish_t): ditto.
8642         (token_data): ditto.
8643         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
8644         it is exported globally.  Fixed all references.
8645         (SYNTAX_IGNORE): ditto.
8646         (SYNTAX_SPACE): ditto.
8647         (SYNTAX_OPEN): ditto.
8648         (SYNTAX_CLOSE): ditto.
8649         (SYNTAX_COMMA): ditto.
8650         (SYNTAX_DOLLAR): ditto.
8651         (SYNTAX_ACTIVE): ditto.
8652         (SYNTAX_ESCAPE): ditto.
8653         (SYNTAX_ALPHA): ditto.
8654         (SYNTAX_NUM): ditto.
8655         (SYNTAX_ALNUM): ditto.
8656         (SYNTAX_LQUOTE): ditto.
8657         (SYNTAX_RQUOTE): ditto.
8658         (SYNTAX_BCOMM): ditto.
8659         (SYNTAX_ECOMM): ditto.
8660         (SYNTAX_VALUE): ditto.
8661         (SYNTAX_MASKS): ditto.
8662         (IS_OTHER): ditto.
8663         (IS_IGNORE): ditto.
8664         (IS_SPACE): ditto.
8665         (IS_OPEN): ditto.
8666         (IS_CLOSE): ditto.
8667         (IS_COMMA): ditto.
8668         (IS_DOLLAR): ditto.
8669         (IS_ACTIVE): ditto.
8670         (IS_ESCAPE): ditto.
8671         (IS_ALPHA): ditto.
8672         (IS_NUM): ditto.
8673         (IS_ALNUM): ditto.
8674         (IS_LQUOTE): ditto.
8675         (IS_RQUOTE): ditto.
8676         (IS_BCOMM): ditto.
8677         (IS_ECOMM): ditto.
8678         (TOKEN_EOF): ditto.
8679         (TOKEN_NONE): ditto.
8680         (TOKEN_STRING): ditto.
8681         (TOKEN_SPACE): ditto.
8682         (TOKEN_WORD): ditto.
8683         (TOKEN_SIMPLE): ditto.
8684         (TOKEN_MACDEF): ditto.
8686         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
8687         consistency.  Fixed all references.
8688         (STRING): Renamed to `m4_string' for consistency, and because if
8689         is exported globally.  Fixed all references.
8690         (token_type): Renamed to `m4_token_t' for the same reasons.
8691         (token_data_type): Renamed to `m4_token_data_t' for the same
8692         reasons.
8694         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
8695         sizes.
8696         (XMALLOC): ditto.
8697         (XREALLOC): ditto.
8698         (XFREE): Wrapper macro which avoids freeing NULL pointers.
8700         * m4/m4module.h (m4_macro):  New type for module defined user
8701         macros.
8702         * modules/modtest.c (m4_macro_table):  Define module user macros.
8703         * modules/shadow.c (m4_macro_table):  ditto.
8705         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
8706         declared with M4BUILTIN.
8708         * m4/xmalloc.c: Use memset if bzero is not available when
8709         emulating calloc with malloc.
8710         (xcalloc): Fallback to malloc/bzero if calloc is not available.
8711         (xfree): Added for consistency.  Will not try to free NULL
8712         pointers.
8713         * src/m4.c (xfree):  Deleted in favour of the above.
8714         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
8715         linking with libdmalloc.
8716         * m4/xstrdup.c (WITH_DMALLOC): ditto.
8718         * modules/frozen.m4:  New test case.
8719         * modules/unfrozen.m4:  ditto.
8720         * modules/modfreeze.test:  New test.
8721         * modules/unload.test:  ditto.
8722         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
8723         (TESTS): Use them.
8724         * modules/modpath1.test:  Don't try this test if module support is
8725         not compiled in.
8726         * modules/modpath2.test: ditto.
8727         * modules/modpath3.test: ditto.
8728         * modules/modpath4.test: ditto.
8729         * modules/modtest.test: ditto.
8730         * modules/shadow.test: ditto.
8732         * modules/perl.c: New module.
8733         * modules/perl.m4: Example of using it.
8734         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
8736         * src/m4.c (main): Assume interactive mode if STDIN is connected
8737         to a tty.
8738         Changed startup sequence slightly so that syntax is not
8739         initialised from here when loading a frozen file.
8741         * src/builtin.c:  Much improved macro definition style.
8742         * src/m4private.h:  Internal structures for m4_builtin and
8743         m4_macro instances.  These are not exposed to module writers.
8744         * src/module.c (module_modname_find):  Find a module structure
8745         from the its name.
8746         (make_macro_table):  Build an internal macro table from a external
8747         definition.
8748         (make_builtin_table):  Build an internal builtin table from an
8749         external definition.
8751         * src/module.c (module_unload): Be extremely careful to remove
8752         builtins and macros that match the module being unloaded -- no
8753         longer assume that the top element can be removed incase another
8754         odule defines an identical name.
8755         * src/symtab.c (remove_table_reference_symbols): remove all symbol
8756         table entries which refer to a given builtin table.
8757         * src/builtin.c (remove_tables): Use it!
8759 2000-07-13  Thomas Tanner  <tanner@ffii.org>
8761         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
8762         * acm4/modules.m4: deleted
8763         * bootstrap: don't libtoolize libltdl!
8764         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
8765         if set, enable WITH_MODULES and add modules to DLPREOPEN
8766         * examples/misc.test: redirect standard output
8767         * lib/Makefile.am: don't use DLLDFLAGS
8768         * lib/m4module.c: include necessary headers to silence GCC -Wall
8769         * lib/m4regex.c: fixes to silence GCC -Wall
8770         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
8771           build modules conditionally
8772         * modules/shadow.c: define symbol aliases before using them
8773         * modules/test.c: define symbol aliases before using them
8774         * po/de.po: update translation
8775         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
8776         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
8777         LIBLTDL to LIBS.
8778         * src/m4.c: initialize libltdl's preloaded symbols via
8779         LTDL_SET_PRELOADED_SYMBOLS
8780         * src/module.c: libltdl's memory management must be initialized
8781         before calling lt_dlinit!, fix warnings
8783 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
8785         * README:  Caveat about nls not supported by dll architecture on
8786         Windows.
8788         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
8790         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
8791         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
8792         * modules/Makefile.am (LIBS): ditto.
8793         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
8794         $(top_srcdir)/m4 (for only <m4module.h>).
8795         * modules/shadow.test: fixed for VPATH.
8796         * modules/modtest.test: ditto.
8797         * modules/modpath4.test: ditto.
8798         * modules/modpath3.test: ditto.
8799         * modules/modpath2.test: ditto.
8800         * modules/modpath1.test: ditto.
8802         * modules/time.test: Removed due to timezone dependence,
8803         * modules/Makefile.am (TESTS): Removed time.test.
8805         * configure.in: Use $3 of AC_DEFINE so that we can,,,
8806         * acconfig.h: Remove everything except the gettext parameters.
8807         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
8808         AC_DEFINE.
8809         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
8810         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
8811         increment serial number.
8813         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
8814         src dir and immediately after libm4 is built for confidence that
8815         it doesn't rely on the src directory.
8816         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
8817         makeinfo stop the build on cygwin (because they don't work).
8819         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
8821         * m4/m4private.h: ...is not a public header, so moved to src.
8822         Add `#include <config.h>', `#define _COMPILING_M4' and
8823         `#include "m4.h".
8824         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
8825         * src/Makefile.am (noinst_HEADERS): add m4private.h.
8826         * src/builtin.c: `#include "m4private.h"' now takes care of the
8827         above.  Duplicates removed.
8828         * src/debug.c: ditto.
8829         * src/eval.c: ditto.
8830         * src/evalmp.c: ditto.
8831         * src/format.c: ditto.
8832         * src/freeze.c: ditto.
8833         * src/input.c: ditto.
8834         * src/m4.c: ditto.
8835         * src/macro.c: ditto.
8836         * src/module.c: ditto.
8837         * src/numb.h: ditto.
8838         * src/output.c: ditto.
8839         * src/path.c: ditto.
8840         * stackovf.c: ditto.
8841         * symtab.c: ditto.
8843         * po/POTFILES.in: compensate for renaming of lib/*.
8844         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
8845         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
8846         and then in $(top_srcdir)/lib (for eg. "m4private.h").
8847         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
8848         m4/libm4.la.
8849         * m4/m4error.h:  Renamed error.h, for installation to
8850         $prefix/include/m4..
8851         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
8852         * m4/m4regex.h: Renamed regex.h, for same reason.
8853         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
8854         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
8855         * m4/m4regex.c: Renamed regex.c, and fix #includes.
8857         * lib: moved to m4 to easily support header installation to
8858         $prefix/include/m4.
8859         * Makefile.am (SUBDIRS): renamed lib dir to m4.
8860         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
8861         * acm4/regex.m4: Point to m4/regex.c.
8863         * examples/foreach.m4:  Sanitise quoting.
8864         * examples/foreach.test:  New torture test.
8865         From Akim Demaille <akim@epita.fr>
8867 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
8869         * src/ltdl.c: Use access() to abort doomed module load attempts
8870         if module file does not exist.
8872         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
8873         getopt1.o will already be used if appropriate, so I moved getopt.c
8874         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
8876         * modules/modpath1.test: Use correct filename in header line.
8877         * modules/modpath2.test: ditto.
8878         * modules/modpath3.test: ditto.
8879         * modules/modpath4.test: ditto.
8881         Without these changes lt_dlopen("test") attempts to
8882         LoadLibrary("/bin/test") on Windows, which although harmless
8883         generates a spurious error message which spoils most of the tests:
8884         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
8885         (TESTS): s/test.test /modtest.test /
8886         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
8887         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
8888         * modules/modpath1.test: s/test.m4 /modtest.m4 /
8889         * modules/modpath2.test: ditto.
8890         * modules/modpath4.test: ditto.
8891         * modules/modpath3.test: s/-m test /-m modtest /
8892         * modules/shadow.m4: use {un,}loadmodule(`modtest').
8894 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
8896         * src/ltdl.c (find_file): Updated to new version with fixed memory
8897         allocation bug in `next'.
8898         * src/ltdl.h: updated to match.
8900         * modules/Makefile.am:  Cleaned up and reordered.
8902 2000-01-16  René Seindal  <rene@seindal.dk>
8904         * modules/Makefile.am (TESTS): New tests for the module system.
8906         * modules/*.test: New files.
8908         * src/m4.c (main): Added call to module_init().
8909         Treats -M and -m as the arguments -D -U and -t, ie deferred.
8911         * src/m4.h: Added declaration of module_init().
8913         * src/module.c (module_init): No longer static
8915         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
8916         Added to shut up automake about non standard libtool library
8917         names.
8919         * src/module.c: Disabled DEBUG by default.
8921         * modules/README: Changed example from unload.m4 to shadow.m4
8923         * modules/shadow.m4: Renamed from unload.m4
8925         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
8927         * src/m4.c (main): Functionality for -m and -M were reversed.
8928         Fixed.
8930 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
8932         * doc/help2man.pl: updated to version 1.020.
8934         * lib/COPYING.LIB:  updated to version 2.1.
8936         * lib/m4module.h: restructure the M4_SCOPE code to work when
8937         creating a dll which links with libm4.la and both DLL_EXPORT
8938         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
8939         both defined.
8941 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
8943         Merged the following changes from my tree:
8945         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
8947         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
8948         ported to compile shared libs.
8950         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
8951         use `__declspec(dllimport)' when linking libm4.la on win32.
8952         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
8954         * configure.in (M4OBJS): Discover whether we need the shipped
8955         implementation of getopt_long.
8956         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
8957         main binary here, as opposed to the module library in lib/libm4.la.
8959         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
8961         * modules/README: Updated to describe the improved libltdl based
8962         module scheme.
8963         * README (cygwin): Added some compilation notes for building m4
8964         correctly under cygwin.
8965         * TODO: Cleaned out the entries for the module system since they
8966         are now implemented.
8968         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
8969         all instances of __P with M4_PARAMS.
8971         * lib/getdate.h: removed unreferenced file.
8973         * lib/m4private.h: New file to define the private interface to the
8974         token_data struct, which must be shared between m4module.c, and
8975         builtin.c but not exported to modules built from the installed
8976         m4module.h since it's size changes depending on compile time
8977         options.
8979         * src/m4.h: Lots of stuff moved to lib/m4module.h.
8981         * lib/m4module.h: New file to define the interface available when
8982         compiling m4 modules.
8983         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
8984         necessary for module compilation into this new file.
8986         * lib/Makefile.am (include_HEADERS): install headers (renamed to
8987         avoid nameclash with other system headers) necessary for compiling
8988         modules.
8989         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
8990         so that modules can include the (renamed) installed headers and
8991         be guaranteed a matching implementation.
8992         * lib/m4error.h: renamed from error.h.
8993         * lib/m4obstack.h: renamed from obstack.h.
8994         * lib/m4regex.h: renamed from regex.h.
8995         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
8996         implementation, simply include the shipped version
8997         unconditionally, otherwise it is hard for a module to know
8998         whether the m4obstack.h header it is using matches the
8999         implementation it ends up linking against.
9000         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
9001         the same reason.
9003         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
9005         * examples/misc.test: Don't run this test on machines which don't
9006         have a root user in /etc/passwd (e.g. cygwin).
9008         * tests/get-them (/^@example$/): Error messages might have a
9009         ``.exe'' suffix to the program name, or else use the libtool
9010         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
9011         of these cases are now catered for when comparing error messages
9012         in generated tests.
9013         * tests/other-tests/*.test: ditto.
9014         * examples/*.test: ditto.
9016         * tests/defs (M4): use libtool execute mode.
9017         * examples/defs (M4): ditto.
9019         * tests/get-them (END): explicitly close any open file.
9020         (printthem): In a regular expression, '{' is the start of a repeat
9021         count!  Use `[{]' for a literal open brace.
9022         (/^@node /): Don't use substr on a string shorter than the trim
9023         length.
9025         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
9027         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9028         substituted.
9029         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9031 2000-01-10  Andreas Schwab  <schwab@suse.de>
9033         * tests/other-tests/gmp.test: Find config.sh in build directory.
9035         * configure.in: Find tests/mkconfig.sh in $srcdir.
9037         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9038         <signal.h> (for SUS2 compliant systems).
9040         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
9041         HAVE_SIGINFO_H.
9043 2000-01-10  René Seindal  <rene@seindal.dk>
9045         * Prerelease 1.4o.
9047         * TODO, NEWS: Cleaned up and updated.
9049         * src/m4.c (main): New variable exit_status for exit status in
9050         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
9051         file cannot be read instead of EXIT_SUCCESS.
9053         * src/builtin.c (m4_indir): Changed error message to help
9054         translators (from Akim Demaille <demaille@inf.enst.fr>).
9056         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
9057         Cygnus.
9059         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
9060         from glic 2.1.2.
9062         * src/input.c (match_input): Reordering of code, to avoid multiple
9063         calls to push_string_init() from obstack_grow(), which can happen
9064         with some compilers (found and fixed by James Bonfield
9065         <jkb@mrc-lmb.cam.ac.uk>).
9067         * src/stackovf.c: Added prototypes for ultrix.
9068         (setup_stackovf_trap): Added __P to cast.
9069         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
9071 2000-01-09  René Seindal  <rene@seindal.dk>
9073         * doc/m4.texinfo (Changequote): Added comment about changing
9074         quotes when the old quote is a part of the new.
9076         * src/builtin.c (expand_ranges): Added break after trailing dash.
9077         This caused misbehavious on some systems (found and fixed by Akim
9078         Demaille <demaille@inf.enst.fr>).
9080         * AUTHORS: Thomas Tanner included
9082         * acconfig.h: Added entry for ss_sp (see below).
9084         * configure.in (use_stackovf): Added check for stack_t with member
9085         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
9086         <eggert@twinsun.com>).
9088         * doc/m4.texinfo (Frozen files): Added a simpler example for
9089         generating frozen files from several input files.
9091 1999-11-14  Paul Eggert  <eggert@twinsun.com>
9093         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
9094         lib/regex.c, lib/xmalloc.c.
9096 1999-11-10  René Seindal  <rene@seindal.dk>
9098         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
9100         * src/module.c: reindented.
9101         (module_load): return if this is a repeated load of same module.
9102         (module_init): slight change of logic to avoid repeated
9103         initialisation debug messages.
9105         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
9106         in the distribution.
9108         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
9109         automake warnings about missing lib prefix.
9110         (time_la_LDFLAGS): ditto
9111         (stdlib_la_LDFLAGS): ditto
9113 1999-11-10  Paul Eggert  <eggert@twinsun.com>
9115         * src/m4.h: Include error.h, since our macros use error.
9116         * src/m4.c: Don't need to include error.h.
9118 1999-11-09  Paul Eggert  <eggert@twinsun.com>
9120         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
9121         and zero, as Solaris 7 cc does.
9122         (bcopy): Remove macro; no longer needed with new obstack.h.
9124         * src/output.c (freeze_diversions): Don't assume that a
9125         diversion size can fit in `int'.  Check for diversion file
9126         size too large to be printed with `unsigned long'.
9128         * src/Makefile.am (CFLAGS): Omit -Wall.
9130         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
9132         * src/debug.c (trace_format):
9133         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
9135         * src/freeze.c (produce_frozen_state):
9136         Don't assume string lengths fit in int.
9138 1999-10-13  René Seindal  <rene@seindal.dk>
9140         * po/cs.po: Czech translation added.
9142         * po/sv.po: Updated Swedish translation.
9144         * po/ru.po: Updated Russian translation.
9146         * po/pl.po: Updated Polish translation.
9148         * po/el.po: Greek translation added.
9150 1999-10-13  René Seindal  <rene@seindal.dk>
9152         * configure.in (ALL_LINGUAS): Added Greek translation (el).
9153         (ALL_LINGUAS): Added Czech translation (cs).
9155 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
9157         * src/builtin.c: moved module loading functions into...
9158         * src/module.c: entirely new implementation using libltdl.
9159         * po/POTFILES.in: added src/module.c.
9160         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
9161         are modules, not linktime libraries.
9162         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
9163         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
9164         avoidance on exported symbols.
9165         * modules/test.c (m4_macro_table, m4_init_module,
9166         m4_finish_module): ditto.
9167         * modules/time.c (m4_macro_table): ditto.
9169         * modules/time2.m4: new file which requires command line loading
9170         of modules.
9171         * src/m4.c (--load-module): dynamically load named runtime module
9172         into running executable before reading the source.
9173         (--module-directory): prepend a directory to the module search
9174         path.
9175         (module_init()): Do this the first time we load a module instead;
9176         if the module subsystem is broken normal m4 scripts can still run.
9177         * src/m4.h (install_builtin_table): is now exported.
9179 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
9181         * src/module.c: removed.  No longer required.
9182         * po/POTFILES.in: removed src/module.c.
9184         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
9185         the bootstrap script can recreate.
9186         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
9187         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
9188         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
9189         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
9190         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
9191         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
9192         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
9193         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
9195         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
9196         better.
9197         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
9198         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
9199         the installed gettext.m4 file when running aclocal.
9201 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
9203         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
9204         distinguish this from the last prerelease.
9205         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
9206         in its own subdirectory.
9208         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
9209         lib prefix on a module" feature.
9210         (LDFLAGS): Added `-module -avoid-version' flags to build
9211         versionless module libraries.
9212         * src/builtin.c (m4_load_module): use libltdl.
9213         (module_unload_all): use libltdl.
9214         * src/m4.c (module_init): initialise module loading on demand for
9215         better diagnostics, and so that m4 will still work even if
9216         the module code is broken.
9217         * src/m4.h (module_init): removed.  No longer relevant.
9218         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
9219         exported symbols for compatibility with dlpreopening.
9220         * modules/test.c (m4_macro_table, m4_init_module,
9221         m4_finish_module): ditto.
9222         * modules/time.c (m4_macro_table): ditto.
9224         * bootstrap: New file.  Runs all the autoutils in the right order
9225         after a fresh checkout, or a make maintainer-clean.
9227 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
9229         * src/builtin.c (dump_symbols): New function, factoring common
9230         content of m4_dumpdef and m4_symbols.
9231         (m4_dumpdef): Use it.
9232         (m4_symbols): New function, implementing `symbols'.  Use it.
9233         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
9234         file compile with modern makeinfo.
9235         (Symbols): New node, documenting symbols.
9236         (direntry): Modernize.
9238 1998-12-11  René Seindal  <rene@seindal.dk>
9240         * src/builtin.c (predefined_tab): New predefined macros
9241         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
9242         configure time options.
9244 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
9246         * src/module.c (module_try_load): Don't try to be clever and
9247         overwrite argument string.  Instead allocate all constructed
9248         strings locally, since they can have arbitrary lengths.  Make
9249         arguments pointers to const.
9250         (module_search): Simplify due to above change.
9252 1998-11-29  René Seindal  <rene@seindal.dk>
9254         * Prerelease 1.4n.
9256         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
9258         * tests/other-tests/import-environment.{m4,test}: New test.
9260         * tests/other-tests/discard-comments.{m4,test}: New test.
9262         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
9264         * src/m4.c (main): New option -c --discard-comments.
9265         New global variable discard_comments.
9267         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
9268         discarded, ie never returned from next_token().
9269         Added declaration of discard_comments.
9271         * src/input.c (next_token): Now loops until token type is not
9272         TOKEN_NONE.  Comments are now given this type when comments should
9273         be discarded.
9275         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
9276         and mpeval.
9278 1998-11-28  René Seindal  <rene@seindal.dk>
9280         * src/m4.c (main): New option --import-environment (no single
9281         letter option).
9283         * When configured with --with-gmp both the normal (fast) eval()
9284         and the gmp aware mpeval() are defined.  To restore previous
9285         bahaviour use "define(`eval', defn(`mpeval'))".
9287         * tests/other-tests/gmp.m4: Changed to use mpeval().
9289         * src/evalmp.c: New file for compiling eval.c as gmp aware.
9290         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
9292         * src/eval.c: Now includes "numb.c" directly.  Everything in this
9293         file must by static, except evaluate(), which is changed to
9294         mp_evaluate() if USE_GMP in force.
9296         * src/numb.c: Changed to be included by eval.c instead of being
9297         compiled separately.  Everything is declared static.
9299         * src/numb.h: Removed declarations of functions, as numb.c is now
9300         included by eval.c.
9302         * src/builtin.c: Declaration of m4_mpeval() added.
9303         Inserted `mpeval' in builtin table.
9304         (do_eval): New function with common code for m4_eval and m4_mpeval.
9305         (m4_mpeval): New function for gmp version of eval.
9307         * src/m4.h: Declaration of mp_evaluate().
9309         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
9310         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
9312         * src/m4.c (main): m4 --version also shows which options were used
9313         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
9315 1998-11-27  René Seindal  <rene@seindal.dk>
9317         * Error messages now always print program name before input file
9318         name as specified by GNU coding standards.  Reported by Akim
9319         Demaille <demaille@inf.enst.fr>.
9321         * doc/m4.texinfo (Include): Change due to changed error message
9322         format.
9323         (Eval): Do.
9325         * tests/get-them: Minor change to sed script due to changed error
9326         message format.
9328         * src/m4.c (print_program_name): New func used to print program
9329         name, input file and line number in error ().  Used as an
9330         error_print_progname handler.
9331         (reference_error): Removed.
9332         (main): Assigns error_print_progname.
9334         * src/m4.h (M4ERROR): Removed reference_error ().
9336 1998-11-25  René Seindal  <rene@seindal.dk>
9338         * Updated to libtool 1.2b.
9340         * src/builtin.c (install_builtin_table): Added braces to avoid
9341         warning of ambiguous 'else'.
9343         * src/module.c: Inserted search path code from path.c modified to
9344         use new interface.
9345         (module_init): Configured default path used only if M4MODPATH is
9346         not set.
9347         (module_try_load): Now reads libMODULE.la as generated by libtool
9348         for actual module name.
9349         (module_load): Gives better error messages on failure.
9351         * src/m4.h: Added declarations of structures and functions for
9352         generic search path handling.
9354         * src/path.c: Removed all module specific code and introduced new
9355         functions of more generic search path handling.
9357 1998-11-24  René Seindal  <rene@seindal.dk>
9359         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
9360         included gettext, as <libintl.h> might not be found
9361         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
9363 1998-11-22  René Seindal  <rene@seindal.dk>
9365         * src/output.c (insert_diversion): Fixed bug that might cause m4
9366         to read from standard output!  Triggered by input
9367         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
9368         so now 'undivert(0)' does nothing.
9370 1998-11-18  René Seindal  <rene@seindal.dk>
9372         * Prerelease 1.4m.
9374         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
9375         could be changed when compiling a illegal regexp, causing later
9376         use of the regexp to dump core.
9378         * src/module.c (module_load): Changed error message to conform to
9379         standards.
9381         * src/m4.c (usage): Added message about reporting bugs.
9383         * doc/m4.texinfo (Changeword): Corrected a wrong example.
9384         (Changeword): Added note about the type of regexps used.
9386         * ltconfig, ltmain.sh: New files from Libtool 1.2.
9388         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
9389         and AM_PROG_LIBTOOL.
9391         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
9392         with libtool.
9394         * modules/Makefile.am: Changed completely to compile modules using
9395         libtool.  The modules are compiled as shared libraries, and are
9396         renamed when installed.
9398         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
9399         USE_SHL_LOAD to HAVE_SHL_LOAD
9401         * src/builtin.c (shipout_string): Now tests for a NULL string.
9403         * src/module.c: New level of indirection around non-portable
9404         functions to load shared objects.  Intended to encapsulate the non
9405         portable parts better and to reduce the number of #ifdefs in the
9406         code.
9408         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
9409         directory modules/ to the distribution.
9411 1998-11-15  René Seindal  <rene@seindal.dk>
9413         * Prerelease 1.4l.
9415         * modules/stdlib.c: New module `stdlib' defining some standard
9416         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
9417         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
9419         * src/builtin.c (shipout_string): New convenience function for
9420         builtins and modules.
9422         * src/module.c (module_load): Tentative support for
9423         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
9425         * Makefile.am (SUBDIRS): Directory modules added if configured.
9427         * modules/Makefile.am: Now correctly compiles and installs
9428         modules in pkglibexecdir.
9430         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
9431         These two are now initialised by autoconf macros.
9433         * src/path.c (module_env_init): MODULE_PATH is always on the
9434         search path.
9436         * src/Makefile.am: Now generated pathconf.h which defined the
9437         default MODULE_PATH.
9439         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
9440         where modules are installed.
9442         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
9443         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
9444         build and install automatically, and it is prepared for other
9445         interfacec than dlopen().
9447         * src/builtin.c (predefined_tab): Added __m4_version__ for the
9448         current version of GNU m4.  It is a GNU extension.
9450 1998-11-14  René Seindal  <rene@seindal.dk>
9452         * tests/Makefile.am (GENERATED_TESTS): Added new
9453         generated-tests/changesy.8.test
9455         * doc/m4.texinfo (Changesyntax): Documentation for escape
9456         syntax class.
9458         * src/macro.c (expand_token): Check for escaped macro call before
9459         symbol table lookup.
9461         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
9462         characters
9464         * src/input.c: New static variable use_macro_escape, which is TRUE
9465         iff some character has code SYNTAX_ESCAPE
9466         (input_init): Added initialisation of use_macro_escape.
9467         (check_use_macro_escape): New function to synchronise
9468         use_macro_escape with the syntax table.
9469         (set_quotes): Added call to check_use_macro_escape()
9470         (set_comment): Do.
9471         (set_syntax): Do.
9472         (next_token): Added new case for IS_ESCAPE.
9474         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
9476 1998-10-13  René Seindal  <rene@seindal.dk>
9478         * Prerelease 1.4k.
9480         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
9481         generated-tests.
9483         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
9484         maintained tests in tests/other-tests.  These currently tests for
9485         8-bit transparency, multiple precision arithmetic and sync-line
9486         output.  Test for stackoverflow detection does not work.
9488         * examples/Makefile.am (TESTS): Added tests for all example files.
9490         * examples/mktests.sh: New file.  Help program for creating test
9491         files.
9493         * tests/mkconfig.sh: New file to generate tests/config.m4 and
9494         tests/config.sh.  This is for tests of configure selectable
9495         features.  Picks up all set WITH_ and ENABLE_ veriables from
9496         config.h
9498         * src/path.c (path_search): Added argument 'char **expanded_name'
9499         to return the expanded name.
9501         * src/m4.h: Added 2nd argument to declaration of path_search().
9503         * src/m4.c (main): Added 2nd argument to path_search().
9505         * src/freeze.c (reload_frozen_state): Do.
9507         * src/builtin.c (m4_undivert): Do.
9508         (include): Do.
9510 1998-10-11  René Seindal  <rene@seindal.dk>
9512         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
9514         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
9516         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
9518         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
9520         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
9522         * intl/: Updated to GNU gettext 0.10.35.
9524         * doc/m4.texinfo (Format): Documented that format is blind.
9526         * src/builtin.c (builtin_tab): Builtin format marked as blind.
9528 1998-10-07  René Seindal  <rene@seindal.dk>
9530         * Prerelease 1.4j.
9532         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
9533         .test, as the files are no longer just m4 input.
9535         * tests/get-them (FILE): Changed .m4 extension to .test.
9537         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
9538         Otherwise quoted strings with leading whitespace first in a macro
9539         argument would be eliminated.
9541         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
9542         (expand_argument): Do.
9544         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
9545         grouped together iff both quote and comment strings are single
9546         character.  Otherwise they might include a comment/quote leader.
9547         (next_token): Returns new token type TOKEN_SPACE.
9549         * src/builtin.c (push_builtin_table): New function to push a
9550         builtin_table on the stack without installing its contents.
9551         (find_builtin_by_name): Added call to push_builtin_table() if
9552         reading frozen files.  Otherwise the builtins named in the frozen
9553         files could not be found.
9554         (install_builtin_table): Changed to use push_builtin_table()
9556 1998-10-04  René Seindal  <rene@seindal.dk>
9558         * po/pl.po: Polish translation added.
9560         * po/POTFILES.in: src/module.c added.
9562 1998-10-04  René Seindal  <rene@seindal.dk>
9564         * Prerelease 1.4i.
9566         * configure.in (ALL_LINGUAS): Added Polish pl.po
9568 1998-10-03  René Seindal  <rene@seindal.dk>
9570         * Many files: Incorporated changes to implement dynamic modules.
9571         Detailed comments in src/modules.c and modules/README
9573         * src/module.c: New file, implements the OS dependant parts of
9574         dynamic module loading.
9576         * src/Makefile.am (m4_SOURCES): Added module.c
9578         * src/builtin.h: New file, declares some functions from builtin.c
9579         that are of use for other modules (shipout_int, numeric_arg,
9580         skip_space, bad_argc), and the macros ARG() and DECLARE().
9582         * src/builtin.c (install_builtin_table): New function.  Each
9583         module brings in a builtin_table, which is pushed on a stack.
9584         (struct builtin_table): New struct for list of builtin_tables.
9585         (m4_loadmodule): New function to implement builtin "loadmodule".
9586         (shipout_int): No longer static, to be used by modules.
9587         (numeric_arg): do.
9588         (skip_space): do.
9589         (bad_argc): do.
9590         (builtin_init): changed to call install_builtin_table()
9591         (find_builtin_by_name): Now searches all builtin_tables
9592         (find_builtin_by_addr): do.
9594         * src/path.c: Reorganised to allow for two search paths, one for
9595         include files and one for modules.
9597         * src/m4.h: Added declarations for new functions in module.c and
9598         in path.c.
9600         * src/m4.c (main): Added call to module_init().
9602         * modules: New directory with a few demo modules.
9604         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
9605         in SUBDIRS.
9607         * configure.in: Added modules/Makefile to AC_OUTPUT.
9609         * configure.in: Added code to implement --with-modules.  Tests for
9610         <dlfcn.h> and -ldl.
9612         * acconfig.h: Added WITH_MODULES
9614 1998-10-02  René Seindal  <rene@seindal.dk>
9616         * examples/Makefile.am (pkgdata_DATA): Removed special target for
9617         check and variables TESTS.  These tests are now run from the
9618         tests/ directory.
9620         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
9621         directory.  The files stay there but the tests are run from the
9622         tests/ directory.
9624         * tests/Makefile.am (EXTRA_DIST): Added run-test.
9626         * tests/run-test: New file.  Run a test manually
9628         * tests/Makefile.am, tests/get_them: Moved automatically generated
9629         tests (from the manual) to sub directory tests/gentest/.  The
9630         tests/ directory had gotten a bit messy.
9632 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9634         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
9635         wrap}.test: Added a few testcases.
9637 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9639         * Prerelease 1.4h.
9641         * lib/Makefile.am (noinst_HEADERS): regex.h added
9643         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
9644         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
9646         * acm4/Makefile.am: created providing rules to create
9647         $(top_srcdir)/acinclude.m4 to be used by aclocal.
9649         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
9650         `C'. Reported by Ulrich Drepper.
9652         * Makefile.am (SUBDIRS): Removed checks directory
9653         * configure.in (AC_OUTPUT): Removed checks/Makefile
9655         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
9656         the space when m4.texinfo is edited and whitespace.el is active.
9657         (Defn,example): idem.
9659 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9661         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
9662         ../COPYING. ../Makefile is a file which is certainly present when
9663         test is executed in testSubDir. One can't be sure that the COPYING
9664         file is in .. or ../.. in all situations, the ../Makefile is
9665         always there.
9667         * doc/m4.texinfo (Include): adjusted expected test output
9668         according to new tests, i.e. the input will always come from the
9669         file `in' created by the test.
9671         * tests/Makefile.am: Added three lines at the top to get
9672         esyscmd.1.test working.
9674         * tests/get-them: modified to generate clearer tests who will need
9675         less maintenance when new test examples are created in
9676         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
9677         need the generic file `defs') shell scripts creating `in', `ok',
9678         `out' and when apropriate `okerr' and `err' in the directory
9679         `testSubDir' when executed. The compare of `ok' and `out'
9680         (and of `okerr' and `err') will be the exit status of the test.
9681         `out' must match `ok' (and `okerr' must match `err') for the test
9682         to be succesful.
9684         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
9685         the tests generated by tests/get-them getting it input normally
9686         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
9687         (dot) before the numeric part) is reserved for all other (hand
9688         written) tests. The `+' means one or more times.
9690 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9692         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
9693         supported short man page to refer to info documentation
9694         * helptoman.pl: added
9695         * configure.in: AC_PATH_PROG(PERL,perl)
9696         * Makefile.am (SUBDIRS): doc after src
9698         * libitized with libit 0.5 from
9699         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
9701         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
9702         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
9703          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
9704         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
9705           lib/rx.{c,h}: added
9706         * configure.in (AC_CHECK_FUNC): getopt_long
9708         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
9710         * TODO: added entry about dependencies
9712 1998-08-10  René Seindal  <rene@seindal.dk>
9714         * Prerelease 1.4f
9716         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
9717         "changesyntax".
9719         * src/builtin.c (m4_changesyntax): Added builtin macro
9720         "changesyntax" to modify the syntax table.
9722         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
9723         table.  All categories are assigned a syntax code and tokens are
9724         read according to this table.
9726 1998-08-09  René Seindal  <rene@seindal.dk>
9728         * src/numb.{c,h}: New files, implements multiple precision eval
9729         using GNU gmp.  Originally submitted by John Gerard Makecki
9730         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
9732         * doc/m4.texinfo (Eval): Added documentation for multiple
9733         precision arithmetic library support.
9735         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
9736         to accommodate multiple precision eval.
9738 1998-08-07  René Seindal  <rene@seindal.dk>
9740         * src/input.c (MATCH, match_input), src/m4.h: changed definition
9741         of comment and quote strings to `unsigned int' to allow eight bit
9742         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
9744         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
9745         patch from Mike Howard <mike@clove.com>
9747 1998-08-06  René Seindal  <rene@seindal.dk>
9749         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
9750         -lintl.
9752 1998-08-03  René Seindal  <rene@seindal.dk>
9754         * Prerelease 1.4e
9756         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
9757         and _ macro.  M4 now builds with --disable-nls.
9759         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
9760         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
9762         * configure.in (ALL_LINGUAS): Added complete list of translations:
9763         de fr it ja nl ru sv.
9765 1998-05-23  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9767         * po/nl.po: Dutch translation by Erick Branderhorst.
9769         * po/fr.po: French translation by Erick Branderhorst, based on the
9770         translations by François Pinard in fr.msg and m4.cod.
9772 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
9774         * Prerelease 1.4d.
9776         * src/m4.c: #include <signal.h> not <sys/signal.h>.
9778         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
9780         * checks/Makefile.am: explicit list tests in CHECKS.
9782         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
9783         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
9784         mkinstalldirs, install-sh: Added automake (1.3) support.
9786         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
9787         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
9788         Used libitize (0.4) to update.
9790         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
9791         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
9792         README accordingly.
9794         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
9795         stack overflow functionality.
9797 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
9799         * Prerelease 1.4.1.
9801         * Makefile.in (realclean-local): Delete stamp-h.in.
9803         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
9804         Localize, adapting from how it is done in sharutils.
9806         * fr.tt: New file, for French.
9808         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
9809         src/freeze.c: Rename PRODUCT to PACKAGE.
9811 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
9813         * configure.in: Check for <libintl.h> and <locale.h>.
9814         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
9815         src/stackovf.c: Rename _ to __P.
9816         * src/m4.h: Declare _ as a macro returning its argument, or else,
9817         include <libintl.h> and declare _ as gettext.
9818         * src/m4.c: Possibly include <locale.h> and call setlocale.
9819         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
9820         src/input.c, src/macro.c, src/output.c, src/path.c,
9821         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
9822         strings.
9824 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
9826         * doc/Makefile.in (stamp-vti): Use new -r option to date.
9828         * configure.in: Put --with-gmp in place, in prevision for John
9829         Gerard's work.
9830         * acconfig.h: Document WITH_GMP.
9832 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
9834         * Release 1.4.
9836         * doc/Makefile.in (realclean): Also remove stamp-vti.
9837         Reported by Eric Backus.
9839 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
9841         * src/freeze.c (produce_frozen_state): If the frozen file cannot
9842         be opened, return immediately after producing the error message.
9843         Reported by Andreas Schwab.
9845         * configure.in: Check for const only after having found possible
9846         ANSIfying compiler flags, this is of no use to check it before.
9847         Reported by Alexander Lehmann.
9849 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
9851         * src/macro.c (collect_arguments): Cast obstack arguments to
9852         (voidstar), so avoiding compiler warnings.
9853         Reported by Joseph E. Sacco.
9855         * src/freeze.c (produce_frozen_state): Cast printed lengths to
9856         (int) so they correspond to %d format items.
9857         Reported by Joseph E. Sacco.
9859         * src/m4.c (main): Cast the argument to xfree to (voidstar).
9860         * src/symtab.c (free_symbol): Idem.
9861         Reported by Karl Vogel.
9863 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
9865         * Makefile.in (DISTFILES): Distribute BACKLOG.
9867         * configure.in: Define PRODUCT and VERSION.
9868         * acconfig.h: Document PRODUCT and VERSION.
9869         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
9870         constant string m4 and variable or parameter named version.
9872 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
9874         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
9875         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
9876         defines __STDC__ to 0, for indicating it is *not* ANSI!
9877         Reported by Kaveh R. Ghazi.
9879         * configure.in: Added obsolescent tests for AIX and Minix.
9881         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
9882         which texclean does not exist anymore.
9883         Reported by Eric Backus, Jim Meyering, John David Anglin and
9884         Joseph E. Sacco.
9886 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
9888         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
9889         Reported by John David Anglin.
9891         * src/ansi2knr.c: New version, sent by Peter Deutsch.
9892         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
9893         ANSI2KNR, depending on the fact the compiler is ANSI or not.
9894         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
9895         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
9896         of $U, put underline in extensions rather than in basenames.  Use
9897         implicit rules, now that regularity makes this possible.
9898         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
9899         of ansi2knr whenever it is needed.
9900         * configure.in: Adjusted for correct STACKOVF substitution.
9901         * src/debug.c (trace_format): When not __STDC__, use (...) as a
9902         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
9903         Reported by David MacKenzie.
9905         * Makefile.in: Remove binprefix.  Use transform_name instead.
9906         Reported by David MacKenzie.
9908         * doc/Makefile.in: Create version.texi, use it, clean it.
9909         Reported by Jim Meyering.
9911 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
9913         * Makefile.in (all, install, uninstall): Depend on Makefile.
9915         * Makefile.in: For actions invoking $(MAKE) from within compound
9916         sh statements, exit non-zero if the sub-make fails.  Otherwise,
9917         the top-level make may exit successfully when it should fail.
9918         Reported by Jim Kingdon.
9920         * {,/*}Makefile.in: Use && after all cd, in case they fail.
9922         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
9923         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
9924         * configure.in: Substitute PRODUCT and VERSION.
9926         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
9928 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
9930         * Makefile.in (mostlyclean-local): Do not remove *~.
9931         * */Makefile.in (mostlyclean): Idem.
9932         Reported by Robert E. Brown and Richard Stallman.
9934 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
9936         * src/m4.h: Get rid of CONFIG_BROKETS.
9938 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
9940         * configure.in: Use AC_ARG_PROGRAM.
9941         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
9942         Reported by David MacKenzie.
9944 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
9946         * configure.in: Do not add -O to CFLAGS for GNU C, now that
9947         configure does it automatically.
9948         Reported by Jim Meyering.
9950 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
9952         * src/stackovf.c: Declare the handler_t typedef earlier in the
9953         code, use it for stackovf_handler.
9954         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
9955         casting sigsegv_handler.
9956         Reported by Robert Bernstein.
9958         * src/m4.c (main): Initialize program_name to argv[0] without
9959         basename'ing it.
9960         Reported by Karl Berry.
9962 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
9964         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
9965         Reported by Karl Berry.
9967 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
9969         * lib/Makefile.in (mostlyclean): Added.
9970         (TAGS): Make in $(srcdir).
9972         * configure.in: Use `choke me' in test, like everywhere!
9974         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
9975         unreacheable and useless.
9977         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
9979         * lib/Makefile.in (DISTFILES): Distribute TAGS.
9980         (distclean): Do not remove TAGS.
9981         (realclean): Remove it.
9982         * Makefile.in: Make TAGS in lib also, not just in src.
9983         Reported by Karl Berry.
9985         * Makefile.in (distclean, realclean): Instead of recursively
9986         calling $(MAKE) for the -local part, allow parallel execution of
9987         -recursive and -local, only delay the removal of config.status,
9988         which is repeated in both goals.
9990 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
9992         * Release 1.3.
9994         * Makefile.in: Group all *clean-recursive goals in one, using sed
9995         to remove `-recursive' while calling make recursively.  Also, use
9996         a subshell for each recursive $(MAKE).
9997         Reported by Jim Meyering.
9999         * src/m4.h (memcpy): Define with bcopy for BSD systems.
10000         Reported by Kaveh R. Ghazi.
10002         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10003         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10004         specify it.
10006         * configure.in: Use date instead of touch for stamp-h.
10007         * Makefile.in (stamp-h.in): Idem.
10009         * Makefile.in (distclean, realclean): Force serial execution of
10010         both goals, in case parallel makes are being used.
10011         Reported by Jim Meyering.
10013         * src/Makefile.in (DISTFILES): Distribute TAGS.
10014         (distclean): Do not remove TAGS.
10015         (realclean): Remove it.
10016         Reported by Karl Berry.
10018 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
10020         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
10021         to old names, for following Autoconf.
10023 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
10025         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10026         ./install.sh will not be correctly referred to in sub-Makefiles.
10027         Reported by John David Anglin.
10029         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10030         Reported by Eric Backus.
10032         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10033         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10034         config.status into remaking this directory's Makefile only.
10035         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10036         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10037         Reported by Jim Meyering.
10039 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
10041         * configure.in: Correct stack overflow detection logic, taking
10042         care of systems having only incomplete implementations (like for
10043         Pyramid 9820 OSx 5.0d).
10044         Reported by Kaveh R. Ghazi.
10046         * src/Makefile.in (TAGS): Remote -t from etags call.
10048 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
10050         * lib/Makefile.in (install): Depend on all.
10052 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
10054         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
10055         Reported by Jim Meyering and John David Anglin.
10057         * Makefile.in (distclean-local): Delete config.log.
10058         Reported by Jim Meyering.
10060         Solidify frozen files with respect to -P:
10061         * src/m4.c: Have -P set prefix_all_buitins variable instead of
10062         calling a function by that name.  Declare the variable.
10063         * src/m4.h: Adjust declaration for prefix_all_buitins.
10064         * src/builtin.c (builtin_init): Merge in functionality from
10065         previous prefix_all_buitins function, while making entries in the
10066         symbol table, but not modifying the builtin description itself.
10068         * src/freeze.c (reload_frozen_state): Add a useless `break;',
10069         because *many* compilers do not accept an empty `default:'.
10070         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
10071         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
10073         * configure.in: Use AC_TYPE_SIGNAL.
10074         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
10075         Reported by Robert Bernstein.
10077         * checks/Makefile.in (check): Modify PATH so check-them will find
10078         m4 in the src directory.
10079         * Makefile.in (check): Don't.
10080         Reported by Akiko Matsushita and Jim Meyering.
10082         * src/output.c (make_room_for, output_character_helper): New
10083         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
10084         a per buffer MAXIMUM_BUFFER_SIZE.
10086         * src/output.c (output_text): New function, for optimizing the
10087         output of strings of characters.  Use it.
10089 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
10091         * doc, src: New directories reorganizing the distribution.
10092         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
10093         files.
10094         * Makefile.in: Adjusted.
10095         * configure.in: Configure new Makefiles.
10097         * m4.h: Declare STRING typedef.  Use it for comment and quote
10098         strings, adjusting all references.  (This is the rudiments of a
10099         beginning for the eventual withdrawal of NUL terminated strings.)
10100         * output.c (shipout_text): Accept a length parameter, and use it.
10101         All callers adjusted.
10103 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
10105         * m4.h: Include <unistd.h> if it exists.
10106         * stackovf.c: Don't.
10108         Clean up for current_diversion variable:
10109         * output.c: Move current_diversion from builtin.c.
10110         * m4.h: Declare current_diversion so builtin.c can access it.
10111         * output.c (output_init, make_diversion): Initialize or update
10112         current_diversion.
10113         * builtin.c (builtin_init, m4_divert): Leave current_diversion
10114         alone.
10116         Remove limit on number of diversions:
10117         * output.c: Replace ndiversion by diversions, declare it.
10118         (output_init): Allocate only diversion 0.
10119         (make_diversion): Allocate new diversions as needed.
10120         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
10121         * m4.c: Still accept -N, but do nothing with it.
10122         Reported by David MacKenzie.
10124         Freeze diversions:
10125         * output.c (freeze_diversions): New function.
10126         * m4.h: Declare freeze_diversions.
10127         * freeze.c: Document frozen file format, revise it, call
10128         freeze_diversions to add diversions to frozen format, and code to
10129         reload them properly.
10130         * m4.c: Do not undivert automatically at end when status being
10131         frozen.  Do not call builtin_init when reloading frozen state.
10133         Speed up diversion processing:
10134         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
10135         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
10136         structure and variables, cached variables out of output_diversion,
10137         reallocate_diversion_for and OUTPUT_CHARACTER.
10138         (shipout_text, make_diversion, insert_diversion): Adapted to new
10139         structures.
10140         (insert_file): Use better buffering.
10141         Reported by David MacKenzie.
10143 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
10145         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
10146         dist works from another build directory.
10148 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
10150         * symtab.c (hack_all_symbols): Use hash_table_size instead of
10151         constant HASHMAX, for -H option to work better.
10153         * builtin.c (DECLARE): Simplify by using _ ().
10155         * freeze.c: New file.
10156         * Makefile.in: Compile it, distribute it.
10157         * m4.c: Recognize, document and process --freeze-state (-F) and
10158         --reload-state (-R) options.  Pass a true flag to builtin_init
10159         only if no reloading some state.
10160         * builtin.c (define_builtin): Remove static specifier.
10161         (find_builtin_by_name): Remove static specifier.
10162         (builtin_init): Accept and obey a flag argument.
10163         * m4.h: Add declarations for freeze.c, changes for builtin.c.
10165 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
10167         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
10168         specifier.
10170         * configure.in: Implement --with-dmalloc.
10171         * acconfig.h: Document WITH_DMALLOC.
10172         * m4.h: Add code for when WITH_DMALLOC.
10174 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
10176         * m4.c (long_options): Use "error-output", the dash was missing.
10177         Reported by Akiko Matsushita.
10179 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
10181         * m4.h: Include <sys/types.h>.
10182         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
10183         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
10184         int.
10185         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
10186         as size_t, not int.
10187         * builtin.c (dump_args): Declare len as size_t, not int.
10189         * debug.c: Prototype the forward declaration of debug_set_file.
10191         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
10192         shadowing of this variable.
10193         * output.c (insert_diversion): Idem.
10195         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
10196         (input_init): Duplicate default quote and comment strings.
10197         (set_quotes): Free previous quote strings in all cases.  Duplicate
10198         even default quote strings.
10199         (set_comment): Free previous comment strings in all cases.
10200         Duplicate even default comment strings.
10202         * configure.in: Updated for Autoconf 2.0.
10203         * Makefile.in (distclean-local): Also delete config.cache.
10205         * m4.c (usage): Reorganize the --help output by topic.  Include a
10206         description for debugging flags.
10208 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
10210         * configure.in: If sigaction is available and SA_ONSTACK defined,
10211         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
10212         defined, use sigvec.  Else don't compile stackovf.c.
10213         * stackovf.c (setup_stackovf_trap): Idem.
10214         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
10215         and Simon Leinen.
10217 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
10219         * m4.c (usage): Replace printf par fputs.
10221 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
10223         * Release 1.2
10225 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
10227         * configure.in: Check for sigaction and sigvec.  Add a new delayed
10228         check for RLIMIT_STACK, combine in the checking for getrlimit.
10229         All those things are not universally available.
10230         * stackovf.c: Split setting up the trap handler and catching
10231         signals, for better taking care of various configure outcomes.
10232         * examples/stackovf.sh: Correct a typo.
10233         Reported by Eric Backus, Jim Avera and Jim Meyering.
10235 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
10237         * ansi2knr.c: New version sent by its author, Peter Deutsch.
10239 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
10241         * Makefile.in: Modify so parallel make will not try making
10242         lib/libm4.a twice simultaneously.
10243         Reported by Jim Meyering.
10245 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
10247         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
10248         error message, for when no code possibility exists.  Even if this
10249         line is completely #ifdef'ed out, it brings a syntax error.
10250         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
10252         * Makefile.in (install): Have install depend on all too, for lib
10253         to be remade as needed.
10255         * examples/stackovf.sh: Try ksh, bsh and bash for shells
10256         providing ulimit, instead of using only ksh.
10257         Reported by Jim Avera and Joseph E. Sacco.
10259 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
10261         * Makefile.in (check): Have it depend on all instead of m4.  In
10262         this way, a change in lib will be detected and processed.
10264         * builtin.c (numeric_arg): Use strtol and verify the conversion,
10265         instead of using sscanf which stops as soon as there is a
10266         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
10267         and divert(1xyzzy) were all accepted without any warning or error
10268         messages.
10269         * m4.h: Declare strtol as long if not including stdlib.h.
10270         * configure.in: Check for limits.h, and replace strtol if missing.
10271         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
10272         * lib/strtol.c: New file, from elsewhere.
10273         Reported by Andreas Schwab.
10275 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
10277         * macro.c (expand_macro): Cast value to (boolean) prior to
10278         assigning it to traced.
10279         Reported by Tom McConnell.
10281         * Makefile.in (m4): Always make all in lib first.
10282         Reported by Jim Meyering.
10284 1994-07-06  Jim Avera <jima@netcom.com>
10286         * stackovf.c: Isolated OS-dependent sections; Improved portability,
10287         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
10288         handlers), and a default error message if the fault address is not
10289         available (when neither siginfo.h nor BSD sigcontext are supported).
10290         * configure.in: Changes for stackovf.h: Check for sigcontext,
10291         sigaction, sigstack, and define rlim_t as int if necessary.
10292         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
10293         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
10294         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
10296 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
10298         * configure.in: Use AC_SET_MAKE.
10299         * Makefile.in: Use @SET_MAKE@.
10300         Reported by Jim Meyering.
10302         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
10303         Reported by Ian Taylor.
10305 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
10307         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
10308         because siginfo.h is unrelated to standard headers, and siginfo.h
10309         is already checked for.
10310         Reported by Joseph E. Sacco.
10312         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
10313         PROTOTYPES.
10314         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
10315         AC_PROTOTYPES.
10317 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
10319         * builtin.c (substitute): Use \& to represent this part of the
10320         string which was matched by the whole regexp, instead of
10321         representing the whole string.  Any usage of \0 issues a warning
10322         and acts like \&, it will disappear in some subsequent release.
10324 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
10326         * m4.c: Complete prototype for forwarded declaration of usage.
10328         * input.c (init_macro_token): Correct own reference in error
10329         message.  Previous name get_macro_func was referred to instead.
10330         (next_char):  Correct own reference in error message.  Previous
10331         name advance_input was referred to instead.
10333         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10334         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10335         and_term, not_term, logical_not_term, cmp_term, shift_term,
10336         add_term, mult_term, exp_term, unary_term, simple_term): Add
10337         prototype to forwarded declarations.  Declare parameter v1 as
10338         eval_t * instead of int *.  Same for local variable v2 in dyadic
10339         functions.  Same for result in exp_term.
10340         * builtin.c (m4_eval): Declare value as eval_t instead of int.
10341         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
10342         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
10343         (shipout_int): Cast first argument of ntoa to eval_t.
10344         Reported by Thorsten Ohl.
10346         * macro.c: Complete the prototypes of forwarded expand_macro and
10347         expand_token.
10348         Reported by Thorsten Ohl.
10350         * m4.h: Define voidstar as void * or char * depending on __STDC__.
10351         The Ultrix 3.1 compiler cannot do much with void pointers.
10353         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10354         * m4.c (xfree):  Replace void * by voidstar.
10355         Reported by Tom McConnell.
10357         * ansi2knr.1: New, from elsewhere.
10358         * Makefile.in (DISTFILES): Distribute ansi2knr.1
10360         * Makefile.in (stamp-h.in): Avoid running ./config.status if
10361         stamp-h does not exist yet.  This avoids running it a second time
10362         just after the initial ./configure.
10363         Reported by David MacKenzie and Tom McConnell.
10365         * m4.h: Replace the enum debug_info declaration with a series of
10366         #define's.  The Ultrix 3.1 compiler would otherwise need casting
10367         (int) to most references, when used in expressions.
10368         Reported by Tom McConnell.
10370 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
10372         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
10373         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
10374         calls the compiler.  Previously, FP_PROTOTYPES was only calling
10375         the preprocessor; by not being subject to CFLAGS, this was
10376         discouraging those flags asking for ANSI compilation.
10377         * acconfig.h: Document HAVE_PROTOTYPES.
10378         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
10379         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
10380         Reported by Eric Backus.
10382         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
10383         from the environment.  Default CFLAGS to -g if not set.
10384         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
10385         * lib/Makefile.in: Have CFLAGS substituted from configure.
10386         Reported by Eric Backus and Tom McConnell.
10388         * configure.in: m4_undefine changeword before using AC_ENABLE.
10390         * m4.h: Declare prototypes for error (for ANSI compilers only),
10391         prefix_all_builtins and reference_error.
10392         Reported by Tom McConnell.
10394         * input.c (set_word_regexp): Do not try to initialize the array
10395         test from a string, this does not work with non-ANSI compilers.
10396         Reported by Eric Backus.
10398         * Makefile.in (dist): Clean examples/ before saving it.
10399         (distclean-local): Also remove stamp-h.
10400         Reported by Eric Backus.
10402         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
10403         non ANSI compilers.
10404         Reported by Tom McConnell.
10406         * checks/Makefile.in (clean): Depends on mostlyclean.
10407         (mostlyclean): New goal.
10409 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
10411         * Makefile.in (DISTFILES): Distribute install.sh.
10412         * install.sh: New file, copied from elsewhere.
10413         Reported by Assar Westerlund and Kaveh R. Ghazi.
10415 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
10417         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
10418         * acconfig.h: Explain ENABLE_CHANGEWORD.
10420         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
10421         from code provided by Pete Chown]
10422         * m4.h: Add original_text field to u_t variant of union u.
10423         Declare TOKEN_DATA_FUNC macro.
10424         * builtin.c: Declare changeword.
10425         (m4_changeword): New function.
10426         * input.c: Include "regex.h", define variables with word regexps.
10427         (input_init): Initialize the word regexp.
10428         (set_word_regexp): New.
10429         (next_token): Declare local variables, use the previous code if
10430         default_word_regexp is true.  Else, match using a new code.  Save
10431         the original text.
10432         * macro.c (expand_token): Ship out original text if not a macro
10433         name.
10434         Reported by Krste Asanovic and Pete Chown.
10436         [These modifs all depend upon ENABLE_CHANGEWORD]
10437         * m4.h: Declare external user_word_regexp.
10438         * m4.c: Declare user_word_regexp, and initialize it from
10439         --word-regexp or -W, or NULL if not specified.
10440         * input.c: Use user_word_regexp if specified, instead of
10441         DEFAULT_WORD_REGEXP.
10443         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
10444         agree with it.
10446         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
10447         * checks/Makefile.in: Empty the suffix list.
10448         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
10450         * m4.c: Declare nesting_limit and initialize it to 250.
10451         Implement -LNUMBER or --nesting-limit=NUMBER to change its
10452         value.
10453         * m4.h: Declare nesting_limit as external.
10454         * macro.c (expand_macro): Stop execution whenever nesting limit
10455         is exceeded.
10456         Reported by Bengt Mertensson.
10458         * eval.c (evaluate): Diagnose excess characters in eval input.
10459         Things like `eval(08)' used to return 0 with no diagnostic.
10461         * m4.h: Capitalize first letter of all macro arguments in
10462         definitions.
10464         * m4.c: Declare warning_status, initialize it to 0.  Add new
10465         option -E, or --fatal-warnings, which sets warning_status to
10466         EXIT_FAILURE instead.
10467         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
10468         EXIT_FAILURE if not otherwise done by header files.
10469         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
10470         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
10471         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
10472         argument of all M4ERROR calls.
10473         Reported by Noah Friedman.
10475         * examples/incl-test.m4: Renamed from incl_test.m4.
10476         * examples/include.m4: Include incl-test.m4 instead of
10477         incl_test.m4.
10478         * examples/multiquotes.m4: Renamed from multi-quotes.m.
10480 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
10482         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
10483         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
10484         also tested it on a Sun Sparc workstation running SunOS 4.x.
10486         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
10487         49.format check, abusing a `union values' argument with sprintf
10488         without selecting the proper field.  Now, save the formatting type
10489         first, delaying the fetch of the corresponding argument.
10490         Reported by Joseph E. Sacco and Tom Quinn.
10492         * format.c (format): Remove const from char *fmt declaration when
10493         not HAVE_EFGCVT, because a NUL may be forced into it.
10495         * m4.h: Declare atof() when not STDC_HEADERS.
10496         Reported by Joseph E. Sacco.
10498         * Regenerate configure using Autoconf 1.11, this corrects a
10499         problem about an incorrect cpp seting on NeXT 3.1.
10500         Reported by Alexander Lehmann.
10502 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
10504         * m4.h (_): Change argument from `x' to `Args'.
10506 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
10508         * m4.h: Rename Args() to _().
10509         * m4.h: Remove extern specifier from all function declarations.
10511 1994-04-22  Jim Avera <jima@netcom.com>
10513         * stackovf.c: New file implementing stack-overflow detection.
10514         * configure.in: Check for getrlimit, sigaction.  If all of
10515         standard headers, getrlimit and sigaction, define USE_STACKOVF and
10516         substitute ${U}stackovf.o for STACKOVF.
10517         * acconfig.h: Declare USE_STACKOVF.
10518         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
10519         * m4.h: Declare setup_stackovf_trap().
10520         * m4.c: Call setup_stackovf_trap().
10521         * tests/stackovf_test.sh: New file.
10523 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
10525         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
10527         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
10529 1994-01-30  François Pinard  <pinard@iro.umontreal.ca>
10531         * m4.h: Remove definition of volatile, not used anymore.
10532         Reported by Jim Meyering and Joseph E. Sacco.
10534         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
10535         of `if ... else /* nothing */' for if macros.
10536         Reported by Jim Meyering.
10538         * builtin.c (m4_regexp): Reorganize the code for avoiding a
10539         warning from gcc about `repl' possibly used before defined.
10540         Reported by Jim Meyering.
10542         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
10543         Reported by Jim Meyering.
10545 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
10547         * m4.h: Move the conditional definition of volatile after the
10548         inclusion of system files, because they may define it first.
10550 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
10552         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
10553         get around a problem with Alpha make seeing a syntax error, there.
10554         Reported by Vern Paxson.
10556 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
10558         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
10559         Reported by Richard Stallman.
10561 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
10563         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
10564         instead of AC_HAVE_FUNCS.
10565         Reported by Noah Friedman.
10567 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
10569         * m4.c: Initialize show_help and show_version to zero.
10571         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
10572         Use them in exit() and usage() calls.
10574 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
10576         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
10577         syserr() macro.  Delete errref, add reference_error and M4ERROR.
10578         * m4.c: Replace errref, which was returning an input reference
10579         string, with reference_error, which prints it on standard error.
10580         * builtin.c, output.c: Use errno as second parameter to error,
10581         instead of using syserr() with %s.
10582         * *.c: Use M4ERROR instead of error: no more errref() with %s.
10583         Doing so, the program name appears after the input reference
10584         instead of before, which eases M-x next-error processing.
10586 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
10588         * checks/get-them: Escape braces with backslashes in patterns,
10589         because HPUX-9.01 awk needs this.
10590         Reported by Jim Meyering.
10592 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
10594         * builtin.c: Declare "FILE *popen ();".
10596         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
10597         macros, replace error_message_prefix() declaration by errref()'s.
10598         Declare xrealloc, for use in errref().
10599         * m4.c: Delete error_message_prefix() function, add errref().
10600         * *.c: Use error() systematically in place of all error macros,
10601         now that error() flushes stdout first.  Make needed adjustments.
10603         * m4.h: Remove const in sys_errlist[] declaration, it creates
10604         conflicts on SGI and Alpha.
10605         Reported by Kaveh R. Ghazi.
10607 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
10609         * m4.c: Include <getopt.h> instead of "getopt.h".
10611         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
10612         * acconfig.h: New, for documenting HAVE_EFGCVT.
10613         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
10614         use them wherever appropriate.  Also use -I. for compilations.
10615         * lib/Makefile.in: Use -I.. for compilations.
10616         * *.c: Include <config.h> or "config.h".
10618         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
10619         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
10621 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
10623         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
10625         * input.c (input_init): Initialize quote and comment strings
10626         explicitely instead of calling set_quotes and set_comment: by
10627         doing so, we ensure we do not free uninitialized variables.
10629         * checks/check-them: Reverse arguments to both diff, so the
10630         expected is on the left and the obtained on the right.
10632         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
10633         macros. Delete declarations for m4error, warning, fatal and
10634         internal_error, add declaration for error_message_prefix.
10635         * m4.c:  Delete m4error, warning, fatal and internal_error
10636         routines, add error_message_prefix routine.
10637         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
10638         warning with WARNING*, fatal with FATAL* and internal_error with
10639         INTERNAL_ERROR*.
10640         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
10641         this is not needed anymore.
10643         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
10644         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
10645         and debug_message, add declaration for debug_message_prefix.
10646         * debug.c: Remove static specifier for FILE *debug declaration.
10647         Delete debug_print and debug_message routines, add
10648         debug_message_prefix routine.
10649         * builtin.c, debug.c: Replace debug_print routine calls with
10650         DEBUG_PRINT* macro calls.
10651         * input.c, path.c: Replace debug_message routine calls with
10652         DEBUG_MESSAGE* macro calls.
10654         * m4.h: Remove inclusion of <varargs.h>.
10655         * debug.c: Include <stdarg.h> or <varargs.h>.
10656         (trace_format): Use stdarg instead of varargs if __STDC__.
10658         * configure.in: Remove checks for vfprintf and _doprnt.  These
10659         implementations use varargs tricks which are not portable enough.
10660         * lib/vfprintf.c: Deleted.
10661         * lib/_doprnt.c: Deleted.
10662         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
10663         Reported by Joel Sherrill.
10665         * path.c (add_include_directory): Use xstrdup.
10667         * builtin.c (find_builtin_by_name): Declare static.
10669         * *.[ch]: Add const to a few "char *" declarations.
10671         * configure.in: Remove commented tests for fileno() and fstat().
10672         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
10674         * debug.c (debug_flush_files): New.
10675         * m4.h: Declares it.
10676         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
10677         Reported by Nicolas Pioch.
10679 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
10681         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
10682         Reported by Joel Sherrill.
10684         * builtin.c (prefix_all_builtins): Instead of the table size, use
10685         the null entry at end for stopping the loop.  It was overwritten.
10686         Reported by Andreas Schwab and Jim Meyering.
10688         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
10689         Reported by Kaveh R. Ghazi.
10691         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
10692         Reported by Karl Vogel.
10694 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
10696         * m4.h: Do not define volatile if already defined.
10697         Reported by René Seindal.
10699         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
10701         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
10702         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
10704 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
10706         * m4.h: Define strchr and strrchr in terms of index and rindex,
10707         instead of the other way around.
10708         * builtin.c, m4.c, path.c: Use strchr instead of index.
10710         * input.c (next_char): Remove a "break;" after a "return ...;".
10711         Reported by Tom McConnell.
10713 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
10715         * Release 1.1
10717         * configure.in: Do not copy check files in the build hierarchy.
10718         * checks/check-them: Identify the m4 version being checked.  For
10719         finding m4, look in $PATH instead of in the parent directory.
10720         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
10721         * checks/Makefile.in (.all-stamp): Always create check files in
10722         the source hierarchy, not anymore in the build hierarchy.
10723         (check): cd to the source hierarchy before performing checks.
10724         Do not copy nor clean COPYING anymore, take it from `..'.
10725         Reported by Tom McConnell.
10727         * Makefile.in (Makefile): Use $(SHELL).
10728         (config.status): Use $(SHELL).  Use "config.status --recheck"
10729         instead of "configure --no-create", which is obsolete.
10730         Reported by Tom McConnell.
10732 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
10734         * m4.c (usage): Use "%s" instead of "m4" in format string.
10735         Reported by Jim Meyering.
10737         * Makefile.in: Distribute mkinstalldirs.
10738         Reported by Pierre Gaumond.
10739         Reported by Jim Meyering.
10740         Reported by Tom McConnell.
10741         Reported by Andreas Gustafsson.
10743         * checks/check-them: Renamed from checks/check_them.
10744         * checks/get-them: Renamed from checks/get_them.
10745         * checks/.all-stamp: Renamed from checks/.all_stamp.
10746         * checks/Makefile.in: Changed accordingly.
10747         Reported by Jim Meyering.
10749 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
10751         * lib/Makefile.in (dist): Correct permissions on files.
10753         * output.c: Declare tmpfile, some systems don't.
10755 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
10757         * checks/Makefile.in (dist): Correct permissions on files.
10759         * Makefile.in (dist): Ensure recursive linking for subdirectory
10760         `examples', also set read/write permissions on all its files.
10762         * mkinstalldirs: New, from elsewhere.
10763         * Makefile.in: Use it.
10765         * debug.c: Synchronize debug messages and regular output when
10766         the debug file and stdout are redirected to the same file.
10767         * configure.in: Add (commented) checks for fileno and fstat.
10768         Reported by Jim Avera.
10770         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
10771         etc., arguments, then ignore the superfluous one.  m4 used to
10772         diagnose missing arguments and return the empty string.
10773         Reported by Nick S. Kanakakorn.
10775 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
10777         * m4.c (main): At end of all input, ensure all undiverted text
10778         goes to the main output stream.
10779         Reported by Andreas Gustafsson.
10781         * m4.c (main): exit (0), instead of return 0.
10783         * m4.c: Implement -P and --prefix-builtins.
10784         * builtin.c: Delete const specifier on builtin_tab.
10785         (prefix_all_builtins): New.
10786         Reported by Noah Friedman.
10787         Reported by Scott Bartram.
10789         * c-boxes.el: New, from elsewhere.
10790         * Makefile.in: Distribute it.
10792         * m4.h: Do not define bcopy if <string.h> defines it.
10793         Reported by Stephen Perkins.
10795         * builtin.c (define_macro): Allow a missing second argument, in
10796         which case it is implied empty.  Affects define and pushdef.
10797         Reported by Eric Allman.
10799 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
10801         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
10802         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
10803         * builtin.c: Initialize all the blindness fields in builtin_tab.
10804         (define_builtin): Copy the blindness of a builtin into its symbol.
10805         * macro.c (expand_token): Avoid processing a blind builtin if the
10806         next character is not an opening parenthesis.
10807         Reported by David MacKenzie.
10808         Reported by Noah Friedman.
10810         * configure.in: Ensure an exit status of 0 on completion.
10811         Reported by Vivek P. Singhal.
10813         * eval.c (eval_lex): Admit both lower and upper case letters for
10814         bases greater than 10.  Only lower case letters were accepted.
10816         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
10817         Reported by Krste Asanovic.
10819         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
10820         * eval.c (logical_not_term): New name for not_term.
10821         * eval.c (xor_term): New, between or_term and and_term.
10822         * eval.c (not_term): New, between and_term and logical_not_term.
10823         * eval.c (shift_term): New, between cmp_term and add_term.
10824         Reported by Krste Asanovic: ~, ^, <<, >>.
10825         Reported by Ben A. Mesander: ** vs ^.
10827         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
10828         * m4.h: Delete xrealloc.c.
10829         * lib/xmalloc.c: New, from elsewhere.
10830         * lib/xstrdup.c: New, from elsewhere.
10831         * lib/Makefile.in: Distribute and compile them.
10833         * m4.c: Change progname to program_name.
10834         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
10835         * lib/error.c: New, from elsewhere.
10836         * lib/Makefile.in: Distribute and compile error.c.
10837         * configure.in: Check AC_VPRINTF and for strerror.
10838         * m4.c: Delete cmd_error.  Use error instead.
10839         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
10841         * m4.h: Delete #define const, let Autoconf takes care of this.
10843         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
10844         Merge parse_args into main.  Declare argv to be `char *const *',
10845         then remove superfluous casts.
10847         * m4.c: Rename --no-gnu-extensions to --traditional.
10848         Reported by Ben A. Mesander.
10850         * m4.c (usage): Add a status parameter.  Supply one in various
10851         calls.  Add --help processing.  Remove -V for --version.
10853         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
10855         * lib/Makefile.in: Have an AR=ar declaration.
10856         Reported by Eric Backus.
10857         Reported by Bjorn R. Bjornsson.
10858         Reported by Tom Tromey.
10859         Reported by Kristine Lund.
10860         Reported by Marion Hakanson.
10862 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
10864         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
10865         Reported by Noah Friedman.
10867 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
10869         * Makefile.in: Remove MDEFINES and cleanup.
10871 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
10873         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
10874         Create a gzip file.
10876 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
10878         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
10879         ensure 777 mode for directories, so older tar's will restore file
10880         modes properly.
10882 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
10884         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
10885         so the installer can override automatically configured choices.
10886         Reported by Karl Berry.
10888 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
10890         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
10891         previous version was not working properly on m68k-hp-bsd4.3.
10892         Reported by Roland McGrath.
10894         * lib/_doprnt.c: Stolen from Oleo distribution.
10895         * configure.in: Check for _doprnt.c if vfprintf.c selected.
10896         * lib/Makefile.in: Distribute _doprnt.c.
10897         Do not distribute regex.[ch].old anymore.
10899 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
10901         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
10902         Richard wants it there.
10904 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
10906         * Makefile.in: Add DEFS to MDEFINES.
10907         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
10908         (libm4.a): Remove the library before creating it.
10909         (distclean): Remove tags and TAGS too.
10911 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
10913         * Makefile.in (dvi, m4.dvi): New goals.
10915         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
10916         macro.c, output.c, path.c, symtab.c: Change Copyright from
10917         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
10919         * examples/divert.m4: Deleted, this bug has been corrected.
10921         * Makefile.in (texclean, mostlyclean): New goals.
10923         * Makefile.in (clean): Remove clutter from ansi2knr.
10924         Reported by Pierre Gaumond.
10926 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
10928         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
10929         might well use CFLAGS is s/he needs it.
10931         * Makefile.in: Allow installation of info files from a separate
10932         build directory.
10933         Reported by Jason Merrill.
10934         Reported by David MacKenzie.
10935         Reported by Skip Montanaro.
10936         Reported by Erez Zadok.
10937         Reported by Assar Westerlund.
10939 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
10941         * Release 1.0.3
10942         This is still a beta release for the future GNU m4 version 1.1.
10944         * lib/alloca.c: New, from elsewhere.
10945         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
10947         * m4.h: Do not define index/rindex if already defined.  If
10948         FALSE/TRUE are already defined, do not redefine them, but merely
10949         define boolean typedef to int.
10951         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
10952         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
10953         because some C compilers do not like connectives with #ifdef.
10954         * m4.h: Define `volatile' only if __GNUC__, instead of once for
10955         __GNUC__ and once for __STDC__.
10956         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
10958         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
10959         Makefile dependencies.  Without it, make keeps destroying and
10960         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
10962         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
10963         to diversion/DIVERSION, this was a spelling error.
10965         * m4.c: Declare version[], remove #include "version.h".
10966         * version.h: Deleted.
10967         * Makefile.in: Remove references to version.h.
10969         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
10970         production, by using a simpler and more robust algorithm.  This
10971         solves the problem of synclines sometimes written in the middle of
10972         an output line.  Delete sync_line() and output_lines variable.
10973         * m4.h: Remove sync_line prototype and output_lines declaration.
10974         * input.c (next_char), output.c (shipout_text): Remove references
10975         to output_lines.
10976         * input.c (push_file, pop_file): Merely put the value -1 in
10977         output_current_line instead of calling sync_line, for delaying a
10978         single `#line NUM FILE' before next output line.  Do not test
10979         for sync_output, because this is unnecessary clutter.
10980         * output.c (make_divertion, insert_divertion): Idem.
10981         * input.c: Rename must_advance_line to start_of_input_line, for
10982         consistency.
10984         * debug.c (trace_header): Select a new debug line format, which
10985         better complies with GNU standards for formatting error messages.
10986         With option `-dfl', M-x next-error might be used on the output.
10987         * m4.c (vmesg): Adjust format of error output to GNU standards.
10988         * m4.texinfo: Adjust examples for `make check' to work.
10990         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
10991         case for enum debug_info constants, which were all lower case.
10993         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
10994         re_search_2.
10995         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
10996         collected patches.  I tried a few times using newer regex.[ch], it
10997         mysteriously stopped aborting with this one.  Insecure feeling...
10998         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11000 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
11002         * m4.c: Change `--no-warnings' to `--silent'.
11003         Reported by David MacKenzie.
11005         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11006         leave it off for now.  See comment in m4.c for justification.
11007         Reported by David MacKenzie.
11009         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11010         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11012         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
11014         * Makefile.in: Ensure recursive cleaning is done before local
11015         cleaning for all clean goals.
11017         * builtin.c (ntoa): Ensure the value is always interpreted as a
11018         signed quantity, whatever the radix is.
11020 1992-11-18  Jim Meyering  <meyering@idefix>
11022         * builtin.c, format.c, input.c: Split long lines.
11023         * m4.c: Use typedef macro_definition instead of struct
11024         macro_definition.
11025         * symtab.c: Use typedef symbol instead of struct symbol.
11027 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
11029         * *.[ch]: Remove all trailing whitespace, in code and comments.
11031         * configure.in: Find some awk.
11032         * Makefile.in: Add $(AWK) to MDEFINES.
11033         * checks/Makefile.in: Transmit $(AWK) to get_them.
11034         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
11035         awk script when switching files, because without this, mawk runs
11036         out of file descriptors.
11038 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
11040         * Makefile.in (realclean): Delete m4.info*.
11041         Reported by Jim Meyering.
11043         * Makefile.in: Adjust and link with checks/Makefile.
11044         * checks/Makefile.in: New.
11045         * configure.in: Output checks/Makefile.
11047         * checks/get_them: Have the dnl header of each test more
11048         recognizable by next-error, also use a better message.
11050 1992-11-16  Jim Meyering  <meyering@idefix>
11052         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
11053         And use that only if __GNUC__ since we're using it's GCC-specific
11054         semantics that tell the compiler the associated function doesn't
11055         return.
11057         * builtin.c (substitute): Don't use character as an array index.
11058         (dumpdef_cmp): Make formal arguments `const void *' to avoid
11059         warnings with gcc -W -Wall on systems with qsort prototype.
11060         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
11061         from gcc -W -Wall.
11063         * eval.c (most functions): Add parentheses to assignments used
11064         as truth values go avoid warnings from gcc -Wall.
11066         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
11067         any functions that don't need external scope.
11069         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
11070         (many functions and arrays): Declare `const'.
11072 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
11074         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
11075         removing the declaration from m4.h.  Also rename false to FALSE
11076         and true to TRUE.
11078         * lib/Makefile.in (Makefile): New goal.
11080         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
11081         so heavily loaded.  It gets more easily overridable, calling make.
11082         Reported by Jim Meyering.
11084         * Makefile.in (dist): Get .fname from the current directory name,
11085         instead of from version.h.  I need updating many files manually,
11086         when the version changes, version.h is just one of them.
11088 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
11090         * m4.h: Remove the tag `boolean' on the enum introducing typedef
11091         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
11092         Reported by Tom McConnell.
11094 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
11096         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
11097         39.cleardiv, which were describing missing or spurious newlines.
11098         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
11099         do not depend on machine word size, `/bin/false' implementation,
11100         or `wc' output format.  `make check' is more dependable, now.
11102         * checks/check_them: Summarize the failed tests by listing their
11103         name, at end.  If none, issue `All checks successful'.  Output
11104         `Checking' instead of `Input file:'.
11106         * checks/get_them, checks/check_them: Reindented.
11108         * Makefile.in (dist): chmod a+r before making the tar file.
11110 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
11112         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
11114         * input.c (next_token): Reinitialize token_buttom just after using
11115         it as a watermark with obstack_free.  Or else, a future token, big
11116         enough for triggering reallocation of the obstack chunk, could
11117         void the initialized value of token_buttom, later causing panic in
11118         obstack_free.  Rename token_buttom to token_bottom everywhere.
11120         * m4.h: Before declaring errno, first include <errno.h> and
11121         ensure that it does not define errno.
11122         Reported by Richard Stallman.
11124 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
11126         * builtin.c: Define and use DECLARE macro for builtins.
11128         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
11129         argument, this is a common idiom for introducing long comments.
11131         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
11132         arguments.  The last argument was silently ignored.
11134         * m4.c (cmd_error): Add a missing semicolon before va_end().
11136 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
11138         * Makefile.in: Now handle protoized sources.  Define and use U.
11139         Compile and use ansi2knr with old compilers.  Update DISTFILES.
11140         Add `aclocal.m4' to `configure' dependencies.
11141         * ansi2knr.c: New, from Ghostscript distribution.
11142         * configure.in: Define U through FP_PROTOTYPES for old compilers.
11143         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
11144         * aclocal.m4: New, provide FP_PROTOTYPES.
11145         * m4.h: Conditionnaly protoized through Args, save for varags.
11146         * builtin.c: Protoized.  Then:
11147         Include <sys/types.h> if size_t is not defined, before "regex.h".
11148         (m4_ifelse): Fetch built-in name properly for diagnostic.
11149         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
11150         (m4_regexp): Add const to `msg' declaration.
11151         (m4_patsubst): Add const to `msg' declaration.
11152         * debug.c: Protoized, save for varargs.
11153         * eval.c: Protoized.
11154         * format.c: Protoized.
11155         * input.c: Protoized.
11156         * m4.c: Protoized, save for varargs.  Then:
11157         (xfree): Accept void * instead of char *.
11158         (xmalloc): Return void * instead of char *.
11159         (xrealloc): Accept and return void * instead of char *.
11160         * macro.c: Protoized.
11161         * output.c: Protoized.
11162         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
11163         * symtab.c: Protoized.
11165 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
11167         * m4.texinfo: Remove directory from diagnostics in 30.include,
11168         51.eval, 56.errprint and 57.m4exit tests.
11170         * m4.h: Remove declarations for int or void system functions, they
11171         cause more conflicting trouble than they make good.
11173         * configure.in: Avoid configuration header file.  Add some tests.
11174         * m4.h: Remove #include "config.h".
11175         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
11176         Then, rewritten for better compliance with GNU standards.
11178 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
11180         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
11181         because of a misplaced #endif.
11183         * Many *.[hc] files: Correct intra-line spacing here and there,
11184         according to GNU indent 1.6 advice.
11186         * configure.in: New, using Autoconf 1.2.
11187         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
11188         * Delete old configure.in, configure, etc/configure.in,
11189         etc/configure, lib/configure.in, lib/configure and config/*.
11190         Reported by Jason Merrill.
11192         * symtab.c (hash): Change (char) NULL to '\0'.
11193         Reported by Jason Merrill.
11195         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
11196         etc/nextvers.sh.  Release numbers will be edited `by hand'.
11197         * version.h: De-automatize, force value in.
11199         * m4.c: Changes in order to use a newer getopt.h.
11200         Reported by David MacKenzie.
11202         * checks/: New name for examples/.
11203         * checks/get_them: New location for etc/get_examples.
11204         * checks/check_them: New location for etc/check_examples.
11205         * Makefile.in, checks/get_them, checks/check_them: Adjust.
11206         * lib/vfprintf.c: New location for etc/vfprintf.c.
11207         * Delete empty etc/.
11208         * examples/: New name for test/.
11210 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
11212         * Makefile.in (check): Add m4 as dependency.
11214         * m4.c: Accept --no-warnings instead of --no_warnings, and
11215         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
11216         usage message more informative.
11217         Reported by David MacKenzie.
11219 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
11221         * etc/check_examples: New name for check_examples.sh.
11222         * etc/get_examples: New name for get_examples.sh.
11223         * Makefile.in, etc/Makefile.in: Use new names.
11225         * Makefile.in: Transmit $(CC) while making in lib.
11227         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
11228         code disposition by hand.
11230 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
11232         * m4.h: Delete definitions for abort() and exit().
11233         Reported by Richard Stallman.
11235         * config/hmake-unicos, config/s-unicos.h: New files.
11236         Reported by Hal Peterson.
11238         * eval.c (exp_term): Have N^0 return 1.
11239         Reported by Michael Fetterman.
11241         * eval.c, input.c, m4.h: Remove last comma in enums.
11242         Reported by Mike Lijewski.
11244         * Transfer of maintenance duties from René to François.
11246 1991-10-24  René Seindal <seindal@diku.dk>
11248         * Release 1.0.  Many thanks to those, who provided me with bug
11249         reports and feedback.
11251         * Uses GNU configure, taken from the gdb distribution.
11253         * Uses GNU getopt(), with long option names.
11255         * The -Q/+quiet option is added, which suppresses warnings about
11256         missing or superflous arguments to built-in macros.
11258         * Added default options via the M4OPTS environment variable.
11260         * The built-in format can now be configured to use sprintf as
11261         the formatting engine, for systems without [efg]cvt(3).
11263         * GNU library code is moved to the ./lib subdirectory; other
11264         utility files are now in ./etc.
11266         * Several minor bugs have been fixed.
11268 1991-07-26  René Seindal <seindal@diku.dk>
11270         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
11271         François Pinard and Roland H. Pesch for providing me with reports.
11273         * The builtins incr and decr are now implemented without use of
11274         eval.
11276         * The builtin indir is added, to allow for indirect macro calls
11277         (allows use of "illegal" macro names).
11279         * The debugging and tracing facilities has been enhanced
11280         considerably.  See the manual for details.
11282         * The -tMACRO option is added, marks MACRO for tracing as soon
11283         as it is defined.
11285         * Builtins are traced after renaming iff they were before.
11287         * Named files can now be undiverted.
11289         * The -Nnum option can be used to increase the number of
11290         divertions available.
11292         * Calling changecom without arguments now disables all comment
11293         handling.
11295         * The function m4_patsubst() is now consistently declared
11296         static.
11298         * A bug in dnl is fixed.
11300         * A bug in the multi-character quoting code is fixed.
11302         * Several typos in the manual has been corrected.  More probably
11303         persist.
11305         * The m4.info file is now installed along with the program.
11307 1990-11-15  René Seindal <seindal@diku.dk>
11309         * Updated and enhanced version.  Release 0.75, manual 0.07.
11311         * Implemented search path for include files (-I option and
11312         M4PATH envronment variable).
11314         * Implemented builtin "format" for printf-like formatting.
11316         * Implemented builtin "regexp" for searching for regular
11317         expressions.
11319         * Implemented builtin "patsubst" for substitution with regular
11320         expressions.
11322         * Implemented builtin "esyscmd", which expands to a shell
11323         commands output.
11325         * Implemented "__file__" and "__line__" for use in error
11326         messages.
11328         * Implemented character ranges in "translit".
11330         * Implemented control over debugging output.
11332         * Implemented multi-character quotes.
11334         * Implemented multi-character comment delimiters.
11336         * Changed predefined macro "gnu" to "__gnu__".
11338         * Changed predefined macro "unix" to "__unix__", when the -G
11339         option is not used.  With -G, "unix" is still defined.
11341         * Changed "shift", "$@" and "$*" to not insert spaces afters
11342         commas.
11344         * Added program name to error messages.
11346         * Fixed two missing null bytes bugs.
11348 1990-01-22  René Seindal <seindal@diku.dk>
11350         * Initial beta release.  Release 0.50, manual 0.05.
11353         -----
11355         Local Variables:
11356         coding: utf-8
11357         End:
11359         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
11360         2005, 2006, 2007, 2008 Free Software Foundation, Inc.
11362         Copying and distribution of this file, with or without
11363         modification, are permitted provided the copyright notice
11364         and this notice are preserved.