Speed up esyscmd with buffer reads.
[m4.git] / ChangeLog
blob51fda555faf567b621653333d3754edcd3291834
1 2009-02-18  Eric Blake  <ebb9@byu.net>
3         Speed up esyscmd with buffer reads.
4         * modules/gnu.c (esyscmd): Read blocks directly into obstack,
5         rather than repeatedly reading bytes.  Detect read errors.
7         Avoid risk of stack overflow.
8         * m4/output.c (insert_file): Avoid stack allocation of large
9         buffer.
11         Synchronize THANKS with branch.
12         * THANKS: Import more names.
14         Improve handling of $ in syntax table.
15         * m4/m4module.h (m4_is_syntax_single_dollar): New function.
16         (M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
17         be context rather than basic syntax categories.
18         (M4_SYNTAX_MASKS): Adjust macro.
19         * m4/m4private.h (struct m4_syntax_table): Add dollar and
20         is_single_dollar members.
21         (m4_is_syntax_single_dollar): Add fast alternative.
22         * m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
23         account for change to context categories.
24         (m4_set_syntax): Manage is_single_dollar.
25         (m4_is_syntax_single_dollar): New function.
26         * m4/macro.c (locate_dollar): New helper function.
27         (process_macro): Use it to speed up macro expansion.
28         * m4/input.c (m4__next_token): Adjust client.
29         * doc/m4.texinfo (Changesyntax): Document this.
31 2009-02-17  Eric Blake  <ebb9@byu.net>
33         Sync changecom documentation with branch.
34         * doc/m4.texinfo (Changecom): Tweak wording.
35         * NEWS: Import changes from the branch.
37         Stage 29b: Process quotes and comments by buffer, not bytes.
38         Search for quote and comment delimiters by buffer when possible.
39         Memory impact: none.
40         Speed impact: noticeable improvement, from fewer function calls.
41         * ltdl/m4/gnulib-cache.m4: Import memchr2 module.
42         * m4/input.c (m4__next_token): Add buffer reads to quote and
43         comment parsing.
44         * NEWS: Document this.
46 2009-02-16  Eric Blake  <ebb9@byu.net>
48         Stage 29a: Process dnl and macro names by buffer, not bytes.
49         Enhance input engine to provide lookahead buffer, rather than
50         forcing clients to call next_char for every byte.  Utilize this
51         for the simplest clients.
52         Memory impact: none.
53         Speed impact: noticeable improvement, from fewer function calls.
54         * ltdl/m4/gnulib-cache.m4: Import freadptr and freadseek modules.
55         * m4/input.c (struct input_funcs): Add virtual functions
56         buffer_func and consume_func.
57         (file_buffer, file_consume, string_buffer, string_consume)
58         (composite_buffer, composite_consume, eof_buffer): Implement
59         them.
60         (file_funcs, string_funcs, composite_funcs, eof_funcs): Update
61         vtables accordingly.
62         (buffer_retry): New sentinel.
63         (next_buffer, consume_buffer): New functions.
64         (m4_skip_line, match_input, consume_syntax): Use them for faster
65         parsing.
66         Suggested by Bruno Haible.
68         Unify single and multi-character delimiter handling.
69         * m4/input.c (MATCH): Add a parameter.
70         (m4__next_token): Simplify logic and reduce redundancy.
71         (m4__next_token_is_open): Adjust caller.
72         * m4/syntax.c (m4_set_comment, m4_set_quotes): Handle delimiters
73         of differing lengths.
74         (m4_set_syntax): Recognize restoration of single delimiters.
76         Revamp changesyntax vs. changequote interactions.
77         * m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
78         (M4_SYNTAX_SUSPECT): New macro.
79         * m4/m4private.h (struct m4_syntax_table): Add suspect field.
80         * m4/syntax.c (check_is_single_quotes, check_is_single_comments)
81         (check_is_macro_escaped): Delete, by inlining body...
82         (m4_set_syntax): ...into here.  Improves handling between
83         changesyntax and changequote/changecom.
84         (add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
85         and let suspect field track needed cleanup.
86         (m4_set_quotes, m4_set_comment): Adjust meaning of
87         is_single_quotes and is_single_comment flags to always be true if
88         only one delimiter exists, regardless of its length.  Ensure that
89         the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
90         only used on 1-byte delimiters.
91         (add_syntax_attribute, remove_syntax_attribute): Change signature
92         to allow the use of fewer casts.  Adjust the suspect field when
93         necessary.
94         (m4_reset_syntax, set_quote_age): Adjust callers.
95         * m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
96         callers.
97         * doc/m4.texinfo (Changesyntax): Update documentation and tests.
99         Improve changesyntax documentation.
100         * doc/m4.texinfo (Changesyntax): Merge two tables into one
101         multitable.
103         Fix regression in multicharacter quotes, from 2008-01-26.
104         * m4/input.c (m4__next_token): Fix typo.
105         * tests/builtins.at (changequote): Enhance test.
107 2009-02-13  Eric Blake  <ebb9@byu.net>
109         Speed up parsing when detecting input file change.
110         * m4/input.c (next_char): Clear input_change flag.  Bug introduced
111         2006-10-25.
113 2009-02-12  Eric Blake  <ebb9@byu.net>
115         Avoid quadratic code when walking definition stack.
116         * examples/stack_sep.m4: Use linear, not quadratic
117         implementation.
118         * doc/m4.texinfo (Improved copy): Fix documentation, based on
119         recent autoconf bug fix.
120         * tests/others.at (recursion): Enhance test.
122 2009-02-11  Eric Blake  <ebb9@byu.net>
124         Stage 28c: Warn on embedded NUL in remaining cases.
125         Ensure all remaining warnings can handle embedded NUL.
126         Memory impact: none.
127         Speed impact: none noticed.
128         * m4/m4module.h (m4_debug_decode, m4_parse_truth_arg): Add
129         parameter.
130         * m4/macro.c (m4_macro_call): Improve diagnostic.
131         * modules/m4.c (defn): Likewise.
132         * m4/debug.c (m4_debug_decode): Handle embedded NUL.
133         * m4/utility.c (m4_parse_truth_arg): Likewise.
134         * modules/format.c (arg_int, arg_long, arg_double): Likewise.
135         (arg_string): New function.
136         (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Update callers.
137         * src/main.c (main): Likewise.
138         * src/freeze.c (reload_frozen_state): Likewise.
139         * modules/gnu.c (debugmode, syncoutput): Likewise.
140         * tests/options.at (--regexp-syntax): Adjust test.
141         * tests/freeze.at (reloading nul): Likewise.
142         * tests/null.m4: Likewise.
143         * tests/null.out: Likewise.
144         * tests/null.err: Likewise.
146         Stage 28b: Warn on embedded NUL in file arguments.
147         Quote warning messages related to file and other NUL-terminated
148         system commands.
149         Memory impact: none.
150         Speed impact: none noticed.
151         * m4/path.c (m4_path_search): Quote file names in message.
152         * modules/m4.c (syscmd, include, m4_make_temp): Handle embedded
153         NUL.
154         * modules/gnu.c (debugfile, esyscmd): Likewise.
155         * tests/others.at (nul character): Adjust test.
156         * tests/builtins.at (mkdtemp, mkstemp): Likewise.
157         * tests/null.m4: Likewise.
158         * tests/null.out: Likewise.
159         * tests/null.err: Likewise.
161         Stage 28a: Warn on embedded NUL in numeric arguments.
162         Quote warning messages related to numeric parsing in order to
163         handle embedded NUL.
164         Memory impact: none.
165         Speed impact: none noticed.
166         * m4/m4module.h (m4_numeric_arg): Adjust prototype.
167         * m4/utility.c (m4_numeric_arg): Add parameter.
168         * modules/gnu.c (debuglen): Adjust callers.
169         * modules/m4.c (incr, decr, divert, undivert, m4exit, substr)
170         (index): Likewise.
171         * modules/evalparse.c (m4_evaluate): Likewise.
172         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
173         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
174         Likewise.
175         * doc/m4.texinfo (Changesyntax): Fix typo.
176         * tests/others.at (nul character): Adjust test.
177         * tests/null.m4: Likewise.
178         * tests/null.out: Likewise.
179         * tests/null.err: Likewise.
181 2009-02-11  Eric Blake  <ebb9@byu.net>
183         Avoid regression in popdef(undef).
184         * doc/m4.texinfo (Trace): Enhance test, to cover regression
185         recently fixed on the branch.
187 2009-02-09  Eric Blake  <ebb9@byu.net>
189         Enhance index to support starting offset.
190         * modules/m4.c (index): Add optional third argument.
191         * NEWS: Document this.
192         * doc/m4.texinfo (Index macro): Likewise.
193         (Macro Arguments): Adjust tests.
195 2009-01-24  Eric Blake  <ebb9@byu.net>
197         Add URLs to --help output.
198         * src/main.c (usage): Use enhanced version-etc features.
200 2009-01-07  Eric Blake  <ebb9@byu.net>
202         Enhance substr to support replacement text.
203         * doc/m4.texinfo (Substr): Document new semantics.
204         * modules/m4.c (substr): Support optional fourth argument.
205         * NEWS: Document this.
207         Enhance substr to support negative values.
208         * doc/m4.texinfo (Substr): Document new semantics, and how to
209         simulate old.
210         * modules/m4.c (substr): Support negative values.
211         * NEWS: Document this.
213 2009-01-05  Eric Blake  <ebb9@byu.net>
215         Maintainer cleanups.
216         * HACKING: Remove mention of xdelta.
217         * Makefile.am (EXTRA_DIST, MAINTAINERCLEANFILES): Let gnulib take
218         care of distributing gendocs.sh.
219         * maint.mk (web-manual): Use new feature of gendocs.
220         * ltdl/m4/gnulib-cache.m4: Regenerate.
222 2008-12-24  Eric Blake  <ebb9@byu.net>
224         Relax eval as allowed by POSIX 2008.
225         * modules/evalparse.c (m4_evaluate): Warn, not error, on invalid
226         operator.  Quote expression in warning.
227         * modules/mpeval.c (includes): Add quotearg.h.
228         * doc/m4.texinfo (Eval, Improved forloop): Update tests.
229         * NEWS: Update to reflect 1.6 support for `?:'.
231 2008-12-23  Eric Blake  <ebb9@byu.net>
233         Add debugmode(o) to control dumpdef output location.
234         * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
235         (M4_DEBUG_TRACE_VERBOSE): Update.
236         * m4/debug.c (m4_debug_decode): Support new debug option.
237         * src/freeze.c (produce_debugmode_state): Likewise.
238         * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
239         than the debug file.
240         * src/main.c (usage): Document it.
241         * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
242         (Debugfile): Likewise.
243         * NEWS: Likewise.
244         Based on an autoconf bug report by Paolo Bonzini.
246         Make --debugfile argument optional.
247         * src/main.c (long_options): Make the argument optional, to allow
248         setting debug file back to stderr.
249         (main): Make --debugfile order-dependent.
250         (usage): Document this.
251         * doc/m4.texinfo (Debugging options): Likewise.
252         * NEWS: Likewise.
253         * tests/options.at (--debugfile): Enhance test.
254         (--safer): Adjust to new semantics.
256 2008-12-22  Eric Blake  <ebb9@byu.net>
258         Use @var correctly.
259         * doc/m4.texinfo (Operation modes, Preprocessor features)
260         (Limits control, Frozen state, Debugging options)
261         (Dynamic loading features): Use lower case names in @var.
262         (Improved copy): Use @code, not @var, as appropriate.
264 2008-12-18  Eric Blake  <ebb9@byu.net>
266         Deal with M4 1.4.x limitation on builtin tokens.
267         * doc/m4.texinfo (Composition): Mention limitation on curry.
268         (Improved copy): New node.
269         (Stacks): Fix typo.
270         * examples/stack.m4: Likewise.
271         * examples/stack_sep.m4: New file.
272         * Makefile.am (dist_pkgdata_DATA): Distribute it.
274 2008-12-15  Eric Blake  <ebb9@byu.net>
276         Double size of temp file cache.
277         * m4/output.c (tmp_file, tmp_file_owner): Split...
278         (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
279         two variables.
280         (tmp_file2_recent): New variable.
281         (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
282         (m4_output_exit): Adjust callers.
284         Use fewer seeks on cached files.
285         * m4/output.c (m4_tmpfile): Use write, not append mode.
286         (m4_tmpopen): Add parameter to decide when to skip seeks.
287         (m4_tmprename, m4_make_diversion, insert_diversion_helper)
288         (m4_freeze_diversions): Adjust callers.
290         Cache most recently spilled diversion.
291         * m4/output.c (tmp_file, tmp_file_owner): New variables, for
292         1-deep cache of spilled diversions.
293         (m4_tmpfile): Open in append mode, since we might revisit
294         diversion without closing it now.
295         (m4_tmpopen): Check cache first.
296         (m4_tmpclose): Update cache, rather than closing.  Add parameter.
297         (m4_tmpremove): Close cache before removing.
298         (m4_tmprename): Deal with open files when renaming.
299         (m4_output_exit): Close cache before exiting.
300         (make_room_for, m4_make_diversion, insert_diversion_helper):
301         Adjust callers.
302         * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
303         * configure.ac (M4_RENAME): Invoke it.
305         Correctly track size of in-memory diversions.
306         * m4/output.c (insert_diversion_helper): Correctly track total
307         in-memory diversion size after undivert.
309         Avoid quadratic behavior for some cases of divert/undivert.
310         * m4/output.c (struct m4_diversion): Improve comments.
311         (m4_tmpname, m4_make_diversion): Strengthen preconditions.
312         (m4_tmprename): New function.
313         (m4_output_init, m4_output_exit): Move after internal functions.
314         (make_room_for): Don't bother copying uninitialized bytes.
315         (insert_diversion_helper): Transfer metadata, rather than copying
316         contents, when undiverting into a previously unused diversion.
317         * tests/builtins.at (divert): Add a check to the test.
318         * doc/m4.texinfo (Undivert): Enhance test.
319         * NEWS: Document the speedup.
321 2008-12-02  Eric Blake  <ebb9@byu.net>
323         Stage 27: Allow embedded NUL in text processing macros.
324         Pass NUL through regular expressions, format, and translit, and
325         diagnose it in eval and changeresyntax.  Improve warning
326         capabilities of format.
327         Memory impact: none.
328         Speed impact: none noticed.
329         * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
330         (translit): Manage NUL bytes.
331         * modules/format.c (format): Likewise.
332         * modules/gnu.c (substitute, regexp_substitute): Likewise.
333         (m4_resyntax_encode_safe): Add parameter.
334         (regexp, patsubst, renamesyms): Update callers.
335         (regexp_compile): Adjust error message.
336         * modules/evalparse.c (m4_evaluate): Use consistent message.
337         (end_text): New variable.
338         (eval_init_lex): Add parameter.
339         (eval_lex): Detect embedded NUL.
340         * src/freeze.c (reload_frozen_state): Likewise.
341         * doc/m4.texinfo (Format): Update to cover new behavior.
342         (Eval): Mention that result is unquoted.
343         * tests/freeze.at (reloading nul): Enhance test.
344         * tests/null.m4: Likewise.
345         * tests/null.err: Update expected output.
346         * tests/null.out: Likewise.
347         * tests/options.at (--regexp-syntax): Likewise.
349 2008-11-28  Eric Blake  <ebb9@byu.net>
351         Resync NEWS with branches.
352         * NEWS: Mention 1.4.12, update state of 1.6.
354 2008-11-26  Eric Blake  <ebb9@byu.net>
356         Keep COPYING in repository.
357         * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
358         * .cvsignore: Don't ignore it.
359         * .gitignore: Likewise.
360         * COPYING: Store in repository, per automake 1.10.2
361         recommendation.
363 2008-11-26  Eric Blake  <ebb9@byu.net>
365         Document optimized forloop.
366         * doc/m4.texinfo (Improved forloop): Mention alternate style that
367         avoids define overhead.
368         * examples/forloop3.m4: New file.
369         * Makefile.am (dist_pkgdata_DATA): Distribute it.
371         Document copy composite using stack_foreach and curry.
372         * doc/m4.texinfo (Stacks): New node, to document pushdef stack
373         manipulation.
374         (Ifelse): Move define_blind...
375         (Composition): ...to this new node.  Document currying, then use
376         it to implement copy and rename.
377         * examples/curry.m4: New file.
378         * examples/stack.m4: Likewise.
379         * Makefile.am (dist_pkgdata_DATA): Distribute them.
381 2008-11-04  Eric Blake  <ebb9@byu.net>
383         Upgrade to FDL 1.3.
384         * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
385         * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
386         file change.
387         * doc/m4.texinfo (GNU Free Documentation License): Likewise.
389 2008-10-22  Eric Blake  <ebb9@byu.net>
391         Give nicer error if user modifies testsuite but lacks autoconf.
392         * Makefile.am (AUTOM4TE): Use missing in the definition.
394 2008-10-09  Eric Blake  <ebb9@byu.net>
396         Allow user to choose which sed to use in testsuite.
397         * tests/atlocal.in (SED): Inherit from configure results.
398         * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
399         (mkstemp, syscmd): Use $SED.
400         * tests/generate.awk (new_test): Likewise.
401         * tests/options.at (deprecated options, unknown option)
402         (--debugmode, --help and --version): Likewise.
403         * tests/testsuite.at (AT_CHECK_M4): Likewise.
404         * tests/others.at (directory, stderr closed, stdin seekable)
405         (stdout closed): Likewise.
406         (nul character): Likewise.  Also, skip test if sed can't handle
407         NUL bytes.
409         Clean up testsuite invocation.
410         * tests/atlocal.in: Fix copyright notice.
411         * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
412         (check-local, installcheck-local): Adjust clients.  Add missing
413         dependency.
415 2008-09-25  Eric Blake  <ebb9@byu.net>
417         Tweak error message on command line failure.
418         * m4/m4private.h (includes): Use "quotearg.h".
419         * src/main.c (process_file, main): Use nicer quotes for file name
420         in error messages.
421         * m4/input.c (file_clean, m4_push_file): Likewise.
422         * m4/module.c (m4__module_open): Likewise.
423         * src/freeze.c (produce_frozen_state, reload_frozen_state):
424         Likewise.
425         * modules/gnu.c (debugfile): Likewise.
426         * modules/m4.c (undivert, include): Likewise.
427         * tests/others.at (directory, stdin closed): Update tests.
428         * tests/options.at (file names, --debugmode): Likewise.
429         * doc/m4.texinfo (Debugmode): Likewise.
431         Unify error handling for reading directories.
432         * m4/path.c (m4_path_search): Factor open attempts...
433         (m4_fopen): ...into new function, to reject directories.
434         * tests/others.at (directory): Enhance test.
435         * doc/m4.texinfo (Include): Document that directories cannot be
436         input files.
438         Avoid bugs on platforms that mishandle trailing /.
439         * ltdl/m4/gnulib-cache.m4: Import fopen module.
440         * tests/others.at (directory): New test.
442 2008-09-16  Eric Blake  <ebb9@byu.net>
444         Fix bootstrap for Solaris /bin/sh.
445         * bootstrap: Avoid shell quoting pitfall.
447 2008-09-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
449         Typos in source code comments.
450         * modules/m4.c: Fix typos in comments.
451         * m4/input.c: Likewise.
452         * src/main.c: Likewise.
454 2008-08-29  Eric Blake  <ebb9@byu.net>
456         Fix manual date information.
457         * doc/m4.texinfo: UPDATED refers to the day the manual was built,
458         not the release date of M4.
459         Based on a bison patch by Akim Demaille.
461 2008-08-27  Eric Blake  <ebb9@byu.net>
463         Tweak -d examples.
464         * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
465         matters.
466         (Dumpdef): Fix typo.
468 2008-08-23  Eric Blake  <ebb9@byu.net>
470         Allow debugmode control over whether defn(undef) warns.
471         * ltdl/m4/gnulib-cache.m4: Import verify module.
472         * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
473         New values.
474         (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
475         * m4/m4.c (m4_create): Start with debugmode = d.
476         * src/main.c (usage): Mention this.
477         (main): Let -E impact debug mode.
478         * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
479         if flag is clear.
480         * modules/gnu.c (builtin, inder): Likewise.
481         * m4/debug.c (m4_debug_decode): Parse new mode.
482         * src/freeze.c (produce_debugmode_state): Accomodate new mode.
483         * doc/m4.texinfo (Debugging options): Mention change in the
484         default behavior.
485         (Debugmode): Mention new flag d.
486         (Operation modes): Mention interaction with -E.
487         (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
488         test its effect.
489         * tests/options.at (--debugmode): Update tests.
490         * tests/freeze.at (reloading debugmode): Likewise.
491         * NEWS: Document this.
492         Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
493         incompatible with Autoconf 2.62.
495 2008-08-22  Eric Blake  <ebb9@byu.net>
497         Improve --debugmode behavior.
498         * m4/m4module.h (m4_debug_decode): Simplify interface.
499         * m4/debug.c (m4_debug_decode): Remove parameter, and handle
500         setting the new value.
501         * modules/gnu.c (debugmode): Adjust caller.
502         * src/freeze.c (reload_frozen_state): Likewise.
503         * src/main.c (main): Likewise.
504         (usage): Fix default for --debug.
505         * doc/m4.texinfo (Debugging options): Add an example.
507 2008-08-21  Eric Blake  <ebb9@byu.net>
509         Avoid regression in defn(undef).
510         * doc/m4.texinfo (Trace): Enhance test, to cover regression
511         recently fixed on the branch.
513 2008-08-18  Eric Blake  <ebb9@byu.net>
515         Remove deprecated -N option; fixes a regression from 2006-09-14.
516         * src/main.c (DIVERSIONS_OPTION): Delete.
517         (long_options, OPTSTRING, main): Remove -N/--diversions option.
518         * doc/m4.texinfo (Limits control): Remove it from the manual.
519         * NEWS: Mention that it is gone.
520         * tests/options.at (deprecated options): Update test.
522         Improve 'git diff' of manual source.
523         * .gitattributes (*.texi*): Add diff attribute.
524         * bootstrap: Tell git how to use it.
525         Inspired by Jim Meyering's similar patch for coreutils.
527 2008-08-07  Bruno Haible  <bruno@clisp.org>  (tiny change)
529         Run m4 tests prior to gnulib unit tests.
530         * Makefile.am (SUBDIRS): Swap order of directories.
532 2008-08-03  Eric Blake  <ebb9@byu.net>
534         Stage 26: Allow embedded NUL in macro definitions.
535         Clean up final few locations that did not track macro definitions
536         by length, to allow embedded NUL.  Make m4_arg_len callers aware
537         of issue of flattening builtins when determining length.
538         Memory impact: none.
539         Speed impact: none noticed.
540         * m4/m4module.h (m4_arg_len): Add parameter.
541         (M4ARGLEN): Provide default for the parameter.
542         * m4/m4private.h (includes): Share xmemdup0.h among all libm4
543         files.
544         * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
545         * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
546         * m4/symtab.c (includes): Likewise.
547         (m4_symbol_value_copy): Use xmemdup0.
548         * m4/module.c (install_macro_table): Likewise.
549         * src/freeze.c (reload_frozen_state): Likewise.
550         * tests/freeze.at (reloading nul): Enhance test.
551         * tests/null.m4: Likewise.
552         * tests/null.err: Update expected output.
553         * tests/null.out: Likewise.
555         Fix regression in commenting unbalanced quotes, from 2008-02-16.
556         * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
557         * m4/input.c (m4__next_token, m4_print_token): Supply new token
558         type for comments.
559         * m4/macro.c (expand_token): Penalize comments, as they can
560         contain unbalanced quotes; latent bug since 2007-12-07, exposed by
561         passing $@ references built from comments.
562         (expand_argument): Adjust caller.
563         * tests/others.at (Comments): Enhance test to catch it.
564         * NEWS: Mention the fix.
566 2008-07-30  Eric Blake  <ebb9@byu.net>
568         Fix regression in trace output, introduced 2008-05-08.
569         * m4/input.c (m4__push_symbol): When cloning chains, break pointer
570         back to original chain; latent bug from 2008-02-02 that did not
571         cause misbehavior until trace output read unfinished chain.
572         * tests/builtins.at (debug): Add test for this.
574 2008-07-28  Eric Blake  <ebb9@byu.net>
576         Optimize iteration examples.
577         * examples/forloop2.m4: Avoid excess indir, by passing current
578         counter value as parameter.
579         * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
580         ignored argument.
581         * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
582         documentation to match.
584 2008-07-26  Eric Blake  <ebb9@byu.net>
586         Give example for O(n) foreach on m4 1.4.x.
587         * examples/foreachq4.m4: New file.
588         * Makefile.am (dist_pkgdata_DATA): Distribute it.
589         * tests/others.at (recursion): Test it.
590         * doc/m4.texinfo (Improved foreach): Document linear foreach with
591         m4 1.4.5 and greater.
593 2008-07-19  Eric Blake  <ebb9@byu.net>
595         Resynchronize docs from branch.
596         * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
597         name, particularly since the old documentation didn't match code.
598         (Standard Modules): Add caveat about using __m4_version__.
600 2008-07-11  Eric Blake  <ebb9@byu.net>
602         Bump required automake to 1.10a; regression introduced 2008-01-22.
603         * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
604         1.10.1, since we also rely on pkglibexecdir.
605         * HACKING: Fix minimum requirement.
606         * bootstrap: Likewise.
607         * THANKS: Update.
608         Reported by Joel E. Denny.
610         Avoid bogus whitespace in @ovar, @dvar.
611         * doc/m4.texinfo (ovar, dvar): Add @c.
612         Based on patch by Ralf Wildenhues to Autoconf manual.
614 2008-06-23  Eric Blake  <ebb9@byu.net>
616         Adjust to new gnulib-tool layout.
617         * ltdl/m4/gnulib-cache.m4: Reformat.
619         Fix bootstrap comment.
620         * bootstrap: DOWNLOAD_PO was previously removed.
622 2008-06-19  Eric Blake  <ebb9@byu.net>
624         Revert speed regression from 2008-06-16.
625         * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
626         * modules/m4.c (numb_obstack): Likewise.
627         * m4/input.c (MATCH): Use fewer conditionals, and factor
628         adjustment of S...
629         (match_input): ...here for smaller code size.
630         * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
631         Supply trailing NUL to delimiters, to meet contract of faster
632         MATCH.
634 2008-06-18  Eric Blake  <ebb9@byu.net>
636         Whitespace cleanup.
637         * m4/m4module.h: Use consistent spacing for pointer parameters.
638         * m4/m4private.h: Likewise.
640         Stage 25b: Handle embedded NUL in changesyntax and friends.
641         Track quote and comment delimiters by length, to allow embedded
642         NUL.  Improve changesyntax to support assigning syntax to NUL.
643         Memory impact: none.
644         Speed impact: none noticed.
645         * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
646         Add parameter.
647         (m4_reset_syntax): New prototype.
648         * m4/syntax.c (add_syntax_set, subtract_syntax_set)
649         (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
650         handle embedded NUL.
651         (m4_set_syntax): Likewise.  Also, split code to reset the table...
652         (m4_reset_syntax): ...into a new function.
653         (m4_syntax_create): Adjust callers.
654         * m4/input.c (match_input, MATCH): Add parameter.
655         (m4__next_token, m4__next_token_is_open): Adjust callers.
656         * modules/m4.h (m4_expand_ranges_func): Add parameter.
657         * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
658         (changequote, changecom, translit, m4_expand_ranges): Track
659         delimiter length.
660         * modules/gnu.c (changesyntax): Handle embedded NUL.
661         * src/freeze.c (reload_frozen_state): Adjust callers.
662         * tests/freeze.at (reloading nul): Enhance test.
663         * tests/null.m4: Likewise.
664         * tests/null.out: Update expected output.
665         * tests/null.err: Likewise.
667 2008-06-16  Eric Blake  <ebb9@byu.net>
669         Stage 25a: Use obstack_printf for easier output.
670         Convert macro tracing and other locations to use obstack_printf
671         rather than hand-rolled equivalents.  Ensure that embedded NUL in
672         trace output does not truncate the trace string.
673         Memory impact: none.
674         Speed impact: noticeable penalty, from obstack_printf overhead.
675         * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
676         * m4/macro.c (trace_format): Delete; use obstack_printf instead.
677         (trace_header, trace_pre, trace_post): All callers updated.
678         * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
679         (m4_divert_text): Speed up syncline output.
680         * modules/m4.c (dumpdef): Handle embedded NUL.
681         (numb_obstack): Speed up eval output.
682         (maketemp): Use obstack_printf.
683         * modules/format.c (format): Likewise.
685         Add missing const qualifications.
686         * m4/resyntax.c (m4_resyntax_map): Declare array elements as
687         const.
688         * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
689         * modules/import.c (m4_builtin_table): Likewise.
690         * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
691         * modules/m4.c (m4_builtin_table): Likewise.
692         * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
693         * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
694         * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
695         * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
696         * modules/stdlib.c (m4_builtin_table): Likewise.
697         * modules/time.c (m4_builtin_table): Likewise.
698         * modules/traditional.c (m4_macro_table): Likewise.
700 2008-06-10  Eric Blake  <ebb9@byu.net>
702         Avoid corrupted frozen file if NUL appears on block boundary.
703         * m4/output.c (insert_file): Separate consecutive quotearg blocks
704         with \<newline>, in case last byte of first block was NUL.
706 2008-06-03  Eric Blake  <ebb9@byu.net>
708         Fix printf type mismatches.
709         * m4/m4module.h (m4_bad_argc): Alter parameter type.
710         * m4/m4private.h (struct m4_call_info): Alter call_id type.
711         * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
712         specifiers.
713         * m4/utility.c (m4_bad_argc): Likewise.
715         Borrow bootstrap ideas from gnulib.
716         * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
717         advertized subset of languages didn't work.  Use --skip-po
718         instead, for consistency with gnulib bootstrap.
719         (func_get_translations): Use rsync, not wget.
720         (func_update_po): Use a reference directory, to avoid changing
721         timestamps on unchanged .po files.
722         * TODO: Update accordingly.
724         Fix fallout from previous patch.
725         * doc/m4.texinfo (Builtin): Adjust expected output.
727 2008-06-02  Eric Blake  <ebb9@byu.net>
729         Stage 24c: Improve display of macro names with embedded NUL.
730         Quote instances of problematic characters in macro names when
731         presented to user.  Track location via call_info rather than
732         munging context for every expansion.
733         Memory impact: none.
734         Speed impact: slight penalty, due to more bookkeeping.
735         * m4/m4module.h (m4_push_string_init): Add parameters.
736         * m4/m4private.h (struct m4_macro_args): Remove argv0 and
737         argv0_len, now redundant with info.
738         (m4__push_wrapup_init): Add parameter.
739         * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
740         location from caller, rather than context.
741         (composite_peek, composite_read, match_input): Adjust callers.
742         * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
743         (m4_verror_at_line): Allow NUL in macro name.
744         * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
745         in trace.
746         (expand_macro): No longer munge context location.
747         (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
748         (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
749         * modules/gnu.c (builtin, indir): Likewise.
750         * tests/null.m4: Enhance test.
751         * tests/null.err: Adjust expected output.
752         * tests/null.out: Likewise.
754         Stage 24b: Allow embedded NUL in macro names.
755         Use length rather than NUL-termination when tracking macro names.
756         All APIs dealing with symbol table changed.
757         Memory impact: none.
758         Speed impact: slight penalty, due to more bookkeeping.
759         * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
760         (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
761         (m4_symbol_rename, m4_symbol_delete): Add length parameter.
762         (m4_string): New type.
763         * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
764         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
765         length.
766         * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
767         (m4__symtab_remove_module_references, symbol_destroy_CB)
768         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
769         (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
770         (m4_symbol_delete): Likewise.
771         * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
772         passing length.
773         * m4/macro.c (expand_token): Adjust all callers.
774         * m4/module.c (install_builtin_table, install_macro_table):
775         Likewise.
776         * m4/utility.c (m4_symbol_value_lookup): Likewise.
777         * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
778         * modules/m4.c (define, undefine, pushdef, popdef)
779         (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
780         (traceon, traceoff): Likewise.
781         * src/main.c (main): Likewise.
782         * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
783         * tests/freeze.at (reloading nul): Augment test.
784         * tests/null.out: Adjust expected output.
786         Stage 24a: Use full call context in error reporting.
787         Replace const char *macro_name with const m4_call_info *call, so
788         that the next patch can pass the length of macro_name with
789         embedded NUL.  Simplifies handling of global state.
790         Memory impact: none.
791         Speed impact: none noticed.
792         * m4/m4module.h (m4_error, m4_warn): Change parameter type.
793         (m4_error_at_line, m4_warn_at_line): Delete.
794         (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
795         (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
796         * m4/m4private.h (m4__next_token): Likewise.
797         * m4/utility.c (m4_verror_at_line): Alter parameter, and use
798         caller's location if caller is provided.
799         (m4_error, m4_warn): Change parameter type.
800         (m4_error_at_line, m4_warn_at_line): Delete.
801         (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
802         (m4_symbol_value_lookup): Adjust all callers.
803         * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
804         * m4/input.c (m4_skip_line, m4__next_token): Likewise.
805         * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
806         (process_macro): Likewise.
807         * modules/m4.h (m4_make_temp_func): Likewise.
808         * modules/evalparse.c (m4_evaluate): Likewise.
809         * modules/format.c (arg_int, arg_long, arg_double, format):
810         Likewise.
811         * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
812         (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
813         (renamesyms, syncoutput, regexp_compile, substitute)
814         (regexp_substitute, m4_resyntax_encode_safe): Likewise.
815         * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
816         (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
817         (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
818         Likewise.
819         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
820         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
821         Likewise.
822         * tests/options.at (--syncoutput): Add test for invalid
823         command-line argument.  Split xfailed portion...
824         (--syncoutput and diversions): ...into new test.
825         (unknown option): New test.
826         * tests/freeze.at (reloading unknown builtin): Update expected
827         output.
829         Adjust to recent gnulib change.
830         * configure.ac (AB_INIT): Delete, now that gnulib does this.
832 2008-05-28  Eric Blake  <ebb9@byu.net>
834         Improve frozen debugmode behavior.
835         * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
836         * src/main.c (main): Interleave -d with files.
837         * tests/options.at (--debugmode): Update test.
838         * tests/freeze.at (reloading debugmode): New test.
839         * doc/m4.texinfo (Debugging options, Debugmode): Document the
840         change.
841         * NEWS: Likewise.
843 2008-05-27  Eric Blake  <ebb9@byu.net>
845         Fix some testsuite failures on Solaris 8.
846         * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
847         broken.
848         * tests/others.at (stderr closed): Likewise.  Also support Solaris
849         wording for EBADF.
850         (stdin closed): Skip test if closed stdin gets reopened.
851         (stdout closed): Support Solaris wording for EBADF.
852         * tests/testsuite.at (AT_CHECK_M4): Likewise.
854         Fix configure message nesting, broken since 2001-09-20.
855         * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
856         not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
858         Support 'make dist' with BSD make.
859         * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
860         of the generated file tests/generated.at.
861         (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
862         * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
864 2008-05-24  Eric Blake  <ebb9@byu.net>
866         Test NUL in frozen files.
867         * tests/testsuite.at (AT_CHECK_M4): Add parameter.
868         * tests/freeze.at (reloading nul): New test.
869         (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
870         (reloading unknown builtin): Likewise.
872 2008-05-23  Eric Blake  <ebb9@byu.net>
874         Improve handling of frozen file errors.
875         * src/freeze.c (produce_frozen_state): Detect write failures.
876         (reload_frozen_state): Use close_stream.
877         * tests/freeze.at (freezing failure): New test.
878         * THANKS: Update.
879         Reported by Jean-Charles Longuet.
881 2008-05-19  Eric Blake  <ebb9@byu.net>
883         In frozen file, split consecutive strings with newline.
884         * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
885         (produce_frozen_state): Likewise for 'Q', 'C'.
886         (reload_frozen_state): Parse the new layout.
887         [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
888         * tests/freeze.at (loading format 2): Rewrite to new format.
889         (reloading unknown builtin): Likewise.
890         (loading format 1): Make sure backslash-newline is not
891         interpreted.
892         * doc/m4.texinfo (Frozen file format 2): Document the format.
893         * NEWS: Document this change.
895         Fix xgettext options.
896         * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
897         xgettext.
899         Fix spelling of René Seindal's name in --version output.
900         * ltdl/m4/gnulib-cache.m4: Import propername module.
901         * src/main.c (AUTHORS): Rewrite in terms of proper_name.
902         * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
903         * HACKING: Mention new prerequisite of gperf.
905 2008-05-18  Eric Blake  <ebb9@byu.net>
907         Allow freezing the trace status of macros.
908         * src/freeze.c (produce_symbol_dump): Let undefined traced macros
909         through.
910         (dump_symbol_CB): Also freeze trace state.
911         * tests/freeze.at (reloading traced macros): New test.
912         * doc/m4.texinfo (Using frozen files): Update documentation to
913         mention new state.
914         (Frozen file format 1): Improve synchronization with branch.
915         (Frozen file format 2): Reorder directives, and add `d', `t'.
916         * NEWS: Document this change.
918 2008-05-15  Eric Blake  <ebb9@byu.net>
920         Fix frozen file regression in pushdef stacks from 2001-09-01.
921         * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
922         just the current definition.
923         (reverse_symbol_value_stack): New helper method.
924         * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
925         (reloading pushdef stack): New test.
926         (reloading unknown builtin): Enhance test.
928 2008-05-13  Eric Blake  <ebb9@byu.net>
930         Fix frozen file regression in diversions from 2007-01-21.
931         * m4/output.c (insert_diversion_helper): Add parameter.
932         (m4_insert_file): Move contents...
933         (insert_file): ...to this new helper, with added parameter.
934         (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
935         Update callers.
936         * src/freeze.c (produce_mem_dump): Simplify.
937         * tests/freeze.at (large diversion): Test for this.
939         Improve error message when frozen file is invalid.
940         * src/freeze.c (decode_char): Add parameter.  Allow \<newline>
941         line continuations.
942         (reload_frozen_state): Track current line.
943         * tests/freeze.at (loading format 1, loading format 2): Update to
944         test this.
946 2008-05-10  Eric Blake  <ebb9@byu.net>
948         Detect integer overflow when loading frozen file.
949         * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
950         immediately on overflow.
951         * tests/freeze.at (loading format 2): Test this.
952         Reported by Jim Meyering.
954 2008-05-08  Eric Blake  <ebb9@byu.net>
956         Stage 23: allow tracing of indirect macro calls.
957         Track all trace information as part of the argv struct, rather
958         than temporarily resetting global state.  Teach indir to trace
959         macros that it invokes.
960         Memory impact: slight penalty, due to larger argv struct.
961         Speed impact: none noticed.
962         * m4/m4module.h (m4_input_block): Remove.
963         (m4_call_info): New opaque type.
964         (m4_trace_prepare, m4_arg_info): New prototypes.
965         (m4_macro_call, m4_push_string_finish, m4_input_print): Change
966         prototypes.
967         * m4/m4private.h (struct m4_macro_args): Add info field.
968         (struct m4_call_info): New structure.
969         (m4_arg_info): New accessor.
970         * m4/input.c (m4_input_block): Make typedef local.
971         (m4_push_string_init): Initialize length.
972         (m4_push_string_finish, m4_input_print): Change signature, so that
973         printing can be done before finalization.
974         (struct input_funcs): Add parameter to print_func.
975         (file_print, string_print, composite_print): Adjust accordingly.
976         * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
977         Change signatures for stacked trace messages, and for using call
978         context.
979         (trace_prepre): Export and rename...
980         (m4_trace_prepare): ...to this, for use by indir.  Alter signature
981         to use call context.
982         (collect_arguments): Alter signature, to manage new field.
983         (expand_macro): Change call context management.  Move tracing...
984         (m4_macro_call): ...here.  Remove redundant parameter.
985         (m4_arg_argc): New function.
986         (m4_make_argv_ref): Replace unused skip parameter with new trace
987         parameter; manage new field.
988         * modules/gnu.c (builtin, indir): Adjust callers.
989         * src/main.c (usage): Update debugmode flag summary.
990         * tests/null.m4: Enhance test.
991         * tests/null.err: Update expected output.
992         * tests/macros.at (Tracing Hanoi Towers): Likewise.
993         * doc/m4.texinfo (Trace): Mention more about trace formatting.
994         (Debugmode): Enhance description of 'c' and 'x'.  Enhance test to
995         cover line numbering details in traces.
996         (Debuglen): Enhance test to cover indir tracing.
997         * NEWS: Mention these changes.
998         Reported by Akim Demaille in the autoconf TODO file in 2000.
1000 2008-05-07  Eric Blake  <ebb9@byu.net>
1002         Test for traceon regression just fixed in branch-1.6.
1003         * doc/m4.texinfo (Trace): Enhance test.
1004         * NEWS: Port news item from branch.
1006 2008-05-05  Eric Blake  <ebb9@byu.net>
1008         Stage 22: allow builtin token concatenation outside $@.
1009         Adjust the input and argument parsing engines to append builtins
1010         alongside text.  Make define warn when builtins must be
1011         flattened.
1012         Memory impact: slight penalty, with fewer builtins flattened.
1013         Speed impact: slight penalty, from more bookkeeping.
1014         * m4/m4module.h (m4_is_arg_composite): New prototype.
1015         (m4_symbol_value_copy): Change return type.
1016         (m4_arg_text): Add parameter.
1017         (M4ARG): Adjust callers.
1018         * m4/m4private.h: Adjust comments.
1019         * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
1020         flattened.
1021         * m4/input.c (init_builtin_token): Add parameter, and allow
1022         concatenating builtins.
1023         (m4__next_token): Adjust caller.
1024         * m4/macro.c (m4_is_arg_composite): New function.
1025         (expand_argument): Allow builtin concatenation.
1026         (m4_arg_text): Add parameter.
1027         (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
1028         (m4_arg_equal): Fix comparison of builtin tokens.
1029         * modules/m4.c (define, pushdef): Warn when flattening builtins.
1030         * doc/m4.texinfo (Define): Remove dead comment.
1031         (Defn): Update to reflect code changes.
1032         * tests/builtins.at (defn): Remove xfail.
1033         * NEWS: Document this change.
1035 2008-05-03  Eric Blake  <ebb9@byu.net>
1037         Document define_blind.
1038         * doc/m4.texinfo (Ifelse): Add a new composite macro.
1039         * THANKS: Update.
1040         Suggested by Mike R.
1042 2008-05-01  Eric Blake  <ebb9@byu.net>
1044         Avoid -Wshadow compiler warnings.
1045         * m4/output.c (threshold_diversion_CB): s/div/diversion/.
1046         * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
1047         (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
1048         (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
1049         (m4_push_arg, m4__push_arg_quote): s/index/arg/.
1050         * modules/format.c (format): Likewise.
1051         * modules/m4.c (ifelse): Likewise.
1053         Improve debugmode testing, based on recent branch-1.6 regressions.
1054         * doc/m4.texinfo (Debugmode): Enhance tests.
1055         * tests/generate.awk: Run tests from stdin, not input.m4.  Support
1056         stderr munging when using -I examples.
1058         Fix regression in define from 2008-02-22.
1059         * m4/m4module.h (m4_symbol_value_copy): Add parameter.
1060         * m4/symtab.c (m4_symbol_value_copy): Support copying $@
1061         back-references.
1062         * m4/macro.c (expand_argument): Update callers.
1063         * modules/m4.c (define, pushdef): Likewise.
1064         * tests/builtins.at (define): Enhance test to catch this.
1066 2008-04-21  Eric Blake  <ebb9@byu.net>
1068         Simplify previous patch.
1069         * tests/m4.in: Compress assignment.
1070         Suggested by Gary V. Vaughan.
1072         Fix --disable-shared testsuite regression from previous patch.
1073         * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
1074         will also work.
1076         Fix spelling of attribution to Christopher Strachey.
1077         * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
1078         * THANKS: Update.
1079         Reported by Fernando Carrijo.
1081 2008-04-17  Eric Blake  <ebb9@byu.net>
1083         Fix testsuite bug when SIGPIPE is ignored.
1084         * tests/builtins.at (divert): Consume all of m4's output, to avoid
1085         spurious write failure.
1086         * src/main.c (main): In batch mode, restore default handling of
1087         SIGPIPE.
1088         * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
1089         * THANKS: Update.
1090         Reported by Bob Proulx, via his autobuilder.
1092 2008-04-15  Eric Blake  <ebb9@byu.net>
1094         Fix 'make installcheck' after './configure --prefix-progname'.
1095         * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
1096         program name.
1097         (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
1098         * tests/builtins.at (patsubst): Avoid space-tab.
1099         (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
1100         * tests/options.at (--debugfile): Likewise.
1101         * tests/others.at (stdin seekable): Likewise.
1102         (fstab): Avoid space-tab.
1103         * Makefile.am (installcheck-local): Accomodate transformed name.
1104         (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
1105         during 'make distcheck'.
1106         * cfg.mk: New file, borrowed from branch.
1108         Update prerequisite tools to match recent releases.
1109         * configure.ac (AC_PREREQ): Rely on released autoconf.
1110         (LT_PREREQ): Rely on released libtool.
1111         * tests/testsuite.at (m4_version_prereq): Update dependence.
1112         * bootstrap: Mention prerequisites.
1114         Work around OS/2 limitation of printf(1).
1115         * tests/null.m4: Use m4, not printf, to generate NUL byte.
1116         * tests/null.out: Check for esyscmd failure.
1117         Reported by Elbert Pol.
1119 2008-04-14  Eric Blake  <ebb9@byu.net>
1121         Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
1122         Improve arg_print to handle builtin tokens when printing to a
1123         known chain, rather than always flattening builtins.  This allows
1124         m4wrap and $@ back-references to handle embedded builtin tokens.
1125         Memory impact: none.
1126         Speed impact: slight penalty, from more bookkeeping.
1127         * m4/m4module.h (m4_push_builtin): Add parameter.
1128         (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
1129         (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
1130         * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
1131         (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
1132         ...to these, in some cases adding a parameter.
1133         (m4__append_builtin): New prototype.
1134         * m4/builtin.c (m4_builtin_print): Alter signature to print
1135         builtin to a growing symbol chain.
1136         * m4/symtab.c (m4__symbol_value_print): Alter signature.
1137         (m4_symbol_print, dump_symbol_CB): Adjust callers.
1138         * m4/input.c (builtin_peek, builtin_read, builtin_unget)
1139         (builtin_print, builtin_funcs): Delete, handled via composite
1140         blocks now.
1141         (struct m4_input_block): Delete u.builtin member.
1142         (init_builtin_token): Only use composite block.
1143         (m4__append_builtin): New function.
1144         (m4_push_builtin, m4__push_wrapup_init): Alter signature.
1145         (m4__push_symbol): Allow builtin tokens.
1146         (m4__push_wrapup_finish): Rename.
1147         (composite_print, m4_print_token): Adjust callers.
1148         * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
1149         tokens.
1150         (m4__arg_print): Alter signature.
1151         (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
1152         callers.
1153         * modules/m4.c (m4wrap): Allow builtin tokens.
1154         (defn, errprint): Adjust callers.
1155         * modules/gnu.c (builtin): Likewise.
1156         * doc/m4.texinfo (M4wrap): New test.
1157         (Debuglen): Adjust expected output.
1159         Stage 21a: Optimize checks for end of input.
1160         Create a new polymorphic input block type, which always fails with
1161         CHAR_EOF, so that remaining input routines no longer have to check
1162         for NULL input block.
1163         Memory impact: none.
1164         Speed impact: noticeable improvement, from fewer conditionals.
1165         * m4/input.c (eof_funcs, input_eof): New objects.
1166         (eof_peek, eof_read, eof_unget): New functions.
1167         (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
1168         (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
1169         (m4_input_exit): Use placeholder to guarantee non-NULL isp and
1170         wsp.
1171         (next_char): Rename retry to allow_unget, and change sense for
1172         easier manipulation.  All callers changed.
1174         Improve OS/2 detection.
1175         * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
1176         are defined, not just the first.  The testsuite ensures that
1177         exactly one gets defined.
1178         * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
1179         what other pre-defined macros it has.
1180         * THANKS: Update.
1181         Reported by Elbert Pol.
1183         Ensure __m4_version__ is unquoted.
1184         * tests/builtins.at (__m4_@&t@version__): Augment test.
1186         Avoid GNU make failure on tarball.
1187         * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
1189 2008-04-10  Eric Blake  <ebb9@byu.net>
1191         Allow back-referenced macro names; fixes 2008-03-13 regression.
1192         * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
1193         * m4/utility.c (m4_symbol_value_lookup): Change signature.
1194         * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
1195         Adjust all callers.
1196         * tests/others.at (ifndef): New test.
1198         Be namespace clean for M4 version; fixes 2008-04-08 regression.
1199         * configure.ac (version): Rename...
1200         (M4_VERSION): ...to this, since using 'version' broke po.m4.
1202 2008-04-09  Eric Blake  <ebb9@byu.net>
1204         Mention 1.4.11 release.
1205         * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
1206         (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
1207         (Format): Add test of C99 hex-float parsing.
1208         * NEWS: Mention 1.4.11 release.
1209         * tests/builtins.at (divert): Add additional test.
1211 2008-04-08  Eric Blake  <ebb9@byu.net>
1213         Overhaul inter-version releases to work with git.
1214         * configure.ac (version): New variable, which has nicer version
1215         contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
1216         (TIMESTAMP): Delete, since CVS id expansion died with transition
1217         to git.
1218         (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
1219         * build-aux/mkstamp: Delete, no longer used.
1220         * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
1221         rebuilds when timestamps don't matter.
1222         (MKSTAMP): Delete, no longer used.
1223         (EXTRA_DIST): No longer worry about mkstamp.
1224         (.version): New rule and distributed file.
1225         (doc/m4.1, tests/package.m4): Depend on .version, not
1226         configure.ac, for timestamp.
1227         * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
1228         * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
1229         * src/main.c (main): Likewise.
1231 2008-03-28  Eric Blake  <ebb9@byu.net>
1233         Use GNUmakefile module.
1234         * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1235         * Makefile.am: Split off maintainer rules...
1236         * maint.mk: ...into this new file.
1238 2008-03-18  Eric Blake  <ebb9@byu.net>
1240         Stage 20b: make m4wrap obey POSIX fifo ordering.
1241         Improve input engine to support location changes within symbol
1242         chains, then convert m4wrap to always build symbol chain.
1243         Memory impact: none.
1244         Speed impact: slight penalty, from more m4wrap bookkeeping.
1245         * m4/m4module.h (m4_wrap_args): Add prototype.
1246         * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1247         (struct m4__symbol_chain): Add struct u_l.
1248         * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1249         new link type.
1250         (composite_peek, composite_read, composite_clean): Handle location
1251         link.
1252         * m4/macro.c (m4_wrap_args): New function.
1253         * modules/m4.c (m4wrap): Use it.
1254         * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1255         (Extensions): Document extension of multiple arguments.
1256         (Location, Improved m4wrap): Adjust example to match FIFO order.
1257         * tests/builtins.at (wrap): Likewise.
1258         * NEWS: Document this change.
1260 2008-03-17  Eric Blake  <ebb9@byu.net>
1262         Stage 20a: reduce unget's in input engine.
1263         Now that out-of-range input placeholders like CHAR_BUILTIN are
1264         consumed outside of next_char, next_token should always consume
1265         rather than peek at the first character.  Fewer peeks results in
1266         less ungetc overhead.
1267         Memory impact: none.
1268         Speed impact: noticeable improvement, from fewer function calls.
1269         * m4/input.c (struct input_funcs): Alter read_func prototype.
1270         (next_char, file_read, buildin_read, string_read, composite_read):
1271         Add allow_argv parameter.
1272         (init_builtin_token, init_argv_symbol): Require all prior input to
1273         be consumed.
1274         (m4_skip_line, match_input, consume_syntax): Adjust callers.
1275         (m4__next_token): Consume first byte without peek.
1277         Update for fresh bootstrap.
1278         * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1280 2008-03-15  Eric Blake  <ebb9@byu.net>
1282         Document join, in order to fix bug in m4wrap example.
1283         * examples/join.m4: New file.
1284         * examples/wraplifo2.m4: Likewise.
1285         * Makefile.am (EXTRA_DIST): Add new files.
1286         * doc/m4.texinfo (Improved m4wrap): New node.
1287         (Defn, Location): Enhance tests.
1288         (Shift): Document the composite macro join.
1289         (Incompatibilities): Move documentation of LIFO vs. FIFO...
1290         (M4wrap): ...here, to match improved example.
1292 2008-03-13  Eric Blake  <ebb9@byu.net>
1294         Stage 19c: allow builtin tokens in more macros.
1295         Allow builtin tokens inside symbol chains, although for now, they
1296         are not allowed inside comments or quotes.  Enable builtin token
1297         handling in more macros, if only to consistently diagnose invalid
1298         macro names.
1299         Memory impact: none.
1300         Speed impact: slight impact, due to more bookkeeping.
1301         * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1302         prototypes.
1303         * m4/m4private.h (enum m4__symbol_chain_type): Add
1304         M4__CHAIN_FUNC.
1305         (struct m4__symbol_chain): Add builtin member.
1306         * m4/utility.c (m4_symbol_value_lookup): New method.
1307         * m4/builtin.c (m4_builtin_print): New function.
1308         * m4/symtab.c (m4_symbol_value_print): Use it.
1309         * m4/input.c (builtin_print): Likewise.
1310         (m4__push_symbol): Allow pushing builtin tokens.
1311         (composite_peek, composite_read, composite_unget, composite_clean)
1312         (composite_print): Handle builtin tokens.
1313         (init_builtin_token): Allow builtin tokens from composite input.
1314         (m4__next_token): Flatten builtins inside comment or string.
1315         * m4/macro.c (expand_argument): Strengthen assertion.
1316         (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1317         Handle builtin tokens.
1318         (arg_symbol): Add parameter, and allow NULL level.
1319         (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1320         (m4_arg_text): Ensure all builtins have been flattened.
1321         * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1322         (undefine, m4_dump_symbols): Warn on invalid macro names.
1323         (ifdef, ifelse, shift): Handle builtin tokens.
1324         * modules/gnu.c (m4symbols): Likewise.
1325         * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1326         behavior.
1327         (Debuglen): Likewise, and remove xfail.
1328         * NEWS: Mention the change.
1330         Stage 19b: invert sense of bit for handling builtin tokens.
1331         Pass builtin tokens by default, rather than as the exception, so
1332         that the logic can consistently refer to flattening arguments.
1333         Memory impact: none.
1334         Speed impact: none.
1335         * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1336         (M4_BUILTIN_GROKS_MACRO): Rename...
1337         (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1338         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1339         (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1340         this.
1341         * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1342         (m4_symbol_value_groks_macro): Likewise...
1343         (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1344         this.
1345         * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1346         (m4_symbol_value_flatten_args): ...to this.
1347         * m4/macro.c (collect_arguments): Accomodate changed sense.
1348         * m4/module.c (m4__module_open): Require arguments if flattening
1349         is requested.
1350         * m4/input.c (m4_push_string_finish): For now, flatten all
1351         builtins pushed as back-references.
1352         * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1353         * modules/import.c (m4_builtin_table): Likewise.
1354         * modules/load.c (m4_builtin_table): Likewise.
1355         * modules/modtest.c (m4_builtin_table): Likewise.
1356         * modules/mpeval.c (m4_builtin_table): Likewise.
1357         * modules/perl.c (m4_builtin_table): Likewise.
1358         * modules/shadow.c (m4_builtin_table): Likewise.
1359         * modules/stdlib.c (m4_builtin_table): Likewise.
1360         * modules/time.c (m4_builtin_table): Likewise.
1361         * modules/m4.c (m4_builtin_table): Likewise.
1362         (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1363         are stringized without preprocessor expansion.
1364         * doc/m4.texinfo (Defn): Update comments to match reality.
1365         (Debuglen): Update test now that user macros pass builtin tokens.
1367         Stage 19a: sort and cache builtins loaded by a module.
1368         Rather than repeatedly using dlsym to browse the builtin table,
1369         copy off the table at module load time.  Then, the input engine
1370         merely refers to the copy instead of duplicating information.
1371         Memory impact: slight penalty, due to more memory per module, but
1372         offset by less memory in input engine.
1373         Speed impact: slight improvement, due to faster builtin lookups.
1374         * m4/m4module.h (m4_set_symbol_value_builtin): Delete.  Use
1375         m4_builtin_find_by_* instead.
1376         (m4_builtin_find_by_func): Change return type.
1377         * m4/m4private.h (m4__builtin): New struct.
1378         (m4_module): Add sorted list of loaded builtins.
1379         (struct m4_symbol_value): Change type of builtin value.
1380         (m4__set_symbol_value_builtin): New prototype and fast accessor.
1381         (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1382         new field type.
1383         * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1384         (m4__set_symbol_value_builtin): ...and populate additional fields,
1385         based on new type.
1386         (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1387         new field type.
1388         * m4/module.c (install_builtin_table): Use cached table.
1389         (compare_builtin_CB): New helper function.
1390         (m4__module_open): Populate table.
1391         (module_remove): Free table.
1392         * m4/builtin.c (compare_builtin_name_CB): New helper function.
1393         (m4_builtin_find_by_name): Rewrite to use sorted table.
1394         (m4_builtin_find_by_func): Change return type.
1395         * m4/input.c (struct m4_input_block): Simplify u_b, since most
1396         fields can be determined from builtin.
1397         (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1398         (m4__next_token): Alter parsing so that only init_builtin_token
1399         consumes a builtin.
1400         (builtin_print, m4_push_builtin): Adjust all users.
1401         * tests/macros.at (Arity, defn, and freeze): Fix typo.
1403         Consistently cast malloc results, for C++ compilation.
1404         * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1405         * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1406         (m4_hash_resize, maybe_grow): Likewise.
1407         * m4/m4.c (m4_create): Likewise.
1408         * m4/macro.c (expand_macro): Likewise.
1409         * m4/output.c (m4_tmpname): Likewise.
1410         * m4/path.c (search_path_add): Likewise.
1411         * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1412         (symtab_fetch): Likewise.
1413         * m4/syntax.c (m4_syntax_create): Likewise.
1414         * modules/gnu.c (regexp_compile): Likewise.
1415         * src/main.c (main): Likewise.
1416         * src/freeze.c (reload_frozen_state): Likewise.
1418 2008-03-06  Eric Blake  <ebb9@byu.net>
1420         Fix nested builtin(`shift',$@) regression from 2008-02-23.
1421         * m4/macro.c (make_argv_ref): Don't output expansion text when
1422         making wrapper for builtin or indir.
1423         * tests/builtins.at (builtin): New test.
1424         * NEWS: Document the fix.
1425         Reported by Andreas Schwab.
1427 2008-03-04  Eric Blake  <ebb9@byu.net>
1429         The gnulib module free was deprecated.
1430         * ltdl/m4/gnulib-cache.m4: Remove free module.
1432 2008-02-29  Eric Blake  <ebb9@byu.net>
1434         Import news from 1.4.10b.
1435         * NEWS: Update from branch.
1437 2008-02-23  Eric Blake  <ebb9@byu.net>
1439         Stage 18: try harder to reuse argv in recursion.
1440         When pushing arguments that contain an existing $@ ref, reuse the
1441         ref rather than creating another layer of wrappers.
1442         Memory impact: noticeable improvement, due to better $@ reuse.
1443         Speed impact: noticeable improvement, due to O(n^2) to O(n)
1444         reduction in unboxed recursion.
1445         * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1446         (m4_push_args): Let make_argv_ref take care of pending data.
1447         * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1448         performance capability.
1449         * tests/others.at (recursion): Add tests to avoid performance
1450         regression.
1452 2008-02-22  Eric Blake  <ebb9@byu.net>
1454         Update NEWS.
1455         * NEWS: Document change to __gnu__ on 2008-02-11.
1457         Stage 17: pass argv through quoted strings.
1458         Allow the concatenation of $@ references with other text input
1459         inside quoted contexts, which requires distinguishing between a
1460         wrapper around many arguments vs. a reference serving as part of a
1461         single argument.  Also optimize based on whether argv contains
1462         builtin tokens that might need flattening to the empty string.
1463         Memory impact: noticeable improvement, due to O(n^2) to O(n)
1464         reduction from total reuse of $@ references.
1465         Speed impact: noticeable improvement, due to O(n^2) to O(n)
1466         reduction in boxed recursion.
1467         * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1468         (M4ARGLEN): Adjust definition.
1469         * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1470         (struct m4_symbol_value): Add wrapper and has_func members.
1471         (struct m4_macro_args): Add flatten and has_func members.
1472         * m4/input.c (append_quote_token): Return argv refs inside quoted
1473         strings.
1474         (init_argv_symbol): Populate new fields.
1475         * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1476         (m4_make_argv_ref): Likewise.
1477         (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1478         fields.
1479         (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1480         new parameter.
1481         * modules/m4.c (ifelse): Adjust caller.
1483 2008-02-22  Gary V. Vaughan  <gary@gnu.org>
1485         Fix regression in argument collection, from 2008-01-21.
1486         * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1487         undo argument collection optimisation for strings, so that
1488         m4_print_token doesn't abort when it otherwise receives an
1489         unprintable M4_SYMBOL_VOID type token.
1491 2008-02-20  Eric Blake  <ebb9@byu.net>
1493         Stage 16: cache quotes and improve m4_arg_print.
1494         Cache rather than always copying quotes when pushing $@ refs; in
1495         particular, reconstruct single-byte quotes on the fly.  Allow NUL
1496         through m4wrap.  Improve sharing of code that prints arguments.
1497         Memory impact: slight improvement, due to cached quotes.
1498         Speed impact: slight improvement, due to less copying.
1499         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
1500         (m4_arg_print): Adjust prototypes.
1501         (m4_dump_args): Delete.
1502         (m4_push_wrapup): Split...
1503         (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
1504         prototypes.
1505         * m4/m4private.h (struct m4_syntax_table): Add cached_quote
1506         member.
1507         (m4__quote_cache, m4__quote_uncache): New prototypes.
1508         * m4/syntax.c (m4_syntax_create): Initialize the cache.
1509         (m4__quote_cache): New function.
1510         (m4_set_syntax): Update caller.
1511         * m4/symtab.c (m4_symbol_value_print): Add parameter.
1512         (m4_symbol_print, dump_symbol_CB): Adjust all callers.
1513         * m4/utility.c (m4_dump_args): Delete; callers should use
1514         m4_arg_print instead.
1515         * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
1516         implementation, and allow embedded NUL.
1517         (m4_print_token, pop_input, composite_print, composite_peek):
1518         (composite_read, append_quote_token): Adjust all callers.
1519         * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
1520         Likewise.
1521         (m4_arg_print): Add parameters.
1522         (trace_pre): Rewrite in terms of m4_arg_print.
1523         * modules/m4.c (errprint): Likewise.
1524         (m4wrap): Rewrite to allow embedded NUL.
1525         (dumpdef): Adjust caller.
1526         * doc/m4.texinfo (Debuglen): Enhance debuglen test.
1527         * tests/null.m4: Test for NUL in m4wrap.
1528         * tests/null.out: Update expected output.
1530         Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
1531         * m4/utility.c (m4_verror_at_line): Properly terminate the string.
1532         Reported by Ralf Wildenhues.
1534         * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
1536 2008-02-19  Eric Blake  <ebb9@byu.net>
1538         Clean up example on filtering defined symbols.
1539         * doc/m4.texinfo (Foreach, Improved foreach): Document another
1540         shortcoming in foreach.m4, and improve filter example by using
1541         foreach2.m4.
1543         * src/main.c (usage): Fix typo.
1545 2008-02-18  Eric Blake  <ebb9@byu.net>
1547         Avoid some magic numbers.
1548         * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
1549         (CHAR_RETRY): Define in terms of UCHAR_MAX.
1550         * m4/syntax.c (m4_syntax_create, set_syntax_set)
1551         (reset_syntax_set, check_is_single_quotes)
1552         (check_is_single_comments, check_is_macro_escaped)
1553         (m4_set_quotes, m4_set_comment): Likewise.
1554         * modules/gnu.c (regexp_compile): Likewise.
1555         * modules/m4.c (translit): Likewise.
1556         * src/freeze.c (produce_syntax_dump): Likewise.
1557         Reported by Ralf Wildenhues.
1559 2008-02-16  Eric Blake  <ebb9@byu.net>
1561         Add regression test for multi-character quote recursion.
1562         * examples/foreach2.m4: Use $0 rather than spelling out name.
1563         * examples/foreachq2.m4: Likewise.
1564         * examples/forloop2.m4: Likewise.
1565         * examples/hanoi.m4: Likewise.
1566         * examples/trace.m4: Likewise.
1567         * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1568         (Improved foreach): Adjust dump from file.
1570         Stage 15: return argv refs back to collect_arguments.
1571         Collect an entire $@ reference at once rather than one argument at
1572         a time, outside of quotes (but inside quotes, $@ is still
1573         flattened for now).  The skip_last field allows concatenation of
1574         $@ with other text when collecting arguments.
1575         Memory impact: noticeable improvement, due to better reuse of $@.
1576         Speed impact: noticeable improvement, due to less parsing.
1577         * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
1578         (enum m4__token_type): Add M4_TOKEN_ARGV.
1579         (struct m4__symbol_chain): Add skip_last member to argv link.
1580         (m4__next_token): Add parameter.
1581         * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
1582         (composite_peek, m4__next_token): Add new parameter.
1583         (composite_read, append_quote_token): Support argv in quotes.
1584         (init_argv_symbol): New function.
1585         (m4__push_symbol, match_input, consume_syntax)
1586         (m4__next_token_is_open, m4_print_token): Adjust callers.
1587         * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
1588         (arg_mark, m4_arg_text, make_argv_ref): Likewise.
1589         (expand_argument, collect_arguments): Handle new token.
1590         (arg_symbol): Drill through $@ reference.
1591         * m4/syntax.c (set_quote_age): Detect disabled comments.
1592         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
1594 2008-02-15  Eric Blake  <ebb9@byu.net>
1596         * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
1598 2008-02-13  Eric Blake  <ebb9@byu.net>
1600         Fix texinfo grammar.
1601         * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
1602         (History): Use @: after abbreviations.
1603         (M4exit): Use correct Latin abbreviation.
1604         (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
1605         between sentences.
1607 2008-02-11  Eric Blake  <ebb9@byu.net>
1609         Allow builtin text macros to specify number of arguments.
1610         * m4/m4module.h (struct m4_macro): Add argument limits to builtin
1611         text macros.
1612         * m4/module.c (install_macro_table): Allow text macros to warn on
1613         extra arguments.
1614         * modules/gnu.c (m4_macro_table): Update all clients.
1615         * modules/load.c (m4_macro_table): Likewise.
1616         * modules/mpeval.c (m4_macro_table): Likewise.
1617         * modules/perl.c (m4_macro_table): Likewise.
1618         * modules/shadow.c (m4_macro_table): Likewise.
1619         * modules/traditional.c (m4_macro_table): Likewise.
1620         * modules/modtest.c (m4_macro_table): Likewise.  Also add text
1621         macros, for testing this.
1622         * doc/m4.texinfo (Standard Modules): Update text, and enhance
1623         test.
1624         * tests/modules.at (modules: text): New test.
1626         Fix regression in command line -D option, from 2006-08-25.
1627         * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
1628         * m4/m4module.h: Fix typo.
1629         * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
1630         of arguments.
1631         * tests/macros.at (Command line define): Enhance test.
1632         * tests/others.at (nul character): Enhance test.
1633         * tests/null.m4: Likewise.
1634         * tests/null.out: Likewise.
1636         Use gnulib's git-merge-changelog driver when available.
1637         * .gitattributes: Add merge attributes for ChangeLog.
1638         * bootstrap: Install driver, if not already present.
1640 2008-02-06  Eric Blake  <ebb9@byu.net>
1642         Fix security hole introduced 2007-11-23.
1643         * m4/utility.c (m4_verror_at_line): Properly escape macro names.
1644         * src/main.c (main): Manage quoteargs defaults.
1645         * doc/m4.texinfo (Indir): Document and test this.
1647         Using raw strtod is not portable.
1648         * ltdl/m4/gnulib-cache.m4: Import the strtod module.
1650 2008-02-02  Eric Blake  <ebb9@byu.net>
1652         Consistently use size_t for number of arguments.
1653         * m4/m4module.h (m4_builtin_func): Alter prototype.
1654         (struct m4_builtin): Adjust type of min_args, max_args.
1655         (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
1656         (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
1657         (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
1658         (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
1659         (m4_arg_print, m4_push_arg): Adjust all clients.
1660         * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
1661         (m4_macro_args): Adjust type of various fields.
1662         (m4__push_arg_quote): Adjust all clients.
1663         * m4/input.c (m4_pop_wrapup): Likewise.
1664         * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
1665         (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
1666         (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
1667         (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
1668         (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
1669         * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
1670         * modules/evalparse.c (m4_evaluate): Likewise.
1671         * modules/gnu.c (changesyntax): Likewise.
1672         * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
1673         (undivert, traceon, traceoff): Likewise.
1674         * modules/m4.h (m4_dump_symbols_func): Likewise.
1675         * modules/perl.c (perleval): Likewise.
1677         Stage 14b: allow pushing argv references.
1678         Push a $@ reference to the input engine in one go, rather than
1679         pushing each element.  For now, argument collection still gets one
1680         argument of a $@ at a time; but the penalties of this patch make
1681         it easier to manage $@ efficiently in future patches.
1682         Memory impact: noticeable penalty, due to larger struct and O(n)
1683         to O(n^2) on unboxed recursion.
1684         Speed impact: noticeable penalty, due to more bookkeeping.
1685         * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
1686         fields.
1687         (struct m4_macro_args): Add level field.
1688         (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
1689         * m4/input.c (m4__push_symbol, composite_peek, composite_read)
1690         (composite_unget, composite_clean, composite_print): Support $@
1691         refs.
1692         * m4/macro.c (collect_arguments): Populate new field.
1693         (expand_macro): Move argv cleanup...
1694         (m4__arg_adjust_refcount): ...to this new function.
1695         (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
1696         (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
1697         helper functions, to add parameters.
1698         (m4_push_args): Adjust caller.
1699         * m4/symtab.c (m4_symbol_value_print): Likewise.
1701         Stage 14a: allow printing argv references.
1702         Refactor symbol-value printing code for better sharing, and to
1703         allow printing a contiguous text representation of a $@ ref.
1704         Memory impact: none.
1705         Speed impact: none.
1706         * m4/m4module.h (m4_arg_print): New prototype.
1707         (m4_symbol_value_print): Alter prototype.
1708         * m4/input.c (struct input_funcs): Add parameter to peek_func.
1709         (file_peek, builtin_peek, string_peek): Ignore new parameter.
1710         (composite_peek): Ignore new parameter, for now.
1711         (composite_clean, pop_input): Rework to minimize indirection, and
1712         to avoid infinite recursion in next patch.
1713         * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
1714         (m4_arg_print): New function.
1715         * m4/symtab.c (m4_symbol_value_print): Update signature.
1716         (m4_symbol_print): Update caller.
1717         * m4/output.c (m4_shipout_string_trunc): Update comments.
1718         * m4/syntax.c (set_quote_age): Require comma as argument separator
1719         when dealing with $@ as a unit.
1720         * tests/builtins.at (ifelse): Augment test.
1721         * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
1723 2008-01-31  Eric Blake  <ebb9@byu.net>
1725         Kill hack for M4 1.4.4.
1726         * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
1727         we require new enough autoconf which in turn requires M4 1.4.5.
1729 2008-01-31  Gary V. Vaughan  <gary@gnu.org>
1730         and Eric Blake  <ebb9@byu.net>
1732         Depend on new libtool to use non-recursive build.
1733         * configure.ac (LT_PREREQ): Bump to alpha release version.
1734         (LTDL_INIT): Choose nonrecursive mode.  Perform sanity check that
1735         installed libtool has correct symbols.
1736         * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
1737         top level.
1738         (AM_CPPFLAGS): Drop directories covered by libtool.
1739         (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
1740         (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
1741         macros, used by libtool.
1742         (lib_LTLIBRARIES): Also used by libtool.
1743         (ltdl/libltdlc.la): Delete, now that libtool does this.
1744         * bootstrap: Mention new requirements.
1745         (LIBTOOLIZE): Provide default program, and run libtoolize prior to
1746         autoreconf.
1747         (autoreconf): Also neutralize libtoolize, since it is run early.
1748         * HACKING: Mention updated prerequisites.
1750 2008-01-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1752         Fix build failure if installed libltdl is used.
1753         * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
1755 2008-01-28  Eric Blake  <ebb9@byu.net>
1757         Depend on newer autoconf, for testsuite -C dir.
1758         * Makefile.am (CD_TESTDIR): Delete, no longer required.
1759         (check-local, installcheck-local, clean-local-tests): Use new -C
1760         option from autotest.
1761         * configure.ac (AC_PREREQ): Bump to 2.61a.347.
1762         * bootstrap: Mention new dependency.
1763         * HACKING: Likewise.
1765 2008-01-27  Eric Blake  <ebb9@byu.net>
1767         Stage 13: push composite text tokens.
1768         Support pushing composite tokens, allowing back-references to be
1769         reused through multiple macro expansions.  Add hueristic that
1770         avoids creating new reference when pushing existing references.
1771         Memory impact: noticeable improvement due to better reference
1772         reuse, except for O(n) to O(n^2) copying in boxed recursion.
1773         Speed impact: slight penalty, due to more bookkeeping.
1774         * m4/m4private.h (m4__push_symbol): Adjust prototype.
1775         * m4/input.c (m4__push_symbol): Add parameter, and support
1776         composite tokens.
1777         (append_quote_token): Add parameter, and support inlining of short
1778         text.
1779         (m4__next_token): Adjust caller.
1780         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1782 2008-01-26  Eric Blake  <ebb9@byu.net>
1784         Stage 12c: add macro for m4_arg_len.
1785         Make a common action easier to type.
1786         Memory impact: none.
1787         Speed impact: none.
1788         * m4/m4module.h (M4ARGLEN): New macro.
1789         * m4/macro.c (process_macro): Adjust all callers.
1790         * m4/utility.c (m4_dump_args): Likewise.
1791         * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1792         (substr): Likewise.
1793         * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1794         (renamesyms): Likewise.
1795         * modules/stdlib.c (setenv): Likewise.
1797         Stage 12b: add m4_string_pair.
1798         Make passing quote delimiters around more efficient.
1799         Memory impact: none.
1800         Speed impact: slight penalty, due to more bookkeeping.
1801         * m4/m4module.h (m4_string_pair): New type.
1802         (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1803         (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1804         Alter signature.
1805         * m4/m4private.h (struct m4_string): Delete.
1806         (struct m4_syntax_table): Combine quote and comment members.
1807         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1808         (m4_get_syntax_ecomm): Adjust accessors.
1809         (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1810         accessors.
1811         * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
1812         Alter signatures.
1813         * m4/input.c (string_print, composite_print, m4_input_print):
1814         All callers updated.
1815         * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
1816         (check_is_single_quotes, m4_set_quotes, set_quote_age)
1817         (m4_get_syntax_lquote, m4_get_syntax_rquote)
1818         (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
1819         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1820         (m4_get_syntax_comments): Likewise.
1821         * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
1822         * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
1823         Likewise.
1824         * modules/m4.c (dumpdef, m4_make_temp): Likewise.
1825         * src/freeze.c (produce_frozen_state): Likewise.
1826         * tests/freeze.at (reloading unknown builtin): Update test.
1828         Stage 12a: make m4_symbol_chain a union.
1829         Shrink size of symbol chains by using a union.
1830         Memory impact: slight improvement, due to smaller struct.
1831         Speed impact: slight improvement, due to less bookkeeping.
1832         * m4/m4private.h (enum m4__symbol_chain_type): New enum.
1833         (struct m4_symbol_chain): Rename...
1834         (struct m4__symbol_chain): ...to this, since it is internal.
1835         * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
1836         callers updated.
1837         * m4/input.c (struct m4_input_block, m4__push_symbol)
1838         (composite_peek, composite_read, composite_unget)
1839         (composite_clean, composite_print, m4__make_text_link)
1840         (append_quote_token): Likewise.
1841         * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
1842         (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
1843         (m4_push_args): Likewise.
1845 2008-01-23  Eric Blake  <ebb9@byu.net>
1847         Adjust to recent libtool interface change.
1848         * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
1849         (LT_WITH_LTDL): Delete, now that it is obsolete.
1850         (LTDL_INIT): Use new libtool macro.
1852 2008-01-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1853         and Eric Blake  <ebb9@byu.net>
1855         Rely on newer automake.
1856         * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
1857         distribution.
1858         * bootstrap: Update automake requirement.
1859         (func_version): Fix --version output, broken since 2007-08-06.
1860         * HACKING: Likewise.  Add lzma requirement.
1861         * Makefile.am (clean-local-src): Not needed any more with newest
1862         Automake.
1863         (clean-local): Adjust.
1864         * TODO: Remove completed item.
1866 2008-01-22  Eric Blake  <ebb9@byu.net>
1868         Doc tweak.
1869         * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
1870         example.
1872 2008-01-21  Eric Blake  <ebb9@byu.net>
1874         Stage 11: full circle for single argument references.
1875         Pass quoted strings through to argument collection in a single
1876         action, so that an argument can be reused throughout macro
1877         recursion if it remains unchanged.
1878         Memory impact: noticeable improvement, due to more reuse in
1879         argument collection stacks; O(n^2) to O(n) on boxed recursion.
1880         Speed impact: noticeable improvement, due to less copying.
1881         * m4/m4module.h (m4_arg_text): Add parameter.
1882         (M4ARG): Adjust.
1883         * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
1884         (m4__make_text_link): New prototype.
1885         (struct m4_symbol_chain): Add quote_age member.
1886         (struct m4_symbol_value): Add end member to chained symbol.
1887         (struct m4_macro_args): Add wrapper member.
1888         * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
1889         (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
1890         composite tokens.
1891         * m4/input.c (make_text_link): Rename...
1892         (m4__make_text_link): ...to this, and export.
1893         (m4_push_string_finish): Adjust caller.
1894         (make_text_link, m4__push_symbol): Update new field.
1895         (file_read, builtin_read, string_read, composite_read, next_char):
1896         Add parameter.
1897         (m4_skip_line, match_input, consume_syntax): Adjust callers.
1898         (append_quote_token): New function.
1899         (m4__next_token): Pass quoted strings onto argument collection.
1900         (m4_print_token) [DEBUG_INPUT]: Update.
1901         * m4/macro.c (expand_argument): Collect composite arguments.
1902         (collect_arguments): Update new field.
1903         (expand_macro): Reduce ref-count of back-references after use.
1904         (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
1905         names.
1906         (m4_is_arg_text): Also recognize composite symbols as text.
1907         (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
1908         (m4_arg_equal): Compare composite symbols.
1909         (m4_push_arg, m4_push_args): Handle composite symbols.
1910         (m4_arg_symbol): Relax assertion.
1911         (process_macro): Use single-argument references.
1912         * m4/output.c (m4_shipout_string_trunc): Update comment.
1913         * tests/macros.at (Rescanning macros): Augment test.
1915 2008-01-16  Eric Blake  <ebb9@byu.net>
1917         Stage 10: avoid extra copying of strings and comments.
1918         When collecting tokens that are immune to further expansion, avoid
1919         copying data from one obstack to another by outputting it into the
1920         destination obstack to begin with.  Also reduce copying done in
1921         format builtin.
1922         Memory impact: slight improvement, due to better obstack usage.
1923         Speed impact: noticeable improvement, due less data copying.
1924         * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
1925         modules.
1926         * m4/m4private.h (m4__token_type): Adjust prototype.
1927         * m4/input.c (m4__next_token): Support new parameter.
1928         * m4/macro.c (m4_macro_expand_input, expand_token)
1929         (expand_argument, collect_arguments): Adjust callers.
1930         * modules/m4.c (ntoa): Tighten buffer size.
1931         * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
1932         * modules/format.c (arg_int, arg_long, arg_double): New helper
1933         functions, to detect overflow or unparsed characters.
1934         (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
1935         missing or excess arguments.
1936         (format): Likewise, and also output directly into obstack if there
1937         is room.
1938         * doc/m4.texinfo (History): Update for new year.
1939         (Format): Test for new warnings.
1941 2008-01-15  Eric Blake  <ebb9@byu.net>
1943         * TODO: Update with some newer URLs.
1945         Verify linear `index'.
1946         * tests/builtins.at (index): New test.
1947         (translit): Make test take longer, to make quadratic algorithms
1948         more apparent.
1950 2007-12-20  Eric Blake  <ebb9@byu.net>
1952         Stage 9: share rather than copy single-arg refs.
1953         Use hooks of previous patch to create back-references to arguments
1954         in the input engine, and inline short text rather than always
1955         creating a FIFO link.  Also start testing embedded NUL behavior.
1956         Until the argument collection engine also shares references, the
1957         memory usage increases.
1958         Memory impact: noticeable penalty, due to longer life of argv
1959         changing O(n) to O(n^2) on boxed recursion.
1960         Speed impact: slight improvement, due less data copying.
1961         * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
1962         * m4/m4module.h (m4_arg_scratch): New prototype.
1963         * m4/m4private.h (m4__push_symbol): Add parameter.
1964         (m4_arg_scratch): Add fast accessor.
1965         (struct m4): Add expansion_level member, taken...
1966         * m4/macro.c (expansion_level): ...from here.  Adjust all users.
1967         (expand_argument): Minor cleanup.
1968         (expand_macro): Track scratch space per macro call.
1969         (m4_arg_scratch): New function.
1970         (m4_make_argv_ref): Call new function.
1971         (m4_push_arg): Push reference to $0.
1972         (m4_push_args): Rework separator usage, since separators will
1973         usually be inlined.
1974         (process_macro): Allow embedded NUL.
1975         * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
1976         (m4__push_symbol): Add parameter.  Inline short strings, and save
1977         references through rescanning.
1978         * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
1979         * modules/m4.c (errprint, index): Handle NUL transparently.
1980         (dumpdef, translit): Use scratch space, rather than expansion
1981         stack.
1982         * modules/gnu.c (renamesyms, m4symbols): Likewise.
1983         * tests/others.at (nul character): New test.
1984         (iso8859): Quote absolute file name, remove XFAIL.
1985         * tests/iso8859.m4: Avoid raw NUL in output.
1986         * tests/null.m4: New file.
1987         * tests/null.out: Likewise.
1988         * tests/null.err: Likewise.
1989         * Makefile.am (OTHER_FILES): Distribute new files.
1990         * .gitattributes: Treat new files as text.
1992 2007-12-17  Eric Blake  <ebb9@byu.net>
1994         Stage 8: extend life of references into argv.
1995         Add hooks to lengthen the lifetime of arguments reused in a macro
1996         expansion, rather than always discarding arguments at the end of
1997         expand_macro.  Rework the expand_macro obstacks to handle longer
1998         lifetimes.  For now, the hooks remain unused.
1999         Memory impact: slight penalty, due to larger structs.
2000         Speed impact: slight penalty, due to more bookkeeping.
2001         * m4/system_.h (obstack_regrow): Delete.
2002         * m4/m4private.h (struct m4_symbol_chain): Add level field.
2003         (m4__push_symbol): Adjust prototype.
2004         (m4__adjust_refcount): New prototype.
2005         (DEBUG_MACRO) [DEBUG]: New debug control.
2006         (struct m4__macro_arg_stacks): New structure.
2007         (struct m4): Add arg_stacks, stacks_count fields.
2008         * m4/m4module.h (m4_make_argv_ref): Add parameter.
2009         * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
2010         context->arg_stacks.
2011         (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
2012         conditional on M4_DEBUG_MACRO envvar.
2013         (collect_arguments): Adjust signature.
2014         (expand_macro): Rework obstack handling.
2015         (m4__adjust_refcount, arg_mark): New functions.
2016         (m4_make_argv_ref): Populate new field.
2017         (m4_push_arg, m4_push_args): Track inuse.
2018         (process_macro): One less cast.
2019         * m4/m4.c (m4_delete): Clean up arg_stacks.
2020         * m4/input.c (make_text_link): Use new field.
2021         (m4__push_symbol, file_clean): Update signature.
2022         (composite_read): Bump refcount when done with reference.
2023         (composite_clean): New function.
2024         (pop_input): Adjust caller.
2025         * m4/debug.c (m4_debug_message): Make assertion match comment.
2026         * modules/gnu.c (builtin, indir): Adjust callers.
2027         * tests/builtins.at (ifelse): New test.
2028         (exp): Move and rename...
2029         * tests/others.at (countdown): ...to this.
2030         * doc/m4.texinfo (Improved foreach): Fix tracing usage in
2031         example.
2033 2007-12-13  Eric Blake  <ebb9@byu.net>
2035         Yet more rewording.
2036         * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
2037         the previous patch.
2039         * THANKS: Update.
2041 2007-12-13  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
2043         * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
2044         example.
2045         Reported by Giovanni Toffetti.
2047 2007-12-11  Eric Blake  <ebb9@byu.net>
2049         Stage 7: use chained input support in input parser.
2050         Allow the LIFO input engine to rescan a macro expansion composed
2051         of smaller chunks of FIFO data, rather than the old approach of a
2052         monolithic string.  For now, all chunks are still copied.
2053         Memory impact: slight penalty, due to FIFO chain overhead.
2054         Speed impact: slight penalty, due to extra bookkeeping.
2055         * m4/m4private.h (m4__push_symbol): New prototype.
2056         (struct m4_symbol_chain): Add const-safety.
2057         * m4/symtab.c (m4_symbol_value_print): Simplify.
2058         (dump_symbol_CB): Update caller.
2059         * m4/input.c (struct m4_input_block): Alter u_c member, first
2060         introduced 2006-10-25, but unused until now.
2061         (composite_peek, composite_read, composite_unget)
2062         (composite_print, init_builtin_token): Rewrite accordingly.
2063         (m4_push_wrapup): No longer need trailing NUL.
2064         (m4__push_symbol, make_text_link): New functions.
2065         (m4_push_string_finish): Use them.
2066         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2067         (expand_macro): Simplify logic of nesting_limit.
2068         * src/main.c (main): Likewise.
2069         * doc/m4.texinfo (Dumpdef): Augment test.
2071 2007-12-08  Eric Blake  <ebb9@byu.net>
2073         Stage 6: convert builtins to push arg at a time.
2074         Add new methods to factor all builtins whose expansion includes an
2075         argument, making back-reference creation easier in future patches.
2076         Factor out length-limited printing to obstacks, and use -1 rather
2077         than 0 for unlimited length.
2078         Memory impact: none.
2079         Speed impact: slight improvement, due to better code sharing.
2080         * m4/m4module.h (m4_shipout_text): Rename...
2081         (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
2082         that does not worry about sync lines.
2083         (m4_shipout_string_trunc): New prototype.
2084         * m4/output.c (m4_shipout_text): Rename...
2085         (m4_divert_text): ...to this.
2086         (m4_shipout_string): Move guts...
2087         (m4_shipout_string_trunc): ...to this new function.
2088         * m4/macro.c (m4_push_arg, m4_push_args): New functions.
2089         (expand_token, process_macro): Update callers.
2090         * m4/input.c (string_print): Likewise.
2091         * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
2092         Likewise.
2093         * modules/gnu.c (patsubst): Likewise.
2094         (debuglen): Use SIZE_MAX for unlimited debug length.
2095         * src/main.c (main): Likewise.
2096         * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
2097         zero.
2099 2007-12-07  Eric Blake  <ebb9@byu.net>
2101         Minor security fix: Quote output of mkstemp.
2102         * modules/m4.c (m4_make_temp): Produce quoted output.
2103         * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
2104         tests.
2106         Stage 5: add notion of quote age.
2107         Cache the quoting rules that were in effect when a string was
2108         parsed, to avoid reparsing that string if no changequote or other
2109         quote age change took place in the meantime.  A quote_age of 0 is
2110         always safe, but does not benefit from caching.
2111         Memory impact: slight improvement, due to smaller struct in input
2112         engine.
2113         Speed impact: slight penalty, due to more bookkeeping.
2114         * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
2115         (m4_set_symbol_value_text): Adjust prototype.
2116         (m4_has_syntax): Factor out the unsigned char cast.
2117         * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
2118         quote_age members.
2119         (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
2120         functions at this point.
2121         (struct m4_symbol_value, struct m4_macro_args): Add quote_age
2122         member.
2123         (m4_set_symbol_value_text): Adjust fast accessor.
2124         (m4_get_symbol_value_quote_age): New fast accessor.
2125         * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
2126         (m4_get_symbol_value_quote_age): New function.
2127         (m4_symbol_value_copy): Adjust callers.
2128         * m4/macro.c (expand_token): Add parameter, and track quote age.
2129         (expand_argument, collect_arguments): Track quote age.
2130         (m4_macro_expand_input, process_macro, m4_make_argv_ref)
2131         (m4_macro_expand_input): Update callers.
2132         (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
2133         * m4/input.c: Comment cleanups.
2134         (struct m4_input_block): Reduce size.
2135         (m4__next_token): Report quote age.
2136         (m4_push_builtin, init_builtin_token): Update callers.
2137         * m4/utility.c (skip_space): Adjust callers.
2138         * m4/module.c (install_macro_table): Likewise.
2139         * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
2140         (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
2141         quote age.
2142         (set_quote_age): New helper function.
2143         (check_is_single_quotes, check_is_single_comments): Adjust
2144         callers.
2145         * src/freeze.c (reload_frozen_state): Likewise.
2146         * src/main.c (main): Likewise.
2147         * modules/m4.c (define, pushdef): No need to set macro text.
2148         * tests/builtins.at (changequote, defn): New tests.
2149         * examples/wrapfifo.m4: New file.
2150         * examples/wraplifo.m4: New file.
2151         * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
2153 2007-12-04  Eric Blake  <ebb9@byu.net>
2155         Fix builds with OpenBSD make.
2156         * Makefile.am (HELP2MAN): New macro.
2157         (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
2158         srcdir.
2159         * README: Update copyright.
2160         * HACKING: Mention help2man and makeinfo dependencies.
2162 2007-11-29  Eric Blake  <ebb9@byu.net>
2164         Stage 4: route indir, builtin through ref; make argv opaque.
2165         Finish making struct opaque to all but the input engine, by
2166         reworking obstack usage in expand_macro to better support creation
2167         of a $@ reference.  Canonicalize the empty argument, to allow
2168         pointer comparison optimizations.
2169         Memory impact: slight penalty, due to larger struct.
2170         Speed impact: slight improvement, due to fewer function calls.
2171         * m4/system_.h (obstack_regrow): Fix precedence.
2172         * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
2173         New prototypes.
2174         (struct m4_macro_args): Move...
2175         * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
2176         to modules.  Add has_ref member.
2177         (bool_bitfield): New helper typedef.
2178         (struct m4_symbol_chain): Add flatten and len members.
2179         * m4/macro.c (empty_symbol): New placeholder, for optimizing
2180         comparison with empty string.
2181         (m4_macro_expand_input): Initialize it.
2182         (collect_arguments): Alter signature, and populate new fields.
2183         (trace_pre, trace_post): Remove redundant parameter.
2184         (expand_macro): Alter handling of obstacks.
2185         (m4_arg_symbol): Account for wrapped argv.
2186         (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
2187         (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
2188         * modules/m4.c (ifelse, syscmd): Likewise.
2189         * modules/evalparse.c (m4_evaluate): Likewise.
2190         (undefine, popdef, m4_dump_symbols): Optimize.
2191         * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
2192         methods.
2193         (changesyntax, regexp): Optimize.
2194         * m4/output.c (diversion_storage): Use typedef.
2196         Stage 3b: cache length, rather than computing it, in modules.
2197         Use cached token length in builtins and output engine.
2198         Memory impact: none.
2199         Speed impact: noticeable improvement, due to fewer function calls.
2200         * m4/hash.c (m4_hash_remove): Avoid double free on remove
2201         failure.
2202         * m4/output.c (m4_shipout_string): Change semantics of len param.
2203         (m4_shipout_int): Use cached length.
2204         * m4/input.c (m4_push_string_finish): Likewise.
2205         * modules/m4.h (m4_make_temp_func): Add parameter.
2206         * m4/macro.c (expand_token, m4_arg_len): Use cached length.
2207         (collect_arguments, expand_macro): Alter signature.
2208         (trace_format): Don't use out-of-scope buffer.
2209         (process_macro): All callers changed.
2210         * m4/utility.c (m4_dump_args): Likewise.
2211         * m4/symtab.c (m4_symbol_value_print): Likewise.
2212         * modules/gnu.c (__file__, __program__, builtin, indir)
2213         (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
2214         renamesyms, patsubst, regexp, regexp_compile): Likewise.
2215         * modules/load.c (m4modules): Likewise.
2216         * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
2217         (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
2218         * modules/perl.c (perleval): Likewise.
2219         * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
2220         (hostname, uname, setenv): Likewise.
2221         * modules/mpeval.c (numb_obstack): Likewise.
2222         * src/freeze.c (dump_symbol_CB): Likewise.
2223         * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
2224         * tests/builtins.at (mkstemp): Likewise.
2225         * tests/others.at (iso8859): XFAIL this test, now that
2226         length-based handling allows NUL through part but not all of M4.
2228 2007-11-28  Eric Blake  <ebb9@byu.net>
2230         Stage 3a: cache length, rather than computing it, in libm4.
2231         Cache the length of a token in the input engine and symbol table,
2232         to avoid repeating lots of strlen calls.  Additionally, by using
2233         obstack length rather than strlen, the input engine can now
2234         support embedded NUL.
2235         Memory impact: slight penalty, due to larger struct.
2236         Speed impact: slight improvement, due to fewer function calls.
2237         * m4/m4module.h (struct m4_macro_args): Cache length.
2238         (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2239         (m4_set_symbol_value_text): Change signature.
2240         * m4/m4private.h (struct m4_symbol_value): Store string length.
2241         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2242         (m4_set_symbol_value_placeholder): Update accordingly.
2243         (m4_set_symbol_value_text): Change signature.
2244         (m4_get_symbol_value_len): New accessor.
2245         * m4/input.c (struct m4_input_block, string_peek, string_read)
2246         (string_unget, string_print, m4_push_string_finish)
2247         (m4_push_wrapup): Track length of string input.
2248         (m4__next_token): Adjust all users of symbol text to track length,
2249         too.
2250         * m4/macro.c (expand_argument, collect_arguments): Likewise.
2251         * m4/module.c (install_macro_table): Likewise.
2252         * modules/gnu.c (builtin, indir): Likewise.
2253         * modules/m4.c (define, pushdef): Likewise.
2254         * src/main.c (main): Likewise.
2255         * src/freeze.c (reload_frozen_state): Likewise.
2256         * m4/symtab.c (m4_symbol_value_copy): Likewise.
2257         (m4_get_symbol_value_len): New function.
2258         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2259         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2260         Adjust implementation.
2262 2007-11-27  Eric Blake  <ebb9@byu.net>
2264         Stage 2: use accessors, not direct reference, into argv.
2265         Outside of macro.c, use accessor methods rather than direct access
2266         into the argv struct.
2267         Memory impact: none.
2268         Speed impact: slight penalty, due to increased function calls.
2269         * m4/m4private.h (m4_arg_argc): New fast accessor.
2270         * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2271         (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2272         prototypes.
2273         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2274         (m4_macro_call): Make argc unsigned.
2275         (M4ARG): Use new accessors.
2276         * modules/m4.c (define, pushdef): Likewise.
2277         (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2278         (traceon, traceoff): Make argc unsigned.
2279         * modules/m4.h (m4_dump_symbols_func): Likewise.
2280         * modules/evalparse.c (m4_evaluate): Likewise.
2281         * modules/gnu.c (builtin, indir): Use new accessors.
2282         (changesyntax): Make argc unsigned.
2283         * modules/perl.c (perleval): Likewise.
2284         * m4/utility.c (m4_dump_args): Use new accessors.
2285         * m4/macro.c (trace_pre): Likewise.
2286         (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2287         (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2288         (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2289         usage.
2291 2007-11-24  Eric Blake  <ebb9@byu.net>
2293         Stage 1: convert m4_symbol_value** into new object.
2294         Pass a variable-size wrapper structure instead of an array to
2295         builtins, so that subsequent optimizations in the structure need
2296         not impact every builtin client.
2297         Memory impact: slight penalty, since struct is larger than array.
2298         Speed impact: slight penalty, due to increased bookkeeping.
2299         * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2300         * m4/m4module.h (m4_macro_args): New type, will be opaque to
2301         modules later.
2302         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2303         (m4_macro_call): Alter signature to use m4_macro_args object.
2304         (M4ARG): Redefine to access new struct.
2305         * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2306         (struct m4_symbol_chain): New type.
2307         (struct m4_symbol_value): Add chain alternative.
2308         * m4/macro.c (collect_arguments): Build new struct.
2309         (expand_macro, m4_macro_call, process_macro, trace_pre)
2310         (trace_post): Adjust implementation to use it.
2311         * m4/utility.c (m4_dump_args): Likewise.
2312         * modules/gnu.c (builtin, indir): Likewise.
2313         * modules/format.c (format): Likewise.
2314         * modules/m4.h (m4_dump_symbols_func): Likewise.
2315         * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2316         (shift, include, errprint, m4wrap): Likewise.
2317         * modules/evalparse.c (m4_evaluate): Likewise.
2319         Pass only macro name to utility functions.
2320         * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2321         * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2322         implementation.
2323         * m4/macro.c (m4_macro_call): Adjust callers.
2324         * modules/gnu.c (builtin, debuglen): Likewise.
2325         * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2326         (substr): Likewise.
2327         * modules/evalparse.c (m4_evaluate): Likewise.
2328         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2329         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2330         Likewise.
2332 2007-11-23  Eric Blake  <ebb9@byu.net>
2334         Add macro name to debugfile messages.
2335         * m4/m4module.h (m4_debug_set_output): Add parameter.
2336         * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2337         name through.
2338         * modules/gnu.c (debugfile): Adjust caller.
2339         * modules/m4.c (m4exit): Likewise.
2340         * src/main.c (main): Likewise.
2342         Factor out handling of macro name in error messages.
2343         * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2344         (m4_warn_at_line): Add new parameter.
2345         * m4/utility.c (m4_verror_at_line): New helper method.
2346         (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2347         parameter.
2348         (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2349         changed.
2350         * m4/debug.c: Likewise.
2351         * m4/input.c: Likewise.
2352         * m4/macro.c: Likewise.
2353         * m4/module.c: Likewise.
2354         * m4/output.c: Likewise.
2355         * m4/path.c: Likewise.
2356         * modules/evalparse.c: Likewise.
2357         * modules/format.c: Likewise.
2358         * modules/gnu.c: Likewise.
2359         * modules/load.c: Likewise.
2360         * modules/m4.c: Likewise.
2361         * modules/mpeval.c: Likewise.
2362         * src/freeze.c: Likewise.
2363         * src/main.c: Likewise.
2365 2007-11-14  Eric Blake  <ebb9@byu.net>
2367         Handle some defn corner cases differently.
2368         * doc/m4.texinfo (Defn): Update documentation; although this still
2369         doesn't match the branch, since it may be changed before 2.0.
2370         * m4/macro.c (expand_argument): Consistently ignore builtins in
2371         concatenation contexts.
2372         * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2374 2007-11-13  Eric Blake  <ebb9@byu.net>
2376         Note: Patches titled Stage 0 through N form a series of patches
2377         which decreases the algorithmic complexity of tail recursion in
2378         macro expansions from O(n^2) to O(n) in both time and memory, then
2379         performs cleanups, such as handling of embedded NUL, made easier
2380         by the code refactoring.
2382         Stage 0: Fix memory leak in tail recursion.
2383         Free expansion text in the input engine as soon as it is parsed,
2384         rather than when the recursive expansion completes.
2385         Memory impact: noticeable improvement, due to reduction from
2386         O(n^2) to O(n) on recursion.
2387         Speed impact: minor improvement, due to better memory usage.
2388         * m4/input.c (pop_input): Add flag parameter and return type.
2389         (next_char): Adjust caller.
2390         (m4_push_string_init): Let go of memory earlier.
2392 2007-11-07  Eric Blake  <ebb9@byu.net>
2394         * tests/macros.at (Rescanning macros): Test more corner cases.
2396 2007-11-06  Eric Blake  <ebb9@byu.net>
2398         * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2400         * Makefile.am (tests/package.m4): Work around bash bug.
2401         Reported by Ralf Wildenhues.
2403 2007-11-05  Eric Blake  <ebb9@byu.net>
2405         For consistency with other GNU projects, use build-aux directory.
2406         * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2407         build-aux.
2408         * bootstrap (config_aux_dir): Likewise.
2409         * Makefile.am (config_aux_dir): Likewise.
2410         * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2412 2007-11-02  Eric Blake  <ebb9@byu.net>
2414         Update some documentation about version control.
2415         * NEWS: M4 is now stored in git.
2416         * HACKING: Likewise.
2417         * README: Likewise.
2418         * bootstrap: Likewise.
2419         * commit: Delete, now that CVS commits are no longer necessary.
2420         * ltdl/config/mailnotify: No longer necessary; git's patch
2421         generation and mail capability is more powerful.
2423         Update to recent gnulib changes.
2424         * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2425         xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2427 2007-11-01  Eric Blake  <ebb9@byu.net>
2429         Improve error message when early end of file occurs.
2430         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2431         (M4wrap): Adjust to new messages.
2432         (Improved capitalize): Enhance test.
2433         * m4/m4private.h (m4__next_token): Adjust prototype.
2434         * m4/input.c (m4__next_token): Add new parameter, and improve
2435         error message.
2436         * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2437         callers.
2438         (expand_argument): Likewise, and add parameter.
2440 2007-10-31  Eric Blake  <ebb9@byu.net>
2442         Test more corner cases.
2443         * tests/macros.at (Rescanning macros): Beef up test.
2444         * doc/m4.texinfo (Changecom): Beef up test.
2445         (Improved foreach): Document alternate foreachq style.
2446         * examples/foreachq3.m4: New file.
2447         * examples/loop.m4: New file.
2448         * Makefile.am (dist_pkgdata_DATA): Distribute them.
2450 2007-10-28  Eric Blake  <ebb9@byu.net>
2452         More test coverage for autoconf usage patterns.
2453         * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2454         * tests/macros.at (Rescanning macros): New test.
2455         * tests/builtins.at (include): Augment test.
2457 2007-10-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2459         * Makefile.am: Adjust getopt handling to latest gnulib layout.
2461 2007-10-27  Eric Blake  <ebb9@byu.net>
2463         Document one use of changequote(`(',`)').
2464         * doc/m4.texinfo (Changequote): Add new test, based on recent
2465         autoconf addition of m4_expand.
2467 2007-10-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2469         * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2471 2007-10-22  Eric Blake  <ebb9@byu.net>
2473         Never let printf failures go undetected.
2474         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2475         xprintf'.
2476         * m4/system_.h: Include xprintf.h.
2477         * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2478         use of printf, xprintf.
2479         * m4/input.c [DEBUG_INPUT]: Likewise.
2480         * m4/module.c [DEBUG_MODULES]: Likewise.
2481         * m4/output.c (m4_shipout_text, m4_shipout_int)
2482         (m4_freeze_diversions): Likewise.
2483         * m4/path.c [DEBUG_INCL]: Likewise.
2484         * m4/symtab.c [DEBUG_SYM]: Likewise.
2485         * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2486         * modules/modtest.c (export_test): Likewise.
2487         * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2488         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2489         Likewise.
2490         * src/main.c (usage): Likewise.
2491         * po/POTFILES.in: Adjust to new file.
2492         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2494 2007-10-18  Eric Blake  <ebb9@byu.net>
2496         Fix 'm4 -F file -t undefined'.
2497         * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
2498         * src/freeze.c (dump_symbol_CB): Also skip void symbols.
2499         * tests/freeze.at (reloading unknown builtin): Test for this bug.
2500         * m4/m4module.h (m4_symtab_apply): Add parameter.
2501         * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
2502         requested.
2503         (m4_symtab_delete, symtab_dump): Adjust callers.
2504         * modules/m4.c (m4_dump_symbols): Likewise.
2506 2007-10-09  Eric Blake  <ebb9@byu.net>
2508         Fix regexp regression of 2007-09-29.
2509         * modules/gnu.c (substitute): Allow NULL buf when no
2510         subexpressions were present.
2511         (regexp): Handle \ escapes even with empty regex.
2512         * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
2514         Cache regex compilation for another autoconf speedup.
2515         * modules/gnu.c (gnu_buf): Replace...
2516         (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
2517         (m4_pattern_buffer): Add fields.
2518         (m4_regexp_compile): Rename...
2519         (regexp_compile): ...to this, and drop no_sub parameter.
2520         Implement caching.
2521         (M4FINISH_HANDLER): Clean up entire cache.
2522         (m4_regexp_search): Rename...
2523         (regex_search): ...to this, adjust to new struct contents, and add
2524         no_sub parameter.
2525         (m4_regexp_substitute): Rename...
2526         (regexp_substitute): ...to this.
2527         (substitute, patsubst, regexp, renamesyms): Adjust callers.
2529 2007-10-02  Eric Blake  <ebb9@byu.net>
2531         Document quoting pitfalls in capitalize.
2532         * doc/m4.texinfo (Patsubst): Use the examples directory.  Also
2533         document shortfall.
2534         (Improved capitalize): New node.
2535         * examples/capitalize.m4: Update to match manual.
2536         * examples/capitalize2.m4: New file.
2538 2007-10-01  Eric Blake  <ebb9@byu.net>
2540         Another Autoconf usage pattern optimization.
2541         * modules/m4.c (m4_index): Optimize search for one byte.
2542         * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
2543         code paths.
2545 2007-09-29  Eric Blake  <ebb9@byu.net>
2547         Optimize for Autoconf usage pattern.
2548         * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
2550         * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
2552 2007-09-24  Eric Blake  <ebb9@byu.net>
2554         Create .gitignore alongside .cvsignore.
2555         * bootstrap (version control): Update to reflect git usage.
2557 2007-09-13  Eric Blake  <ebb9@byu.net>
2559         * AUTHORS: Fix typo.
2561 2007-09-12  Gary V. Vaughan  <gary@gnu.org>
2563         Be consistent about using 'module' for m4_module types and
2564         'handle' for lt_dlhandle types:
2566         * m4/m4private.h (m4_symbol_value): Rename handle element to
2567         method.  Changed all references.
2568         (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
2569         SYMBOL_HANDLE respectively.  Changed all references.
2570         * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
2571         * m4/builtin.c (m4_builtin_find_by_name)
2572         (m4_builtin_find_by_func): Use module as the parameter name for
2573         pointers of type 'm4_module'.
2574         * m4/module.c (module_remove, m4_get_module_name)
2575         (install_builtin_table, install_macro_table)
2576         (m4_module_make_resident, m4__module_next, m4_module_refcount):
2577         Ditto.
2578         * src/freeze.c (produce_module_dump): Ditto.
2579         * m4/input.c (m4_input_block): Rename handle element to method.
2580         Changed all references.
2581         * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
2582         * modules/load.c: Use module as the variable name for pointers
2583         of type 'm4_module'.
2584         * modules/m4.c: Ditto.
2585         * modules/perl.c: Ditto.
2586         * modules/shadow.c: Ditto.
2588 2007-09-07  Eric Blake  <ebb9@byu.net>
2590         Add refcount builtin.
2591         * modules/load.c (refcount): New builtin.
2592         (m4modules): Use correct type.
2593         * doc/m4.texinfo (Refcount): New section.
2594         * m4/m4private.h (struct m4_module): Add refcount member.
2595         (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
2596         * m4/module.c (m4_module_load): Add symbols to table on first
2597         load by m4, regardless of other libltdl loads of same module.
2598         (m4_module_refcount): Use new struct member, rather than relying
2599         on libltdl count which might be inflated by unrelated loads.
2600         (m4__module_interface): Optimize.
2601         (m4__module_next, m4__module_find): Avoid assertions that could
2602         trigger with unrelated libltdl loads.
2603         (m4__module_open): Track m4 load count.
2604         (m4__module_exit): Only unload what m4 loaded.
2605         (module_remove): Track m4 unloads.
2606         * NEWS: Document new builtin.
2608         More conversion to m4_module*.
2609         * src/freeze.c (produce_module_dump, dump_symbol_CB)
2610         (reload_frozen_state): Use correct type.
2611         * m4/input.c (struct m4_input_block): Likewise.
2612         * m4/symtab.c (dump_symbol_CB): Likewise.
2614         * AUTHORS: Simplify, to match libtool and autoconf layout.
2615         * THANKS: Sync with branch.
2617 2007-09-06  Eric Blake  <ebb9@byu.net>
2619         Wrap lt_dlhandle in struct m4_module.
2620         * m4/m4module.h (includes): No longer require clients to know
2621         about lt_dlhandle.
2622         (m4_module): New opaque declaration.
2623         (m4_export): Delete unused type.
2624         (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
2625         (m4_module_finish_func, m4_module_load, m4_get_module_name)
2626         (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
2627         wrapper.
2628         (m4_module_makeresident, m4_module_refcount): New declarations.
2629         * m4/m4private.h (includes): Move <ltdl.h> here.
2630         (m4_module): New declaration.  Simple for now, but intended for
2631         growth.
2632         (m4__module_open, m4__module_next, m4__module_find)
2633         (m4__symtab_remove_module_references): Use new wrapper.
2634         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2635         Likewise.
2636         * m4/module.c (m4_get_module_name, m4_module_import)
2637         (m4_module_load): Likewise.
2638         (install_builtin_table, install_macro_table): Likewise.  Also,
2639         change return type since these always returned NULL and no one
2640         used the result.
2641         (m4_module_makeresident, m4_module_refcount): New functions.
2642         (m4_module_unload, m4__module_next, m4__module_find): Use new
2643         wrapper.
2644         (m4__module_open): Populate new wrapper, and associate it with the
2645         lt_dlhandle.
2646         (m4__module_exit): Use new wrapper.
2647         (module_remove): Likewise.  Reclaim storage on last use.
2648         (module_close): Delete, and inline into module_remove.
2649         * m4/symtab.c (m4__symtab_remove_module_references): Use new
2650         wrapper.
2651         * modules/load.c (load_init): Use new API.
2652         * modules/m4.c (m4_export_table): Kill unused declaration.
2653         (m4_init): Use new API.
2654         * modules/shadow.c (shadow_init): Use new API.
2655         * src/main.c (main): Adjust callers.
2656         * src/freeze.c (reload_frozen_state): Likewise.
2657         * tests/modules.at (unload load module): New test.
2659 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
2661         * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
2662         * src/m4/.cvsignore: Add xstrtol module sources.
2664 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
2666         Work around a bug in darwin's awk:
2668         * bootstrap (func_get_translations): Use $AWK instead of raw
2669         `awk' so that the user can use an alternative implementation
2670         if the first awk in PATH doesn't behave as expected.
2671         (func_get_translations): The first awk script mangles the last
2672         entry passed to it for at least the awk implementation shipped
2673         with Darwin 8.10.1.  Capture $3 into a variable too to work-
2674         around that problem.
2676 2007-08-29  Gary V. Vaughan  <gary@gnu.org>
2678         As gnulib xstrtol is only used by main, and unconditionally pulls
2679         in a copy of getopt, undo bootstrap change from 2007-08-11 below,
2680         and copy the xstrtol code into src/ so that main() can use it
2681         without pushing the extra code into libm4:
2683         * bootstrap (src_modules): Add getopt and xstrtol modules.
2684         * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
2685         * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
2687 2007-08-11  Eric Blake  <ebb9@byu.net>
2689         Another upstream xstrtol change.
2690         * po/POTFILES.in: Track changes in files containing messages.
2691         * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
2692         need to grab it separately.
2693         * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2694         No longer needed.
2695         (size_opt): Adjust to latest xstrtol interface.
2697 2007-08-10  Eric Blake  <ebb9@byu.net>
2699         Documentation improvements.
2700         * doc/m4.texinfo (Defn): Resync with branch.
2701         (Compatibility, Extensions): Sync with branch.
2703 2007-08-07  Eric Blake  <ebb9@byu.net>
2705         Adjust to gnulib xstrtol changes.
2706         * src/main.c (size_opt): Adjust signature, so that error strings
2707         are easier to translate.
2708         (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
2709         for tracking long options.
2710         (main): Track which long option was used.
2711         * tests/options.at (--debuglen, --nesting-limit): Adjust to change
2712         in error message.
2713         (deprecated options): Test that --arglength spelling shows up in
2714         error message.
2716 2007-08-06  Eric Blake  <ebb9@byu.net>
2718         Normalize all GPL license notices.
2719         * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
2720         at this time.
2721         * Makefile.am: Update license wording.
2722         * bootstrap: Likewise.
2723         * commit: Likewise.
2724         * configure.ac: Likewise.
2725         * ltdl/config/mailnotify: Likewise.
2726         * ltdl/config/mkstamp: Likewise.
2727         * ltdl/m4/debug.m4: Likewise.
2728         * ltdl/m4/gmp.m4: Likewise.
2729         * ltdl/m4/m4-error.m4: Likewise.
2730         * ltdl/m4/m4-getopt.m4: Likewise.
2731         * ltdl/m4/m4-gettext.m4: Likewise.
2732         * ltdl/m4/m4-obstack.m4: Likewise.
2733         * ltdl/m4/m4-regex.m4: Likewise.
2734         * ltdl/m4/stackovf.m4: Likewise.
2735         * m4/builtin.c: Likewise.
2736         * m4/debug.c: Likewise.
2737         * m4/hash.c: Likewise.
2738         * m4/hash.h: Likewise.
2739         * m4/input.c: Likewise.
2740         * m4/m4.c: Likewise.
2741         * m4/m4module.h: Likewise.
2742         * m4/m4private.h: Likewise.
2743         * m4/macro.c: Likewise.
2744         * m4/module.c: Likewise.
2745         * m4/output.c: Likewise.
2746         * m4/path.c: Likewise.
2747         * m4/resyntax.c: Likewise.
2748         * m4/symtab.c: Likewise.
2749         * m4/syntax.c: Likewise.
2750         * m4/system_.h: Likewise.
2751         * m4/utility.c: Likewise.
2752         * modules/evalparse.c: Likewise.
2753         * modules/format.c: Likewise.
2754         * modules/gnu.c: Likewise.
2755         * modules/import.c: Likewise.
2756         * modules/load.c: Likewise.
2757         * modules/m4.c: Likewise.
2758         * modules/m4.h: Likewise.
2759         * modules/modtest.c: Likewise.
2760         * modules/mpeval.c: Likewise.
2761         * modules/perl.c: Likewise.
2762         * modules/shadow.c: Likewise.
2763         * modules/stdlib.c: Likewise.
2764         * modules/time.c: Likewise.
2765         * modules/traditional.c: Likewise.
2766         * po/Makevars: Likewise.
2767         * src/freeze.c: Likewise.
2768         * src/m4.h: Likewise.
2769         * src/main.c: Likewise.
2770         * src/stackovf.c: Likewise.
2771         * tests/builtins.at: Likewise.
2772         * tests/freeze.at: Likewise.
2773         * tests/generate.awk: Likewise.
2774         * tests/m4.in: Likewise.
2775         * tests/macros.at: Likewise.
2776         * tests/modules.at: Likewise.
2777         * tests/options.at: Likewise.
2778         * tests/others.at: Likewise.
2779         * tests/stackovf.test: Likewise.
2780         * tests/testsuite.at: Likewise.
2782 2007-07-22  Eric Blake  <ebb9@byu.net>
2784         Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2785         * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2786         * tests/builtins.at (divert): Enhance test to cover this.
2787         * THANKS: Update.
2788         Reported by Thomas Klausner.
2790 2007-07-20  Eric Blake  <ebb9@byu.net>
2792         Fix 'make distcheck' issues.
2793         * bootstrap: Add more files that might be more up-to-date in
2794         gnulib.
2795         * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2796         * config/m4/gnulib-cache.m4: Update to latest gnulib.
2798 2007-07-16  Eric Blake  <ebb9@byu.net>
2800         * po/POTFILES.in: Track recent translation additions from gnulib
2801         updates.
2803 2007-07-14  Eric Blake  <ebb9@byu.net>
2805         Reflect upstream license .texi changes.
2806         * doc/m4.texinfo (Copying): Rename node...
2807         (GNU General Public License): ...to this.
2808         (GNU Free Documentation License): Adjust node location.
2809         * local/doc/gpl-3.0.texi.diff: Remove file.
2811 2007-07-10  Eric Blake  <ebb9@byu.net>
2813         Upgrade to GPLv3, and document 1.4.10.
2814         * bootstrap: Adjust to GPLv3.
2815         (func_update): Port from branch.
2816         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2817         --local-dir=local --import gpl-3.0'.
2818         * doc/m4.texinfo (History): Mention 1.4.11.
2819         (Copying This Package): New appendix.
2820         * NEWS: Document 1.4.10.
2821         * local/doc/gpl-3.0.texi.diff: New file.
2822         * Makefile.am: Update license.
2823         (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
2824         * commit: Update license.
2825         * configure.ac: Likewise.
2826         * ltdl/config/mailnotify: Likewise.
2827         * ltdl/config/mkstamp: Likewise.
2828         * ltdl/m4/debug.m4: Likewise.
2829         * ltdl/m4/gmp.m4: Likewise.
2830         * ltdl/m4/m4-error.m4: Likewise.
2831         * ltdl/m4/m4-getopt.m4: Likewise.
2832         * ltdl/m4/m4-gettext.m4: Likewise.
2833         * ltdl/m4/m4-obstack.m4: Likewise.
2834         * ltdl/m4/m4-regex.m4: Likewise.
2835         * ltdl/m4/stackovf.m4: Likewise.
2836         * m4/builtin.c: Likewise.
2837         * m4/debug.c: Likewise.
2838         * m4/hash.c: Likewise.
2839         * m4/hash.h: Likewise.
2840         * m4/input.c: Likewise.
2841         * m4/m4.c: Likewise.
2842         * m4/m4module.h: Likewise.
2843         * m4/m4private.h: Likewise.
2844         * m4/macro.c: Likewise.
2845         * m4/module.c: Likewise.
2846         * m4/output.c: Likewise.
2847         * m4/path.c: Likewise.
2848         * m4/resyntax.c: Likewise.
2849         * m4/symtab.c: Likewise.
2850         * m4/syntax.c: Likewise.
2851         * m4/system_.h: Likewise.
2852         * m4/utility.c: Likewise.
2853         * modules/evalparse.c: Likewise.
2854         * modules/format.c: Likewise.
2855         * modules/gnu.c: Likewise.
2856         * modules/import.c: Likewise.
2857         * modules/load.c: Likewise.
2858         * modules/m4.c: Likewise.
2859         * modules/m4.h: Likewise.
2860         * modules/modtest.c: Likewise.
2861         * modules/mpeval.c: Likewise.
2862         * modules/perl.c: Likewise.
2863         * modules/shadow.c: Likewise.
2864         * modules/stdlib.c: Likewise.
2865         * modules/time.c: Likewise.
2866         * modules/traditional.c: Likewise.
2867         * po/Makevars: Likewise.
2868         * src/freeze.c: Likewise.
2869         * src/m4.h: Likewise.
2870         * src/main.c: Likewise.
2871         * src/stackovf.c: Likewise.
2872         * tests/builtins.at: Likewise.
2873         * tests/freeze.at: Likewise.
2874         * tests/generate.awk: Likewise.
2875         * tests/m4.in: Likewise.
2876         * tests/macros.at: Likewise.
2877         * tests/modules.at: Likewise.
2878         * tests/options.at: Likewise.
2879         * tests/others.at: Likewise.
2880         * tests/stackovf.test: Likewise.
2881         * tests/testsuite.at: Likewise.
2883 2007-07-09  Eric Blake  <ebb9@byu.net>
2885         * modules/format.c (format): Avoid undefined behavior with %c.
2887 2007-07-01  Gary V. Vaughan  <gary@gnu.org>
2889         The translation project has moved.
2890         * bootstrap (func_get_translations): Use the new translation
2891         project url.
2892         (TP_URL): Removed.
2894 2007-06-26  Karl Berry  <karl@freefriends.org>  (tiny change)
2896         Match Free Software Directory categories.
2897         * doc/m4.texinfo (dircategory): Update.
2899 2007-05-31  Eric Blake  <ebb9@byu.net>
2901         Add extension to divert builtin.
2902         * modules/m4.c (builtin_divert): Immediately divert second
2903         argument.
2904         * m4/output.c (m4_output_text): Allow 0 length.  Fixes regression
2905         from two days ago.
2906         (m4_shipout_text): Short-circuit on zero length.
2907         * tests/freeze.at (loading format 2): Expand test to catch
2908         regression.  Also check out-of-range version.
2909         * tests/builtins.at (divert): Expand test to check corner cases
2910         of extension.
2911         * doc/m4.texinfo (Divert): Document the extension.
2912         * NEWS: Likewise.
2913         Reported by Daniel Richard G.
2915 2007-05-30  Eric Blake  <ebb9@byu.net>
2917         Port format improvements from branch.
2918         * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
2919         (Format): Enhance section.
2920         * modules/format.c (format): Accept %'hhd, and issue warnings on
2921         unrecognized specifiers.
2922         * modules/gnu.c (builtin_format): Adjust how format is called.
2924 2007-05-28  Eric Blake  <ebb9@byu.net>
2926         * tests/options.at (--syncoutput): Add xfailed test.
2928         Fix sync line interaction with multiline comments.
2929         * doc/m4.texinfo (Preprocessor features): Improve documentation.
2930         (Syncoutput): Improve testsuite.
2931         (Incompatibilities): Add testcase, and document bug.
2932         * src/freeze.c (reload_frozen_state): Don't interfere with
2933         synclines when reloading state.
2934         * m4/input.c (m4__next_token): Report line where multiline tokens
2935         start.
2936         * m4/m4private.h (m4__token_type): Add parameter.
2937         * m4/m4module.h (m4_output_text): Export.
2938         (m4_shipout_text): Add parameter.
2939         * src/macro.c (m4_macro_expand_input, expand_token)
2940         (expand_argument): Adjust callers so that line is passed from
2941         input to output.
2942         * m4/output.c (output_text): Rename...
2943         (m4_output_text): ...to this, and export.
2944         (m4_insert_file, insert_diversion_helper): Update callers.
2945         (m4_shipout_text): Take new parameter for start line of token.
2946         Output at most one syncline per token.
2947         Reported by Sergey Poznyakoff.
2949         Fix large diversion corner cases.
2950         * tests/freeze.at (large diversion): New test.
2951         * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
2952         (make_room_for): Use NULL, not 0, for pointers.
2953         (m4_freeze_diversions): Allow freezing large diversions.
2954         (insert_diversion_helper): Avoid using rewind.
2956         Also run gnulib unit tests during make check.
2957         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2958         --tests-base=tests/gnu --with-tests'.
2959         * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
2960         * Makefile.am (SUBDIRS): Run gnulib tests before ours.
2962 2007-05-25  Eric Blake  <ebb9@byu.net>
2964         * m4/system_.h: Include <stdint.h>, for intmax_t.
2965         * THANKS: Update.
2966         Reported by Daniel Richard G.
2968 2007-05-24  Eric Blake  <ebb9@byu.net>
2970         Provide consistent shift semantics regardless of hardware.
2971         * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
2972         before shifting.
2973         (number, unumber): Always use [u]intmax_t.
2974         Reported by Gary V. Vaughan.
2976         Support POSIX flush semantics on all platforms.
2977         * modules/m4.c (m4_sysval_flush): Rely on gnulib.
2978         * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
2980         Work around cygwin and mingw fseeko bugs.
2981         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2982         fseeko'.
2983         * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
2985 2007-04-25  Eric Blake  <ebb9@byu.net>
2987         Test that regression in 1.4.9's eval doesn't recur.
2988         * doc/m4.texinfo (Eval): Check negative division.
2989         * THANKS: Update.
2991 2007-04-12  Eric Blake  <ebb9@byu.net>
2993         Allow for running test in sticky or setgid directory.
2994         * tests/builtins.at (mkdtemp): Adjust test.
2996         Don't test for broken sed too soon.
2997         * tests/others.at (stdin seekable): Rearrange subtests.
2999         Work around 'stdin seekable' shortcoming on glibc.
3000         * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
3001         * tests/others.at (stdin closed): Adjust to new output.
3002         * src/main.c (process_file): No need to return anything.
3003         (main): Use close_stdin instead of close_stdout.
3004         Reported by Ralf Wildenhues.
3006         Enable autobuild usage.
3007         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3008         autobuild'.
3009         * configure.ac (AB_INIT): Output autobuild information.
3011 2007-04-11  Eric Blake  <ebb9@byu.net>
3013         Address testsuite shortcoming in 'stdout full' on glibc.
3014         * tests/others.at (stdout full): Adjust expected output when more
3015         than 1k text is printed to /dev/full.
3016         Reported by Ralf Wildenhues.
3018 2007-04-10  Eric Blake  <ebb9@byu.net>
3020         * tests/macros.at (Arity and defn): Fix quoting.
3022 2007-04-09  Eric Blake  <ebb9@byu.net>
3024         Address failure of 'seekable stdin' on Mac OS X.
3025         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3026         fflush'.
3028 2007-04-07  Eric Blake  <ebb9@byu.net>
3030         Include <config.h> first in all C files, and not in headers.
3031         Fixes regression for --disable-assert builds from 2007-04-02.
3032         * src/m4.h (includes): Don't include config.h here.
3033         * m4/m4private.h (includes): Likewise.
3034         * m4/builtin.c: Include config.h before anything else.
3035         * m4/debug.c: Likewise.
3036         * m4/hash.c: Likewise.
3037         * m4/input.c: Likewise.
3038         * m4/m4.c: Likewise.
3039         * m4/macro.c: Likewise.
3040         * m4/module.c: Likewise.
3041         * m4/symtab.c: Likewise.
3042         * m4/syntax.c: Likewise.
3043         * m4/utility.c: Likewise.
3044         * src/freeze.c: Likewise.
3045         * src/stackovf.c: Likewise.
3047 2007-04-03  Eric Blake  <ebb9@byu.net>
3049         * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
3050         SIGFPE on x86 architectures.
3051         Reported by Ralf Wildenhues.
3053 2007-04-02  Eric Blake  <ebb9@byu.net>
3055         Fix warnings from last commit.
3056         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3057         fprintf-posix sprintf-posix'.
3058         * m4/macro.c (expand_macro, trace_format): Use correct specifier
3059         for size_t.
3060         (process_macro): Avoid negative array index.
3061         * src/freeze.c (produce_resyntax_dump, produce_module_dump)
3062         (dump_symbol_CB, produce_frozen_state): Use correct specifier for
3063         size_t.
3065 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
3067         Get rid of the last 'differs in signedness' compiler warnings:
3069         * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
3070         a regular 'char *', so variables to store the return address,
3071         and iterate through it should be regular 'char *' too.
3072         * m4/input.c (m4_input_block): The start and current members of
3073         the string part of this union store regular 'char *' types, so
3074         they should be regular 'char *' types too.
3076 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
3078         M4 was designed to have a small number of header files defining
3079         the interfaces to several source files each.  Keeping this in
3080         mind allows us to tidy things up considerably.  Having done this,
3081         it becomes clear that some of the installed headers reference
3082         other headers which are not installed (but that's another patch):
3084         * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
3085         here...
3086         * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
3087         ...to here, so client modules can benefit too.
3088         (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
3089         lowest level to save doing it multiple times elsewhere.
3090         * m4/debug.c (stdio.h): Removed.  The portable <gnu/stdio--.h>
3091         is already included via m4private.h.
3092         * modules/time.c (stdio.h): Ditto.
3093         * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
3094         * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
3095         and <gnu/unistd--.h>,
3096         * m4/m4private.h (m4module.h): Use angle brackets for an installed
3097         file.
3098         * m4/hash.h (system.h): Ditto.
3099         * modules/gnu.c (progname.h): Removed.
3100         * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
3101         * m4/m4private.h (assert.h, errno.h): Already included via
3102         m4/m4module.h.
3103         * m4/input.c (ctype.h): Ditto.
3104         * m4/module.c (ltdl.h): Ditto.
3105         * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
3106         (unistd.h): Ditto.
3107         * m4/path.c (config.h, stdlib.h): Ditto.
3108         * m4/utility.c (config.h): Ditto.
3109         * modules/evalparse.c (assert.h, ctype.h): Ditto.
3110         * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
3111         * modules/import.c (assert.h): Ditto.
3112         * modules/m4.c (assert.h, errno.h): Ditto.
3113         * modules/modtest.c (assert.h): Ditto.
3114         * modules/stdlib.c (sys/types.h): DittAo.
3115         * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
3116         Ditto.
3117         * src/stackovf.c (assert.h): Ditto.
3118         * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
3119         private interfaces when NDEBUG is defined.
3120         * modules/import.c (m4/m4module.h, m4private.h): Ditto.
3121         * modules/load.c (m4/m4module.h, m4private.h): Ditto.
3122         * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
3123         * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
3124         * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
3125         * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
3126         * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
3127         * modules/time.c (m4/m4module.h, m4private.h): Ditto.
3128         * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
3129         * src/m4.h (locale.h): Moved from here...
3130         * src/main.h: ...to here.
3131         (m4private.h): Already included via m4.h.
3132         * src/stackovf.c (m4private.h): Ditto.
3134 2007-03-28  Gary V. Vaughan  <gary@gnu.org>
3136         * Makefile.am (stamp-vcl): Removed.
3137         (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
3139 2007-03-28  Eric Blake  <ebb9@byu.net>
3141         * src/main.c (usage): Improve note to TRANSLATORS.
3142         * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
3144         * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
3145         empty.
3147 2007-03-24  Eric Blake  <ebb9@byu.net>
3149         * m4/output.c (m4_output_init): Update to latest gnulib.
3150         * bootstrap (ltdl/m4/.cvsignore): No longer track generated
3151         .cvsignore in CVS.
3152         * NEWS: Reflect release of 1.4.9.
3153         * THANKS: Update.
3155 2007-03-07  Eric Blake  <ebb9@byu.net>
3157         * AUTHORS: Update
3159         Exercise gnulib's new POSIX *printf modules.
3160         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3161         vasprintf-posix'.
3162         * modules/format.c (format): Support %a and %A.
3163         * doc/m4.texinfo (Format): Test this addition.
3164         * NEWS: Document this addition.
3166 2007-03-03  Eric Blake  <ebb9@byu.net>
3168         * m4/input.c (m4__next_token): Fix synclines when in batch mode.
3169         * doc/m4.texinfo (M4exit): Synch another section.
3170         (Syncoutput): Make similar to other sections.
3172 2007-03-01  Eric Blake  <ebb9@byu.net>
3174         * doc/m4.texinfo: Improve the indices.
3175         (Concept index): Rearrange to be last.
3176         (Sysval): Merge from branch.
3178         * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
3180 2007-02-28  Eric Blake  <ebb9@byu.net>
3182         POSIX XCU ERN 137 was approved.
3183         * modules/mpeval.c (numb_extension): Delete.
3184         * modules/m4.c (numb_extension): Likewise.
3185         * modules/evalparse.c (comma_term, condition_term): Always
3186         implement ?: and , operators.
3187         * m4/symtab.c: Update comment to match reality.
3188         * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
3189         dereferencing context directly when accessor exists.
3190         * src/main.c (usage): Prefer GNU_M4 over EMACS.
3191         (struct macro_definition): Rename...
3192         (struct deferred): ...to match usage.  All uses changed.
3193         * doc/m4.texinfo (Eval): Document this change.
3194         (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
3195         over emacs.
3196         (Preprocessor features, Changesyntax): Fix inaccuracies.
3197         * NEWS: Import branch NEWS items for 1.4.x series.  Document
3198         change in eval.
3200         POSIX XCU ERN 118 was approved.
3201         * modules/m4.c (define): Kill posixly_correct distinction in
3202         define behavior, since POSIX says GNU behavior complies.
3203         * tests/builtins.at (define): Restore original semantics.
3204         * doc/m4.texinfo (Pushdef): Document portability issues with
3205         define.
3206         (Incompatibilities): Clean up wording of what POSIX requires.
3207         * NEWS: Document this.
3209 2007-02-26  Eric Blake  <ebb9@byu.net>
3211         Re-enable clean bootstrap on cygwin.
3212         * Makefile.am (AM_LDFLAGS): For now, export all symbols from
3213         modules, since otherwise we run afoul of current libtool
3214         limitations on cygwin and mingw.
3216 2007-02-25  M. Levinson  <levinsm@users.sourceforge.net>  (tiny change)
3218         * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
3219         memory.  Fixes regression introduced 2007-01-20.
3221 2007-02-25  Eric Blake  <ebb9@byu.net>
3223         * tests/freeze.at (loading format 2): Augment test to catch
3224         regression introduced on 2007-01-20.
3225         * THANKS: Update.
3226         Reported by M. Levinson.
3228         * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3229         latest gnulib.
3231 2007-02-05  Eric Blake  <ebb9@byu.net>
3233         * tests/options.at (--fatal-warnings): New test.
3234         * tests/others.at (stdin seekable): Exit on error.
3235         * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3236         (m4_get_warnings_exit_opt): Access it.
3237         * m4/m4module.h (m4_context_opt_bit_table): Access it.
3238         * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3239         on -EE.
3240         (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3241         exit on -EE.
3242         * src/m4.c (usage): Document new -E behavior.
3243         (main): Make -E an additive option.
3244         * doc/m4.texinfo (Operation modes): Document the change.
3245         Reported by Ralf Wildenhues.
3247         * tests/others.at (stdin seekable): Fix bug in test.
3248         * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3250         * m4/input.c (struct m4_input_block): Remove unused field traced.
3252 2007-02-03  Eric Blake  <ebb9@byu.net>
3253         and Bruno Haible  <bruno@clisp.org>  (tiny change)
3255         * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3256         the examples.
3257         Reported by Bruno Haible.
3259 2007-01-31  Eric Blake  <ebb9@byu.net>
3261         * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3262         failure.
3264 2007-01-26  Eric Blake  <ebb9@byu.net>
3266         * m4/symtab.c (includes): Adjust to latest gnulib.
3267         * modules/m4.c (includes): Likewise.
3269 2007-01-23  Eric Blake  <ebb9@byu.net>
3271         * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3272         extension to make enough room.
3273         (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3274         code in input.c special cases this category.
3275         (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3276         for define(eleventh,${11}) extension.
3277         * m4/syntax.c: Update comments accordingly.
3278         (m4_syntax_create, m4_syntax_code): Handle { and }.
3279         * m4/input.c (m4__next_token): Likewise.
3280         * src/freeze.c (produce_frozen_state): Support new categories.
3281         (reload_frozen_state): When loading version 1, disable syntax
3282         features not present in 1.4.x.
3283         * tests/freeze.at: Sort and rename existing tests.
3284         (loading format 1): Ensure we don't break v1 frozen files that
3285         used raw ${.
3286         (loading format 2, reloading changecom, reloading changesyntax):
3287         New tests.
3288         * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3289         the new syntax categories.
3290         (Arguments): Update the FIXME comment.
3291         (M4wrap): Merge examples from branch, before worrying about fixing
3292         m4wrap to obey POSIX.
3293         (Using frozen files): Start merging from branch.
3294         * NEWS: Update.
3296 2007-01-20  Eric Blake  <ebb9@byu.net>
3298         * src/freeze.c (produce_char_dump): Delete.  Replace with...
3299         (produce_mem_dump): ...this new function, to encode more strings.
3300         Also make the coding easier to read and slightly more compact.
3301         (produce_syntax_dump): Only dump non-default syntax codes.
3302         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3303         Encode non-ASCII characters in user-supplied strings.
3304         (GET_STRING): Accept escape sequences in version 2.
3305         * NEWS: Document this change.
3306         * TODO: Update.
3308 2007-01-16  Eric Blake  <ebb9@byu.net>
3310         Port patch from branch for stack overflow detection on BSD/OS.
3311         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3312         * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3313         ! HAVE_STACK_T_SS_SP]: Use this check.
3314         Reported by Chris McGuire.
3316 2007-01-15  Eric Blake  <ebb9@byu.net>
3318         * tests/builtins.at (__m4_version__): New test.
3319         * modules/traditional.c (m4_macro_table): Provide windows and os2
3320         macros, as appropriate.  Add __traditional__ macro.
3321         * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3322         not __gmp__, to match module name.
3323         * modules/load.c (m4_macro_table): Name the macro __load__, not
3324         __modules__, to match module name.
3325         * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3326         from the branch.
3327         (Standard Modules): Improve wording.
3328         (Incompatibilities): Move platform macros into their own node.
3329         (Load, Unload): Use actual examples.
3330         * NEWS: Document this change.
3331         * THANKS: Update.
3333 2007-01-13  Eric Blake  <ebb9@byu.net>
3335         * doc/m4.texinfo (Mpeval): Add tests.
3336         * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3337         * tests/builtins.at (gmp): ...here.  Rename test to...
3338         (mpeval): ...this.
3339         * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3340         is not available.
3341         * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3342         no_gnu_extensions with posixly_correct_opt, since they were set in
3343         sync.
3344         * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3345         * src/main.c (main): Update caller.
3346         * src/freeze.c (reload_frozen_state): Likewise.
3347         * modules/m4.c (m4wrap): Likewise.
3349 2007-01-12  Eric Blake  <ebb9@byu.net>
3351         * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3352         POSIX, so update the comment.
3353         * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3354         approved by POSIX, so we can always have blind macros, even when
3355         POSIXLY_CORRECT.
3356         (Ifelse): Mention the term `blind builtin'.
3358 2007-01-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3360         * doc/m4.texinfo: Fix a couple of typos.
3362 2007-01-08  Eric Blake  <ebb9@byu.net>
3364         * ltdl/m4/gnulib-cache.m4: Update for new year.
3365         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3366         Reported by Ralf Wildenhues.
3368 2007-01-06  Eric Blake  <ebb9@byu.net>
3370         * m4/m4private.h (to_uchar): Move...
3371         * m4/m4module.h: here, so modules can use it.
3372         * src/main.c (usage, long_options): Support --posix as a synonym
3373         for --traditional.
3374         * modules/m4.c (numb_invert): Detect unsupported x**-y.
3375         (numb_incr, numb_urshift, numb_extension): New macros.
3376         (numb_obstack): Port patch from branch to support radix 1 output.
3377         * modules/mpeval.c (numb_obstack): Use \ for ratios.
3378         (numb_incr, numb_urshift, numb_extension): New macros.
3379         (mpq2mpz): Warn rather than error.
3380         * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3381         enumerators.
3382         (eval_error): Rearrange, so that all ignorable errors are less
3383         than SYNTAX_ERROR.
3384         (eval_text, last_text): Obey C++ type safety rules.
3385         (numb_pow): Change return type.
3386         (exp_term): Adjust caller.
3387         (m4_evaluate): Fail on bad exponent.
3388         (logical_or_term, logical_and_term): Ignore failed ** in short
3389         circuit.
3390         (eval_lex): Fix typos when detecting <<= and >>=.  Use \ instead
3391         of : for ratio.  Support >>>, ,, and ?:.  Port patch from branch
3392         to parse radix 1 numbers.
3393         (condition_term, comma_term): New parse functions.
3394         (shift_term): Support >>>.
3395         (m4_evaluate): Port patch from branch to output radix 1 numbers.
3396         Warn instead of error for most parse problems.
3397         * doc/m4.texinfo (Limits control, Eval): Document these changes.
3398         * NEWS: Document new operators and new command line option.
3400 2007-01-04  Eric Blake  <ebb9@byu.net>
3402         * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3404 2007-01-03  Eric Blake  <ebb9@byu.net>
3406         * doc/m4.texinfo (Format, Incr): More merges.
3407         (Eval): Ensure C precedence rules are met.
3408         * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3409         (not_term, logical_not_term): Delete; these are same precedence
3410         as other unary operators.
3411         (equality_term): New; these are lower precedence than relational
3412         operators.
3413         (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3414         operators for better error messages.
3415         (logical_or_term, logical_and_term): Short-circuit out the error
3416         of division by zero.
3417         (unary_term): Allow consecutive unary operators.
3418         * modules/m4.c (int2numb, numb2int): Delete; these potentially
3419         truncate bits.
3420         (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3421         * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3422         * NEWS: Document this change.
3424 2006-12-27  Eric Blake  <ebb9@byu.net>
3426         * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3427         branch.
3428         * modules/m4.c (substr): Merge from branch.
3430 2006-12-26  Eric Blake  <ebb9@byu.net>
3432         * doc/m4.texinfo (Changesyntax): Check for regressions with
3433         changesyntax(W=...).
3435 2006-12-22  Eric Blake  <ebb9@byu.net>
3437         * m4/m4module.h (m4_set_syntax): Change signature.
3438         * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3439         warning.
3440         (changesyntax): Likewise, and update caller.
3441         * m4/m4private.h (m4_syntax_table): Add orig member.
3442         * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3443         Don't set is_single_quotes and is_single_comments when the begin
3444         character is shadowed by another syntax type.
3445         (m4_syntax_create): Populate default syntax table.
3446         (add_syntax_attribute): Don't lose quote assignment.
3447         (remove_syntax_attribute): Only allow removing rquote or ecomm.
3448         (add_syntax_set, subtract_syntax_set, set_syntax_set)
3449         (reset_syntax_set): New helper routines.
3450         (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3451         to default, and empty chars reverts that key to default.
3452         (check_is_single_quotes, check_is_single_comments): New helper
3453         routines.
3454         * modules/m4.c (changecom): Merge from branch.
3455         * m4/input.c (m4__next_token): Rearrange token recognition order
3456         to macro, quote, comment, in order to match traditional
3457         implementations.
3458         * src/freeze.c (reload_frozen_state): Update caller.
3459         * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3460         modifications.
3461         (Changeresyntax): Revise to match style of surrounding sections
3462         and add more examples.
3463         (Changesyntax): Likewise, and update to new semantics.
3464         * NEWS: Document this change.
3466         * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3467         (M4wrap, Eval, Errprint): Fix typos.
3468         (Divnum): Not necessary to redivert in example.
3470 2006-12-21  Eric Blake  <ebb9@byu.net>
3472         * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3473         from branch.
3475 2006-12-19  Eric Blake  <ebb9@byu.net>
3477         * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3478         * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3479         can track write errors without all other callers warning multiple
3480         times.
3481         (sysval_flush_helper): New function.
3482         (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3483         * modules/gnu.c (esyscmd): Likewise.
3484         * tests/others.at (stdout closed, stdout full): Error message
3485         update.
3487 2006-12-16  Eric Blake  <ebb9@byu.net>
3489         * src/main.c: Fix missing include.
3491         * src/main.c (main): Check for errors when closing stdin.
3492         * modules/m4.c (m4exit): Missed part of previous patch: flush
3493         stdin before a successful exit.
3494         Reported by Ralf Wildenhues.
3496 2006-12-14  Eric Blake  <ebb9@byu.net>
3498         * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
3499         required by POSIX.
3500         * tests/others.at (stdin seekable): New test.
3502 2006-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3504         * doc/m4.texinfo: Fix some typos.
3506 2006-12-04  Eric Blake  <ebb9@byu.net>
3508         * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
3509         sections.
3510         (Modules): Make style consistent.
3512 2006-11-16  Eric Blake  <ebb9@byu.net>
3514         * bootstrap: Relax m4 requirement, thanks to...
3515         * configure.ac (Gettext support): ...this workaround to the 1.4.4
3516         bug.  Undoes restriction added on 2006-11-09.
3518         * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
3519         diversions are now closed when not active.
3520         (divert): Remove check now in the manual.
3521         * tests/others.at (stderr closed): Likewise.
3522         (stdout closed): Add a check.
3523         * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
3524         more docs with branch.
3526 2006-11-14  Eric Blake  <ebb9@byu.net>
3528         Remerge sparse diversion handling from branch.
3529         * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
3530         avltree-oset.
3531         * m4/output.c (diversion_table): Change type to gl_oset_t.
3532         (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
3533         (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
3534         (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
3535         (div0, diversion_storage): New variables.
3536         (diversions, equal_diversion_CB): Deleted.
3537         (threshold_diversion_CB): New callback.
3538         (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
3539         functions.
3540         (m4_tmpfile): Move cloexec action here.
3542         * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
3543         char.
3545 2006-11-13  Eric Blake  <ebb9@byu.net>
3547         Add several new command line options.
3548         * src/main.c (usage): Update.
3549         (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
3550         --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
3551         Make --regexp-syntax argument optional.
3552         (main): Support new options.  Fix regression in interactive
3553         behavior from Nov 8.
3554         * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
3555         M4_OPT_SYNC_OUTPUT_BIT.
3556         * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
3557         syncoutput, to match option.
3558         (m4_parse_truth_arg): New prototype.
3559         * m4/utility.c (m4_parse_truth_arg): Implement it.
3560         * m4/output.c (m4_shipout_text): Adjust sync_output caller.
3561         * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
3562         m4_parse_truth_arg.
3563         * doc/m4.texinfo (Operation modes, Dynamic loading features)
3564         (Preprocessor features, Limits control, Debugging options)
3565         (Command line files): Update documentation.
3566         * tests/builtins.at (mkstemp): Simplify.
3567         * tests/macros.at (Command line pushdef): New test.
3568         (Command line define): Improve.
3569         * tests/options.at (--traceon and --traceoff, --syncoutput): New
3570         tests.
3571         (POSIXLY_CORRECT): Likewise.
3572         (deprecated options): Augment.
3573         (--regexp-syntax): Update, now that -r takes optional arg.
3574         * NEWS: Reformat.  Document new options.
3576 2006-11-11  Eric Blake  <ebb9@byu.net>
3578         One step closer to allowing C++ compilation - don't blindly
3579         convert between char* and unsigned char*.
3580         * m4/m4module.h (m4_set_syntax): Change signature.
3581         * m4/m4private.h (m4_string): Use signed char.
3582         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
3583         (m4_get_syntax_ecomm): No longer a need to cast.
3584         * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
3585         Reflect this change.
3586         * m4/macro.c (expand_argument): Simplify.
3587         (expand_token): Use proper type.
3588         * src/freeze.c (reload_frozen_state): Likewise.
3589         * m4/input.c (MATCH, match_input): Likewise.
3590         * modules/m4.c (translit): Likewise.
3591         * modules/gnu.c (substitute): Simplify.
3593         * m4/macro.c (trace_format): Use canonical type name.
3594         * m4/output.c (m4_freeze_diversions): Likewise.
3595         * src/freeze.c (produce_module_dump, dump_symbol_CB)
3596         (produce_frozen_state): Likewise.
3597         * m4/m4private.h (to_uchar): Grab from branch.
3598         * m4/input.c (string_peek, string_read): Use it.
3599         * m4/utility.c (skip_space): Likewise.
3600         * src/main.c (main): Likewise.
3601         * doc/m4.texinfo (Translit): Remerge from branch.
3602         * tests/builtins.at (translit): Test 8-bit range.
3603         * modules/m4.c (m4_expand_ranges): Merge from branch.
3605 2006-11-09  Eric Blake  <ebb9@byu.net>
3607         * bootstrap: Validate that installed M4 is powerful enough.
3608         Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
3610 2006-11-08  Eric Blake  <ebb9@byu.net>
3612         Merge deferred handling of -D option from branch.
3613         * doc/m4.texinfo (Debugging options, Preprocessor features)
3614         (Dynamic loading features, Operation modes, Invoking m4):
3615         Document this change.
3616         * src/main.c (OPTSTRING): Specify in-order processing.
3617         (process_file): New function.
3618         (main): Use it to interleave files and deferred options.
3619         * tests/macros.at (Command line define): New test.
3620         * tests/generate.awk: Allow '@comment file' as first example
3621         within a node.
3622         * tests/options.at (option grouping): Update to reflect actual
3623         POSIX semantics.
3624         (file names): New test.
3626 2006-11-07  Eric Blake  <ebb9@byu.net>
3628         * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
3629         for failure.
3631         * tests/builtins.at (m4exit): New test; failed on cygwin before
3632         this patch.
3633         * m4/output.c (cleanup_tmpfile): Close files before removing
3634         directory.
3635         (make_room_for, m4_output_exit): Ensure that atexit handler
3636         invoked from m4_error sees consistent state.
3638         * doc/m4.texinfo (Errprint): Merge another doc node.
3639         * tests/builtins.at (dumpdef, errprint): New tests.
3640         * modules/m4.c (errprint): Merge from branch: flush before
3641         printing to stderr.
3643 2006-11-02  Eric Blake  <ebb9@byu.net>
3645         * bootstrap: Update bootstrap requirement wording.
3646         Reported by Bruno Haible.
3648 2006-10-31  Eric Blake  <ebb9@byu.net>
3650         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3651         strstr'.
3652         * doc/m4.texinfo (Translit): Merge from branch.
3653         * modules/m4.c (divert, substr): Ignore excess arguments.
3654         (index, translit): Merge from branch.
3655         * tests/builtins.at (translit): Add a test.
3657 2006-10-30  Eric Blake  <ebb9@byu.net>
3659         * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
3660         checkin.
3661         * m4/symtab.c (m4_get_symbol_value_module): Likewise.
3663         * modules/m4.c (m4_make_temp): Make safe across libtool.
3664         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
3665         * configure.ac (--with-modules): Accomodate changed module
3666         location when doing './configure --enable-debug'.
3668 2006-10-28  Eric Blake  <ebb9@byu.net>
3670         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3671         config-h.'
3673 2006-10-27  Eric Blake  <ebb9@byu.net>
3675         * bootstrap (gnulib): No longer a need to patch after gnulib-tool
3676         --update.
3677         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3678         0.16, since 0.15 is incompatible with our automake requirement.
3680         * m4/macro.c (expand_argument): Fix missing initialization.
3681         * m4/m4private.h (struct m4_symbol_value): Store entire
3682         m4_builtin, not just the func.
3683         (m4_get_symbol_value_func): Update.
3684         (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
3685         fast accessors.
3686         * m4/m4module.h (m4_get_symbol_value_builtin)
3687         (m4_get_symbol_builtin): New prototypes.
3688         (m4_set_symbol_value_func): Delete, replace with...
3689         (m4_set_symbol_value_builtin): New function.
3690         (m4_builtin_find_by_name): Change signature.
3691         * m4/symtab.c (m4_symbol_value_print): Simplify.
3692         (m4_get_symbol_value_func): Update.
3693         (m4_get_symbol_value_builtin): New function.
3694         (m4_set_symbol_value_func): Delete, replace with...
3695         (m4_set_symbol_value_builtin): New function.
3696         (dump_symbol_CB) [DEBUG_SYM]: Simplify.
3697         * m4/builtin.c (m4_builtin_find_by_name): Change signature.
3698         * m4/input.c (struct m4_input_block): Remove unused trace member.
3699         (m4_push_builtin, builtin_print, init_builtin_token): Update
3700         callers.
3701         * m4/module.c (install_builtin_table): Likewise.
3702         * src/freeze.c (reload_frozen_state): Likewise.
3703         * modules/gnu.c (builtin): Make it possible to retrieve a builtin
3704         token, even after the builtin has been undefined.
3705         * doc/m4.texinfo (Builtin): Document new capability.
3706         * NEWS: Likewise.
3708         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3709         tempname'.
3710         * modules/m4.c (m4_make_temp): Use it.
3711         * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
3713 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3715         * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
3716         files.
3718 2006-10-26  Eric Blake  <ebb9@byu.net>
3720         Silence -O2 -Wall -Wwrite-strings warnings.
3721         * m4/m4private.h (m4_symbol_value): Const-ify text.
3722         * m4/m4module.h (m4_get_symbol_value_text)
3723         (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
3724         (m4_set_symbol_value_placeholder): Likewise.
3725         * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
3726         fallout.
3727         * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
3728         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
3729         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
3730         Likewise.
3731         * modules/format.c (format): Likewise.
3732         * src/main.c (main): Likewise.
3733         * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
3734         * modules/shadow.c (shadow, test): Likewise.
3735         * m4/output.c (m4_make_diversion): Don't hold on to empty
3736         diversions.
3737         (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
3738         (m4_freeze_diversions): Likewise.  Don't use uninitialized
3739         variable.
3741         Convert diversions to list instead of sparse array, part 2.
3742         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3743         avltree-list'.
3744         * m4/output.c (m4_diversion): Add next pointer and divnum members.
3745         (diversion_table): Convert to a list instead of a sparse array.
3746         (free_list): Maintain free list of reclaimed diversions.
3747         (equal_diversion_CB, cmp_diversion_CB): New functions.
3748         (m4_output_init): Set up list.
3749         (m4_output_exit): Tear down list.
3750         (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
3751         list iteration.
3752         (m4_make_diversion): Change creation of new diversions.
3753         (m4_insert_diversion_helper): New function, to avoid list
3754         searches.
3755         * tests/builtins.at (divert): The test now passes.
3756         * NEWS: Document this improvement.
3758         Convert diversions to list instead of sparse array, part 1.
3759         * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
3760         for length.
3761         * m4/output.c (diversion, total_buffer_size, output_unused):
3762         Track size in size_t.  All users changed.
3763         (struct diversion): Reduce size now, to compensate for part 2.
3764         (m4_make_diversion, make_room_for): Avoid malloc overflow.
3765         (m4_output_exit): Fix typo in assert.
3766         (m4_output_init, make_room_for, m4_make_diversion)
3767         (m4_insert_diversion, m4_freeze_diversions): Adjust users of
3768         struct m4_diversion to disambiguate the new union.
3769         * tests/builtins.at (divert): Detect this failure.
3771 2006-10-25  Eric Blake  <ebb9@byu.net>
3773         * m4/m4module.h (m4_push_builtin): Add parameter.
3774         * modules/m4.c (defn): Update caller.
3775         * m4/input.c (file_read_init, string_read_init): No longer
3776         needed.
3777         (input_funcs): Change signature of read_func, all callers
3778         updated.
3779         (composite_peek, composite_read, composite_unget),
3780         (composite_print, composite_funcs): New input type.  Not yet
3781         fully utilized, but one step closer to fixing defn.
3782         (m4_input_block): Make every input block track current file and
3783         line.  Rename some members.  Remove unused out_line.  Add support
3784         for composite input block.
3785         (input_change): New flag.
3786         (file_peek, file_read, file_clean, file_unget, file_print):
3787         Update callers.
3788         (m4_push_file, m4_push_builtin, m4_push_string_init)
3789         (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3790         (m4_skip_line, pop_input): Track input block changes.
3791         (m4_pop_wrapup): Avoid overflow.
3792         (init_builtin_token): Handle composite input.
3793         (next_char): Handle input block changes.
3794         * doc/m4.texinfo (Location): Remerge from branch.
3796         * src/m4.h (includes): Need <locale.h> after all; fixes
3797         regression from yesterday.
3799         * m4/system_.h (obstack_regrow): New macro.  Hopefully glibc will
3800         accept it someday.
3801         * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3802         Handle nesting the argc obstack.
3803         (expand_token): Avoid unnecessary malloc.
3804         (collect_arguments): Copy name before invalidating it.
3805         (argc_stack, argv_stack): New variables.
3806         (m4_macro_expand_input): Initialize argc and argv stacks once per
3807         file, instead of once per macro.
3809 2006-10-24  Eric Blake  <ebb9@byu.net>
3811         * src/m4.h (includes): Add gettext.h, for N_.  Assume setlocale.
3813 2006-10-23  Eric Blake  <ebb9@byu.net>
3815         * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
3816         from branch regarding stripped leading whitespace.
3818         * modules/m4.c (includes): Use safe headers even when configured
3819         with --enable-assert.
3820         (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
3821         #defined as mkstemp_safer.
3823 2006-10-21  Eric Blake  <ebb9@byu.net>
3825         * modules/m4.c (m4_make_temp): Change signature.
3826         (maketemp, mkstemp): Update callers.
3827         * modules/m4.h (m4_make_temp_func): New export.
3828         * modules/gnu.c (mkdtemp): New macro.
3829         * doc/m4.texinfo (Operation modes): Document interaction with
3830         --safer.
3831         (Mkdtemp): New node.
3832         * tests/builtins.at (mkdtemp): New test.
3833         (mkstemp): Check for umask effect.
3834         * NEWS: Document new builtin.
3836         * tests/generate.awk (normalize): Update recognition of trailing
3837         spaces in tests.
3838         * doc/m4.texinfo: Minor formatting fixes from branch.
3839         (Foreach, Improved foreach): Merge from branch.
3840         * examples/foreach.m4: Merge from branch.
3841         * examples/foreachq.m4: New file from branch.
3842         * examples/foreach2.m4: Likewise.
3843         * examples/foreachq2.m4: Likewise.
3845         * doc/m4.texinfo (titlepage): Add myself as author.
3846         * src/main.c (AUTHORS): Likewise.
3848 2006-10-19  Eric Blake  <ebb9@byu.net>
3850         * modules/m4.c (m4_make_temp, mkstemp): New functions.
3851         (maketemp): Add POSIX behavior and a warning.
3852         * tests/others.at (maketemp): Move this test...
3853         * tests/builtins.at (mkstemp): ...to here, and beef up.
3854         * tests/options.at (--safer): Update to new warning message.
3855         * doc/m4.texinfo (Mkstemp): Sync from branch.
3856         (Extensions): Update maketemp behavior.
3857         * NEWS: Document that maketemp now always warns.
3859         * tests/generate.awk: For ease of doc-writing, simplify selection
3860         of '-Ipath/to/examples' to '@comment examples'.
3861         * examples/forloop.m4: Simplify.
3862         * examples/forloop2.m4: New file.
3863         * examples/quote.m4: New file.
3864         * doc/m4.texinfo (Improved forloop): New node.
3865         (Manual): Clarify use of examples directory.
3866         (Shift, Forloop): Resync from branch.
3867         (Include, Location): Update to new usage of examples directory.
3869         * m4/system_.h (includes): Pick up <unistd.h> before checking for
3870         _POSIX_VERSION.
3871         (gettext_noop): Don't define here, let gettext.h do it instead.
3872         * po/POTFILES.in: Update entries to reflect gnulib imports.
3874 2006-10-16  Eric Blake  <ebb9@byu.net>
3876         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3877         configmake'.
3878         * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
3879         pkglibexecdir support.
3880         * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
3881         worry about pathconf.h, now that gnulib does it for us.
3882         (pkgmodincludedir): Simplify.
3883         (pkglibexecdir): Delete, now that automake does this.
3884         * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
3885         * src/main.c (usage): Likewise.
3886         * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
3888         * doc/m4.texinfo: Port some changes from the branch.
3889         (Invoking m4): Promote to a chapter, instead of a section of
3890         Preliminaries.
3891         (Operation modes, Dynamic loading features, Preprocessor features)
3892         (Limits control Frozen state, Debugging options)
3893         (Command line files): Subdivide into new sections.
3894         (Cleardivert): Rename from cleardiv.
3896 2006-10-14  Eric Blake  <ebb9@byu.net>
3898         * tests/others.at (stdin closed): Update to match previous patch.
3900         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
3901         is not portable.
3902         Reported by Ralf Wildenhues.
3904         * modules/m4.c (undivert): Merge from branch.
3905         * doc/m4.texinfo (Improved fatal_error): Fix typo.
3906         (Improved exch): New node, copied from branch.
3907         (Improved cleardivert): Update from branch.
3908         * THANKS: Update.
3910 2006-10-13  Eric Blake  <ebb9@byu.net>
3912         * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
3913         not config-h.in.
3914         * modules/gnu.c (builtin, indir): Transparently handle builtin
3915         tokens from defn.
3916         * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
3917         * m4/input.c (m4_pop_wrapup): Display debug message when switching
3918         to wrapped text.
3919         (m4_input_init): No need to use empty file any more.
3920         (file_print): Display correct file name.
3921         * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
3922         dereference a NULL file name.
3923         * m4/m4module.h (m4_pop_wrapup): New parameter.
3924         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
3925         prototypes.
3926         * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
3927         * m4/symtab.c (m4_symbol_value_groks_macro): New method.
3928         * src/main.c (main): Adjust caller.
3929         * tests/options.at (--debugmode): Test more output from -dV.
3931 2006-10-12  Eric Blake  <ebb9@byu.net>
3933         * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
3935         * m4/m4private.h (m4__next_token_is_open): New prototype.
3936         * m4/m4module.h (m4_push_single): Delete; push_string is an
3937         adequate interface, and removing support for this simplifies the
3938         input engine.
3939         (m4_push_wrapup): New parameter.
3940         (m4_is_syntax): Delete; m4_has_syntax is sufficient.
3941         (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
3942         start-quote and start-comment exclusive from other syntax
3943         categories.
3944         * m4/syntax.c: Likewise.
3945         * m4/input.c (input_funcs): Make polymorphic without requiring
3946         clients to know whether they are located at isp.  All users
3947         changed.
3948         (file_names): New variable.
3949         (m4_input_init): Initialize it.
3950         (m4_push_file): Use it.
3951         (m4_input_exit): Free it after use.
3952         (m4__next_token): Simplify slightly.
3953         (m4__peek_token): Rename and simplify...
3954         (m4__next_token_is_open): ... to this.  In particular, this
3955         allows us to avoid a double ungetc, which POSIX doesn't
3956         guarantee.
3957         (struct m4_input_block, m4_push_single, single_peek, single_read):
3958         Remove support for single characters, as the input engine now
3959         guarantees we don't need it.
3960         (file_unget, string_unget, m4_input_print, unget_input):
3961         Strengthen assertions.
3962         (file_init_funcs, file_read_init): New for file reading.
3963         (string_init_funcs, string_read_init): New for wrapped text.
3964         (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
3965         Support wrapped text with locations.
3966         (m4_skip_line): Support dnl across include file boundary.
3967         (peek_char): Don't pop input when peeking.
3968         (file_peek): Peek can be called at the end of the file.
3969         (string_read): Don't read beyond string bounds.
3970         * m4/macro.c (expand_token, collect_arguments): Update callers.
3971         (expand_macro): Report errors at location of open parenthesis.
3972         (expand_token, expand_argument, process_macro): Avoid negative
3973         array dereferences with m4_has_syntax.
3974         * m4/utility.c (skip_space): Likewise.
3975         * modules/m4.c (m4wrap): Update caller.
3976         * tests/builtins.at (__file__, __line__, dnl): New tests.
3977         * tests/options.at (--debugmode): Normalize the output.
3978         * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
3979         Remerge recent changes from branch.
3980         (Improved fatal_error): New node from branch.
3982 2006-10-11  Eric Blake  <ebb9@byu.net>
3984         * src/main.c (usage, long_options): Add --debugmode as an alias
3985         for --debug, to match macro name.
3986         * tests/options.at (--debugmode): Rename from --debug, and test
3987         for new alias.
3988         (--discard-comments): Augment test.
3989         * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
3990         * NEWS: Likewise.
3992 2006-10-10  Eric Blake  <ebb9@byu.net>
3994         Trace improvements: debugmode(c) was always printing the last two
3995         lines paired, combine them; and show non-text expansions.
3996         * m4/macro.c (trace_prepre): Update to show what the macro will
3997         expand to.
3998         (trace_pre): No need to special-case on debugmode(c).
3999         (trace_post): Likewise.  Also, show non-text expansions.
4000         (expand_macro): Update caller.  Collecting arguments can change
4001         debug mode, so cache values beforehand.
4002         (trace_format): Remove support for unused %l%S%r, and fix support
4003         for %z to match gcc's attribute((printf)).
4004         (trace_header): Update caller.
4005         * m4/input.c (struct m4_input_block): Rename from input_block.
4006         (struct input_funcs): Add print_func member.
4007         (file_print, builtin_unget, builtin_print, string_print)
4008         (m4_input_print): New functions.
4009         (m4_push_string_finish): Change return type.
4010         (m4_push_file): Fix missing use of close parameter.
4011         * m4/debug.c (m4_debug_decode): Don't clear pending traces.
4012         * m4/m4module.h (m4_input_print): New prototype.
4013         * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
4014         to match behavior change.
4015         * tests/options.at (--debug): Likewise.
4016         * tests/macros.at (Propagation of traceon)
4017         (Propagation of --trace): Likewise.
4018         * tests/others.at (stderr closed, stdout closed, stdin closed):
4019         Likewise.
4020         * doc/m4.texinfo (Forloop): Simplify.
4021         (Trace): Update to changed behavior.
4022         (Debugmode): Document this change.
4023         * src/main.c (usage): Likewise.
4024         * NEWS: Likewise.
4026 2006-10-09  Eric Blake  <ebb9@byu.net>
4028         * m4/path.c (m4_include_env_init): Don't alter result of getenv.
4029         Reported by Ralf Wildenhues.
4031         * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
4033 2006-10-07  Eric Blake  <ebb9@byu.net>
4035         * m4/m4module.h (m4_set_exit_failure): New prototype.
4036         * m4/utility.c (m4_set_exit_failure): New function.
4037         * modules/m4.c (m4exit): Use it to avoid yet another global
4038         variable export in libm4.
4040 2006-10-06  Eric Blake  <ebb9@byu.net>
4042         * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
4043         up.
4044         * tests/others.at (stdout closed): Fix final check.
4046         Replace uses of tmpfile with clean-temp, since tmpfile is
4047         incompatible with closeout.
4048         * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
4049         exit status of m4.
4050         * tests/others.at (stderr closed): Likewise.
4051         * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
4052         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4053         clean-temp.
4054         * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
4055         (m4_tmpfile, cleanup_tmpfile): New functions.
4056         (make_room_for, m4_insert_diversion): Use clean-temp module.
4057         * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
4058         tmpfile.
4059         * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
4061         * m4/utility.c (m4_numeric_arg): Merge from branch.
4062         * modules/gnu.c (debuglen): New builtin.
4063         * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
4064         Rename --arglength to --debuglen.
4065         * tests/options.at (--arglength): Rename to --debuglen.
4066         (deprecated options): Augment test.
4067         * doc/m4.texinfo (Invoking m4): Document the name change.
4068         (Debugmode): Rename from Debug Levels.
4069         (Debugfile): Rename from Debug Output.
4070         (Debuglen): New node.
4071         * NEWS: Document these changes.
4073         * modules/m4.c (m4exit): Fix typo.  Ensure desired exit status in
4074         case closing a module exits.
4076         * modules/m4.c (m4exit): Merge from branch.
4077         * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
4079 2006-10-05  Eric Blake  <ebb9@byu.net>
4081         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4082         closeout.
4083         * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
4084         * src/main.c (main): Close stdout on exit.
4085         * m4/debug.c (set_debug_file): Check for write failure.
4086         * m4/m4.c (m4_delete): Don't mask write failure.
4087         * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
4088         macros before calling AT_CHECK.
4089         (M4_ONE_MEG_DEFN): New helper macro.
4090         * tests/others.at (stdout full): New test.
4091         (stderr closed, stdin closed, stdout closed): Augment.
4092         * tests/builtins.at (syscmd): New test.
4093         (esyscmd): Augment.
4095 2006-10-04  Eric Blake  <ebb9@byu.net>
4097         * tests/builtins.at: Alphabetize tests.
4098         * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
4099         * tests/generate.awk (new_test): Fix underquoting.
4100         * tests/others.at (maketemp): Rename from misc.
4101         (stdin closed, stdout closed, stderr closed): New tests.
4103 2006-10-03  Eric Blake  <ebb9@byu.net>
4105         Avoid all global variables in modules, so that --disable-static
4106         can work on cygwin.
4107         * examples/incl.m4: New file, from branch.
4108         * Makefile.am (dist_pkgdata_DATA): Distribute it.
4109         * doc/m4.texinfo (Location): Merge this section from branch.
4110         (Include): Update the test.
4111         * tests/generate.awk (new_test): Allow for VPATH build
4112         pre-processing of expected __program__ output.
4113         * m4/m4module.h (m4_current_diversion, m4_output_current_line):
4114         Avoid global variables.
4115         (m4_context_field_table): Add current_diversion, output_line.
4116         (m4_output_init, m4_make_diversion): Add parameter.
4117         (m4_get_program_name, m4_set_program_name): New accessors.
4118         * m4/m4private.h (m4_get_current_diversion),
4119         (m4_set_current_diversion, m4_get_output_line)
4120         (m4_set_output_line): New accessors.
4121         * m4/utility.c (m4_get_program_name, m4_set_program_name): New
4122         methods.
4123         * modules/m4.c (divnum, divert): Adjust callers.
4124         * modules/gnu.c (__program__): Likewise.
4125         * m4/output.c (m4_output_init, m4_make_diversion)
4126         (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
4127         (m4_insert_diversion): Likewise.
4128         * m4/input.c (file_clean, m4_push_file): Likewise.
4129         * src/freeze.c (reload_frozen_state): Likewise.
4130         * src/main.c (main, usage): Likewise.
4132         Partially plug memory leak when unloading gnu module.
4133         * tests/modules.at (unload gnu module): New test.
4134         * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
4135         (m4_regexp_compile): Move static storage to module visibility.
4136         * tests/options.at (--debug): Adjust to new output.
4138 2006-09-29  Eric Blake  <ebb9@byu.net>
4140         Even when not the first option, --help can't have side effects.
4141         * tests/options.at (--debugfile): Detect bugs in this area.
4142         * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
4143         stderr.
4144         * src/main.c (main): Fix it by deferring debugfile change.  Also,
4145         defer closing streams until after module tracing is done.
4146         * modules/gnu.c (debugfile): Make message consistent with command
4147         line.
4148         * doc/m4.texinfo (Invoking m4): Touch up the documentation.
4149         * NEWS: Document this fix.
4151         * modules/m4.c (dnl): Include macro name in warning message.
4152         * m4/input.c (m4_skip_line): Add parameter.
4153         * m4/m4module.h (m4_skip_line): Likewise.
4154         * src/main.c (usage): Update wording.
4155         * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
4156         issue of blind macros vs. POSIX is resolved.
4157         (Dnl): Merge another node from branch.
4159         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4160         xstrtol.
4161         * m4/system_.h (N_): Define.
4162         * src/main.c (main): Validate numeric arguments.
4163         (size_opt): New function, idea borrowed from coreutils.
4164         * m4/macro.c (expand_macro): -L0 implies no limit.
4165         * doc/m4.texinfo (Invoking m4): Document this change.
4166         * NEWS: Likewise.
4167         * tests/options.at: (--arglength, --nesting-limit)
4168         (--regexp-syntax): New tests of argument validation.
4170 2006-09-28  Eric Blake  <ebb9@byu.net>
4172         * tests/options.at: Alphabetize the tests.
4174 2006-09-27  Eric Blake  <ebb9@byu.net>
4176         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
4177         another parameter to print module info.
4178         * m4/macro.c (trace_pre): Adjust caller.
4179         * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
4180         * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
4181         * NEWS: Document this.
4183         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4184         strnlen.
4185         * m4/symtab.c (symbol_value_print): Rename to...
4186         (m4_symbol_value_print): ...this, and...
4187         (m4_symbol_print): Update to allow -L length truncation.  Now
4188         truncation also affects dumpdef output and builtin names.
4189         * m4/m4private.h (nesting_limit, max_debug_argument_length):
4190         Switch to size_t.
4191         * m4/m4module.h (m4_symbol_print): Add parameter.
4192         (m4_symbol_value_print): New function.
4193         * modules/m4.c (dumpdef): Allow length truncation.
4194         * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
4195         repeating code.
4196         * doc/m4.texinfo (Invoking m4): Document -l better.
4197         (Dumpdef, Debug Levels): Document the effect of -l.
4198         * NEWS: Document this change.
4200         * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
4201         (m4_expand_ranges): Ensure we aren't picking up partial object on
4202         obstack.
4203         * modules/stdlib.c (setenv): Allow extra arguments.
4204         * modules/time.c (ctime): Avoid side effect in call to
4205         obstack_grow.
4206         * modules/gnu.c (m4_regexp_substitute): Likewise.
4207         (renamesyms): Avoid extra obstack_init.
4208         * src/freeze.c (reload_frozen_state): Remove debug comment.
4209         (produce_frozen_state): Simplify fprintf to puts where possible.
4210         * modules/modtest.c (modtest_init, modtest_finish): Likewise.
4211         * modules/import.c (import, symbol_fail, modules_fail): Likewise.
4212         * m4/macro.c (trace_flush): Likewise.
4213         * m4/debug.c (m4_debug_message_prefix): Likewise.
4214         * m4/path.c (include_dump): Likewise.
4215         * m4/module.c (module_remove): Likewise.
4216         (install_builtin_table): Simplify malloc and string
4217         concatenation.
4219 2006-09-26  Eric Blake  <ebb9@byu.net>
4221         * m4/m4module.h (m4_symbol_print): New prototype.
4222         (M4_DEBUG_TRACE_STACK): New enumerator.
4223         (m4_is_debug_bit): Allow use without requiring m4private.h.
4224         * m4/symtab.c (symbol_value_print, m4_symbol_print): New
4225         functions.
4226         * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
4227         callback.
4228         (dumpdef): Allow printing pushdef'd stacks.
4229         * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4230         * src/main.c (usage): Document it.
4231         * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4232         * NEWS: Likewise.
4234         * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4235         gnulib headers.
4236         * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4237         of lines during make.
4238         (AM_CPPFLAGS): Remove unneeded include path.
4239         (src_m4_CPPFLAGS): Remove redundant include path.
4240         * m4/system_.h Make preprocessor indentation consistent.
4241         (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4242         macros.
4243         (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4244         branch.
4245         (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4246         (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4247         (bool, true, false): Don't undefine here; stdbool takes care of
4248         that.
4249         * src/m4.h (includes): Assume config.h, and several standard
4250         headers.
4251         (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4252         * m4/m4private.h: Assume config.h.
4253         * m4/output.c: Likewise.
4254         * m4/path.c: Likewise.
4255         * m4/resyntax.c: Likewise.
4256         * m4/utility.c: Likewise.
4257         * modules/gnu.c: Likewise.
4258         * modules/import.c: Likewise.
4259         * modules/load.c: Likewise.
4260         * modules/m4.c: Likewise.
4261         * modules/modtest.c: Likewise.
4262         * modules/mpeval.c: Likewise.
4263         * modules/perl.c: Likewise.
4264         * modules/shadow.c: Likewise.
4265         * modules/stdlib.c: Likewise.
4266         * modules/time.c: Likewise.
4267         * modules/traditional.c: Likewise.
4269 2006-09-21  Eric Blake  <ebb9@byu.net>
4271         * doc/m4.texinfo (Invoking m4): Add clarification on option
4272         processing behavior.
4273         * tests/options.at (option grouping): Test this.
4274         * THANKS: Update.
4275         Reported by Mikhail Teterin.
4277         * bootstrap: Add --force option, based on idea from coreutils.
4278         * README: Document that ./bootstrap and autoreconf are for
4279         developers, and not lightly done in tarballs.
4281 2006-09-20  Eric Blake  <ebb9@byu.net>
4283         * src/main.c (usage, OPTSTRING, main): Rename -e to -i.  Make
4284         warnings consistent.
4285         (long_options, HASHSIZE_OPTION): Warn on -H.
4286         * doc/m4.texinfo (Invoking m4): Document this.
4287         * tests/options.at (deprecated options): Update.
4289         Change the default of interactive sessions to match sh.
4290         * src/main.c (usage): Document this.
4291         (enum interactive_choice): New enum.
4292         (main): Use it to defer decision of interactive until after
4293         argument processing.
4294         * doc/m4.texinfo (Invoking m4): Document this.
4295         * NEWS: Likewise, plus add missing mention of -b.
4296         Reported by Stepan Kasal.
4298 2006-09-19  Eric Blake  <ebb9@byu.net>
4300         * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4301         well as --error-output; the goal is to add -o/--output in some
4302         future version with semantics like gcc or autom4te.
4303         * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4304         (Extensions): Reflect this update.
4305         (Renamesyms): Add another test.
4306         (Defn): Xfail for now, so that `make check' is happy.
4307         * NEWS: Document this change.
4308         * tests/generate.awk: Mark dynamic loading tests as such.  Allow
4309         xfailing tests.
4310         * tests/macros.at (Renamesyms collisions): New test, exposing
4311         renamesyms' coredump.
4312         * tests/options.at (--debugfile, --safer): Update to match
4313         change.
4315         * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4316         and stderr are same file, introduced 2003-07-23.
4317         * tests/options.at (--debugfile): New test, to catch the bug.
4318         (deprecated options): Test --error-output.
4319         * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4320         Deprecate --error-output, and replace it with --debugfile.
4321         * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4322         Document this change.
4323         * NEWS: Likewise.
4325 2006-09-18  Eric Blake  <ebb9@byu.net>
4327         * modules/load.c (modules): Rename to...
4328         (m4modules): ...this, since it is an English word with 0
4329         arguments.
4330         * modules/gnu.c (symbols, m4symbols): Likewise.
4331         * doc/m4.texinfo (Listing Modules): Rename to...
4332         (M4modules): ...this.
4333         (Symbols): Rename to...
4334         (M4symbols): ...this.
4335         (Load, Foreach, Trace, Answers): Update to new spellings.
4336         * NEWS: Document this.
4338         * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4339         such that without arguments, the global trace flag is changed
4340         rather than walking the table of all currently-defined macros.
4341         (set_trace_CB): No longer needed.
4342         * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4343         (m4_set_symbol_traced): Delete.
4344         (m4_symtab_create): Nuke the nuke parameter.
4345         * m4/m4private.h (m4_get_symbol_value): Delete.
4346         * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4347         (m4_set_symbol_name_traced): Free undefined entries that are no
4348         longer traced.
4349         (symbol_destroy_CB): Update caller.
4350         * m4/m4.c (m4_create): Update caller.
4351         * src/main.c (main): Likewise.
4352         (usage): Fix typo in last commit.
4353         * doc/m4.texinfo: Minor cleanups throughout.
4354         (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4355         more nodes from branch.
4356         (Trace): Document new semantics, and how to simulate the old.
4357         * tests/builtins.at (multiquotes): Adjust to new semantics.
4358         * NEWS: Update somewhat.
4360 2006-09-14  Eric Blake  <ebb9@byu.net>
4362         Add --safer option, per debian bug 5898.
4363         * src/main.c (usage): Document new option.
4364         (SAFER_OPTION): New enumerator.
4365         (main): Set the option bit.
4366         * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4367         accessors.
4368         * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4369         (m4_get_safer_opt): New accessor.
4370         * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4371         * modules/m4.c (syscmd, maketemp): Likewise.
4372         * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4373         (Sysval, Maketemp): Add tests of this.
4374         * tests/options.at (--safer): Likewise.
4376 2006-09-13  Eric Blake  <ebb9@byu.net>
4378         * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4379         stderr filtering.
4380         Reported by Ralf Wildenhues.
4382         Fix installcheck.
4383         * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4384         tests directory, so we can be sure an installed build is not
4385         picking up uninstalled non-test libraries.
4386         (check-local, installcheck-local): Depend on test libraries.
4387         * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4388         after file name.  Fix quoting.  Remove skipping the test, now
4389         that makefile guarantees test modules will exist.
4390         (Freezing modules, modules: shadow, modules: unload)
4391         (modules: trace): Always put test modules in module path.
4392         (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4393         stderr munging.
4394         * src/main.c (usage): Document default module search path.
4395         (import_environment, frozen_file_to_read, frozen_file_to_write):
4396         Move...
4397         (main): ...here.
4398         * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4399         * tests/m4.in: ...not here.
4400         Reported by Ralf Wildenhues.
4402 2006-09-08  Eric Blake  <ebb9@byu.net>
4404         * bootstrap: Kill unrelated copy-n-paste code from argument
4405         parsing.  Let Makefile generate testsuite.
4406         * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4408 2006-09-07  Eric Blake  <ebb9@byu.net>
4410         * m4/m4module.h (m4_peek_input): No longer export.
4411         (m4_error_at_line, m4_warn_at_line): New prototypes.
4412         (m4_is_symbol_void): New macro.
4413         (m4_push_file): Update prototype.
4414         * m4/m4private.h (m4__peek_token): New prototype.
4415         (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4416         * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4417         * src/main.c (main): Allow reading from stdin twice.
4418         * modules/m4.c (include): Adjust to new prototype.
4419         * m4/input.c: General comment cleanup.
4420         (file_peek, file_read, file_unget, push_file): Set end flag on
4421         EOF, so that we don't call getc twice.
4422         (push_file, file_clean): Port fix from branch to avoid closing
4423         stdin prematurely.
4424         (pop_input): Port fix from branch to avoid reading free'd memory
4425         when input ends mid-string.
4426         (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4427         (string_peek, string_read): Always use unsigned char.
4428         (m4_skip_line): Warn when dnl cut short by EOF.
4429         (peek_input): Rename from m4_peek_input.
4430         (match_input): Update signature, to distinguish between `(' token
4431         and multi-char quote or comment beginning with `('.
4432         (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4433         (m4__peek_token): New function, ported from branch.
4434         (m4__next_token): Update to new token types.
4435         * m4/macro.c (expand_token, expand_argument): Use peek_token.
4436         * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4437         (Invoking m4): Remerge from branch.
4439         * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4440         (check-local): and put dependency here.
4441         Reported by Ralf Wildenhues.
4443 2006-09-05  Eric Blake  <ebb9@byu.net>
4445         * m4/m4module.h (m4_debug_message): New prototype.
4446         (M4_DEBUG_TRACE_MODULE): New debug bit.
4447         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4448         (M4_DEBUG_MESSAGE2): Delete these macros.
4449         * m4/debug.c (m4_debug_message): New method.
4450         (m4_debug_decode): Add module tracing as flag `m'.
4451         * m4/input.c (m4_push_file, file_clean): Use new method.
4452         * m4/path.c (m4_path_search): Likewise.
4453         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4454         * m4/module.c (install_builtin_table, install_macro_table)
4455         (m4__module_open, module_close, module_remove): Promote several
4456         module debug messages outside of DEBUG_MODULES.
4457         (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4458         DEBUG_MODULES with normal trace output.
4459         * src/main.c (usage): Document new flag.
4460         * doc/m4.texinfo (Debug Levels): Likewise.
4461         * Makefile.am ($(TESTSUITE)): Add missing dependency.
4462         * tests/m4.in: Neutralize platform-dependent module filenames.
4463         * tests/options.at (--debug): Update expected output.
4465 2006-09-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4467         * doc/m4.texinfo: Fix some typos.
4468         * tests/others.at: Likewise.
4470 2006-09-05  Eric Blake  <ebb9@byu.net>
4472         * m4/input.c (lex_debug): Remove dead code that broke compilation
4473         with --enable-debug.
4474         * m4/module.c (install_builtin_table, install_macro_table)
4475         (m4__module_init, m4__module_open, module_close)
4476         (module_remove): Fix compilation when --enable-debug.
4477         * m4/output.c (m4_shipout_text): Likewise.
4478         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4479         libraries when --enable-debug.
4480         * configure.ac (DYNAMIC_MODULES): New variable, to pass
4481         information to testsuite.
4482         (modules to preload): Determine modules after we know whether
4483         shared libraries are supported.
4484         * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4485         testsuite.
4486         * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4487         * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4488         (modules: shadow, modules: unload, modules: importing)
4489         (modules: trace): Use new macro.
4490         * tests/builtins.at (gmp): Likewise.
4492         * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
4493         All users updated.
4494         (expand_token): Avoid assertion just added to docs.
4495         (expand_macro): Track pending expansions, for when a symbol's
4496         definition changes during argument collection.
4497         (m4_macro_call, process_macro): Operate on symbol value, not
4498         symbol, since symbol may have changed during argument collection.
4499         * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
4500         (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
4501         (m4_get_symbol_value): Add fast macro version.
4502         * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
4503         (m4_macro_call): Adjust prototype.
4504         * m4/module.c (install_builtin_table): Check that flags are valid
4505         when creating builtin.
4506         * m4/symtab.c (m4__symtab_remove_module_references): Use
4507         m4_symbol_value_delete, rather than inlining it.
4508         (m4_symbol_value_copy): Copy placeholder text.
4509         (symbol_popval): Use m4_symbol_value_delete.
4510         (m4_symbol_value_delete): Implementation was missing when NDEBUG.
4511         Handle pending expansions.
4512         * modules/gnu.c (indir): Update to new prototype.
4513         * doc/m4.texinfo: Fix menus to be consistent with section names.
4514         (Defn): Add test that macro tokens flatten to empty string;
4515         triggered an assert before this patch.
4516         (Ifelse): Merge another node.
4517         (Loops): Split into...
4518         (Forloop, Foreach): New nodes; work is still underway on them.
4519         (Answers): Add more info on foreach macro; work is still underway.
4520         (Indir): Add test that indir collects arguments before looking up
4521         macro.
4522         * TODO: Update based on this patch.
4524 2006-09-01  Eric Blake  <ebb9@byu.net>
4526         * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
4527         * m4/hash.h (m4_free_hash_iterator): New prototype.
4528         * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
4529         ensure we don't do unsafe things while iterating.
4530         (HASH_ITER, ITER_CHAIN): New accessor macros.
4531         (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
4532         (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
4533         (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
4534         (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
4535         to catch unsafe actions.
4536         (m4_free_hash_iterator): New function, to avoid memory leaks, and
4537         when debugging, to track safe actions.
4538         (m4_hash_apply): Avoid memory leak.
4539         * m4/symtab.c (m4_symtab_apply): Likewise.
4540         * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
4541         in manually to src/ for now.
4542         * tests/builtins.at (gmp): Add keyword module.
4543         * tests/modules.at (Freezing modules, modules: shadow)
4544         (modules: unload, modules: importing, modules: trace): Likewise.
4546 2006-08-30  Eric Blake  <ebb9@byu.net>
4548         * m4/utility.c (m4_warn): Factor "Warning" out of messages into
4549         here.
4550         (m4_bad_argc, m4_numeric_arg): Update all callers.
4551         * m4/macro.c (m4_macro_call): Likewise.
4552         * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
4553         (Indir, Builtin, Ifdef): More doc merges.
4554         (Loops): Mention that documenting foreach would be nice.
4555         (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
4556         (Include, Eval, Location, M4exit): s/input.m4/stdin/.
4557         * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
4558         (substitute, syncoutput): Update all m4_warn callers.
4559         * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
4560         (traceon, traceoff): Make warning message consistent.
4561         (define, pushdef): Update all m4_warn callers.
4562         * tests/generate.awk: Choose file name so that documentation can
4563         show command-line behavior.
4564         * tests/builtins.at (define): Update to new wording.
4565         * tests/macros.at (pushdef/popdef): Likewise.
4566         * tests/freeze.at (loading format 1): Likewise.
4567         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4569         * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
4570         the branch.
4571         (Defn): Add failing test case for mixing text and builtin.
4572         (Renamesyms): Improve wording, and identify core dump that needs
4573         fixing.
4575 2006-08-29  Eric Blake  <ebb9@byu.net>
4577         * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
4578         (Arguments, Pseudo Arguments): More doc merges from the branch.
4579         (Macro expansion): Turn example into test.
4580         (Pseudo Arguments): Add example of avoiding argument.
4581         * modules/m4.c (undefine, popdef): Accept multiple arguments.
4582         (define, pushdef): Warn on non-text macro name.
4583         (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
4584         warning/error messages.
4585         (ifdef): Ignore extra arguments.
4586         * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
4587         (m4__symtab_remove_module_references): Check that there is no leak.
4588         * tests/macros.at (pushdef/popdef): Update to new message.
4589         * tests/builtins.at (define): Likewise.
4590         * tests/freeze.at (loading format 1): Likewise.
4591         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4593         * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
4594         (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
4595         as accessor function, to avoid compiler warning.
4596         * m4/module.c (m4__module_open): Move declaration of variable to
4597         avoid compiler warning.
4598         * src/main.c (main): Avoid shadowing a global variable.
4599         * src/freeze.c (produce_symbol_dump): Avoid unused variable
4600         warning when NDEBUG.
4601         * tests/options.at (--discard-comments, --import-environment)
4602         (--debug, --prepend-include, --help and --version): Rename tests
4603         to name option tested.
4605 2006-08-28  Eric Blake  <ebb9@byu.net>
4607         * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
4608         * m4/module.c (install_builtin_table): ...to here, and add
4609         assertion that blind macros require arguments.
4610         * m4/m4module.h (struct m4_builtin): Document restrictions that
4611         must be met during module loading.
4612         * modules/gnu.c (changeresyntax, changesyntax): These are blind,
4613         so require an argument to avoid triggering assertion.
4614         (debugfile): Tweak error message.
4616 2006-08-25  Eric Blake  <ebb9@byu.net>
4618         * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
4619         (M4_BUILTIN_SIDE_EFFECT): New enumerators.
4620         (struct m4_builtin): New member flags replaces groks_macro_args,
4621         blind_if_no_args.  min_args and max_args are now 0-based.
4622         Rearrange members to reduce size on platforms where function
4623         pointers are 64 bits but regular pointers are 32.
4624         (m4_bad_argc): Add argument.
4625         * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
4626         * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
4627         effect into account.
4628         * m4/module.c (install_builtin_table): Adjust all users affected
4629         by this API change.
4630         * m4/macro.c (m4_macro_call): Likewise.
4631         * src/freeze.c (reload_frozen_state): Likewise.
4632         * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
4633         * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
4634         * modules/import.c (builtin_functions): Likewise.
4635         * modules/load.c (builtin_functions): Likewise.
4636         * modules/modtest.c (builtin_functions): Likewise.
4637         * modules/mpeval.c (builtin_functions): Likewise.
4638         * modules/perl.c (builtin_functions): Likewise.
4639         * modules/shadow.c (builtin_functions): Likewise.
4640         * modules/stdlib.c (builtin_functions): Likewise.
4641         * modules/time.c (builtin_functions, mktime_functions)
4642         (strftime_functions): Likewise.
4643         * doc/m4.texinfo (Loops): Update test now that shift is blind.
4644         (Macro Arguments): Fix typo in test.
4645         (Patsubst): Fix typo in test.
4646         * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
4647         end of string.  Fix return value when ignore_duplicates.
4648         * tests/builtins.at (patsubst): Fix typo in test.
4650         * tests/options.at (debug-flags): Update to reflect new message.
4651         (deprecated options, prepend-include, help and version): New
4652         tests.
4653         * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
4654         test omits an input file name.
4655         * src/main.c (long_options, main): Add -B/--prepend-include.
4656         (usage): Document it.
4657         (main): `m4 --help --version' now displays help, not version.
4658         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4659         dirname filenamecat.
4660         * m4/m4module.h (m4_add_include_directory): Add parameter.
4661         * m4/m4private.h (m4__include_init): New prototype.
4662         * m4/m4.c (m4_create): Put `.' on path before options are
4663         collected.
4664         * m4/path.c (includes): Assume C89.  Use gnulib for file name
4665         management.
4666         (m4__include_init): New function.
4667         (search_path_add): Allow prepending.
4668         (m4_add_include_directory, search_path_env_init): Adjust callers.
4669         (m4_path_search): Relative names now invoke path search, since
4670         `.' might not be first.
4671         * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
4673 2006-08-25  Bruno Haible  <bruno@clisp.org>  (tiny change)
4674         and Eric Blake  <ebb9@byu.net>
4676         * bootstrap: Run autopoint before gnulib-tool, since autopoint
4677         0.15 installs macros obsoleted by current gnulib.
4679 2006-08-25  Eric Blake  <ebb9@byu.net>
4681         * doc/m4.texinfo (Macro Arguments): Another section merged;
4682         testsuite failures now exposed.
4684 2006-08-23  Eric Blake  <ebb9@byu.net>
4686         * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
4687         (Input processing): More doc merges from the branch.
4688         (Regular expression syntax): Add introductory text.
4689         (Inhibiting Invocation): More doc merges from the branch.
4690         (Other tokens): Reorder after comments.
4691         * tests/generate.awk: Allow passing options to doc examples.
4693 2006-08-22  Eric Blake  <ebb9@byu.net>
4695         * tests/options.at (debug-flags): New test.
4696         * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
4697         not negative, to distinguish failure in m4_debug_decode.
4698         (m4_debug_decode): Add new parameter.
4699         * modules/gnu.c (regexp): Slight cleanup.
4700         (renamesyms): Ignore excess arguments.
4701         (syncoutput): Make case-insensitive, warn on bad argument.
4702         (debugmode): Factor -+ handling out to...
4703         * m4/debug.c (m4_debug_decode): ...here.
4704         (m4_debug_message_prefix): Fix spacing.
4705         * src/main.c (main): Let -d option adjust flags.
4706         * m4/input.c (file_clean): Avoid printing empty file name.
4707         * doc/m4.texinfo (Syncoutput): Document new range of input.
4708         (Invoking m4): Document use of multiple -d flags.
4710         Start porting various fixes from the branch that use gnulib.
4711         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4712         binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
4713         regexprops-generic stdlib-safer unlocked-io.
4714         * m4/debug.c (m4_debug_set_output): Close debug file on exec.
4715         * m4/path.c (m4_path_search): Close input file on exec, reject
4716         empty file name, fix parameter naming.
4717         * m4/output.c (make_room_for): Close diversion file on exec.
4718         (includes): Assume C89 headers.
4719         (tmpfile): For now, we don't want tmpfile-safer, because we want
4720         clean-temp later.
4721         * m4/m4private.h (includes): Use various gnulib headers.
4722         * doc/regexprops-generic.texi: Use gnulib's copy.
4724         * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
4725         * AUTHORS: Add copyright.
4726         * ChangeLog: Likewise.
4727         * README: Likewise.  Require automake 1.9b or later.
4728         * HACKING: New file.
4729         * README-alpha: Add copyright.
4730         * THANKS: Likewise.  Update.
4731         * doc/STYLE: Add copyright, and tweak for changed directories.
4732         * modules/README: Add copyright, and tweak for libtool version.
4733         * examples/COPYING: New file.
4734         * examples/WWW/COPYING: Likewise.
4735         * examples/WWW/m4lib/COPYING: Likewise.
4736         * modules/shadow.m4: Add copyright.
4737         * modules/perl.m4: Likewise.
4738         * modules/modtest.m4: Likewise.
4739         * modules/stdlib.m4: Likewise.
4740         * modules/time.m4: Likewise.
4741         * modules/time2.m4: Likewise.
4742         * po/Makevars: Likewise.
4743         * tests/iso8859.m4: Likewise.
4744         * tests/m4.in: Likewise.
4745         * NEWS: Add (C) to copyright.
4746         * TODO: Likewise.
4747         * m4/system_.h: Likewise.
4748         * tests/atlocal.in: Likewise.
4749         * tests/builtins.at: Likewise.
4750         * tests/freeze.at: Likewise.
4751         * tests/generate.awk: Likewise.
4752         * tests/macros.at: Likewise.
4753         * tests/modules.at: Likewise.
4754         * tests/options.at: Likewise.
4755         * tests/others.at: Likewise.
4756         * tests/testsuite.at: Likewise.
4757         * m4/utility.c: Spell out copyright years.
4758         * src/main.c: Likewise.
4760         * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
4762 2006-08-21  Eric Blake  <ebb9@byu.net>
4764         * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
4765         * modules/gnu.c (esyscmd): Use -1 for failure.  Set sysval to 0
4766         when no arguments are given, but without losing warning about 0
4767         arguments.
4768         * modules/m4.c (syscmd): Likewise.
4769         (includes): Assume C89.
4770         (m4_sysval): Make static.
4771         (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
4772         (sysval): Port calculation from branch.
4774 2006-08-20  Eric Blake  <ebb9@byu.net>
4776         * m4/macro.c (expand_macro): Move argument check...
4777         (m4_macro_call): ...to here, so indir will warn.
4778         * modules/gnu.c (__program__): New macro, ported from branch.
4779         (builtin): Perform argument check.
4780         (changesyntax): Avoid out-of-bounds read.
4782         * modules/gnu.c (includes): Assume stdlib.h, errno.
4783         (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4784         (substitute): Add caller parameter, avoid out-of-bounds memory
4785         references.
4786         (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4787         callers.
4789 2006-08-16  Eric Blake  <ebb9@byu.net>
4791         * po/POTFILES.in: Add more files that contain translatable
4792         strings.
4793         * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4794         information to translators.
4795         (USE_MSGCTXT): New var for gettext 0.15.
4796         * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4797         debug/trace messages in lower case.
4798         * m4/macro.c (expand_argument): Likewise.
4799         * m4/path.c (m4_path_search): Likewise.
4800         * src/main.c (main): Likewise.
4802 2006-08-14  Eric Blake  <ebb9@byu.net>
4804         * src/main.c (usage): Document --import-environment.
4805         * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4807 2006-08-11  Eric Blake  <ebb9@byu.net>
4809         * bootstrap (func_get_translations): Only remove files when doing
4810         full update.
4811         (func_update_po): Avoid CDPATH problems.
4813 2006-08-10  Eric Blake  <ebb9@byu.net>
4815         * bootstrap (func_get_translations): New function.
4816         (func_update_po): Borrow ideas from tar to correctly pull in
4817         translations from newer location.
4819 2006-08-09  Eric Blake  <ebb9@byu.net>
4821         * bootstrap: Recent gnulib no longer has jm_* macros to worry
4822         about.
4823         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4824         verror.
4825         * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
4826         (m4_error, m4_warn): ... these new prototypes.
4827         (m4_current_file, m4_current_line): Move into context, rather
4828         than leaving as globals.
4829         (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
4830         (m4_undivert_all, m4_input_init): Now takes context.
4831         * m4/utility.c (m4_error, m4_warn): New functions.
4832         * m4/m4private.h: Assume errno exists.
4833         (struct m4): Move warning_status to a bit flag,
4834         and add exit_status.  Adjust accessors accordingly.
4835         * src/main.c (print_program_name_CB): No longer needed.
4836         (main): Use new m4_get_fatal_warnings_opt.
4837         * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
4838         instead of issuing "INTERNAL ERROR".  Pass context when needed,
4839         and use new accessors.
4840         * m4/input.c: Likewise.
4841         * m4/macro.c: Likewise.
4842         * m4/output.c: Likewise.
4843         * m4/utility.c: Likewise.
4844         * modules/evalparse.c: Likewise.
4845         * modules/gnu.c: Likewise.
4846         * modules/load.c: Likewise.
4847         * modules/m4.c: Likewise.
4848         * modules/mpeval.c: Likewise.
4849         * src/freeze.c: Likewise.
4850         * src/main.c: Likewise.
4851         * tests/macros.at: Adjust to new message format.
4852         * tests/builtins.at: Likewise.
4853         * tests/freeze.at: Likewise.
4854         * tests/modules.at: Likewise.
4855         * doc/m4.texinfo: Likewise.
4857         * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
4858         newer gettext 0.15.
4860 2006-08-03  Eric Blake  <ebb9@byu.net>
4862         * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
4863         gracefully handle ENOSYS.
4864         * TODO: Update.
4865         * THANKS: Update.
4867 2006-07-28  Eric Blake  <ebb9@byu.net>
4869         * src/freeze.c (reload_frozen_state): Copy string when creating
4870         placeholder, to avoid memory corruption.
4871         * m4/symtab.c (symbol_popval): Avoid memory leak.
4872         (m4_symbol_rename): Avoid shadowing rename function.
4873         (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
4874         * tests/freeze.at (reloading unknown builtin): Add test.
4875         * tests/generate.awk: Capture m4.texinfo line number in
4876         testsuite.log, not just generated.at.
4878         Port idea from branch that a frozen file can request an unknown
4879         builtin without producing a warning unless the builtin is
4880         actually used.
4881         * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
4882         (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
4883         (m4_set_symbol_value_placeholder): New accessors.
4884         * m4/m4module.h (m4_is_symbol_placeholder),
4885         (m4_get_symbol_value_placeholder),
4886         (m4_set_symbol_value_placeholder),
4887         (m4_get_symbol_placeholder): Likewise.
4888         * m4/symtab.c (m4_is_symbol_value_placeholder),
4889         (m4_get_symbol_value_placeholder),
4890         (m4_set_symbol_value_placeholder): Likewise.
4891         (dump_symbol_CB): Handle new symbol type.
4892         * m4/macro.c (trace_pre): Likewise.
4893         (m4_macro_call): Warn when invoking a placeholder.
4894         * modules/m4.c (dumpdef): Handle dumping a placeholder.
4895         (defn): Warn when referencing a placeholder.
4896         * src/freeze.c (dump_symbol_CB): Ignore placeholder when
4897         freezing.
4898         (reload_frozen_state): When reloading unknown builtin, install a
4899         placeholder instead of warning.
4900         * tests/freeze.at (loading format 1): Allow warning when
4901         popdef'ing undefined function.
4903 2006-07-27  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
4905         * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
4906         function. Shift by 7, not 3, for consistency with
4907         gnulib/lib/hash.c. Don't assume hash word is 32 bits.
4909 2006-07-27  Eric Blake  <ebb9@byu.net>
4911         * src/main.c (usage): Update to match branch.
4912         (main): Update --version info to distinguish between program name
4913         `m4' and package name `GNU M4'.
4914         (AUTHORS): Translate René Seindal's name.
4915         * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
4916         * Makefile.am (doc/m4.1): Update to match branch.
4917         * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
4918         branch.
4920         * m4/system_.h (EXIT_MISMATCH): Define.
4921         * src/main.c (main): Don't clear syntax table for version 1.
4922         (usage): Document exit status.
4923         * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
4924         branch, and require V directive to appear first in file.  Fix
4925         broken logic for detecting F and T in version 1 files.
4927 2006-07-22  Eric Blake  <ebb9@byu.net>
4929         * src/main.c (stackovf_handler): Document the problems in our
4930         overflow handler.
4931         * src/stackovf.c: Forward port changes in branch to use POSIX
4932         sa_sigaction when available.
4933         (process_sigsegv): Avoid buffer overrun when error string is
4934         translated, although the fact that we translate in a signal
4935         handler is still a bug.
4936         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
4937         from branch to modernize checks.
4939         * modules/format.c (format): Avoid compiler warning that str may
4940         be used uninitialized.
4942         * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
4943         spelling.
4944         (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
4945         (DEBUG_MACRO): Remove unused macro.
4946         * src/stackovf.c: Avoid compiler warnings.
4947         * m4/input.c: Likewise.
4948         * m4/module.c: Likewise.
4949         * m4/output.c: Likewise.
4950         * m4/path.c: Likewise.
4951         * m4/symtab.c: Likewise.
4952         * m4/syntax.c: Likewise.
4954 2006-07-20  Eric Blake  <ebb9@byu.net>
4956         * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
4957         Regenerate to explicitly ask for --assume-autoconf=2.60.
4959 2006-07-19  Eric Blake  <ebb9@byu.net>
4961         * po/ChangeLog: Merge into main ChangeLog, then delete file.
4962         * THANKS: Update.
4964         * doc/m4.texinfo (copying): Relax restriction on front-cover and
4965         back-cover texts.
4967 2006-07-17  Eric Blake  <ebb9@byu.net>
4969         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
4970         0.14.5.
4972         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
4973         xvasprintf'.
4974         * modules/format.c (includes): Use xvasprintf.h.
4975         (format): Make static.  Avoid buffer overflow, that can lead to
4976         arbitrary code execution exploit.  Only pass unsigned char to
4977         is*().  Support F, g, and G specifiers.
4978         * doc/m4.texinfo (Format): Expose buffer overrun bug.  Document
4979         new specifiers.
4981 2006-07-17  Gary V. Vaughan  <gary@gnu.org>
4983         Ensure M4 compiles correctly with -DDEBUG, and use a single
4984         consistent definition of various /DEBUG_[A-Z]+/ symbols:
4986         * m4/input.c: Have commented out out DEBUG_INPUT only by default.
4987         (m4_print_token): Use m4_get_symbol_value_text and
4988         m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
4989         and VALUE_FUNC respectively.
4990         (m4__next_token): Use m4_print_token call instead of obsolescent
4991         print_token symbol.
4992         * m4/module.c: Have commented out out DEBUG_MODULE only by default.
4993         * m4/output.c: Similarly for DEBUG_OUTPUT.
4994         * m4/path.c: Similarly for DEBUG_INCL.
4995         * m4/symtax.c: Similarly for DEBUG_SYM.
4996         * m4/syntax.c: Similarly for DEBUG_SYNTAX.
4997         * src/stackovf.c: Similarly for DEBUG_STACKOVF.
4998         * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
4999         preprocessor macros defined with -DDEBUG compiles.
5001 2006-07-17  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
5003         * bootstrap: Correct typo in --download-po argument parsing.
5005 2006-07-15  Eric Blake  <ebb9@byu.net>
5007         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5008         gendocs fdl'.
5009         * tests/generate.awk (normalize): Recognize @tabchar.
5010         * doc/m4.texinfo (Top): Start merging from branch.  Remove tabs.
5011         Fix menus.  Upgrade FDL license from 1.1 to 1.2.  Fix overfull
5012         hboxes.
5013         (Index macro, Shell commands, Incompatiblities): Rename nodes
5014         from Index, UNIX commands, Other incompat.
5015         (Platform macros, Using frozen files, Frozen file format 1)
5016         (Frozen file format 2, Copying This Manual, Indices): New nodes.
5017         * Makefile.am (EXTRA_DIST): Distribute gendocs.
5018         (MAINTAINERCLEANFILES): Clean up files from gnulib.
5019         (doc_m4_TEXINFOS): Depend on fdl.texi.
5020         (web-manual): New maintainer target.
5022 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
5024         * doc/m4.texinfo (Modules):  RMS asked me for an explanation of
5025         the modular architecture of M4.  The result is paraphrased here
5026         for the benefit of future readers of the manual.
5028 2006-07-14  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
5030         * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5032 2006-07-14  Eric Blake  <ebb9@byu.net>
5034         * src/main.c (main): Avoid compiler warning.
5035         * modules/gnu.c (renamesyms): Remove unused variable.
5037 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
5039         * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
5040         (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
5041         new functions for managing regexp syntax options.
5042         * m4/m4private.h (m4): Add regexp_syntax field.
5043         * m4/resyntax.c: New file implements the above.
5044         * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
5045         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
5046         (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
5047         (m4_patsubst_do, m4_renamesyms_do): Removed.
5048         (builtin_changeresyntax): New builtin to change regular expression
5049         syntax.
5050         (m4_resyntax_encode_safe): Factor out diagnostics code.
5051         * src/freeze.c (produce_resyntax_dump): New function to dump
5052         default regexp syntax specifier to frozen file.
5053         (reload_frozen_state): Updated to action 'R' directive.
5054         * src/main.c (usage): Describe new -r option.
5055         (long_options, OPTSTRING): Declare it.
5056         (main): Encode and store cli regexp syntax option argument.
5057         * tests/freeze.at (regexp syntax): New test that regexp syntax
5058         survives freezing.
5059         * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
5060         * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
5061         (Epatsubst and Patsubst): Renamed to...
5062         (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
5063         documentation and added new examples.
5064         (Changeresyntax): New section describing changeresyntax builtin,
5065         and regexp syntax names.
5066         (Regular expression syntax): New section describing differences
5067         between various regular expression syntaxes.
5068         (Frozen files): Document 'R' directive.
5069         * NEWS: Updated.
5071 2006-07-13  Gary V. Vaughan  <gary@gnu.org>
5073         * bootstrap: Enhanced to work more like our other scripts:
5074         Add a copyright statement; support --version and --help; accept a
5075         --download-po option with argument as a substitute for DOWNLOAD_PO
5076         in the environment.
5078 2006-07-11  Eric Blake  <ebb9@byu.net>
5080         * Makefile.am (doc/m4.1): Port patch from branch that avoids
5081         intermediate file.
5082         * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
5083         changed.
5085 2006-07-10  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
5087         * tests/builtin.at (patsubst, regexp):  Adjust these tests, now
5088         that `\0' is no longer accepted.
5090         * src/main.c (usage): Alphabetize options within their sections.
5092         * modules/gnu.c (m4_regexp_search, regsub, substitute)
5093         (esyscmd):  Improve comments.
5095         * modules/gnu.c (substitute): Remove old warning for \0.
5096         (substitute_warned): No longer required.  Removed.
5098         * modules/gnu.c: Put macro definitions into alphabetical order.
5100 2006-07-07  Eric Blake  <ebb9@byu.net>
5102         * tests/freeze.at (loading format 1): New file, with new test.
5103         * tests/testsuite.at: Include it.
5104         * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
5105         * tests/modules.at (Freezing modules): Likewise.
5107         * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
5108         (AC_CHECK_HEADERS): Assume signal.h.
5109         (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
5110         (AC_CHECK_FUNCS_ONCE): Likewise.
5111         * src/m4.h (includes): Assume signal.h.
5113 2006-07-05  Eric Blake  <ebb9@byu.net>
5115         Fix all testsuite failures on cygwin.
5116         * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
5117         branch-1_4.  Solves testsuite failure when uninstalled m4 is
5118         shadowed by redefinition of PATH in libtool wrapper.
5119         * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
5120         contains the -no-undefined required by cygwin.
5121         (TESTS_ENVIRONMENT): Export abs_top_builddir.
5122         * tests/others.at (misc): Port to platforms where /etc/passwd
5123         does not exist or does not contain user named root.
5124         * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
5125         directory.
5126         * tests/builtins.at (define, divert): Avoid overquoting.
5127         * tests/generate.awk (new_group): Likewise.
5129 2006-07-05  Gary V. Vaughan  <gary@gnu.org>
5131         The regs_allocated field in a struct re_pattern_buffer refers
5132         to the state of a particular re_registers struct when used in
5133         successive matches using the same compiled pattern.  Avoid a
5134         SEGV in `renamesyms' resulting from using a new re_registers
5135         with an existing re_pattern_buffer:
5137         * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
5138         pattern buffer and registers.
5139         (m4_regexp_search): New function to call re_regexp_search with
5140         correctly matched pattern buffer and register instantiations.
5141         (m4_regexp_compile): Return an m4_pattern_buffer.  Adust all
5142         callers.
5144 2006-07-04  Gary V. Vaughan  <gary@gnu.org>
5146         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
5147         changes to gnulib getopt.m4 since last build.
5148         * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
5149         if the system getopt fails M4_GETOPT tests.
5151 2006-06-22  Eric Blake  <ebb9@byu.net>
5153         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
5154         Reported by Bruno Haible.
5156 2006-06-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5158         * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
5160 2006-06-19  Eric Blake  <ebb9@byu.net>
5162         * THANKS: Update.
5164 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5166         * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
5167         (clean-local): Split into and depend upon...
5168         (clean-local-tests, clean-local-src): ...these two.  The latter
5169         removes the libtool object directory below `src', to work around
5170         a buglet in Automake, failing to list it.
5171         (EXTRA_DIST): Distribute modules/perl.c.
5173 2006-06-19  Eric Blake  <ebb9@byu.net>
5175         * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
5176         right side of dependency; VPATH does that.
5177         (stamp-vcl): Update to use libtool's algorithm.
5178         (EXTRA_DIST): Distribute stamp-vcl.
5179         Reported by Ralf Wildenhues.
5180         (TESTSUITE): Revert earlier change that used absolute path, as
5181         that broke 'make dist' in VPATH.  Stick with $(srcdir) instead.
5182         (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
5183         (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
5184         atlocal takes care of it instead.
5185         (check-local, installcheck-local, clean-local): Inline absolute
5186         path to testsuite here, rather than relative path to testsuite
5187         elsewhere.
5189 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5191         * m4/m4private.h (DELETE): Cast away const here...
5192         * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
5193         * src/freeze.c (reload_frozen_state): Avoid uninitialized
5194         variable warning.
5196 2006-06-19  Eric Blake  <ebb9@byu.net>
5198         * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
5199         .info pages are built.
5200         Reported by Ralf Wildenhues.
5201         (EXTRA_DIST): Inline definition of testsuite, so that make dist
5202         works again.
5204 2006-06-16  Eric Blake  <ebb9@byu.net>
5206         Follow recommendations from autoconf manual for autotest.
5207         * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
5208         turn it into an absolute path until autotest provides an option
5209         that allows us to avoid changing directories.  Properly quote
5210         throughout.
5211         (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
5212         (check-recursive): Delete unused target.
5213         ($(TESTSUITE)): Atomically update testsuite.
5214         (CD_TESTDIR): Simplify.
5215         (m4__cd): Delete unused macro.
5216         (check-local): Let TESTSUITEFLAGS influence the run.
5217         (installcheck-local): Let TESTSUITEFLAGS override
5218         AUTOTEST_PATH.  Add dependencies.
5219         (clean-local): Clean up.
5220         (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
5221         * README: Document how to use the testsuite.
5223 2006-06-15  Eric Blake  <ebb9@byu.net>
5225         * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
5227         * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
5228         clashes with m4sugar.
5229         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5230         * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5231         * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5232         * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5233         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5234         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5235         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5236         * configure.ac: Likewise.
5237         (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5238         * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5239         conditional.
5240         * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5242         Reduce compiler warnings.  Inside GMP, mpq_t is an array type, so
5243         const mpq_t is not assignable from plain mpq_t.  Avoid
5244         type-punning warnings caused trying to mix these types.
5245         * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5246         (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5247         * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5248         (mult_term, exp_term): Remove type-punning casts.
5249         (numb_pow): Remove const qualifier.
5250         * src/freeze.c (reload_frozen_state): Fix typo in messages.
5251         Fix variables that can be used uninitialized, which fixes
5252         security hole where malicious frozen file can execute arbitrary
5253         code.
5255 2006-06-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5257         * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5259 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5260         and Eric Blake  <ebb9@byu.net>
5262         Allow `make dist' to work again.
5263         * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5264         (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5265         (cvs-dist): Fix typo.
5266         * NEWS: Match current version number.
5268 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5270         * Makefile.am (AM_CPPFLAGS):  Add $(LTDLINCL), so the right
5271         ltdl.h is used.
5273         * bootstrap: Do not run libtoolize manually, this is done
5274         correctly by autoreconf.  Invoke autoreconf with --no-recursive
5275         to avoid unnecessary rerunning of autotools for libltdl.
5277 2006-06-13  Eric Blake  <ebb9@byu.net>
5279         * THANKS: Update.
5281 2006-06-12  Eric Blake  <ebb9@byu.net>
5283         * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5284         bother with mktemp.
5285         * src/m4.h: Don't declare mktemp.
5286         * m4/input.c (m4__next_token): Avoid bzero.
5287         * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5288         * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5289         than distributing outdated helptoman.pl.
5290         * doc/helptoman.pl: Delete.
5292 2006-06-10  Eric Blake  <ebb9@byu.net>
5294         * README (Patches): Document the current dependence on CVS
5295         builds of autotools.
5296         * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5297         * configure.ac: Use consistent quoting throughout.
5298         (AC_PREREQ): Bump to 2.59d.
5299         (AC_INIT): Package name begins with uppercase.
5300         (AC_ARG_WITH): Use AS_HELP_STRING.
5301         (AM_INIT_AUTOMAKE): Enable gnits mode.
5302         (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5303         (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5304         (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5305         done by gnulib or automake, or which autoconf has declared
5306         obsolete.
5307         * m4/m4private.h (Includes): Assume C89 or better, and use errno
5308         unconditionally.
5309         * m4/output.c (Includes): Likewise.
5310         * modules/gnu.c (Includes): Likewise.
5311         * modules/m4.c (Includes): Likewise.
5312         * src/m4.h (Includes): Likewise.
5314         * README-alpha: Update web address.
5315         * README: Likewise. Change encoding to ASCII.  Remove old advice
5316         about cygwin.  Document bootstrapping dependency.
5317         * AUTHORS: Update from branch-1_4.
5318         * THANKS: Likewise.  Change encoding to UTF-8.
5319         * BACKLOG: Delete.  This file is too old and unmaintained to be
5320         worthwhile.
5321         * ChangeLog: Change encoding to UTF-8.
5323         Avoid compiler warnings.
5324         * m4/macro.c (trace_format): Don't mark this as a printf format,
5325         since we don't accept the same set of modifiers as printf.  It
5326         would be nice if gcc let us specify a custom format archetype.
5327         * src/main.c (main): Cast away const.
5329 2006-06-10  Andreas Schwab  <schwab@suse.de>  (tiny change)
5330             Eric Blake  <ebb9@byu.net>
5332         * modules/time.c (ctime): Pass correctly typed variable to
5333         m4_numeric_arg.
5334         (gmtime): Likewise.
5335         (localtime): Likewise.
5336         (strftime): Likewise.
5337         * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5338         limit inherent in this interface.
5340 2006-05-08  Bruno Haible  <bruno@clisp.org>  (tiny change)
5342         * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5343         (sysval): Use WEXITSTATUS.
5344         * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5345         big-endian and little-endian wait status definitions.
5347 2006-05-06  Eric Blake  <ebb9@byu.net>
5349         * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5350         * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5351         in src, not gnu.
5353 2006-05-06  Eric Blake  <ebb9@byu.net>
5355         * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5356         subdirectory to use.
5357         (support for -pipe): Move after LT_INIT, since it relies on
5358         libtool internals.
5360 2006-05-05  Eric Blake  <ebb9@byu.net>
5362         * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5364         * THANKS: Update.
5366 2006-05-05  Bruno Haible  <bruno@clisp.org>
5367         and Eric Blake  <ebb9@byu.net>
5369         * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5370         * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5371         usage pattern.
5372         * bootstrap: Update usage of gnulib-tool.
5374 2006-05-04  Eric Blake  <ebb9@byu.net>
5376         * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5377         Cleanup whitespace.
5379 2005-12-05  Gary V. Vaughan  <gary@gnu.org>
5381         * bootstrap (func_update_po): Synch with CVS GNU tar.  wget 1.9.x
5382         and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5383         Reported by Eric Blake <ebb9@byu.net>
5385 2005-12-04  Gary V. Vaughan  <gary@gnu.org>
5387         * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5388         http caching as -C is no longer supported by wget 1.10.x.
5389         Reported by Eric Blake <ebb9@byu.net>
5391 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
5393         * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5394         to ...
5395         (iface_id): ...an lt_dlinterface_id type.
5396         (m4__module_find): New abstraction for lt_dlhandle_fetch.  Use
5397         throughout, instead of calling obsolete lt_dlhandle_find directly.
5398         (m4__module_next): Use multiloader-safe lt_dlhandle_iterate.  Use
5399         throughout, instead of calling obsolete lt_dlhandle_next.
5400         * m4/m4private.h (m4__module_find): Declare it.
5401         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5402         Use m4__module_next instead of obsolete lt_dlhandle_next.
5404 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
5406         * bootstrap (func_update_po): Update pofiles directly from the
5407         translation project.
5408         * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5409         po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5410         these files under source control anymore.
5411         Suggested by Eric Blake <ebb9@byu.net>
5413 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
5415         * ltdl/m4/m4-gnulib.m4: Update FSF contact address.  Somehow this
5416         file escaped the address updates on 2005-05-01.
5418 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
5420         * bootstrap: Allow user overriding of gnulib-tool location, and
5421         correctly determine module source directories whether gnulib-tool
5422         is given as a relative or absolute path, or is found by searching
5423         PATH.
5424         Reported by Eric Blake <ebb9@byu.net>
5426 2005-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5428         * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5429         and $RM are defined for various versions of
5430         AC_LIBTOOL_COMPILER_OPTION.
5432         * bootstrap (AUTORECONF): New variable to allow user overriding of
5433         autoreconf path.
5435 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
5437         * doc/m4.texinfo (History): Add better notes on the ancestory of
5438         GNU m4, and other historical interest.
5440 2005-05-08  Gary V. Vaughan  <gary@gnu.org>
5442         * m4/symtab.c (m4_symbol_rename): New function that performs a low
5443         level symbol rename.
5444         * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5445         * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5446         (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5447         regsub...
5448         (erenamesyms, renamesyms): ...builtins that use these to implement
5449         macro renaming by regular expression.
5450         * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5451         * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5452         to stop the new generated tests from choking.
5454 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
5456         Since most of the build is handled from a single Makefile.am now,
5457         we can teach make about the dependencies between the m4 binary and
5458         the preopened modules it is built against:
5460         * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5461         preopened modules.
5462         * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5463         of the preopened modules have changed.
5465 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
5467         * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5468         have a native implementation.
5470 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
5472         * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed.  These are
5473         handled already by gnu/exit.h.
5475         * configure.ac (gl_MODULES): Add assert to support a
5476         --disable-assert configure time option for NDEBUG setting.
5478         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5479         * bootstrap (src_modules): Add version-etc-fsf.
5480         * src/main.c (version_etc_copyright): Removed.
5482         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5484 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5486         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5487         recognition macros.
5488         * src/freeze.c (produce_frozen_state): Use \n line-endings even
5489         on Windows, so that the frozen file reader will work.
5490         Reported by Josef T. Burger <bolo@bolo.com>
5492 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
5494         Forward port of a patch that allowed m4-1.4.2 to compile on
5495         QNX 6.3:
5497         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
5498         sys/signal.h.
5499         * src/m4.h: And include them as appropriate.
5500         * src/main.c, src/stackovf.h: Don't include signal.h literally;
5501         m4.h will include the correct file.
5503 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5505         * m4/m4private.h: Make errno visible for the sources patched
5506         below.
5508 2005-05-04  Paul Eggert  <eggert@twinsun.com>
5510         * src/main.c (print_program_name_CB): Preserve errno, since
5511         M4ERROR relies on this.
5512         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
5513         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
5514         * m4/path.c (m4_path_search): Don't let "free" trash errno when
5515         returning NULL.
5517         * m4/output.c (m4_insert_file): Don't assume errno has a valid
5518         value simply because fread returns zero.  This fixes a
5519         portability bug reported by Marion Hakanson in
5520         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
5522 2005-05-04  Santiago Vila  <sanvila@debian.org>
5524         * tests/stackovf.test: Use tempfile if available.
5526 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
5528         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
5529         * m4/output.c (m4_insert_file): Do not mix buffered and
5530         unbuffered I/O, as this breaks on the Hurd.
5532 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5534         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
5535         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
5536         and libtoolize does a better job of ltdl importing now too, so
5537         take advantage of that while updating the tree:
5539         * acm4, config: Moved from here...
5540         * ltdl/m4, ltdl/config: ...to here.
5541         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
5542         src/Makefile.am, tests/Makefile.am: Removed...
5543         * Makefile.am: ...and migrated to here, with adjustments to
5544         compensate for relative path differences.
5545         * commit: Adjust relative paths.
5546         * configure.ac: Adjust relative paths.
5547         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
5548         patch.
5549         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
5550         the meanwhile, CVS HEAD libtool is needed.
5551         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
5552         stricly new enough, we also need a patch.
5553         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
5554         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
5555         (gl_MODULES): Don't list getopt and version-etc, as they don't
5556         belong in libm4.
5557         * bootstrap: After running gnulib-tool to import the listed
5558         modules, fetch getopt and version-etc into src manually.
5559         (ltdldir): Change to ltdl.
5560         * src/main.c: Adjust for changes in version-etc API.
5561         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
5562         but works when the getopt module isn't to be included in the lib.
5563         * README: Add note about patching autoconf and automake to
5564         bootstrap CVS m4.
5566 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
5568         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
5569         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
5570         empty file rather than to a nonexistent file.  This closes a
5571         common security hole.
5572         * modules/m4.c (m4_maketemp): Implement the above, by using
5573         mkstemp rather than mktemp.
5575 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
5577         The FSF are moving offices today.  Changed their contact address
5578         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
5579         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
5581 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
5583         * tests/Makefile (clean-local): Ignore testsuite cleanup
5584         failures.
5586 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
5588         * tests/Makefile (clean-local): Only run the testsuite cleanup
5589         if the testsuite has been generated.
5591 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
5593         * TODO: slight clarification of the example of qindir usage.
5595 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
5597         * TODO: Add qindir requirement, and defn bug.
5598         From Stepan Kasal  <kasal@ucw.cz>
5600 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
5602         * TODO: Add ``execution stack'', fix a typo.
5603         * doc/m4.texinfo: Typos.
5605 2004-12-24  Eric Blake  <ebb9@byu.net>
5607         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
5608         to the gnu subdirectory.
5609         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
5610         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
5611         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
5612         * m4/system_.h: Likewise, in non-configured includes.
5614 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
5615             Gary V. Vaughan  <gary@gnu.org>
5617         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
5618         Protect definitions from macro expansion under -DNDEBUG by
5619         parenthesising the expanded function names.
5620         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5621         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5622         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5623         (m4_is_syntax_macro_escaped): Similarly protect function
5624         definitions from macro expansion under -DNDEBUG by #undefing the
5625         matching macro names before each definition.  Also, move all the
5626         function definitions to the end of the file so that any
5627         invocations in the rest of the file pick up the fast macro
5628         versions.
5629         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
5630         (m4_set_debug_file, m4_set_trace_messages)
5631         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5632         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5633         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
5634         option setter functions.
5636 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
5638         * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
5639         to gnu.
5641 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
5643         * src/main.c: Include gnulib files from the correct directory.
5645         * gnulib/*: Don't store any of the gnulib files in arch, as they
5646         generate spurious changes.
5647         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
5648         gnulib macros now share our macro directory.
5649         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
5650         * bootstrap: Call gnulib-tool to import from the gnulib tree.
5651         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
5652         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
5653         the gettext macros from autopoint that overwrite the gnulib-tool
5654         imported versions.  Import sources and Makefile.am into the `gnu'
5655         directory.  Changed all callers.
5656         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
5657         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
5658         for imported modules.
5659         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
5660         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
5661         hardcoding the gnulib macros they wrap.
5663 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
5665         Latest CVS libtool can preload modules in libraries, including
5666         its own module loaders!  Tweak m4 so that it doesn't try to treat
5667         libltdl's module loaders as m4 modules when freezing and on exit:
5669         * gnulib/acm4/*.m4: Don't store these files in arch since they
5670         generate spurious changes.
5671         * bootstrap: Simplify initial libtoolize call, since CVS
5672         libtoolize is smarter these days.
5673         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
5674         build.
5675         * m4/module.h (m4__module_exit): Missing declaration.
5676         * m4/m4private.h (m4__module_next): New function declaration.
5677         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
5678         encapsulation.  Changed all callers.
5679         (m4__module_interface): New function to verify m4 loadable module
5680         interfaces.
5681         (m4__module_init): Register the interface validator.
5682         (m4__module_exit): Only close my own modules.
5683         * modules/m4.c (unistd.h): Provide missing declaration.
5684         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
5685         (m4_expand_ranges): More missing declarations.
5686         * modules/modtest.c (export_test): Ditto.
5687         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
5688         * src/main.c (main): Bump copyright year.
5689         * tests/modules.at: Fix sed syntax error.
5692 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
5694         Tweaking to enable compilation with latest CVS libtool and
5695         libltdl.  We can't just dump the library files directly into the
5696         m4 directory anymore now that libltdl is built from pieces itself:
5698         * bootstrap: Rewritten to use latest libtoolize sanely, and to
5699         set up libltdl subdirectory.
5700         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
5701         gnulib subdirectory's config.
5702         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
5703         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
5704         macros from gnulib.
5705         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
5706         configure.ac, so use AC_WITH_LTDL instead.
5707         * Makefile.am (SUBDIRS): Add libltdl.
5708         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
5709         gl_INCLUDED_REGEX.
5710         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
5711         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
5712         (libm4_la_LIBADD): Add LIBLTDL.
5713         * m4/ltdl.c, m4/ltdl.h: Removed.
5714         * m4/m4module.h: Include canonical ltdl.h.
5715         * po/*.po: Updated.
5717 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
5719         * gnulib/import: Now updates makefile fragments, and configure.ac.
5720         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
5721         * gnulib/m4/Makefile.am: include it.
5722         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
5723         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
5724         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
5725         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
5726         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
5727         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
5728         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
5729         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
5730         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5731         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5732         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5733         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
5734         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
5735         import.
5736         * gnulib/m4/getopt_int.h: New source file from latest gnulib
5737         import.
5738         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
5739         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
5740         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
5741         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
5742         Updated source files from latest gnulib.
5744 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
5746         * config/mailnotify: New file for mailing commit notifications,
5747         imported from cvs-utils.
5748         * commit: Updated from cvs-utils and tweaked for m4.
5750 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
5752         * config/mkstamp: Updated from CVS libtool.
5753         * configure.ac: Generate a gnu coding standards compliant version
5754         number, and use it for the banner.
5755         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
5756         mhen the TIMESTAMP changes in ChangeLog, but the file modification
5757         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
5758         contain the previous version number.
5759         * src/main.c: Make --version output conform to the GNU standard.
5761         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
5762         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
5763         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
5764         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
5765         time_la_SOURCES): ...so that these are defaulted correctly, and
5766         can be removed from this file.
5767         (AM_LDFLAGS): Add -module...
5768         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
5769         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
5770         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
5771         the individual settings can be removed.
5772         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
5773         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
5774         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
5775         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
5776         time_la_LIBADD): ...so that these are picked up as a deplib of
5777         libm4 and don't need to be set explicitly.
5779 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
5781         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
5782         from the standard build.  It is too fragile.
5784         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5785         CVS libtool after merging m4 changes across to libtool.
5787         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5788         * m4/path.c (search_path_add): Ditto.
5790 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5792         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5793         libtool tags we don't use in configure.  This reduces the size
5794         of the script from over 1Mb to under 700Kb.
5796 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5798         The import script was not written properly, and the last gnulib
5799         import was incomplete.  Fixed that problem, and reimport our
5800         gnulib dependencies, which picks up the address calculation
5801         overflow checks described by Paul below.  Also tweak the clients
5802         of the gnulib xalloc module not to use deprecated macros:
5804         * gnulib/import: Recurse through module dependencies rather than
5805         naively descending only one level.
5806         * configure.ac: Add calls to gnulib's strnlen and extension module
5807         macros.
5808         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5809         extension modules.
5810         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5811         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5812         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
5813         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
5814         gnulib.
5815         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
5816         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
5817         place of `xcalloc (1, S)'.
5818         * m4/m4.c (m4_create): Likewise.
5819         * m4/m4private.h (m4_symbol_value_create): Likewise.
5820         * m4/symtab.c (symtab_fetch): Likewise.
5821         * m4/syntax.c (m4_syntax_create): Likewise.
5822         * src/freeze.c (reload_frozen_state): Likewise.
5823         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
5824         macro.
5825         * m4/symtab.c (m4_symtab_create): Likewise.
5827 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5829         * tests/module.at: Comment typo.
5831 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
5833         * tests/modules.at (modules: importing): Apply some lateral
5834         thinking, and use AT_CHECK to compare the output of a sed pass
5835         over stderr against the canonical strerror string.
5837         * tests/modules.at (modules: importing): Edit the generated stderr
5838         output to canonicalize strerror output, before a comparison.
5840 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
5842         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
5843         careful not to trip over the mess:
5845         * modules/perl.c: Some builds of perl install headers that contain
5846         `#define try __builtin_try'.  Be sure to undefine that macro
5847         before `m4/hash.h' gets included, which uses the `try' symbol.
5848         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
5849         `false' before including `stdbool.h'.
5850         (DELETE):  This symbol is not in m4's namespace, and is in any
5851         case only used internally...
5852         * m4/m4private.h (DELETE): ...so move it to here.
5853         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
5855 2003-10-08  Paul Eggert  <eggert@twinsun.com>
5857         Don't use XMALLOC and XCALLOC.  Once we install the
5858         corresponding patch into gnulib, this will fix some
5859         address-calculation overflow bugs on hosts where calloc (A, B)
5860         returns garbage when A*B overflows.
5862         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
5863         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
5864         xmalloc, XCALLOC with xcalloc.
5865         * m4/m4.c (m4_create): Likewise.
5866         * m4/m4private.h (m4_symbol_value_create): Likewise.
5867         * m4/output.c (m4_output_init): Likewise.
5868         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
5869         * m4/syntax.c (remove_syntax_attribute): Likewise.
5870         * src/freeze.c (reload_frozen_state): Likewise.
5871         * src/main.c (main): Likewise.
5873 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
5875         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
5876         gnulib/acm4 directories for aclocal m4 macros.
5877         * gnulib/Makefile.am (EXTRA_DIST): Removed.
5878         (MAINTAINERCLEANFILES): Add Makefile.in.
5879         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
5880         modules we use.
5881         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
5882         * gnulib/import: New file.  Temporary script for updating gnulib
5883         imported files, until gnulib-tool is working.
5884         * gnulib/config/codeset.m4, gnulib/config/error.m4,
5885         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
5886         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
5887         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5888         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
5889         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5890         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5891         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5892         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
5893         gnulib/config/nls.m4, gnulib/config/obstack.m4,
5894         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
5895         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
5896         gnulib/config/regex.m4, gnulib/config/restrict.m4.
5897         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
5898         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
5899         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
5900         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
5901         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
5902         gnulib/config/xstrndup.m4: Removed.
5903         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
5904         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
5905         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
5906         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
5907         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
5908         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
5909         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
5910         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
5911         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
5912         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
5913         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
5914         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
5915         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
5916         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
5917         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5918         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
5919         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
5920         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5921         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5922         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
5923         gnulib/import script.
5924         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
5925         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
5926         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5927         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
5928         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
5929         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
5930         gnulib with gnulib/import script.
5931         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
5932         guards ready for gnulib-tool to autoupdate on import.
5933         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
5934         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
5935         config/stackovf.m4: Moved from here...
5936         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
5937         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
5938         acm4/stackovf.m4: ...to here, to separate aclocal macros from
5939         configure time helper scripts.
5940         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
5941         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
5942         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
5943         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
5944         gnulib xalloc.h.
5945         * src/main.c (version_etc_copyright): Only output the current
5946         year.
5947         (version_etc): Call with new variadic API.
5949 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
5951         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
5952         version-etc module from CVS gnulib.
5953         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
5954         * src/Makefile.am: Build it.
5955         * src/main.c: Use it.
5957         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
5958         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
5959         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
5960         exit.h instead.
5962 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
5963             Gary V. Vaughan  <gary@gnu.org>
5965         * bootstrap: Separate options.
5966         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
5967         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
5968         not set.
5969         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
5970         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
5971         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
5972         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
5973         $(LTLIBINTL) for gettext support on cygwin.
5974         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
5975         have $(LTLIBINTL) from the preloaded module la files.
5976         * README: Remove the warning about using --disable-nls on Windows
5977         machines.
5979 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
5981         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
5982         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
5983         is required.
5985 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
5987         * doc/STYLE: Document the gnulib header naming conventions, and
5988         #include policy.
5989         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
5990         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
5991         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
5992         respectively.
5993         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
5995         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
5996         module from CVS gnulib.
5997         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
5998         (gl_FUNC_STRTOL): In favour of the module macro.
6000 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
6002         Replace the getopt code with CVS gnulib getopt.  The source files
6003         detect whether they are in a glibc environment and preprocess away
6004         all of the code if there is a system getopt, so we can compile
6005         them into the m4 executable unconditionally:
6007         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
6008         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
6009         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
6010         macros.
6011         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
6012         version.
6013         * src/Makefile.am: Adjust.
6014         * src/main.c: Always include our shipped getopt.h.
6015         * po/POTFILES.in: Use new location of getopt.c.
6017 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
6019         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
6020         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
6021         in this directory automatically.
6022         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
6024         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
6025         isn't set yet.
6026         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
6027         inline.
6028         * modules/Makefile.am (pkglibexecdir): Set it here.
6029         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
6031         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
6032         Import regex module from CVS gnulib.
6033         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
6034         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
6035         do extra substitutions for Makefile.
6036         * configure.ac: Use it.
6037         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
6038         from regex_.h if necessary.
6039         * m4/system_.h: Include the correct version of regex.h.
6040         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
6041         version.
6042         * po/POTFILES.in: Use new location of regex.c.
6044         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
6045         realloc.c: automake distributes these files already.
6047 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
6049         Replace the xstrzdup code by importing the xstrndup module from
6050         CVS gnulib, along with its dependencies: strndup and strnlen:
6052         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
6053         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
6054         gnulib.
6055         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
6056         gnulib/config/strndup.m4: Ditto wrt strndup.
6057         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
6058         strnlen.
6059         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
6060         However, contrary to gnulib, we install xstrndup.h.
6061         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
6062         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
6063         is an artifact of the old m4 portability layer.
6064         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
6065         * m4/system_.h: Include xstrndup.h.
6066         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
6068 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
6070         Reimport the latest xalloc module from CVS gnulib, and adjust the
6071         m4 sources to take advantage of xalloc xfree.  Also create a new
6072         macro DELETE with the same semantics as the old m4 XFREE macro,
6073         and carefully tweak callers:
6075         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
6076         gnulib.
6077         * m4/utility.c (xfree): Removed.  This function is now supplied by
6078         gnulib xalloc.
6079         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
6080         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
6081         * m4/symtab.c (m4_symtab_create): Ditto.
6082         * m4/system_.h: Removed XFREE redefine.
6083         (DELETE): New macro with same functionality as the original m4
6084         XFREE macro, but based on xalloc.h now.  Changed all callers.
6085         * src/main.c (main): Use XMALLOC macro.
6086         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
6087         instead of XFREE.
6088         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
6090 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
6092         Import the xalloc module from CVS gnulib, along with its
6093         dependencies: exitfail, malloc and realloc. We had different
6094         semantics for our XFREE and a function xfree() not supplied by
6095         gnulib, so also a bit of work to keep everything running
6096         smoothly:
6098         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
6099         (gl_XALLOC): Use gnulib equivalents.
6100         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
6101         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
6102         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
6103         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
6104         realloc.
6105         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
6106         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
6107         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
6108         imported modules.
6109         (pkgincdir): Removed.  Use pkgincludedir instead.
6110         * m4/m4private.h (XFREE): xfree already checks for NULL.
6111         * m4/system_.h: Use xalloc module, and remove macros already
6112         supplied by xalloc.h.
6113         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
6114         moved the old definition from m4/xmalloc.c to here for now.
6116 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
6118         Import the error and progname modules from CVS gnulib.  Our old
6119         error.c subsumed the functionality of both, so a little adjustment
6120         was required to accomodate the split in sources.  Also added more
6121         wrapper macros to choose between a system installed error.h or our
6122         shipped gnulib error module:
6124         * m4/error.c, m4/error.h: Removed.
6125         * m4/Makefile.am: Adjust.
6126         (pkgincdir): Removed.  Use pkgincludedir instead.
6127         * m4/module.h, src/main.c: Don't include `m4/error.h'.
6128         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
6129         error.h.
6130         * gnulib/m4/progname.c: Imported from CVS gnulib.
6131         * gnulib/m4/progname.h: Ditto.
6132         * src/main.c: Adjust to use progname module.
6133         * gnulib/m4/error.c: Imported from CVS gnulib.
6134         * gnulib/m4/error_.h: Ditto.
6135         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
6136         if appropriate, and link a local error.h if the system version is
6137         missing.
6138         (libgnu_la_SOURCES) Add progname module sources.
6139         * gnulib/config/error.m4: Imported from CVS gnulib.
6140         * gnulib/config/strerror_r.m4: Ditto.
6141         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
6142         to have ERROR_H for Makefile substitutions and tell system.h
6143         whether the system error.h should be used, or a locally installed
6144         version.
6145         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
6147 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
6149         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
6150         s/gettext_.h/gettext.h/.
6152         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
6153         automake have been fixed.
6155         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
6156         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
6157         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
6158         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
6160 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
6162         The gnulib obstack module requires the gnulib gettext module for
6163         systems that do not have GNU gettext installed.  Because we use
6164         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
6165         that directory incase it clashes with the system gettext.h.  This
6166         delta uses gettext_.h and extra rules in the Makefile to make a
6167         link to gettext.h when needed:
6169         * Makefile.am (auxdir): Removed.  No longer used.
6170         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
6171         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
6172         moved.
6173         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
6174         Makefile based build.
6175         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
6176         of the macros are kept.
6177         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
6178         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
6179         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
6180         distributes these automatically.
6181         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
6182         warning from automake-1.7a.
6183         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
6184         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
6185         all callers.
6186         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
6187         wrt. m4_FUNC_OBSTACK.
6188         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
6189         wrt. m4_sys_STACKOVF.
6190         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
6191         wrt. _m4_LIB_GMP, m4_LIB_GMP.
6192         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
6193         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
6194         respectively.
6195         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
6196         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
6197         gettext.h link on deficient systems.
6198         (pkginc_HEADERS): Mention $(GETTEXT_H).
6199         (EXTRA_HEADERS): Mention gettext.h.
6200         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
6201         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
6202         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6203         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
6204         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6205         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6206         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6207         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
6208         gnulib/config/po.m4, gnulib/config/progtest.m4,
6209         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
6210         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
6212 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
6214         We can't mirror the gnulib directory structure here, since we need
6215         to be able to eg. `#include <m4/obstack.h>' from our source files,
6216         which is much easier if the local obstack.h is created in a
6217         directory named m4.  Rather than trying to symlink everything into
6218         the m4 directory, now we build a libtool convenience library from
6219         the sources we get from gnulib and link that with libm4.la:
6221         * gnulib/config/extensions.m4: Imported from CVS gnulib.
6222         * gnulib/config/unlocked-io.m4: Ditto.
6223         * gnulib/m4/unlocked-io.h: Ditto.
6224         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
6225         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
6226         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
6227         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
6228         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
6229         * m4/Makefile.am: Adjust.
6230         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6231         macros we redistribute.
6232         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
6233         library among others.
6234         (GNULIB_SRCS, GNULIB_MACROS): Removed.
6235         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6236         * config/m4-obstack.m4: Adjust.
6237         * po/POTFILES.in: Adjust.
6238         * configure.ac: Reformatting.  Call newly imported gnulib macros.
6239         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6240         bogus calls of `#include "m4.h"'.
6241         * Makefile.am: INCLUDES has been deprecated in favour of
6242         AM_CPPFLAGS.
6243         * m4/Makefile.am: Ditto.
6244         * modules/Makefile.am: Ditto.
6245         * src/Makefile.am: Ditto.
6247 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
6249         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6251 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
6253         Migrate the obstack support into the gnulib directories for easy
6254         synchronisation with upstream files in gnulib:
6256         * config/gnu-obstack.m4: Moved from here...
6257         * config/m4-obstack.m4: ...to here.
6258         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6259         * m4/obstack.c, m4/obstack_.h: Moved from here...
6260         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6261         * po/POTFILES.in: Adjust.
6262         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6263         * m4/Makefile.am: Add a whole new section to link the obstack
6264         sources from the gnulib tree if necessary.
6265         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6266         from gnulib.
6267         * config/m4-obstack.m4: Rewrite as a wrapper for
6268         gnulib/m4/obstack.m4.
6270 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
6272         GNU M4 currently builds with a number of files adapted from
6273         upstream sources.  Recently the gnulib project on savannah.gnu.org
6274         has pulled together a great many of these externally maintained
6275         files.  This delta is the beginnings of isolating those files
6276         maintained in gnulib to make it easy to synchronise M4 with the
6277         upstream files prior to releases.
6279         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6280         directory.
6281         (SUBDIRS): Added new gnulib subdirectory.
6282         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6283         * config/stdbool.m4: Moved from here...
6284         * gnulib/m4/stdbool.m4: ...to here.
6285         * m4/stdbool_.h: Moved from here...
6286         * gnulib/lib/stdbool_.h: ...to here.
6287         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
6288         distributed.
6289         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6290         code to work with new stdbool_.h location.
6291         (gnulib_srcdir): New.
6293 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
6295         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6296         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6297         builds to work.
6298         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
6299         (EXTRA_DIST): Use it.
6301         * bootstrap: CVS autoreconf leaves file droppings.  Remove
6302         aclocal.m4t incase autoreconf doesn't.
6304 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
6306         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
6307         the other gnulib imports, renamed to m4/obstack_.h.
6308         * m4/obstack.c: Updated from CVS gnulib.
6309         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6310         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6311         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
6312         about vpath already, and $top_srcdir upsets CVS Automake, so the
6313         $top_srcdir reference was removed.
6315         * m4/system-h.in: For consistency with the gnulib imports, renamed
6316         to m4/system_.h.
6317         * m4/Makefile (EXTRA_HEADERS): Adjust.
6318         * configure.ac (AC_CONFIG_FILES): Adjust.
6320         * m4/stdbool_.h: New file from gnulib for systems without their
6321         own.
6322         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6323         * config/stdbool.m4: New file.  Macros from gnulib for same.
6324         * configure.ac: Use it.
6326 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
6328         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6329         * config/gmp.m4: Ditto.
6330         * config/gnu-obstack.m4: Ditto.
6331         * config/stackovf.m4: Ditto.
6332         * m4/builtin.c: Ditto.
6333         * m4/debug.c: Ditto.
6334         * m4/error.c: Ditto.
6335         * m4/error.h: Ditto.
6336         * m4/gnu-obstack.h: Ditto.
6337         * m4/hash.c: Ditto.
6338         * m4/hash.h: Ditto.
6339         * m4/input.c: Ditto.
6340         * m4/m4.c: Ditto.
6341         * m4/m4module.h: Ditto.
6342         * m4/m4private.h: Ditto.
6343         * m4/macro.c: Ditto.
6344         * m4/module.c: Ditto.
6345         * m4/obstack.c: Ditto.
6346         * m4/output.c: Ditto.
6347         * m4/path.c: Ditto.
6348         * m4/regex.c: Ditto.
6349         * m4/regex.h: Ditto.
6350         * m4/strtol.c: Ditto.
6351         * m4/symtab.c: Ditto.
6352         * m4/syntax.c: Ditto.
6353         * m4/utility.c: Ditto.
6354         * m4/xmalloc.c: Ditto.
6355         * m4/xstrdup.c: Ditto.
6356         * m4/xstrzdup.c: Ditto.
6357         * modules/evalparse.c: Ditto.
6358         * modules/format.c: Ditto.
6359         * modules/gnu.c: Ditto.
6360         * modules/import.c: Ditto.
6361         * modules/load.c: Ditto.
6362         * modules/m4.c: Ditto.
6363         * modules/m4.h: Ditto.
6364         * modules/modtest.c: Ditto.
6365         * modules/mpeval.c: Ditto.
6366         * modules/perl.c: Ditto.
6367         * modules/shadow.c: Ditto.
6368         * modules/stdlib.c: Ditto.
6369         * modules/time.c: Ditto.
6370         * modules/traditional.c: Ditto.
6371         * src/freeze.c: Ditto.
6372         * src/getopt.c: Ditto.
6373         * src/getopt1.c: Ditto.
6374         * src/m4.h: Ditto.
6375         * src/main.c: Ditto.
6376         * src/stackovf.c: Ditto.
6378         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6379         ac_default_headers is an autoconf internal variable.
6380         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6381         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6383         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6384         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6385         delta.
6387 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
6389         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6390         C99 bool.
6391         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6392         possible or faking one with a typedef.  Changed all callers.
6394 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
6396         Still cleaning up the users' module API, by taking out the stuff
6397         that isn't used by any existing modules, and moving specialised
6398         functions out of libm4 and into the module they are used by.
6400         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
6401         * m4/utility.c (m4_skip_space): ...to here the home of its only
6402         use, made static and renamed to `skip_space'.  Changed all
6403         callers.
6404         * m4/m4module.h (m4_expand_ranges): Removed prototype.
6405         * m4/utility.c (m4_expand_ranges): Moved definition from here...
6406         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6407         ltdl.
6408         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6409         casting .
6410         * modules/gnu.c (builtin_syntax): Import and use in this
6411         builtin implementation.
6412         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6413         Not used.  Deleted.
6414         * m4/macro.c (trace_flush): Except here where the macro is now
6415         manually inlined.
6416         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6417         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6418         moved...
6419         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6420         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6422 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
6424         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6425         compiler based AC_CHECK_HEADER that was introduced in
6426         autoconf-2.56.
6427         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6428         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6429         * configure.ac: Use renamed M4_AC_LIB_GMP.
6431         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6432         macro that requires arguments! This stops the shell's bad
6433         substitution error at configure time.
6435         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6436         variables to the testsuite shell.  Set the value of USE_GMP so
6437         that the gmp test will run!
6438         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6440 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
6442         Libltdl already has an excellent mechanism for accessing C symbols
6443         in modules.  Lets use that!  Remove all the exporting cruft and
6444         just use lt_dlsym in conjunction with a few conventions to
6445         simplify module writers' jobs.  Also removed the table address
6446         caching code and otherwise simplified the module loader quite a
6447         bit.  To access exported symbols in other modules, first the
6448         exporting module must name the symbols <modname>_LTX_<symname>,
6449         and the importing module must define a function type called
6450         <symname>_func.  The importer then adds
6451         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6452         that wishes to call out to the exported functions.  Care must be
6453         taken that <symname> is non-NULL in the importing module incase
6454         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6455         definition was in the importers source.  Study
6456         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
6457         m4_module_import will attempt to automatically load a module
6458         required for symbol access if it is not loaded already.
6460         * TODO: Removed the items fixed in this delta.
6461         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6462         module name.
6463         * m4/ltdl.h (lt_dlhandle_find): Declare it.
6464         * m4/module.c (m4_module_unload): Use it.
6465         * src/freeze.c (reload_frozen_state): Ditto.
6466         * m4/m4module.h (m4_export): Deleted.  Removed all references.
6467         (M4_MODULE_IMPORT): New user convenience macro for importing
6468         arbitrary symbols from other modules.
6469         * m4/module.c (m4_module_import): New function to service
6470         M4_MODULE_IMPORT macro.
6471         (module_data): Removed.  Looking up the tables on demand with
6472         lt_dlsym, rather than caching their addresses here simplifies the
6473         code substantially.
6474         (m4_get_module_builtin_table, m4_get_module_macro_table):
6475         Removed.  Changed all callers.
6476         (set_module_macro_table, set_module_builtin_table): Renamed to
6477         install_macro_table and install_builtin_table respectively, and
6478         simplified now that the cache is no more.
6479         * modules/gnu.c (builtin_symbols): Use this new mechanism to
6480         import m4_dump_symbols from the m4 module.
6481         (builtin_esyscmd): Likewise for m4_set_sysval and
6482         m4_sysval_flush.
6483         * modules/m4.c (m4_export_table): Removed.  Functions are
6484         addressed with the new mechanism which doesn't need this.
6485         (m4_set_sysval): New exported accessor function to prevent
6486         problems with variable access on inferior architectures.
6487         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6488         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6489         that we can have some type safety.
6490         * modules/modtest.c (export_test): C level exported function for
6491         testing the new import mechanism.
6492         * modules/import.c: New file for the import end of the test.
6493         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
6494         * tests/modules.at: New test cases for intermodule symbol
6495         importing.
6497 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
6499         * m4/m4module.c (m4_string): Moved from here...
6500         * m4/m4private.c (m4_string): ...to here.
6502         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
6504 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
6506         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
6507         already available to module writers through
6508         m4_{get,set}_nesting_limit_opt(), so moved from here...
6509         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
6510         (m4_create): Use it.
6512 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
6514         Aside from auditing path.c for m4module.h api obfuscation, this
6515         delta introduces the concept of private struct members in opaque
6516         data types to GNU m4: See the STYLE file for details.
6518         * TODO: Remind ourselves that a rewrite of path.c is needed.
6519         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
6520         Moved from here...
6521         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
6522         here and renamed.  These type definitions are for internal api use
6523         only.  Changed all callers.
6524         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
6525         Moved from here...
6526         * m4/path.c (search_path_env_init, search_path_add): ...to here
6527         and renamed.  These calls were never used outside this file.
6528         Changed all callers.
6529         (dirpath): Moved functionality of this static declaration...
6530         * m4/m4private.h (struct m4): ...to this new internal only
6531         search_path field.  Changed all callers.
6532         (m4__get_search_path): Added new internal api accessor.
6533         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
6534         (m4_include_init): Removed...
6535         * m4/m4.c (m4_create): ...because the new m4 field is now
6536         initialised here.
6537         (m4_delete): Recycle search_path memory.
6538         * src/main.c (main): Don't call m4_include_init now that it's
6539         gone!
6540         * doc/STYLE: Document convention for private fields in opaque
6541         ADTs.
6543 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6545         Sometimes exporting the address of a symbol from a module isn't
6546         enough for other modules to call that symbol correctly.  If
6547         custom data types are used for function parameters, they need to
6548         be known to the caller.  This change introduces the concept of
6549         $(prefix)/include/modules/$(modulename).h to declare those
6550         structures.  Also we move m4_dump_symbols from libm4 to the m4
6551         module to show this concept in action.
6553         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
6554         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
6555         exporting data structures from modules/m4.c.
6556         * modules/m4.c, modules/gnu.c: Include it.
6557         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
6558         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
6559         prototypes.
6560         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
6561         Moved from here...
6562         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
6563         ...to here, with slight renaming.
6564         (m4_export_table): Prototype and add m4_dump_symbols.
6565         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
6566         definition of m4_dump_symbols.
6567         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
6568         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
6570 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6572         Create an export table in modules/m4.c in readiness for beefing up
6573         the module loader to track module exports and imports.
6575         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
6576         * m4/debug.c (m4_debug_flush_files): Moved...
6577         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
6578         * modules/gnu.c (builtin_esysval): Use it.
6579         * m4/m4module.h (m4_export): New type for declaring module symbols
6580         for export.
6581         * modules/m4.c (m4_export_table): List symbols exported from this
6582         module for use by other modules.
6584 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6586         An experiment: There is loads of code in libm4 which should be in
6587         the m4 module, but is also used by another module. Just because
6588         some linkers won't cope with calls across dynamic runtime loaded
6589         objects I initially left the code in libm4.  It will tidy the
6590         module api immensely if this code moves to the right place, I just
6591         need to remember to invent a suitable calling mechanism at some
6592         point.  For now, only modules that are statically linked and
6593         preloaded will get this treatment, so the only platforms that will
6594         break are those that require all symbols to be resolved at link
6595         time.
6597         * TODO: Reminder that what I am doing could reduce portability
6598         unless I do something more robust later.
6599         * m4/m4module.h (m4_sysval): No longer exported from libm4.
6600         * m4/utility.c (m4_sysval): No longer declared in libm4.
6601         * modules/Makefile.am: Reformatting.
6602         * modules/m4.c (m4_sysval): Declare it at place of use.
6603         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
6605 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
6607         * m4/m4module.h: Reformatting and rearranging lines a bit.
6608         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
6609         all users.
6610         (m4_call_macro, m4_expand_input): Renamed...
6611         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
6612         callers.
6613         (m4_expansion_level, m4_process_macro): Moved...
6614         * m4/macro.c (expansion_level, process_macro): ...to here, and
6615         made static.
6617         * m4/m4module.h (program_name): Not used by modules at all, so
6618         moved...
6619         * src/main.c (program_name): ...to here.
6620         (print_program_name): Renamed...
6621         (print_program_name_CB): ...to conform to the STYLE guide.
6623 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
6625         More refactoring of the m4module.h API.  Replace #defines with an
6626         enum, and move non-public functions out of the public API.
6628         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
6629         inclusion.
6630         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
6631         * m4/debug.c (m4_debug, trace): Moved...
6632         * m4/m4private.h (struct m4): ...to fields of this struct.
6633         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
6634         for the new fields.
6635         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
6636         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
6637         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
6638         * m4/m4module.h (m4_context_field_table): Add entries for new
6639         debug_file and trace_messages fields.
6640         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
6641         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
6642         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
6643         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
6644         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
6645         (m4_is_debug_bit): New macro to simplfy checks against the debug
6646         bits above.
6647         (m4_trace_format, m4_trace_header, m4_trace_flush)
6648         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
6649         prototypes.
6650         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
6651         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
6652         * m4/macro.c (trace_format, trace_header, trace_flush)
6653         (trace_prepre, trace_pre, trace_post): ...to these newly static
6654         functions, since they are only ever used from this file.  Changed
6655         all callers.
6657 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
6659         Change the macros for checking syntax so that matching against
6660         multiple possible syntax classes can be done with a single
6661         comparison some of the time.  The various classes are now bits of
6662         an int that can be checked with bitwise logic operators.
6664         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
6665         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
6666         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
6667         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
6668         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
6669         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
6670         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
6671         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
6672         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
6673         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
6674         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
6675         Replace all calls with invocations of these...
6676         (m4_is_syntax, m4_has_syntax): ...New macros.
6677         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
6678         is no longer required with new macros.  Changed all callers.
6680 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
6682         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
6683         values are returned as part of the internal interface, so they
6684         need to be moved...
6685         * m4/private.h: ...to here.
6686         * m4/macro.c (expand_token): Check for out of range
6687         m4_peek_input() results before looking up in the syntax table.
6688         (collect_arguments): Ditto.
6690         * NEWS: Note `$' syntax class.
6692 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
6693             Gary V. Vaughan  <gary@gnu.org>
6695         Conform to POSIX if the POSIXLY_CORRECT environment is set.
6696         --traditional `define' now smashes all the definitions.
6698         * NEWS: Explain this.
6699         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
6700         (Extensions): Explain that extensions that are incompatible with
6701         POSIX are disabled if POSIXLY_CORRECT is set.
6702         (Incompatibilities): Remove.
6703         (Define, Other Incompat): Explain difference
6704         between GNU and POSIX behavior of define, pushdef, popdef.
6705         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
6706         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
6707         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
6708         (m4_get_posixly_correct_opt): New macro.
6709         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
6710         POSIXLY_CORRECT.
6711         * modules/m4.c (builtin_functions): defn now takes any number of args.
6712         (builtin_define): Smash all the definitions if
6713         POSIXLY_CORRECT.
6714         (builtin_defn)): Allow any number of arguments.
6715         (builtin_undivert): Do not allow nonnumeric arguments
6716         if POSIXLY_CORRECT.
6717         * src/main.c (main): Set posixly-correct behavior if either
6718         POSIXLY_CORRECT is set, or if -G is given.
6719         * tests/builtins.at: New test for smashed definitions.
6721 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
6723         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
6724         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
6725         not to slow the parser down.
6726         (M4__IS_STRING): New macro to test string syntax class membership.
6727         * m4/syntax.c: Adjust docucomment.
6728         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
6729         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
6730         * m4/input.c (init_builtin_token): Comment typo.
6731         (m4__next_token): Comment typo.
6732         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
6733         by using the new M4__IS_STRING macro.
6734         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
6735         variable references in macro expansions.
6737         * doc/m4.texinfo (Eregexp and Regexp): Typo.
6738         (Epatsubst and Patsubst): Typo.
6739         (Eval): Typo.
6741 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
6743         Move the global variables that pertain to syntax to a new `struct
6744         m4_syntax_table', and then add one of these to `struct m4'.  The
6745         ripple effect through the code to both change formerly global
6746         references, and make sure a suitable context is available in
6747         lexical scope is disproportionately large compared to the size of
6748         the change proper.  This change is a large part of decoupling
6749         syntax.c from the rest of the code that uses it.
6751         * m4/m4private.h (struct m4): Add a syntax field.
6752         * m4/m4.c (m4_create): Initialise it,
6753         (m4_delete): Recycle it.
6754         (m4_get_symtab): Remove hand coded version...
6755         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
6756         callers.
6757         * m4/m4module.h (m4_context_field_table): Add an extra field so we
6758         can generate m4_get_symbol_table.  Add a new row for
6759         m4_get_syntax_table.
6760         (M4SYNTAX): Syntactic sugar for module writers.
6761         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
6762         (m4_syntax_table): New home for syntax related formerly global
6763         variables.
6764         * m4/m4private.h (struct m4_syntax_table): Define it.
6765         * m4/input.c (m4_input_init): Initialisation of these formerly
6766         global variables moved...
6767         * m4/syntax.c (m4_syntax_create): ...to here.
6768         * m4/input.c (m4_input_exit): And similarly, recycling of the
6769         memory used by those values moved...
6770         * m4/syntax.c (m4_syntax_delete): ...to here.
6771         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
6772         Moved to m4/m4private.h.
6773         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6774         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6775         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6776         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
6777         objects.  Changed all callers that used to directly access the
6778         global equivalents.
6779         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
6780         Removed and incorporated into m4_syntax_table structure.
6781         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
6782         * m4/syntax.c (m4_set_syntax): Now returns an error status,
6783         instead of requiring a `struct m4' to generate its own errors.
6784         Changed all callers.
6785         * src/main.c (main): Now that the syntax table is initialised as
6786         part of m4_create, we have to manually wipe the syntax entries if
6787         we are about to read a frozen file.
6789 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
6791         * doc/STYLE: Added notes on callback naming schemes.
6793         * m4/module.c (m4_set_module_macro_table)
6794         (m4_set_module_builtin_table): Declarations weren't changed when
6795         definitions were renamed on 2003-06-19.
6797         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
6798         neither used nor particularly appropriate since it exposes the
6799         internal workings of the hash module.  I haven't yet decided
6800         whether to remove it entirely.
6802 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
6804         Two related changes, and a huge knockon effect throughout the
6805         source: Moved the option variables out of global space and into
6806         `struct m4'; made `m4_symtab' a real datatype, so that its api
6807         is not marred passing `struct m4' around just so it can decide
6808         whether to keep traced symbol names or not.  Added setters and
6809         getters for the formerly global option variables, and obviously
6810         changed a vast number of functions to take a `struct m4' and use
6811         the getter funcs to find option values.
6813         * m4/utility.c (interactive, sync_output, debug_level)
6814         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
6815         (max_debug_argument_length, warning_status, nesting_limit)
6816         (discard_comments): Removed.
6817         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
6818         (debug_level, max_debug_argument_length, prefix_all_builtins)
6819         (suppress_warnings, discard_comments, interactive, sync_output):
6820         Removed from here...
6821         * m4/m4private.h (struct m4): ...and equivalent fields added to
6822         this structure.
6823         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6824         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6825         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6826         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6827         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
6828         macros for the new fields.
6829         * m4/m4module.h (m4_context_field_table)
6830         (m4_context_opt_bit_table): Helper macros used to generate
6831         prototypes, setters and getters for new option fields
6832         consistently.
6833         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6834         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6835         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6836         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6837         (m4_get_interactive_opt, m4_get_sync_output_opt)
6838         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6839         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6840         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
6841         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
6842         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
6843         setter and getter functions generated by cpp from
6844         m4_context_field_table and m4_context_opt_bit_table, exported as
6845         part of the module api.  Changed all callers.
6846         * m4/symtab (struct m4_symtab): Used as the concrete type for
6847         m4_symtab now.
6848         (m4_symtab_create): Allocate and initialise a new struct.
6849         (m4_symtab_apply): New function that works like m4_hash_apply, but
6850         with different callbacks specific to symbol tables.  Changed all
6851         callers.
6852         (symbol_destroy, arg_destroy, arg_copy): Renamed
6853         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
6854         they have unused parameters for a reason!
6855         (dump_symbol_CB): New callback to dump the contents of a single
6856         symbol.
6857         (symtob_dump): Rewritten in terms of dump_symbol_CB.
6858         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
6859         Changed all callers.
6860         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
6861         of the contained `m4_symtab' at the `no_gnu_extensions' field.
6862         Although I'm not convinced these semantics are correct, they are
6863         at least consistent with how things were before this delta.  Also
6864         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
6866 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
6868         Tie down the interface to libm4 some more.  Make more structures
6869         opaque to modules by moving them to m4private.h, and writing
6870         setters and getters.  To win back the speed penalty for doing this
6871         also wrote macroized versions that do know about structure layout
6872         in m4private.h and #include that file into modules when NDEBUG is
6873         defined at compile time.  There are still some accessor macros in
6874         m4private.h that need to go, but that is not necessary to clean
6875         the module api up.
6877         * m4/m4module.h (m4_symbol_type): Moved...
6878         * m4/m4private.h (m4__symbol_type): ...to here.
6879         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
6880         (m4_set_symbol_traced, m4_set_symbol_name_traced)
6881         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6882         (m4_get_symbol_func, m4_symbol_value_create)
6883         (m4_symbol_value_delete, m4_set_symbol_value_text)
6884         (m4_set_symbol_value_func): New exported api to symbols.
6885         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
6886         and m4_is_symbol_value_func.
6887         * m4/m4module.h: Prototype these guys.
6888         * m4/module.c (m4_set_module_macro_table)
6889         (m4_set_module_builtin_table): Make these static, there is no
6890         reason to pollute the api with them.
6891         * m4/m4private.h: Reformatting.
6892         (m4_get_symtab): Only define when NDEBUG is defined.
6893         (m4_get_symbol_value, m4_get_symbol_traced)
6894         (m4_set_symbol_traced, m4_set_symbol_name_traced)
6895         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6896         (m4_get_symbol_func, m4_symbol_value_create)
6897         (m4_symbol_value_delete, m4_set_symbol_value_text)
6898         (m4_set_symbol_value_func): Macro implementations of the new
6899         functions when NDEBUG is defined.
6900         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
6901         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
6902         Superceded by the above.  All callers changed.
6903         (M4ARG): Removed.  This is no longer different to the
6904         m4/m4module.h definition.
6905         * modules/gnu.c, modules/m4.c: Only include m4private.h when
6906         NDEBUG is defined.  That way we exercise the same (albeit slower)
6907         api that external modules must use.
6909 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
6911         Renamed some of the types and their accessors to make more sense.
6912         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
6913         has a stack of SYMBOL_VALUEs.
6915         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
6916         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
6917         m4_get_symbol_value_type,  m4_get_symbol_value_text,
6918         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
6919         Changed all callers.
6920         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
6921         (m4_get_token_type): Renamed
6922         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
6923         to the internal api.
6924         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
6925         s/TOKEN_/VALUE_/
6926         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
6927         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
6928         (m4__token_type): Moved here from m4module.h.
6929         (m4__next_token): Renamed from m4_next_token.
6930         * m4/symtab.c: Removed some of the parameterised macro support
6931         functions for modularisation later.
6932         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
6933         m4_hash_dup to perform a true deep copy of the SRC.
6934         (arg_copy): Callback for m4_symbol_value_copy.
6935         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
6936         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
6937         m4_get_symbol_value_func.  Changed all callers.
6939 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
6941         Tidy up style of hash.[ch] in accordance with doc/STYLE.
6943         * m4/hash.c: Internal symbol renaming and formatting.
6944         (m4_hash_dup): New function to facilitate deep copies of hash
6945         tables.
6946         (m4_hash_apply_func): Returns a void* now, which is a richer type
6947         for returning exceptions (NULL means keep going).
6948         (m4_hash_apply): Ditto.
6949         * m4/hash.h: Declare exported symbols with an explicit extern.
6950         Reformated.
6952 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
6954         Still refactoring furiously.  This delta represents a change in
6955         semantics to symtab.c.  Instead of building temporary m4_tokens
6956         in the caller, and copying fields in the methods, we now create
6957         the actual m4_token for hashing in the caller so the methods just
6958         slot them in directly.  Also, this means that we don't lookup a
6959         symbol and get back an allocated but VOID token to copy fields
6960         into, we create the token we want to push and pass that to
6961         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
6962         a few other small changes to stop knowledge of the implementation
6963         of symtab.c leaking out into other files.
6965         * m4/macro.c (expand_argument): Comment typo corrected.
6966         * m4/symtab.c (symtab_fetch): New function to fetch the address of
6967         an interned symbol.
6968         (m4_symbol_pushdef): Take an extra value parameter and use this
6969         directly as the new top of the value stack.  All callers changed
6970         to build a token and pass responsibility for memory in, rather
6971         than copying as we used to.
6972         (m4_symbol_define): Also use the new value parameter directly as a
6973         replacement for the top of the value stack.  All callers changed
6974         to build a token as above.
6975         (m4_set_symbol_traced): New function to set the traced bit on the
6976         named symbol, creating it if necessary.
6977         (symbol_popval): The guts of the old m4_symbol_popdef.
6978         (m4_symbol_popdef): Use it.
6979         * m4/builtin.c (m4_symbol_set_token): Removed,
6980         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
6981         replaced...
6982         * m4/module.c (m4_set_module_builtin_table)
6983         (m4_set_module_macro_table): ...with these more orthogonal
6984         functions.
6985         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
6986         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
6987         required.
6988         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
6989         (m4_arg_signature_parse): Moved...
6990         * m4/symtab.c: ...to here.
6991         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
6992         screw something up. Moved...
6993         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
6994         actually does a proper deep copy of source to dest.
6996 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
6998         Further refactoring to stabilise the module API.  Renaming some
6999         functions for orthogonality, and judicious definition migration to
7000         move things out of the set of exported symbols.
7002         * doc/STYLE: New file.  Notes on coding style.
7003         * m4/m4module.c: Updated bitrotted docucomment at the top of the
7004         file.
7005         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
7006         m4_get_module_name, m4_get_module_builtin_table,
7007         m4_get_module_macro_table which are verb phrases.  Changed all
7008         callers.
7009         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
7010         Moved to...
7011         * m4/module.c (m4_set_module_builtin_table)
7012         (m4_set_module_macro_table): ...here, and renamed. Changed all
7013         callers.
7014         * m4/m4module.c (m4_module_data): This...
7015         * m4/m4private.c (struct m4_module_data): ...and this...
7016         * m4/module.c (module_data) ...consolidated here and no longer
7017         exported.  Changed all callers.
7019 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
7021         Begin work on lifting the curse of the global variables.  To start
7022         with create a `struct m4' context container, and replace
7023         `m4__symtab' with `context->symtab' throughout.  This means
7024         initialising a context container in main, and adjusting many
7025         functions between main and the module entry points so that the
7026         container gets passed through.  It would have been nice to
7027         defer this until after 1.5, but it has a major effect on the
7028         user's module writing ABI, so it needs to be addressed now - at
7029         least in the areas that impact the ABI.  An interrelated change
7030         in the symtab API removes the dependency on a global symbol table,
7031         and instead focuses on a passed table (from the context
7032         container).
7034         * TODO: Reminders for finishing context functionality.
7035         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
7036         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
7037         global variables and eventually allow m4 to be reentrant.
7038         * m4/m4private.h (m4): Define the new structure here...
7039         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
7040         don't carry the overhead of a function call.
7041         * m4/m4module.h: Prototype extern functions from m4/m4.c.
7042         (m4): Declare type for new struct m4 objects.
7043         (M4SYMTAB): User macro to ease finding the symbol table for the
7044         current context for module developers.
7045         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
7046         verb.
7047         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
7048         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
7049         (m4_call_macro, m4_dump_symbols, m4_expand_input)
7050         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
7051         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
7052         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
7053         m4* context parameter. Changed definitions and all callers.
7054         (m4_symtab): Alias for m4_hash to decouple the
7055         m4_symtab api from m4_hash.
7056         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
7057         m4_hash.
7058         (m4_symtab_create): New function to return an initialised
7059         m4_symtab.
7060         (m4_symtab_delete): New function to delete an m4_symtab's memory.
7061         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
7062         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
7063         instead of simply using the global m4__symtab.  Changed
7064         definitions and all callers.
7065         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
7066         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
7067         * src/main.c (main): Create a context and use that instead of the
7068         former global m4__symtab.
7070 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
7072         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
7073         to the callback.  Callbacks should not need to hardcode the
7074         hashtable they are working from, nor should we have to waste the
7075         userdata parameter to pass the table in.
7076         * m4/hash.h (m4_hash_apply_func): Require the initial table
7077         parameter.
7078         * m4/symtab.c (symtab_destroy): Use the passed table instead
7079         of hardcoding m4__symtab.
7080         (m4_symbol_popdef): Don't use the userdata parameter to pass the
7081         table to arg_destroy.
7082         (arg_destroy): Use the hash parameter, ignore userdata.
7083         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
7084         prototype.
7085         (traceon, traceoff): Call set_trace with the extra initial
7086         parameter.
7088 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
7090         More refactoring to stabilise the module api, this time for
7091         symtab.c.  Additionally, start to pay attention to function names
7092         that don't contain a verb like they should.
7094         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
7095         wrapper for m4_hash_apply to decouple the symtab module from the
7096         hash module.
7097         (m4_symbol_builtin, m4_symbol_macro): Renamed to
7098         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
7099         callers.
7100         (m4_symbol_delete): Create a macro version to save a function
7101         call.
7102         (m4_token_t, m4_data_t): These violate the POSIX reserved
7103         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
7104         all callers.
7105         (m4_token_type): Renamed to m4_token_get_type.
7106         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
7107         (m4_symtab_exit): Removed from the exported module
7108         api...
7109         * m4/m4private.h (m4__symtab, m4__symtab_init)
7110         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
7111         renamed and added to the internal api. Changed all callers.
7112         (m4_symtab_apply): A faster macro version of the function for
7113         users of the internal api.
7114         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
7115         symbol_destroy and arg_destroy.
7116         (symtab_debug): Added a prototype.
7117         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
7118         so that callers in this file get the faster macro versions from
7119         m4/m4private.h.
7121 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
7123         Refactoring modules to rationalise the API into an external
7124         documented (eventually!) API for use by modules in the `m4_'
7125         namespace declared in m4/m4module.h, an internal API between the
7126         source files we ship (including our shipped modules) in the `m4__'
7127         namespace declared in m4/m4private.h and making the rest as
7128         cohesive as possible with liberal use of the `static' keyword.
7129         This change represents an audit to m4/module.c along these
7130         guidelines.
7132         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
7133         Removed.  No longer used.
7134         (m4_module_close): Removed prototypes.
7135         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
7136         from the exported module api...
7137         * m4/m4private.h (m4__module_init, m4__module_open)
7138         (m4__module_exit): ...and renamed and added to the internal api.
7139         Changed all callers.
7140         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
7141         Centralised definitions after renaming...
7142         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
7143         (M4_FINISH_SYMBOL): ...and removing from here.
7144         (m4_module_dlerror, m4_module_remove, m4_module_close)
7145         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
7146         module_remove, module_close and caller_id.
7147         (MODULE_SELF_NAME): New macro to make reporting self errors
7148         easier.
7149         (m4_module_load, module_close, module_remove): Use it.
7150         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
7151         name.
7152         * src/main.c (main): Use it.
7154 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
7156         * README: Remove references to --enable-changeword, which has been
7157         removed from the code.
7159 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
7161         Getting rid of the annoying bug with configure --enable-debug,
7162         which spewed -e: command not found errors.  This was an interaction
7163         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
7164         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
7165         branch-1-5) to get the full fix.
7167         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
7168         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
7169         and then use the probed value of $SED.
7170         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
7171         this, it messes up the AC_REQUIRE stack.
7173 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
7175         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
7176         the destroy callback.
7177         (m4_arg_destroy): Use the hash address to free the hash node key
7178         field.
7180 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
7182         First cut at formal parameters in macros.
7184         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
7185         * m4/xstrzdup.c: New file.
7186         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
7187         associative array of parameter names to details.
7188         (m4_symbol_token): Capture macro names with parameter lists.
7189         (m4_arg_signature_parse): And build an associative array to hang
7190         from the symbol structure to map names to details.
7191         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
7192         m4_hash_resize idiom.  Now that we potentially add a little hash
7193         table to many of the entries in the symbol table, added an extra
7194         arg to set the initial size.  Changed all callers.
7195         (m4_hash_apply): New function that is basically a generalised
7196         version of...
7197         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
7198         all callers to call m4_hash_apply instead.
7199         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
7200         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
7201         m4_arg_signature association that might be attached to the symbol,
7202         * m4/hash.h (m4_hash_apply_func): Replacement type for...
7203         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
7204         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
7205         parameter lists.
7206         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
7207         (M4_IS_IDENT): Detect characters that can be safely used in
7208         parameter names.
7209         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
7210         * m4/macro.c: Corrected grammar in some comments.  Use `token'
7211         rather than `td' for m4_token variables.
7212         (m4_process_macro): If we find a dollar followed by some
7213         M4_IS_IDENT characters, replace that with the contents of the argv
7214         entry with offset stored in the m4_token_arg associated with the
7215         collected identifier.
7217 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
7219         Begin preparations for supporting formal parameters in m4 macros.
7221         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
7222         the details of a formal parameter.
7223         (m4_token): Add an arg_signature member to hold a hash table for
7224         looking up formal parameters.
7225         * m4/input.c: Update more bitrotted comments.
7226         (m4_push_builtin): Initialise arg_signature member.
7227         (init_builtin_token): Copy arg_signature member.
7228         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
7229         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7230         replace...
7231         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7232         (m4_macro_pushdef, m4_macro_define): ...these, And...
7233         (m4_symbol_token): ...wrapped around this new function, which
7234         vastly simplifies the arguments required by the functions it
7235         replaces.
7236         Changed all callers.
7238 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
7240         * m4/macro.c: Format changes.
7242 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
7244         * m4/input.c: Updated various bitrotted comments.
7245         (m4_push_builtin): Just pass the whole m4_token, rather than
7246         extracting all the fields in the caller.  This also allows us to
7247         check the token type for consistency.
7248         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7249         Renamed to builtin_funcs, builtin_peek, builtin_read,
7250         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7251         the code.  Changed all callers.
7252         (struct input_block): Similarly renamed u_m member to u_b, and
7253         changed all callers.
7254         (m4_next_token): Use bzero to initialise the data fields.
7255         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7257 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
7259         These changes were necessary to get m4 to build on my iBook
7260         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7261         (GCC) 3.1 20020420 (prerelease)":
7263         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7264         inclusion of module loader headers.
7265         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7266         * m4/Makefile.am: Ditto.
7267         (libm4_la_LIBADD): Added $(LTLIBINTL).
7268         * m4/utility.c (program_name): Removed declaration in favour of
7269         the one already in error.c!
7270         * m4/m4module.h (program_name): Define to program_invocation_name
7271         when using GNU C library. Use an explicit extern declaration.
7272         (interactive, sync_output, debug_level, hash_table_size)
7273         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7274         (suppress_warnings, warning_status, nesting_limit, discard_comments)
7275         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7276         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7277         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7278         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7279         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7280         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7281         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7282         (m4_current_line, m4_current_diversion, m4_output_current_line):
7283         Don't rely on default, use an explicit extern.
7284         * m4/error.h (error, error_at_line, error_print_progname)
7285         (error_message_count, error_one_per_line): Ditto.
7286         * m4/ltdl.c: Update from CVS libtool.
7287         * m4/ltdl.h: Ditto.
7288         * commit: Update from CVS cvs-utils.
7290 2002-11-04  gettextize  <bug-gnu-gettext@gnu.org>
7292         * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7293         * po/boldquot.sed: New file, from gettext-0.11.5.
7294         * po/en@boldquot.header: New file, from gettext-0.11.5.
7295         * po/en@quot.header: New file, from gettext-0.11.5.
7296         * po/insert-header.sin: New file, from gettext-0.11.5.
7297         * po/quot.sed: New file, from gettext-0.11.5.
7298         * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7299         * po/Rules-quot: New file, from gettext-0.11.5.
7301 2002-11-04  Akim Demaille  <akim@epita.fr>
7303         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7304         running m4 itself.
7305         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7307 2002-11-04  Akim Demaille  <akim@epita.fr>
7309         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7311 2002-11-04  Akim Demaille  <akim@epita.fr>
7313         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7314         used as `external', and Libtool 1.4.3.
7315         (LINGUAS): Remove.
7316         (LTLIBOBJS): Don't play with it.
7317         * intl/: Remove.
7318         * Makefile.am (SUBDIRS): Remove intl.
7319         (ACLOCAL_AMFLAGS): Add -I config.
7320         (EXTRA_DIST): Add config/config.rpath.
7321         * po/LINGUAS: New.
7322         * po/Makevars: New.
7323         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7325 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
7327         Preparations for refactoring syntax tables to allow reverse
7328         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7329         speed of normal lookups in an array of unsigned short.
7331         * m4/input.c (single_quotes, single_comments, use_macro_escape):
7332         Moved from here...
7333         * m4/m4private.h (m4__single_quotes, m4__single_comments,
7334         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
7335         is for internal symbols which unavoidably pollute the global
7336         namespace, but are not published APIs.
7337         Adjusted all callers.
7338         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7339         m4_set_comment, m4_set_syntax, set_syntax_internal,
7340         unset_syntax_attribute): Moved from this file...
7341         * m4/syntax.c: New. ...to this file.
7342         Also added an m4_syntax_exit stub for orthogonality.
7343         * src/main.c (main): Use it.
7344         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7345         * m4/m4module.h: Reformatting.  New prototypes.
7347 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
7349         * bootstrap (aclocal_apiversion): The aclocal apiversion is
7350         distinct from the automake release number (in that the apiversion
7351         apparently has no micro-version-component).
7352         (aclocal_apilibdir): Use it.
7354 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
7356         * m4/hash.c (m4_hash_resize): New function.
7357         * m4/hash.h: Add prototype.
7358         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
7359         benchmarking to find a good value for, say, autoconf.  This is
7360         already a little quicker than before for me.
7362         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7363         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7364         and reenamed.
7365         * m4/hash.h: Adjust prototypes.
7367 2002-01-22  Akim Demaille  <akim@epita.fr>
7369         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7370         APIVERSION scheme.
7371         * tests/Makefile.am (package.m4): New.
7372         * tests/atlocal.in: Adjust to CVS Autotest.
7373         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7374         * configure.ac: LIBOBJ is a forbidden string.
7375         Simplify AM_INIT_AUTOMAKE invocation.
7376         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7377         options.m4.
7379 2002-01-21  gettextize  <bug-gnu-utils@gnu.org>
7381         * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7383 2001-10-19  Akim Demaille  <akim@epita.fr>
7385         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7387 2001-10-19  Akim Demaille  <akim@epita.fr>
7389         * m4/input.c (m4_next_token): Display where was opened what is
7390         not closed.
7392 2001-10-19  Akim Demaille  <akim@epita.fr>
7394         * m4/macro.c (expand_argument): Display where was opened what is
7395         not closed.
7397 2001-10-18  Akim Demaille  <akim@epita.fr>
7399         * m4/input.c, modules/m4.c: Formatting changes.
7401 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
7403         * bootstrap: s/configure.in/configure.ac/
7405 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
7407         * m4/symtab.c (m4_symbol_destroy): This function calls
7408         m4_symbol_popdef, which recycles a symbols memory when the last
7409         definition is popped.  Since we were passing the address of the
7410         symbol name found in the symbol table, and it was being removed
7411         partway through m4_symbol_destroy() we were referencing freed
7412         memory for the balance of the function.  Now we take a copy of the
7413         symbol name tring and use that as a key into the symbol
7414         table... that way if the original symbol name is freed, the copy
7415         is still valid.
7417 2001-10-13  Akim Demaille  <akim@epita.fr>
7419         * m4/ltdl.c: Update.
7421 2001-10-13  Akim Demaille  <akim@epita.fr>
7423         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7424         Don't gettextize internal error messages.
7426 2001-10-13  Akim Demaille  <akim@epita.fr>
7428         * tests/macros.at (Arity and defn): New failing test.
7429         (Arity, defn, and freeze): New.
7431         Fix `Arity and defn'.
7433         * m4/input.c (m4_push_macro): Don't forget the arity.
7434         * modules/m4.c (defn): Likewise.
7436 2001-10-13  Akim Demaille  <akim@epita.fr>
7438         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7439         to...
7440         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7441         (Propagation of traceon, Propagation of --trace): this new file.
7443 2001-10-13  Akim Demaille  <akim@epita.fr>
7445         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7446         interface instead of (name, argc...).
7447         Upon failure, specify which argument was guilty.
7448         Adjust callers.
7450 2001-10-13  Akim Demaille  <akim@epita.fr>
7452         * modules/evalparse.c: Save translators' time: don't translate
7453         internal error messages.
7454         (m4_evaluate): Simplify/normalize error messages.
7455         * doc/m4.texinfo (Eval): Adjust.
7457 2001-10-13  Akim Demaille  <akim@epita.fr>
7459         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7460         where no checking is needed.
7461         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7462         interface instead of (name, argc...).
7463         Adjust callers.
7464         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7465         elsewhere.
7467 2001-10-13  Akim Demaille  <akim@epita.fr>
7469         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7470         exclude the builtin name from the count.
7471         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7472         calling ifelse with a single argument is valid.
7473         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7474         with 1 and 2 args, mostly to strengthen the test suite.
7476 2001-10-13  Akim Demaille  <akim@epita.fr>
7478         * m4/output.c (m4_make_diversion, m4_insert_file)
7479         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7481 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
7483         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
7484         since we call these things builtins in the rest of the code!
7486         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7488 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
7490         Rather than forcing each builtin definition to manage its own
7491         argument range checking, tabulate the maxima and minima for all
7492         builtins in each module.  This forces us to consider what the
7493         valid ranges for each builtin should be, and moves the checking
7494         code out of each builtin implementation and into the builtin
7495         caller infrastructure.
7497         * m4/m4module.h (struct m4_builtin): Add argument minima and
7498         maxima.
7499         * m4/m4private.h (struct m4_token): Reflect them here too.
7500         * m4/input.c (struct input_block): ...and here.
7501         (m4_token_copy): New function for token copying.
7502         (init_macro_token): Copy them from a token to the input stack.
7503         (m4_next_token): Don't forget to initialise them for text
7504         macros.
7505         * m4/macro.c (expand_argument): Use m4_token_copy, and also
7506         check argument counts before calling the builtin handler.
7507         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
7508         (m4_symbol_macro): Likewise.
7509         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
7510         parameters.  Updated all callers.
7511         (m4_builtin_define): Ditto.
7512         (m4_macro_pushdef, m4_macro_define): Ditto.
7513         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
7514         * modules/evalparse.c:  Declare argument counts for defined
7515         builtins and remove explicit calls to m4_bad_argc().
7516         * modules/gnu.c: Ditto.
7517         * modules/load.c: Ditto.
7518         * modules/m4.c: Ditto.
7519         * modules/modtest.c: Ditto.
7520         * modules/mpeval.c: Ditto.
7521         * modules/perl.c: Ditto.
7522         * modules/shadow.c: Ditto.
7523         * modules/stdlib.c: Ditto.
7524         * modules/time.c: Ditto.
7525         * TODO: Updated.
7527 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
7529         The trace semantics now attach the trace bit to a symbol name.
7530         For as long as a traceon(`foo') is active, calls to foo will be
7531         traced regardless of intervening undefines or module unloads.
7532         Fixed the flag propogation issues differently to the fixes
7533         reverted with the last attempt at nailing down trace:
7535         * m4/m4private.h:  This file is not visible outside of the m4
7536         source tree, so I removed all the `M4_' and `m4_' prefixes to save
7537         on typing.  Updated all clients.
7538         (m4_token): New typedef contains the fields that need to be passed
7539         around with the low level tokeniser.
7540         (m4_token_data):  Removed.
7541         (m4_symbol): Now contains the traced flag again.
7542         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
7543         the trace bit set.  This change is contained entirely within this
7544         module and doesn't leak out into the callers.  Updated all
7545         clients.
7546         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
7547         new fields in m4_token.  Updated all clients.
7548         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
7549         that `groks_macro_args' and `blind_if_no_args' flags are retained
7550         when defn() results are passed around in m4 code.  Updated all
7551         callers.
7552         (m4_builtin_define): Ditto.
7553         (m4_macro_pushdef, m4_macro_define): Ditto.
7554         * m4/input.c (struct input_block): Add a flags field to facilitate
7555         the above.
7556         (m4_push_macro):  ...use it.
7557         (init_macro_token):  Retrieve it.
7558         (m4_next_token): Initialise it.
7559         * m4/macro.c (expand_argument):  Copy it.
7560         * m4/m4module.h: Adjust.
7561         * tests/builtins.at:  Adjust the expected output of the trace
7562         tests to reflect the change in semantics.
7563         * tests/modules.at (modules: trace):  Check that unloading a
7564         module which supplies a traced symbol definition doesn't lose te
7565         trace bit.
7567 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
7569         * modules/gnu.c (m4_macro_table): Display the timetamp when
7570         expanding __m4_version__.
7572         * configure.ac (--with-modules): Forgot a comma in the
7573         AC_HELP_STRING parameter list.
7575 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
7577         * bootstrap: Remove aclocal.m4t when it is no longer required.
7579 2001-10-05  Akim Demaille  <akim@epita.fr>
7581         * tests/Makefile.am: Adjust for gnuprog2.
7582         * tests/m4.in: There can be a leading path.
7583         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
7584         * tests/testsuite.at: Adjust to the most recent Autotest.
7585         (AT_CHECK_M4_FILTER): Fix and rename as...
7586         (AT_TEST_M4): this.
7587         * tests/others.at: Use it.
7589         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
7590         variable in shell scripts, one uses `$'...
7592 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
7594         * configure.ac: `rm -f $m4_getopt_h' was lost.
7596 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
7598         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
7599         time.  Define it for config.h in order to...
7600         * src/main.c (main): ...display the timestamp for --version.
7602 2001-10-04  Akim Demaille  <akim@epita.fr>
7604         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
7605         previous builtins `regexp' and `patsubst'.
7606         (regexp, patsubst): Use them.
7607         (eregexp, epatsubst): New builtins.
7608         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
7609         (Epatsubst and Patsubst, Eregexp and Regexp): these.
7610         (Extensions): More info on REs.
7612 2001-10-04  Akim Demaille  <akim@epita.fr>
7614         * modules/modtest.c (init_handler): Consistently output to stderr.
7615         (finish_handler): New.
7616         (test): The `if' is an `assert'.
7617         * tests/modules.at: Adjust.
7619 2001-10-04  Akim Demaille  <akim@epita.fr>
7621         * m4/utility.c (m4_bad_argc): Detail the mismatches.
7623 2001-10-01  Akim Demaille  <akim@epita.fr>
7625         * tests/generate.awk: Tag the tests with `documentation'.
7626         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
7627         Use the make the existing modtest tests more uniform, and complete
7628         the set of possibilities.
7630 2001-10-01  Akim Demaille  <akim@epita.fr>
7632         * config/gmp.m4: Consult the user before using GMP: use
7633         --without-gmp.
7634         * configure.ac: Adjust.
7635         * modules/gmp.c: No protection needed as the module is not built
7636         if GMP is not used.
7638 2001-10-01  Akim Demaille  <akim@epita.fr>
7640         * tests/generate.awk: Remove debugging code.
7641         (fatal): Specify the current location.
7643         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
7644         * modules/gnu.c, modules/m4.c: Use M4ARG.
7646 2001-10-01  Akim Demaille  <akim@epita.fr>
7648         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
7649         (m4_regexp_compile): New.
7650         (regexp, patsubst): Use it.
7652 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7654         Reinstate the memory handling improvements from the patch I just
7655         reverted.  Relevant ChangeLog entries repeated here:
7657         * m4/module.c (m4_module_remove): New function that holds the core
7658         of the old m4_module_unload.
7659         (m4_module_unload): Use it.
7660         (m4_module_unload_all): When we know the modules will never be
7661         used again (i.e. on exit), free up as much module memory as
7662         possible.  There are still some artifacts from resident modules
7663         living inside ltdl.c, but everything else is freed.
7664         * m4/debug.c (m4_debug_exit): Free memory allocated in
7665         m4_debug_init().
7666         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7667         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7668         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7669         * m4/m4module.h: Updated prototypes.
7670         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7671         * m4/hash.h: Updated prototypes.
7672         * src/main.c (main): Use all these new functions to clean up as
7673         much memory as possible before exit.
7675 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7677         Reverted my large patch for removing the old m4_symbol
7678         structure on 2001-09-20.  We are still not happy about the way
7679         trace works in conjunction with defn and undefine, and leaving
7680         the reverted patch active prevents us from moving the traced
7681         bit from the definition back to the symbol.
7683 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7685         * configure.in: Moved to...
7686         * configure.ac: ...here.  Added a libtool like timestamped
7687         banner, and tidied up the libltdl cruft.
7688         * config/mkstamp: Script to extract a timestamp from ChangeLog.
7689         * modules/Makefile.am (INCLTDL):  Removed.  This is required
7690         only when libltdl is configured in a subdirectory.
7691         * src/Makefile.am: Ditto.
7692         (LIBADD_DL):  No need to add this again, libtool already knows
7693         that libm4.la depends on it.
7694         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
7695         them.
7697         * TODO: stackovf.c is basically broken.
7698         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
7700 2001-09-28  Akim Demaille  <akim@epita.fr>
7702         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
7704 2001-09-27  Akim Demaille  <akim@epita.fr>
7706         * tests/m4.in: Don't use short options.
7707         Simplify the stderr signature normalization.
7709 2001-09-27  Akim Demaille  <akim@epita.fr>
7711         tests/m4 shall be position independent.
7713         * tests/m4.in: New.
7714         * tests/m4: Remove.
7715         * tests/testsuite.at: No args to AT_INIT.
7716         * configure.in, tests/Makefile.am: Adjust.
7718 2001-09-22  Akim Demaille  <akim@epita.fr>
7720         Autotest has changed again.
7722         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
7723         (package.m4): Remove.
7724         * configure.in: Adjust to LIBADD_GMP.
7726 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
7728         * config/gmp.m4 (AC_ARG_WITH): Removed.
7729         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
7730         (AC_LIB_GMP): When performing a test compile against libgmp,
7731         include the header gmp.h if possible, and link against -lgmp.  If
7732         they both work define USE_GMP.
7733         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
7734         (mpeval_LTX_init_func): Complain on load that there was no libgmp
7735         at compile time.
7737 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
7739         * m4/evalparse.c: Moved to...
7740         * modules/evalparse.c:  ...here.  This code is shared between
7741         modules/mpeval.c and modules/m4.c, so there is no need to pollute
7742         the libm4 API with its details.  Moderately rewritten to interface
7743         into its clients more simply.
7744         * m4/eval.c: Deleted.  Migrated functionality to...
7745         * modules/m4.c: ...here.
7746         (builtin_eval):  Implemented in terms of the new interface style.
7747         * modules/mpeval.c (builtin_mpeval): Ditto.
7748         * m4/m4module.h: Removed references to the former m4/eval.c.
7749         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
7750         (EXTRA_libm4_la_SOURCES): Deleted.
7751         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
7752         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
7754 2001-09-20  Akim Demaille  <akim@epita.fr>
7756         * config/gmp.m4 (AM_WITH_GMP): Rename as...
7757         (AC_LIB_GMP): this.
7758         By default, use gmp.
7759         Massive revamping.
7760         * configure.in: Adjust.
7761         Use Automake conditionals for USE_GMP.
7762         Always compute sizeof (long long int).
7763         This was a bug BTW, as `eval' (not `mpeval') depends on it:
7764         before, it was used _only_ if mpeval was not activated.
7765         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
7766         (mpeval_la_LIBADD): New macros.
7767         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
7768         Indent.
7769         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
7770         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
7771         WITH_GMP.
7773 2001-09-20  Akim Demaille  <akim@epita.fr>
7775         * tests/Makefile.am (package.m4): New.
7776         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
7778 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
7780         More cleanup.  After the last patch, m4_symbol holds nothing but
7781         the head of a chain of m4_token_data.  So I have removed the old
7782         m4_symbol, so that m4_token_data chains are stored directly in the
7783         value cell of a hash table node.  But there's more... m4_symbol
7784         was a more natural name for the symbol value cell, and now that it
7785         is gone I have renamed the former m4_token_data structure to
7786         m4_symbol.  This change turned out to be a pig to get right, since
7787         the original code didn't need to modify the value cell itself,
7788         since changing the chain happened inside the m4_symbol that used
7789         to be returned -- I had to pass the address of the value cell
7790         across various function calls, incase the head value changed.  I
7791         also tightened up the memory management to help me find a nasty
7792         memory corruption bug that took me all night to track down...
7794         * m4/m4private.h (struct m4_symbol): Removed.
7795         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
7796         all references.
7797         * m4/hash.c (m4_hash_iterator_value): Return the address of the
7798         value cell.  Updated all callers.
7799         * m4/symtab.c: Took advantage of the simplification in the data
7800         structures to rewrite a lot of this file more simply.  There is
7801         still some room for optimisation here, but we should tackle that
7802         systematically closer to the release.
7804         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7805         revealed.  This version is ahead of CVS libtool until I get chance
7806         to flush my changes.
7807         * m4/module.c (m4_module_remove): New function that holds the core
7808         of the old m4_module_unload.
7809         (m4_module_unload): Use it.
7810         (m4_module_unload_all): When we know the modules will never be
7811         used again (i.e. on exit), free up as much module memory as
7812         possible.  There are still some artifacts from resident modules
7813         living inside ltdl.c, but everything else is freed.
7814         * m4/debug.c (m4_debug_exit): Free memory allocated in
7815         m4_debug_init().
7816         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7817         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7818         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7819         * m4/m4module.h: Updated prototypes.
7820         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7821         * m4/hash.h: Updated prototypes.
7822         * src/main.c (main): Use all these new functions to clean up as
7823         much memory as possible before exit.
7825 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
7827         The `traced' flag needs to be attached to the definition of a
7828         symbol rather than the current symbol containing the definition.
7829         Implementing this showed up some long standing post 1.4 bugs in
7830         flag propogation which I also fixed.
7832         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
7833         (struct m4_token_data): And add it back in here.
7834         * m4/input.c (init_macro_token): Propogate the traced flag
7835         correctly.
7836         * m4/macro.c (expand_argument): Ditto.
7837         * tests/builtins.at (trace2, trace3): New tests based on Akim's
7838         sadistic email ;-)
7840 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7842         * m4/m4private.h (struct m4_token_data): Simplified by removing
7843         the redundant `traced' flag, and one level of structure nesting.
7844         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
7845         * m4/input.c (init_macro_token): No need to initialise removed
7846         `traced' field.
7847         * m4/macro.c (expand_argument): No need to copy it either.
7848         * m4/utility.c (m4_token_data_func_traced): Or provide an access
7849         function.
7851         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
7852         dependant on multiple symbols with the same key, so preserving
7853         relative symbol order in each bucket during resizing is no longer
7854         required.  The resize function is considerably faster as a result.
7856         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
7857         s/m4_symbol_insert/m4_symbol_define/g;
7858         s/m4_builtin_insert/m4_builtin_define/g;
7859         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
7861 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7863         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
7864         commits, the m4_lookup_symbol dispatch function is split into
7865         specialised functions that must be called directly.
7867         * m4/m4module.h (m4_symbol_lookup_t): Removed.
7868         * m4/symtab.c (m4_lookup_symbol): Removed.
7869         (m4_symbol_builtin, m4_symbol_macro): New functions.
7870         * m4/builtin.c (m4_builtin_define): Split into...
7871         (m4_builtin_pushdef, m4_builtin_insert): ...these.
7872         (m4_macro_define): Split into...
7873         (m4_macro_pushdef, m4_macro_insert): ...these.
7874         * src/main.c (main): Set command line macros from `-D' parameters
7875         using `m4_macro_define'.
7877 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7879         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
7880         this from m4_remove_table_reference_symbols().
7881         * m4/m4module.h, m4/module.c: Updated all references.
7883 2001-09-07  Akim Demaille  <akim@epita.fr>
7885         * modules/stdlib.c, modules/times.c: Misc cleanups.
7887 2001-09-07  Akim Demaille  <akim@epita.fr>
7889         * configure.in: We now need Autoconf 2.52e.
7890         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
7891         and `M4_SYMBOL_DELETE'.
7892         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
7893         * src/main.c (main): Adjust.
7895 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
7897         Fix the obstack.h problem once and for all!  At configure time we
7898         can test for a system supplied obstack.h:  depending on the
7899         result, we now generate system.h with an #include of the correct
7900         header.  As a bonus, I've also added a --with-included-obstack,
7901         incase the user doesn't like the system obstack for some
7902         reason... and also we can test the shipped obstack on a system
7903         that has oe of its own.  We also now need to be careful to add
7904         build directories to the include search path, since the generated
7905         system.h will be in the build tree.
7907         * configure.in (AC_CONFIG_FILES): Generate system.h from
7908         system-h.in.
7909         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
7910         include the system obstack header or the copy shipped with M4.
7911         Allow the user to override configure and force the build to use
7912         the shipped version.
7913         * m4/system-h.in: New file, template for...
7914         * m4/system.h: ...this.  Now deleted.
7915         * m4/m4module.h: Include system.h before everything else.
7916         * src/freeze.c: Ditto.
7917         * m4/Makefile.am (dist-hook): Remove generated system.h.
7918         (INCLUDES): Check builddir for generated headers before checking
7919         srcdir.
7920         * modules/Makefile.am (INCLUDES): Ditto.
7921         * src/Makefile.am (INCLUDES): Ditto.
7923 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
7925         * TODO: Remove the items that have been addressed already.
7927 2001-09-05  Akim Demaille  <akim@epita.fr>
7929         * src/main.c (main): Standardize --version.
7931 2001-09-05  Akim Demaille  <akim@epita.fr>
7933         * modules/format.c (format): Have a bigger `str'.
7935 2001-09-05  Akim Demaille  <akim@epita.fr>
7937         Rationalize warnings, reporting the macro name as if it were a
7938         program name, and assertions.
7940         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
7941         (M4WARN): New.
7942         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
7943         (m4_symbol_delete):
7944         Use assert for internal errors.
7945         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
7946         M4WARN.
7947         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
7948         M4WARN and assert.
7949         * tests/builtins.at (pushpop): Adjust.
7951 2001-09-05  Akim Demaille  <akim@epita.fr>
7953         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
7954         with pointers.
7956 2001-09-05  Akim Demaille  <akim@epita.fr>
7958         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
7959         * m4/macro.c, m4/symtab.c: Adjust.
7961 2001-09-05  Akim Demaille  <akim@epita.fr>
7963         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
7964         (m4_symbol_pop, m4_symbol_del): this.
7965         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
7966         (m4_symbol_popdef, m4_symbol_delete): New.
7967         (m4_lookup_symbol): Adjust.
7968         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
7970 2001-09-05  Akim Demaille  <akim@epita.fr>
7972         * m4/m4module.h (m4_symbol_lookup): Rename as...
7973         (m4_symbol_lookup_t): this.
7975 2001-09-05  Akim Demaille  <akim@epita.fr>
7977         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
7978         unused.
7979         * m4/symtab.c (m4_lookup_symbol): Adjust.
7981 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
7983         Bootstrap will now work with Libtool 1.4.1 or higher:
7984         * bootstrap: Remove stale autom4te.cache files when
7985         rebootstrapping.
7986         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
7987         libtool.m4.
7988         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
7989         libtool.m4 directly.
7990         Run libtoolize to refresh ltmain.sh.
7991         * config/ltmain.sh:  Deleted.
7992         * acinclude.m4: Deleted.
7993         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
7995         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
7996         implementation for the cvs impaired libtool user.
7998 2001-09-03  Akim Demaille  <akim@epita.fr>
8000         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
8001         internal errors.
8002         Avoid using `default' in switch, as it hides useful compiler
8003         warnings when a case is forgotten.
8005 2001-09-03  Akim Demaille  <akim@epita.fr>
8007         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
8008         is no such thing as `WITH_MODULES'.
8010 2001-09-03  Akim Demaille  <akim@epita.fr>
8012         Improve the test suite's selfcontainedness.
8014         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
8015         (Include, Undivert): Tag the other input files.
8016         * tests/generate.awk: Catch `@comment file:'.
8017         `-I $src' is no longer needed.
8018         `next' is really like `return': the rest is skipped.
8019         Adjust to `input.m4'.
8020         (fatal): New function.
8021         * tests/foo, tests/incl.m4: Remove.
8023 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
8025         The shadowing mechanism and, infact, the whole symbol table
8026         implementation was creaking under the weight of the features piled
8027         on top of it.  We now have a separate hash table module which will
8028         dynamically resize to keep symbol density withing good performace
8029         limits, and a new symtab module layered above it.  Symbol lookups
8030         are now marginally more efficient (since the shadowed flag is no
8031         longer required) and symbol removal, such as on module unload, is
8032         considerably faster due to a reorganisation of the data structures
8033         used in symtab.c.
8035         * src/main.c (main):  Don't mention `-H'.
8036         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
8037         effect.
8038         * NEWS: Updated.
8039         * m4/hash.c: New generalised dynamic hash table data structure
8040         management module.
8041         * m4/hash.h: Public interface.
8042         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
8043         (libm4_la_SOURCES): Add hash.c.
8044         * m4/symtab.c: More or less rewritten from scratch, within the
8045         bounds of the previous API.
8046         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
8047         call.  Updated all callers.
8048         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
8049         declarations to reflect API changes.
8050         (M4INIT): Generate a declaration too, to avoid the warning with
8051         --enable-debug builds.
8052         (M4FINISH): Ditto.
8053         (HASHMAX): Removed.
8054         * m4/utility.c (hash_table_size):  Removed.
8055         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
8056         names, which are then looked up by builtin_dumpdef() as necessary.
8057         This implies a small speedup in builtin_symbols(), which discarded
8058         all of the symbol info under the old call.
8059         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
8060         shadowing is implicit in respect to the new data structures.
8061         symbol names are no longer duplicated here, they are stored in the
8062         key field of the hash table.
8063         Moved macro_args and blind_no_args...
8064         (m4_token_data): ...to here.
8065         m4/macro.c (expand_macro):  Added a name argument since the symbol
8066         name is no longer copied into each struct m4_symbol.  Modified all
8067         callers.
8068         (collect_arguments):  Ditto.
8069         * modules/m4.c (set_trace): Ditto.
8070         * modules/gnu.c (builtin_symbols): Updated.
8071         * src/freeze.c (produce_symbol_dump): Much improved in light of
8072         the improved symbol table layout.
8074 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
8076         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
8077         to M4_SYMBOL_NEXT.
8078         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
8079         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
8080         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
8081         SYMBOL_HANDLE): Ditto.
8082         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
8083         modules/gnu.c, modules/m4.c, src/freeze.c,
8084         src/main.c:  Updated all references.
8086         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
8087         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
8088         already listed in m4_LDADD... how did that ever used to work?
8089         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
8090         link.
8091         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
8092         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
8094         * tests/m4: Don't call the m4 wrapper script with libtool, it
8095         works fine all by itself.
8097 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
8099         The experimental `changeword' feature never took off, and has
8100         no obvious advantages over `changesyntax' to compensate the
8101         enormous speed penalty it carries:
8102         * configure.in (ENABLE_CHANGEWORD): Removed.
8103         * m4/m4module.h (m4_set_word_regexp): Removed.
8104         * m4/m4private.h (m4_token_data): Removed original_text field.
8105         * m4/utility.c (m4_token_data_orig_text): Removed.
8106         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
8107         * m4/macro.c: Ditto.
8108         * src/main.c: Ditto.
8109         * modules/Makefile.am (changeword.la): Removed.
8110         * modules/changeword.c: File removed.
8111         * doc/m4.texinfo: References to changeword and --word-regexp
8112         removed.
8113         * po/POTFILES.in: modules/changeword.c removed.
8114         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
8115         * tests/builtins.at (changeword): Test removed.
8117 2001-08-30  Akim Demaille  <akim@epita.fr>
8119         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
8120         This also help having a single list of m4 files: in
8121         config/Makefile.am.
8122         * config/Makefile.am (STANDARD_MACROS): Rename as...
8123         (ACLOCAL_MACROS): this.
8124         (list-standard-macros): Remove.
8125         (spy): New.
8127 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
8129         In an attempt to moderate my egomania...
8130         * tests/modules.at: Remove attributions.
8132         * tests/generate.awk: When making substitutions to "@&t@", either
8133         "&" or "\&" in the substitution string argument to gsub refer back
8134         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
8135         67 now pass for me.
8137 2001-08-29  Akim Demaille  <akim@epita.fr>
8139         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
8140         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
8141         (sync-lines, trace, translit, undivert, wrap): Move to...
8142         * tests/builtins.at: this new file.
8143         * tests/others.at (Discard comments, import-environment): Move to...
8144         * tests/options.at: this new file.
8146 2001-08-29  Akim Demaille  <akim@epita.fr>
8148         * tests/others.at (Freezing modules)
8149         (--module-directory: absolute path, modpath2, modpath3)
8150         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
8151         * tests/modules.at: here, new file.
8152         * tests/others.at, tests/generate.awk: Add a banner.
8153         * tests/testsuite.at: Adjust.
8154         (AT_CHECK_M4_FILTER): New, but unused.
8156 2001-08-29  Akim Demaille  <akim@epita.fr>
8158         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
8159         handle that.
8160         * tests/others.at (wrap): Inline wrap.m4.
8161         (shadow): Inline shadow.m4.
8162         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
8163         * tests/m4: Simplify.
8165 2001-08-29  Akim Demaille  <akim@epita.fr>
8167         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
8168         --language.
8170 2001-08-29  Akim Demaille  <akim@epita.fr>
8172         * tests/generate.awk (normalize): s/@__@/@&t@/.
8174 2001-08-28  Akim Demaille  <akim@epita.fr>
8176         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
8178 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
8180         * bootstrap (generate.awk): Generate test cases with new script.
8182 2001-08-27  Akim Demaille  <akim@epita.fr>
8184         * tests/Makefile.am (installcheck-local): Don't use
8185         `dc_install_base' which is not visible here, but `exec_prefix'
8186         which is clearly the RT anyway.
8187         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
8188         related to testing a now installed m4.
8189         * tests/m4: Do it here.
8191 2001-08-27  Akim Demaille  <akim@epita.fr>
8193         * tests/others.at (indir): Formatting change.
8195 2001-08-27  Akim Demaille  <akim@epita.fr>
8197         * tests/Makefile.am (installcheck-local): New.
8198         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
8199         the test suite.
8200         Prefer options over envvars.
8201         * src/main.c (main): First bug caught by the test suite (yeah!):
8202         --batch lacked a `break' which resulted in an accidental
8203         invocation of --discard-comments.
8205 2001-08-27  Akim Demaille  <akim@epita.fr>
8207         * tests/others.at (capitalize, changeword, comments, ddivert)
8208         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
8209         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
8210         (sysv-args, trace, translit, undivert): Don't rely on files in
8211         examples/: AT_DATA them.
8213 2001-08-27  Akim Demaille  <akim@epita.fr>
8215         Let the test suite use a wrapper around the not installed m4 to
8216         pretend it is (installed).
8218         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
8219         such a way that m4 does not process them.
8220         * configure.in: The package name seems to be `m4', not `M4'.
8221         * tests/m4: New.
8222         * tests/atlocal.in (at_package, M4): Remove.
8223         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
8225 2001-08-27  Akim Demaille  <akim@epita.fr>
8227         * tests/Makefile.am (CLEANFILES): Remove.
8228         (DISTCLEANFILES, clean-local): New.
8229         * examples/mktests.sh: Remove.
8231 2001-08-27  Akim Demaille  <akim@epita.fr>
8233         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8234         Don't use aclocal: it's written by hand.
8235         * aclocal.m4: m4_include all the files instead of being built by
8236         aclocal.
8237         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8238         until it reads the traces by itself.
8239         * configure.in: Require Autoconf 2.42c as we are now using
8240         AC_CONFIG_TESTDIR instead of AT_CONFIG.
8241         Catch unexpanded `jm_' macros.
8242         * config/atconfig.m4: Remove.
8243         * config/error.m4: new.
8244         * config/Makefile.am: Ship the files included by aclocal.m4.
8245         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8246         (TESTSUITE_AT): this, to please Automake.
8247         (TESTSUITE): This target uses autotest/autotest.m4, not
8248         autotest/general.m4.
8249         * tests/testsuite.at: Prereq Autotest 2.52c.
8250         * examples/Makefile.am (pkgdata_DATA): Rename as...
8251         (dist_pkgdata_DATA): this.
8252         * doc/Makefile.am (man_MANS): Rename as...
8253         (dist_man_mans): this.
8255 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
8257         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
8258         Robert Collins, building on Cygwin no longer requires Windows
8259         import and export symbol decorations.
8260         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
8261         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8262         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8263         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8264         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8265         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8266         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8267         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8268         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8269         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
8270         anymore.
8271         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8272         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8274 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
8276         Ansify the source.  Previously we had a mix, where my code was
8277         in a K&R compatible style, and the preexisting code was in ANSI
8278         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
8279         and now the code base is much cleaner.
8281         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
8282         VOID macro and all users.
8283         * m4/m4module.h:  Ansify function prototypes and headers.
8284         * m4/builtin.c:  Ditto.
8285         * m4/evalparse.c:  Ditto.
8286         * m4/input.c:  Ditto.
8287         * m4/macro.c:  Ditto.
8288         * m4/module.c:  Ditto.
8289         * m4/output.c:  Ditto.
8290         * m4/path.c:  Ditto.
8291         * m4/symtab.c:  Ditto.
8292         * m4/utility.c:  Ditto.
8293         * modules/format.c:  Ditto.
8294         * modules/gnu.c:  Ditto.
8295         * modules/m4.c:  Ditto.
8296         * modules/mpeval.c:  Ditto.
8297         * src/freeze.c:  Ditto.
8298         * src/m4.h:  Ditto.
8299         * src/main.c:  Ditto.
8301 2001-08-20  Akim Demaille  <akim@epita.fr>
8303         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8304         generated with stock 2.52.
8306 2001-08-20  Akim Demaille  <akim@epita.fr>
8308         * config/atconfig.m4: New, until part of Autoconf per se.
8309         * configure.in (AT_CONFIG): Use it.
8310         Adjust.
8311         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8312         * tests/atlocal.in: New.
8313         * tests/generate.awk: For the time being, the empty quadrigraph is
8314         `@__@'.
8315         * tests/others.at (changeword, gmp): Check the configuration
8316         variable against `yes'.
8317         * tests/testsuite.at (dnl): Allow it, as it's used all over the
8318         place.
8320 2001-08-20  Akim Demaille  <akim@epita.fr>
8322         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8323         * modules/m4.c (undivert): Disable the possibility of undiverting
8324         several files at once: it is not documented, it is inconsistent
8325         with the other macros, it can be straightforwardly mocked by
8326         several invocations, and most importantly, it prevents the
8327         possibility of other kinds of extension.
8328         Use `m4_numeric_arg'.
8330 2001-08-20  Akim Demaille  <akim@epita.fr>
8332         * examples/include.m4: Typo.
8333         * tests/generate.awk: Really add it.
8334         * tests/Makefile.am: Adjust.
8335         * tests/others.at (Discard comments): It sure fails without `-c'.
8336         (include, undivert): Add -I examples/.
8338 2001-08-20  Akim Demaille  <akim@epita.fr>
8340         Use sprintf, not ecft and friends since it is standard, portable,
8341         simplifies the code, and since the latter is even deprecated
8342         according to the GNU libc documentation.
8344         * modules/format.c: Drop evct support.
8346 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
8348         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
8349         for `-pipe' here...
8350         * configure.in: ...do it here instead.
8352         * c-boxes.el: Deleted.
8353         * m4/builtin.c: Reformat box comments to be closer to GNU
8354         standards.
8355         * m4/debug.c:  Ditto.
8356         * m4/eval.c:  Ditto.
8357         * m4/evalparse.c:  Ditto.
8358         * m4/input.c:  Ditto.
8359         * m4/m4module.h:  Ditto.
8360         * m4/macro.c:  Ditto.
8361         * m4/output.c:  Ditto.
8362         * m4/symtab.c:  Ditto.
8363         * m4/utility.c:  Ditto.
8364         * modules/changeword.c:  Ditto.
8365         * modules/format.c:  Ditto.
8366         * modules/gnu.c:  Ditto.
8367         * modules/load.c:  Ditto.
8368         * modules/m4.c:  Ditto.
8369         * modules/modtest.c:  Ditto.
8370         * modules/mpeval.c:  Ditto.
8371         * modules/perl.c:  Ditto.
8372         * modules/shadow.c:  Ditto.
8373         * modules/stdlib.c:  Ditto.
8374         * modules/time.c:  Ditto.
8375         * src/freeze.c:  Ditto.
8376         * src/main.c:  Ditto.
8378 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
8380         * m4/module.c: Fixup some errors in the description comment.
8382 2001-08-17  Akim Demaille  <akim@epita.fr>
8384         * tests/others.at (iso8859): Specify the path to the M4 test file.
8385         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8386         files in error messages.
8388 2001-08-17  Akim Demaille  <akim@epita.fr>
8390         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8391         * tests/others.at: Adjust input files paths.
8392         * tests/atconfig.in: Set top_builddir.
8393         * tests/Makefile.am: Adjust.
8394         `testsuite' is in src, not build.
8396 2001-08-17  Akim Demaille  <akim@epita.fr>
8398         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8399         (generate.at): Install a temporary hack until the actual
8400         generate.awk is added to the repository.
8401         * tests/atconfig.in: New.
8403 2001-08-17  Akim Demaille  <akim@epita.fr>
8405         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8407 2001-08-17  Akim Demaille  <akim@epita.fr>
8409         * doc/m4.texinfo: Promote proper quotation.
8411 2001-08-17  Akim Demaille  <akim@epita.fr>
8413         Remove the non Autotest tests.
8415         * tests/other-tests/capitalize.test,
8416         * tests/other-tests/changeword.test,
8417         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8418         * tests/other-tests/debug.test,
8419         * tests/other-tests/discard-comments.m4,
8420         * tests/other-tests/discard-comments.test,
8421         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8422         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8423         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8424         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8425         * tests/other-tests/hanoi.test,
8426         * tests/other-tests/import-environment.m4,
8427         * tests/other-tests/import-environment.test,
8428         * tests/other-tests/include.test, tests/other-tests/indir.test,
8429         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8430         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8431         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8432         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8433         * tests/other-tests/modtest.test,
8434         * tests/other-tests/multiquotes.test,
8435         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8436         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8437         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8438         * tests/other-tests/sync-lines.m4,
8439         * tests/other-tests/sync-lines.test,
8440         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8441         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8442         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8443         * tests/other-tests/wrap.test: Remove.
8445         * tests/run-test, tests/get-them: Remove.
8446         * tests/Makefile.am: Adjust.
8448 2001-08-17  Akim Demaille  <akim@epita.fr>
8450         others.at no longer depends on other-tests/.
8452         * tests/others.at (stackovf): You're actually...
8453         (sync-lines): this.
8454         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8455         (unload.test): Keep their authorship.
8456         (discard-comments, gmp, import-environment, modfreeze)
8457         (sync-lines): Embed the input files.
8458         * tests/stackovf.test: Copy from other-tests/stackovf.test.
8459         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8461 2001-08-17  Akim Demaille  <akim@epita.fr>
8463         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8464         (M4exit): Tag the exit status of the example.
8465         * tests/get-them: Adjust.
8466         * tests/generate.awk: New, based on get-them.
8467         * tests/Makefile.am: Adjust to generate `generated.at'.
8468         * tests/testsuite.at: Adjust.
8469         (AT_CHECK_M4): Don't overquote.  Blush...
8471 2001-08-17  Akim Demaille  <akim@epita.fr>
8473         Start using Autotest.  atconfig creation is still lacking.
8475         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8476         * examples/reverse.m4, tests/other-tests/import-environment.m4,
8477         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8478         * tests/other-tests/import-environment.test: Don't check LANGUAGE
8479         as it might be `unset', or set to `C'.
8480         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
8481         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8482         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8483         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
8484         * tests/other-tests/shadow.test: Adjust.
8485         * tests/testsuite.at, tests/others.at: New.
8486         * tests/Makefile.am: Adjust.
8488 2001-08-17  Akim Demaille  <akim@epita.fr>
8490         Drop Autoconf 2.13 compatibility.
8492         * configure.in (changeword): No need to undefine it, as anyway if
8493         it's defined, M4sugar moved it as m4_changeword.
8494         And anyway, proper quotation is enough.
8495         (m4_pattern_allow): As it exists in 2.50, just use it.
8496         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
8497         Don't handle Gettext's duties, let it handle them.
8498         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
8500 2001-08-17  Akim Demaille  <akim@epita.fr>
8502         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
8503         (m4_errprint): Use fputs.
8504         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
8505         dumpdef are not concerned.
8506         (Dumpdef, Errprint): Emphasize their insensitivity to
8507         --error-output.
8508         * doc/Makefile.am: Add `TAGS' support.
8509         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
8510         in `config/' now.
8511         * config/Makefile.am (MAINTAINERCLEANFILES): New.
8513 2001-08-17  Akim Demaille  <akim@epita.fr>
8515         * modules/Makefile.am (ETAGS_ARGS): New.
8517 2001-08-17  Akim Demaille  <akim@epita.fr>
8519         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
8520         changes.
8522 2001-08-17  Akim Demaille  <akim@epita.fr>
8524         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
8526 2001-08-17  Akim Demaille  <akim@epita.fr>
8528         * m4/m4module.h (m4/list.h): Don't include it.
8530 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
8532         m4_modules are no more, we use lt_dlhandles directly and let
8533         latest libltdl features manage the list of loaded modules.
8534         * acinclude.m4: Regenerated.
8535         * m4/ltdl.c: Updated from master copy.
8536         * m4/module.c: Reimplemented to take advantage of advances in
8537         libltdl.
8538         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
8539         list with lt_dlhandle_next.
8540         (m4_builtin_find_by_func): Ditto.
8541         (m4_builtin_table_install): Use lt_dlhandle.
8542         (m4_macro_define): Ditto.
8543         (m4_macro_table_install): Ditto.
8544         m4/module.h: Prototype new module management API.
8545         (m4_modules): No longer required.
8546         (m4_module_init_t, m4_module_finish_t): POSIX namespace
8547         violations, renamed to...
8548         (m4_module_init_func, m4_module_finish_func): ...these,
8549         respectively.
8550         (M4INIT_HANDLER): Clean way to declare init functions in modules.
8551         (M4FINISH_HANDLER):  And similarly for finish functions.
8552         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
8553         -- Add indirection to the CONC macro so that arguments are
8554         correctly expanded.
8555         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
8556         * modules/shadow.c (m4_init_module):  Ditto.
8557         Due to new init function semantics, be careful to perform the
8558         initialisation only on first load.
8559         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
8560         (m4_finish_module): Replaced with M4FINISH_HANDLER.
8561         Due to new finish function semantics, be careful to perform the
8562         finalisation only on first load.
8563         * m4/m4private.h (m4_module): Removed in favour of...
8564         (m4_module_data): ...structure without all the wrapper fields.
8565         Instances of this new structure are stored associated lt_dlhandles
8566         with lt_dlcaller_data_set().
8567         * m4/builtin.c (m4_builtin_define): Takes a handle argument
8568         instead of the old module argument.
8569         (m4_builtin_table_install): Ditto.
8570         * modules/load.c (m4_resident_module):  Removed.  This is no
8571         longer implemented as a magic symbol...
8572         * modules/m4.c (m4_resident_module): Ditto.
8573         * modules/load.c (M4INIT_HANDLER): ...the module init function now
8574         uses the ltdl api to make the module resident.
8575         * modules/m4.c (M4INIT_HANDLER): Ditto.
8576         * modules/load.c (builtin_modules): Traverse the loaded module
8577         list with lt_dlhandle_next.
8578         (builtin_load): Much simplified in light of the reimplemented
8579         module loader.
8580         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
8581         light of the m4/module.c rewrite.
8582         (produce_symbol_dump): Ditto.
8583         (reload_frozen_state): Ditto.
8584         * m4/list.c, m4/list.h: Files deleted.  No longer required.
8585         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
8586         (libm4_la_SOURCES): Delete list.c reference.
8587         * m4/m4private.h (m4_token_data):  Add a handle field.  This
8588         eliminates many of the searches to find the handle associated with
8589         various tokens that are passed between functions.
8590         (struct m4_symbol):  Removed the module field.  The
8591         module association does not belong with the symbol...
8592         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
8593         that the module implementation code is from.  Added a handle
8594         field.
8595         (m4_push_macro): Add a `handle' argument.  Changed all callers.
8596         (init_macro_token):  Set the `handle' field for the
8597         m4_token_data.
8598         * m4/macro.c (expand_argument): Copy the new handle field during
8599         reassignment.
8600         * modules/m4.c (macro_install): Use the new handle field to
8601         optimise the search for the correct builtin structure, and pass
8602         the handle details to m4_builtin_define.
8604 2001-08-15  Akim Demaille  <akim@epita.fr>
8606         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
8607         when creating `m4/obstack.h'.
8608         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
8609         top_builddir.
8610         * tests/defs: Make them absolute.
8611         (CDPATH) Neutralize.
8612         * tests/gethem: Use them.
8614 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
8616         * config/ltmain.sh: Doh!  Import again for a quoting fix that
8617         prevented any regression test from passing.
8619         * m4/m4module.h (obstack.h): Choose between installed version
8620         and shipped version based on configure tests.
8621         * src/freeze.c (obstack.h): Ditto.
8623         * acconfig.h: Removed.  No longer required.
8625         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
8626         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
8627         them to AC_INIT and AM_INIT_AUTOMAKE.
8628         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
8629         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
8630         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
8631         shell variable m4_cv_func_obstack_h.
8632         * tests/defs (M4): Be more careful about relative path to libtool
8633         script and m4 binary by using $srcdir.
8635         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
8636         optargs to the existing libltdl search path.
8637         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
8638         * m4/ltdl.c: Updated.
8639         * m4/ltdl.h: Ditto.
8640         * config/ltmain.sh: Ditto.
8642 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
8644         * src/main.c (main): Add `-b' (for `batch') mode switch to force
8645         interactive mode off.
8647 2001-08-10  Akim Demaille  <akim@epita.fr>
8649         * configure.in: Require Autoconf 2.52.
8650         (AC_ARG_PROGRAM): Remove, handled by Automake.
8651         (m4_getopt): Rename as...
8652         (m4_getopt_h): this.
8653         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
8654         Undefine `changeword' only if defined.
8655         * config/gnu-obstack.m4: Require Autoconf 2.52.
8656         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
8657         Allow this token.
8659 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
8661         * doc/m4.texinfo: Fix some typos, and apply some small
8662         clarifications.
8664 2001-08-09  Andreas Schwab  <schwab@suse.de>
8666         * src/main.c (main): Fix improper uses of error (missing format
8667         string).
8669 2001-08-07  Akim Demaille  <akim@epita.fr>
8671         Improve `make distcheck'.
8673         * configure.in: Be sure to be able to run `mkconfig.sh' when src
8674         != build.
8675         * Makefile.am (dist-hook): Remove, as it is no longer needed.
8676         * doc/m4.texinfo (Include): Add missing blank.
8677         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
8678         obstack.c.
8680 2001-08-07  Akim Demaille  <akim@epita.fr>
8682         * m4/evalparse.c: A better introductory comment.
8683         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
8684         * m4/macro.c: Adjust old comments.
8685         * modules/README: Typo.
8687 2001-08-07  Akim Demaille  <akim@epita.fr>
8689         * config/gnu-obstack.m4: New.
8691 2001-08-07  Akim Demaille  <akim@epita.fr>
8693         * config/Makefile.am, config/stackovf.m4: New.
8694         * configure.in, Makefile.am: Adjust.
8696 2001-08-05  gettextize  <bug-gnu-utils@gnu.org>
8698         * po/Makefile.in.in: Upgrade to gettext-0.10.39.
8699         * po/cat-id-tbl.c: Remove file.
8700         * po/stamp-cat-id: Remove file.
8702 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
8704         * modules/format.c (format):  Formatting for %f was not
8705         interpreting the position of the decimal point correctly for
8706         whole numbers.
8708 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
8710         * TODO:  Removed m4exit bug.
8711         * modules/load.c (m4_resident_module): Make this module resident.
8712         * module/m4.c (m4_resident_module): Ditto.
8713         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
8714         feature to mark modules as resident if they export
8715         `m4_resident_module' as TRUE.
8716         (m4_module_unload): Do not remove resident modules, and take care
8717         with symbol insertion and deletion with resident modules.
8718         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
8719         use resident modules feature.
8721 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
8723         * TODO: Updated.  Removed some cruft that has since been fixed
8724         or implemented.  Added some more entries.
8725         * NEWS: Updated.
8726         * README: Updated.
8727         * modules/README: Updated.
8728         * doc/m4.texinfo: Updated.
8730         * modules/gnu.c (builtin_functions): Make indir orthogonal to
8731         builtin, in that each is recognised as a macro only with parameters
8732         (builtin_indir): Passing 0 arguments is now an error, as with
8733         builtin.
8735         * src/main.c (usage): Added missing description of `-c' option.
8737 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
8739         Consolidate the myriad of dispersed test scripts into the
8740         tests subdirectory.  I think I now have all the file where I
8741         want them, so there shouldn't be anymore upheaval =)O|
8742         Honest!
8743         * tests/Makefile.am: Updated to run the new tests added below.
8744         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
8745         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
8746         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8747         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8748         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8749         tests/other-tests/hanoi.test, tests/other-tests/include.test,
8750         tests/other-tests/indir.test, tests/other-tests/misc.test,
8751         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
8752         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8753         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8754         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
8755         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
8756         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
8757         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8758         tests/other-tests/translit.test, tests/other-tests/undivert.test,
8759         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8760         tests/other-tests/wrap.test:  New tests based on the contents
8761         of the tests removed below.
8762         * examples/Makefile.am, modules/Makefile.am:  Updated to
8763         reflect removed tests.
8764         * examples/defs,modules/defs: Removed.
8765         * examples/capitalize.test, examples/comments.test,
8766         examples/ddivert.test, examples/debug.test,
8767         examples/esyscmd.test, examples/exp.test,
8768         examples/foreach.test, examples/forloop.test,
8769         examples/fstab.test, examples/hanoi.test,
8770         examples/include.test, examples/indir.test,
8771         examples/misc.test, examples/multiquotes.test,
8772         examples/patsubst.test, examples/pushpop.test,
8773         examples/regexp.test, examples/reverse.test,
8774         examples/sysv-args.test, examples/trace.test,
8775         examples/translit.test, examples/undivert.test,
8776         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
8777         modules/modpath1.test, modules/modpath2.test,
8778         modules/modpath3.test, modules/modpath4.test,
8779         modules/modtest.test, modules/shadow.test,
8780         modules/unfrozen.m4, modules/unload.test: Removed.
8782         Move the implementation of GMP support for the mpeval() builtin
8783         into a loadable module that depends on libgmp.  mpeval() and
8784         eval() share a common parser, now in m4/evalparser.c; the code
8785         in m4/numb.c and m4/numb.h is now physically split between
8786         m4/eval.c (the eval() backend) and modules/mpeval.c (the
8787         mpeval() backend), rather than being differentiated by cpp
8788         macros and multiple inclusion.  The mpeval module is always
8789         built but will generate an diagnostic if it is used from an
8790         installation that didn't link in the gmp library.
8791         * modules/Makefile.am: build and install the new mpeval module.
8792         * modules/mpeval.c: Now contains the former parts of m4/numb.c
8793         and m4/numb.h that are required for gmp support in mpeval().
8794         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8795         * m4/evalmp.c:  Removed.
8796         * m4/m4module.h: Removed conditional prototype for
8797         m4_mp_evaluate().
8798         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
8799         and m4/numb.h that do not rely on gmp.
8800         * m4/evalparse.c:  New file, contains the shared parts of the
8801         eval() and evalmp() parser implementations, and is no longer
8802         unencumbered by cpp magic to uncover the right parts.
8803         * m4/numb.h:  Removed.  It's former contents are split between
8804         m4/eval.c and modules/mpeval.c.
8805         * m4/numb.c: ditto.
8807         * tests/other-tests/changeword.test: New test.  Rudimentary
8808         testing of changeword builtin runs only if --wnable-changeword
8809         was used at configure time.
8810         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8811         alternation correctly.  Split into two expressions to compensate.
8812         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
8813         * modules/Makefile.am: Build changeword module.
8814         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
8815         only when --enable-changeword was passed to configure.
8816         (builtin_changeword): If --enable-changeword was not used, then
8817         report that changeword() builtin has no support in m4 binary.
8819 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
8821         * src/main.c (main): Fixed a particularly nasty bug is
8822         user_search_path setting -- the -M flag processing must be
8823         extremely careful with search path ordering, or else the default
8824         installed module directory (possibly containing modules from a
8825         previous release) is placed earlier in the search path than any -M
8826         arguments (which are relied upon to load uninstalled modules with
8827         most of the tests in the regresion suite).
8829         * modules/load.c (builtin_load):  Nasty hack to prevent adding
8830         symbols to symtab again if a module is loaded more than once.
8831         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
8833         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
8834         possible NULL pointer dereference.
8836         * m4/module.c (m4_module_find_by_modname): Renamed from
8837         m4_module_modname_find.   Fixed all references.
8838         (m4_module_find_by_builtin):  New function.
8840         * modules/modfreeze.test: load the `load' module with each
8841         invocation.
8842         * src/freeze.c (produce_frozen_state): Simplified in light of
8843         module field in m4_symbol.  Allow a third argument for text macros
8844         to name the originating module.
8845         (reload_frozen_state): ditto.
8846         * m4/m4module.h:  Fixup prototypes.
8847         * m4/builtin.h (m4_builtin_define): Add a module argument so
8848         that symbols can be registered against the defining module.
8849         (m4_macro_define): ditto.
8850         * m4/m4private.h (m4_symbol): Make the module field const to save
8851         on casting in the rest of the code.
8852         (SYMBOL_MODULE): New macro.
8854         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
8855         symbol reference maintenance bugs when removing a symbol from the
8856         symtab.
8858         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
8860 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
8862         * configure.in (m4_cv_func_obstack): A better check for whether
8863         libc has an obstack implementation.
8864         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
8866         * configure.in (--with-modules): Changed semantics.  This
8867         option is now used to list modules to be preopened.
8868         * src/m4.h: #include "ltdl.h" unconditionally.
8869         * src/main.c: Removed all dependencies on WITH_MODULES.
8870         * src/freeze.c: ditto.
8871         * modules/Makefile.am: ditto.
8872         * m4/m4.c (builtin_m4exit): ditto.
8873         * modules/modpath1.test: ditto.
8874         * modules/modpath2.test: ditto.
8875         * modules/modpath3.test: ditto.
8876         * modules/modpath4.test: ditto.
8877         * modules/modtest.test: ditto.
8878         * modules/shadow.test: ditto.
8879         * modules/unload.test: ditto.
8881         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
8882         comes up on demand in LTLIBOBJS now.
8883         * configure.in (getopt_long):  Creating and relying on a link for
8884         getopt.h on hosts with no getopt_long() of thier own works
8885         correctly now.  This is necessary so that callers of getopt_long()
8886         can simply `#include <getopt.h>': the naive way of doing this
8887         would end up using our own getopt.h and the installed
8888         getopt_long(), which is asking for trouble!
8889         (obstack_init): A similar argument applies to obstack.h and
8890         obstack_init().
8892         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
8893         On Solaris-2.5 (at least) the native dlopen implementation
8894         gets confused about m4.o when looking for module "m4".  This
8895         version always looks for .la an .$lib_ext suffixed names first
8896         to work around the problem.  Sigh.
8898         * po/POTFILES.in: Take account of these file movements.
8899         * src/Makefile.am (m4_SOURCES): removed eval.c.
8900         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
8901         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
8902         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
8903         * modules/m4.c (builtin_eval): Use m4_evaluate().
8904         * m4/eval.c: Moved here from src/eval.c to facilitate
8905         implementation of eval() builtin as part of the `m4' loadable
8906         module.
8907         (m4_evaluate): renamed from evaluate for namespace cleanliness.
8908         * m4/numb.c: Moved here from src/numb.c, since it is #included
8909         into eval.c at compile time.
8910         * m4/m4module.h (m4_evaluate): Added prototype.
8911         * src/m4.h (evaluate): Removed prototype.
8913 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
8915         * modules/perl.c (builtin_perleval):  Use PL_na for
8916         compatibility with perl-5.6.
8918         * src/main.c (main):  It is now safe to
8919         ``m4_module_install("m4")'', without tripping over the m4
8920         binary itself!
8921         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
8922         versions having fixed the insidious module search order bug.
8924         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
8925         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
8927         * configure.in: Figure out whether to use the installed
8928         getopt.h or the supplied one.
8929         * src/Makefile.am: ditto.
8931         * po/POTFILES.in: List files in their new positions.
8933         * config/ltmain.sh:  This needs to be checked in to match the
8934         libtool macros copied to acinclude.m4 (until a released
8935         libtool copes with m4's needs).
8936         * bootstrap:  Run gettextize.
8938 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
8940         * AUTHORS:  Added my details.
8941         * TODO: updated.
8942         * NEWS: updated.
8943         * bootstrap: temporary update until released libtool catches up.
8945         * All files:  Use new GNU GPL copyright blurb with current contact
8946         address.
8948         * configure.in (LTLIBOBJS): Use canonical code for calculation of
8949         this variable.
8951         * config: renamed acm4 directory to config to be more like
8952         other autoconfiscated packages.
8954         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
8955         * config/debug.m4:  New file implementing configure macros to add
8956         suitable debug flags to the compiler invocation.
8958         * modules/load.c:  New file implementing the ``load'' and
8959         ``unload'' builtins.
8960         * tests/get-them:  Set the module search directory to the modules
8961         build directory in generated tests.
8962         * modules/shadow.test: ditto.
8963         * modules/modtest.test: ditto.
8964         * modules/modpath1.test: ditto.
8965         * modules/modpath2.test: ditto.
8966         * modules/modpath3.test: ditto.
8967         * modules/modpath4.test: ditto.
8968         * modules/modtest.test: ditto.
8969         * modules/modfreeze.test: ditto.
8970         * modules/unload.test: ditto.
8972         * modules/changeword.c:  New file implementing the ``changeword''
8973         builtin as a loadable module.
8974         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
8975         as a loadable module.
8977         * src/main.c (main):  Load the gnu module if m4 was started
8978         normally -- i.e. without the -G option.
8979         * modules/gnu.c:  New file implementing a new loadable module wuth
8980         definitions for all the gnu extension builtins.
8981         * modules/format.c:  Moved here from src/format.c.  Now included
8982         directly by gnu.c.
8984         * src/main.c (main):  Load the traditional module if m4 was
8985         started in `no_gnu_extensions' mode.
8986         * modules/traditional.c:  New file implementing the ``unix'' macro,
8987         required when m4 is executed in traditional mode, as a loadable
8988         module.
8990         * src/main.c:  Renamed from m4.c to avoid confusion with
8991         modules/m4.c.
8992         (main):  Always load the m4 module.
8993         * modules/m4.c:  New file implementing a new loadable module with
8994         definitions for all m4 builtins that are not gnu extensions.
8996         * m4/Makefile.am:  Adjusted to take new files below into account.
8997         * m4/m4module.h: Prototypes for exported functions and types moved
8998         to this directory from the src directory.
8999         * m4/m4private.h: Moved here from src/m4private.h to facilitate
9000         the migration of all builtin implementations to loadable modules.
9001         * m4/macro.c: Moved this file here from the src directory,
9002         renaming all exported symbols to use the prefix ``m4_''.
9003         * m4/builtin.c: ditto.
9004         * m4/module.c: ditto.
9005         * m4/symtab.c: ditto.
9006         * m4/debug.c: ditto.
9007         * m4/input.c: ditto.
9008         * m4/output.c: ditto.
9009         * m4/path.c: ditto.
9010         * m4/ltdl.h, m4/ltdl.c: ditto.
9011         * m4/utility.c: Odd functions moved here from files in the src
9012         directory to facilitate builtin migration.
9014 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
9016         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
9017         error message, to make translators' jobs a little easier.
9018         (builtin_builtin): ditto.
9019         (builtin_traceon): ditto.
9020         (builtin_traceoff): ditto.
9021         Reported by Akim Demaille <akim@epita.fr>
9023         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
9024         pkgincludedir instead.
9026         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
9027         it is exported globally.  Fixed all references.
9028         (lquote): ditto.
9029         (bcomm): ditto.
9030         (ecomm): ditto.
9031         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
9032         globally.  Fixed all references.
9033         (DEF_LQUOTE): ditto.
9034         (DEF_BCOMM): ditto.
9035         (DEF_ECOMM): ditto.
9037 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
9039         * NEWS: updated.
9040         * TODO: updated.
9042         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
9043         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
9045         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
9046         Removed `Prev', `Next' and `Up' fields of all @nodes now that
9047         makeinfo calculates them for us, and to make any future
9048         reorganisation easier.
9049         (Frozen files): Document format version 2.
9050         `V' now takes argument `2'.
9051         `F' can take a single argument if symbol and builtin names
9052         are the same, or 3 arguments if the builtin is from a module.
9053         New `S' specification for saving syntax table contents.
9054         New `M' specification for saving loaded module names.
9055         * src/freeze.c: Implement them.
9056         * src/input.c (syntax_code): For interpreting frozen syntax
9057         state.
9059         * examples/Makefile.am:  Add the contents of the WWW directory to
9060         the distribution.
9061         * examples/WWW/Makefile:  ditto,
9062         (%.htm): Compares file contents (not just sizes) to determine
9063         whether a change has occured.
9064         * examples/WWW/_header.htm: Bumped version number.
9065         * examples/WWW: Regenerated content.
9067         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
9068         compilers comes much easier without ansi2knr.
9069         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
9071         * m4/list.c: New generic list container type.
9072         * m4/list.h: Interface to new container type.
9073         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
9074         (libm4_la_SOURCES): compile and link list.c.
9075         * src/builtin.c (builtin_tables): Use list container.
9076         * src/module.c (symtab): ditto.
9077         * src/symtab.c (symtab): ditto.
9079         * m4/system.h: New file for common preprocessor definitions.
9080         * m4/Makefile.am (pkginc_HEADERS): install system.h.
9081         * m4/error.c: Use system.h in place of inline preprocessor.
9082         * m4/error.h: ditto.
9083         * m4/module.c: ditto.
9084         * m4/module.h: ditto.
9085         * m4/xmalloc.c: ditto.
9087         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
9088         compatibility.
9089         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
9091         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
9092         it is exported globally.  Fixed all references.
9093         (builtin): ditto.
9094         (module_init_t): ditto.
9095         (module_finish_t): ditto.
9096         (token_data): ditto.
9097         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
9098         it is exported globally.  Fixed all references.
9099         (SYNTAX_IGNORE): ditto.
9100         (SYNTAX_SPACE): ditto.
9101         (SYNTAX_OPEN): ditto.
9102         (SYNTAX_CLOSE): ditto.
9103         (SYNTAX_COMMA): ditto.
9104         (SYNTAX_DOLLAR): ditto.
9105         (SYNTAX_ACTIVE): ditto.
9106         (SYNTAX_ESCAPE): ditto.
9107         (SYNTAX_ALPHA): ditto.
9108         (SYNTAX_NUM): ditto.
9109         (SYNTAX_ALNUM): ditto.
9110         (SYNTAX_LQUOTE): ditto.
9111         (SYNTAX_RQUOTE): ditto.
9112         (SYNTAX_BCOMM): ditto.
9113         (SYNTAX_ECOMM): ditto.
9114         (SYNTAX_VALUE): ditto.
9115         (SYNTAX_MASKS): ditto.
9116         (IS_OTHER): ditto.
9117         (IS_IGNORE): ditto.
9118         (IS_SPACE): ditto.
9119         (IS_OPEN): ditto.
9120         (IS_CLOSE): ditto.
9121         (IS_COMMA): ditto.
9122         (IS_DOLLAR): ditto.
9123         (IS_ACTIVE): ditto.
9124         (IS_ESCAPE): ditto.
9125         (IS_ALPHA): ditto.
9126         (IS_NUM): ditto.
9127         (IS_ALNUM): ditto.
9128         (IS_LQUOTE): ditto.
9129         (IS_RQUOTE): ditto.
9130         (IS_BCOMM): ditto.
9131         (IS_ECOMM): ditto.
9132         (TOKEN_EOF): ditto.
9133         (TOKEN_NONE): ditto.
9134         (TOKEN_STRING): ditto.
9135         (TOKEN_SPACE): ditto.
9136         (TOKEN_WORD): ditto.
9137         (TOKEN_SIMPLE): ditto.
9138         (TOKEN_MACDEF): ditto.
9140         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
9141         consistency.  Fixed all references.
9142         (STRING): Renamed to `m4_string' for consistency, and because if
9143         is exported globally.  Fixed all references.
9144         (token_type): Renamed to `m4_token_t' for the same reasons.
9145         (token_data_type): Renamed to `m4_token_data_t' for the same
9146         reasons.
9148         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
9149         sizes.
9150         (XMALLOC): ditto.
9151         (XREALLOC): ditto.
9152         (XFREE): Wrapper macro which avoids freeing NULL pointers.
9154         * m4/m4module.h (m4_macro):  New type for module defined user
9155         macros.
9156         * modules/modtest.c (m4_macro_table):  Define module user macros.
9157         * modules/shadow.c (m4_macro_table):  ditto.
9159         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
9160         declared with M4BUILTIN.
9162         * m4/xmalloc.c: Use memset if bzero is not available when
9163         emulating calloc with malloc.
9164         (xcalloc): Fallback to malloc/bzero if calloc is not available.
9165         (xfree): Added for consistency.  Will not try to free NULL
9166         pointers.
9167         * src/m4.c (xfree):  Deleted in favour of the above.
9168         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
9169         linking with libdmalloc.
9170         * m4/xstrdup.c (WITH_DMALLOC): ditto.
9172         * modules/frozen.m4:  New test case.
9173         * modules/unfrozen.m4:  ditto.
9174         * modules/modfreeze.test:  New test.
9175         * modules/unload.test:  ditto.
9176         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
9177         (TESTS): Use them.
9178         * modules/modpath1.test:  Don't try this test if module support is
9179         not compiled in.
9180         * modules/modpath2.test: ditto.
9181         * modules/modpath3.test: ditto.
9182         * modules/modpath4.test: ditto.
9183         * modules/modtest.test: ditto.
9184         * modules/shadow.test: ditto.
9186         * modules/perl.c: New module.
9187         * modules/perl.m4: Example of using it.
9188         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
9190         * src/m4.c (main): Assume interactive mode if STDIN is connected
9191         to a tty.
9192         Changed startup sequence slightly so that syntax is not
9193         initialised from here when loading a frozen file.
9195         * src/builtin.c:  Much improved macro definition style.
9196         * src/m4private.h:  Internal structures for m4_builtin and
9197         m4_macro instances.  These are not exposed to module writers.
9198         * src/module.c (module_modname_find):  Find a module structure
9199         from the its name.
9200         (make_macro_table):  Build an internal macro table from a external
9201         definition.
9202         (make_builtin_table):  Build an internal builtin table from an
9203         external definition.
9205         * src/module.c (module_unload): Be extremely careful to remove
9206         builtins and macros that match the module being unloaded -- no
9207         longer assume that the top element can be removed incase another
9208         odule defines an identical name.
9209         * src/symtab.c (remove_table_reference_symbols): remove all symbol
9210         table entries which refer to a given builtin table.
9211         * src/builtin.c (remove_tables): Use it!
9213 2000-07-13  Thomas Tanner  <tanner@ffii.org>
9215         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
9216         * acm4/modules.m4: deleted
9217         * bootstrap: don't libtoolize libltdl!
9218         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
9219         if set, enable WITH_MODULES and add modules to DLPREOPEN
9220         * examples/misc.test: redirect standard output
9221         * lib/Makefile.am: don't use DLLDFLAGS
9222         * lib/m4module.c: include necessary headers to silence GCC -Wall
9223         * lib/m4regex.c: fixes to silence GCC -Wall
9224         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
9225           build modules conditionally
9226         * modules/shadow.c: define symbol aliases before using them
9227         * modules/test.c: define symbol aliases before using them
9228         * po/de.po: update translation
9229         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9230         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9231         LIBLTDL to LIBS.
9232         * src/m4.c: initialize libltdl's preloaded symbols via
9233         LTDL_SET_PRELOADED_SYMBOLS
9234         * src/module.c: libltdl's memory management must be initialized
9235         before calling lt_dlinit!, fix warnings
9237 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
9239         * README:  Caveat about nls not supported by dll architecture on
9240         Windows.
9242         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9244         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
9245         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
9246         * modules/Makefile.am (LIBS): ditto.
9247         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9248         $(top_srcdir)/m4 (for only <m4module.h>).
9249         * modules/shadow.test: fixed for VPATH.
9250         * modules/modtest.test: ditto.
9251         * modules/modpath4.test: ditto.
9252         * modules/modpath3.test: ditto.
9253         * modules/modpath2.test: ditto.
9254         * modules/modpath1.test: ditto.
9256         * modules/time.test: Removed due to timezone dependence,
9257         * modules/Makefile.am (TESTS): Removed time.test.
9259         * configure.in: Use $3 of AC_DEFINE so that we can,,,
9260         * acconfig.h: Remove everything except the gettext parameters.
9261         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9262         AC_DEFINE.
9263         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
9264         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
9265         increment serial number.
9267         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9268         src dir and immediately after libm4 is built for confidence that
9269         it doesn't rely on the src directory.
9270         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9271         makeinfo stop the build on cygwin (because they don't work).
9273         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9275         * m4/m4private.h: ...is not a public header, so moved to src.
9276         Add `#include <config.h>', `#define _COMPILING_M4' and
9277         `#include "m4.h".
9278         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9279         * src/Makefile.am (noinst_HEADERS): add m4private.h.
9280         * src/builtin.c: `#include "m4private.h"' now takes care of the
9281         above.  Duplicates removed.
9282         * src/debug.c: ditto.
9283         * src/eval.c: ditto.
9284         * src/evalmp.c: ditto.
9285         * src/format.c: ditto.
9286         * src/freeze.c: ditto.
9287         * src/input.c: ditto.
9288         * src/m4.c: ditto.
9289         * src/macro.c: ditto.
9290         * src/module.c: ditto.
9291         * src/numb.h: ditto.
9292         * src/output.c: ditto.
9293         * src/path.c: ditto.
9294         * stackovf.c: ditto.
9295         * symtab.c: ditto.
9297         * po/POTFILES.in: compensate for renaming of lib/*.
9298         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9299         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9300         and then in $(top_srcdir)/lib (for eg. "m4private.h").
9301         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9302         m4/libm4.la.
9303         * m4/m4error.h:  Renamed error.h, for installation to
9304         $prefix/include/m4..
9305         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
9306         * m4/m4regex.h: Renamed regex.h, for same reason.
9307         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
9308         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9309         * m4/m4regex.c: Renamed regex.c, and fix #includes.
9311         * lib: moved to m4 to easily support header installation to
9312         $prefix/include/m4.
9313         * Makefile.am (SUBDIRS): renamed lib dir to m4.
9314         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9315         * acm4/regex.m4: Point to m4/regex.c.
9317         * examples/foreach.m4:  Sanitise quoting.
9318         * examples/foreach.test:  New torture test.
9319         From Akim Demaille <akim@epita.fr>
9321 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
9323         * src/ltdl.c: Use access() to abort doomed module load attempts
9324         if module file does not exist.
9326         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9327         getopt1.o will already be used if appropriate, so I moved getopt.c
9328         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9330         * modules/modpath1.test: Use correct filename in header line.
9331         * modules/modpath2.test: ditto.
9332         * modules/modpath3.test: ditto.
9333         * modules/modpath4.test: ditto.
9335         Without these changes lt_dlopen("test") attempts to
9336         LoadLibrary("/bin/test") on Windows, which although harmless
9337         generates a spurious error message which spoils most of the tests:
9338         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9339         (TESTS): s/test.test /modtest.test /
9340         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9341         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9342         * modules/modpath1.test: s/test.m4 /modtest.m4 /
9343         * modules/modpath2.test: ditto.
9344         * modules/modpath4.test: ditto.
9345         * modules/modpath3.test: s/-m test /-m modtest /
9346         * modules/shadow.m4: use {un,}loadmodule(`modtest').
9348 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
9350         * src/ltdl.c (find_file): Updated to new version with fixed memory
9351         allocation bug in `next'.
9352         * src/ltdl.h: updated to match.
9354         * modules/Makefile.am:  Cleaned up and reordered.
9356 2000-01-16  René Seindal  <rene@seindal.dk>
9358         * modules/Makefile.am (TESTS): New tests for the module system.
9360         * modules/*.test: New files.
9362         * src/m4.c (main): Added call to module_init().
9363         Treats -M and -m as the arguments -D -U and -t, ie deferred.
9365         * src/m4.h: Added declaration of module_init().
9367         * src/module.c (module_init): No longer static
9369         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9370         Added to shut up automake about non standard libtool library
9371         names.
9373         * src/module.c: Disabled DEBUG by default.
9375         * modules/README: Changed example from unload.m4 to shadow.m4
9377         * modules/shadow.m4: Renamed from unload.m4
9379         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9381         * src/m4.c (main): Functionality for -m and -M were reversed.
9382         Fixed.
9384 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
9386         * doc/help2man.pl: updated to version 1.020.
9388         * lib/COPYING.LIB:  updated to version 2.1.
9390         * lib/m4module.h: restructure the M4_SCOPE code to work when
9391         creating a dll which links with libm4.la and both DLL_EXPORT
9392         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9393         both defined.
9395 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
9397         Merged the following changes from my tree:
9399         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
9401         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9402         ported to compile shared libs.
9404         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9405         use `__declspec(dllimport)' when linking libm4.la on win32.
9406         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9408         * configure.in (M4OBJS): Discover whether we need the shipped
9409         implementation of getopt_long.
9410         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9411         main binary here, as opposed to the module library in lib/libm4.la.
9413         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
9415         * modules/README: Updated to describe the improved libltdl based
9416         module scheme.
9417         * README (cygwin): Added some compilation notes for building m4
9418         correctly under cygwin.
9419         * TODO: Cleaned out the entries for the module system since they
9420         are now implemented.
9422         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9423         all instances of __P with M4_PARAMS.
9425         * lib/getdate.h: removed unreferenced file.
9427         * lib/m4private.h: New file to define the private interface to the
9428         token_data struct, which must be shared between m4module.c, and
9429         builtin.c but not exported to modules built from the installed
9430         m4module.h since it's size changes depending on compile time
9431         options.
9433         * src/m4.h: Lots of stuff moved to lib/m4module.h.
9435         * lib/m4module.h: New file to define the interface available when
9436         compiling m4 modules.
9437         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9438         necessary for module compilation into this new file.
9440         * lib/Makefile.am (include_HEADERS): install headers (renamed to
9441         avoid nameclash with other system headers) necessary for compiling
9442         modules.
9443         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9444         so that modules can include the (renamed) installed headers and
9445         be guaranteed a matching implementation.
9446         * lib/m4error.h: renamed from error.h.
9447         * lib/m4obstack.h: renamed from obstack.h.
9448         * lib/m4regex.h: renamed from regex.h.
9449         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
9450         implementation, simply include the shipped version
9451         unconditionally, otherwise it is hard for a module to know
9452         whether the m4obstack.h header it is using matches the
9453         implementation it ends up linking against.
9454         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
9455         the same reason.
9457         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
9459         * examples/misc.test: Don't run this test on machines which don't
9460         have a root user in /etc/passwd (e.g. cygwin).
9462         * tests/get-them (/^@example$/): Error messages might have a
9463         ``.exe'' suffix to the program name, or else use the libtool
9464         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
9465         of these cases are now catered for when comparing error messages
9466         in generated tests.
9467         * tests/other-tests/*.test: ditto.
9468         * examples/*.test: ditto.
9470         * tests/defs (M4): use libtool execute mode.
9471         * examples/defs (M4): ditto.
9473         * tests/get-them (END): explicitly close any open file.
9474         (printthem): In a regular expression, '{' is the start of a repeat
9475         count!  Use `[{]' for a literal open brace.
9476         (/^@node /): Don't use substr on a string shorter than the trim
9477         length.
9479         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
9481         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9482         substituted.
9483         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9485 2000-01-10  Andreas Schwab  <schwab@suse.de>
9487         * tests/other-tests/gmp.test: Find config.sh in build directory.
9489         * configure.in: Find tests/mkconfig.sh in $srcdir.
9491         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9492         <signal.h> (for SUS2 compliant systems).
9494         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
9495         HAVE_SIGINFO_H.
9497 2000-01-10  René Seindal  <rene@seindal.dk>
9499         * Prerelease 1.4o.
9501         * TODO, NEWS: Cleaned up and updated.
9503         * src/m4.c (main): New variable exit_status for exit status in
9504         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
9505         file cannot be read instead of EXIT_SUCCESS.
9507         * src/builtin.c (m4_indir): Changed error message to help
9508         translators (from Akim Demaille <demaille@inf.enst.fr>).
9510         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
9511         Cygnus.
9513         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
9514         from glic 2.1.2.
9516         * src/input.c (match_input): Reordering of code, to avoid multiple
9517         calls to push_string_init() from obstack_grow(), which can happen
9518         with some compilers (found and fixed by James Bonfield
9519         <jkb@mrc-lmb.cam.ac.uk>).
9521         * src/stackovf.c: Added prototypes for ultrix.
9522         (setup_stackovf_trap): Added __P to cast.
9523         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
9525 2000-01-09  René Seindal  <rene@seindal.dk>
9527         * doc/m4.texinfo (Changequote): Added comment about changing
9528         quotes when the old quote is a part of the new.
9530         * src/builtin.c (expand_ranges): Added break after trailing dash.
9531         This caused misbehavious on some systems (found and fixed by Akim
9532         Demaille <demaille@inf.enst.fr>).
9534         * AUTHORS: Thomas Tanner included
9536         * acconfig.h: Added entry for ss_sp (see below).
9538         * configure.in (use_stackovf): Added check for stack_t with member
9539         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
9540         <eggert@twinsun.com>).
9542         * doc/m4.texinfo (Frozen files): Added a simpler example for
9543         generating frozen files from several input files.
9545 1999-11-14  Paul Eggert  <eggert@twinsun.com>
9547         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
9548         lib/regex.c, lib/xmalloc.c.
9550 1999-11-10  René Seindal  <rene@seindal.dk>
9552         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
9554         * src/module.c: reindented.
9555         (module_load): return if this is a repeated load of same module.
9556         (module_init): slight change of logic to avoid repeated
9557         initialisation debug messages.
9559         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
9560         in the distribution.
9562         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
9563         automake warnings about missing lib prefix.
9564         (time_la_LDFLAGS): ditto
9565         (stdlib_la_LDFLAGS): ditto
9567 1999-11-10  Paul Eggert  <eggert@twinsun.com>
9569         * src/m4.h: Include error.h, since our macros use error.
9570         * src/m4.c: Don't need to include error.h.
9572 1999-11-09  Paul Eggert  <eggert@twinsun.com>
9574         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
9575         and zero, as Solaris 7 cc does.
9576         (bcopy): Remove macro; no longer needed with new obstack.h.
9578         * src/output.c (freeze_diversions): Don't assume that a
9579         diversion size can fit in `int'.  Check for diversion file
9580         size too large to be printed with `unsigned long'.
9582         * src/Makefile.am (CFLAGS): Omit -Wall.
9584         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
9586         * src/debug.c (trace_format):
9587         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
9589         * src/freeze.c (produce_frozen_state):
9590         Don't assume string lengths fit in int.
9592 1999-10-13  René Seindal  <rene@seindal.dk>
9594         * po/cs.po: Czech translation added.
9596         * po/sv.po: Updated Swedish translation.
9598         * po/ru.po: Updated Russian translation.
9600         * po/pl.po: Updated Polish translation.
9602         * po/el.po: Greek translation added.
9604 1999-10-13  René Seindal  <rene@seindal.dk>
9606         * configure.in (ALL_LINGUAS): Added Greek translation (el).
9607         (ALL_LINGUAS): Added Czech translation (cs).
9609 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
9611         * src/builtin.c: moved module loading functions into...
9612         * src/module.c: entirely new implementation using libltdl.
9613         * po/POTFILES.in: added src/module.c.
9614         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
9615         are modules, not linktime libraries.
9616         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
9617         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
9618         avoidance on exported symbols.
9619         * modules/test.c (m4_macro_table, m4_init_module,
9620         m4_finish_module): ditto.
9621         * modules/time.c (m4_macro_table): ditto.
9623         * modules/time2.m4: new file which requires command line loading
9624         of modules.
9625         * src/m4.c (--load-module): dynamically load named runtime module
9626         into running executable before reading the source.
9627         (--module-directory): prepend a directory to the module search
9628         path.
9629         (module_init()): Do this the first time we load a module instead;
9630         if the module subsystem is broken normal m4 scripts can still run.
9631         * src/m4.h (install_builtin_table): is now exported.
9633 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
9635         * src/module.c: removed.  No longer required.
9636         * po/POTFILES.in: removed src/module.c.
9638         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
9639         the bootstrap script can recreate.
9640         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
9641         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
9642         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
9643         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
9644         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
9645         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
9646         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
9647         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
9649         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
9650         better.
9651         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
9652         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
9653         the installed gettext.m4 file when running aclocal.
9655 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
9657         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
9658         distinguish this from the last prerelease.
9659         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
9660         in its own subdirectory.
9662         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
9663         lib prefix on a module" feature.
9664         (LDFLAGS): Added `-module -avoid-version' flags to build
9665         versionless module libraries.
9666         * src/builtin.c (m4_load_module): use libltdl.
9667         (module_unload_all): use libltdl.
9668         * src/m4.c (module_init): initialise module loading on demand for
9669         better diagnostics, and so that m4 will still work even if
9670         the module code is broken.
9671         * src/m4.h (module_init): removed.  No longer relevant.
9672         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
9673         exported symbols for compatibility with dlpreopening.
9674         * modules/test.c (m4_macro_table, m4_init_module,
9675         m4_finish_module): ditto.
9676         * modules/time.c (m4_macro_table): ditto.
9678         * bootstrap: New file.  Runs all the autoutils in the right order
9679         after a fresh checkout, or a make maintainer-clean.
9681 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
9683         * src/builtin.c (dump_symbols): New function, factoring common
9684         content of m4_dumpdef and m4_symbols.
9685         (m4_dumpdef): Use it.
9686         (m4_symbols): New function, implementing `symbols'.  Use it.
9687         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
9688         file compile with modern makeinfo.
9689         (Symbols): New node, documenting symbols.
9690         (direntry): Modernize.
9692 1998-12-11  René Seindal  <rene@seindal.dk>
9694         * src/builtin.c (predefined_tab): New predefined macros
9695         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
9696         configure time options.
9698 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
9700         * src/module.c (module_try_load): Don't try to be clever and
9701         overwrite argument string.  Instead allocate all constructed
9702         strings locally, since they can have arbitrary lengths.  Make
9703         arguments pointers to const.
9704         (module_search): Simplify due to above change.
9706 1998-11-29  René Seindal  <rene@seindal.dk>
9708         * Prerelease 1.4n.
9710         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
9712         * tests/other-tests/import-environment.{m4,test}: New test.
9714         * tests/other-tests/discard-comments.{m4,test}: New test.
9716         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
9718         * src/m4.c (main): New option -c --discard-comments.
9719         New global variable discard_comments.
9721         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
9722         discarded, ie never returned from next_token().
9723         Added declaration of discard_comments.
9725         * src/input.c (next_token): Now loops until token type is not
9726         TOKEN_NONE.  Comments are now given this type when comments should
9727         be discarded.
9729         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
9730         and mpeval.
9732 1998-11-28  René Seindal  <rene@seindal.dk>
9734         * src/m4.c (main): New option --import-environment (no single
9735         letter option).
9737         * When configured with --with-gmp both the normal (fast) eval()
9738         and the gmp aware mpeval() are defined.  To restore previous
9739         bahaviour use "define(`eval', defn(`mpeval'))".
9741         * tests/other-tests/gmp.m4: Changed to use mpeval().
9743         * src/evalmp.c: New file for compiling eval.c as gmp aware.
9744         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
9746         * src/eval.c: Now includes "numb.c" directly.  Everything in this
9747         file must by static, except evaluate(), which is changed to
9748         mp_evaluate() if USE_GMP in force.
9750         * src/numb.c: Changed to be included by eval.c instead of being
9751         compiled separately.  Everything is declared static.
9753         * src/numb.h: Removed declarations of functions, as numb.c is now
9754         included by eval.c.
9756         * src/builtin.c: Declaration of m4_mpeval() added.
9757         Inserted `mpeval' in builtin table.
9758         (do_eval): New function with common code for m4_eval and m4_mpeval.
9759         (m4_mpeval): New function for gmp version of eval.
9761         * src/m4.h: Declaration of mp_evaluate().
9763         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
9764         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
9766         * src/m4.c (main): m4 --version also shows which options were used
9767         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
9769 1998-11-27  René Seindal  <rene@seindal.dk>
9771         * Error messages now always print program name before input file
9772         name as specified by GNU coding standards.  Reported by Akim
9773         Demaille <demaille@inf.enst.fr>.
9775         * doc/m4.texinfo (Include): Change due to changed error message
9776         format.
9777         (Eval): Do.
9779         * tests/get-them: Minor change to sed script due to changed error
9780         message format.
9782         * src/m4.c (print_program_name): New func used to print program
9783         name, input file and line number in error ().  Used as an
9784         error_print_progname handler.
9785         (reference_error): Removed.
9786         (main): Assigns error_print_progname.
9788         * src/m4.h (M4ERROR): Removed reference_error ().
9790 1998-11-25  René Seindal  <rene@seindal.dk>
9792         * Updated to libtool 1.2b.
9794         * src/builtin.c (install_builtin_table): Added braces to avoid
9795         warning of ambiguous 'else'.
9797         * src/module.c: Inserted search path code from path.c modified to
9798         use new interface.
9799         (module_init): Configured default path used only if M4MODPATH is
9800         not set.
9801         (module_try_load): Now reads libMODULE.la as generated by libtool
9802         for actual module name.
9803         (module_load): Gives better error messages on failure.
9805         * src/m4.h: Added declarations of structures and functions for
9806         generic search path handling.
9808         * src/path.c: Removed all module specific code and introduced new
9809         functions of more generic search path handling.
9811 1998-11-24  René Seindal  <rene@seindal.dk>
9813         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
9814         included gettext, as <libintl.h> might not be found
9815         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
9817 1998-11-22  René Seindal  <rene@seindal.dk>
9819         * src/output.c (insert_diversion): Fixed bug that might cause m4
9820         to read from standard output!  Triggered by input
9821         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
9822         so now 'undivert(0)' does nothing.
9824 1998-11-18  René Seindal  <rene@seindal.dk>
9826         * Prerelease 1.4m.
9828         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
9829         could be changed when compiling a illegal regexp, causing later
9830         use of the regexp to dump core.
9832         * src/module.c (module_load): Changed error message to conform to
9833         standards.
9835         * src/m4.c (usage): Added message about reporting bugs.
9837         * doc/m4.texinfo (Changeword): Corrected a wrong example.
9838         (Changeword): Added note about the type of regexps used.
9840         * ltconfig, ltmain.sh: New files from Libtool 1.2.
9842         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
9843         and AM_PROG_LIBTOOL.
9845         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
9846         with libtool.
9848         * modules/Makefile.am: Changed completely to compile modules using
9849         libtool.  The modules are compiled as shared libraries, and are
9850         renamed when installed.
9852         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
9853         USE_SHL_LOAD to HAVE_SHL_LOAD
9855         * src/builtin.c (shipout_string): Now tests for a NULL string.
9857         * src/module.c: New level of indirection around non-portable
9858         functions to load shared objects.  Intended to encapsulate the non
9859         portable parts better and to reduce the number of #ifdefs in the
9860         code.
9862         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
9863         directory modules/ to the distribution.
9865 1998-11-15  René Seindal  <rene@seindal.dk>
9867         * Prerelease 1.4l.
9869         * modules/stdlib.c: New module `stdlib' defining some standard
9870         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
9871         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
9873         * src/builtin.c (shipout_string): New convenience function for
9874         builtins and modules.
9876         * src/module.c (module_load): Tentative support for
9877         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
9879         * Makefile.am (SUBDIRS): Directory modules added if configured.
9881         * modules/Makefile.am: Now correctly compiles and installs
9882         modules in pkglibexecdir.
9884         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
9885         These two are now initialised by autoconf macros.
9887         * src/path.c (module_env_init): MODULE_PATH is always on the
9888         search path.
9890         * src/Makefile.am: Now generated pathconf.h which defined the
9891         default MODULE_PATH.
9893         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
9894         where modules are installed.
9896         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
9897         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
9898         build and install automatically, and it is prepared for other
9899         interfacec than dlopen().
9901         * src/builtin.c (predefined_tab): Added __m4_version__ for the
9902         current version of GNU m4.  It is a GNU extension.
9904 1998-11-14  René Seindal  <rene@seindal.dk>
9906         * tests/Makefile.am (GENERATED_TESTS): Added new
9907         generated-tests/changesy.8.test
9909         * doc/m4.texinfo (Changesyntax): Documentation for escape
9910         syntax class.
9912         * src/macro.c (expand_token): Check for escaped macro call before
9913         symbol table lookup.
9915         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
9916         characters
9918         * src/input.c: New static variable use_macro_escape, which is TRUE
9919         iff some character has code SYNTAX_ESCAPE
9920         (input_init): Added initialisation of use_macro_escape.
9921         (check_use_macro_escape): New function to synchronise
9922         use_macro_escape with the syntax table.
9923         (set_quotes): Added call to check_use_macro_escape()
9924         (set_comment): Do.
9925         (set_syntax): Do.
9926         (next_token): Added new case for IS_ESCAPE.
9928         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
9930 1998-10-13  René Seindal  <rene@seindal.dk>
9932         * Prerelease 1.4k.
9934         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
9935         generated-tests.
9937         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
9938         maintained tests in tests/other-tests.  These currently tests for
9939         8-bit transparency, multiple precision arithmetic and sync-line
9940         output.  Test for stackoverflow detection does not work.
9942         * examples/Makefile.am (TESTS): Added tests for all example files.
9944         * examples/mktests.sh: New file.  Help program for creating test
9945         files.
9947         * tests/mkconfig.sh: New file to generate tests/config.m4 and
9948         tests/config.sh.  This is for tests of configure selectable
9949         features.  Picks up all set WITH_ and ENABLE_ veriables from
9950         config.h
9952         * src/path.c (path_search): Added argument 'char **expanded_name'
9953         to return the expanded name.
9955         * src/m4.h: Added 2nd argument to declaration of path_search().
9957         * src/m4.c (main): Added 2nd argument to path_search().
9959         * src/freeze.c (reload_frozen_state): Do.
9961         * src/builtin.c (m4_undivert): Do.
9962         (include): Do.
9964 1998-10-11  René Seindal  <rene@seindal.dk>
9966         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
9968         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
9970         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
9972         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
9974         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
9976         * intl/: Updated to GNU gettext 0.10.35.
9978         * doc/m4.texinfo (Format): Documented that format is blind.
9980         * src/builtin.c (builtin_tab): Builtin format marked as blind.
9982 1998-10-07  René Seindal  <rene@seindal.dk>
9984         * Prerelease 1.4j.
9986         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
9987         .test, as the files are no longer just m4 input.
9989         * tests/get-them (FILE): Changed .m4 extension to .test.
9991         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
9992         Otherwise quoted strings with leading whitespace first in a macro
9993         argument would be eliminated.
9995         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
9996         (expand_argument): Do.
9998         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
9999         grouped together iff both quote and comment strings are single
10000         character.  Otherwise they might include a comment/quote leader.
10001         (next_token): Returns new token type TOKEN_SPACE.
10003         * src/builtin.c (push_builtin_table): New function to push a
10004         builtin_table on the stack without installing its contents.
10005         (find_builtin_by_name): Added call to push_builtin_table() if
10006         reading frozen files.  Otherwise the builtins named in the frozen
10007         files could not be found.
10008         (install_builtin_table): Changed to use push_builtin_table()
10010 1998-10-04  René Seindal  <rene@seindal.dk>
10012         * po/pl.po: Polish translation added.
10014         * po/POTFILES.in: src/module.c added.
10016 1998-10-04  René Seindal  <rene@seindal.dk>
10018         * Prerelease 1.4i.
10020         * configure.in (ALL_LINGUAS): Added Polish pl.po
10022 1998-10-03  René Seindal  <rene@seindal.dk>
10024         * Many files: Incorporated changes to implement dynamic modules.
10025         Detailed comments in src/modules.c and modules/README
10027         * src/module.c: New file, implements the OS dependant parts of
10028         dynamic module loading.
10030         * src/Makefile.am (m4_SOURCES): Added module.c
10032         * src/builtin.h: New file, declares some functions from builtin.c
10033         that are of use for other modules (shipout_int, numeric_arg,
10034         skip_space, bad_argc), and the macros ARG() and DECLARE().
10036         * src/builtin.c (install_builtin_table): New function.  Each
10037         module brings in a builtin_table, which is pushed on a stack.
10038         (struct builtin_table): New struct for list of builtin_tables.
10039         (m4_loadmodule): New function to implement builtin "loadmodule".
10040         (shipout_int): No longer static, to be used by modules.
10041         (numeric_arg): do.
10042         (skip_space): do.
10043         (bad_argc): do.
10044         (builtin_init): changed to call install_builtin_table()
10045         (find_builtin_by_name): Now searches all builtin_tables
10046         (find_builtin_by_addr): do.
10048         * src/path.c: Reorganised to allow for two search paths, one for
10049         include files and one for modules.
10051         * src/m4.h: Added declarations for new functions in module.c and
10052         in path.c.
10054         * src/m4.c (main): Added call to module_init().
10056         * modules: New directory with a few demo modules.
10058         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
10059         in SUBDIRS.
10061         * configure.in: Added modules/Makefile to AC_OUTPUT.
10063         * configure.in: Added code to implement --with-modules.  Tests for
10064         <dlfcn.h> and -ldl.
10066         * acconfig.h: Added WITH_MODULES
10068 1998-10-02  René Seindal  <rene@seindal.dk>
10070         * examples/Makefile.am (pkgdata_DATA): Removed special target for
10071         check and variables TESTS.  These tests are now run from the
10072         tests/ directory.
10074         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
10075         directory.  The files stay there but the tests are run from the
10076         tests/ directory.
10078         * tests/Makefile.am (EXTRA_DIST): Added run-test.
10080         * tests/run-test: New file.  Run a test manually
10082         * tests/Makefile.am, tests/get_them: Moved automatically generated
10083         tests (from the manual) to sub directory tests/gentest/.  The
10084         tests/ directory had gotten a bit messy.
10086 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10088         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
10089         wrap}.test: Added a few testcases.
10091 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10093         * Prerelease 1.4h.
10095         * lib/Makefile.am (noinst_HEADERS): regex.h added
10097         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
10098         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
10100         * acm4/Makefile.am: created providing rules to create
10101         $(top_srcdir)/acinclude.m4 to be used by aclocal.
10103         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
10104         `C'. Reported by Ulrich Drepper.
10106         * Makefile.am (SUBDIRS): Removed checks directory
10107         * configure.in (AC_OUTPUT): Removed checks/Makefile
10109         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
10110         the space when m4.texinfo is edited and whitespace.el is active.
10111         (Defn,example): idem.
10113 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10115         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
10116         ../COPYING. ../Makefile is a file which is certainly present when
10117         test is executed in testSubDir. One can't be sure that the COPYING
10118         file is in .. or ../.. in all situations, the ../Makefile is
10119         always there.
10121         * doc/m4.texinfo (Include): adjusted expected test output
10122         according to new tests, i.e. the input will always come from the
10123         file `in' created by the test.
10125         * tests/Makefile.am: Added three lines at the top to get
10126         esyscmd.1.test working.
10128         * tests/get-them: modified to generate clearer tests who will need
10129         less maintenance when new test examples are created in
10130         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
10131         need the generic file `defs') shell scripts creating `in', `ok',
10132         `out' and when apropriate `okerr' and `err' in the directory
10133         `testSubDir' when executed. The compare of `ok' and `out'
10134         (and of `okerr' and `err') will be the exit status of the test.
10135         `out' must match `ok' (and `okerr' must match `err') for the test
10136         to be succesful.
10138         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
10139         the tests generated by tests/get-them getting it input normally
10140         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
10141         (dot) before the numeric part) is reserved for all other (hand
10142         written) tests. The `+' means one or more times.
10144 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10146         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
10147         supported short man page to refer to info documentation
10148         * helptoman.pl: added
10149         * configure.in: AC_PATH_PROG(PERL,perl)
10150         * Makefile.am (SUBDIRS): doc after src
10152         * libitized with libit 0.5 from
10153         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
10155         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
10156         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
10157          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
10158         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
10159           lib/rx.{c,h}: added
10160         * configure.in (AC_CHECK_FUNC): getopt_long
10162         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
10164         * TODO: added entry about dependencies
10166 1998-08-10  René Seindal  <rene@seindal.dk>
10168         * Prerelease 1.4f
10170         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
10171         "changesyntax".
10173         * src/builtin.c (m4_changesyntax): Added builtin macro
10174         "changesyntax" to modify the syntax table.
10176         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
10177         table.  All categories are assigned a syntax code and tokens are
10178         read according to this table.
10180 1998-08-09  René Seindal  <rene@seindal.dk>
10182         * src/numb.{c,h}: New files, implements multiple precision eval
10183         using GNU gmp.  Originally submitted by John Gerard Makecki
10184         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
10186         * doc/m4.texinfo (Eval): Added documentation for multiple
10187         precision arithmetic library support.
10189         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
10190         to accommodate multiple precision eval.
10192 1998-08-07  René Seindal  <rene@seindal.dk>
10194         * src/input.c (MATCH, match_input), src/m4.h: changed definition
10195         of comment and quote strings to `unsigned int' to allow eight bit
10196         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
10198         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
10199         patch from Mike Howard <mike@clove.com>
10201 1998-08-06  René Seindal  <rene@seindal.dk>
10203         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
10204         -lintl.
10206 1998-08-03  René Seindal  <rene@seindal.dk>
10208         * Prerelease 1.4e
10210         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
10211         and _ macro.  M4 now builds with --disable-nls.
10213         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
10214         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
10216         * configure.in (ALL_LINGUAS): Added complete list of translations:
10217         de fr it ja nl ru sv.
10219 1998-05-23  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10221         * po/nl.po: Dutch translation by Erick Branderhorst.
10223         * po/fr.po: French translation by Erick Branderhorst, based on the
10224         translations by François Pinard in fr.msg and m4.cod.
10226 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10228         * Prerelease 1.4d.
10230         * src/m4.c: #include <signal.h> not <sys/signal.h>.
10232         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10234         * checks/Makefile.am: explicit list tests in CHECKS.
10236         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10237         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10238         mkinstalldirs, install-sh: Added automake (1.3) support.
10240         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10241         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10242         Used libitize (0.4) to update.
10244         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10245         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10246         README accordingly.
10248         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10249         stack overflow functionality.
10251 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
10253         * Prerelease 1.4.1.
10255         * Makefile.in (realclean-local): Delete stamp-h.in.
10257         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10258         Localize, adapting from how it is done in sharutils.
10260         * fr.tt: New file, for French.
10262         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10263         src/freeze.c: Rename PRODUCT to PACKAGE.
10265 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
10267         * configure.in: Check for <libintl.h> and <locale.h>.
10268         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10269         src/stackovf.c: Rename _ to __P.
10270         * src/m4.h: Declare _ as a macro returning its argument, or else,
10271         include <libintl.h> and declare _ as gettext.
10272         * src/m4.c: Possibly include <locale.h> and call setlocale.
10273         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10274         src/input.c, src/macro.c, src/output.c, src/path.c,
10275         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10276         strings.
10278 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
10280         * doc/Makefile.in (stamp-vti): Use new -r option to date.
10282         * configure.in: Put --with-gmp in place, in prevision for John
10283         Gerard's work.
10284         * acconfig.h: Document WITH_GMP.
10286 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
10288         * Release 1.4.
10290         * doc/Makefile.in (realclean): Also remove stamp-vti.
10291         Reported by Eric Backus.
10293 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
10295         * src/freeze.c (produce_frozen_state): If the frozen file cannot
10296         be opened, return immediately after producing the error message.
10297         Reported by Andreas Schwab.
10299         * configure.in: Check for const only after having found possible
10300         ANSIfying compiler flags, this is of no use to check it before.
10301         Reported by Alexander Lehmann.
10303 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
10305         * src/macro.c (collect_arguments): Cast obstack arguments to
10306         (voidstar), so avoiding compiler warnings.
10307         Reported by Joseph E. Sacco.
10309         * src/freeze.c (produce_frozen_state): Cast printed lengths to
10310         (int) so they correspond to %d format items.
10311         Reported by Joseph E. Sacco.
10313         * src/m4.c (main): Cast the argument to xfree to (voidstar).
10314         * src/symtab.c (free_symbol): Idem.
10315         Reported by Karl Vogel.
10317 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
10319         * Makefile.in (DISTFILES): Distribute BACKLOG.
10321         * configure.in: Define PRODUCT and VERSION.
10322         * acconfig.h: Document PRODUCT and VERSION.
10323         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10324         constant string m4 and variable or parameter named version.
10326 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
10328         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10329         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10330         defines __STDC__ to 0, for indicating it is *not* ANSI!
10331         Reported by Kaveh R. Ghazi.
10333         * configure.in: Added obsolescent tests for AIX and Minix.
10335         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10336         which texclean does not exist anymore.
10337         Reported by Eric Backus, Jim Meyering, John David Anglin and
10338         Joseph E. Sacco.
10340 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
10342         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10343         Reported by John David Anglin.
10345         * src/ansi2knr.c: New version, sent by Peter Deutsch.
10346         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10347         ANSI2KNR, depending on the fact the compiler is ANSI or not.
10348         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10349         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
10350         of $U, put underline in extensions rather than in basenames.  Use
10351         implicit rules, now that regularity makes this possible.
10352         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10353         of ansi2knr whenever it is needed.
10354         * configure.in: Adjusted for correct STACKOVF substitution.
10355         * src/debug.c (trace_format): When not __STDC__, use (...) as a
10356         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10357         Reported by David MacKenzie.
10359         * Makefile.in: Remove binprefix.  Use transform_name instead.
10360         Reported by David MacKenzie.
10362         * doc/Makefile.in: Create version.texi, use it, clean it.
10363         Reported by Jim Meyering.
10365 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
10367         * Makefile.in (all, install, uninstall): Depend on Makefile.
10369         * Makefile.in: For actions invoking $(MAKE) from within compound
10370         sh statements, exit non-zero if the sub-make fails.  Otherwise,
10371         the top-level make may exit successfully when it should fail.
10372         Reported by Jim Kingdon.
10374         * {,/*}Makefile.in: Use && after all cd, in case they fail.
10376         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10377         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10378         * configure.in: Substitute PRODUCT and VERSION.
10380         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10382 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
10384         * Makefile.in (mostlyclean-local): Do not remove *~.
10385         * */Makefile.in (mostlyclean): Idem.
10386         Reported by Robert E. Brown and Richard Stallman.
10388 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
10390         * src/m4.h: Get rid of CONFIG_BROKETS.
10392 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
10394         * configure.in: Use AC_ARG_PROGRAM.
10395         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10396         Reported by David MacKenzie.
10398 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
10400         * configure.in: Do not add -O to CFLAGS for GNU C, now that
10401         configure does it automatically.
10402         Reported by Jim Meyering.
10404 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
10406         * src/stackovf.c: Declare the handler_t typedef earlier in the
10407         code, use it for stackovf_handler.
10408         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10409         casting sigsegv_handler.
10410         Reported by Robert Bernstein.
10412         * src/m4.c (main): Initialize program_name to argv[0] without
10413         basename'ing it.
10414         Reported by Karl Berry.
10416 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
10418         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10419         Reported by Karl Berry.
10421 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
10423         * lib/Makefile.in (mostlyclean): Added.
10424         (TAGS): Make in $(srcdir).
10426         * configure.in: Use `choke me' in test, like everywhere!
10428         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10429         unreacheable and useless.
10431         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10433         * lib/Makefile.in (DISTFILES): Distribute TAGS.
10434         (distclean): Do not remove TAGS.
10435         (realclean): Remove it.
10436         * Makefile.in: Make TAGS in lib also, not just in src.
10437         Reported by Karl Berry.
10439         * Makefile.in (distclean, realclean): Instead of recursively
10440         calling $(MAKE) for the -local part, allow parallel execution of
10441         -recursive and -local, only delay the removal of config.status,
10442         which is repeated in both goals.
10444 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
10446         * Release 1.3.
10448         * Makefile.in: Group all *clean-recursive goals in one, using sed
10449         to remove `-recursive' while calling make recursively.  Also, use
10450         a subshell for each recursive $(MAKE).
10451         Reported by Jim Meyering.
10453         * src/m4.h (memcpy): Define with bcopy for BSD systems.
10454         Reported by Kaveh R. Ghazi.
10456         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10457         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10458         specify it.
10460         * configure.in: Use date instead of touch for stamp-h.
10461         * Makefile.in (stamp-h.in): Idem.
10463         * Makefile.in (distclean, realclean): Force serial execution of
10464         both goals, in case parallel makes are being used.
10465         Reported by Jim Meyering.
10467         * src/Makefile.in (DISTFILES): Distribute TAGS.
10468         (distclean): Do not remove TAGS.
10469         (realclean): Remove it.
10470         Reported by Karl Berry.
10472 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
10474         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
10475         to old names, for following Autoconf.
10477 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
10479         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10480         ./install.sh will not be correctly referred to in sub-Makefiles.
10481         Reported by John David Anglin.
10483         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10484         Reported by Eric Backus.
10486         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10487         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10488         config.status into remaking this directory's Makefile only.
10489         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10490         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10491         Reported by Jim Meyering.
10493 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
10495         * configure.in: Correct stack overflow detection logic, taking
10496         care of systems having only incomplete implementations (like for
10497         Pyramid 9820 OSx 5.0d).
10498         Reported by Kaveh R. Ghazi.
10500         * src/Makefile.in (TAGS): Remote -t from etags call.
10502 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
10504         * lib/Makefile.in (install): Depend on all.
10506 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
10508         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
10509         Reported by Jim Meyering and John David Anglin.
10511         * Makefile.in (distclean-local): Delete config.log.
10512         Reported by Jim Meyering.
10514         Solidify frozen files with respect to -P:
10515         * src/m4.c: Have -P set prefix_all_buitins variable instead of
10516         calling a function by that name.  Declare the variable.
10517         * src/m4.h: Adjust declaration for prefix_all_buitins.
10518         * src/builtin.c (builtin_init): Merge in functionality from
10519         previous prefix_all_buitins function, while making entries in the
10520         symbol table, but not modifying the builtin description itself.
10522         * src/freeze.c (reload_frozen_state): Add a useless `break;',
10523         because *many* compilers do not accept an empty `default:'.
10524         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
10525         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
10527         * configure.in: Use AC_TYPE_SIGNAL.
10528         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
10529         Reported by Robert Bernstein.
10531         * checks/Makefile.in (check): Modify PATH so check-them will find
10532         m4 in the src directory.
10533         * Makefile.in (check): Don't.
10534         Reported by Akiko Matsushita and Jim Meyering.
10536         * src/output.c (make_room_for, output_character_helper): New
10537         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
10538         a per buffer MAXIMUM_BUFFER_SIZE.
10540         * src/output.c (output_text): New function, for optimizing the
10541         output of strings of characters.  Use it.
10543 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
10545         * doc, src: New directories reorganizing the distribution.
10546         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
10547         files.
10548         * Makefile.in: Adjusted.
10549         * configure.in: Configure new Makefiles.
10551         * m4.h: Declare STRING typedef.  Use it for comment and quote
10552         strings, adjusting all references.  (This is the rudiments of a
10553         beginning for the eventual withdrawal of NUL terminated strings.)
10554         * output.c (shipout_text): Accept a length parameter, and use it.
10555         All callers adjusted.
10557 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
10559         * m4.h: Include <unistd.h> if it exists.
10560         * stackovf.c: Don't.
10562         Clean up for current_diversion variable:
10563         * output.c: Move current_diversion from builtin.c.
10564         * m4.h: Declare current_diversion so builtin.c can access it.
10565         * output.c (output_init, make_diversion): Initialize or update
10566         current_diversion.
10567         * builtin.c (builtin_init, m4_divert): Leave current_diversion
10568         alone.
10570         Remove limit on number of diversions:
10571         * output.c: Replace ndiversion by diversions, declare it.
10572         (output_init): Allocate only diversion 0.
10573         (make_diversion): Allocate new diversions as needed.
10574         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
10575         * m4.c: Still accept -N, but do nothing with it.
10576         Reported by David MacKenzie.
10578         Freeze diversions:
10579         * output.c (freeze_diversions): New function.
10580         * m4.h: Declare freeze_diversions.
10581         * freeze.c: Document frozen file format, revise it, call
10582         freeze_diversions to add diversions to frozen format, and code to
10583         reload them properly.
10584         * m4.c: Do not undivert automatically at end when status being
10585         frozen.  Do not call builtin_init when reloading frozen state.
10587         Speed up diversion processing:
10588         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
10589         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
10590         structure and variables, cached variables out of output_diversion,
10591         reallocate_diversion_for and OUTPUT_CHARACTER.
10592         (shipout_text, make_diversion, insert_diversion): Adapted to new
10593         structures.
10594         (insert_file): Use better buffering.
10595         Reported by David MacKenzie.
10597 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
10599         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
10600         dist works from another build directory.
10602 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
10604         * symtab.c (hack_all_symbols): Use hash_table_size instead of
10605         constant HASHMAX, for -H option to work better.
10607         * builtin.c (DECLARE): Simplify by using _ ().
10609         * freeze.c: New file.
10610         * Makefile.in: Compile it, distribute it.
10611         * m4.c: Recognize, document and process --freeze-state (-F) and
10612         --reload-state (-R) options.  Pass a true flag to builtin_init
10613         only if no reloading some state.
10614         * builtin.c (define_builtin): Remove static specifier.
10615         (find_builtin_by_name): Remove static specifier.
10616         (builtin_init): Accept and obey a flag argument.
10617         * m4.h: Add declarations for freeze.c, changes for builtin.c.
10619 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
10621         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
10622         specifier.
10624         * configure.in: Implement --with-dmalloc.
10625         * acconfig.h: Document WITH_DMALLOC.
10626         * m4.h: Add code for when WITH_DMALLOC.
10628 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
10630         * m4.c (long_options): Use "error-output", the dash was missing.
10631         Reported by Akiko Matsushita.
10633 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
10635         * m4.h: Include <sys/types.h>.
10636         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
10637         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
10638         int.
10639         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
10640         as size_t, not int.
10641         * builtin.c (dump_args): Declare len as size_t, not int.
10643         * debug.c: Prototype the forward declaration of debug_set_file.
10645         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
10646         shadowing of this variable.
10647         * output.c (insert_diversion): Idem.
10649         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
10650         (input_init): Duplicate default quote and comment strings.
10651         (set_quotes): Free previous quote strings in all cases.  Duplicate
10652         even default quote strings.
10653         (set_comment): Free previous comment strings in all cases.
10654         Duplicate even default comment strings.
10656         * configure.in: Updated for Autoconf 2.0.
10657         * Makefile.in (distclean-local): Also delete config.cache.
10659         * m4.c (usage): Reorganize the --help output by topic.  Include a
10660         description for debugging flags.
10662 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
10664         * configure.in: If sigaction is available and SA_ONSTACK defined,
10665         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
10666         defined, use sigvec.  Else don't compile stackovf.c.
10667         * stackovf.c (setup_stackovf_trap): Idem.
10668         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
10669         and Simon Leinen.
10671 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
10673         * m4.c (usage): Replace printf par fputs.
10675 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
10677         * Release 1.2
10679 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
10681         * configure.in: Check for sigaction and sigvec.  Add a new delayed
10682         check for RLIMIT_STACK, combine in the checking for getrlimit.
10683         All those things are not universally available.
10684         * stackovf.c: Split setting up the trap handler and catching
10685         signals, for better taking care of various configure outcomes.
10686         * examples/stackovf.sh: Correct a typo.
10687         Reported by Eric Backus, Jim Avera and Jim Meyering.
10689 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
10691         * ansi2knr.c: New version sent by its author, Peter Deutsch.
10693 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
10695         * Makefile.in: Modify so parallel make will not try making
10696         lib/libm4.a twice simultaneously.
10697         Reported by Jim Meyering.
10699 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
10701         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
10702         error message, for when no code possibility exists.  Even if this
10703         line is completely #ifdef'ed out, it brings a syntax error.
10704         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
10706         * Makefile.in (install): Have install depend on all too, for lib
10707         to be remade as needed.
10709         * examples/stackovf.sh: Try ksh, bsh and bash for shells
10710         providing ulimit, instead of using only ksh.
10711         Reported by Jim Avera and Joseph E. Sacco.
10713 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
10715         * Makefile.in (check): Have it depend on all instead of m4.  In
10716         this way, a change in lib will be detected and processed.
10718         * builtin.c (numeric_arg): Use strtol and verify the conversion,
10719         instead of using sscanf which stops as soon as there is a
10720         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
10721         and divert(1xyzzy) were all accepted without any warning or error
10722         messages.
10723         * m4.h: Declare strtol as long if not including stdlib.h.
10724         * configure.in: Check for limits.h, and replace strtol if missing.
10725         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
10726         * lib/strtol.c: New file, from elsewhere.
10727         Reported by Andreas Schwab.
10729 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
10731         * macro.c (expand_macro): Cast value to (boolean) prior to
10732         assigning it to traced.
10733         Reported by Tom McConnell.
10735         * Makefile.in (m4): Always make all in lib first.
10736         Reported by Jim Meyering.
10738 1994-07-06  Jim Avera <jima@netcom.com>
10740         * stackovf.c: Isolated OS-dependent sections; Improved portability,
10741         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
10742         handlers), and a default error message if the fault address is not
10743         available (when neither siginfo.h nor BSD sigcontext are supported).
10744         * configure.in: Changes for stackovf.h: Check for sigcontext,
10745         sigaction, sigstack, and define rlim_t as int if necessary.
10746         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
10747         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
10748         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
10750 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
10752         * configure.in: Use AC_SET_MAKE.
10753         * Makefile.in: Use @SET_MAKE@.
10754         Reported by Jim Meyering.
10756         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
10757         Reported by Ian Taylor.
10759 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
10761         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
10762         because siginfo.h is unrelated to standard headers, and siginfo.h
10763         is already checked for.
10764         Reported by Joseph E. Sacco.
10766         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
10767         PROTOTYPES.
10768         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
10769         AC_PROTOTYPES.
10771 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
10773         * builtin.c (substitute): Use \& to represent this part of the
10774         string which was matched by the whole regexp, instead of
10775         representing the whole string.  Any usage of \0 issues a warning
10776         and acts like \&, it will disappear in some subsequent release.
10778 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
10780         * m4.c: Complete prototype for forwarded declaration of usage.
10782         * input.c (init_macro_token): Correct own reference in error
10783         message.  Previous name get_macro_func was referred to instead.
10784         (next_char):  Correct own reference in error message.  Previous
10785         name advance_input was referred to instead.
10787         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10788         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10789         and_term, not_term, logical_not_term, cmp_term, shift_term,
10790         add_term, mult_term, exp_term, unary_term, simple_term): Add
10791         prototype to forwarded declarations.  Declare parameter v1 as
10792         eval_t * instead of int *.  Same for local variable v2 in dyadic
10793         functions.  Same for result in exp_term.
10794         * builtin.c (m4_eval): Declare value as eval_t instead of int.
10795         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
10796         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
10797         (shipout_int): Cast first argument of ntoa to eval_t.
10798         Reported by Thorsten Ohl.
10800         * macro.c: Complete the prototypes of forwarded expand_macro and
10801         expand_token.
10802         Reported by Thorsten Ohl.
10804         * m4.h: Define voidstar as void * or char * depending on __STDC__.
10805         The Ultrix 3.1 compiler cannot do much with void pointers.
10807         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10808         * m4.c (xfree):  Replace void * by voidstar.
10809         Reported by Tom McConnell.
10811         * ansi2knr.1: New, from elsewhere.
10812         * Makefile.in (DISTFILES): Distribute ansi2knr.1
10814         * Makefile.in (stamp-h.in): Avoid running ./config.status if
10815         stamp-h does not exist yet.  This avoids running it a second time
10816         just after the initial ./configure.
10817         Reported by David MacKenzie and Tom McConnell.
10819         * m4.h: Replace the enum debug_info declaration with a series of
10820         #define's.  The Ultrix 3.1 compiler would otherwise need casting
10821         (int) to most references, when used in expressions.
10822         Reported by Tom McConnell.
10824 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
10826         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
10827         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
10828         calls the compiler.  Previously, FP_PROTOTYPES was only calling
10829         the preprocessor; by not being subject to CFLAGS, this was
10830         discouraging those flags asking for ANSI compilation.
10831         * acconfig.h: Document HAVE_PROTOTYPES.
10832         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
10833         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
10834         Reported by Eric Backus.
10836         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
10837         from the environment.  Default CFLAGS to -g if not set.
10838         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
10839         * lib/Makefile.in: Have CFLAGS substituted from configure.
10840         Reported by Eric Backus and Tom McConnell.
10842         * configure.in: m4_undefine changeword before using AC_ENABLE.
10844         * m4.h: Declare prototypes for error (for ANSI compilers only),
10845         prefix_all_builtins and reference_error.
10846         Reported by Tom McConnell.
10848         * input.c (set_word_regexp): Do not try to initialize the array
10849         test from a string, this does not work with non-ANSI compilers.
10850         Reported by Eric Backus.
10852         * Makefile.in (dist): Clean examples/ before saving it.
10853         (distclean-local): Also remove stamp-h.
10854         Reported by Eric Backus.
10856         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
10857         non ANSI compilers.
10858         Reported by Tom McConnell.
10860         * checks/Makefile.in (clean): Depends on mostlyclean.
10861         (mostlyclean): New goal.
10863 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
10865         * Makefile.in (DISTFILES): Distribute install.sh.
10866         * install.sh: New file, copied from elsewhere.
10867         Reported by Assar Westerlund and Kaveh R. Ghazi.
10869 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
10871         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
10872         * acconfig.h: Explain ENABLE_CHANGEWORD.
10874         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
10875         from code provided by Pete Chown]
10876         * m4.h: Add original_text field to u_t variant of union u.
10877         Declare TOKEN_DATA_FUNC macro.
10878         * builtin.c: Declare changeword.
10879         (m4_changeword): New function.
10880         * input.c: Include "regex.h", define variables with word regexps.
10881         (input_init): Initialize the word regexp.
10882         (set_word_regexp): New.
10883         (next_token): Declare local variables, use the previous code if
10884         default_word_regexp is true.  Else, match using a new code.  Save
10885         the original text.
10886         * macro.c (expand_token): Ship out original text if not a macro
10887         name.
10888         Reported by Krste Asanovic and Pete Chown.
10890         [These modifs all depend upon ENABLE_CHANGEWORD]
10891         * m4.h: Declare external user_word_regexp.
10892         * m4.c: Declare user_word_regexp, and initialize it from
10893         --word-regexp or -W, or NULL if not specified.
10894         * input.c: Use user_word_regexp if specified, instead of
10895         DEFAULT_WORD_REGEXP.
10897         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
10898         agree with it.
10900         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
10901         * checks/Makefile.in: Empty the suffix list.
10902         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
10904         * m4.c: Declare nesting_limit and initialize it to 250.
10905         Implement -LNUMBER or --nesting-limit=NUMBER to change its
10906         value.
10907         * m4.h: Declare nesting_limit as external.
10908         * macro.c (expand_macro): Stop execution whenever nesting limit
10909         is exceeded.
10910         Reported by Bengt Mertensson.
10912         * eval.c (evaluate): Diagnose excess characters in eval input.
10913         Things like `eval(08)' used to return 0 with no diagnostic.
10915         * m4.h: Capitalize first letter of all macro arguments in
10916         definitions.
10918         * m4.c: Declare warning_status, initialize it to 0.  Add new
10919         option -E, or --fatal-warnings, which sets warning_status to
10920         EXIT_FAILURE instead.
10921         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
10922         EXIT_FAILURE if not otherwise done by header files.
10923         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
10924         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
10925         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
10926         argument of all M4ERROR calls.
10927         Reported by Noah Friedman.
10929         * examples/incl-test.m4: Renamed from incl_test.m4.
10930         * examples/include.m4: Include incl-test.m4 instead of
10931         incl_test.m4.
10932         * examples/multiquotes.m4: Renamed from multi-quotes.m.
10934 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
10936         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
10937         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
10938         also tested it on a Sun Sparc workstation running SunOS 4.x.
10940         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
10941         49.format check, abusing a `union values' argument with sprintf
10942         without selecting the proper field.  Now, save the formatting type
10943         first, delaying the fetch of the corresponding argument.
10944         Reported by Joseph E. Sacco and Tom Quinn.
10946         * format.c (format): Remove const from char *fmt declaration when
10947         not HAVE_EFGCVT, because a NUL may be forced into it.
10949         * m4.h: Declare atof() when not STDC_HEADERS.
10950         Reported by Joseph E. Sacco.
10952         * Regenerate configure using Autoconf 1.11, this corrects a
10953         problem about an incorrect cpp seting on NeXT 3.1.
10954         Reported by Alexander Lehmann.
10956 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
10958         * m4.h (_): Change argument from `x' to `Args'.
10960 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
10962         * m4.h: Rename Args() to _().
10963         * m4.h: Remove extern specifier from all function declarations.
10965 1994-04-22  Jim Avera <jima@netcom.com>
10967         * stackovf.c: New file implementing stack-overflow detection.
10968         * configure.in: Check for getrlimit, sigaction.  If all of
10969         standard headers, getrlimit and sigaction, define USE_STACKOVF and
10970         substitute ${U}stackovf.o for STACKOVF.
10971         * acconfig.h: Declare USE_STACKOVF.
10972         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
10973         * m4.h: Declare setup_stackovf_trap().
10974         * m4.c: Call setup_stackovf_trap().
10975         * tests/stackovf_test.sh: New file.
10977 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
10979         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
10981         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
10983 1994-01-30  François Pinard  <pinard@iro.umontreal.ca>
10985         * m4.h: Remove definition of volatile, not used anymore.
10986         Reported by Jim Meyering and Joseph E. Sacco.
10988         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
10989         of `if ... else /* nothing */' for if macros.
10990         Reported by Jim Meyering.
10992         * builtin.c (m4_regexp): Reorganize the code for avoiding a
10993         warning from gcc about `repl' possibly used before defined.
10994         Reported by Jim Meyering.
10996         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
10997         Reported by Jim Meyering.
10999 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
11001         * m4.h: Move the conditional definition of volatile after the
11002         inclusion of system files, because they may define it first.
11004 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
11006         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
11007         get around a problem with Alpha make seeing a syntax error, there.
11008         Reported by Vern Paxson.
11010 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
11012         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
11013         Reported by Richard Stallman.
11015 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
11017         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
11018         instead of AC_HAVE_FUNCS.
11019         Reported by Noah Friedman.
11021 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
11023         * m4.c: Initialize show_help and show_version to zero.
11025         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
11026         Use them in exit() and usage() calls.
11028 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
11030         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
11031         syserr() macro.  Delete errref, add reference_error and M4ERROR.
11032         * m4.c: Replace errref, which was returning an input reference
11033         string, with reference_error, which prints it on standard error.
11034         * builtin.c, output.c: Use errno as second parameter to error,
11035         instead of using syserr() with %s.
11036         * *.c: Use M4ERROR instead of error: no more errref() with %s.
11037         Doing so, the program name appears after the input reference
11038         instead of before, which eases M-x next-error processing.
11040 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
11042         * checks/get-them: Escape braces with backslashes in patterns,
11043         because HPUX-9.01 awk needs this.
11044         Reported by Jim Meyering.
11046 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
11048         * builtin.c: Declare "FILE *popen ();".
11050         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
11051         macros, replace error_message_prefix() declaration by errref()'s.
11052         Declare xrealloc, for use in errref().
11053         * m4.c: Delete error_message_prefix() function, add errref().
11054         * *.c: Use error() systematically in place of all error macros,
11055         now that error() flushes stdout first.  Make needed adjustments.
11057         * m4.h: Remove const in sys_errlist[] declaration, it creates
11058         conflicts on SGI and Alpha.
11059         Reported by Kaveh R. Ghazi.
11061 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
11063         * m4.c: Include <getopt.h> instead of "getopt.h".
11065         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
11066         * acconfig.h: New, for documenting HAVE_EFGCVT.
11067         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
11068         use them wherever appropriate.  Also use -I. for compilations.
11069         * lib/Makefile.in: Use -I.. for compilations.
11070         * *.c: Include <config.h> or "config.h".
11072         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
11073         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
11075 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
11077         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
11079         * input.c (input_init): Initialize quote and comment strings
11080         explicitely instead of calling set_quotes and set_comment: by
11081         doing so, we ensure we do not free uninitialized variables.
11083         * checks/check-them: Reverse arguments to both diff, so the
11084         expected is on the left and the obtained on the right.
11086         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
11087         macros. Delete declarations for m4error, warning, fatal and
11088         internal_error, add declaration for error_message_prefix.
11089         * m4.c:  Delete m4error, warning, fatal and internal_error
11090         routines, add error_message_prefix routine.
11091         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
11092         warning with WARNING*, fatal with FATAL* and internal_error with
11093         INTERNAL_ERROR*.
11094         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
11095         this is not needed anymore.
11097         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
11098         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
11099         and debug_message, add declaration for debug_message_prefix.
11100         * debug.c: Remove static specifier for FILE *debug declaration.
11101         Delete debug_print and debug_message routines, add
11102         debug_message_prefix routine.
11103         * builtin.c, debug.c: Replace debug_print routine calls with
11104         DEBUG_PRINT* macro calls.
11105         * input.c, path.c: Replace debug_message routine calls with
11106         DEBUG_MESSAGE* macro calls.
11108         * m4.h: Remove inclusion of <varargs.h>.
11109         * debug.c: Include <stdarg.h> or <varargs.h>.
11110         (trace_format): Use stdarg instead of varargs if __STDC__.
11112         * configure.in: Remove checks for vfprintf and _doprnt.  These
11113         implementations use varargs tricks which are not portable enough.
11114         * lib/vfprintf.c: Deleted.
11115         * lib/_doprnt.c: Deleted.
11116         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
11117         Reported by Joel Sherrill.
11119         * path.c (add_include_directory): Use xstrdup.
11121         * builtin.c (find_builtin_by_name): Declare static.
11123         * *.[ch]: Add const to a few "char *" declarations.
11125         * configure.in: Remove commented tests for fileno() and fstat().
11126         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
11128         * debug.c (debug_flush_files): New.
11129         * m4.h: Declares it.
11130         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
11131         Reported by Nicolas Pioch.
11133 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
11135         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
11136         Reported by Joel Sherrill.
11138         * builtin.c (prefix_all_builtins): Instead of the table size, use
11139         the null entry at end for stopping the loop.  It was overwritten.
11140         Reported by Andreas Schwab and Jim Meyering.
11142         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
11143         Reported by Kaveh R. Ghazi.
11145         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
11146         Reported by Karl Vogel.
11148 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
11150         * m4.h: Do not define volatile if already defined.
11151         Reported by René Seindal.
11153         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
11155         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
11156         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
11158 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
11160         * m4.h: Define strchr and strrchr in terms of index and rindex,
11161         instead of the other way around.
11162         * builtin.c, m4.c, path.c: Use strchr instead of index.
11164         * input.c (next_char): Remove a "break;" after a "return ...;".
11165         Reported by Tom McConnell.
11167 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
11169         * Release 1.1
11171         * configure.in: Do not copy check files in the build hierarchy.
11172         * checks/check-them: Identify the m4 version being checked.  For
11173         finding m4, look in $PATH instead of in the parent directory.
11174         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
11175         * checks/Makefile.in (.all-stamp): Always create check files in
11176         the source hierarchy, not anymore in the build hierarchy.
11177         (check): cd to the source hierarchy before performing checks.
11178         Do not copy nor clean COPYING anymore, take it from `..'.
11179         Reported by Tom McConnell.
11181         * Makefile.in (Makefile): Use $(SHELL).
11182         (config.status): Use $(SHELL).  Use "config.status --recheck"
11183         instead of "configure --no-create", which is obsolete.
11184         Reported by Tom McConnell.
11186 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
11188         * m4.c (usage): Use "%s" instead of "m4" in format string.
11189         Reported by Jim Meyering.
11191         * Makefile.in: Distribute mkinstalldirs.
11192         Reported by Pierre Gaumond.
11193         Reported by Jim Meyering.
11194         Reported by Tom McConnell.
11195         Reported by Andreas Gustafsson.
11197         * checks/check-them: Renamed from checks/check_them.
11198         * checks/get-them: Renamed from checks/get_them.
11199         * checks/.all-stamp: Renamed from checks/.all_stamp.
11200         * checks/Makefile.in: Changed accordingly.
11201         Reported by Jim Meyering.
11203 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
11205         * lib/Makefile.in (dist): Correct permissions on files.
11207         * output.c: Declare tmpfile, some systems don't.
11209 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
11211         * checks/Makefile.in (dist): Correct permissions on files.
11213         * Makefile.in (dist): Ensure recursive linking for subdirectory
11214         `examples', also set read/write permissions on all its files.
11216         * mkinstalldirs: New, from elsewhere.
11217         * Makefile.in: Use it.
11219         * debug.c: Synchronize debug messages and regular output when
11220         the debug file and stdout are redirected to the same file.
11221         * configure.in: Add (commented) checks for fileno and fstat.
11222         Reported by Jim Avera.
11224         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
11225         etc., arguments, then ignore the superfluous one.  m4 used to
11226         diagnose missing arguments and return the empty string.
11227         Reported by Nick S. Kanakakorn.
11229 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
11231         * m4.c (main): At end of all input, ensure all undiverted text
11232         goes to the main output stream.
11233         Reported by Andreas Gustafsson.
11235         * m4.c (main): exit (0), instead of return 0.
11237         * m4.c: Implement -P and --prefix-builtins.
11238         * builtin.c: Delete const specifier on builtin_tab.
11239         (prefix_all_builtins): New.
11240         Reported by Noah Friedman.
11241         Reported by Scott Bartram.
11243         * c-boxes.el: New, from elsewhere.
11244         * Makefile.in: Distribute it.
11246         * m4.h: Do not define bcopy if <string.h> defines it.
11247         Reported by Stephen Perkins.
11249         * builtin.c (define_macro): Allow a missing second argument, in
11250         which case it is implied empty.  Affects define and pushdef.
11251         Reported by Eric Allman.
11253 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
11255         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11256         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11257         * builtin.c: Initialize all the blindness fields in builtin_tab.
11258         (define_builtin): Copy the blindness of a builtin into its symbol.
11259         * macro.c (expand_token): Avoid processing a blind builtin if the
11260         next character is not an opening parenthesis.
11261         Reported by David MacKenzie.
11262         Reported by Noah Friedman.
11264         * configure.in: Ensure an exit status of 0 on completion.
11265         Reported by Vivek P. Singhal.
11267         * eval.c (eval_lex): Admit both lower and upper case letters for
11268         bases greater than 10.  Only lower case letters were accepted.
11270         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11271         Reported by Krste Asanovic.
11273         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
11274         * eval.c (logical_not_term): New name for not_term.
11275         * eval.c (xor_term): New, between or_term and and_term.
11276         * eval.c (not_term): New, between and_term and logical_not_term.
11277         * eval.c (shift_term): New, between cmp_term and add_term.
11278         Reported by Krste Asanovic: ~, ^, <<, >>.
11279         Reported by Ben A. Mesander: ** vs ^.
11281         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11282         * m4.h: Delete xrealloc.c.
11283         * lib/xmalloc.c: New, from elsewhere.
11284         * lib/xstrdup.c: New, from elsewhere.
11285         * lib/Makefile.in: Distribute and compile them.
11287         * m4.c: Change progname to program_name.
11288         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11289         * lib/error.c: New, from elsewhere.
11290         * lib/Makefile.in: Distribute and compile error.c.
11291         * configure.in: Check AC_VPRINTF and for strerror.
11292         * m4.c: Delete cmd_error.  Use error instead.
11293         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11295         * m4.h: Delete #define const, let Autoconf takes care of this.
11297         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11298         Merge parse_args into main.  Declare argv to be `char *const *',
11299         then remove superfluous casts.
11301         * m4.c: Rename --no-gnu-extensions to --traditional.
11302         Reported by Ben A. Mesander.
11304         * m4.c (usage): Add a status parameter.  Supply one in various
11305         calls.  Add --help processing.  Remove -V for --version.
11307         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11309         * lib/Makefile.in: Have an AR=ar declaration.
11310         Reported by Eric Backus.
11311         Reported by Bjorn R. Bjornsson.
11312         Reported by Tom Tromey.
11313         Reported by Kristine Lund.
11314         Reported by Marion Hakanson.
11316 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
11318         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11319         Reported by Noah Friedman.
11321 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
11323         * Makefile.in: Remove MDEFINES and cleanup.
11325 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
11327         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11328         Create a gzip file.
11330 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
11332         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11333         ensure 777 mode for directories, so older tar's will restore file
11334         modes properly.
11336 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
11338         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11339         so the installer can override automatically configured choices.
11340         Reported by Karl Berry.
11342 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
11344         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
11345         previous version was not working properly on m68k-hp-bsd4.3.
11346         Reported by Roland McGrath.
11348         * lib/_doprnt.c: Stolen from Oleo distribution.
11349         * configure.in: Check for _doprnt.c if vfprintf.c selected.
11350         * lib/Makefile.in: Distribute _doprnt.c.
11351         Do not distribute regex.[ch].old anymore.
11353 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
11355         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11356         Richard wants it there.
11358 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
11360         * Makefile.in: Add DEFS to MDEFINES.
11361         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11362         (libm4.a): Remove the library before creating it.
11363         (distclean): Remove tags and TAGS too.
11365 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
11367         * Makefile.in (dvi, m4.dvi): New goals.
11369         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11370         macro.c, output.c, path.c, symtab.c: Change Copyright from
11371         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11373         * examples/divert.m4: Deleted, this bug has been corrected.
11375         * Makefile.in (texclean, mostlyclean): New goals.
11377         * Makefile.in (clean): Remove clutter from ansi2knr.
11378         Reported by Pierre Gaumond.
11380 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
11382         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
11383         might well use CFLAGS is s/he needs it.
11385         * Makefile.in: Allow installation of info files from a separate
11386         build directory.
11387         Reported by Jason Merrill.
11388         Reported by David MacKenzie.
11389         Reported by Skip Montanaro.
11390         Reported by Erez Zadok.
11391         Reported by Assar Westerlund.
11393 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
11395         * Release 1.0.3
11396         This is still a beta release for the future GNU m4 version 1.1.
11398         * lib/alloca.c: New, from elsewhere.
11399         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
11401         * m4.h: Do not define index/rindex if already defined.  If
11402         FALSE/TRUE are already defined, do not redefine them, but merely
11403         define boolean typedef to int.
11405         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11406         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11407         because some C compilers do not like connectives with #ifdef.
11408         * m4.h: Define `volatile' only if __GNUC__, instead of once for
11409         __GNUC__ and once for __STDC__.
11410         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11412         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11413         Makefile dependencies.  Without it, make keeps destroying and
11414         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
11416         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11417         to diversion/DIVERSION, this was a spelling error.
11419         * m4.c: Declare version[], remove #include "version.h".
11420         * version.h: Deleted.
11421         * Makefile.in: Remove references to version.h.
11423         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11424         production, by using a simpler and more robust algorithm.  This
11425         solves the problem of synclines sometimes written in the middle of
11426         an output line.  Delete sync_line() and output_lines variable.
11427         * m4.h: Remove sync_line prototype and output_lines declaration.
11428         * input.c (next_char), output.c (shipout_text): Remove references
11429         to output_lines.
11430         * input.c (push_file, pop_file): Merely put the value -1 in
11431         output_current_line instead of calling sync_line, for delaying a
11432         single `#line NUM FILE' before next output line.  Do not test
11433         for sync_output, because this is unnecessary clutter.
11434         * output.c (make_divertion, insert_divertion): Idem.
11435         * input.c: Rename must_advance_line to start_of_input_line, for
11436         consistency.
11438         * debug.c (trace_header): Select a new debug line format, which
11439         better complies with GNU standards for formatting error messages.
11440         With option `-dfl', M-x next-error might be used on the output.
11441         * m4.c (vmesg): Adjust format of error output to GNU standards.
11442         * m4.texinfo: Adjust examples for `make check' to work.
11444         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11445         case for enum debug_info constants, which were all lower case.
11447         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11448         re_search_2.
11449         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11450         collected patches.  I tried a few times using newer regex.[ch], it
11451         mysteriously stopped aborting with this one.  Insecure feeling...
11452         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11454 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
11456         * m4.c: Change `--no-warnings' to `--silent'.
11457         Reported by David MacKenzie.
11459         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11460         leave it off for now.  See comment in m4.c for justification.
11461         Reported by David MacKenzie.
11463         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11464         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11466         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
11468         * Makefile.in: Ensure recursive cleaning is done before local
11469         cleaning for all clean goals.
11471         * builtin.c (ntoa): Ensure the value is always interpreted as a
11472         signed quantity, whatever the radix is.
11474 1992-11-18  Jim Meyering  <meyering@idefix>
11476         * builtin.c, format.c, input.c: Split long lines.
11477         * m4.c: Use typedef macro_definition instead of struct
11478         macro_definition.
11479         * symtab.c: Use typedef symbol instead of struct symbol.
11481 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
11483         * *.[ch]: Remove all trailing whitespace, in code and comments.
11485         * configure.in: Find some awk.
11486         * Makefile.in: Add $(AWK) to MDEFINES.
11487         * checks/Makefile.in: Transmit $(AWK) to get_them.
11488         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
11489         awk script when switching files, because without this, mawk runs
11490         out of file descriptors.
11492 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
11494         * Makefile.in (realclean): Delete m4.info*.
11495         Reported by Jim Meyering.
11497         * Makefile.in: Adjust and link with checks/Makefile.
11498         * checks/Makefile.in: New.
11499         * configure.in: Output checks/Makefile.
11501         * checks/get_them: Have the dnl header of each test more
11502         recognizable by next-error, also use a better message.
11504 1992-11-16  Jim Meyering  <meyering@idefix>
11506         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
11507         And use that only if __GNUC__ since we're using it's GCC-specific
11508         semantics that tell the compiler the associated function doesn't
11509         return.
11511         * builtin.c (substitute): Don't use character as an array index.
11512         (dumpdef_cmp): Make formal arguments `const void *' to avoid
11513         warnings with gcc -W -Wall on systems with qsort prototype.
11514         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
11515         from gcc -W -Wall.
11517         * eval.c (most functions): Add parentheses to assignments used
11518         as truth values go avoid warnings from gcc -Wall.
11520         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
11521         any functions that don't need external scope.
11523         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
11524         (many functions and arrays): Declare `const'.
11526 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
11528         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
11529         removing the declaration from m4.h.  Also rename false to FALSE
11530         and true to TRUE.
11532         * lib/Makefile.in (Makefile): New goal.
11534         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
11535         so heavily loaded.  It gets more easily overridable, calling make.
11536         Reported by Jim Meyering.
11538         * Makefile.in (dist): Get .fname from the current directory name,
11539         instead of from version.h.  I need updating many files manually,
11540         when the version changes, version.h is just one of them.
11542 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
11544         * m4.h: Remove the tag `boolean' on the enum introducing typedef
11545         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
11546         Reported by Tom McConnell.
11548 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
11550         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
11551         39.cleardiv, which were describing missing or spurious newlines.
11552         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
11553         do not depend on machine word size, `/bin/false' implementation,
11554         or `wc' output format.  `make check' is more dependable, now.
11556         * checks/check_them: Summarize the failed tests by listing their
11557         name, at end.  If none, issue `All checks successful'.  Output
11558         `Checking' instead of `Input file:'.
11560         * checks/get_them, checks/check_them: Reindented.
11562         * Makefile.in (dist): chmod a+r before making the tar file.
11564 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
11566         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
11568         * input.c (next_token): Reinitialize token_buttom just after using
11569         it as a watermark with obstack_free.  Or else, a future token, big
11570         enough for triggering reallocation of the obstack chunk, could
11571         void the initialized value of token_buttom, later causing panic in
11572         obstack_free.  Rename token_buttom to token_bottom everywhere.
11574         * m4.h: Before declaring errno, first include <errno.h> and
11575         ensure that it does not define errno.
11576         Reported by Richard Stallman.
11578 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
11580         * builtin.c: Define and use DECLARE macro for builtins.
11582         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
11583         argument, this is a common idiom for introducing long comments.
11585         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
11586         arguments.  The last argument was silently ignored.
11588         * m4.c (cmd_error): Add a missing semicolon before va_end().
11590 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
11592         * Makefile.in: Now handle protoized sources.  Define and use U.
11593         Compile and use ansi2knr with old compilers.  Update DISTFILES.
11594         Add `aclocal.m4' to `configure' dependencies.
11595         * ansi2knr.c: New, from Ghostscript distribution.
11596         * configure.in: Define U through FP_PROTOTYPES for old compilers.
11597         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
11598         * aclocal.m4: New, provide FP_PROTOTYPES.
11599         * m4.h: Conditionnaly protoized through Args, save for varags.
11600         * builtin.c: Protoized.  Then:
11601         Include <sys/types.h> if size_t is not defined, before "regex.h".
11602         (m4_ifelse): Fetch built-in name properly for diagnostic.
11603         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
11604         (m4_regexp): Add const to `msg' declaration.
11605         (m4_patsubst): Add const to `msg' declaration.
11606         * debug.c: Protoized, save for varargs.
11607         * eval.c: Protoized.
11608         * format.c: Protoized.
11609         * input.c: Protoized.
11610         * m4.c: Protoized, save for varargs.  Then:
11611         (xfree): Accept void * instead of char *.
11612         (xmalloc): Return void * instead of char *.
11613         (xrealloc): Accept and return void * instead of char *.
11614         * macro.c: Protoized.
11615         * output.c: Protoized.
11616         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
11617         * symtab.c: Protoized.
11619 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
11621         * m4.texinfo: Remove directory from diagnostics in 30.include,
11622         51.eval, 56.errprint and 57.m4exit tests.
11624         * m4.h: Remove declarations for int or void system functions, they
11625         cause more conflicting trouble than they make good.
11627         * configure.in: Avoid configuration header file.  Add some tests.
11628         * m4.h: Remove #include "config.h".
11629         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
11630         Then, rewritten for better compliance with GNU standards.
11632 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
11634         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
11635         because of a misplaced #endif.
11637         * Many *.[hc] files: Correct intra-line spacing here and there,
11638         according to GNU indent 1.6 advice.
11640         * configure.in: New, using Autoconf 1.2.
11641         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
11642         * Delete old configure.in, configure, etc/configure.in,
11643         etc/configure, lib/configure.in, lib/configure and config/*.
11644         Reported by Jason Merrill.
11646         * symtab.c (hash): Change (char) NULL to '\0'.
11647         Reported by Jason Merrill.
11649         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
11650         etc/nextvers.sh.  Release numbers will be edited `by hand'.
11651         * version.h: De-automatize, force value in.
11653         * m4.c: Changes in order to use a newer getopt.h.
11654         Reported by David MacKenzie.
11656         * checks/: New name for examples/.
11657         * checks/get_them: New location for etc/get_examples.
11658         * checks/check_them: New location for etc/check_examples.
11659         * Makefile.in, checks/get_them, checks/check_them: Adjust.
11660         * lib/vfprintf.c: New location for etc/vfprintf.c.
11661         * Delete empty etc/.
11662         * examples/: New name for test/.
11664 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
11666         * Makefile.in (check): Add m4 as dependency.
11668         * m4.c: Accept --no-warnings instead of --no_warnings, and
11669         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
11670         usage message more informative.
11671         Reported by David MacKenzie.
11673 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
11675         * etc/check_examples: New name for check_examples.sh.
11676         * etc/get_examples: New name for get_examples.sh.
11677         * Makefile.in, etc/Makefile.in: Use new names.
11679         * Makefile.in: Transmit $(CC) while making in lib.
11681         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
11682         code disposition by hand.
11684 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
11686         * m4.h: Delete definitions for abort() and exit().
11687         Reported by Richard Stallman.
11689         * config/hmake-unicos, config/s-unicos.h: New files.
11690         Reported by Hal Peterson.
11692         * eval.c (exp_term): Have N^0 return 1.
11693         Reported by Michael Fetterman.
11695         * eval.c, input.c, m4.h: Remove last comma in enums.
11696         Reported by Mike Lijewski.
11698         * Transfer of maintenance duties from René to François.
11700 1991-10-24  René Seindal <seindal@diku.dk>
11702         * Release 1.0.  Many thanks to those, who provided me with bug
11703         reports and feedback.
11705         * Uses GNU configure, taken from the gdb distribution.
11707         * Uses GNU getopt(), with long option names.
11709         * The -Q/+quiet option is added, which suppresses warnings about
11710         missing or superflous arguments to built-in macros.
11712         * Added default options via the M4OPTS environment variable.
11714         * The built-in format can now be configured to use sprintf as
11715         the formatting engine, for systems without [efg]cvt(3).
11717         * GNU library code is moved to the ./lib subdirectory; other
11718         utility files are now in ./etc.
11720         * Several minor bugs have been fixed.
11722 1991-07-26  René Seindal <seindal@diku.dk>
11724         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
11725         François Pinard and Roland H. Pesch for providing me with reports.
11727         * The builtins incr and decr are now implemented without use of
11728         eval.
11730         * The builtin indir is added, to allow for indirect macro calls
11731         (allows use of "illegal" macro names).
11733         * The debugging and tracing facilities has been enhanced
11734         considerably.  See the manual for details.
11736         * The -tMACRO option is added, marks MACRO for tracing as soon
11737         as it is defined.
11739         * Builtins are traced after renaming iff they were before.
11741         * Named files can now be undiverted.
11743         * The -Nnum option can be used to increase the number of
11744         divertions available.
11746         * Calling changecom without arguments now disables all comment
11747         handling.
11749         * The function m4_patsubst() is now consistently declared
11750         static.
11752         * A bug in dnl is fixed.
11754         * A bug in the multi-character quoting code is fixed.
11756         * Several typos in the manual has been corrected.  More probably
11757         persist.
11759         * The m4.info file is now installed along with the program.
11761 1990-11-15  René Seindal <seindal@diku.dk>
11763         * Updated and enhanced version.  Release 0.75, manual 0.07.
11765         * Implemented search path for include files (-I option and
11766         M4PATH envronment variable).
11768         * Implemented builtin "format" for printf-like formatting.
11770         * Implemented builtin "regexp" for searching for regular
11771         expressions.
11773         * Implemented builtin "patsubst" for substitution with regular
11774         expressions.
11776         * Implemented builtin "esyscmd", which expands to a shell
11777         commands output.
11779         * Implemented "__file__" and "__line__" for use in error
11780         messages.
11782         * Implemented character ranges in "translit".
11784         * Implemented control over debugging output.
11786         * Implemented multi-character quotes.
11788         * Implemented multi-character comment delimiters.
11790         * Changed predefined macro "gnu" to "__gnu__".
11792         * Changed predefined macro "unix" to "__unix__", when the -G
11793         option is not used.  With -G, "unix" is still defined.
11795         * Changed "shift", "$@" and "$*" to not insert spaces afters
11796         commas.
11798         * Added program name to error messages.
11800         * Fixed two missing null bytes bugs.
11802 1990-01-22  René Seindal <seindal@diku.dk>
11804         * Initial beta release.  Release 0.50, manual 0.05.
11807         -----
11809         Local Variables:
11810         coding: utf-8
11811         End:
11813         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
11814         2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
11816         Copying and distribution of this file, with or without
11817         modification, are permitted provided the copyright notice
11818         and this notice are preserved.