Make gnulib a git submodule.
[m4.git] / ChangeLog
blob4c9c95a5a1863e72c333e1cf94180dfc45b0b1e1
1 2009-03-23  Eric Blake  <ebb9@byu.net>
3         Make gnulib a git submodule.
4         * .gitmodules: New file.
5         * gnulib: Record which version of gnulib has been tested.
6         * bootstrap: Aid in submodule usage.
7         * cfg.mk (gnulib_dir): Alter default location of gnulib.
8         * HACKING: Mention how to use submodule.
10 2009-03-21  Eric Blake  <ebb9@byu.net>
12         Use memcmp2 to simplify lexicographic comparisons.
13         * ltdl/m4/gnulib-cache.m4: Import memcmp2.
14         * modules/m4.c (dumpdef_cmp_CB): Use it.
16 2009-03-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
18         Fix m4.1 build race, exposed by parallelism through GNUmakefile.
19         * Makefile.am (SUBDIRS): Add doc.
20         (Documentation rules): Move ...
21         * doc/Makefile.am: ... to this new file.
22         * configure.ac (AC_CONFIG_FILES): Generate doc/Makefile.
24 2009-03-13  Eric Blake  <ebb9@byu.net>
26         Try to tolerate spaces in directory names in testsuite.
27         * tests/null.m4: Provide shell quoting, in case __program__
28         contains spaces.
30         Fix awk script portability.
31         * checks/get-them: In gsub, properly escape {.
32         Reported by Gary V. Vaughan.
34         Make bootstrap easier on Solaris.
35         * bootstrap: Add GNULIB_SRCDIR.  Useful when a wrapper script
36         gnulib-tool exists earlier on the path to work around /bin/sh
37         failure in parsing $GNULIB_SRCDIR/gnulib-tool.
39 2009-03-13  Eric Blake  <ebb9@byu.net>
41         Allow configuration choice in syscmd shell.
42         * ltdl/m4/m4-syscmd.m4: New file.
43         * configure.ac (M4_SYSCMD): Use it to provide
44         --with-syscmd-shell.
45         (AC_CHECK_HEADERS_ONCE): No longer need to worry about
46         <sys/wait.h>.
47         * modules/m4.c (syscmd): Use it to avoid hard-coding the shell
48         location.
49         * modules/gnu.c (esyscmd): Likewise.
50         * doc/m4.texinfo (Syscmd, Esyscmd): Document this.
51         * README: Document new configure option.
52         * NEWS: Likewise.
54         Use gnulib pipe module instead of popen(3).
55         * ltdl/m4/gnulib-cache.m4: Import pipe and wait-process modules.
56         * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS):
57         Delete.
58         (esyscmd): Rewrite with pipe module.
59         Resolves a failure on AIX, reported by Gary V. Vaughan.
61         Use gnulib execute module instead of system(3).
62         * ltdl/m4/gnulib-cache.m4: Import execute module.
63         * m4/utility.c (m4_info_name): New function.
64         * m4/m4module.h (m4_info_name): New prototype.
65         * modules/m4.c (syscmd): Rewrite with execute module.
66         (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS, m4_sysval): Move
67         computation...
68         * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS)
69         (esyscmd): ...here.
70         Resolves a failure on AIX, reported by Gary V. Vaughan.
72 2009-03-05  Eric Blake  <ebb9@byu.net>
74         Improve web-manual maintainer rule.
75         * maint.mk (web-manual): Factor package-specific detail...
76         * cfg.mk (manual_title): ...to new variable.
78 2009-02-23  Eric Blake  <ebb9@byu.net>
80         Speed up translit when from argument is short.
81         * modules/m4.c (translit): Use memchr2 when possible.
82         * tests/builtins.at (translit): Add tests.
83         * NEWS: Document this.
85 2009-02-18  Eric Blake  <ebb9@byu.net>
87         Prefer buffer over byte operations.
88         * modules/format.c (format): Use memchr for speed.
89         * modules/gnu.c (substitute): Likewise.
90         * m4/macro.c (locate_dollar): Inline into only caller...
91         (process_macro): ...and rearrange for readability.
92         * m4/input.c (consume_buffer): Allow C++ compilation.
93         * doc/m4.texinfo (Changesyntax): Enhance test.
95         Speed up esyscmd with buffer reads.
96         * modules/gnu.c (esyscmd): Read blocks directly into obstack,
97         rather than repeatedly reading bytes.  Detect read errors.
99         Avoid risk of stack overflow.
100         * m4/output.c (insert_file): Avoid stack allocation of large
101         buffer.
103         Synchronize THANKS with branch.
104         * THANKS: Import more names.
106         Improve handling of $ in syntax table.
107         * m4/m4module.h (m4_is_syntax_single_dollar): New function.
108         (M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
109         be context rather than basic syntax categories.
110         (M4_SYNTAX_MASKS): Adjust macro.
111         * m4/m4private.h (struct m4_syntax_table): Add dollar and
112         is_single_dollar members.
113         (m4_is_syntax_single_dollar): Add fast alternative.
114         * m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
115         account for change to context categories.
116         (m4_set_syntax): Manage is_single_dollar.
117         (m4_is_syntax_single_dollar): New function.
118         * m4/macro.c (locate_dollar): New helper function.
119         (process_macro): Use it to speed up macro expansion.
120         * m4/input.c (m4__next_token): Adjust client.
121         * doc/m4.texinfo (Changesyntax): Document this.
123 2009-02-17  Eric Blake  <ebb9@byu.net>
125         Sync changecom documentation with branch.
126         * doc/m4.texinfo (Changecom): Tweak wording.
127         * NEWS: Import changes from the branch.
129         Stage 29b: Process quotes and comments by buffer, not bytes.
130         Search for quote and comment delimiters by buffer when possible.
131         Memory impact: none.
132         Speed impact: noticeable improvement, from fewer function calls.
133         * ltdl/m4/gnulib-cache.m4: Import memchr2 module.
134         * m4/input.c (m4__next_token): Add buffer reads to quote and
135         comment parsing.
136         * NEWS: Document this.
138 2009-02-16  Eric Blake  <ebb9@byu.net>
140         Stage 29a: Process dnl and macro names by buffer, not bytes.
141         Enhance input engine to provide lookahead buffer, rather than
142         forcing clients to call next_char for every byte.  Utilize this
143         for the simplest clients.
144         Memory impact: none.
145         Speed impact: noticeable improvement, from fewer function calls.
146         * ltdl/m4/gnulib-cache.m4: Import freadptr and freadseek modules.
147         * m4/input.c (struct input_funcs): Add virtual functions
148         buffer_func and consume_func.
149         (file_buffer, file_consume, string_buffer, string_consume)
150         (composite_buffer, composite_consume, eof_buffer): Implement
151         them.
152         (file_funcs, string_funcs, composite_funcs, eof_funcs): Update
153         vtables accordingly.
154         (buffer_retry): New sentinel.
155         (next_buffer, consume_buffer): New functions.
156         (m4_skip_line, match_input, consume_syntax): Use them for faster
157         parsing.
158         Suggested by Bruno Haible.
160         Unify single and multi-character delimiter handling.
161         * m4/input.c (MATCH): Add a parameter.
162         (m4__next_token): Simplify logic and reduce redundancy.
163         (m4__next_token_is_open): Adjust caller.
164         * m4/syntax.c (m4_set_comment, m4_set_quotes): Handle delimiters
165         of differing lengths.
166         (m4_set_syntax): Recognize restoration of single delimiters.
168         Revamp changesyntax vs. changequote interactions.
169         * m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
170         (M4_SYNTAX_SUSPECT): New macro.
171         * m4/m4private.h (struct m4_syntax_table): Add suspect field.
172         * m4/syntax.c (check_is_single_quotes, check_is_single_comments)
173         (check_is_macro_escaped): Delete, by inlining body...
174         (m4_set_syntax): ...into here.  Improves handling between
175         changesyntax and changequote/changecom.
176         (add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
177         and let suspect field track needed cleanup.
178         (m4_set_quotes, m4_set_comment): Adjust meaning of
179         is_single_quotes and is_single_comment flags to always be true if
180         only one delimiter exists, regardless of its length.  Ensure that
181         the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
182         only used on 1-byte delimiters.
183         (add_syntax_attribute, remove_syntax_attribute): Change signature
184         to allow the use of fewer casts.  Adjust the suspect field when
185         necessary.
186         (m4_reset_syntax, set_quote_age): Adjust callers.
187         * m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
188         callers.
189         * doc/m4.texinfo (Changesyntax): Update documentation and tests.
191         Improve changesyntax documentation.
192         * doc/m4.texinfo (Changesyntax): Merge two tables into one
193         multitable.
195         Fix regression in multicharacter quotes, from 2008-01-26.
196         * m4/input.c (m4__next_token): Fix typo.
197         * tests/builtins.at (changequote): Enhance test.
199 2009-02-13  Eric Blake  <ebb9@byu.net>
201         Speed up parsing when detecting input file change.
202         * m4/input.c (next_char): Clear input_change flag.  Bug introduced
203         2006-10-25.
205 2009-02-12  Eric Blake  <ebb9@byu.net>
207         Avoid quadratic code when walking definition stack.
208         * examples/stack_sep.m4: Use linear, not quadratic
209         implementation.
210         * doc/m4.texinfo (Improved copy): Fix documentation, based on
211         recent autoconf bug fix.
212         * tests/others.at (recursion): Enhance test.
214 2009-02-11  Eric Blake  <ebb9@byu.net>
216         Stage 28c: Warn on embedded NUL in remaining cases.
217         Ensure all remaining warnings can handle embedded NUL.
218         Memory impact: none.
219         Speed impact: none noticed.
220         * m4/m4module.h (m4_debug_decode, m4_parse_truth_arg): Add
221         parameter.
222         * m4/macro.c (m4_macro_call): Improve diagnostic.
223         * modules/m4.c (defn): Likewise.
224         * m4/debug.c (m4_debug_decode): Handle embedded NUL.
225         * m4/utility.c (m4_parse_truth_arg): Likewise.
226         * modules/format.c (arg_int, arg_long, arg_double): Likewise.
227         (arg_string): New function.
228         (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Update callers.
229         * src/main.c (main): Likewise.
230         * src/freeze.c (reload_frozen_state): Likewise.
231         * modules/gnu.c (debugmode, syncoutput): Likewise.
232         * tests/options.at (--regexp-syntax): Adjust test.
233         * tests/freeze.at (reloading nul): Likewise.
234         * tests/null.m4: Likewise.
235         * tests/null.out: Likewise.
236         * tests/null.err: Likewise.
238         Stage 28b: Warn on embedded NUL in file arguments.
239         Quote warning messages related to file and other NUL-terminated
240         system commands.
241         Memory impact: none.
242         Speed impact: none noticed.
243         * m4/path.c (m4_path_search): Quote file names in message.
244         * modules/m4.c (syscmd, include, m4_make_temp): Handle embedded
245         NUL.
246         * modules/gnu.c (debugfile, esyscmd): Likewise.
247         * tests/others.at (nul character): Adjust test.
248         * tests/builtins.at (mkdtemp, mkstemp): Likewise.
249         * tests/null.m4: Likewise.
250         * tests/null.out: Likewise.
251         * tests/null.err: Likewise.
253         Stage 28a: Warn on embedded NUL in numeric arguments.
254         Quote warning messages related to numeric parsing in order to
255         handle embedded NUL.
256         Memory impact: none.
257         Speed impact: none noticed.
258         * m4/m4module.h (m4_numeric_arg): Adjust prototype.
259         * m4/utility.c (m4_numeric_arg): Add parameter.
260         * modules/gnu.c (debuglen): Adjust callers.
261         * modules/m4.c (incr, decr, divert, undivert, m4exit, substr)
262         (index): Likewise.
263         * modules/evalparse.c (m4_evaluate): Likewise.
264         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
265         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
266         Likewise.
267         * doc/m4.texinfo (Changesyntax): Fix typo.
268         * tests/others.at (nul character): Adjust test.
269         * tests/null.m4: Likewise.
270         * tests/null.out: Likewise.
271         * tests/null.err: Likewise.
273 2009-02-11  Eric Blake  <ebb9@byu.net>
275         Avoid regression in popdef(undef).
276         * doc/m4.texinfo (Trace): Enhance test, to cover regression
277         recently fixed on the branch.
279 2009-02-09  Eric Blake  <ebb9@byu.net>
281         Enhance index to support starting offset.
282         * modules/m4.c (index): Add optional third argument.
283         * NEWS: Document this.
284         * doc/m4.texinfo (Index macro): Likewise.
285         (Macro Arguments): Adjust tests.
287 2009-01-24  Eric Blake  <ebb9@byu.net>
289         Add URLs to --help output.
290         * src/main.c (usage): Use enhanced version-etc features.
292 2009-01-07  Eric Blake  <ebb9@byu.net>
294         Enhance substr to support replacement text.
295         * doc/m4.texinfo (Substr): Document new semantics.
296         * modules/m4.c (substr): Support optional fourth argument.
297         * NEWS: Document this.
299         Enhance substr to support negative values.
300         * doc/m4.texinfo (Substr): Document new semantics, and how to
301         simulate old.
302         * modules/m4.c (substr): Support negative values.
303         * NEWS: Document this.
305 2009-01-05  Eric Blake  <ebb9@byu.net>
307         Maintainer cleanups.
308         * HACKING: Remove mention of xdelta.
309         * Makefile.am (EXTRA_DIST, MAINTAINERCLEANFILES): Let gnulib take
310         care of distributing gendocs.sh.
311         * maint.mk (web-manual): Use new feature of gendocs.
312         * ltdl/m4/gnulib-cache.m4: Regenerate.
314 2008-12-24  Eric Blake  <ebb9@byu.net>
316         Relax eval as allowed by POSIX 2008.
317         * modules/evalparse.c (m4_evaluate): Warn, not error, on invalid
318         operator.  Quote expression in warning.
319         * modules/mpeval.c (includes): Add quotearg.h.
320         * doc/m4.texinfo (Eval, Improved forloop): Update tests.
321         * NEWS: Update to reflect 1.6 support for `?:'.
323 2008-12-23  Eric Blake  <ebb9@byu.net>
325         Add debugmode(o) to control dumpdef output location.
326         * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
327         (M4_DEBUG_TRACE_VERBOSE): Update.
328         * m4/debug.c (m4_debug_decode): Support new debug option.
329         * src/freeze.c (produce_debugmode_state): Likewise.
330         * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
331         than the debug file.
332         * src/main.c (usage): Document it.
333         * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
334         (Debugfile): Likewise.
335         * NEWS: Likewise.
336         Based on an autoconf bug report by Paolo Bonzini.
338         Make --debugfile argument optional.
339         * src/main.c (long_options): Make the argument optional, to allow
340         setting debug file back to stderr.
341         (main): Make --debugfile order-dependent.
342         (usage): Document this.
343         * doc/m4.texinfo (Debugging options): Likewise.
344         * NEWS: Likewise.
345         * tests/options.at (--debugfile): Enhance test.
346         (--safer): Adjust to new semantics.
348 2008-12-22  Eric Blake  <ebb9@byu.net>
350         Use @var correctly.
351         * doc/m4.texinfo (Operation modes, Preprocessor features)
352         (Limits control, Frozen state, Debugging options)
353         (Dynamic loading features): Use lower case names in @var.
354         (Improved copy): Use @code, not @var, as appropriate.
356 2008-12-18  Eric Blake  <ebb9@byu.net>
358         Deal with M4 1.4.x limitation on builtin tokens.
359         * doc/m4.texinfo (Composition): Mention limitation on curry.
360         (Improved copy): New node.
361         (Stacks): Fix typo.
362         * examples/stack.m4: Likewise.
363         * examples/stack_sep.m4: New file.
364         * Makefile.am (dist_pkgdata_DATA): Distribute it.
366 2008-12-15  Eric Blake  <ebb9@byu.net>
368         Double size of temp file cache.
369         * m4/output.c (tmp_file, tmp_file_owner): Split...
370         (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
371         two variables.
372         (tmp_file2_recent): New variable.
373         (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
374         (m4_output_exit): Adjust callers.
376         Use fewer seeks on cached files.
377         * m4/output.c (m4_tmpfile): Use write, not append mode.
378         (m4_tmpopen): Add parameter to decide when to skip seeks.
379         (m4_tmprename, m4_make_diversion, insert_diversion_helper)
380         (m4_freeze_diversions): Adjust callers.
382         Cache most recently spilled diversion.
383         * m4/output.c (tmp_file, tmp_file_owner): New variables, for
384         1-deep cache of spilled diversions.
385         (m4_tmpfile): Open in append mode, since we might revisit
386         diversion without closing it now.
387         (m4_tmpopen): Check cache first.
388         (m4_tmpclose): Update cache, rather than closing.  Add parameter.
389         (m4_tmpremove): Close cache before removing.
390         (m4_tmprename): Deal with open files when renaming.
391         (m4_output_exit): Close cache before exiting.
392         (make_room_for, m4_make_diversion, insert_diversion_helper):
393         Adjust callers.
394         * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
395         * configure.ac (M4_RENAME): Invoke it.
397         Correctly track size of in-memory diversions.
398         * m4/output.c (insert_diversion_helper): Correctly track total
399         in-memory diversion size after undivert.
401         Avoid quadratic behavior for some cases of divert/undivert.
402         * m4/output.c (struct m4_diversion): Improve comments.
403         (m4_tmpname, m4_make_diversion): Strengthen preconditions.
404         (m4_tmprename): New function.
405         (m4_output_init, m4_output_exit): Move after internal functions.
406         (make_room_for): Don't bother copying uninitialized bytes.
407         (insert_diversion_helper): Transfer metadata, rather than copying
408         contents, when undiverting into a previously unused diversion.
409         * tests/builtins.at (divert): Add a check to the test.
410         * doc/m4.texinfo (Undivert): Enhance test.
411         * NEWS: Document the speedup.
413 2008-12-02  Eric Blake  <ebb9@byu.net>
415         Stage 27: Allow embedded NUL in text processing macros.
416         Pass NUL through regular expressions, format, and translit, and
417         diagnose it in eval and changeresyntax.  Improve warning
418         capabilities of format.
419         Memory impact: none.
420         Speed impact: none noticed.
421         * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
422         (translit): Manage NUL bytes.
423         * modules/format.c (format): Likewise.
424         * modules/gnu.c (substitute, regexp_substitute): Likewise.
425         (m4_resyntax_encode_safe): Add parameter.
426         (regexp, patsubst, renamesyms): Update callers.
427         (regexp_compile): Adjust error message.
428         * modules/evalparse.c (m4_evaluate): Use consistent message.
429         (end_text): New variable.
430         (eval_init_lex): Add parameter.
431         (eval_lex): Detect embedded NUL.
432         * src/freeze.c (reload_frozen_state): Likewise.
433         * doc/m4.texinfo (Format): Update to cover new behavior.
434         (Eval): Mention that result is unquoted.
435         * tests/freeze.at (reloading nul): Enhance test.
436         * tests/null.m4: Likewise.
437         * tests/null.err: Update expected output.
438         * tests/null.out: Likewise.
439         * tests/options.at (--regexp-syntax): Likewise.
441 2008-11-28  Eric Blake  <ebb9@byu.net>
443         Resync NEWS with branches.
444         * NEWS: Mention 1.4.12, update state of 1.6.
446 2008-11-26  Eric Blake  <ebb9@byu.net>
448         Keep COPYING in repository.
449         * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
450         * .cvsignore: Don't ignore it.
451         * .gitignore: Likewise.
452         * COPYING: Store in repository, per automake 1.10.2
453         recommendation.
455 2008-11-26  Eric Blake  <ebb9@byu.net>
457         Document optimized forloop.
458         * doc/m4.texinfo (Improved forloop): Mention alternate style that
459         avoids define overhead.
460         * examples/forloop3.m4: New file.
461         * Makefile.am (dist_pkgdata_DATA): Distribute it.
463         Document copy composite using stack_foreach and curry.
464         * doc/m4.texinfo (Stacks): New node, to document pushdef stack
465         manipulation.
466         (Ifelse): Move define_blind...
467         (Composition): ...to this new node.  Document currying, then use
468         it to implement copy and rename.
469         * examples/curry.m4: New file.
470         * examples/stack.m4: Likewise.
471         * Makefile.am (dist_pkgdata_DATA): Distribute them.
473 2008-11-04  Eric Blake  <ebb9@byu.net>
475         Upgrade to FDL 1.3.
476         * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
477         * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
478         file change.
479         * doc/m4.texinfo (GNU Free Documentation License): Likewise.
481 2008-10-22  Eric Blake  <ebb9@byu.net>
483         Give nicer error if user modifies testsuite but lacks autoconf.
484         * Makefile.am (AUTOM4TE): Use missing in the definition.
486 2008-10-09  Eric Blake  <ebb9@byu.net>
488         Allow user to choose which sed to use in testsuite.
489         * tests/atlocal.in (SED): Inherit from configure results.
490         * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
491         (mkstemp, syscmd): Use $SED.
492         * tests/generate.awk (new_test): Likewise.
493         * tests/options.at (deprecated options, unknown option)
494         (--debugmode, --help and --version): Likewise.
495         * tests/testsuite.at (AT_CHECK_M4): Likewise.
496         * tests/others.at (directory, stderr closed, stdin seekable)
497         (stdout closed): Likewise.
498         (nul character): Likewise.  Also, skip test if sed can't handle
499         NUL bytes.
501         Clean up testsuite invocation.
502         * tests/atlocal.in: Fix copyright notice.
503         * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
504         (check-local, installcheck-local): Adjust clients.  Add missing
505         dependency.
507 2008-09-25  Eric Blake  <ebb9@byu.net>
509         Tweak error message on command line failure.
510         * m4/m4private.h (includes): Use "quotearg.h".
511         * src/main.c (process_file, main): Use nicer quotes for file name
512         in error messages.
513         * m4/input.c (file_clean, m4_push_file): Likewise.
514         * m4/module.c (m4__module_open): Likewise.
515         * src/freeze.c (produce_frozen_state, reload_frozen_state):
516         Likewise.
517         * modules/gnu.c (debugfile): Likewise.
518         * modules/m4.c (undivert, include): Likewise.
519         * tests/others.at (directory, stdin closed): Update tests.
520         * tests/options.at (file names, --debugmode): Likewise.
521         * doc/m4.texinfo (Debugmode): Likewise.
523         Unify error handling for reading directories.
524         * m4/path.c (m4_path_search): Factor open attempts...
525         (m4_fopen): ...into new function, to reject directories.
526         * tests/others.at (directory): Enhance test.
527         * doc/m4.texinfo (Include): Document that directories cannot be
528         input files.
530         Avoid bugs on platforms that mishandle trailing /.
531         * ltdl/m4/gnulib-cache.m4: Import fopen module.
532         * tests/others.at (directory): New test.
534 2008-09-16  Eric Blake  <ebb9@byu.net>
536         Fix bootstrap for Solaris /bin/sh.
537         * bootstrap: Avoid shell quoting pitfall.
539 2008-09-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
541         Typos in source code comments.
542         * modules/m4.c: Fix typos in comments.
543         * m4/input.c: Likewise.
544         * src/main.c: Likewise.
546 2008-08-29  Eric Blake  <ebb9@byu.net>
548         Fix manual date information.
549         * doc/m4.texinfo: UPDATED refers to the day the manual was built,
550         not the release date of M4.
551         Based on a bison patch by Akim Demaille.
553 2008-08-27  Eric Blake  <ebb9@byu.net>
555         Tweak -d examples.
556         * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
557         matters.
558         (Dumpdef): Fix typo.
560 2008-08-23  Eric Blake  <ebb9@byu.net>
562         Allow debugmode control over whether defn(undef) warns.
563         * ltdl/m4/gnulib-cache.m4: Import verify module.
564         * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
565         New values.
566         (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
567         * m4/m4.c (m4_create): Start with debugmode = d.
568         * src/main.c (usage): Mention this.
569         (main): Let -E impact debug mode.
570         * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
571         if flag is clear.
572         * modules/gnu.c (builtin, inder): Likewise.
573         * m4/debug.c (m4_debug_decode): Parse new mode.
574         * src/freeze.c (produce_debugmode_state): Accomodate new mode.
575         * doc/m4.texinfo (Debugging options): Mention change in the
576         default behavior.
577         (Debugmode): Mention new flag d.
578         (Operation modes): Mention interaction with -E.
579         (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
580         test its effect.
581         * tests/options.at (--debugmode): Update tests.
582         * tests/freeze.at (reloading debugmode): Likewise.
583         * NEWS: Document this.
584         Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
585         incompatible with Autoconf 2.62.
587 2008-08-22  Eric Blake  <ebb9@byu.net>
589         Improve --debugmode behavior.
590         * m4/m4module.h (m4_debug_decode): Simplify interface.
591         * m4/debug.c (m4_debug_decode): Remove parameter, and handle
592         setting the new value.
593         * modules/gnu.c (debugmode): Adjust caller.
594         * src/freeze.c (reload_frozen_state): Likewise.
595         * src/main.c (main): Likewise.
596         (usage): Fix default for --debug.
597         * doc/m4.texinfo (Debugging options): Add an example.
599 2008-08-21  Eric Blake  <ebb9@byu.net>
601         Avoid regression in defn(undef).
602         * doc/m4.texinfo (Trace): Enhance test, to cover regression
603         recently fixed on the branch.
605 2008-08-18  Eric Blake  <ebb9@byu.net>
607         Remove deprecated -N option; fixes a regression from 2006-09-14.
608         * src/main.c (DIVERSIONS_OPTION): Delete.
609         (long_options, OPTSTRING, main): Remove -N/--diversions option.
610         * doc/m4.texinfo (Limits control): Remove it from the manual.
611         * NEWS: Mention that it is gone.
612         * tests/options.at (deprecated options): Update test.
614         Improve 'git diff' of manual source.
615         * .gitattributes (*.texi*): Add diff attribute.
616         * bootstrap: Tell git how to use it.
617         Inspired by Jim Meyering's similar patch for coreutils.
619 2008-08-07  Bruno Haible  <bruno@clisp.org>  (tiny change)
621         Run m4 tests prior to gnulib unit tests.
622         * Makefile.am (SUBDIRS): Swap order of directories.
624 2008-08-03  Eric Blake  <ebb9@byu.net>
626         Stage 26: Allow embedded NUL in macro definitions.
627         Clean up final few locations that did not track macro definitions
628         by length, to allow embedded NUL.  Make m4_arg_len callers aware
629         of issue of flattening builtins when determining length.
630         Memory impact: none.
631         Speed impact: none noticed.
632         * m4/m4module.h (m4_arg_len): Add parameter.
633         (M4ARGLEN): Provide default for the parameter.
634         * m4/m4private.h (includes): Share xmemdup0.h among all libm4
635         files.
636         * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
637         * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
638         * m4/symtab.c (includes): Likewise.
639         (m4_symbol_value_copy): Use xmemdup0.
640         * m4/module.c (install_macro_table): Likewise.
641         * src/freeze.c (reload_frozen_state): Likewise.
642         * tests/freeze.at (reloading nul): Enhance test.
643         * tests/null.m4: Likewise.
644         * tests/null.err: Update expected output.
645         * tests/null.out: Likewise.
647         Fix regression in commenting unbalanced quotes, from 2008-02-16.
648         * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
649         * m4/input.c (m4__next_token, m4_print_token): Supply new token
650         type for comments.
651         * m4/macro.c (expand_token): Penalize comments, as they can
652         contain unbalanced quotes; latent bug since 2007-12-07, exposed by
653         passing $@ references built from comments.
654         (expand_argument): Adjust caller.
655         * tests/others.at (Comments): Enhance test to catch it.
656         * NEWS: Mention the fix.
658 2008-07-30  Eric Blake  <ebb9@byu.net>
660         Fix regression in trace output, introduced 2008-05-08.
661         * m4/input.c (m4__push_symbol): When cloning chains, break pointer
662         back to original chain; latent bug from 2008-02-02 that did not
663         cause misbehavior until trace output read unfinished chain.
664         * tests/builtins.at (debug): Add test for this.
666 2008-07-28  Eric Blake  <ebb9@byu.net>
668         Optimize iteration examples.
669         * examples/forloop2.m4: Avoid excess indir, by passing current
670         counter value as parameter.
671         * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
672         ignored argument.
673         * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
674         documentation to match.
676 2008-07-26  Eric Blake  <ebb9@byu.net>
678         Give example for O(n) foreach on m4 1.4.x.
679         * examples/foreachq4.m4: New file.
680         * Makefile.am (dist_pkgdata_DATA): Distribute it.
681         * tests/others.at (recursion): Test it.
682         * doc/m4.texinfo (Improved foreach): Document linear foreach with
683         m4 1.4.5 and greater.
685 2008-07-19  Eric Blake  <ebb9@byu.net>
687         Resynchronize docs from branch.
688         * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
689         name, particularly since the old documentation didn't match code.
690         (Standard Modules): Add caveat about using __m4_version__.
692 2008-07-11  Eric Blake  <ebb9@byu.net>
694         Bump required automake to 1.10a; regression introduced 2008-01-22.
695         * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
696         1.10.1, since we also rely on pkglibexecdir.
697         * HACKING: Fix minimum requirement.
698         * bootstrap: Likewise.
699         * THANKS: Update.
700         Reported by Joel E. Denny.
702         Avoid bogus whitespace in @ovar, @dvar.
703         * doc/m4.texinfo (ovar, dvar): Add @c.
704         Based on patch by Ralf Wildenhues to Autoconf manual.
706 2008-06-23  Eric Blake  <ebb9@byu.net>
708         Adjust to new gnulib-tool layout.
709         * ltdl/m4/gnulib-cache.m4: Reformat.
711         Fix bootstrap comment.
712         * bootstrap: DOWNLOAD_PO was previously removed.
714 2008-06-19  Eric Blake  <ebb9@byu.net>
716         Revert speed regression from 2008-06-16.
717         * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
718         * modules/m4.c (numb_obstack): Likewise.
719         * m4/input.c (MATCH): Use fewer conditionals, and factor
720         adjustment of S...
721         (match_input): ...here for smaller code size.
722         * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
723         Supply trailing NUL to delimiters, to meet contract of faster
724         MATCH.
726 2008-06-18  Eric Blake  <ebb9@byu.net>
728         Whitespace cleanup.
729         * m4/m4module.h: Use consistent spacing for pointer parameters.
730         * m4/m4private.h: Likewise.
732         Stage 25b: Handle embedded NUL in changesyntax and friends.
733         Track quote and comment delimiters by length, to allow embedded
734         NUL.  Improve changesyntax to support assigning syntax to NUL.
735         Memory impact: none.
736         Speed impact: none noticed.
737         * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
738         Add parameter.
739         (m4_reset_syntax): New prototype.
740         * m4/syntax.c (add_syntax_set, subtract_syntax_set)
741         (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
742         handle embedded NUL.
743         (m4_set_syntax): Likewise.  Also, split code to reset the table...
744         (m4_reset_syntax): ...into a new function.
745         (m4_syntax_create): Adjust callers.
746         * m4/input.c (match_input, MATCH): Add parameter.
747         (m4__next_token, m4__next_token_is_open): Adjust callers.
748         * modules/m4.h (m4_expand_ranges_func): Add parameter.
749         * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
750         (changequote, changecom, translit, m4_expand_ranges): Track
751         delimiter length.
752         * modules/gnu.c (changesyntax): Handle embedded NUL.
753         * src/freeze.c (reload_frozen_state): Adjust callers.
754         * tests/freeze.at (reloading nul): Enhance test.
755         * tests/null.m4: Likewise.
756         * tests/null.out: Update expected output.
757         * tests/null.err: Likewise.
759 2008-06-16  Eric Blake  <ebb9@byu.net>
761         Stage 25a: Use obstack_printf for easier output.
762         Convert macro tracing and other locations to use obstack_printf
763         rather than hand-rolled equivalents.  Ensure that embedded NUL in
764         trace output does not truncate the trace string.
765         Memory impact: none.
766         Speed impact: noticeable penalty, from obstack_printf overhead.
767         * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
768         * m4/macro.c (trace_format): Delete; use obstack_printf instead.
769         (trace_header, trace_pre, trace_post): All callers updated.
770         * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
771         (m4_divert_text): Speed up syncline output.
772         * modules/m4.c (dumpdef): Handle embedded NUL.
773         (numb_obstack): Speed up eval output.
774         (maketemp): Use obstack_printf.
775         * modules/format.c (format): Likewise.
777         Add missing const qualifications.
778         * m4/resyntax.c (m4_resyntax_map): Declare array elements as
779         const.
780         * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
781         * modules/import.c (m4_builtin_table): Likewise.
782         * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
783         * modules/m4.c (m4_builtin_table): Likewise.
784         * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
785         * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
786         * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
787         * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
788         * modules/stdlib.c (m4_builtin_table): Likewise.
789         * modules/time.c (m4_builtin_table): Likewise.
790         * modules/traditional.c (m4_macro_table): Likewise.
792 2008-06-10  Eric Blake  <ebb9@byu.net>
794         Avoid corrupted frozen file if NUL appears on block boundary.
795         * m4/output.c (insert_file): Separate consecutive quotearg blocks
796         with \<newline>, in case last byte of first block was NUL.
798 2008-06-03  Eric Blake  <ebb9@byu.net>
800         Fix printf type mismatches.
801         * m4/m4module.h (m4_bad_argc): Alter parameter type.
802         * m4/m4private.h (struct m4_call_info): Alter call_id type.
803         * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
804         specifiers.
805         * m4/utility.c (m4_bad_argc): Likewise.
807         Borrow bootstrap ideas from gnulib.
808         * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
809         advertized subset of languages didn't work.  Use --skip-po
810         instead, for consistency with gnulib bootstrap.
811         (func_get_translations): Use rsync, not wget.
812         (func_update_po): Use a reference directory, to avoid changing
813         timestamps on unchanged .po files.
814         * TODO: Update accordingly.
816         Fix fallout from previous patch.
817         * doc/m4.texinfo (Builtin): Adjust expected output.
819 2008-06-02  Eric Blake  <ebb9@byu.net>
821         Stage 24c: Improve display of macro names with embedded NUL.
822         Quote instances of problematic characters in macro names when
823         presented to user.  Track location via call_info rather than
824         munging context for every expansion.
825         Memory impact: none.
826         Speed impact: slight penalty, due to more bookkeeping.
827         * m4/m4module.h (m4_push_string_init): Add parameters.
828         * m4/m4private.h (struct m4_macro_args): Remove argv0 and
829         argv0_len, now redundant with info.
830         (m4__push_wrapup_init): Add parameter.
831         * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
832         location from caller, rather than context.
833         (composite_peek, composite_read, match_input): Adjust callers.
834         * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
835         (m4_verror_at_line): Allow NUL in macro name.
836         * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
837         in trace.
838         (expand_macro): No longer munge context location.
839         (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
840         (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
841         * modules/gnu.c (builtin, indir): Likewise.
842         * tests/null.m4: Enhance test.
843         * tests/null.err: Adjust expected output.
844         * tests/null.out: Likewise.
846         Stage 24b: Allow embedded NUL in macro names.
847         Use length rather than NUL-termination when tracking macro names.
848         All APIs dealing with symbol table changed.
849         Memory impact: none.
850         Speed impact: slight penalty, due to more bookkeeping.
851         * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
852         (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
853         (m4_symbol_rename, m4_symbol_delete): Add length parameter.
854         (m4_string): New type.
855         * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
856         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
857         length.
858         * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
859         (m4__symtab_remove_module_references, symbol_destroy_CB)
860         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
861         (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
862         (m4_symbol_delete): Likewise.
863         * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
864         passing length.
865         * m4/macro.c (expand_token): Adjust all callers.
866         * m4/module.c (install_builtin_table, install_macro_table):
867         Likewise.
868         * m4/utility.c (m4_symbol_value_lookup): Likewise.
869         * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
870         * modules/m4.c (define, undefine, pushdef, popdef)
871         (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
872         (traceon, traceoff): Likewise.
873         * src/main.c (main): Likewise.
874         * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
875         * tests/freeze.at (reloading nul): Augment test.
876         * tests/null.out: Adjust expected output.
878         Stage 24a: Use full call context in error reporting.
879         Replace const char *macro_name with const m4_call_info *call, so
880         that the next patch can pass the length of macro_name with
881         embedded NUL.  Simplifies handling of global state.
882         Memory impact: none.
883         Speed impact: none noticed.
884         * m4/m4module.h (m4_error, m4_warn): Change parameter type.
885         (m4_error_at_line, m4_warn_at_line): Delete.
886         (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
887         (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
888         * m4/m4private.h (m4__next_token): Likewise.
889         * m4/utility.c (m4_verror_at_line): Alter parameter, and use
890         caller's location if caller is provided.
891         (m4_error, m4_warn): Change parameter type.
892         (m4_error_at_line, m4_warn_at_line): Delete.
893         (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
894         (m4_symbol_value_lookup): Adjust all callers.
895         * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
896         * m4/input.c (m4_skip_line, m4__next_token): Likewise.
897         * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
898         (process_macro): Likewise.
899         * modules/m4.h (m4_make_temp_func): Likewise.
900         * modules/evalparse.c (m4_evaluate): Likewise.
901         * modules/format.c (arg_int, arg_long, arg_double, format):
902         Likewise.
903         * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
904         (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
905         (renamesyms, syncoutput, regexp_compile, substitute)
906         (regexp_substitute, m4_resyntax_encode_safe): Likewise.
907         * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
908         (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
909         (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
910         Likewise.
911         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
912         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
913         Likewise.
914         * tests/options.at (--syncoutput): Add test for invalid
915         command-line argument.  Split xfailed portion...
916         (--syncoutput and diversions): ...into new test.
917         (unknown option): New test.
918         * tests/freeze.at (reloading unknown builtin): Update expected
919         output.
921         Adjust to recent gnulib change.
922         * configure.ac (AB_INIT): Delete, now that gnulib does this.
924 2008-05-28  Eric Blake  <ebb9@byu.net>
926         Improve frozen debugmode behavior.
927         * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
928         * src/main.c (main): Interleave -d with files.
929         * tests/options.at (--debugmode): Update test.
930         * tests/freeze.at (reloading debugmode): New test.
931         * doc/m4.texinfo (Debugging options, Debugmode): Document the
932         change.
933         * NEWS: Likewise.
935 2008-05-27  Eric Blake  <ebb9@byu.net>
937         Fix some testsuite failures on Solaris 8.
938         * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
939         broken.
940         * tests/others.at (stderr closed): Likewise.  Also support Solaris
941         wording for EBADF.
942         (stdin closed): Skip test if closed stdin gets reopened.
943         (stdout closed): Support Solaris wording for EBADF.
944         * tests/testsuite.at (AT_CHECK_M4): Likewise.
946         Fix configure message nesting, broken since 2001-09-20.
947         * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
948         not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
950         Support 'make dist' with BSD make.
951         * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
952         of the generated file tests/generated.at.
953         (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
954         * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
956 2008-05-24  Eric Blake  <ebb9@byu.net>
958         Test NUL in frozen files.
959         * tests/testsuite.at (AT_CHECK_M4): Add parameter.
960         * tests/freeze.at (reloading nul): New test.
961         (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
962         (reloading unknown builtin): Likewise.
964 2008-05-23  Eric Blake  <ebb9@byu.net>
966         Improve handling of frozen file errors.
967         * src/freeze.c (produce_frozen_state): Detect write failures.
968         (reload_frozen_state): Use close_stream.
969         * tests/freeze.at (freezing failure): New test.
970         * THANKS: Update.
971         Reported by Jean-Charles Longuet.
973 2008-05-19  Eric Blake  <ebb9@byu.net>
975         In frozen file, split consecutive strings with newline.
976         * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
977         (produce_frozen_state): Likewise for 'Q', 'C'.
978         (reload_frozen_state): Parse the new layout.
979         [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
980         * tests/freeze.at (loading format 2): Rewrite to new format.
981         (reloading unknown builtin): Likewise.
982         (loading format 1): Make sure backslash-newline is not
983         interpreted.
984         * doc/m4.texinfo (Frozen file format 2): Document the format.
985         * NEWS: Document this change.
987         Fix xgettext options.
988         * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
989         xgettext.
991         Fix spelling of René Seindal's name in --version output.
992         * ltdl/m4/gnulib-cache.m4: Import propername module.
993         * src/main.c (AUTHORS): Rewrite in terms of proper_name.
994         * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
995         * HACKING: Mention new prerequisite of gperf.
997 2008-05-18  Eric Blake  <ebb9@byu.net>
999         Allow freezing the trace status of macros.
1000         * src/freeze.c (produce_symbol_dump): Let undefined traced macros
1001         through.
1002         (dump_symbol_CB): Also freeze trace state.
1003         * tests/freeze.at (reloading traced macros): New test.
1004         * doc/m4.texinfo (Using frozen files): Update documentation to
1005         mention new state.
1006         (Frozen file format 1): Improve synchronization with branch.
1007         (Frozen file format 2): Reorder directives, and add `d', `t'.
1008         * NEWS: Document this change.
1010 2008-05-15  Eric Blake  <ebb9@byu.net>
1012         Fix frozen file regression in pushdef stacks from 2001-09-01.
1013         * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
1014         just the current definition.
1015         (reverse_symbol_value_stack): New helper method.
1016         * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
1017         (reloading pushdef stack): New test.
1018         (reloading unknown builtin): Enhance test.
1020 2008-05-13  Eric Blake  <ebb9@byu.net>
1022         Fix frozen file regression in diversions from 2007-01-21.
1023         * m4/output.c (insert_diversion_helper): Add parameter.
1024         (m4_insert_file): Move contents...
1025         (insert_file): ...to this new helper, with added parameter.
1026         (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
1027         Update callers.
1028         * src/freeze.c (produce_mem_dump): Simplify.
1029         * tests/freeze.at (large diversion): Test for this.
1031         Improve error message when frozen file is invalid.
1032         * src/freeze.c (decode_char): Add parameter.  Allow \<newline>
1033         line continuations.
1034         (reload_frozen_state): Track current line.
1035         * tests/freeze.at (loading format 1, loading format 2): Update to
1036         test this.
1038 2008-05-10  Eric Blake  <ebb9@byu.net>
1040         Detect integer overflow when loading frozen file.
1041         * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
1042         immediately on overflow.
1043         * tests/freeze.at (loading format 2): Test this.
1044         Reported by Jim Meyering.
1046 2008-05-08  Eric Blake  <ebb9@byu.net>
1048         Stage 23: allow tracing of indirect macro calls.
1049         Track all trace information as part of the argv struct, rather
1050         than temporarily resetting global state.  Teach indir to trace
1051         macros that it invokes.
1052         Memory impact: slight penalty, due to larger argv struct.
1053         Speed impact: none noticed.
1054         * m4/m4module.h (m4_input_block): Remove.
1055         (m4_call_info): New opaque type.
1056         (m4_trace_prepare, m4_arg_info): New prototypes.
1057         (m4_macro_call, m4_push_string_finish, m4_input_print): Change
1058         prototypes.
1059         * m4/m4private.h (struct m4_macro_args): Add info field.
1060         (struct m4_call_info): New structure.
1061         (m4_arg_info): New accessor.
1062         * m4/input.c (m4_input_block): Make typedef local.
1063         (m4_push_string_init): Initialize length.
1064         (m4_push_string_finish, m4_input_print): Change signature, so that
1065         printing can be done before finalization.
1066         (struct input_funcs): Add parameter to print_func.
1067         (file_print, string_print, composite_print): Adjust accordingly.
1068         * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
1069         Change signatures for stacked trace messages, and for using call
1070         context.
1071         (trace_prepre): Export and rename...
1072         (m4_trace_prepare): ...to this, for use by indir.  Alter signature
1073         to use call context.
1074         (collect_arguments): Alter signature, to manage new field.
1075         (expand_macro): Change call context management.  Move tracing...
1076         (m4_macro_call): ...here.  Remove redundant parameter.
1077         (m4_arg_argc): New function.
1078         (m4_make_argv_ref): Replace unused skip parameter with new trace
1079         parameter; manage new field.
1080         * modules/gnu.c (builtin, indir): Adjust callers.
1081         * src/main.c (usage): Update debugmode flag summary.
1082         * tests/null.m4: Enhance test.
1083         * tests/null.err: Update expected output.
1084         * tests/macros.at (Tracing Hanoi Towers): Likewise.
1085         * doc/m4.texinfo (Trace): Mention more about trace formatting.
1086         (Debugmode): Enhance description of 'c' and 'x'.  Enhance test to
1087         cover line numbering details in traces.
1088         (Debuglen): Enhance test to cover indir tracing.
1089         * NEWS: Mention these changes.
1090         Reported by Akim Demaille in the autoconf TODO file in 2000.
1092 2008-05-07  Eric Blake  <ebb9@byu.net>
1094         Test for traceon regression just fixed in branch-1.6.
1095         * doc/m4.texinfo (Trace): Enhance test.
1096         * NEWS: Port news item from branch.
1098 2008-05-05  Eric Blake  <ebb9@byu.net>
1100         Stage 22: allow builtin token concatenation outside $@.
1101         Adjust the input and argument parsing engines to append builtins
1102         alongside text.  Make define warn when builtins must be
1103         flattened.
1104         Memory impact: slight penalty, with fewer builtins flattened.
1105         Speed impact: slight penalty, from more bookkeeping.
1106         * m4/m4module.h (m4_is_arg_composite): New prototype.
1107         (m4_symbol_value_copy): Change return type.
1108         (m4_arg_text): Add parameter.
1109         (M4ARG): Adjust callers.
1110         * m4/m4private.h: Adjust comments.
1111         * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
1112         flattened.
1113         * m4/input.c (init_builtin_token): Add parameter, and allow
1114         concatenating builtins.
1115         (m4__next_token): Adjust caller.
1116         * m4/macro.c (m4_is_arg_composite): New function.
1117         (expand_argument): Allow builtin concatenation.
1118         (m4_arg_text): Add parameter.
1119         (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
1120         (m4_arg_equal): Fix comparison of builtin tokens.
1121         * modules/m4.c (define, pushdef): Warn when flattening builtins.
1122         * doc/m4.texinfo (Define): Remove dead comment.
1123         (Defn): Update to reflect code changes.
1124         * tests/builtins.at (defn): Remove xfail.
1125         * NEWS: Document this change.
1127 2008-05-03  Eric Blake  <ebb9@byu.net>
1129         Document define_blind.
1130         * doc/m4.texinfo (Ifelse): Add a new composite macro.
1131         * THANKS: Update.
1132         Suggested by Mike R.
1134 2008-05-01  Eric Blake  <ebb9@byu.net>
1136         Avoid -Wshadow compiler warnings.
1137         * m4/output.c (threshold_diversion_CB): s/div/diversion/.
1138         * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
1139         (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
1140         (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
1141         (m4_push_arg, m4__push_arg_quote): s/index/arg/.
1142         * modules/format.c (format): Likewise.
1143         * modules/m4.c (ifelse): Likewise.
1145         Improve debugmode testing, based on recent branch-1.6 regressions.
1146         * doc/m4.texinfo (Debugmode): Enhance tests.
1147         * tests/generate.awk: Run tests from stdin, not input.m4.  Support
1148         stderr munging when using -I examples.
1150         Fix regression in define from 2008-02-22.
1151         * m4/m4module.h (m4_symbol_value_copy): Add parameter.
1152         * m4/symtab.c (m4_symbol_value_copy): Support copying $@
1153         back-references.
1154         * m4/macro.c (expand_argument): Update callers.
1155         * modules/m4.c (define, pushdef): Likewise.
1156         * tests/builtins.at (define): Enhance test to catch this.
1158 2008-04-21  Eric Blake  <ebb9@byu.net>
1160         Simplify previous patch.
1161         * tests/m4.in: Compress assignment.
1162         Suggested by Gary V. Vaughan.
1164         Fix --disable-shared testsuite regression from previous patch.
1165         * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
1166         will also work.
1168         Fix spelling of attribution to Christopher Strachey.
1169         * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
1170         * THANKS: Update.
1171         Reported by Fernando Carrijo.
1173 2008-04-17  Eric Blake  <ebb9@byu.net>
1175         Fix testsuite bug when SIGPIPE is ignored.
1176         * tests/builtins.at (divert): Consume all of m4's output, to avoid
1177         spurious write failure.
1178         * src/main.c (main): In batch mode, restore default handling of
1179         SIGPIPE.
1180         * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
1181         * THANKS: Update.
1182         Reported by Bob Proulx, via his autobuilder.
1184 2008-04-15  Eric Blake  <ebb9@byu.net>
1186         Fix 'make installcheck' after './configure --prefix-progname'.
1187         * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
1188         program name.
1189         (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
1190         * tests/builtins.at (patsubst): Avoid space-tab.
1191         (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
1192         * tests/options.at (--debugfile): Likewise.
1193         * tests/others.at (stdin seekable): Likewise.
1194         (fstab): Avoid space-tab.
1195         * Makefile.am (installcheck-local): Accomodate transformed name.
1196         (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
1197         during 'make distcheck'.
1198         * cfg.mk: New file, borrowed from branch.
1200         Update prerequisite tools to match recent releases.
1201         * configure.ac (AC_PREREQ): Rely on released autoconf.
1202         (LT_PREREQ): Rely on released libtool.
1203         * tests/testsuite.at (m4_version_prereq): Update dependence.
1204         * bootstrap: Mention prerequisites.
1206         Work around OS/2 limitation of printf(1).
1207         * tests/null.m4: Use m4, not printf, to generate NUL byte.
1208         * tests/null.out: Check for esyscmd failure.
1209         Reported by Elbert Pol.
1211 2008-04-14  Eric Blake  <ebb9@byu.net>
1213         Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
1214         Improve arg_print to handle builtin tokens when printing to a
1215         known chain, rather than always flattening builtins.  This allows
1216         m4wrap and $@ back-references to handle embedded builtin tokens.
1217         Memory impact: none.
1218         Speed impact: slight penalty, from more bookkeeping.
1219         * m4/m4module.h (m4_push_builtin): Add parameter.
1220         (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
1221         (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
1222         * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
1223         (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
1224         ...to these, in some cases adding a parameter.
1225         (m4__append_builtin): New prototype.
1226         * m4/builtin.c (m4_builtin_print): Alter signature to print
1227         builtin to a growing symbol chain.
1228         * m4/symtab.c (m4__symbol_value_print): Alter signature.
1229         (m4_symbol_print, dump_symbol_CB): Adjust callers.
1230         * m4/input.c (builtin_peek, builtin_read, builtin_unget)
1231         (builtin_print, builtin_funcs): Delete, handled via composite
1232         blocks now.
1233         (struct m4_input_block): Delete u.builtin member.
1234         (init_builtin_token): Only use composite block.
1235         (m4__append_builtin): New function.
1236         (m4_push_builtin, m4__push_wrapup_init): Alter signature.
1237         (m4__push_symbol): Allow builtin tokens.
1238         (m4__push_wrapup_finish): Rename.
1239         (composite_print, m4_print_token): Adjust callers.
1240         * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
1241         tokens.
1242         (m4__arg_print): Alter signature.
1243         (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
1244         callers.
1245         * modules/m4.c (m4wrap): Allow builtin tokens.
1246         (defn, errprint): Adjust callers.
1247         * modules/gnu.c (builtin): Likewise.
1248         * doc/m4.texinfo (M4wrap): New test.
1249         (Debuglen): Adjust expected output.
1251         Stage 21a: Optimize checks for end of input.
1252         Create a new polymorphic input block type, which always fails with
1253         CHAR_EOF, so that remaining input routines no longer have to check
1254         for NULL input block.
1255         Memory impact: none.
1256         Speed impact: noticeable improvement, from fewer conditionals.
1257         * m4/input.c (eof_funcs, input_eof): New objects.
1258         (eof_peek, eof_read, eof_unget): New functions.
1259         (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
1260         (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
1261         (m4_input_exit): Use placeholder to guarantee non-NULL isp and
1262         wsp.
1263         (next_char): Rename retry to allow_unget, and change sense for
1264         easier manipulation.  All callers changed.
1266         Improve OS/2 detection.
1267         * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
1268         are defined, not just the first.  The testsuite ensures that
1269         exactly one gets defined.
1270         * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
1271         what other pre-defined macros it has.
1272         * THANKS: Update.
1273         Reported by Elbert Pol.
1275         Ensure __m4_version__ is unquoted.
1276         * tests/builtins.at (__m4_@&t@version__): Augment test.
1278         Avoid GNU make failure on tarball.
1279         * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
1281 2008-04-10  Eric Blake  <ebb9@byu.net>
1283         Allow back-referenced macro names; fixes 2008-03-13 regression.
1284         * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
1285         * m4/utility.c (m4_symbol_value_lookup): Change signature.
1286         * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
1287         Adjust all callers.
1288         * tests/others.at (ifndef): New test.
1290         Be namespace clean for M4 version; fixes 2008-04-08 regression.
1291         * configure.ac (version): Rename...
1292         (M4_VERSION): ...to this, since using 'version' broke po.m4.
1294 2008-04-09  Eric Blake  <ebb9@byu.net>
1296         Mention 1.4.11 release.
1297         * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
1298         (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
1299         (Format): Add test of C99 hex-float parsing.
1300         * NEWS: Mention 1.4.11 release.
1301         * tests/builtins.at (divert): Add additional test.
1303 2008-04-08  Eric Blake  <ebb9@byu.net>
1305         Overhaul inter-version releases to work with git.
1306         * configure.ac (version): New variable, which has nicer version
1307         contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
1308         (TIMESTAMP): Delete, since CVS id expansion died with transition
1309         to git.
1310         (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
1311         * build-aux/mkstamp: Delete, no longer used.
1312         * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
1313         rebuilds when timestamps don't matter.
1314         (MKSTAMP): Delete, no longer used.
1315         (EXTRA_DIST): No longer worry about mkstamp.
1316         (.version): New rule and distributed file.
1317         (doc/m4.1, tests/package.m4): Depend on .version, not
1318         configure.ac, for timestamp.
1319         * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
1320         * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
1321         * src/main.c (main): Likewise.
1323 2008-03-28  Eric Blake  <ebb9@byu.net>
1325         Use GNUmakefile module.
1326         * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1327         * Makefile.am: Split off maintainer rules...
1328         * maint.mk: ...into this new file.
1330 2008-03-18  Eric Blake  <ebb9@byu.net>
1332         Stage 20b: make m4wrap obey POSIX fifo ordering.
1333         Improve input engine to support location changes within symbol
1334         chains, then convert m4wrap to always build symbol chain.
1335         Memory impact: none.
1336         Speed impact: slight penalty, from more m4wrap bookkeeping.
1337         * m4/m4module.h (m4_wrap_args): Add prototype.
1338         * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1339         (struct m4__symbol_chain): Add struct u_l.
1340         * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1341         new link type.
1342         (composite_peek, composite_read, composite_clean): Handle location
1343         link.
1344         * m4/macro.c (m4_wrap_args): New function.
1345         * modules/m4.c (m4wrap): Use it.
1346         * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1347         (Extensions): Document extension of multiple arguments.
1348         (Location, Improved m4wrap): Adjust example to match FIFO order.
1349         * tests/builtins.at (wrap): Likewise.
1350         * NEWS: Document this change.
1352 2008-03-17  Eric Blake  <ebb9@byu.net>
1354         Stage 20a: reduce unget's in input engine.
1355         Now that out-of-range input placeholders like CHAR_BUILTIN are
1356         consumed outside of next_char, next_token should always consume
1357         rather than peek at the first character.  Fewer peeks results in
1358         less ungetc overhead.
1359         Memory impact: none.
1360         Speed impact: noticeable improvement, from fewer function calls.
1361         * m4/input.c (struct input_funcs): Alter read_func prototype.
1362         (next_char, file_read, buildin_read, string_read, composite_read):
1363         Add allow_argv parameter.
1364         (init_builtin_token, init_argv_symbol): Require all prior input to
1365         be consumed.
1366         (m4_skip_line, match_input, consume_syntax): Adjust callers.
1367         (m4__next_token): Consume first byte without peek.
1369         Update for fresh bootstrap.
1370         * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1372 2008-03-15  Eric Blake  <ebb9@byu.net>
1374         Document join, in order to fix bug in m4wrap example.
1375         * examples/join.m4: New file.
1376         * examples/wraplifo2.m4: Likewise.
1377         * Makefile.am (EXTRA_DIST): Add new files.
1378         * doc/m4.texinfo (Improved m4wrap): New node.
1379         (Defn, Location): Enhance tests.
1380         (Shift): Document the composite macro join.
1381         (Incompatibilities): Move documentation of LIFO vs. FIFO...
1382         (M4wrap): ...here, to match improved example.
1384 2008-03-13  Eric Blake  <ebb9@byu.net>
1386         Stage 19c: allow builtin tokens in more macros.
1387         Allow builtin tokens inside symbol chains, although for now, they
1388         are not allowed inside comments or quotes.  Enable builtin token
1389         handling in more macros, if only to consistently diagnose invalid
1390         macro names.
1391         Memory impact: none.
1392         Speed impact: slight impact, due to more bookkeeping.
1393         * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1394         prototypes.
1395         * m4/m4private.h (enum m4__symbol_chain_type): Add
1396         M4__CHAIN_FUNC.
1397         (struct m4__symbol_chain): Add builtin member.
1398         * m4/utility.c (m4_symbol_value_lookup): New method.
1399         * m4/builtin.c (m4_builtin_print): New function.
1400         * m4/symtab.c (m4_symbol_value_print): Use it.
1401         * m4/input.c (builtin_print): Likewise.
1402         (m4__push_symbol): Allow pushing builtin tokens.
1403         (composite_peek, composite_read, composite_unget, composite_clean)
1404         (composite_print): Handle builtin tokens.
1405         (init_builtin_token): Allow builtin tokens from composite input.
1406         (m4__next_token): Flatten builtins inside comment or string.
1407         * m4/macro.c (expand_argument): Strengthen assertion.
1408         (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1409         Handle builtin tokens.
1410         (arg_symbol): Add parameter, and allow NULL level.
1411         (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1412         (m4_arg_text): Ensure all builtins have been flattened.
1413         * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1414         (undefine, m4_dump_symbols): Warn on invalid macro names.
1415         (ifdef, ifelse, shift): Handle builtin tokens.
1416         * modules/gnu.c (m4symbols): Likewise.
1417         * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1418         behavior.
1419         (Debuglen): Likewise, and remove xfail.
1420         * NEWS: Mention the change.
1422         Stage 19b: invert sense of bit for handling builtin tokens.
1423         Pass builtin tokens by default, rather than as the exception, so
1424         that the logic can consistently refer to flattening arguments.
1425         Memory impact: none.
1426         Speed impact: none.
1427         * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1428         (M4_BUILTIN_GROKS_MACRO): Rename...
1429         (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1430         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1431         (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1432         this.
1433         * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1434         (m4_symbol_value_groks_macro): Likewise...
1435         (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1436         this.
1437         * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1438         (m4_symbol_value_flatten_args): ...to this.
1439         * m4/macro.c (collect_arguments): Accomodate changed sense.
1440         * m4/module.c (m4__module_open): Require arguments if flattening
1441         is requested.
1442         * m4/input.c (m4_push_string_finish): For now, flatten all
1443         builtins pushed as back-references.
1444         * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1445         * modules/import.c (m4_builtin_table): Likewise.
1446         * modules/load.c (m4_builtin_table): Likewise.
1447         * modules/modtest.c (m4_builtin_table): Likewise.
1448         * modules/mpeval.c (m4_builtin_table): Likewise.
1449         * modules/perl.c (m4_builtin_table): Likewise.
1450         * modules/shadow.c (m4_builtin_table): Likewise.
1451         * modules/stdlib.c (m4_builtin_table): Likewise.
1452         * modules/time.c (m4_builtin_table): Likewise.
1453         * modules/m4.c (m4_builtin_table): Likewise.
1454         (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1455         are stringized without preprocessor expansion.
1456         * doc/m4.texinfo (Defn): Update comments to match reality.
1457         (Debuglen): Update test now that user macros pass builtin tokens.
1459         Stage 19a: sort and cache builtins loaded by a module.
1460         Rather than repeatedly using dlsym to browse the builtin table,
1461         copy off the table at module load time.  Then, the input engine
1462         merely refers to the copy instead of duplicating information.
1463         Memory impact: slight penalty, due to more memory per module, but
1464         offset by less memory in input engine.
1465         Speed impact: slight improvement, due to faster builtin lookups.
1466         * m4/m4module.h (m4_set_symbol_value_builtin): Delete.  Use
1467         m4_builtin_find_by_* instead.
1468         (m4_builtin_find_by_func): Change return type.
1469         * m4/m4private.h (m4__builtin): New struct.
1470         (m4_module): Add sorted list of loaded builtins.
1471         (struct m4_symbol_value): Change type of builtin value.
1472         (m4__set_symbol_value_builtin): New prototype and fast accessor.
1473         (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1474         new field type.
1475         * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1476         (m4__set_symbol_value_builtin): ...and populate additional fields,
1477         based on new type.
1478         (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1479         new field type.
1480         * m4/module.c (install_builtin_table): Use cached table.
1481         (compare_builtin_CB): New helper function.
1482         (m4__module_open): Populate table.
1483         (module_remove): Free table.
1484         * m4/builtin.c (compare_builtin_name_CB): New helper function.
1485         (m4_builtin_find_by_name): Rewrite to use sorted table.
1486         (m4_builtin_find_by_func): Change return type.
1487         * m4/input.c (struct m4_input_block): Simplify u_b, since most
1488         fields can be determined from builtin.
1489         (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1490         (m4__next_token): Alter parsing so that only init_builtin_token
1491         consumes a builtin.
1492         (builtin_print, m4_push_builtin): Adjust all users.
1493         * tests/macros.at (Arity, defn, and freeze): Fix typo.
1495         Consistently cast malloc results, for C++ compilation.
1496         * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1497         * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1498         (m4_hash_resize, maybe_grow): Likewise.
1499         * m4/m4.c (m4_create): Likewise.
1500         * m4/macro.c (expand_macro): Likewise.
1501         * m4/output.c (m4_tmpname): Likewise.
1502         * m4/path.c (search_path_add): Likewise.
1503         * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1504         (symtab_fetch): Likewise.
1505         * m4/syntax.c (m4_syntax_create): Likewise.
1506         * modules/gnu.c (regexp_compile): Likewise.
1507         * src/main.c (main): Likewise.
1508         * src/freeze.c (reload_frozen_state): Likewise.
1510 2008-03-06  Eric Blake  <ebb9@byu.net>
1512         Fix nested builtin(`shift',$@) regression from 2008-02-23.
1513         * m4/macro.c (make_argv_ref): Don't output expansion text when
1514         making wrapper for builtin or indir.
1515         * tests/builtins.at (builtin): New test.
1516         * NEWS: Document the fix.
1517         Reported by Andreas Schwab.
1519 2008-03-04  Eric Blake  <ebb9@byu.net>
1521         The gnulib module free was deprecated.
1522         * ltdl/m4/gnulib-cache.m4: Remove free module.
1524 2008-02-29  Eric Blake  <ebb9@byu.net>
1526         Import news from 1.4.10b.
1527         * NEWS: Update from branch.
1529 2008-02-23  Eric Blake  <ebb9@byu.net>
1531         Stage 18: try harder to reuse argv in recursion.
1532         When pushing arguments that contain an existing $@ ref, reuse the
1533         ref rather than creating another layer of wrappers.
1534         Memory impact: noticeable improvement, due to better $@ reuse.
1535         Speed impact: noticeable improvement, due to O(n^2) to O(n)
1536         reduction in unboxed recursion.
1537         * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1538         (m4_push_args): Let make_argv_ref take care of pending data.
1539         * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1540         performance capability.
1541         * tests/others.at (recursion): Add tests to avoid performance
1542         regression.
1544 2008-02-22  Eric Blake  <ebb9@byu.net>
1546         Update NEWS.
1547         * NEWS: Document change to __gnu__ on 2008-02-11.
1549         Stage 17: pass argv through quoted strings.
1550         Allow the concatenation of $@ references with other text input
1551         inside quoted contexts, which requires distinguishing between a
1552         wrapper around many arguments vs. a reference serving as part of a
1553         single argument.  Also optimize based on whether argv contains
1554         builtin tokens that might need flattening to the empty string.
1555         Memory impact: noticeable improvement, due to O(n^2) to O(n)
1556         reduction from total reuse of $@ references.
1557         Speed impact: noticeable improvement, due to O(n^2) to O(n)
1558         reduction in boxed recursion.
1559         * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1560         (M4ARGLEN): Adjust definition.
1561         * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1562         (struct m4_symbol_value): Add wrapper and has_func members.
1563         (struct m4_macro_args): Add flatten and has_func members.
1564         * m4/input.c (append_quote_token): Return argv refs inside quoted
1565         strings.
1566         (init_argv_symbol): Populate new fields.
1567         * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1568         (m4_make_argv_ref): Likewise.
1569         (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1570         fields.
1571         (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1572         new parameter.
1573         * modules/m4.c (ifelse): Adjust caller.
1575 2008-02-22  Gary V. Vaughan  <gary@gnu.org>
1577         Fix regression in argument collection, from 2008-01-21.
1578         * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1579         undo argument collection optimisation for strings, so that
1580         m4_print_token doesn't abort when it otherwise receives an
1581         unprintable M4_SYMBOL_VOID type token.
1583 2008-02-20  Eric Blake  <ebb9@byu.net>
1585         Stage 16: cache quotes and improve m4_arg_print.
1586         Cache rather than always copying quotes when pushing $@ refs; in
1587         particular, reconstruct single-byte quotes on the fly.  Allow NUL
1588         through m4wrap.  Improve sharing of code that prints arguments.
1589         Memory impact: slight improvement, due to cached quotes.
1590         Speed impact: slight improvement, due to less copying.
1591         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
1592         (m4_arg_print): Adjust prototypes.
1593         (m4_dump_args): Delete.
1594         (m4_push_wrapup): Split...
1595         (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
1596         prototypes.
1597         * m4/m4private.h (struct m4_syntax_table): Add cached_quote
1598         member.
1599         (m4__quote_cache, m4__quote_uncache): New prototypes.
1600         * m4/syntax.c (m4_syntax_create): Initialize the cache.
1601         (m4__quote_cache): New function.
1602         (m4_set_syntax): Update caller.
1603         * m4/symtab.c (m4_symbol_value_print): Add parameter.
1604         (m4_symbol_print, dump_symbol_CB): Adjust all callers.
1605         * m4/utility.c (m4_dump_args): Delete; callers should use
1606         m4_arg_print instead.
1607         * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
1608         implementation, and allow embedded NUL.
1609         (m4_print_token, pop_input, composite_print, composite_peek):
1610         (composite_read, append_quote_token): Adjust all callers.
1611         * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
1612         Likewise.
1613         (m4_arg_print): Add parameters.
1614         (trace_pre): Rewrite in terms of m4_arg_print.
1615         * modules/m4.c (errprint): Likewise.
1616         (m4wrap): Rewrite to allow embedded NUL.
1617         (dumpdef): Adjust caller.
1618         * doc/m4.texinfo (Debuglen): Enhance debuglen test.
1619         * tests/null.m4: Test for NUL in m4wrap.
1620         * tests/null.out: Update expected output.
1622         Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
1623         * m4/utility.c (m4_verror_at_line): Properly terminate the string.
1624         Reported by Ralf Wildenhues.
1626         * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
1628 2008-02-19  Eric Blake  <ebb9@byu.net>
1630         Clean up example on filtering defined symbols.
1631         * doc/m4.texinfo (Foreach, Improved foreach): Document another
1632         shortcoming in foreach.m4, and improve filter example by using
1633         foreach2.m4.
1635         * src/main.c (usage): Fix typo.
1637 2008-02-18  Eric Blake  <ebb9@byu.net>
1639         Avoid some magic numbers.
1640         * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
1641         (CHAR_RETRY): Define in terms of UCHAR_MAX.
1642         * m4/syntax.c (m4_syntax_create, set_syntax_set)
1643         (reset_syntax_set, check_is_single_quotes)
1644         (check_is_single_comments, check_is_macro_escaped)
1645         (m4_set_quotes, m4_set_comment): Likewise.
1646         * modules/gnu.c (regexp_compile): Likewise.
1647         * modules/m4.c (translit): Likewise.
1648         * src/freeze.c (produce_syntax_dump): Likewise.
1649         Reported by Ralf Wildenhues.
1651 2008-02-16  Eric Blake  <ebb9@byu.net>
1653         Add regression test for multi-character quote recursion.
1654         * examples/foreach2.m4: Use $0 rather than spelling out name.
1655         * examples/foreachq2.m4: Likewise.
1656         * examples/forloop2.m4: Likewise.
1657         * examples/hanoi.m4: Likewise.
1658         * examples/trace.m4: Likewise.
1659         * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1660         (Improved foreach): Adjust dump from file.
1662         Stage 15: return argv refs back to collect_arguments.
1663         Collect an entire $@ reference at once rather than one argument at
1664         a time, outside of quotes (but inside quotes, $@ is still
1665         flattened for now).  The skip_last field allows concatenation of
1666         $@ with other text when collecting arguments.
1667         Memory impact: noticeable improvement, due to better reuse of $@.
1668         Speed impact: noticeable improvement, due to less parsing.
1669         * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
1670         (enum m4__token_type): Add M4_TOKEN_ARGV.
1671         (struct m4__symbol_chain): Add skip_last member to argv link.
1672         (m4__next_token): Add parameter.
1673         * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
1674         (composite_peek, m4__next_token): Add new parameter.
1675         (composite_read, append_quote_token): Support argv in quotes.
1676         (init_argv_symbol): New function.
1677         (m4__push_symbol, match_input, consume_syntax)
1678         (m4__next_token_is_open, m4_print_token): Adjust callers.
1679         * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
1680         (arg_mark, m4_arg_text, make_argv_ref): Likewise.
1681         (expand_argument, collect_arguments): Handle new token.
1682         (arg_symbol): Drill through $@ reference.
1683         * m4/syntax.c (set_quote_age): Detect disabled comments.
1684         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
1686 2008-02-15  Eric Blake  <ebb9@byu.net>
1688         * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
1690 2008-02-13  Eric Blake  <ebb9@byu.net>
1692         Fix texinfo grammar.
1693         * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
1694         (History): Use @: after abbreviations.
1695         (M4exit): Use correct Latin abbreviation.
1696         (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
1697         between sentences.
1699 2008-02-11  Eric Blake  <ebb9@byu.net>
1701         Allow builtin text macros to specify number of arguments.
1702         * m4/m4module.h (struct m4_macro): Add argument limits to builtin
1703         text macros.
1704         * m4/module.c (install_macro_table): Allow text macros to warn on
1705         extra arguments.
1706         * modules/gnu.c (m4_macro_table): Update all clients.
1707         * modules/load.c (m4_macro_table): Likewise.
1708         * modules/mpeval.c (m4_macro_table): Likewise.
1709         * modules/perl.c (m4_macro_table): Likewise.
1710         * modules/shadow.c (m4_macro_table): Likewise.
1711         * modules/traditional.c (m4_macro_table): Likewise.
1712         * modules/modtest.c (m4_macro_table): Likewise.  Also add text
1713         macros, for testing this.
1714         * doc/m4.texinfo (Standard Modules): Update text, and enhance
1715         test.
1716         * tests/modules.at (modules: text): New test.
1718         Fix regression in command line -D option, from 2006-08-25.
1719         * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
1720         * m4/m4module.h: Fix typo.
1721         * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
1722         of arguments.
1723         * tests/macros.at (Command line define): Enhance test.
1724         * tests/others.at (nul character): Enhance test.
1725         * tests/null.m4: Likewise.
1726         * tests/null.out: Likewise.
1728         Use gnulib's git-merge-changelog driver when available.
1729         * .gitattributes: Add merge attributes for ChangeLog.
1730         * bootstrap: Install driver, if not already present.
1732 2008-02-06  Eric Blake  <ebb9@byu.net>
1734         Fix security hole introduced 2007-11-23.
1735         * m4/utility.c (m4_verror_at_line): Properly escape macro names.
1736         * src/main.c (main): Manage quoteargs defaults.
1737         * doc/m4.texinfo (Indir): Document and test this.
1739         Using raw strtod is not portable.
1740         * ltdl/m4/gnulib-cache.m4: Import the strtod module.
1742 2008-02-02  Eric Blake  <ebb9@byu.net>
1744         Consistently use size_t for number of arguments.
1745         * m4/m4module.h (m4_builtin_func): Alter prototype.
1746         (struct m4_builtin): Adjust type of min_args, max_args.
1747         (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
1748         (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
1749         (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
1750         (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
1751         (m4_arg_print, m4_push_arg): Adjust all clients.
1752         * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
1753         (m4_macro_args): Adjust type of various fields.
1754         (m4__push_arg_quote): Adjust all clients.
1755         * m4/input.c (m4_pop_wrapup): Likewise.
1756         * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
1757         (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
1758         (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
1759         (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
1760         (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
1761         * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
1762         * modules/evalparse.c (m4_evaluate): Likewise.
1763         * modules/gnu.c (changesyntax): Likewise.
1764         * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
1765         (undivert, traceon, traceoff): Likewise.
1766         * modules/m4.h (m4_dump_symbols_func): Likewise.
1767         * modules/perl.c (perleval): Likewise.
1769         Stage 14b: allow pushing argv references.
1770         Push a $@ reference to the input engine in one go, rather than
1771         pushing each element.  For now, argument collection still gets one
1772         argument of a $@ at a time; but the penalties of this patch make
1773         it easier to manage $@ efficiently in future patches.
1774         Memory impact: noticeable penalty, due to larger struct and O(n)
1775         to O(n^2) on unboxed recursion.
1776         Speed impact: noticeable penalty, due to more bookkeeping.
1777         * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
1778         fields.
1779         (struct m4_macro_args): Add level field.
1780         (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
1781         * m4/input.c (m4__push_symbol, composite_peek, composite_read)
1782         (composite_unget, composite_clean, composite_print): Support $@
1783         refs.
1784         * m4/macro.c (collect_arguments): Populate new field.
1785         (expand_macro): Move argv cleanup...
1786         (m4__arg_adjust_refcount): ...to this new function.
1787         (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
1788         (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
1789         helper functions, to add parameters.
1790         (m4_push_args): Adjust caller.
1791         * m4/symtab.c (m4_symbol_value_print): Likewise.
1793         Stage 14a: allow printing argv references.
1794         Refactor symbol-value printing code for better sharing, and to
1795         allow printing a contiguous text representation of a $@ ref.
1796         Memory impact: none.
1797         Speed impact: none.
1798         * m4/m4module.h (m4_arg_print): New prototype.
1799         (m4_symbol_value_print): Alter prototype.
1800         * m4/input.c (struct input_funcs): Add parameter to peek_func.
1801         (file_peek, builtin_peek, string_peek): Ignore new parameter.
1802         (composite_peek): Ignore new parameter, for now.
1803         (composite_clean, pop_input): Rework to minimize indirection, and
1804         to avoid infinite recursion in next patch.
1805         * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
1806         (m4_arg_print): New function.
1807         * m4/symtab.c (m4_symbol_value_print): Update signature.
1808         (m4_symbol_print): Update caller.
1809         * m4/output.c (m4_shipout_string_trunc): Update comments.
1810         * m4/syntax.c (set_quote_age): Require comma as argument separator
1811         when dealing with $@ as a unit.
1812         * tests/builtins.at (ifelse): Augment test.
1813         * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
1815 2008-01-31  Eric Blake  <ebb9@byu.net>
1817         Kill hack for M4 1.4.4.
1818         * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
1819         we require new enough autoconf which in turn requires M4 1.4.5.
1821 2008-01-31  Gary V. Vaughan  <gary@gnu.org>
1822         and Eric Blake  <ebb9@byu.net>
1824         Depend on new libtool to use non-recursive build.
1825         * configure.ac (LT_PREREQ): Bump to alpha release version.
1826         (LTDL_INIT): Choose nonrecursive mode.  Perform sanity check that
1827         installed libtool has correct symbols.
1828         * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
1829         top level.
1830         (AM_CPPFLAGS): Drop directories covered by libtool.
1831         (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
1832         (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
1833         macros, used by libtool.
1834         (lib_LTLIBRARIES): Also used by libtool.
1835         (ltdl/libltdlc.la): Delete, now that libtool does this.
1836         * bootstrap: Mention new requirements.
1837         (LIBTOOLIZE): Provide default program, and run libtoolize prior to
1838         autoreconf.
1839         (autoreconf): Also neutralize libtoolize, since it is run early.
1840         * HACKING: Mention updated prerequisites.
1842 2008-01-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1844         Fix build failure if installed libltdl is used.
1845         * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
1847 2008-01-28  Eric Blake  <ebb9@byu.net>
1849         Depend on newer autoconf, for testsuite -C dir.
1850         * Makefile.am (CD_TESTDIR): Delete, no longer required.
1851         (check-local, installcheck-local, clean-local-tests): Use new -C
1852         option from autotest.
1853         * configure.ac (AC_PREREQ): Bump to 2.61a.347.
1854         * bootstrap: Mention new dependency.
1855         * HACKING: Likewise.
1857 2008-01-27  Eric Blake  <ebb9@byu.net>
1859         Stage 13: push composite text tokens.
1860         Support pushing composite tokens, allowing back-references to be
1861         reused through multiple macro expansions.  Add hueristic that
1862         avoids creating new reference when pushing existing references.
1863         Memory impact: noticeable improvement due to better reference
1864         reuse, except for O(n) to O(n^2) copying in boxed recursion.
1865         Speed impact: slight penalty, due to more bookkeeping.
1866         * m4/m4private.h (m4__push_symbol): Adjust prototype.
1867         * m4/input.c (m4__push_symbol): Add parameter, and support
1868         composite tokens.
1869         (append_quote_token): Add parameter, and support inlining of short
1870         text.
1871         (m4__next_token): Adjust caller.
1872         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1874 2008-01-26  Eric Blake  <ebb9@byu.net>
1876         Stage 12c: add macro for m4_arg_len.
1877         Make a common action easier to type.
1878         Memory impact: none.
1879         Speed impact: none.
1880         * m4/m4module.h (M4ARGLEN): New macro.
1881         * m4/macro.c (process_macro): Adjust all callers.
1882         * m4/utility.c (m4_dump_args): Likewise.
1883         * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1884         (substr): Likewise.
1885         * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1886         (renamesyms): Likewise.
1887         * modules/stdlib.c (setenv): Likewise.
1889         Stage 12b: add m4_string_pair.
1890         Make passing quote delimiters around more efficient.
1891         Memory impact: none.
1892         Speed impact: slight penalty, due to more bookkeeping.
1893         * m4/m4module.h (m4_string_pair): New type.
1894         (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1895         (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1896         Alter signature.
1897         * m4/m4private.h (struct m4_string): Delete.
1898         (struct m4_syntax_table): Combine quote and comment members.
1899         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1900         (m4_get_syntax_ecomm): Adjust accessors.
1901         (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1902         accessors.
1903         * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
1904         Alter signatures.
1905         * m4/input.c (string_print, composite_print, m4_input_print):
1906         All callers updated.
1907         * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
1908         (check_is_single_quotes, m4_set_quotes, set_quote_age)
1909         (m4_get_syntax_lquote, m4_get_syntax_rquote)
1910         (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
1911         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1912         (m4_get_syntax_comments): Likewise.
1913         * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
1914         * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
1915         Likewise.
1916         * modules/m4.c (dumpdef, m4_make_temp): Likewise.
1917         * src/freeze.c (produce_frozen_state): Likewise.
1918         * tests/freeze.at (reloading unknown builtin): Update test.
1920         Stage 12a: make m4_symbol_chain a union.
1921         Shrink size of symbol chains by using a union.
1922         Memory impact: slight improvement, due to smaller struct.
1923         Speed impact: slight improvement, due to less bookkeeping.
1924         * m4/m4private.h (enum m4__symbol_chain_type): New enum.
1925         (struct m4_symbol_chain): Rename...
1926         (struct m4__symbol_chain): ...to this, since it is internal.
1927         * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
1928         callers updated.
1929         * m4/input.c (struct m4_input_block, m4__push_symbol)
1930         (composite_peek, composite_read, composite_unget)
1931         (composite_clean, composite_print, m4__make_text_link)
1932         (append_quote_token): Likewise.
1933         * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
1934         (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
1935         (m4_push_args): Likewise.
1937 2008-01-23  Eric Blake  <ebb9@byu.net>
1939         Adjust to recent libtool interface change.
1940         * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
1941         (LT_WITH_LTDL): Delete, now that it is obsolete.
1942         (LTDL_INIT): Use new libtool macro.
1944 2008-01-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1945         and Eric Blake  <ebb9@byu.net>
1947         Rely on newer automake.
1948         * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
1949         distribution.
1950         * bootstrap: Update automake requirement.
1951         (func_version): Fix --version output, broken since 2007-08-06.
1952         * HACKING: Likewise.  Add lzma requirement.
1953         * Makefile.am (clean-local-src): Not needed any more with newest
1954         Automake.
1955         (clean-local): Adjust.
1956         * TODO: Remove completed item.
1958 2008-01-22  Eric Blake  <ebb9@byu.net>
1960         Doc tweak.
1961         * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
1962         example.
1964 2008-01-21  Eric Blake  <ebb9@byu.net>
1966         Stage 11: full circle for single argument references.
1967         Pass quoted strings through to argument collection in a single
1968         action, so that an argument can be reused throughout macro
1969         recursion if it remains unchanged.
1970         Memory impact: noticeable improvement, due to more reuse in
1971         argument collection stacks; O(n^2) to O(n) on boxed recursion.
1972         Speed impact: noticeable improvement, due to less copying.
1973         * m4/m4module.h (m4_arg_text): Add parameter.
1974         (M4ARG): Adjust.
1975         * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
1976         (m4__make_text_link): New prototype.
1977         (struct m4_symbol_chain): Add quote_age member.
1978         (struct m4_symbol_value): Add end member to chained symbol.
1979         (struct m4_macro_args): Add wrapper member.
1980         * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
1981         (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
1982         composite tokens.
1983         * m4/input.c (make_text_link): Rename...
1984         (m4__make_text_link): ...to this, and export.
1985         (m4_push_string_finish): Adjust caller.
1986         (make_text_link, m4__push_symbol): Update new field.
1987         (file_read, builtin_read, string_read, composite_read, next_char):
1988         Add parameter.
1989         (m4_skip_line, match_input, consume_syntax): Adjust callers.
1990         (append_quote_token): New function.
1991         (m4__next_token): Pass quoted strings onto argument collection.
1992         (m4_print_token) [DEBUG_INPUT]: Update.
1993         * m4/macro.c (expand_argument): Collect composite arguments.
1994         (collect_arguments): Update new field.
1995         (expand_macro): Reduce ref-count of back-references after use.
1996         (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
1997         names.
1998         (m4_is_arg_text): Also recognize composite symbols as text.
1999         (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
2000         (m4_arg_equal): Compare composite symbols.
2001         (m4_push_arg, m4_push_args): Handle composite symbols.
2002         (m4_arg_symbol): Relax assertion.
2003         (process_macro): Use single-argument references.
2004         * m4/output.c (m4_shipout_string_trunc): Update comment.
2005         * tests/macros.at (Rescanning macros): Augment test.
2007 2008-01-16  Eric Blake  <ebb9@byu.net>
2009         Stage 10: avoid extra copying of strings and comments.
2010         When collecting tokens that are immune to further expansion, avoid
2011         copying data from one obstack to another by outputting it into the
2012         destination obstack to begin with.  Also reduce copying done in
2013         format builtin.
2014         Memory impact: slight improvement, due to better obstack usage.
2015         Speed impact: noticeable improvement, due less data copying.
2016         * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
2017         modules.
2018         * m4/m4private.h (m4__token_type): Adjust prototype.
2019         * m4/input.c (m4__next_token): Support new parameter.
2020         * m4/macro.c (m4_macro_expand_input, expand_token)
2021         (expand_argument, collect_arguments): Adjust callers.
2022         * modules/m4.c (ntoa): Tighten buffer size.
2023         * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
2024         * modules/format.c (arg_int, arg_long, arg_double): New helper
2025         functions, to detect overflow or unparsed characters.
2026         (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
2027         missing or excess arguments.
2028         (format): Likewise, and also output directly into obstack if there
2029         is room.
2030         * doc/m4.texinfo (History): Update for new year.
2031         (Format): Test for new warnings.
2033 2008-01-15  Eric Blake  <ebb9@byu.net>
2035         * TODO: Update with some newer URLs.
2037         Verify linear `index'.
2038         * tests/builtins.at (index): New test.
2039         (translit): Make test take longer, to make quadratic algorithms
2040         more apparent.
2042 2007-12-20  Eric Blake  <ebb9@byu.net>
2044         Stage 9: share rather than copy single-arg refs.
2045         Use hooks of previous patch to create back-references to arguments
2046         in the input engine, and inline short text rather than always
2047         creating a FIFO link.  Also start testing embedded NUL behavior.
2048         Until the argument collection engine also shares references, the
2049         memory usage increases.
2050         Memory impact: noticeable penalty, due to longer life of argv
2051         changing O(n) to O(n^2) on boxed recursion.
2052         Speed impact: slight improvement, due less data copying.
2053         * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
2054         * m4/m4module.h (m4_arg_scratch): New prototype.
2055         * m4/m4private.h (m4__push_symbol): Add parameter.
2056         (m4_arg_scratch): Add fast accessor.
2057         (struct m4): Add expansion_level member, taken...
2058         * m4/macro.c (expansion_level): ...from here.  Adjust all users.
2059         (expand_argument): Minor cleanup.
2060         (expand_macro): Track scratch space per macro call.
2061         (m4_arg_scratch): New function.
2062         (m4_make_argv_ref): Call new function.
2063         (m4_push_arg): Push reference to $0.
2064         (m4_push_args): Rework separator usage, since separators will
2065         usually be inlined.
2066         (process_macro): Allow embedded NUL.
2067         * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
2068         (m4__push_symbol): Add parameter.  Inline short strings, and save
2069         references through rescanning.
2070         * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
2071         * modules/m4.c (errprint, index): Handle NUL transparently.
2072         (dumpdef, translit): Use scratch space, rather than expansion
2073         stack.
2074         * modules/gnu.c (renamesyms, m4symbols): Likewise.
2075         * tests/others.at (nul character): New test.
2076         (iso8859): Quote absolute file name, remove XFAIL.
2077         * tests/iso8859.m4: Avoid raw NUL in output.
2078         * tests/null.m4: New file.
2079         * tests/null.out: Likewise.
2080         * tests/null.err: Likewise.
2081         * Makefile.am (OTHER_FILES): Distribute new files.
2082         * .gitattributes: Treat new files as text.
2084 2007-12-17  Eric Blake  <ebb9@byu.net>
2086         Stage 8: extend life of references into argv.
2087         Add hooks to lengthen the lifetime of arguments reused in a macro
2088         expansion, rather than always discarding arguments at the end of
2089         expand_macro.  Rework the expand_macro obstacks to handle longer
2090         lifetimes.  For now, the hooks remain unused.
2091         Memory impact: slight penalty, due to larger structs.
2092         Speed impact: slight penalty, due to more bookkeeping.
2093         * m4/system_.h (obstack_regrow): Delete.
2094         * m4/m4private.h (struct m4_symbol_chain): Add level field.
2095         (m4__push_symbol): Adjust prototype.
2096         (m4__adjust_refcount): New prototype.
2097         (DEBUG_MACRO) [DEBUG]: New debug control.
2098         (struct m4__macro_arg_stacks): New structure.
2099         (struct m4): Add arg_stacks, stacks_count fields.
2100         * m4/m4module.h (m4_make_argv_ref): Add parameter.
2101         * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
2102         context->arg_stacks.
2103         (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
2104         conditional on M4_DEBUG_MACRO envvar.
2105         (collect_arguments): Adjust signature.
2106         (expand_macro): Rework obstack handling.
2107         (m4__adjust_refcount, arg_mark): New functions.
2108         (m4_make_argv_ref): Populate new field.
2109         (m4_push_arg, m4_push_args): Track inuse.
2110         (process_macro): One less cast.
2111         * m4/m4.c (m4_delete): Clean up arg_stacks.
2112         * m4/input.c (make_text_link): Use new field.
2113         (m4__push_symbol, file_clean): Update signature.
2114         (composite_read): Bump refcount when done with reference.
2115         (composite_clean): New function.
2116         (pop_input): Adjust caller.
2117         * m4/debug.c (m4_debug_message): Make assertion match comment.
2118         * modules/gnu.c (builtin, indir): Adjust callers.
2119         * tests/builtins.at (ifelse): New test.
2120         (exp): Move and rename...
2121         * tests/others.at (countdown): ...to this.
2122         * doc/m4.texinfo (Improved foreach): Fix tracing usage in
2123         example.
2125 2007-12-13  Eric Blake  <ebb9@byu.net>
2127         Yet more rewording.
2128         * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
2129         the previous patch.
2131         * THANKS: Update.
2133 2007-12-13  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
2135         * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
2136         example.
2137         Reported by Giovanni Toffetti.
2139 2007-12-11  Eric Blake  <ebb9@byu.net>
2141         Stage 7: use chained input support in input parser.
2142         Allow the LIFO input engine to rescan a macro expansion composed
2143         of smaller chunks of FIFO data, rather than the old approach of a
2144         monolithic string.  For now, all chunks are still copied.
2145         Memory impact: slight penalty, due to FIFO chain overhead.
2146         Speed impact: slight penalty, due to extra bookkeeping.
2147         * m4/m4private.h (m4__push_symbol): New prototype.
2148         (struct m4_symbol_chain): Add const-safety.
2149         * m4/symtab.c (m4_symbol_value_print): Simplify.
2150         (dump_symbol_CB): Update caller.
2151         * m4/input.c (struct m4_input_block): Alter u_c member, first
2152         introduced 2006-10-25, but unused until now.
2153         (composite_peek, composite_read, composite_unget)
2154         (composite_print, init_builtin_token): Rewrite accordingly.
2155         (m4_push_wrapup): No longer need trailing NUL.
2156         (m4__push_symbol, make_text_link): New functions.
2157         (m4_push_string_finish): Use them.
2158         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2159         (expand_macro): Simplify logic of nesting_limit.
2160         * src/main.c (main): Likewise.
2161         * doc/m4.texinfo (Dumpdef): Augment test.
2163 2007-12-08  Eric Blake  <ebb9@byu.net>
2165         Stage 6: convert builtins to push arg at a time.
2166         Add new methods to factor all builtins whose expansion includes an
2167         argument, making back-reference creation easier in future patches.
2168         Factor out length-limited printing to obstacks, and use -1 rather
2169         than 0 for unlimited length.
2170         Memory impact: none.
2171         Speed impact: slight improvement, due to better code sharing.
2172         * m4/m4module.h (m4_shipout_text): Rename...
2173         (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
2174         that does not worry about sync lines.
2175         (m4_shipout_string_trunc): New prototype.
2176         * m4/output.c (m4_shipout_text): Rename...
2177         (m4_divert_text): ...to this.
2178         (m4_shipout_string): Move guts...
2179         (m4_shipout_string_trunc): ...to this new function.
2180         * m4/macro.c (m4_push_arg, m4_push_args): New functions.
2181         (expand_token, process_macro): Update callers.
2182         * m4/input.c (string_print): Likewise.
2183         * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
2184         Likewise.
2185         * modules/gnu.c (patsubst): Likewise.
2186         (debuglen): Use SIZE_MAX for unlimited debug length.
2187         * src/main.c (main): Likewise.
2188         * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
2189         zero.
2191 2007-12-07  Eric Blake  <ebb9@byu.net>
2193         Minor security fix: Quote output of mkstemp.
2194         * modules/m4.c (m4_make_temp): Produce quoted output.
2195         * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
2196         tests.
2198         Stage 5: add notion of quote age.
2199         Cache the quoting rules that were in effect when a string was
2200         parsed, to avoid reparsing that string if no changequote or other
2201         quote age change took place in the meantime.  A quote_age of 0 is
2202         always safe, but does not benefit from caching.
2203         Memory impact: slight improvement, due to smaller struct in input
2204         engine.
2205         Speed impact: slight penalty, due to more bookkeeping.
2206         * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
2207         (m4_set_symbol_value_text): Adjust prototype.
2208         (m4_has_syntax): Factor out the unsigned char cast.
2209         * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
2210         quote_age members.
2211         (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
2212         functions at this point.
2213         (struct m4_symbol_value, struct m4_macro_args): Add quote_age
2214         member.
2215         (m4_set_symbol_value_text): Adjust fast accessor.
2216         (m4_get_symbol_value_quote_age): New fast accessor.
2217         * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
2218         (m4_get_symbol_value_quote_age): New function.
2219         (m4_symbol_value_copy): Adjust callers.
2220         * m4/macro.c (expand_token): Add parameter, and track quote age.
2221         (expand_argument, collect_arguments): Track quote age.
2222         (m4_macro_expand_input, process_macro, m4_make_argv_ref)
2223         (m4_macro_expand_input): Update callers.
2224         (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
2225         * m4/input.c: Comment cleanups.
2226         (struct m4_input_block): Reduce size.
2227         (m4__next_token): Report quote age.
2228         (m4_push_builtin, init_builtin_token): Update callers.
2229         * m4/utility.c (skip_space): Adjust callers.
2230         * m4/module.c (install_macro_table): Likewise.
2231         * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
2232         (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
2233         quote age.
2234         (set_quote_age): New helper function.
2235         (check_is_single_quotes, check_is_single_comments): Adjust
2236         callers.
2237         * src/freeze.c (reload_frozen_state): Likewise.
2238         * src/main.c (main): Likewise.
2239         * modules/m4.c (define, pushdef): No need to set macro text.
2240         * tests/builtins.at (changequote, defn): New tests.
2241         * examples/wrapfifo.m4: New file.
2242         * examples/wraplifo.m4: New file.
2243         * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
2245 2007-12-04  Eric Blake  <ebb9@byu.net>
2247         Fix builds with OpenBSD make.
2248         * Makefile.am (HELP2MAN): New macro.
2249         (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
2250         srcdir.
2251         * README: Update copyright.
2252         * HACKING: Mention help2man and makeinfo dependencies.
2254 2007-11-29  Eric Blake  <ebb9@byu.net>
2256         Stage 4: route indir, builtin through ref; make argv opaque.
2257         Finish making struct opaque to all but the input engine, by
2258         reworking obstack usage in expand_macro to better support creation
2259         of a $@ reference.  Canonicalize the empty argument, to allow
2260         pointer comparison optimizations.
2261         Memory impact: slight penalty, due to larger struct.
2262         Speed impact: slight improvement, due to fewer function calls.
2263         * m4/system_.h (obstack_regrow): Fix precedence.
2264         * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
2265         New prototypes.
2266         (struct m4_macro_args): Move...
2267         * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
2268         to modules.  Add has_ref member.
2269         (bool_bitfield): New helper typedef.
2270         (struct m4_symbol_chain): Add flatten and len members.
2271         * m4/macro.c (empty_symbol): New placeholder, for optimizing
2272         comparison with empty string.
2273         (m4_macro_expand_input): Initialize it.
2274         (collect_arguments): Alter signature, and populate new fields.
2275         (trace_pre, trace_post): Remove redundant parameter.
2276         (expand_macro): Alter handling of obstacks.
2277         (m4_arg_symbol): Account for wrapped argv.
2278         (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
2279         (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
2280         * modules/m4.c (ifelse, syscmd): Likewise.
2281         * modules/evalparse.c (m4_evaluate): Likewise.
2282         (undefine, popdef, m4_dump_symbols): Optimize.
2283         * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
2284         methods.
2285         (changesyntax, regexp): Optimize.
2286         * m4/output.c (diversion_storage): Use typedef.
2288         Stage 3b: cache length, rather than computing it, in modules.
2289         Use cached token length in builtins and output engine.
2290         Memory impact: none.
2291         Speed impact: noticeable improvement, due to fewer function calls.
2292         * m4/hash.c (m4_hash_remove): Avoid double free on remove
2293         failure.
2294         * m4/output.c (m4_shipout_string): Change semantics of len param.
2295         (m4_shipout_int): Use cached length.
2296         * m4/input.c (m4_push_string_finish): Likewise.
2297         * modules/m4.h (m4_make_temp_func): Add parameter.
2298         * m4/macro.c (expand_token, m4_arg_len): Use cached length.
2299         (collect_arguments, expand_macro): Alter signature.
2300         (trace_format): Don't use out-of-scope buffer.
2301         (process_macro): All callers changed.
2302         * m4/utility.c (m4_dump_args): Likewise.
2303         * m4/symtab.c (m4_symbol_value_print): Likewise.
2304         * modules/gnu.c (__file__, __program__, builtin, indir)
2305         (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
2306         renamesyms, patsubst, regexp, regexp_compile): Likewise.
2307         * modules/load.c (m4modules): Likewise.
2308         * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
2309         (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
2310         * modules/perl.c (perleval): Likewise.
2311         * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
2312         (hostname, uname, setenv): Likewise.
2313         * modules/mpeval.c (numb_obstack): Likewise.
2314         * src/freeze.c (dump_symbol_CB): Likewise.
2315         * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
2316         * tests/builtins.at (mkstemp): Likewise.
2317         * tests/others.at (iso8859): XFAIL this test, now that
2318         length-based handling allows NUL through part but not all of M4.
2320 2007-11-28  Eric Blake  <ebb9@byu.net>
2322         Stage 3a: cache length, rather than computing it, in libm4.
2323         Cache the length of a token in the input engine and symbol table,
2324         to avoid repeating lots of strlen calls.  Additionally, by using
2325         obstack length rather than strlen, the input engine can now
2326         support embedded NUL.
2327         Memory impact: slight penalty, due to larger struct.
2328         Speed impact: slight improvement, due to fewer function calls.
2329         * m4/m4module.h (struct m4_macro_args): Cache length.
2330         (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2331         (m4_set_symbol_value_text): Change signature.
2332         * m4/m4private.h (struct m4_symbol_value): Store string length.
2333         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2334         (m4_set_symbol_value_placeholder): Update accordingly.
2335         (m4_set_symbol_value_text): Change signature.
2336         (m4_get_symbol_value_len): New accessor.
2337         * m4/input.c (struct m4_input_block, string_peek, string_read)
2338         (string_unget, string_print, m4_push_string_finish)
2339         (m4_push_wrapup): Track length of string input.
2340         (m4__next_token): Adjust all users of symbol text to track length,
2341         too.
2342         * m4/macro.c (expand_argument, collect_arguments): Likewise.
2343         * m4/module.c (install_macro_table): Likewise.
2344         * modules/gnu.c (builtin, indir): Likewise.
2345         * modules/m4.c (define, pushdef): Likewise.
2346         * src/main.c (main): Likewise.
2347         * src/freeze.c (reload_frozen_state): Likewise.
2348         * m4/symtab.c (m4_symbol_value_copy): Likewise.
2349         (m4_get_symbol_value_len): New function.
2350         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2351         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2352         Adjust implementation.
2354 2007-11-27  Eric Blake  <ebb9@byu.net>
2356         Stage 2: use accessors, not direct reference, into argv.
2357         Outside of macro.c, use accessor methods rather than direct access
2358         into the argv struct.
2359         Memory impact: none.
2360         Speed impact: slight penalty, due to increased function calls.
2361         * m4/m4private.h (m4_arg_argc): New fast accessor.
2362         * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2363         (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2364         prototypes.
2365         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2366         (m4_macro_call): Make argc unsigned.
2367         (M4ARG): Use new accessors.
2368         * modules/m4.c (define, pushdef): Likewise.
2369         (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2370         (traceon, traceoff): Make argc unsigned.
2371         * modules/m4.h (m4_dump_symbols_func): Likewise.
2372         * modules/evalparse.c (m4_evaluate): Likewise.
2373         * modules/gnu.c (builtin, indir): Use new accessors.
2374         (changesyntax): Make argc unsigned.
2375         * modules/perl.c (perleval): Likewise.
2376         * m4/utility.c (m4_dump_args): Use new accessors.
2377         * m4/macro.c (trace_pre): Likewise.
2378         (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2379         (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2380         (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2381         usage.
2383 2007-11-24  Eric Blake  <ebb9@byu.net>
2385         Stage 1: convert m4_symbol_value** into new object.
2386         Pass a variable-size wrapper structure instead of an array to
2387         builtins, so that subsequent optimizations in the structure need
2388         not impact every builtin client.
2389         Memory impact: slight penalty, since struct is larger than array.
2390         Speed impact: slight penalty, due to increased bookkeeping.
2391         * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2392         * m4/m4module.h (m4_macro_args): New type, will be opaque to
2393         modules later.
2394         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2395         (m4_macro_call): Alter signature to use m4_macro_args object.
2396         (M4ARG): Redefine to access new struct.
2397         * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2398         (struct m4_symbol_chain): New type.
2399         (struct m4_symbol_value): Add chain alternative.
2400         * m4/macro.c (collect_arguments): Build new struct.
2401         (expand_macro, m4_macro_call, process_macro, trace_pre)
2402         (trace_post): Adjust implementation to use it.
2403         * m4/utility.c (m4_dump_args): Likewise.
2404         * modules/gnu.c (builtin, indir): Likewise.
2405         * modules/format.c (format): Likewise.
2406         * modules/m4.h (m4_dump_symbols_func): Likewise.
2407         * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2408         (shift, include, errprint, m4wrap): Likewise.
2409         * modules/evalparse.c (m4_evaluate): Likewise.
2411         Pass only macro name to utility functions.
2412         * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2413         * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2414         implementation.
2415         * m4/macro.c (m4_macro_call): Adjust callers.
2416         * modules/gnu.c (builtin, debuglen): Likewise.
2417         * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2418         (substr): Likewise.
2419         * modules/evalparse.c (m4_evaluate): Likewise.
2420         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2421         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2422         Likewise.
2424 2007-11-23  Eric Blake  <ebb9@byu.net>
2426         Add macro name to debugfile messages.
2427         * m4/m4module.h (m4_debug_set_output): Add parameter.
2428         * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2429         name through.
2430         * modules/gnu.c (debugfile): Adjust caller.
2431         * modules/m4.c (m4exit): Likewise.
2432         * src/main.c (main): Likewise.
2434         Factor out handling of macro name in error messages.
2435         * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2436         (m4_warn_at_line): Add new parameter.
2437         * m4/utility.c (m4_verror_at_line): New helper method.
2438         (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2439         parameter.
2440         (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2441         changed.
2442         * m4/debug.c: Likewise.
2443         * m4/input.c: Likewise.
2444         * m4/macro.c: Likewise.
2445         * m4/module.c: Likewise.
2446         * m4/output.c: Likewise.
2447         * m4/path.c: Likewise.
2448         * modules/evalparse.c: Likewise.
2449         * modules/format.c: Likewise.
2450         * modules/gnu.c: Likewise.
2451         * modules/load.c: Likewise.
2452         * modules/m4.c: Likewise.
2453         * modules/mpeval.c: Likewise.
2454         * src/freeze.c: Likewise.
2455         * src/main.c: Likewise.
2457 2007-11-14  Eric Blake  <ebb9@byu.net>
2459         Handle some defn corner cases differently.
2460         * doc/m4.texinfo (Defn): Update documentation; although this still
2461         doesn't match the branch, since it may be changed before 2.0.
2462         * m4/macro.c (expand_argument): Consistently ignore builtins in
2463         concatenation contexts.
2464         * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2466 2007-11-13  Eric Blake  <ebb9@byu.net>
2468         Note: Patches titled Stage 0 through N form a series of patches
2469         which decreases the algorithmic complexity of tail recursion in
2470         macro expansions from O(n^2) to O(n) in both time and memory, then
2471         performs cleanups, such as handling of embedded NUL, made easier
2472         by the code refactoring.
2474         Stage 0: Fix memory leak in tail recursion.
2475         Free expansion text in the input engine as soon as it is parsed,
2476         rather than when the recursive expansion completes.
2477         Memory impact: noticeable improvement, due to reduction from
2478         O(n^2) to O(n) on recursion.
2479         Speed impact: minor improvement, due to better memory usage.
2480         * m4/input.c (pop_input): Add flag parameter and return type.
2481         (next_char): Adjust caller.
2482         (m4_push_string_init): Let go of memory earlier.
2484 2007-11-07  Eric Blake  <ebb9@byu.net>
2486         * tests/macros.at (Rescanning macros): Test more corner cases.
2488 2007-11-06  Eric Blake  <ebb9@byu.net>
2490         * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2492         * Makefile.am (tests/package.m4): Work around bash bug.
2493         Reported by Ralf Wildenhues.
2495 2007-11-05  Eric Blake  <ebb9@byu.net>
2497         For consistency with other GNU projects, use build-aux directory.
2498         * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2499         build-aux.
2500         * bootstrap (config_aux_dir): Likewise.
2501         * Makefile.am (config_aux_dir): Likewise.
2502         * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2504 2007-11-02  Eric Blake  <ebb9@byu.net>
2506         Update some documentation about version control.
2507         * NEWS: M4 is now stored in git.
2508         * HACKING: Likewise.
2509         * README: Likewise.
2510         * bootstrap: Likewise.
2511         * commit: Delete, now that CVS commits are no longer necessary.
2512         * ltdl/config/mailnotify: No longer necessary; git's patch
2513         generation and mail capability is more powerful.
2515         Update to recent gnulib changes.
2516         * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2517         xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2519 2007-11-01  Eric Blake  <ebb9@byu.net>
2521         Improve error message when early end of file occurs.
2522         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2523         (M4wrap): Adjust to new messages.
2524         (Improved capitalize): Enhance test.
2525         * m4/m4private.h (m4__next_token): Adjust prototype.
2526         * m4/input.c (m4__next_token): Add new parameter, and improve
2527         error message.
2528         * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2529         callers.
2530         (expand_argument): Likewise, and add parameter.
2532 2007-10-31  Eric Blake  <ebb9@byu.net>
2534         Test more corner cases.
2535         * tests/macros.at (Rescanning macros): Beef up test.
2536         * doc/m4.texinfo (Changecom): Beef up test.
2537         (Improved foreach): Document alternate foreachq style.
2538         * examples/foreachq3.m4: New file.
2539         * examples/loop.m4: New file.
2540         * Makefile.am (dist_pkgdata_DATA): Distribute them.
2542 2007-10-28  Eric Blake  <ebb9@byu.net>
2544         More test coverage for autoconf usage patterns.
2545         * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2546         * tests/macros.at (Rescanning macros): New test.
2547         * tests/builtins.at (include): Augment test.
2549 2007-10-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2551         * Makefile.am: Adjust getopt handling to latest gnulib layout.
2553 2007-10-27  Eric Blake  <ebb9@byu.net>
2555         Document one use of changequote(`(',`)').
2556         * doc/m4.texinfo (Changequote): Add new test, based on recent
2557         autoconf addition of m4_expand.
2559 2007-10-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2561         * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2563 2007-10-22  Eric Blake  <ebb9@byu.net>
2565         Never let printf failures go undetected.
2566         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2567         xprintf'.
2568         * m4/system_.h: Include xprintf.h.
2569         * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2570         use of printf, xprintf.
2571         * m4/input.c [DEBUG_INPUT]: Likewise.
2572         * m4/module.c [DEBUG_MODULES]: Likewise.
2573         * m4/output.c (m4_shipout_text, m4_shipout_int)
2574         (m4_freeze_diversions): Likewise.
2575         * m4/path.c [DEBUG_INCL]: Likewise.
2576         * m4/symtab.c [DEBUG_SYM]: Likewise.
2577         * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2578         * modules/modtest.c (export_test): Likewise.
2579         * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2580         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2581         Likewise.
2582         * src/main.c (usage): Likewise.
2583         * po/POTFILES.in: Adjust to new file.
2584         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2586 2007-10-18  Eric Blake  <ebb9@byu.net>
2588         Fix 'm4 -F file -t undefined'.
2589         * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
2590         * src/freeze.c (dump_symbol_CB): Also skip void symbols.
2591         * tests/freeze.at (reloading unknown builtin): Test for this bug.
2592         * m4/m4module.h (m4_symtab_apply): Add parameter.
2593         * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
2594         requested.
2595         (m4_symtab_delete, symtab_dump): Adjust callers.
2596         * modules/m4.c (m4_dump_symbols): Likewise.
2598 2007-10-09  Eric Blake  <ebb9@byu.net>
2600         Fix regexp regression of 2007-09-29.
2601         * modules/gnu.c (substitute): Allow NULL buf when no
2602         subexpressions were present.
2603         (regexp): Handle \ escapes even with empty regex.
2604         * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
2606         Cache regex compilation for another autoconf speedup.
2607         * modules/gnu.c (gnu_buf): Replace...
2608         (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
2609         (m4_pattern_buffer): Add fields.
2610         (m4_regexp_compile): Rename...
2611         (regexp_compile): ...to this, and drop no_sub parameter.
2612         Implement caching.
2613         (M4FINISH_HANDLER): Clean up entire cache.
2614         (m4_regexp_search): Rename...
2615         (regex_search): ...to this, adjust to new struct contents, and add
2616         no_sub parameter.
2617         (m4_regexp_substitute): Rename...
2618         (regexp_substitute): ...to this.
2619         (substitute, patsubst, regexp, renamesyms): Adjust callers.
2621 2007-10-02  Eric Blake  <ebb9@byu.net>
2623         Document quoting pitfalls in capitalize.
2624         * doc/m4.texinfo (Patsubst): Use the examples directory.  Also
2625         document shortfall.
2626         (Improved capitalize): New node.
2627         * examples/capitalize.m4: Update to match manual.
2628         * examples/capitalize2.m4: New file.
2630 2007-10-01  Eric Blake  <ebb9@byu.net>
2632         Another Autoconf usage pattern optimization.
2633         * modules/m4.c (m4_index): Optimize search for one byte.
2634         * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
2635         code paths.
2637 2007-09-29  Eric Blake  <ebb9@byu.net>
2639         Optimize for Autoconf usage pattern.
2640         * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
2642         * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
2644 2007-09-24  Eric Blake  <ebb9@byu.net>
2646         Create .gitignore alongside .cvsignore.
2647         * bootstrap (version control): Update to reflect git usage.
2649 2007-09-13  Eric Blake  <ebb9@byu.net>
2651         * AUTHORS: Fix typo.
2653 2007-09-12  Gary V. Vaughan  <gary@gnu.org>
2655         Be consistent about using 'module' for m4_module types and
2656         'handle' for lt_dlhandle types:
2658         * m4/m4private.h (m4_symbol_value): Rename handle element to
2659         method.  Changed all references.
2660         (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
2661         SYMBOL_HANDLE respectively.  Changed all references.
2662         * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
2663         * m4/builtin.c (m4_builtin_find_by_name)
2664         (m4_builtin_find_by_func): Use module as the parameter name for
2665         pointers of type 'm4_module'.
2666         * m4/module.c (module_remove, m4_get_module_name)
2667         (install_builtin_table, install_macro_table)
2668         (m4_module_make_resident, m4__module_next, m4_module_refcount):
2669         Ditto.
2670         * src/freeze.c (produce_module_dump): Ditto.
2671         * m4/input.c (m4_input_block): Rename handle element to method.
2672         Changed all references.
2673         * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
2674         * modules/load.c: Use module as the variable name for pointers
2675         of type 'm4_module'.
2676         * modules/m4.c: Ditto.
2677         * modules/perl.c: Ditto.
2678         * modules/shadow.c: Ditto.
2680 2007-09-07  Eric Blake  <ebb9@byu.net>
2682         Add refcount builtin.
2683         * modules/load.c (refcount): New builtin.
2684         (m4modules): Use correct type.
2685         * doc/m4.texinfo (Refcount): New section.
2686         * m4/m4private.h (struct m4_module): Add refcount member.
2687         (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
2688         * m4/module.c (m4_module_load): Add symbols to table on first
2689         load by m4, regardless of other libltdl loads of same module.
2690         (m4_module_refcount): Use new struct member, rather than relying
2691         on libltdl count which might be inflated by unrelated loads.
2692         (m4__module_interface): Optimize.
2693         (m4__module_next, m4__module_find): Avoid assertions that could
2694         trigger with unrelated libltdl loads.
2695         (m4__module_open): Track m4 load count.
2696         (m4__module_exit): Only unload what m4 loaded.
2697         (module_remove): Track m4 unloads.
2698         * NEWS: Document new builtin.
2700         More conversion to m4_module*.
2701         * src/freeze.c (produce_module_dump, dump_symbol_CB)
2702         (reload_frozen_state): Use correct type.
2703         * m4/input.c (struct m4_input_block): Likewise.
2704         * m4/symtab.c (dump_symbol_CB): Likewise.
2706         * AUTHORS: Simplify, to match libtool and autoconf layout.
2707         * THANKS: Sync with branch.
2709 2007-09-06  Eric Blake  <ebb9@byu.net>
2711         Wrap lt_dlhandle in struct m4_module.
2712         * m4/m4module.h (includes): No longer require clients to know
2713         about lt_dlhandle.
2714         (m4_module): New opaque declaration.
2715         (m4_export): Delete unused type.
2716         (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
2717         (m4_module_finish_func, m4_module_load, m4_get_module_name)
2718         (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
2719         wrapper.
2720         (m4_module_makeresident, m4_module_refcount): New declarations.
2721         * m4/m4private.h (includes): Move <ltdl.h> here.
2722         (m4_module): New declaration.  Simple for now, but intended for
2723         growth.
2724         (m4__module_open, m4__module_next, m4__module_find)
2725         (m4__symtab_remove_module_references): Use new wrapper.
2726         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2727         Likewise.
2728         * m4/module.c (m4_get_module_name, m4_module_import)
2729         (m4_module_load): Likewise.
2730         (install_builtin_table, install_macro_table): Likewise.  Also,
2731         change return type since these always returned NULL and no one
2732         used the result.
2733         (m4_module_makeresident, m4_module_refcount): New functions.
2734         (m4_module_unload, m4__module_next, m4__module_find): Use new
2735         wrapper.
2736         (m4__module_open): Populate new wrapper, and associate it with the
2737         lt_dlhandle.
2738         (m4__module_exit): Use new wrapper.
2739         (module_remove): Likewise.  Reclaim storage on last use.
2740         (module_close): Delete, and inline into module_remove.
2741         * m4/symtab.c (m4__symtab_remove_module_references): Use new
2742         wrapper.
2743         * modules/load.c (load_init): Use new API.
2744         * modules/m4.c (m4_export_table): Kill unused declaration.
2745         (m4_init): Use new API.
2746         * modules/shadow.c (shadow_init): Use new API.
2747         * src/main.c (main): Adjust callers.
2748         * src/freeze.c (reload_frozen_state): Likewise.
2749         * tests/modules.at (unload load module): New test.
2751 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
2753         * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
2754         * src/m4/.cvsignore: Add xstrtol module sources.
2756 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
2758         Work around a bug in darwin's awk:
2760         * bootstrap (func_get_translations): Use $AWK instead of raw
2761         `awk' so that the user can use an alternative implementation
2762         if the first awk in PATH doesn't behave as expected.
2763         (func_get_translations): The first awk script mangles the last
2764         entry passed to it for at least the awk implementation shipped
2765         with Darwin 8.10.1.  Capture $3 into a variable too to work-
2766         around that problem.
2768 2007-08-29  Gary V. Vaughan  <gary@gnu.org>
2770         As gnulib xstrtol is only used by main, and unconditionally pulls
2771         in a copy of getopt, undo bootstrap change from 2007-08-11 below,
2772         and copy the xstrtol code into src/ so that main() can use it
2773         without pushing the extra code into libm4:
2775         * bootstrap (src_modules): Add getopt and xstrtol modules.
2776         * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
2777         * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
2779 2007-08-11  Eric Blake  <ebb9@byu.net>
2781         Another upstream xstrtol change.
2782         * po/POTFILES.in: Track changes in files containing messages.
2783         * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
2784         need to grab it separately.
2785         * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2786         No longer needed.
2787         (size_opt): Adjust to latest xstrtol interface.
2789 2007-08-10  Eric Blake  <ebb9@byu.net>
2791         Documentation improvements.
2792         * doc/m4.texinfo (Defn): Resync with branch.
2793         (Compatibility, Extensions): Sync with branch.
2795 2007-08-07  Eric Blake  <ebb9@byu.net>
2797         Adjust to gnulib xstrtol changes.
2798         * src/main.c (size_opt): Adjust signature, so that error strings
2799         are easier to translate.
2800         (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
2801         for tracking long options.
2802         (main): Track which long option was used.
2803         * tests/options.at (--debuglen, --nesting-limit): Adjust to change
2804         in error message.
2805         (deprecated options): Test that --arglength spelling shows up in
2806         error message.
2808 2007-08-06  Eric Blake  <ebb9@byu.net>
2810         Normalize all GPL license notices.
2811         * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
2812         at this time.
2813         * Makefile.am: Update license wording.
2814         * bootstrap: Likewise.
2815         * commit: Likewise.
2816         * configure.ac: Likewise.
2817         * ltdl/config/mailnotify: Likewise.
2818         * ltdl/config/mkstamp: Likewise.
2819         * ltdl/m4/debug.m4: Likewise.
2820         * ltdl/m4/gmp.m4: Likewise.
2821         * ltdl/m4/m4-error.m4: Likewise.
2822         * ltdl/m4/m4-getopt.m4: Likewise.
2823         * ltdl/m4/m4-gettext.m4: Likewise.
2824         * ltdl/m4/m4-obstack.m4: Likewise.
2825         * ltdl/m4/m4-regex.m4: Likewise.
2826         * ltdl/m4/stackovf.m4: Likewise.
2827         * m4/builtin.c: Likewise.
2828         * m4/debug.c: Likewise.
2829         * m4/hash.c: Likewise.
2830         * m4/hash.h: Likewise.
2831         * m4/input.c: Likewise.
2832         * m4/m4.c: Likewise.
2833         * m4/m4module.h: Likewise.
2834         * m4/m4private.h: Likewise.
2835         * m4/macro.c: Likewise.
2836         * m4/module.c: Likewise.
2837         * m4/output.c: Likewise.
2838         * m4/path.c: Likewise.
2839         * m4/resyntax.c: Likewise.
2840         * m4/symtab.c: Likewise.
2841         * m4/syntax.c: Likewise.
2842         * m4/system_.h: Likewise.
2843         * m4/utility.c: Likewise.
2844         * modules/evalparse.c: Likewise.
2845         * modules/format.c: Likewise.
2846         * modules/gnu.c: Likewise.
2847         * modules/import.c: Likewise.
2848         * modules/load.c: Likewise.
2849         * modules/m4.c: Likewise.
2850         * modules/m4.h: Likewise.
2851         * modules/modtest.c: Likewise.
2852         * modules/mpeval.c: Likewise.
2853         * modules/perl.c: Likewise.
2854         * modules/shadow.c: Likewise.
2855         * modules/stdlib.c: Likewise.
2856         * modules/time.c: Likewise.
2857         * modules/traditional.c: Likewise.
2858         * po/Makevars: Likewise.
2859         * src/freeze.c: Likewise.
2860         * src/m4.h: Likewise.
2861         * src/main.c: Likewise.
2862         * src/stackovf.c: Likewise.
2863         * tests/builtins.at: Likewise.
2864         * tests/freeze.at: Likewise.
2865         * tests/generate.awk: Likewise.
2866         * tests/m4.in: Likewise.
2867         * tests/macros.at: Likewise.
2868         * tests/modules.at: Likewise.
2869         * tests/options.at: Likewise.
2870         * tests/others.at: Likewise.
2871         * tests/stackovf.test: Likewise.
2872         * tests/testsuite.at: Likewise.
2874 2007-07-22  Eric Blake  <ebb9@byu.net>
2876         Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2877         * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2878         * tests/builtins.at (divert): Enhance test to cover this.
2879         * THANKS: Update.
2880         Reported by Thomas Klausner.
2882 2007-07-20  Eric Blake  <ebb9@byu.net>
2884         Fix 'make distcheck' issues.
2885         * bootstrap: Add more files that might be more up-to-date in
2886         gnulib.
2887         * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2888         * config/m4/gnulib-cache.m4: Update to latest gnulib.
2890 2007-07-16  Eric Blake  <ebb9@byu.net>
2892         * po/POTFILES.in: Track recent translation additions from gnulib
2893         updates.
2895 2007-07-14  Eric Blake  <ebb9@byu.net>
2897         Reflect upstream license .texi changes.
2898         * doc/m4.texinfo (Copying): Rename node...
2899         (GNU General Public License): ...to this.
2900         (GNU Free Documentation License): Adjust node location.
2901         * local/doc/gpl-3.0.texi.diff: Remove file.
2903 2007-07-10  Eric Blake  <ebb9@byu.net>
2905         Upgrade to GPLv3, and document 1.4.10.
2906         * bootstrap: Adjust to GPLv3.
2907         (func_update): Port from branch.
2908         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2909         --local-dir=local --import gpl-3.0'.
2910         * doc/m4.texinfo (History): Mention 1.4.11.
2911         (Copying This Package): New appendix.
2912         * NEWS: Document 1.4.10.
2913         * local/doc/gpl-3.0.texi.diff: New file.
2914         * Makefile.am: Update license.
2915         (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
2916         * commit: Update license.
2917         * configure.ac: Likewise.
2918         * ltdl/config/mailnotify: Likewise.
2919         * ltdl/config/mkstamp: Likewise.
2920         * ltdl/m4/debug.m4: Likewise.
2921         * ltdl/m4/gmp.m4: Likewise.
2922         * ltdl/m4/m4-error.m4: Likewise.
2923         * ltdl/m4/m4-getopt.m4: Likewise.
2924         * ltdl/m4/m4-gettext.m4: Likewise.
2925         * ltdl/m4/m4-obstack.m4: Likewise.
2926         * ltdl/m4/m4-regex.m4: Likewise.
2927         * ltdl/m4/stackovf.m4: Likewise.
2928         * m4/builtin.c: Likewise.
2929         * m4/debug.c: Likewise.
2930         * m4/hash.c: Likewise.
2931         * m4/hash.h: Likewise.
2932         * m4/input.c: Likewise.
2933         * m4/m4.c: Likewise.
2934         * m4/m4module.h: Likewise.
2935         * m4/m4private.h: Likewise.
2936         * m4/macro.c: Likewise.
2937         * m4/module.c: Likewise.
2938         * m4/output.c: Likewise.
2939         * m4/path.c: Likewise.
2940         * m4/resyntax.c: Likewise.
2941         * m4/symtab.c: Likewise.
2942         * m4/syntax.c: Likewise.
2943         * m4/system_.h: Likewise.
2944         * m4/utility.c: Likewise.
2945         * modules/evalparse.c: Likewise.
2946         * modules/format.c: Likewise.
2947         * modules/gnu.c: Likewise.
2948         * modules/import.c: Likewise.
2949         * modules/load.c: Likewise.
2950         * modules/m4.c: Likewise.
2951         * modules/m4.h: Likewise.
2952         * modules/modtest.c: Likewise.
2953         * modules/mpeval.c: Likewise.
2954         * modules/perl.c: Likewise.
2955         * modules/shadow.c: Likewise.
2956         * modules/stdlib.c: Likewise.
2957         * modules/time.c: Likewise.
2958         * modules/traditional.c: Likewise.
2959         * po/Makevars: Likewise.
2960         * src/freeze.c: Likewise.
2961         * src/m4.h: Likewise.
2962         * src/main.c: Likewise.
2963         * src/stackovf.c: Likewise.
2964         * tests/builtins.at: Likewise.
2965         * tests/freeze.at: Likewise.
2966         * tests/generate.awk: Likewise.
2967         * tests/m4.in: Likewise.
2968         * tests/macros.at: Likewise.
2969         * tests/modules.at: Likewise.
2970         * tests/options.at: Likewise.
2971         * tests/others.at: Likewise.
2972         * tests/stackovf.test: Likewise.
2973         * tests/testsuite.at: Likewise.
2975 2007-07-09  Eric Blake  <ebb9@byu.net>
2977         * modules/format.c (format): Avoid undefined behavior with %c.
2979 2007-07-01  Gary V. Vaughan  <gary@gnu.org>
2981         The translation project has moved.
2982         * bootstrap (func_get_translations): Use the new translation
2983         project url.
2984         (TP_URL): Removed.
2986 2007-06-26  Karl Berry  <karl@freefriends.org>  (tiny change)
2988         Match Free Software Directory categories.
2989         * doc/m4.texinfo (dircategory): Update.
2991 2007-05-31  Eric Blake  <ebb9@byu.net>
2993         Add extension to divert builtin.
2994         * modules/m4.c (builtin_divert): Immediately divert second
2995         argument.
2996         * m4/output.c (m4_output_text): Allow 0 length.  Fixes regression
2997         from two days ago.
2998         (m4_shipout_text): Short-circuit on zero length.
2999         * tests/freeze.at (loading format 2): Expand test to catch
3000         regression.  Also check out-of-range version.
3001         * tests/builtins.at (divert): Expand test to check corner cases
3002         of extension.
3003         * doc/m4.texinfo (Divert): Document the extension.
3004         * NEWS: Likewise.
3005         Reported by Daniel Richard G.
3007 2007-05-30  Eric Blake  <ebb9@byu.net>
3009         Port format improvements from branch.
3010         * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
3011         (Format): Enhance section.
3012         * modules/format.c (format): Accept %'hhd, and issue warnings on
3013         unrecognized specifiers.
3014         * modules/gnu.c (builtin_format): Adjust how format is called.
3016 2007-05-28  Eric Blake  <ebb9@byu.net>
3018         * tests/options.at (--syncoutput): Add xfailed test.
3020         Fix sync line interaction with multiline comments.
3021         * doc/m4.texinfo (Preprocessor features): Improve documentation.
3022         (Syncoutput): Improve testsuite.
3023         (Incompatibilities): Add testcase, and document bug.
3024         * src/freeze.c (reload_frozen_state): Don't interfere with
3025         synclines when reloading state.
3026         * m4/input.c (m4__next_token): Report line where multiline tokens
3027         start.
3028         * m4/m4private.h (m4__token_type): Add parameter.
3029         * m4/m4module.h (m4_output_text): Export.
3030         (m4_shipout_text): Add parameter.
3031         * src/macro.c (m4_macro_expand_input, expand_token)
3032         (expand_argument): Adjust callers so that line is passed from
3033         input to output.
3034         * m4/output.c (output_text): Rename...
3035         (m4_output_text): ...to this, and export.
3036         (m4_insert_file, insert_diversion_helper): Update callers.
3037         (m4_shipout_text): Take new parameter for start line of token.
3038         Output at most one syncline per token.
3039         Reported by Sergey Poznyakoff.
3041         Fix large diversion corner cases.
3042         * tests/freeze.at (large diversion): New test.
3043         * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
3044         (make_room_for): Use NULL, not 0, for pointers.
3045         (m4_freeze_diversions): Allow freezing large diversions.
3046         (insert_diversion_helper): Avoid using rewind.
3048         Also run gnulib unit tests during make check.
3049         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3050         --tests-base=tests/gnu --with-tests'.
3051         * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
3052         * Makefile.am (SUBDIRS): Run gnulib tests before ours.
3054 2007-05-25  Eric Blake  <ebb9@byu.net>
3056         * m4/system_.h: Include <stdint.h>, for intmax_t.
3057         * THANKS: Update.
3058         Reported by Daniel Richard G.
3060 2007-05-24  Eric Blake  <ebb9@byu.net>
3062         Provide consistent shift semantics regardless of hardware.
3063         * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
3064         before shifting.
3065         (number, unumber): Always use [u]intmax_t.
3066         Reported by Gary V. Vaughan.
3068         Support POSIX flush semantics on all platforms.
3069         * modules/m4.c (m4_sysval_flush): Rely on gnulib.
3070         * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
3072         Work around cygwin and mingw fseeko bugs.
3073         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3074         fseeko'.
3075         * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
3077 2007-04-25  Eric Blake  <ebb9@byu.net>
3079         Test that regression in 1.4.9's eval doesn't recur.
3080         * doc/m4.texinfo (Eval): Check negative division.
3081         * THANKS: Update.
3083 2007-04-12  Eric Blake  <ebb9@byu.net>
3085         Allow for running test in sticky or setgid directory.
3086         * tests/builtins.at (mkdtemp): Adjust test.
3088         Don't test for broken sed too soon.
3089         * tests/others.at (stdin seekable): Rearrange subtests.
3091         Work around 'stdin seekable' shortcoming on glibc.
3092         * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
3093         * tests/others.at (stdin closed): Adjust to new output.
3094         * src/main.c (process_file): No need to return anything.
3095         (main): Use close_stdin instead of close_stdout.
3096         Reported by Ralf Wildenhues.
3098         Enable autobuild usage.
3099         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3100         autobuild'.
3101         * configure.ac (AB_INIT): Output autobuild information.
3103 2007-04-11  Eric Blake  <ebb9@byu.net>
3105         Address testsuite shortcoming in 'stdout full' on glibc.
3106         * tests/others.at (stdout full): Adjust expected output when more
3107         than 1k text is printed to /dev/full.
3108         Reported by Ralf Wildenhues.
3110 2007-04-10  Eric Blake  <ebb9@byu.net>
3112         * tests/macros.at (Arity and defn): Fix quoting.
3114 2007-04-09  Eric Blake  <ebb9@byu.net>
3116         Address failure of 'seekable stdin' on Mac OS X.
3117         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3118         fflush'.
3120 2007-04-07  Eric Blake  <ebb9@byu.net>
3122         Include <config.h> first in all C files, and not in headers.
3123         Fixes regression for --disable-assert builds from 2007-04-02.
3124         * src/m4.h (includes): Don't include config.h here.
3125         * m4/m4private.h (includes): Likewise.
3126         * m4/builtin.c: Include config.h before anything else.
3127         * m4/debug.c: Likewise.
3128         * m4/hash.c: Likewise.
3129         * m4/input.c: Likewise.
3130         * m4/m4.c: Likewise.
3131         * m4/macro.c: Likewise.
3132         * m4/module.c: Likewise.
3133         * m4/symtab.c: Likewise.
3134         * m4/syntax.c: Likewise.
3135         * m4/utility.c: Likewise.
3136         * src/freeze.c: Likewise.
3137         * src/stackovf.c: Likewise.
3139 2007-04-03  Eric Blake  <ebb9@byu.net>
3141         * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
3142         SIGFPE on x86 architectures.
3143         Reported by Ralf Wildenhues.
3145 2007-04-02  Eric Blake  <ebb9@byu.net>
3147         Fix warnings from last commit.
3148         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3149         fprintf-posix sprintf-posix'.
3150         * m4/macro.c (expand_macro, trace_format): Use correct specifier
3151         for size_t.
3152         (process_macro): Avoid negative array index.
3153         * src/freeze.c (produce_resyntax_dump, produce_module_dump)
3154         (dump_symbol_CB, produce_frozen_state): Use correct specifier for
3155         size_t.
3157 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
3159         Get rid of the last 'differs in signedness' compiler warnings:
3161         * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
3162         a regular 'char *', so variables to store the return address,
3163         and iterate through it should be regular 'char *' too.
3164         * m4/input.c (m4_input_block): The start and current members of
3165         the string part of this union store regular 'char *' types, so
3166         they should be regular 'char *' types too.
3168 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
3170         M4 was designed to have a small number of header files defining
3171         the interfaces to several source files each.  Keeping this in
3172         mind allows us to tidy things up considerably.  Having done this,
3173         it becomes clear that some of the installed headers reference
3174         other headers which are not installed (but that's another patch):
3176         * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
3177         here...
3178         * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
3179         ...to here, so client modules can benefit too.
3180         (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
3181         lowest level to save doing it multiple times elsewhere.
3182         * m4/debug.c (stdio.h): Removed.  The portable <gnu/stdio--.h>
3183         is already included via m4private.h.
3184         * modules/time.c (stdio.h): Ditto.
3185         * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
3186         * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
3187         and <gnu/unistd--.h>,
3188         * m4/m4private.h (m4module.h): Use angle brackets for an installed
3189         file.
3190         * m4/hash.h (system.h): Ditto.
3191         * modules/gnu.c (progname.h): Removed.
3192         * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
3193         * m4/m4private.h (assert.h, errno.h): Already included via
3194         m4/m4module.h.
3195         * m4/input.c (ctype.h): Ditto.
3196         * m4/module.c (ltdl.h): Ditto.
3197         * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
3198         (unistd.h): Ditto.
3199         * m4/path.c (config.h, stdlib.h): Ditto.
3200         * m4/utility.c (config.h): Ditto.
3201         * modules/evalparse.c (assert.h, ctype.h): Ditto.
3202         * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
3203         * modules/import.c (assert.h): Ditto.
3204         * modules/m4.c (assert.h, errno.h): Ditto.
3205         * modules/modtest.c (assert.h): Ditto.
3206         * modules/stdlib.c (sys/types.h): DittAo.
3207         * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
3208         Ditto.
3209         * src/stackovf.c (assert.h): Ditto.
3210         * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
3211         private interfaces when NDEBUG is defined.
3212         * modules/import.c (m4/m4module.h, m4private.h): Ditto.
3213         * modules/load.c (m4/m4module.h, m4private.h): Ditto.
3214         * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
3215         * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
3216         * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
3217         * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
3218         * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
3219         * modules/time.c (m4/m4module.h, m4private.h): Ditto.
3220         * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
3221         * src/m4.h (locale.h): Moved from here...
3222         * src/main.h: ...to here.
3223         (m4private.h): Already included via m4.h.
3224         * src/stackovf.c (m4private.h): Ditto.
3226 2007-03-28  Gary V. Vaughan  <gary@gnu.org>
3228         * Makefile.am (stamp-vcl): Removed.
3229         (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
3231 2007-03-28  Eric Blake  <ebb9@byu.net>
3233         * src/main.c (usage): Improve note to TRANSLATORS.
3234         * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
3236         * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
3237         empty.
3239 2007-03-24  Eric Blake  <ebb9@byu.net>
3241         * m4/output.c (m4_output_init): Update to latest gnulib.
3242         * bootstrap (ltdl/m4/.cvsignore): No longer track generated
3243         .cvsignore in CVS.
3244         * NEWS: Reflect release of 1.4.9.
3245         * THANKS: Update.
3247 2007-03-07  Eric Blake  <ebb9@byu.net>
3249         * AUTHORS: Update
3251         Exercise gnulib's new POSIX *printf modules.
3252         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3253         vasprintf-posix'.
3254         * modules/format.c (format): Support %a and %A.
3255         * doc/m4.texinfo (Format): Test this addition.
3256         * NEWS: Document this addition.
3258 2007-03-03  Eric Blake  <ebb9@byu.net>
3260         * m4/input.c (m4__next_token): Fix synclines when in batch mode.
3261         * doc/m4.texinfo (M4exit): Synch another section.
3262         (Syncoutput): Make similar to other sections.
3264 2007-03-01  Eric Blake  <ebb9@byu.net>
3266         * doc/m4.texinfo: Improve the indices.
3267         (Concept index): Rearrange to be last.
3268         (Sysval): Merge from branch.
3270         * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
3272 2007-02-28  Eric Blake  <ebb9@byu.net>
3274         POSIX XCU ERN 137 was approved.
3275         * modules/mpeval.c (numb_extension): Delete.
3276         * modules/m4.c (numb_extension): Likewise.
3277         * modules/evalparse.c (comma_term, condition_term): Always
3278         implement ?: and , operators.
3279         * m4/symtab.c: Update comment to match reality.
3280         * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
3281         dereferencing context directly when accessor exists.
3282         * src/main.c (usage): Prefer GNU_M4 over EMACS.
3283         (struct macro_definition): Rename...
3284         (struct deferred): ...to match usage.  All uses changed.
3285         * doc/m4.texinfo (Eval): Document this change.
3286         (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
3287         over emacs.
3288         (Preprocessor features, Changesyntax): Fix inaccuracies.
3289         * NEWS: Import branch NEWS items for 1.4.x series.  Document
3290         change in eval.
3292         POSIX XCU ERN 118 was approved.
3293         * modules/m4.c (define): Kill posixly_correct distinction in
3294         define behavior, since POSIX says GNU behavior complies.
3295         * tests/builtins.at (define): Restore original semantics.
3296         * doc/m4.texinfo (Pushdef): Document portability issues with
3297         define.
3298         (Incompatibilities): Clean up wording of what POSIX requires.
3299         * NEWS: Document this.
3301 2007-02-26  Eric Blake  <ebb9@byu.net>
3303         Re-enable clean bootstrap on cygwin.
3304         * Makefile.am (AM_LDFLAGS): For now, export all symbols from
3305         modules, since otherwise we run afoul of current libtool
3306         limitations on cygwin and mingw.
3308 2007-02-25  M. Levinson  <levinsm@users.sourceforge.net>  (tiny change)
3310         * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
3311         memory.  Fixes regression introduced 2007-01-20.
3313 2007-02-25  Eric Blake  <ebb9@byu.net>
3315         * tests/freeze.at (loading format 2): Augment test to catch
3316         regression introduced on 2007-01-20.
3317         * THANKS: Update.
3318         Reported by M. Levinson.
3320         * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3321         latest gnulib.
3323 2007-02-05  Eric Blake  <ebb9@byu.net>
3325         * tests/options.at (--fatal-warnings): New test.
3326         * tests/others.at (stdin seekable): Exit on error.
3327         * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3328         (m4_get_warnings_exit_opt): Access it.
3329         * m4/m4module.h (m4_context_opt_bit_table): Access it.
3330         * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3331         on -EE.
3332         (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3333         exit on -EE.
3334         * src/m4.c (usage): Document new -E behavior.
3335         (main): Make -E an additive option.
3336         * doc/m4.texinfo (Operation modes): Document the change.
3337         Reported by Ralf Wildenhues.
3339         * tests/others.at (stdin seekable): Fix bug in test.
3340         * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3342         * m4/input.c (struct m4_input_block): Remove unused field traced.
3344 2007-02-03  Eric Blake  <ebb9@byu.net>
3345         and Bruno Haible  <bruno@clisp.org>  (tiny change)
3347         * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3348         the examples.
3349         Reported by Bruno Haible.
3351 2007-01-31  Eric Blake  <ebb9@byu.net>
3353         * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3354         failure.
3356 2007-01-26  Eric Blake  <ebb9@byu.net>
3358         * m4/symtab.c (includes): Adjust to latest gnulib.
3359         * modules/m4.c (includes): Likewise.
3361 2007-01-23  Eric Blake  <ebb9@byu.net>
3363         * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3364         extension to make enough room.
3365         (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3366         code in input.c special cases this category.
3367         (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3368         for define(eleventh,${11}) extension.
3369         * m4/syntax.c: Update comments accordingly.
3370         (m4_syntax_create, m4_syntax_code): Handle { and }.
3371         * m4/input.c (m4__next_token): Likewise.
3372         * src/freeze.c (produce_frozen_state): Support new categories.
3373         (reload_frozen_state): When loading version 1, disable syntax
3374         features not present in 1.4.x.
3375         * tests/freeze.at: Sort and rename existing tests.
3376         (loading format 1): Ensure we don't break v1 frozen files that
3377         used raw ${.
3378         (loading format 2, reloading changecom, reloading changesyntax):
3379         New tests.
3380         * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3381         the new syntax categories.
3382         (Arguments): Update the FIXME comment.
3383         (M4wrap): Merge examples from branch, before worrying about fixing
3384         m4wrap to obey POSIX.
3385         (Using frozen files): Start merging from branch.
3386         * NEWS: Update.
3388 2007-01-20  Eric Blake  <ebb9@byu.net>
3390         * src/freeze.c (produce_char_dump): Delete.  Replace with...
3391         (produce_mem_dump): ...this new function, to encode more strings.
3392         Also make the coding easier to read and slightly more compact.
3393         (produce_syntax_dump): Only dump non-default syntax codes.
3394         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3395         Encode non-ASCII characters in user-supplied strings.
3396         (GET_STRING): Accept escape sequences in version 2.
3397         * NEWS: Document this change.
3398         * TODO: Update.
3400 2007-01-16  Eric Blake  <ebb9@byu.net>
3402         Port patch from branch for stack overflow detection on BSD/OS.
3403         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3404         * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3405         ! HAVE_STACK_T_SS_SP]: Use this check.
3406         Reported by Chris McGuire.
3408 2007-01-15  Eric Blake  <ebb9@byu.net>
3410         * tests/builtins.at (__m4_version__): New test.
3411         * modules/traditional.c (m4_macro_table): Provide windows and os2
3412         macros, as appropriate.  Add __traditional__ macro.
3413         * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3414         not __gmp__, to match module name.
3415         * modules/load.c (m4_macro_table): Name the macro __load__, not
3416         __modules__, to match module name.
3417         * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3418         from the branch.
3419         (Standard Modules): Improve wording.
3420         (Incompatibilities): Move platform macros into their own node.
3421         (Load, Unload): Use actual examples.
3422         * NEWS: Document this change.
3423         * THANKS: Update.
3425 2007-01-13  Eric Blake  <ebb9@byu.net>
3427         * doc/m4.texinfo (Mpeval): Add tests.
3428         * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3429         * tests/builtins.at (gmp): ...here.  Rename test to...
3430         (mpeval): ...this.
3431         * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3432         is not available.
3433         * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3434         no_gnu_extensions with posixly_correct_opt, since they were set in
3435         sync.
3436         * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3437         * src/main.c (main): Update caller.
3438         * src/freeze.c (reload_frozen_state): Likewise.
3439         * modules/m4.c (m4wrap): Likewise.
3441 2007-01-12  Eric Blake  <ebb9@byu.net>
3443         * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3444         POSIX, so update the comment.
3445         * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3446         approved by POSIX, so we can always have blind macros, even when
3447         POSIXLY_CORRECT.
3448         (Ifelse): Mention the term `blind builtin'.
3450 2007-01-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3452         * doc/m4.texinfo: Fix a couple of typos.
3454 2007-01-08  Eric Blake  <ebb9@byu.net>
3456         * ltdl/m4/gnulib-cache.m4: Update for new year.
3457         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3458         Reported by Ralf Wildenhues.
3460 2007-01-06  Eric Blake  <ebb9@byu.net>
3462         * m4/m4private.h (to_uchar): Move...
3463         * m4/m4module.h: here, so modules can use it.
3464         * src/main.c (usage, long_options): Support --posix as a synonym
3465         for --traditional.
3466         * modules/m4.c (numb_invert): Detect unsupported x**-y.
3467         (numb_incr, numb_urshift, numb_extension): New macros.
3468         (numb_obstack): Port patch from branch to support radix 1 output.
3469         * modules/mpeval.c (numb_obstack): Use \ for ratios.
3470         (numb_incr, numb_urshift, numb_extension): New macros.
3471         (mpq2mpz): Warn rather than error.
3472         * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3473         enumerators.
3474         (eval_error): Rearrange, so that all ignorable errors are less
3475         than SYNTAX_ERROR.
3476         (eval_text, last_text): Obey C++ type safety rules.
3477         (numb_pow): Change return type.
3478         (exp_term): Adjust caller.
3479         (m4_evaluate): Fail on bad exponent.
3480         (logical_or_term, logical_and_term): Ignore failed ** in short
3481         circuit.
3482         (eval_lex): Fix typos when detecting <<= and >>=.  Use \ instead
3483         of : for ratio.  Support >>>, ,, and ?:.  Port patch from branch
3484         to parse radix 1 numbers.
3485         (condition_term, comma_term): New parse functions.
3486         (shift_term): Support >>>.
3487         (m4_evaluate): Port patch from branch to output radix 1 numbers.
3488         Warn instead of error for most parse problems.
3489         * doc/m4.texinfo (Limits control, Eval): Document these changes.
3490         * NEWS: Document new operators and new command line option.
3492 2007-01-04  Eric Blake  <ebb9@byu.net>
3494         * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3496 2007-01-03  Eric Blake  <ebb9@byu.net>
3498         * doc/m4.texinfo (Format, Incr): More merges.
3499         (Eval): Ensure C precedence rules are met.
3500         * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3501         (not_term, logical_not_term): Delete; these are same precedence
3502         as other unary operators.
3503         (equality_term): New; these are lower precedence than relational
3504         operators.
3505         (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3506         operators for better error messages.
3507         (logical_or_term, logical_and_term): Short-circuit out the error
3508         of division by zero.
3509         (unary_term): Allow consecutive unary operators.
3510         * modules/m4.c (int2numb, numb2int): Delete; these potentially
3511         truncate bits.
3512         (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3513         * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3514         * NEWS: Document this change.
3516 2006-12-27  Eric Blake  <ebb9@byu.net>
3518         * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3519         branch.
3520         * modules/m4.c (substr): Merge from branch.
3522 2006-12-26  Eric Blake  <ebb9@byu.net>
3524         * doc/m4.texinfo (Changesyntax): Check for regressions with
3525         changesyntax(W=...).
3527 2006-12-22  Eric Blake  <ebb9@byu.net>
3529         * m4/m4module.h (m4_set_syntax): Change signature.
3530         * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3531         warning.
3532         (changesyntax): Likewise, and update caller.
3533         * m4/m4private.h (m4_syntax_table): Add orig member.
3534         * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3535         Don't set is_single_quotes and is_single_comments when the begin
3536         character is shadowed by another syntax type.
3537         (m4_syntax_create): Populate default syntax table.
3538         (add_syntax_attribute): Don't lose quote assignment.
3539         (remove_syntax_attribute): Only allow removing rquote or ecomm.
3540         (add_syntax_set, subtract_syntax_set, set_syntax_set)
3541         (reset_syntax_set): New helper routines.
3542         (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3543         to default, and empty chars reverts that key to default.
3544         (check_is_single_quotes, check_is_single_comments): New helper
3545         routines.
3546         * modules/m4.c (changecom): Merge from branch.
3547         * m4/input.c (m4__next_token): Rearrange token recognition order
3548         to macro, quote, comment, in order to match traditional
3549         implementations.
3550         * src/freeze.c (reload_frozen_state): Update caller.
3551         * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3552         modifications.
3553         (Changeresyntax): Revise to match style of surrounding sections
3554         and add more examples.
3555         (Changesyntax): Likewise, and update to new semantics.
3556         * NEWS: Document this change.
3558         * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3559         (M4wrap, Eval, Errprint): Fix typos.
3560         (Divnum): Not necessary to redivert in example.
3562 2006-12-21  Eric Blake  <ebb9@byu.net>
3564         * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3565         from branch.
3567 2006-12-19  Eric Blake  <ebb9@byu.net>
3569         * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3570         * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3571         can track write errors without all other callers warning multiple
3572         times.
3573         (sysval_flush_helper): New function.
3574         (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3575         * modules/gnu.c (esyscmd): Likewise.
3576         * tests/others.at (stdout closed, stdout full): Error message
3577         update.
3579 2006-12-16  Eric Blake  <ebb9@byu.net>
3581         * src/main.c: Fix missing include.
3583         * src/main.c (main): Check for errors when closing stdin.
3584         * modules/m4.c (m4exit): Missed part of previous patch: flush
3585         stdin before a successful exit.
3586         Reported by Ralf Wildenhues.
3588 2006-12-14  Eric Blake  <ebb9@byu.net>
3590         * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
3591         required by POSIX.
3592         * tests/others.at (stdin seekable): New test.
3594 2006-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3596         * doc/m4.texinfo: Fix some typos.
3598 2006-12-04  Eric Blake  <ebb9@byu.net>
3600         * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
3601         sections.
3602         (Modules): Make style consistent.
3604 2006-11-16  Eric Blake  <ebb9@byu.net>
3606         * bootstrap: Relax m4 requirement, thanks to...
3607         * configure.ac (Gettext support): ...this workaround to the 1.4.4
3608         bug.  Undoes restriction added on 2006-11-09.
3610         * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
3611         diversions are now closed when not active.
3612         (divert): Remove check now in the manual.
3613         * tests/others.at (stderr closed): Likewise.
3614         (stdout closed): Add a check.
3615         * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
3616         more docs with branch.
3618 2006-11-14  Eric Blake  <ebb9@byu.net>
3620         Remerge sparse diversion handling from branch.
3621         * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
3622         avltree-oset.
3623         * m4/output.c (diversion_table): Change type to gl_oset_t.
3624         (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
3625         (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
3626         (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
3627         (div0, diversion_storage): New variables.
3628         (diversions, equal_diversion_CB): Deleted.
3629         (threshold_diversion_CB): New callback.
3630         (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
3631         functions.
3632         (m4_tmpfile): Move cloexec action here.
3634         * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
3635         char.
3637 2006-11-13  Eric Blake  <ebb9@byu.net>
3639         Add several new command line options.
3640         * src/main.c (usage): Update.
3641         (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
3642         --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
3643         Make --regexp-syntax argument optional.
3644         (main): Support new options.  Fix regression in interactive
3645         behavior from Nov 8.
3646         * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
3647         M4_OPT_SYNC_OUTPUT_BIT.
3648         * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
3649         syncoutput, to match option.
3650         (m4_parse_truth_arg): New prototype.
3651         * m4/utility.c (m4_parse_truth_arg): Implement it.
3652         * m4/output.c (m4_shipout_text): Adjust sync_output caller.
3653         * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
3654         m4_parse_truth_arg.
3655         * doc/m4.texinfo (Operation modes, Dynamic loading features)
3656         (Preprocessor features, Limits control, Debugging options)
3657         (Command line files): Update documentation.
3658         * tests/builtins.at (mkstemp): Simplify.
3659         * tests/macros.at (Command line pushdef): New test.
3660         (Command line define): Improve.
3661         * tests/options.at (--traceon and --traceoff, --syncoutput): New
3662         tests.
3663         (POSIXLY_CORRECT): Likewise.
3664         (deprecated options): Augment.
3665         (--regexp-syntax): Update, now that -r takes optional arg.
3666         * NEWS: Reformat.  Document new options.
3668 2006-11-11  Eric Blake  <ebb9@byu.net>
3670         One step closer to allowing C++ compilation - don't blindly
3671         convert between char* and unsigned char*.
3672         * m4/m4module.h (m4_set_syntax): Change signature.
3673         * m4/m4private.h (m4_string): Use signed char.
3674         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
3675         (m4_get_syntax_ecomm): No longer a need to cast.
3676         * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
3677         Reflect this change.
3678         * m4/macro.c (expand_argument): Simplify.
3679         (expand_token): Use proper type.
3680         * src/freeze.c (reload_frozen_state): Likewise.
3681         * m4/input.c (MATCH, match_input): Likewise.
3682         * modules/m4.c (translit): Likewise.
3683         * modules/gnu.c (substitute): Simplify.
3685         * m4/macro.c (trace_format): Use canonical type name.
3686         * m4/output.c (m4_freeze_diversions): Likewise.
3687         * src/freeze.c (produce_module_dump, dump_symbol_CB)
3688         (produce_frozen_state): Likewise.
3689         * m4/m4private.h (to_uchar): Grab from branch.
3690         * m4/input.c (string_peek, string_read): Use it.
3691         * m4/utility.c (skip_space): Likewise.
3692         * src/main.c (main): Likewise.
3693         * doc/m4.texinfo (Translit): Remerge from branch.
3694         * tests/builtins.at (translit): Test 8-bit range.
3695         * modules/m4.c (m4_expand_ranges): Merge from branch.
3697 2006-11-09  Eric Blake  <ebb9@byu.net>
3699         * bootstrap: Validate that installed M4 is powerful enough.
3700         Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
3702 2006-11-08  Eric Blake  <ebb9@byu.net>
3704         Merge deferred handling of -D option from branch.
3705         * doc/m4.texinfo (Debugging options, Preprocessor features)
3706         (Dynamic loading features, Operation modes, Invoking m4):
3707         Document this change.
3708         * src/main.c (OPTSTRING): Specify in-order processing.
3709         (process_file): New function.
3710         (main): Use it to interleave files and deferred options.
3711         * tests/macros.at (Command line define): New test.
3712         * tests/generate.awk: Allow '@comment file' as first example
3713         within a node.
3714         * tests/options.at (option grouping): Update to reflect actual
3715         POSIX semantics.
3716         (file names): New test.
3718 2006-11-07  Eric Blake  <ebb9@byu.net>
3720         * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
3721         for failure.
3723         * tests/builtins.at (m4exit): New test; failed on cygwin before
3724         this patch.
3725         * m4/output.c (cleanup_tmpfile): Close files before removing
3726         directory.
3727         (make_room_for, m4_output_exit): Ensure that atexit handler
3728         invoked from m4_error sees consistent state.
3730         * doc/m4.texinfo (Errprint): Merge another doc node.
3731         * tests/builtins.at (dumpdef, errprint): New tests.
3732         * modules/m4.c (errprint): Merge from branch: flush before
3733         printing to stderr.
3735 2006-11-02  Eric Blake  <ebb9@byu.net>
3737         * bootstrap: Update bootstrap requirement wording.
3738         Reported by Bruno Haible.
3740 2006-10-31  Eric Blake  <ebb9@byu.net>
3742         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3743         strstr'.
3744         * doc/m4.texinfo (Translit): Merge from branch.
3745         * modules/m4.c (divert, substr): Ignore excess arguments.
3746         (index, translit): Merge from branch.
3747         * tests/builtins.at (translit): Add a test.
3749 2006-10-30  Eric Blake  <ebb9@byu.net>
3751         * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
3752         checkin.
3753         * m4/symtab.c (m4_get_symbol_value_module): Likewise.
3755         * modules/m4.c (m4_make_temp): Make safe across libtool.
3756         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
3757         * configure.ac (--with-modules): Accomodate changed module
3758         location when doing './configure --enable-debug'.
3760 2006-10-28  Eric Blake  <ebb9@byu.net>
3762         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3763         config-h.'
3765 2006-10-27  Eric Blake  <ebb9@byu.net>
3767         * bootstrap (gnulib): No longer a need to patch after gnulib-tool
3768         --update.
3769         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3770         0.16, since 0.15 is incompatible with our automake requirement.
3772         * m4/macro.c (expand_argument): Fix missing initialization.
3773         * m4/m4private.h (struct m4_symbol_value): Store entire
3774         m4_builtin, not just the func.
3775         (m4_get_symbol_value_func): Update.
3776         (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
3777         fast accessors.
3778         * m4/m4module.h (m4_get_symbol_value_builtin)
3779         (m4_get_symbol_builtin): New prototypes.
3780         (m4_set_symbol_value_func): Delete, replace with...
3781         (m4_set_symbol_value_builtin): New function.
3782         (m4_builtin_find_by_name): Change signature.
3783         * m4/symtab.c (m4_symbol_value_print): Simplify.
3784         (m4_get_symbol_value_func): Update.
3785         (m4_get_symbol_value_builtin): New function.
3786         (m4_set_symbol_value_func): Delete, replace with...
3787         (m4_set_symbol_value_builtin): New function.
3788         (dump_symbol_CB) [DEBUG_SYM]: Simplify.
3789         * m4/builtin.c (m4_builtin_find_by_name): Change signature.
3790         * m4/input.c (struct m4_input_block): Remove unused trace member.
3791         (m4_push_builtin, builtin_print, init_builtin_token): Update
3792         callers.
3793         * m4/module.c (install_builtin_table): Likewise.
3794         * src/freeze.c (reload_frozen_state): Likewise.
3795         * modules/gnu.c (builtin): Make it possible to retrieve a builtin
3796         token, even after the builtin has been undefined.
3797         * doc/m4.texinfo (Builtin): Document new capability.
3798         * NEWS: Likewise.
3800         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3801         tempname'.
3802         * modules/m4.c (m4_make_temp): Use it.
3803         * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
3805 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3807         * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
3808         files.
3810 2006-10-26  Eric Blake  <ebb9@byu.net>
3812         Silence -O2 -Wall -Wwrite-strings warnings.
3813         * m4/m4private.h (m4_symbol_value): Const-ify text.
3814         * m4/m4module.h (m4_get_symbol_value_text)
3815         (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
3816         (m4_set_symbol_value_placeholder): Likewise.
3817         * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
3818         fallout.
3819         * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
3820         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
3821         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
3822         Likewise.
3823         * modules/format.c (format): Likewise.
3824         * src/main.c (main): Likewise.
3825         * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
3826         * modules/shadow.c (shadow, test): Likewise.
3827         * m4/output.c (m4_make_diversion): Don't hold on to empty
3828         diversions.
3829         (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
3830         (m4_freeze_diversions): Likewise.  Don't use uninitialized
3831         variable.
3833         Convert diversions to list instead of sparse array, part 2.
3834         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3835         avltree-list'.
3836         * m4/output.c (m4_diversion): Add next pointer and divnum members.
3837         (diversion_table): Convert to a list instead of a sparse array.
3838         (free_list): Maintain free list of reclaimed diversions.
3839         (equal_diversion_CB, cmp_diversion_CB): New functions.
3840         (m4_output_init): Set up list.
3841         (m4_output_exit): Tear down list.
3842         (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
3843         list iteration.
3844         (m4_make_diversion): Change creation of new diversions.
3845         (m4_insert_diversion_helper): New function, to avoid list
3846         searches.
3847         * tests/builtins.at (divert): The test now passes.
3848         * NEWS: Document this improvement.
3850         Convert diversions to list instead of sparse array, part 1.
3851         * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
3852         for length.
3853         * m4/output.c (diversion, total_buffer_size, output_unused):
3854         Track size in size_t.  All users changed.
3855         (struct diversion): Reduce size now, to compensate for part 2.
3856         (m4_make_diversion, make_room_for): Avoid malloc overflow.
3857         (m4_output_exit): Fix typo in assert.
3858         (m4_output_init, make_room_for, m4_make_diversion)
3859         (m4_insert_diversion, m4_freeze_diversions): Adjust users of
3860         struct m4_diversion to disambiguate the new union.
3861         * tests/builtins.at (divert): Detect this failure.
3863 2006-10-25  Eric Blake  <ebb9@byu.net>
3865         * m4/m4module.h (m4_push_builtin): Add parameter.
3866         * modules/m4.c (defn): Update caller.
3867         * m4/input.c (file_read_init, string_read_init): No longer
3868         needed.
3869         (input_funcs): Change signature of read_func, all callers
3870         updated.
3871         (composite_peek, composite_read, composite_unget),
3872         (composite_print, composite_funcs): New input type.  Not yet
3873         fully utilized, but one step closer to fixing defn.
3874         (m4_input_block): Make every input block track current file and
3875         line.  Rename some members.  Remove unused out_line.  Add support
3876         for composite input block.
3877         (input_change): New flag.
3878         (file_peek, file_read, file_clean, file_unget, file_print):
3879         Update callers.
3880         (m4_push_file, m4_push_builtin, m4_push_string_init)
3881         (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3882         (m4_skip_line, pop_input): Track input block changes.
3883         (m4_pop_wrapup): Avoid overflow.
3884         (init_builtin_token): Handle composite input.
3885         (next_char): Handle input block changes.
3886         * doc/m4.texinfo (Location): Remerge from branch.
3888         * src/m4.h (includes): Need <locale.h> after all; fixes
3889         regression from yesterday.
3891         * m4/system_.h (obstack_regrow): New macro.  Hopefully glibc will
3892         accept it someday.
3893         * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3894         Handle nesting the argc obstack.
3895         (expand_token): Avoid unnecessary malloc.
3896         (collect_arguments): Copy name before invalidating it.
3897         (argc_stack, argv_stack): New variables.
3898         (m4_macro_expand_input): Initialize argc and argv stacks once per
3899         file, instead of once per macro.
3901 2006-10-24  Eric Blake  <ebb9@byu.net>
3903         * src/m4.h (includes): Add gettext.h, for N_.  Assume setlocale.
3905 2006-10-23  Eric Blake  <ebb9@byu.net>
3907         * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
3908         from branch regarding stripped leading whitespace.
3910         * modules/m4.c (includes): Use safe headers even when configured
3911         with --enable-assert.
3912         (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
3913         #defined as mkstemp_safer.
3915 2006-10-21  Eric Blake  <ebb9@byu.net>
3917         * modules/m4.c (m4_make_temp): Change signature.
3918         (maketemp, mkstemp): Update callers.
3919         * modules/m4.h (m4_make_temp_func): New export.
3920         * modules/gnu.c (mkdtemp): New macro.
3921         * doc/m4.texinfo (Operation modes): Document interaction with
3922         --safer.
3923         (Mkdtemp): New node.
3924         * tests/builtins.at (mkdtemp): New test.
3925         (mkstemp): Check for umask effect.
3926         * NEWS: Document new builtin.
3928         * tests/generate.awk (normalize): Update recognition of trailing
3929         spaces in tests.
3930         * doc/m4.texinfo: Minor formatting fixes from branch.
3931         (Foreach, Improved foreach): Merge from branch.
3932         * examples/foreach.m4: Merge from branch.
3933         * examples/foreachq.m4: New file from branch.
3934         * examples/foreach2.m4: Likewise.
3935         * examples/foreachq2.m4: Likewise.
3937         * doc/m4.texinfo (titlepage): Add myself as author.
3938         * src/main.c (AUTHORS): Likewise.
3940 2006-10-19  Eric Blake  <ebb9@byu.net>
3942         * modules/m4.c (m4_make_temp, mkstemp): New functions.
3943         (maketemp): Add POSIX behavior and a warning.
3944         * tests/others.at (maketemp): Move this test...
3945         * tests/builtins.at (mkstemp): ...to here, and beef up.
3946         * tests/options.at (--safer): Update to new warning message.
3947         * doc/m4.texinfo (Mkstemp): Sync from branch.
3948         (Extensions): Update maketemp behavior.
3949         * NEWS: Document that maketemp now always warns.
3951         * tests/generate.awk: For ease of doc-writing, simplify selection
3952         of '-Ipath/to/examples' to '@comment examples'.
3953         * examples/forloop.m4: Simplify.
3954         * examples/forloop2.m4: New file.
3955         * examples/quote.m4: New file.
3956         * doc/m4.texinfo (Improved forloop): New node.
3957         (Manual): Clarify use of examples directory.
3958         (Shift, Forloop): Resync from branch.
3959         (Include, Location): Update to new usage of examples directory.
3961         * m4/system_.h (includes): Pick up <unistd.h> before checking for
3962         _POSIX_VERSION.
3963         (gettext_noop): Don't define here, let gettext.h do it instead.
3964         * po/POTFILES.in: Update entries to reflect gnulib imports.
3966 2006-10-16  Eric Blake  <ebb9@byu.net>
3968         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3969         configmake'.
3970         * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
3971         pkglibexecdir support.
3972         * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
3973         worry about pathconf.h, now that gnulib does it for us.
3974         (pkgmodincludedir): Simplify.
3975         (pkglibexecdir): Delete, now that automake does this.
3976         * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
3977         * src/main.c (usage): Likewise.
3978         * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
3980         * doc/m4.texinfo: Port some changes from the branch.
3981         (Invoking m4): Promote to a chapter, instead of a section of
3982         Preliminaries.
3983         (Operation modes, Dynamic loading features, Preprocessor features)
3984         (Limits control Frozen state, Debugging options)
3985         (Command line files): Subdivide into new sections.
3986         (Cleardivert): Rename from cleardiv.
3988 2006-10-14  Eric Blake  <ebb9@byu.net>
3990         * tests/others.at (stdin closed): Update to match previous patch.
3992         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
3993         is not portable.
3994         Reported by Ralf Wildenhues.
3996         * modules/m4.c (undivert): Merge from branch.
3997         * doc/m4.texinfo (Improved fatal_error): Fix typo.
3998         (Improved exch): New node, copied from branch.
3999         (Improved cleardivert): Update from branch.
4000         * THANKS: Update.
4002 2006-10-13  Eric Blake  <ebb9@byu.net>
4004         * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
4005         not config-h.in.
4006         * modules/gnu.c (builtin, indir): Transparently handle builtin
4007         tokens from defn.
4008         * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
4009         * m4/input.c (m4_pop_wrapup): Display debug message when switching
4010         to wrapped text.
4011         (m4_input_init): No need to use empty file any more.
4012         (file_print): Display correct file name.
4013         * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
4014         dereference a NULL file name.
4015         * m4/m4module.h (m4_pop_wrapup): New parameter.
4016         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
4017         prototypes.
4018         * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
4019         * m4/symtab.c (m4_symbol_value_groks_macro): New method.
4020         * src/main.c (main): Adjust caller.
4021         * tests/options.at (--debugmode): Test more output from -dV.
4023 2006-10-12  Eric Blake  <ebb9@byu.net>
4025         * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
4027         * m4/m4private.h (m4__next_token_is_open): New prototype.
4028         * m4/m4module.h (m4_push_single): Delete; push_string is an
4029         adequate interface, and removing support for this simplifies the
4030         input engine.
4031         (m4_push_wrapup): New parameter.
4032         (m4_is_syntax): Delete; m4_has_syntax is sufficient.
4033         (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
4034         start-quote and start-comment exclusive from other syntax
4035         categories.
4036         * m4/syntax.c: Likewise.
4037         * m4/input.c (input_funcs): Make polymorphic without requiring
4038         clients to know whether they are located at isp.  All users
4039         changed.
4040         (file_names): New variable.
4041         (m4_input_init): Initialize it.
4042         (m4_push_file): Use it.
4043         (m4_input_exit): Free it after use.
4044         (m4__next_token): Simplify slightly.
4045         (m4__peek_token): Rename and simplify...
4046         (m4__next_token_is_open): ... to this.  In particular, this
4047         allows us to avoid a double ungetc, which POSIX doesn't
4048         guarantee.
4049         (struct m4_input_block, m4_push_single, single_peek, single_read):
4050         Remove support for single characters, as the input engine now
4051         guarantees we don't need it.
4052         (file_unget, string_unget, m4_input_print, unget_input):
4053         Strengthen assertions.
4054         (file_init_funcs, file_read_init): New for file reading.
4055         (string_init_funcs, string_read_init): New for wrapped text.
4056         (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
4057         Support wrapped text with locations.
4058         (m4_skip_line): Support dnl across include file boundary.
4059         (peek_char): Don't pop input when peeking.
4060         (file_peek): Peek can be called at the end of the file.
4061         (string_read): Don't read beyond string bounds.
4062         * m4/macro.c (expand_token, collect_arguments): Update callers.
4063         (expand_macro): Report errors at location of open parenthesis.
4064         (expand_token, expand_argument, process_macro): Avoid negative
4065         array dereferences with m4_has_syntax.
4066         * m4/utility.c (skip_space): Likewise.
4067         * modules/m4.c (m4wrap): Update caller.
4068         * tests/builtins.at (__file__, __line__, dnl): New tests.
4069         * tests/options.at (--debugmode): Normalize the output.
4070         * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
4071         Remerge recent changes from branch.
4072         (Improved fatal_error): New node from branch.
4074 2006-10-11  Eric Blake  <ebb9@byu.net>
4076         * src/main.c (usage, long_options): Add --debugmode as an alias
4077         for --debug, to match macro name.
4078         * tests/options.at (--debugmode): Rename from --debug, and test
4079         for new alias.
4080         (--discard-comments): Augment test.
4081         * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
4082         * NEWS: Likewise.
4084 2006-10-10  Eric Blake  <ebb9@byu.net>
4086         Trace improvements: debugmode(c) was always printing the last two
4087         lines paired, combine them; and show non-text expansions.
4088         * m4/macro.c (trace_prepre): Update to show what the macro will
4089         expand to.
4090         (trace_pre): No need to special-case on debugmode(c).
4091         (trace_post): Likewise.  Also, show non-text expansions.
4092         (expand_macro): Update caller.  Collecting arguments can change
4093         debug mode, so cache values beforehand.
4094         (trace_format): Remove support for unused %l%S%r, and fix support
4095         for %z to match gcc's attribute((printf)).
4096         (trace_header): Update caller.
4097         * m4/input.c (struct m4_input_block): Rename from input_block.
4098         (struct input_funcs): Add print_func member.
4099         (file_print, builtin_unget, builtin_print, string_print)
4100         (m4_input_print): New functions.
4101         (m4_push_string_finish): Change return type.
4102         (m4_push_file): Fix missing use of close parameter.
4103         * m4/debug.c (m4_debug_decode): Don't clear pending traces.
4104         * m4/m4module.h (m4_input_print): New prototype.
4105         * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
4106         to match behavior change.
4107         * tests/options.at (--debug): Likewise.
4108         * tests/macros.at (Propagation of traceon)
4109         (Propagation of --trace): Likewise.
4110         * tests/others.at (stderr closed, stdout closed, stdin closed):
4111         Likewise.
4112         * doc/m4.texinfo (Forloop): Simplify.
4113         (Trace): Update to changed behavior.
4114         (Debugmode): Document this change.
4115         * src/main.c (usage): Likewise.
4116         * NEWS: Likewise.
4118 2006-10-09  Eric Blake  <ebb9@byu.net>
4120         * m4/path.c (m4_include_env_init): Don't alter result of getenv.
4121         Reported by Ralf Wildenhues.
4123         * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
4125 2006-10-07  Eric Blake  <ebb9@byu.net>
4127         * m4/m4module.h (m4_set_exit_failure): New prototype.
4128         * m4/utility.c (m4_set_exit_failure): New function.
4129         * modules/m4.c (m4exit): Use it to avoid yet another global
4130         variable export in libm4.
4132 2006-10-06  Eric Blake  <ebb9@byu.net>
4134         * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
4135         up.
4136         * tests/others.at (stdout closed): Fix final check.
4138         Replace uses of tmpfile with clean-temp, since tmpfile is
4139         incompatible with closeout.
4140         * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
4141         exit status of m4.
4142         * tests/others.at (stderr closed): Likewise.
4143         * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
4144         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4145         clean-temp.
4146         * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
4147         (m4_tmpfile, cleanup_tmpfile): New functions.
4148         (make_room_for, m4_insert_diversion): Use clean-temp module.
4149         * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
4150         tmpfile.
4151         * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
4153         * m4/utility.c (m4_numeric_arg): Merge from branch.
4154         * modules/gnu.c (debuglen): New builtin.
4155         * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
4156         Rename --arglength to --debuglen.
4157         * tests/options.at (--arglength): Rename to --debuglen.
4158         (deprecated options): Augment test.
4159         * doc/m4.texinfo (Invoking m4): Document the name change.
4160         (Debugmode): Rename from Debug Levels.
4161         (Debugfile): Rename from Debug Output.
4162         (Debuglen): New node.
4163         * NEWS: Document these changes.
4165         * modules/m4.c (m4exit): Fix typo.  Ensure desired exit status in
4166         case closing a module exits.
4168         * modules/m4.c (m4exit): Merge from branch.
4169         * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
4171 2006-10-05  Eric Blake  <ebb9@byu.net>
4173         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4174         closeout.
4175         * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
4176         * src/main.c (main): Close stdout on exit.
4177         * m4/debug.c (set_debug_file): Check for write failure.
4178         * m4/m4.c (m4_delete): Don't mask write failure.
4179         * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
4180         macros before calling AT_CHECK.
4181         (M4_ONE_MEG_DEFN): New helper macro.
4182         * tests/others.at (stdout full): New test.
4183         (stderr closed, stdin closed, stdout closed): Augment.
4184         * tests/builtins.at (syscmd): New test.
4185         (esyscmd): Augment.
4187 2006-10-04  Eric Blake  <ebb9@byu.net>
4189         * tests/builtins.at: Alphabetize tests.
4190         * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
4191         * tests/generate.awk (new_test): Fix underquoting.
4192         * tests/others.at (maketemp): Rename from misc.
4193         (stdin closed, stdout closed, stderr closed): New tests.
4195 2006-10-03  Eric Blake  <ebb9@byu.net>
4197         Avoid all global variables in modules, so that --disable-static
4198         can work on cygwin.
4199         * examples/incl.m4: New file, from branch.
4200         * Makefile.am (dist_pkgdata_DATA): Distribute it.
4201         * doc/m4.texinfo (Location): Merge this section from branch.
4202         (Include): Update the test.
4203         * tests/generate.awk (new_test): Allow for VPATH build
4204         pre-processing of expected __program__ output.
4205         * m4/m4module.h (m4_current_diversion, m4_output_current_line):
4206         Avoid global variables.
4207         (m4_context_field_table): Add current_diversion, output_line.
4208         (m4_output_init, m4_make_diversion): Add parameter.
4209         (m4_get_program_name, m4_set_program_name): New accessors.
4210         * m4/m4private.h (m4_get_current_diversion),
4211         (m4_set_current_diversion, m4_get_output_line)
4212         (m4_set_output_line): New accessors.
4213         * m4/utility.c (m4_get_program_name, m4_set_program_name): New
4214         methods.
4215         * modules/m4.c (divnum, divert): Adjust callers.
4216         * modules/gnu.c (__program__): Likewise.
4217         * m4/output.c (m4_output_init, m4_make_diversion)
4218         (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
4219         (m4_insert_diversion): Likewise.
4220         * m4/input.c (file_clean, m4_push_file): Likewise.
4221         * src/freeze.c (reload_frozen_state): Likewise.
4222         * src/main.c (main, usage): Likewise.
4224         Partially plug memory leak when unloading gnu module.
4225         * tests/modules.at (unload gnu module): New test.
4226         * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
4227         (m4_regexp_compile): Move static storage to module visibility.
4228         * tests/options.at (--debug): Adjust to new output.
4230 2006-09-29  Eric Blake  <ebb9@byu.net>
4232         Even when not the first option, --help can't have side effects.
4233         * tests/options.at (--debugfile): Detect bugs in this area.
4234         * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
4235         stderr.
4236         * src/main.c (main): Fix it by deferring debugfile change.  Also,
4237         defer closing streams until after module tracing is done.
4238         * modules/gnu.c (debugfile): Make message consistent with command
4239         line.
4240         * doc/m4.texinfo (Invoking m4): Touch up the documentation.
4241         * NEWS: Document this fix.
4243         * modules/m4.c (dnl): Include macro name in warning message.
4244         * m4/input.c (m4_skip_line): Add parameter.
4245         * m4/m4module.h (m4_skip_line): Likewise.
4246         * src/main.c (usage): Update wording.
4247         * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
4248         issue of blind macros vs. POSIX is resolved.
4249         (Dnl): Merge another node from branch.
4251         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4252         xstrtol.
4253         * m4/system_.h (N_): Define.
4254         * src/main.c (main): Validate numeric arguments.
4255         (size_opt): New function, idea borrowed from coreutils.
4256         * m4/macro.c (expand_macro): -L0 implies no limit.
4257         * doc/m4.texinfo (Invoking m4): Document this change.
4258         * NEWS: Likewise.
4259         * tests/options.at: (--arglength, --nesting-limit)
4260         (--regexp-syntax): New tests of argument validation.
4262 2006-09-28  Eric Blake  <ebb9@byu.net>
4264         * tests/options.at: Alphabetize the tests.
4266 2006-09-27  Eric Blake  <ebb9@byu.net>
4268         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
4269         another parameter to print module info.
4270         * m4/macro.c (trace_pre): Adjust caller.
4271         * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
4272         * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
4273         * NEWS: Document this.
4275         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4276         strnlen.
4277         * m4/symtab.c (symbol_value_print): Rename to...
4278         (m4_symbol_value_print): ...this, and...
4279         (m4_symbol_print): Update to allow -L length truncation.  Now
4280         truncation also affects dumpdef output and builtin names.
4281         * m4/m4private.h (nesting_limit, max_debug_argument_length):
4282         Switch to size_t.
4283         * m4/m4module.h (m4_symbol_print): Add parameter.
4284         (m4_symbol_value_print): New function.
4285         * modules/m4.c (dumpdef): Allow length truncation.
4286         * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
4287         repeating code.
4288         * doc/m4.texinfo (Invoking m4): Document -l better.
4289         (Dumpdef, Debug Levels): Document the effect of -l.
4290         * NEWS: Document this change.
4292         * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
4293         (m4_expand_ranges): Ensure we aren't picking up partial object on
4294         obstack.
4295         * modules/stdlib.c (setenv): Allow extra arguments.
4296         * modules/time.c (ctime): Avoid side effect in call to
4297         obstack_grow.
4298         * modules/gnu.c (m4_regexp_substitute): Likewise.
4299         (renamesyms): Avoid extra obstack_init.
4300         * src/freeze.c (reload_frozen_state): Remove debug comment.
4301         (produce_frozen_state): Simplify fprintf to puts where possible.
4302         * modules/modtest.c (modtest_init, modtest_finish): Likewise.
4303         * modules/import.c (import, symbol_fail, modules_fail): Likewise.
4304         * m4/macro.c (trace_flush): Likewise.
4305         * m4/debug.c (m4_debug_message_prefix): Likewise.
4306         * m4/path.c (include_dump): Likewise.
4307         * m4/module.c (module_remove): Likewise.
4308         (install_builtin_table): Simplify malloc and string
4309         concatenation.
4311 2006-09-26  Eric Blake  <ebb9@byu.net>
4313         * m4/m4module.h (m4_symbol_print): New prototype.
4314         (M4_DEBUG_TRACE_STACK): New enumerator.
4315         (m4_is_debug_bit): Allow use without requiring m4private.h.
4316         * m4/symtab.c (symbol_value_print, m4_symbol_print): New
4317         functions.
4318         * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
4319         callback.
4320         (dumpdef): Allow printing pushdef'd stacks.
4321         * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4322         * src/main.c (usage): Document it.
4323         * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4324         * NEWS: Likewise.
4326         * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4327         gnulib headers.
4328         * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4329         of lines during make.
4330         (AM_CPPFLAGS): Remove unneeded include path.
4331         (src_m4_CPPFLAGS): Remove redundant include path.
4332         * m4/system_.h Make preprocessor indentation consistent.
4333         (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4334         macros.
4335         (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4336         branch.
4337         (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4338         (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4339         (bool, true, false): Don't undefine here; stdbool takes care of
4340         that.
4341         * src/m4.h (includes): Assume config.h, and several standard
4342         headers.
4343         (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4344         * m4/m4private.h: Assume config.h.
4345         * m4/output.c: Likewise.
4346         * m4/path.c: Likewise.
4347         * m4/resyntax.c: Likewise.
4348         * m4/utility.c: Likewise.
4349         * modules/gnu.c: Likewise.
4350         * modules/import.c: Likewise.
4351         * modules/load.c: Likewise.
4352         * modules/m4.c: Likewise.
4353         * modules/modtest.c: Likewise.
4354         * modules/mpeval.c: Likewise.
4355         * modules/perl.c: Likewise.
4356         * modules/shadow.c: Likewise.
4357         * modules/stdlib.c: Likewise.
4358         * modules/time.c: Likewise.
4359         * modules/traditional.c: Likewise.
4361 2006-09-21  Eric Blake  <ebb9@byu.net>
4363         * doc/m4.texinfo (Invoking m4): Add clarification on option
4364         processing behavior.
4365         * tests/options.at (option grouping): Test this.
4366         * THANKS: Update.
4367         Reported by Mikhail Teterin.
4369         * bootstrap: Add --force option, based on idea from coreutils.
4370         * README: Document that ./bootstrap and autoreconf are for
4371         developers, and not lightly done in tarballs.
4373 2006-09-20  Eric Blake  <ebb9@byu.net>
4375         * src/main.c (usage, OPTSTRING, main): Rename -e to -i.  Make
4376         warnings consistent.
4377         (long_options, HASHSIZE_OPTION): Warn on -H.
4378         * doc/m4.texinfo (Invoking m4): Document this.
4379         * tests/options.at (deprecated options): Update.
4381         Change the default of interactive sessions to match sh.
4382         * src/main.c (usage): Document this.
4383         (enum interactive_choice): New enum.
4384         (main): Use it to defer decision of interactive until after
4385         argument processing.
4386         * doc/m4.texinfo (Invoking m4): Document this.
4387         * NEWS: Likewise, plus add missing mention of -b.
4388         Reported by Stepan Kasal.
4390 2006-09-19  Eric Blake  <ebb9@byu.net>
4392         * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4393         well as --error-output; the goal is to add -o/--output in some
4394         future version with semantics like gcc or autom4te.
4395         * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4396         (Extensions): Reflect this update.
4397         (Renamesyms): Add another test.
4398         (Defn): Xfail for now, so that `make check' is happy.
4399         * NEWS: Document this change.
4400         * tests/generate.awk: Mark dynamic loading tests as such.  Allow
4401         xfailing tests.
4402         * tests/macros.at (Renamesyms collisions): New test, exposing
4403         renamesyms' coredump.
4404         * tests/options.at (--debugfile, --safer): Update to match
4405         change.
4407         * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4408         and stderr are same file, introduced 2003-07-23.
4409         * tests/options.at (--debugfile): New test, to catch the bug.
4410         (deprecated options): Test --error-output.
4411         * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4412         Deprecate --error-output, and replace it with --debugfile.
4413         * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4414         Document this change.
4415         * NEWS: Likewise.
4417 2006-09-18  Eric Blake  <ebb9@byu.net>
4419         * modules/load.c (modules): Rename to...
4420         (m4modules): ...this, since it is an English word with 0
4421         arguments.
4422         * modules/gnu.c (symbols, m4symbols): Likewise.
4423         * doc/m4.texinfo (Listing Modules): Rename to...
4424         (M4modules): ...this.
4425         (Symbols): Rename to...
4426         (M4symbols): ...this.
4427         (Load, Foreach, Trace, Answers): Update to new spellings.
4428         * NEWS: Document this.
4430         * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4431         such that without arguments, the global trace flag is changed
4432         rather than walking the table of all currently-defined macros.
4433         (set_trace_CB): No longer needed.
4434         * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4435         (m4_set_symbol_traced): Delete.
4436         (m4_symtab_create): Nuke the nuke parameter.
4437         * m4/m4private.h (m4_get_symbol_value): Delete.
4438         * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4439         (m4_set_symbol_name_traced): Free undefined entries that are no
4440         longer traced.
4441         (symbol_destroy_CB): Update caller.
4442         * m4/m4.c (m4_create): Update caller.
4443         * src/main.c (main): Likewise.
4444         (usage): Fix typo in last commit.
4445         * doc/m4.texinfo: Minor cleanups throughout.
4446         (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4447         more nodes from branch.
4448         (Trace): Document new semantics, and how to simulate the old.
4449         * tests/builtins.at (multiquotes): Adjust to new semantics.
4450         * NEWS: Update somewhat.
4452 2006-09-14  Eric Blake  <ebb9@byu.net>
4454         Add --safer option, per debian bug 5898.
4455         * src/main.c (usage): Document new option.
4456         (SAFER_OPTION): New enumerator.
4457         (main): Set the option bit.
4458         * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4459         accessors.
4460         * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4461         (m4_get_safer_opt): New accessor.
4462         * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4463         * modules/m4.c (syscmd, maketemp): Likewise.
4464         * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4465         (Sysval, Maketemp): Add tests of this.
4466         * tests/options.at (--safer): Likewise.
4468 2006-09-13  Eric Blake  <ebb9@byu.net>
4470         * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4471         stderr filtering.
4472         Reported by Ralf Wildenhues.
4474         Fix installcheck.
4475         * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4476         tests directory, so we can be sure an installed build is not
4477         picking up uninstalled non-test libraries.
4478         (check-local, installcheck-local): Depend on test libraries.
4479         * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4480         after file name.  Fix quoting.  Remove skipping the test, now
4481         that makefile guarantees test modules will exist.
4482         (Freezing modules, modules: shadow, modules: unload)
4483         (modules: trace): Always put test modules in module path.
4484         (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4485         stderr munging.
4486         * src/main.c (usage): Document default module search path.
4487         (import_environment, frozen_file_to_read, frozen_file_to_write):
4488         Move...
4489         (main): ...here.
4490         * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4491         * tests/m4.in: ...not here.
4492         Reported by Ralf Wildenhues.
4494 2006-09-08  Eric Blake  <ebb9@byu.net>
4496         * bootstrap: Kill unrelated copy-n-paste code from argument
4497         parsing.  Let Makefile generate testsuite.
4498         * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4500 2006-09-07  Eric Blake  <ebb9@byu.net>
4502         * m4/m4module.h (m4_peek_input): No longer export.
4503         (m4_error_at_line, m4_warn_at_line): New prototypes.
4504         (m4_is_symbol_void): New macro.
4505         (m4_push_file): Update prototype.
4506         * m4/m4private.h (m4__peek_token): New prototype.
4507         (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4508         * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4509         * src/main.c (main): Allow reading from stdin twice.
4510         * modules/m4.c (include): Adjust to new prototype.
4511         * m4/input.c: General comment cleanup.
4512         (file_peek, file_read, file_unget, push_file): Set end flag on
4513         EOF, so that we don't call getc twice.
4514         (push_file, file_clean): Port fix from branch to avoid closing
4515         stdin prematurely.
4516         (pop_input): Port fix from branch to avoid reading free'd memory
4517         when input ends mid-string.
4518         (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4519         (string_peek, string_read): Always use unsigned char.
4520         (m4_skip_line): Warn when dnl cut short by EOF.
4521         (peek_input): Rename from m4_peek_input.
4522         (match_input): Update signature, to distinguish between `(' token
4523         and multi-char quote or comment beginning with `('.
4524         (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4525         (m4__peek_token): New function, ported from branch.
4526         (m4__next_token): Update to new token types.
4527         * m4/macro.c (expand_token, expand_argument): Use peek_token.
4528         * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4529         (Invoking m4): Remerge from branch.
4531         * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4532         (check-local): and put dependency here.
4533         Reported by Ralf Wildenhues.
4535 2006-09-05  Eric Blake  <ebb9@byu.net>
4537         * m4/m4module.h (m4_debug_message): New prototype.
4538         (M4_DEBUG_TRACE_MODULE): New debug bit.
4539         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4540         (M4_DEBUG_MESSAGE2): Delete these macros.
4541         * m4/debug.c (m4_debug_message): New method.
4542         (m4_debug_decode): Add module tracing as flag `m'.
4543         * m4/input.c (m4_push_file, file_clean): Use new method.
4544         * m4/path.c (m4_path_search): Likewise.
4545         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4546         * m4/module.c (install_builtin_table, install_macro_table)
4547         (m4__module_open, module_close, module_remove): Promote several
4548         module debug messages outside of DEBUG_MODULES.
4549         (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4550         DEBUG_MODULES with normal trace output.
4551         * src/main.c (usage): Document new flag.
4552         * doc/m4.texinfo (Debug Levels): Likewise.
4553         * Makefile.am ($(TESTSUITE)): Add missing dependency.
4554         * tests/m4.in: Neutralize platform-dependent module filenames.
4555         * tests/options.at (--debug): Update expected output.
4557 2006-09-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4559         * doc/m4.texinfo: Fix some typos.
4560         * tests/others.at: Likewise.
4562 2006-09-05  Eric Blake  <ebb9@byu.net>
4564         * m4/input.c (lex_debug): Remove dead code that broke compilation
4565         with --enable-debug.
4566         * m4/module.c (install_builtin_table, install_macro_table)
4567         (m4__module_init, m4__module_open, module_close)
4568         (module_remove): Fix compilation when --enable-debug.
4569         * m4/output.c (m4_shipout_text): Likewise.
4570         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4571         libraries when --enable-debug.
4572         * configure.ac (DYNAMIC_MODULES): New variable, to pass
4573         information to testsuite.
4574         (modules to preload): Determine modules after we know whether
4575         shared libraries are supported.
4576         * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4577         testsuite.
4578         * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4579         * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4580         (modules: shadow, modules: unload, modules: importing)
4581         (modules: trace): Use new macro.
4582         * tests/builtins.at (gmp): Likewise.
4584         * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
4585         All users updated.
4586         (expand_token): Avoid assertion just added to docs.
4587         (expand_macro): Track pending expansions, for when a symbol's
4588         definition changes during argument collection.
4589         (m4_macro_call, process_macro): Operate on symbol value, not
4590         symbol, since symbol may have changed during argument collection.
4591         * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
4592         (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
4593         (m4_get_symbol_value): Add fast macro version.
4594         * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
4595         (m4_macro_call): Adjust prototype.
4596         * m4/module.c (install_builtin_table): Check that flags are valid
4597         when creating builtin.
4598         * m4/symtab.c (m4__symtab_remove_module_references): Use
4599         m4_symbol_value_delete, rather than inlining it.
4600         (m4_symbol_value_copy): Copy placeholder text.
4601         (symbol_popval): Use m4_symbol_value_delete.
4602         (m4_symbol_value_delete): Implementation was missing when NDEBUG.
4603         Handle pending expansions.
4604         * modules/gnu.c (indir): Update to new prototype.
4605         * doc/m4.texinfo: Fix menus to be consistent with section names.
4606         (Defn): Add test that macro tokens flatten to empty string;
4607         triggered an assert before this patch.
4608         (Ifelse): Merge another node.
4609         (Loops): Split into...
4610         (Forloop, Foreach): New nodes; work is still underway on them.
4611         (Answers): Add more info on foreach macro; work is still underway.
4612         (Indir): Add test that indir collects arguments before looking up
4613         macro.
4614         * TODO: Update based on this patch.
4616 2006-09-01  Eric Blake  <ebb9@byu.net>
4618         * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
4619         * m4/hash.h (m4_free_hash_iterator): New prototype.
4620         * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
4621         ensure we don't do unsafe things while iterating.
4622         (HASH_ITER, ITER_CHAIN): New accessor macros.
4623         (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
4624         (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
4625         (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
4626         (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
4627         to catch unsafe actions.
4628         (m4_free_hash_iterator): New function, to avoid memory leaks, and
4629         when debugging, to track safe actions.
4630         (m4_hash_apply): Avoid memory leak.
4631         * m4/symtab.c (m4_symtab_apply): Likewise.
4632         * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
4633         in manually to src/ for now.
4634         * tests/builtins.at (gmp): Add keyword module.
4635         * tests/modules.at (Freezing modules, modules: shadow)
4636         (modules: unload, modules: importing, modules: trace): Likewise.
4638 2006-08-30  Eric Blake  <ebb9@byu.net>
4640         * m4/utility.c (m4_warn): Factor "Warning" out of messages into
4641         here.
4642         (m4_bad_argc, m4_numeric_arg): Update all callers.
4643         * m4/macro.c (m4_macro_call): Likewise.
4644         * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
4645         (Indir, Builtin, Ifdef): More doc merges.
4646         (Loops): Mention that documenting foreach would be nice.
4647         (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
4648         (Include, Eval, Location, M4exit): s/input.m4/stdin/.
4649         * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
4650         (substitute, syncoutput): Update all m4_warn callers.
4651         * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
4652         (traceon, traceoff): Make warning message consistent.
4653         (define, pushdef): Update all m4_warn callers.
4654         * tests/generate.awk: Choose file name so that documentation can
4655         show command-line behavior.
4656         * tests/builtins.at (define): Update to new wording.
4657         * tests/macros.at (pushdef/popdef): Likewise.
4658         * tests/freeze.at (loading format 1): Likewise.
4659         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4661         * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
4662         the branch.
4663         (Defn): Add failing test case for mixing text and builtin.
4664         (Renamesyms): Improve wording, and identify core dump that needs
4665         fixing.
4667 2006-08-29  Eric Blake  <ebb9@byu.net>
4669         * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
4670         (Arguments, Pseudo Arguments): More doc merges from the branch.
4671         (Macro expansion): Turn example into test.
4672         (Pseudo Arguments): Add example of avoiding argument.
4673         * modules/m4.c (undefine, popdef): Accept multiple arguments.
4674         (define, pushdef): Warn on non-text macro name.
4675         (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
4676         warning/error messages.
4677         (ifdef): Ignore extra arguments.
4678         * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
4679         (m4__symtab_remove_module_references): Check that there is no leak.
4680         * tests/macros.at (pushdef/popdef): Update to new message.
4681         * tests/builtins.at (define): Likewise.
4682         * tests/freeze.at (loading format 1): Likewise.
4683         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4685         * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
4686         (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
4687         as accessor function, to avoid compiler warning.
4688         * m4/module.c (m4__module_open): Move declaration of variable to
4689         avoid compiler warning.
4690         * src/main.c (main): Avoid shadowing a global variable.
4691         * src/freeze.c (produce_symbol_dump): Avoid unused variable
4692         warning when NDEBUG.
4693         * tests/options.at (--discard-comments, --import-environment)
4694         (--debug, --prepend-include, --help and --version): Rename tests
4695         to name option tested.
4697 2006-08-28  Eric Blake  <ebb9@byu.net>
4699         * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
4700         * m4/module.c (install_builtin_table): ...to here, and add
4701         assertion that blind macros require arguments.
4702         * m4/m4module.h (struct m4_builtin): Document restrictions that
4703         must be met during module loading.
4704         * modules/gnu.c (changeresyntax, changesyntax): These are blind,
4705         so require an argument to avoid triggering assertion.
4706         (debugfile): Tweak error message.
4708 2006-08-25  Eric Blake  <ebb9@byu.net>
4710         * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
4711         (M4_BUILTIN_SIDE_EFFECT): New enumerators.
4712         (struct m4_builtin): New member flags replaces groks_macro_args,
4713         blind_if_no_args.  min_args and max_args are now 0-based.
4714         Rearrange members to reduce size on platforms where function
4715         pointers are 64 bits but regular pointers are 32.
4716         (m4_bad_argc): Add argument.
4717         * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
4718         * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
4719         effect into account.
4720         * m4/module.c (install_builtin_table): Adjust all users affected
4721         by this API change.
4722         * m4/macro.c (m4_macro_call): Likewise.
4723         * src/freeze.c (reload_frozen_state): Likewise.
4724         * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
4725         * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
4726         * modules/import.c (builtin_functions): Likewise.
4727         * modules/load.c (builtin_functions): Likewise.
4728         * modules/modtest.c (builtin_functions): Likewise.
4729         * modules/mpeval.c (builtin_functions): Likewise.
4730         * modules/perl.c (builtin_functions): Likewise.
4731         * modules/shadow.c (builtin_functions): Likewise.
4732         * modules/stdlib.c (builtin_functions): Likewise.
4733         * modules/time.c (builtin_functions, mktime_functions)
4734         (strftime_functions): Likewise.
4735         * doc/m4.texinfo (Loops): Update test now that shift is blind.
4736         (Macro Arguments): Fix typo in test.
4737         (Patsubst): Fix typo in test.
4738         * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
4739         end of string.  Fix return value when ignore_duplicates.
4740         * tests/builtins.at (patsubst): Fix typo in test.
4742         * tests/options.at (debug-flags): Update to reflect new message.
4743         (deprecated options, prepend-include, help and version): New
4744         tests.
4745         * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
4746         test omits an input file name.
4747         * src/main.c (long_options, main): Add -B/--prepend-include.
4748         (usage): Document it.
4749         (main): `m4 --help --version' now displays help, not version.
4750         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4751         dirname filenamecat.
4752         * m4/m4module.h (m4_add_include_directory): Add parameter.
4753         * m4/m4private.h (m4__include_init): New prototype.
4754         * m4/m4.c (m4_create): Put `.' on path before options are
4755         collected.
4756         * m4/path.c (includes): Assume C89.  Use gnulib for file name
4757         management.
4758         (m4__include_init): New function.
4759         (search_path_add): Allow prepending.
4760         (m4_add_include_directory, search_path_env_init): Adjust callers.
4761         (m4_path_search): Relative names now invoke path search, since
4762         `.' might not be first.
4763         * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
4765 2006-08-25  Bruno Haible  <bruno@clisp.org>  (tiny change)
4766         and Eric Blake  <ebb9@byu.net>
4768         * bootstrap: Run autopoint before gnulib-tool, since autopoint
4769         0.15 installs macros obsoleted by current gnulib.
4771 2006-08-25  Eric Blake  <ebb9@byu.net>
4773         * doc/m4.texinfo (Macro Arguments): Another section merged;
4774         testsuite failures now exposed.
4776 2006-08-23  Eric Blake  <ebb9@byu.net>
4778         * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
4779         (Input processing): More doc merges from the branch.
4780         (Regular expression syntax): Add introductory text.
4781         (Inhibiting Invocation): More doc merges from the branch.
4782         (Other tokens): Reorder after comments.
4783         * tests/generate.awk: Allow passing options to doc examples.
4785 2006-08-22  Eric Blake  <ebb9@byu.net>
4787         * tests/options.at (debug-flags): New test.
4788         * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
4789         not negative, to distinguish failure in m4_debug_decode.
4790         (m4_debug_decode): Add new parameter.
4791         * modules/gnu.c (regexp): Slight cleanup.
4792         (renamesyms): Ignore excess arguments.
4793         (syncoutput): Make case-insensitive, warn on bad argument.
4794         (debugmode): Factor -+ handling out to...
4795         * m4/debug.c (m4_debug_decode): ...here.
4796         (m4_debug_message_prefix): Fix spacing.
4797         * src/main.c (main): Let -d option adjust flags.
4798         * m4/input.c (file_clean): Avoid printing empty file name.
4799         * doc/m4.texinfo (Syncoutput): Document new range of input.
4800         (Invoking m4): Document use of multiple -d flags.
4802         Start porting various fixes from the branch that use gnulib.
4803         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4804         binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
4805         regexprops-generic stdlib-safer unlocked-io.
4806         * m4/debug.c (m4_debug_set_output): Close debug file on exec.
4807         * m4/path.c (m4_path_search): Close input file on exec, reject
4808         empty file name, fix parameter naming.
4809         * m4/output.c (make_room_for): Close diversion file on exec.
4810         (includes): Assume C89 headers.
4811         (tmpfile): For now, we don't want tmpfile-safer, because we want
4812         clean-temp later.
4813         * m4/m4private.h (includes): Use various gnulib headers.
4814         * doc/regexprops-generic.texi: Use gnulib's copy.
4816         * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
4817         * AUTHORS: Add copyright.
4818         * ChangeLog: Likewise.
4819         * README: Likewise.  Require automake 1.9b or later.
4820         * HACKING: New file.
4821         * README-alpha: Add copyright.
4822         * THANKS: Likewise.  Update.
4823         * doc/STYLE: Add copyright, and tweak for changed directories.
4824         * modules/README: Add copyright, and tweak for libtool version.
4825         * examples/COPYING: New file.
4826         * examples/WWW/COPYING: Likewise.
4827         * examples/WWW/m4lib/COPYING: Likewise.
4828         * modules/shadow.m4: Add copyright.
4829         * modules/perl.m4: Likewise.
4830         * modules/modtest.m4: Likewise.
4831         * modules/stdlib.m4: Likewise.
4832         * modules/time.m4: Likewise.
4833         * modules/time2.m4: Likewise.
4834         * po/Makevars: Likewise.
4835         * tests/iso8859.m4: Likewise.
4836         * tests/m4.in: Likewise.
4837         * NEWS: Add (C) to copyright.
4838         * TODO: Likewise.
4839         * m4/system_.h: Likewise.
4840         * tests/atlocal.in: Likewise.
4841         * tests/builtins.at: Likewise.
4842         * tests/freeze.at: Likewise.
4843         * tests/generate.awk: Likewise.
4844         * tests/macros.at: Likewise.
4845         * tests/modules.at: Likewise.
4846         * tests/options.at: Likewise.
4847         * tests/others.at: Likewise.
4848         * tests/testsuite.at: Likewise.
4849         * m4/utility.c: Spell out copyright years.
4850         * src/main.c: Likewise.
4852         * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
4854 2006-08-21  Eric Blake  <ebb9@byu.net>
4856         * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
4857         * modules/gnu.c (esyscmd): Use -1 for failure.  Set sysval to 0
4858         when no arguments are given, but without losing warning about 0
4859         arguments.
4860         * modules/m4.c (syscmd): Likewise.
4861         (includes): Assume C89.
4862         (m4_sysval): Make static.
4863         (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
4864         (sysval): Port calculation from branch.
4866 2006-08-20  Eric Blake  <ebb9@byu.net>
4868         * m4/macro.c (expand_macro): Move argument check...
4869         (m4_macro_call): ...to here, so indir will warn.
4870         * modules/gnu.c (__program__): New macro, ported from branch.
4871         (builtin): Perform argument check.
4872         (changesyntax): Avoid out-of-bounds read.
4874         * modules/gnu.c (includes): Assume stdlib.h, errno.
4875         (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4876         (substitute): Add caller parameter, avoid out-of-bounds memory
4877         references.
4878         (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4879         callers.
4881 2006-08-16  Eric Blake  <ebb9@byu.net>
4883         * po/POTFILES.in: Add more files that contain translatable
4884         strings.
4885         * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4886         information to translators.
4887         (USE_MSGCTXT): New var for gettext 0.15.
4888         * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4889         debug/trace messages in lower case.
4890         * m4/macro.c (expand_argument): Likewise.
4891         * m4/path.c (m4_path_search): Likewise.
4892         * src/main.c (main): Likewise.
4894 2006-08-14  Eric Blake  <ebb9@byu.net>
4896         * src/main.c (usage): Document --import-environment.
4897         * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4899 2006-08-11  Eric Blake  <ebb9@byu.net>
4901         * bootstrap (func_get_translations): Only remove files when doing
4902         full update.
4903         (func_update_po): Avoid CDPATH problems.
4905 2006-08-10  Eric Blake  <ebb9@byu.net>
4907         * bootstrap (func_get_translations): New function.
4908         (func_update_po): Borrow ideas from tar to correctly pull in
4909         translations from newer location.
4911 2006-08-09  Eric Blake  <ebb9@byu.net>
4913         * bootstrap: Recent gnulib no longer has jm_* macros to worry
4914         about.
4915         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4916         verror.
4917         * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
4918         (m4_error, m4_warn): ... these new prototypes.
4919         (m4_current_file, m4_current_line): Move into context, rather
4920         than leaving as globals.
4921         (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
4922         (m4_undivert_all, m4_input_init): Now takes context.
4923         * m4/utility.c (m4_error, m4_warn): New functions.
4924         * m4/m4private.h: Assume errno exists.
4925         (struct m4): Move warning_status to a bit flag,
4926         and add exit_status.  Adjust accessors accordingly.
4927         * src/main.c (print_program_name_CB): No longer needed.
4928         (main): Use new m4_get_fatal_warnings_opt.
4929         * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
4930         instead of issuing "INTERNAL ERROR".  Pass context when needed,
4931         and use new accessors.
4932         * m4/input.c: Likewise.
4933         * m4/macro.c: Likewise.
4934         * m4/output.c: Likewise.
4935         * m4/utility.c: Likewise.
4936         * modules/evalparse.c: Likewise.
4937         * modules/gnu.c: Likewise.
4938         * modules/load.c: Likewise.
4939         * modules/m4.c: Likewise.
4940         * modules/mpeval.c: Likewise.
4941         * src/freeze.c: Likewise.
4942         * src/main.c: Likewise.
4943         * tests/macros.at: Adjust to new message format.
4944         * tests/builtins.at: Likewise.
4945         * tests/freeze.at: Likewise.
4946         * tests/modules.at: Likewise.
4947         * doc/m4.texinfo: Likewise.
4949         * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
4950         newer gettext 0.15.
4952 2006-08-03  Eric Blake  <ebb9@byu.net>
4954         * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
4955         gracefully handle ENOSYS.
4956         * TODO: Update.
4957         * THANKS: Update.
4959 2006-07-28  Eric Blake  <ebb9@byu.net>
4961         * src/freeze.c (reload_frozen_state): Copy string when creating
4962         placeholder, to avoid memory corruption.
4963         * m4/symtab.c (symbol_popval): Avoid memory leak.
4964         (m4_symbol_rename): Avoid shadowing rename function.
4965         (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
4966         * tests/freeze.at (reloading unknown builtin): Add test.
4967         * tests/generate.awk: Capture m4.texinfo line number in
4968         testsuite.log, not just generated.at.
4970         Port idea from branch that a frozen file can request an unknown
4971         builtin without producing a warning unless the builtin is
4972         actually used.
4973         * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
4974         (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
4975         (m4_set_symbol_value_placeholder): New accessors.
4976         * m4/m4module.h (m4_is_symbol_placeholder),
4977         (m4_get_symbol_value_placeholder),
4978         (m4_set_symbol_value_placeholder),
4979         (m4_get_symbol_placeholder): Likewise.
4980         * m4/symtab.c (m4_is_symbol_value_placeholder),
4981         (m4_get_symbol_value_placeholder),
4982         (m4_set_symbol_value_placeholder): Likewise.
4983         (dump_symbol_CB): Handle new symbol type.
4984         * m4/macro.c (trace_pre): Likewise.
4985         (m4_macro_call): Warn when invoking a placeholder.
4986         * modules/m4.c (dumpdef): Handle dumping a placeholder.
4987         (defn): Warn when referencing a placeholder.
4988         * src/freeze.c (dump_symbol_CB): Ignore placeholder when
4989         freezing.
4990         (reload_frozen_state): When reloading unknown builtin, install a
4991         placeholder instead of warning.
4992         * tests/freeze.at (loading format 1): Allow warning when
4993         popdef'ing undefined function.
4995 2006-07-27  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
4997         * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
4998         function. Shift by 7, not 3, for consistency with
4999         gnulib/lib/hash.c. Don't assume hash word is 32 bits.
5001 2006-07-27  Eric Blake  <ebb9@byu.net>
5003         * src/main.c (usage): Update to match branch.
5004         (main): Update --version info to distinguish between program name
5005         `m4' and package name `GNU M4'.
5006         (AUTHORS): Translate René Seindal's name.
5007         * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
5008         * Makefile.am (doc/m4.1): Update to match branch.
5009         * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
5010         branch.
5012         * m4/system_.h (EXIT_MISMATCH): Define.
5013         * src/main.c (main): Don't clear syntax table for version 1.
5014         (usage): Document exit status.
5015         * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
5016         branch, and require V directive to appear first in file.  Fix
5017         broken logic for detecting F and T in version 1 files.
5019 2006-07-22  Eric Blake  <ebb9@byu.net>
5021         * src/main.c (stackovf_handler): Document the problems in our
5022         overflow handler.
5023         * src/stackovf.c: Forward port changes in branch to use POSIX
5024         sa_sigaction when available.
5025         (process_sigsegv): Avoid buffer overrun when error string is
5026         translated, although the fact that we translate in a signal
5027         handler is still a bug.
5028         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
5029         from branch to modernize checks.
5031         * modules/format.c (format): Avoid compiler warning that str may
5032         be used uninitialized.
5034         * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
5035         spelling.
5036         (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
5037         (DEBUG_MACRO): Remove unused macro.
5038         * src/stackovf.c: Avoid compiler warnings.
5039         * m4/input.c: Likewise.
5040         * m4/module.c: Likewise.
5041         * m4/output.c: Likewise.
5042         * m4/path.c: Likewise.
5043         * m4/symtab.c: Likewise.
5044         * m4/syntax.c: Likewise.
5046 2006-07-20  Eric Blake  <ebb9@byu.net>
5048         * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
5049         Regenerate to explicitly ask for --assume-autoconf=2.60.
5051 2006-07-19  Eric Blake  <ebb9@byu.net>
5053         * po/ChangeLog: Merge into main ChangeLog, then delete file.
5054         * THANKS: Update.
5056         * doc/m4.texinfo (copying): Relax restriction on front-cover and
5057         back-cover texts.
5059 2006-07-17  Eric Blake  <ebb9@byu.net>
5061         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
5062         0.14.5.
5064         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5065         xvasprintf'.
5066         * modules/format.c (includes): Use xvasprintf.h.
5067         (format): Make static.  Avoid buffer overflow, that can lead to
5068         arbitrary code execution exploit.  Only pass unsigned char to
5069         is*().  Support F, g, and G specifiers.
5070         * doc/m4.texinfo (Format): Expose buffer overrun bug.  Document
5071         new specifiers.
5073 2006-07-17  Gary V. Vaughan  <gary@gnu.org>
5075         Ensure M4 compiles correctly with -DDEBUG, and use a single
5076         consistent definition of various /DEBUG_[A-Z]+/ symbols:
5078         * m4/input.c: Have commented out out DEBUG_INPUT only by default.
5079         (m4_print_token): Use m4_get_symbol_value_text and
5080         m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
5081         and VALUE_FUNC respectively.
5082         (m4__next_token): Use m4_print_token call instead of obsolescent
5083         print_token symbol.
5084         * m4/module.c: Have commented out out DEBUG_MODULE only by default.
5085         * m4/output.c: Similarly for DEBUG_OUTPUT.
5086         * m4/path.c: Similarly for DEBUG_INCL.
5087         * m4/symtax.c: Similarly for DEBUG_SYM.
5088         * m4/syntax.c: Similarly for DEBUG_SYNTAX.
5089         * src/stackovf.c: Similarly for DEBUG_STACKOVF.
5090         * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
5091         preprocessor macros defined with -DDEBUG compiles.
5093 2006-07-17  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
5095         * bootstrap: Correct typo in --download-po argument parsing.
5097 2006-07-15  Eric Blake  <ebb9@byu.net>
5099         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5100         gendocs fdl'.
5101         * tests/generate.awk (normalize): Recognize @tabchar.
5102         * doc/m4.texinfo (Top): Start merging from branch.  Remove tabs.
5103         Fix menus.  Upgrade FDL license from 1.1 to 1.2.  Fix overfull
5104         hboxes.
5105         (Index macro, Shell commands, Incompatiblities): Rename nodes
5106         from Index, UNIX commands, Other incompat.
5107         (Platform macros, Using frozen files, Frozen file format 1)
5108         (Frozen file format 2, Copying This Manual, Indices): New nodes.
5109         * Makefile.am (EXTRA_DIST): Distribute gendocs.
5110         (MAINTAINERCLEANFILES): Clean up files from gnulib.
5111         (doc_m4_TEXINFOS): Depend on fdl.texi.
5112         (web-manual): New maintainer target.
5114 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
5116         * doc/m4.texinfo (Modules):  RMS asked me for an explanation of
5117         the modular architecture of M4.  The result is paraphrased here
5118         for the benefit of future readers of the manual.
5120 2006-07-14  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
5122         * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5124 2006-07-14  Eric Blake  <ebb9@byu.net>
5126         * src/main.c (main): Avoid compiler warning.
5127         * modules/gnu.c (renamesyms): Remove unused variable.
5129 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
5131         * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
5132         (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
5133         new functions for managing regexp syntax options.
5134         * m4/m4private.h (m4): Add regexp_syntax field.
5135         * m4/resyntax.c: New file implements the above.
5136         * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
5137         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
5138         (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
5139         (m4_patsubst_do, m4_renamesyms_do): Removed.
5140         (builtin_changeresyntax): New builtin to change regular expression
5141         syntax.
5142         (m4_resyntax_encode_safe): Factor out diagnostics code.
5143         * src/freeze.c (produce_resyntax_dump): New function to dump
5144         default regexp syntax specifier to frozen file.
5145         (reload_frozen_state): Updated to action 'R' directive.
5146         * src/main.c (usage): Describe new -r option.
5147         (long_options, OPTSTRING): Declare it.
5148         (main): Encode and store cli regexp syntax option argument.
5149         * tests/freeze.at (regexp syntax): New test that regexp syntax
5150         survives freezing.
5151         * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
5152         * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
5153         (Epatsubst and Patsubst): Renamed to...
5154         (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
5155         documentation and added new examples.
5156         (Changeresyntax): New section describing changeresyntax builtin,
5157         and regexp syntax names.
5158         (Regular expression syntax): New section describing differences
5159         between various regular expression syntaxes.
5160         (Frozen files): Document 'R' directive.
5161         * NEWS: Updated.
5163 2006-07-13  Gary V. Vaughan  <gary@gnu.org>
5165         * bootstrap: Enhanced to work more like our other scripts:
5166         Add a copyright statement; support --version and --help; accept a
5167         --download-po option with argument as a substitute for DOWNLOAD_PO
5168         in the environment.
5170 2006-07-11  Eric Blake  <ebb9@byu.net>
5172         * Makefile.am (doc/m4.1): Port patch from branch that avoids
5173         intermediate file.
5174         * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
5175         changed.
5177 2006-07-10  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
5179         * tests/builtin.at (patsubst, regexp):  Adjust these tests, now
5180         that `\0' is no longer accepted.
5182         * src/main.c (usage): Alphabetize options within their sections.
5184         * modules/gnu.c (m4_regexp_search, regsub, substitute)
5185         (esyscmd):  Improve comments.
5187         * modules/gnu.c (substitute): Remove old warning for \0.
5188         (substitute_warned): No longer required.  Removed.
5190         * modules/gnu.c: Put macro definitions into alphabetical order.
5192 2006-07-07  Eric Blake  <ebb9@byu.net>
5194         * tests/freeze.at (loading format 1): New file, with new test.
5195         * tests/testsuite.at: Include it.
5196         * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
5197         * tests/modules.at (Freezing modules): Likewise.
5199         * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
5200         (AC_CHECK_HEADERS): Assume signal.h.
5201         (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
5202         (AC_CHECK_FUNCS_ONCE): Likewise.
5203         * src/m4.h (includes): Assume signal.h.
5205 2006-07-05  Eric Blake  <ebb9@byu.net>
5207         Fix all testsuite failures on cygwin.
5208         * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
5209         branch-1_4.  Solves testsuite failure when uninstalled m4 is
5210         shadowed by redefinition of PATH in libtool wrapper.
5211         * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
5212         contains the -no-undefined required by cygwin.
5213         (TESTS_ENVIRONMENT): Export abs_top_builddir.
5214         * tests/others.at (misc): Port to platforms where /etc/passwd
5215         does not exist or does not contain user named root.
5216         * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
5217         directory.
5218         * tests/builtins.at (define, divert): Avoid overquoting.
5219         * tests/generate.awk (new_group): Likewise.
5221 2006-07-05  Gary V. Vaughan  <gary@gnu.org>
5223         The regs_allocated field in a struct re_pattern_buffer refers
5224         to the state of a particular re_registers struct when used in
5225         successive matches using the same compiled pattern.  Avoid a
5226         SEGV in `renamesyms' resulting from using a new re_registers
5227         with an existing re_pattern_buffer:
5229         * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
5230         pattern buffer and registers.
5231         (m4_regexp_search): New function to call re_regexp_search with
5232         correctly matched pattern buffer and register instantiations.
5233         (m4_regexp_compile): Return an m4_pattern_buffer.  Adust all
5234         callers.
5236 2006-07-04  Gary V. Vaughan  <gary@gnu.org>
5238         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
5239         changes to gnulib getopt.m4 since last build.
5240         * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
5241         if the system getopt fails M4_GETOPT tests.
5243 2006-06-22  Eric Blake  <ebb9@byu.net>
5245         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
5246         Reported by Bruno Haible.
5248 2006-06-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5250         * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
5252 2006-06-19  Eric Blake  <ebb9@byu.net>
5254         * THANKS: Update.
5256 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5258         * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
5259         (clean-local): Split into and depend upon...
5260         (clean-local-tests, clean-local-src): ...these two.  The latter
5261         removes the libtool object directory below `src', to work around
5262         a buglet in Automake, failing to list it.
5263         (EXTRA_DIST): Distribute modules/perl.c.
5265 2006-06-19  Eric Blake  <ebb9@byu.net>
5267         * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
5268         right side of dependency; VPATH does that.
5269         (stamp-vcl): Update to use libtool's algorithm.
5270         (EXTRA_DIST): Distribute stamp-vcl.
5271         Reported by Ralf Wildenhues.
5272         (TESTSUITE): Revert earlier change that used absolute path, as
5273         that broke 'make dist' in VPATH.  Stick with $(srcdir) instead.
5274         (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
5275         (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
5276         atlocal takes care of it instead.
5277         (check-local, installcheck-local, clean-local): Inline absolute
5278         path to testsuite here, rather than relative path to testsuite
5279         elsewhere.
5281 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5283         * m4/m4private.h (DELETE): Cast away const here...
5284         * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
5285         * src/freeze.c (reload_frozen_state): Avoid uninitialized
5286         variable warning.
5288 2006-06-19  Eric Blake  <ebb9@byu.net>
5290         * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
5291         .info pages are built.
5292         Reported by Ralf Wildenhues.
5293         (EXTRA_DIST): Inline definition of testsuite, so that make dist
5294         works again.
5296 2006-06-16  Eric Blake  <ebb9@byu.net>
5298         Follow recommendations from autoconf manual for autotest.
5299         * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
5300         turn it into an absolute path until autotest provides an option
5301         that allows us to avoid changing directories.  Properly quote
5302         throughout.
5303         (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
5304         (check-recursive): Delete unused target.
5305         ($(TESTSUITE)): Atomically update testsuite.
5306         (CD_TESTDIR): Simplify.
5307         (m4__cd): Delete unused macro.
5308         (check-local): Let TESTSUITEFLAGS influence the run.
5309         (installcheck-local): Let TESTSUITEFLAGS override
5310         AUTOTEST_PATH.  Add dependencies.
5311         (clean-local): Clean up.
5312         (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
5313         * README: Document how to use the testsuite.
5315 2006-06-15  Eric Blake  <ebb9@byu.net>
5317         * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
5319         * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
5320         clashes with m4sugar.
5321         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5322         * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5323         * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5324         * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5325         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5326         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5327         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5328         * configure.ac: Likewise.
5329         (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5330         * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5331         conditional.
5332         * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5334         Reduce compiler warnings.  Inside GMP, mpq_t is an array type, so
5335         const mpq_t is not assignable from plain mpq_t.  Avoid
5336         type-punning warnings caused trying to mix these types.
5337         * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5338         (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5339         * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5340         (mult_term, exp_term): Remove type-punning casts.
5341         (numb_pow): Remove const qualifier.
5342         * src/freeze.c (reload_frozen_state): Fix typo in messages.
5343         Fix variables that can be used uninitialized, which fixes
5344         security hole where malicious frozen file can execute arbitrary
5345         code.
5347 2006-06-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5349         * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5351 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5352         and Eric Blake  <ebb9@byu.net>
5354         Allow `make dist' to work again.
5355         * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5356         (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5357         (cvs-dist): Fix typo.
5358         * NEWS: Match current version number.
5360 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5362         * Makefile.am (AM_CPPFLAGS):  Add $(LTDLINCL), so the right
5363         ltdl.h is used.
5365         * bootstrap: Do not run libtoolize manually, this is done
5366         correctly by autoreconf.  Invoke autoreconf with --no-recursive
5367         to avoid unnecessary rerunning of autotools for libltdl.
5369 2006-06-13  Eric Blake  <ebb9@byu.net>
5371         * THANKS: Update.
5373 2006-06-12  Eric Blake  <ebb9@byu.net>
5375         * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5376         bother with mktemp.
5377         * src/m4.h: Don't declare mktemp.
5378         * m4/input.c (m4__next_token): Avoid bzero.
5379         * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5380         * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5381         than distributing outdated helptoman.pl.
5382         * doc/helptoman.pl: Delete.
5384 2006-06-10  Eric Blake  <ebb9@byu.net>
5386         * README (Patches): Document the current dependence on CVS
5387         builds of autotools.
5388         * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5389         * configure.ac: Use consistent quoting throughout.
5390         (AC_PREREQ): Bump to 2.59d.
5391         (AC_INIT): Package name begins with uppercase.
5392         (AC_ARG_WITH): Use AS_HELP_STRING.
5393         (AM_INIT_AUTOMAKE): Enable gnits mode.
5394         (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5395         (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5396         (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5397         done by gnulib or automake, or which autoconf has declared
5398         obsolete.
5399         * m4/m4private.h (Includes): Assume C89 or better, and use errno
5400         unconditionally.
5401         * m4/output.c (Includes): Likewise.
5402         * modules/gnu.c (Includes): Likewise.
5403         * modules/m4.c (Includes): Likewise.
5404         * src/m4.h (Includes): Likewise.
5406         * README-alpha: Update web address.
5407         * README: Likewise. Change encoding to ASCII.  Remove old advice
5408         about cygwin.  Document bootstrapping dependency.
5409         * AUTHORS: Update from branch-1_4.
5410         * THANKS: Likewise.  Change encoding to UTF-8.
5411         * BACKLOG: Delete.  This file is too old and unmaintained to be
5412         worthwhile.
5413         * ChangeLog: Change encoding to UTF-8.
5415         Avoid compiler warnings.
5416         * m4/macro.c (trace_format): Don't mark this as a printf format,
5417         since we don't accept the same set of modifiers as printf.  It
5418         would be nice if gcc let us specify a custom format archetype.
5419         * src/main.c (main): Cast away const.
5421 2006-06-10  Andreas Schwab  <schwab@suse.de>  (tiny change)
5422             Eric Blake  <ebb9@byu.net>
5424         * modules/time.c (ctime): Pass correctly typed variable to
5425         m4_numeric_arg.
5426         (gmtime): Likewise.
5427         (localtime): Likewise.
5428         (strftime): Likewise.
5429         * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5430         limit inherent in this interface.
5432 2006-05-08  Bruno Haible  <bruno@clisp.org>  (tiny change)
5434         * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5435         (sysval): Use WEXITSTATUS.
5436         * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5437         big-endian and little-endian wait status definitions.
5439 2006-05-06  Eric Blake  <ebb9@byu.net>
5441         * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5442         * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5443         in src, not gnu.
5445 2006-05-06  Eric Blake  <ebb9@byu.net>
5447         * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5448         subdirectory to use.
5449         (support for -pipe): Move after LT_INIT, since it relies on
5450         libtool internals.
5452 2006-05-05  Eric Blake  <ebb9@byu.net>
5454         * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5456         * THANKS: Update.
5458 2006-05-05  Bruno Haible  <bruno@clisp.org>
5459         and Eric Blake  <ebb9@byu.net>
5461         * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5462         * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5463         usage pattern.
5464         * bootstrap: Update usage of gnulib-tool.
5466 2006-05-04  Eric Blake  <ebb9@byu.net>
5468         * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5469         Cleanup whitespace.
5471 2005-12-05  Gary V. Vaughan  <gary@gnu.org>
5473         * bootstrap (func_update_po): Synch with CVS GNU tar.  wget 1.9.x
5474         and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5475         Reported by Eric Blake <ebb9@byu.net>
5477 2005-12-04  Gary V. Vaughan  <gary@gnu.org>
5479         * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5480         http caching as -C is no longer supported by wget 1.10.x.
5481         Reported by Eric Blake <ebb9@byu.net>
5483 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
5485         * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5486         to ...
5487         (iface_id): ...an lt_dlinterface_id type.
5488         (m4__module_find): New abstraction for lt_dlhandle_fetch.  Use
5489         throughout, instead of calling obsolete lt_dlhandle_find directly.
5490         (m4__module_next): Use multiloader-safe lt_dlhandle_iterate.  Use
5491         throughout, instead of calling obsolete lt_dlhandle_next.
5492         * m4/m4private.h (m4__module_find): Declare it.
5493         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5494         Use m4__module_next instead of obsolete lt_dlhandle_next.
5496 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
5498         * bootstrap (func_update_po): Update pofiles directly from the
5499         translation project.
5500         * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5501         po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5502         these files under source control anymore.
5503         Suggested by Eric Blake <ebb9@byu.net>
5505 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
5507         * ltdl/m4/m4-gnulib.m4: Update FSF contact address.  Somehow this
5508         file escaped the address updates on 2005-05-01.
5510 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
5512         * bootstrap: Allow user overriding of gnulib-tool location, and
5513         correctly determine module source directories whether gnulib-tool
5514         is given as a relative or absolute path, or is found by searching
5515         PATH.
5516         Reported by Eric Blake <ebb9@byu.net>
5518 2005-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5520         * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5521         and $RM are defined for various versions of
5522         AC_LIBTOOL_COMPILER_OPTION.
5524         * bootstrap (AUTORECONF): New variable to allow user overriding of
5525         autoreconf path.
5527 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
5529         * doc/m4.texinfo (History): Add better notes on the ancestory of
5530         GNU m4, and other historical interest.
5532 2005-05-08  Gary V. Vaughan  <gary@gnu.org>
5534         * m4/symtab.c (m4_symbol_rename): New function that performs a low
5535         level symbol rename.
5536         * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5537         * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5538         (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5539         regsub...
5540         (erenamesyms, renamesyms): ...builtins that use these to implement
5541         macro renaming by regular expression.
5542         * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5543         * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5544         to stop the new generated tests from choking.
5546 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
5548         Since most of the build is handled from a single Makefile.am now,
5549         we can teach make about the dependencies between the m4 binary and
5550         the preopened modules it is built against:
5552         * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5553         preopened modules.
5554         * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5555         of the preopened modules have changed.
5557 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
5559         * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5560         have a native implementation.
5562 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
5564         * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed.  These are
5565         handled already by gnu/exit.h.
5567         * configure.ac (gl_MODULES): Add assert to support a
5568         --disable-assert configure time option for NDEBUG setting.
5570         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5571         * bootstrap (src_modules): Add version-etc-fsf.
5572         * src/main.c (version_etc_copyright): Removed.
5574         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5576 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5578         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5579         recognition macros.
5580         * src/freeze.c (produce_frozen_state): Use \n line-endings even
5581         on Windows, so that the frozen file reader will work.
5582         Reported by Josef T. Burger <bolo@bolo.com>
5584 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
5586         Forward port of a patch that allowed m4-1.4.2 to compile on
5587         QNX 6.3:
5589         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
5590         sys/signal.h.
5591         * src/m4.h: And include them as appropriate.
5592         * src/main.c, src/stackovf.h: Don't include signal.h literally;
5593         m4.h will include the correct file.
5595 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5597         * m4/m4private.h: Make errno visible for the sources patched
5598         below.
5600 2005-05-04  Paul Eggert  <eggert@twinsun.com>
5602         * src/main.c (print_program_name_CB): Preserve errno, since
5603         M4ERROR relies on this.
5604         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
5605         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
5606         * m4/path.c (m4_path_search): Don't let "free" trash errno when
5607         returning NULL.
5609         * m4/output.c (m4_insert_file): Don't assume errno has a valid
5610         value simply because fread returns zero.  This fixes a
5611         portability bug reported by Marion Hakanson in
5612         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
5614 2005-05-04  Santiago Vila  <sanvila@debian.org>
5616         * tests/stackovf.test: Use tempfile if available.
5618 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
5620         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
5621         * m4/output.c (m4_insert_file): Do not mix buffered and
5622         unbuffered I/O, as this breaks on the Hurd.
5624 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
5626         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
5627         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
5628         and libtoolize does a better job of ltdl importing now too, so
5629         take advantage of that while updating the tree:
5631         * acm4, config: Moved from here...
5632         * ltdl/m4, ltdl/config: ...to here.
5633         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
5634         src/Makefile.am, tests/Makefile.am: Removed...
5635         * Makefile.am: ...and migrated to here, with adjustments to
5636         compensate for relative path differences.
5637         * commit: Adjust relative paths.
5638         * configure.ac: Adjust relative paths.
5639         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
5640         patch.
5641         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
5642         the meanwhile, CVS HEAD libtool is needed.
5643         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
5644         stricly new enough, we also need a patch.
5645         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
5646         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
5647         (gl_MODULES): Don't list getopt and version-etc, as they don't
5648         belong in libm4.
5649         * bootstrap: After running gnulib-tool to import the listed
5650         modules, fetch getopt and version-etc into src manually.
5651         (ltdldir): Change to ltdl.
5652         * src/main.c: Adjust for changes in version-etc API.
5653         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
5654         but works when the getopt module isn't to be included in the lib.
5655         * README: Add note about patching autoconf and automake to
5656         bootstrap CVS m4.
5658 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
5660         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
5661         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
5662         empty file rather than to a nonexistent file.  This closes a
5663         common security hole.
5664         * modules/m4.c (m4_maketemp): Implement the above, by using
5665         mkstemp rather than mktemp.
5667 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
5669         The FSF are moving offices today.  Changed their contact address
5670         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
5671         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
5673 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
5675         * tests/Makefile (clean-local): Ignore testsuite cleanup
5676         failures.
5678 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
5680         * tests/Makefile (clean-local): Only run the testsuite cleanup
5681         if the testsuite has been generated.
5683 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
5685         * TODO: slight clarification of the example of qindir usage.
5687 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
5689         * TODO: Add qindir requirement, and defn bug.
5690         From Stepan Kasal  <kasal@ucw.cz>
5692 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
5694         * TODO: Add ``execution stack'', fix a typo.
5695         * doc/m4.texinfo: Typos.
5697 2004-12-24  Eric Blake  <ebb9@byu.net>
5699         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
5700         to the gnu subdirectory.
5701         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
5702         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
5703         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
5704         * m4/system_.h: Likewise, in non-configured includes.
5706 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
5707             Gary V. Vaughan  <gary@gnu.org>
5709         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
5710         Protect definitions from macro expansion under -DNDEBUG by
5711         parenthesising the expanded function names.
5712         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5713         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5714         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5715         (m4_is_syntax_macro_escaped): Similarly protect function
5716         definitions from macro expansion under -DNDEBUG by #undefing the
5717         matching macro names before each definition.  Also, move all the
5718         function definitions to the end of the file so that any
5719         invocations in the rest of the file pick up the fast macro
5720         versions.
5721         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
5722         (m4_set_debug_file, m4_set_trace_messages)
5723         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5724         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5725         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
5726         option setter functions.
5728 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
5730         * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
5731         to gnu.
5733 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
5735         * src/main.c: Include gnulib files from the correct directory.
5737         * gnulib/*: Don't store any of the gnulib files in arch, as they
5738         generate spurious changes.
5739         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
5740         gnulib macros now share our macro directory.
5741         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
5742         * bootstrap: Call gnulib-tool to import from the gnulib tree.
5743         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
5744         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
5745         the gettext macros from autopoint that overwrite the gnulib-tool
5746         imported versions.  Import sources and Makefile.am into the `gnu'
5747         directory.  Changed all callers.
5748         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
5749         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
5750         for imported modules.
5751         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
5752         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
5753         hardcoding the gnulib macros they wrap.
5755 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
5757         Latest CVS libtool can preload modules in libraries, including
5758         its own module loaders!  Tweak m4 so that it doesn't try to treat
5759         libltdl's module loaders as m4 modules when freezing and on exit:
5761         * gnulib/acm4/*.m4: Don't store these files in arch since they
5762         generate spurious changes.
5763         * bootstrap: Simplify initial libtoolize call, since CVS
5764         libtoolize is smarter these days.
5765         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
5766         build.
5767         * m4/module.h (m4__module_exit): Missing declaration.
5768         * m4/m4private.h (m4__module_next): New function declaration.
5769         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
5770         encapsulation.  Changed all callers.
5771         (m4__module_interface): New function to verify m4 loadable module
5772         interfaces.
5773         (m4__module_init): Register the interface validator.
5774         (m4__module_exit): Only close my own modules.
5775         * modules/m4.c (unistd.h): Provide missing declaration.
5776         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
5777         (m4_expand_ranges): More missing declarations.
5778         * modules/modtest.c (export_test): Ditto.
5779         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
5780         * src/main.c (main): Bump copyright year.
5781         * tests/modules.at: Fix sed syntax error.
5784 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
5786         Tweaking to enable compilation with latest CVS libtool and
5787         libltdl.  We can't just dump the library files directly into the
5788         m4 directory anymore now that libltdl is built from pieces itself:
5790         * bootstrap: Rewritten to use latest libtoolize sanely, and to
5791         set up libltdl subdirectory.
5792         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
5793         gnulib subdirectory's config.
5794         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
5795         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
5796         macros from gnulib.
5797         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
5798         configure.ac, so use AC_WITH_LTDL instead.
5799         * Makefile.am (SUBDIRS): Add libltdl.
5800         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
5801         gl_INCLUDED_REGEX.
5802         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
5803         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
5804         (libm4_la_LIBADD): Add LIBLTDL.
5805         * m4/ltdl.c, m4/ltdl.h: Removed.
5806         * m4/m4module.h: Include canonical ltdl.h.
5807         * po/*.po: Updated.
5809 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
5811         * gnulib/import: Now updates makefile fragments, and configure.ac.
5812         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
5813         * gnulib/m4/Makefile.am: include it.
5814         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
5815         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
5816         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
5817         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
5818         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
5819         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
5820         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
5821         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
5822         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5823         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5824         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5825         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
5826         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
5827         import.
5828         * gnulib/m4/getopt_int.h: New source file from latest gnulib
5829         import.
5830         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
5831         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
5832         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
5833         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
5834         Updated source files from latest gnulib.
5836 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
5838         * config/mailnotify: New file for mailing commit notifications,
5839         imported from cvs-utils.
5840         * commit: Updated from cvs-utils and tweaked for m4.
5842 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
5844         * config/mkstamp: Updated from CVS libtool.
5845         * configure.ac: Generate a gnu coding standards compliant version
5846         number, and use it for the banner.
5847         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
5848         mhen the TIMESTAMP changes in ChangeLog, but the file modification
5849         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
5850         contain the previous version number.
5851         * src/main.c: Make --version output conform to the GNU standard.
5853         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
5854         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
5855         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
5856         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
5857         time_la_SOURCES): ...so that these are defaulted correctly, and
5858         can be removed from this file.
5859         (AM_LDFLAGS): Add -module...
5860         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
5861         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
5862         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
5863         the individual settings can be removed.
5864         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
5865         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
5866         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
5867         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
5868         time_la_LIBADD): ...so that these are picked up as a deplib of
5869         libm4 and don't need to be set explicitly.
5871 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
5873         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
5874         from the standard build.  It is too fragile.
5876         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5877         CVS libtool after merging m4 changes across to libtool.
5879         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5880         * m4/path.c (search_path_add): Ditto.
5882 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5884         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5885         libtool tags we don't use in configure.  This reduces the size
5886         of the script from over 1Mb to under 700Kb.
5888 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5890         The import script was not written properly, and the last gnulib
5891         import was incomplete.  Fixed that problem, and reimport our
5892         gnulib dependencies, which picks up the address calculation
5893         overflow checks described by Paul below.  Also tweak the clients
5894         of the gnulib xalloc module not to use deprecated macros:
5896         * gnulib/import: Recurse through module dependencies rather than
5897         naively descending only one level.
5898         * configure.ac: Add calls to gnulib's strnlen and extension module
5899         macros.
5900         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5901         extension modules.
5902         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5903         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5904         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
5905         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
5906         gnulib.
5907         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
5908         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
5909         place of `xcalloc (1, S)'.
5910         * m4/m4.c (m4_create): Likewise.
5911         * m4/m4private.h (m4_symbol_value_create): Likewise.
5912         * m4/symtab.c (symtab_fetch): Likewise.
5913         * m4/syntax.c (m4_syntax_create): Likewise.
5914         * src/freeze.c (reload_frozen_state): Likewise.
5915         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
5916         macro.
5917         * m4/symtab.c (m4_symtab_create): Likewise.
5919 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
5921         * tests/module.at: Comment typo.
5923 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
5925         * tests/modules.at (modules: importing): Apply some lateral
5926         thinking, and use AT_CHECK to compare the output of a sed pass
5927         over stderr against the canonical strerror string.
5929         * tests/modules.at (modules: importing): Edit the generated stderr
5930         output to canonicalize strerror output, before a comparison.
5932 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
5934         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
5935         careful not to trip over the mess:
5937         * modules/perl.c: Some builds of perl install headers that contain
5938         `#define try __builtin_try'.  Be sure to undefine that macro
5939         before `m4/hash.h' gets included, which uses the `try' symbol.
5940         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
5941         `false' before including `stdbool.h'.
5942         (DELETE):  This symbol is not in m4's namespace, and is in any
5943         case only used internally...
5944         * m4/m4private.h (DELETE): ...so move it to here.
5945         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
5947 2003-10-08  Paul Eggert  <eggert@twinsun.com>
5949         Don't use XMALLOC and XCALLOC.  Once we install the
5950         corresponding patch into gnulib, this will fix some
5951         address-calculation overflow bugs on hosts where calloc (A, B)
5952         returns garbage when A*B overflows.
5954         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
5955         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
5956         xmalloc, XCALLOC with xcalloc.
5957         * m4/m4.c (m4_create): Likewise.
5958         * m4/m4private.h (m4_symbol_value_create): Likewise.
5959         * m4/output.c (m4_output_init): Likewise.
5960         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
5961         * m4/syntax.c (remove_syntax_attribute): Likewise.
5962         * src/freeze.c (reload_frozen_state): Likewise.
5963         * src/main.c (main): Likewise.
5965 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
5967         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
5968         gnulib/acm4 directories for aclocal m4 macros.
5969         * gnulib/Makefile.am (EXTRA_DIST): Removed.
5970         (MAINTAINERCLEANFILES): Add Makefile.in.
5971         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
5972         modules we use.
5973         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
5974         * gnulib/import: New file.  Temporary script for updating gnulib
5975         imported files, until gnulib-tool is working.
5976         * gnulib/config/codeset.m4, gnulib/config/error.m4,
5977         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
5978         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
5979         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5980         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
5981         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5982         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5983         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5984         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
5985         gnulib/config/nls.m4, gnulib/config/obstack.m4,
5986         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
5987         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
5988         gnulib/config/regex.m4, gnulib/config/restrict.m4.
5989         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
5990         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
5991         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
5992         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
5993         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
5994         gnulib/config/xstrndup.m4: Removed.
5995         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
5996         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
5997         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
5998         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
5999         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
6000         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
6001         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
6002         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
6003         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
6004         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
6005         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
6006         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
6007         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
6008         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
6009         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
6010         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
6011         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
6012         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
6013         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
6014         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
6015         gnulib/import script.
6016         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
6017         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
6018         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
6019         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
6020         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
6021         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
6022         gnulib with gnulib/import script.
6023         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
6024         guards ready for gnulib-tool to autoupdate on import.
6025         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
6026         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
6027         config/stackovf.m4: Moved from here...
6028         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
6029         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
6030         acm4/stackovf.m4: ...to here, to separate aclocal macros from
6031         configure time helper scripts.
6032         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
6033         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
6034         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
6035         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
6036         gnulib xalloc.h.
6037         * src/main.c (version_etc_copyright): Only output the current
6038         year.
6039         (version_etc): Call with new variadic API.
6041 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
6043         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
6044         version-etc module from CVS gnulib.
6045         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
6046         * src/Makefile.am: Build it.
6047         * src/main.c: Use it.
6049         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
6050         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
6051         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
6052         exit.h instead.
6054 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
6055             Gary V. Vaughan  <gary@gnu.org>
6057         * bootstrap: Separate options.
6058         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
6059         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
6060         not set.
6061         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
6062         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
6063         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
6064         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
6065         $(LTLIBINTL) for gettext support on cygwin.
6066         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
6067         have $(LTLIBINTL) from the preloaded module la files.
6068         * README: Remove the warning about using --disable-nls on Windows
6069         machines.
6071 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
6073         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
6074         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
6075         is required.
6077 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
6079         * doc/STYLE: Document the gnulib header naming conventions, and
6080         #include policy.
6081         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
6082         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
6083         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
6084         respectively.
6085         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
6087         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
6088         module from CVS gnulib.
6089         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
6090         (gl_FUNC_STRTOL): In favour of the module macro.
6092 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
6094         Replace the getopt code with CVS gnulib getopt.  The source files
6095         detect whether they are in a glibc environment and preprocess away
6096         all of the code if there is a system getopt, so we can compile
6097         them into the m4 executable unconditionally:
6099         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
6100         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
6101         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
6102         macros.
6103         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
6104         version.
6105         * src/Makefile.am: Adjust.
6106         * src/main.c: Always include our shipped getopt.h.
6107         * po/POTFILES.in: Use new location of getopt.c.
6109 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
6111         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
6112         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
6113         in this directory automatically.
6114         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
6116         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
6117         isn't set yet.
6118         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
6119         inline.
6120         * modules/Makefile.am (pkglibexecdir): Set it here.
6121         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
6123         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
6124         Import regex module from CVS gnulib.
6125         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
6126         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
6127         do extra substitutions for Makefile.
6128         * configure.ac: Use it.
6129         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
6130         from regex_.h if necessary.
6131         * m4/system_.h: Include the correct version of regex.h.
6132         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
6133         version.
6134         * po/POTFILES.in: Use new location of regex.c.
6136         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
6137         realloc.c: automake distributes these files already.
6139 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
6141         Replace the xstrzdup code by importing the xstrndup module from
6142         CVS gnulib, along with its dependencies: strndup and strnlen:
6144         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
6145         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
6146         gnulib.
6147         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
6148         gnulib/config/strndup.m4: Ditto wrt strndup.
6149         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
6150         strnlen.
6151         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
6152         However, contrary to gnulib, we install xstrndup.h.
6153         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
6154         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
6155         is an artifact of the old m4 portability layer.
6156         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
6157         * m4/system_.h: Include xstrndup.h.
6158         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
6160 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
6162         Reimport the latest xalloc module from CVS gnulib, and adjust the
6163         m4 sources to take advantage of xalloc xfree.  Also create a new
6164         macro DELETE with the same semantics as the old m4 XFREE macro,
6165         and carefully tweak callers:
6167         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
6168         gnulib.
6169         * m4/utility.c (xfree): Removed.  This function is now supplied by
6170         gnulib xalloc.
6171         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
6172         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
6173         * m4/symtab.c (m4_symtab_create): Ditto.
6174         * m4/system_.h: Removed XFREE redefine.
6175         (DELETE): New macro with same functionality as the original m4
6176         XFREE macro, but based on xalloc.h now.  Changed all callers.
6177         * src/main.c (main): Use XMALLOC macro.
6178         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
6179         instead of XFREE.
6180         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
6182 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
6184         Import the xalloc module from CVS gnulib, along with its
6185         dependencies: exitfail, malloc and realloc. We had different
6186         semantics for our XFREE and a function xfree() not supplied by
6187         gnulib, so also a bit of work to keep everything running
6188         smoothly:
6190         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
6191         (gl_XALLOC): Use gnulib equivalents.
6192         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
6193         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
6194         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
6195         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
6196         realloc.
6197         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
6198         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
6199         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
6200         imported modules.
6201         (pkgincdir): Removed.  Use pkgincludedir instead.
6202         * m4/m4private.h (XFREE): xfree already checks for NULL.
6203         * m4/system_.h: Use xalloc module, and remove macros already
6204         supplied by xalloc.h.
6205         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
6206         moved the old definition from m4/xmalloc.c to here for now.
6208 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
6210         Import the error and progname modules from CVS gnulib.  Our old
6211         error.c subsumed the functionality of both, so a little adjustment
6212         was required to accomodate the split in sources.  Also added more
6213         wrapper macros to choose between a system installed error.h or our
6214         shipped gnulib error module:
6216         * m4/error.c, m4/error.h: Removed.
6217         * m4/Makefile.am: Adjust.
6218         (pkgincdir): Removed.  Use pkgincludedir instead.
6219         * m4/module.h, src/main.c: Don't include `m4/error.h'.
6220         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
6221         error.h.
6222         * gnulib/m4/progname.c: Imported from CVS gnulib.
6223         * gnulib/m4/progname.h: Ditto.
6224         * src/main.c: Adjust to use progname module.
6225         * gnulib/m4/error.c: Imported from CVS gnulib.
6226         * gnulib/m4/error_.h: Ditto.
6227         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
6228         if appropriate, and link a local error.h if the system version is
6229         missing.
6230         (libgnu_la_SOURCES) Add progname module sources.
6231         * gnulib/config/error.m4: Imported from CVS gnulib.
6232         * gnulib/config/strerror_r.m4: Ditto.
6233         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
6234         to have ERROR_H for Makefile substitutions and tell system.h
6235         whether the system error.h should be used, or a locally installed
6236         version.
6237         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
6239 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
6241         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
6242         s/gettext_.h/gettext.h/.
6244         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
6245         automake have been fixed.
6247         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
6248         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
6249         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
6250         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
6252 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
6254         The gnulib obstack module requires the gnulib gettext module for
6255         systems that do not have GNU gettext installed.  Because we use
6256         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
6257         that directory incase it clashes with the system gettext.h.  This
6258         delta uses gettext_.h and extra rules in the Makefile to make a
6259         link to gettext.h when needed:
6261         * Makefile.am (auxdir): Removed.  No longer used.
6262         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
6263         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
6264         moved.
6265         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
6266         Makefile based build.
6267         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
6268         of the macros are kept.
6269         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
6270         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
6271         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
6272         distributes these automatically.
6273         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
6274         warning from automake-1.7a.
6275         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
6276         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
6277         all callers.
6278         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
6279         wrt. m4_FUNC_OBSTACK.
6280         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
6281         wrt. m4_sys_STACKOVF.
6282         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
6283         wrt. _m4_LIB_GMP, m4_LIB_GMP.
6284         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
6285         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
6286         respectively.
6287         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
6288         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
6289         gettext.h link on deficient systems.
6290         (pkginc_HEADERS): Mention $(GETTEXT_H).
6291         (EXTRA_HEADERS): Mention gettext.h.
6292         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
6293         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
6294         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6295         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
6296         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6297         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6298         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6299         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
6300         gnulib/config/po.m4, gnulib/config/progtest.m4,
6301         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
6302         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
6304 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
6306         We can't mirror the gnulib directory structure here, since we need
6307         to be able to eg. `#include <m4/obstack.h>' from our source files,
6308         which is much easier if the local obstack.h is created in a
6309         directory named m4.  Rather than trying to symlink everything into
6310         the m4 directory, now we build a libtool convenience library from
6311         the sources we get from gnulib and link that with libm4.la:
6313         * gnulib/config/extensions.m4: Imported from CVS gnulib.
6314         * gnulib/config/unlocked-io.m4: Ditto.
6315         * gnulib/m4/unlocked-io.h: Ditto.
6316         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
6317         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
6318         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
6319         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
6320         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
6321         * m4/Makefile.am: Adjust.
6322         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6323         macros we redistribute.
6324         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
6325         library among others.
6326         (GNULIB_SRCS, GNULIB_MACROS): Removed.
6327         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6328         * config/m4-obstack.m4: Adjust.
6329         * po/POTFILES.in: Adjust.
6330         * configure.ac: Reformatting.  Call newly imported gnulib macros.
6331         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6332         bogus calls of `#include "m4.h"'.
6333         * Makefile.am: INCLUDES has been deprecated in favour of
6334         AM_CPPFLAGS.
6335         * m4/Makefile.am: Ditto.
6336         * modules/Makefile.am: Ditto.
6337         * src/Makefile.am: Ditto.
6339 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
6341         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6343 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
6345         Migrate the obstack support into the gnulib directories for easy
6346         synchronisation with upstream files in gnulib:
6348         * config/gnu-obstack.m4: Moved from here...
6349         * config/m4-obstack.m4: ...to here.
6350         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6351         * m4/obstack.c, m4/obstack_.h: Moved from here...
6352         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6353         * po/POTFILES.in: Adjust.
6354         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6355         * m4/Makefile.am: Add a whole new section to link the obstack
6356         sources from the gnulib tree if necessary.
6357         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6358         from gnulib.
6359         * config/m4-obstack.m4: Rewrite as a wrapper for
6360         gnulib/m4/obstack.m4.
6362 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
6364         GNU M4 currently builds with a number of files adapted from
6365         upstream sources.  Recently the gnulib project on savannah.gnu.org
6366         has pulled together a great many of these externally maintained
6367         files.  This delta is the beginnings of isolating those files
6368         maintained in gnulib to make it easy to synchronise M4 with the
6369         upstream files prior to releases.
6371         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6372         directory.
6373         (SUBDIRS): Added new gnulib subdirectory.
6374         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6375         * config/stdbool.m4: Moved from here...
6376         * gnulib/m4/stdbool.m4: ...to here.
6377         * m4/stdbool_.h: Moved from here...
6378         * gnulib/lib/stdbool_.h: ...to here.
6379         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
6380         distributed.
6381         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6382         code to work with new stdbool_.h location.
6383         (gnulib_srcdir): New.
6385 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
6387         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6388         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6389         builds to work.
6390         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
6391         (EXTRA_DIST): Use it.
6393         * bootstrap: CVS autoreconf leaves file droppings.  Remove
6394         aclocal.m4t incase autoreconf doesn't.
6396 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
6398         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
6399         the other gnulib imports, renamed to m4/obstack_.h.
6400         * m4/obstack.c: Updated from CVS gnulib.
6401         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6402         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6403         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
6404         about vpath already, and $top_srcdir upsets CVS Automake, so the
6405         $top_srcdir reference was removed.
6407         * m4/system-h.in: For consistency with the gnulib imports, renamed
6408         to m4/system_.h.
6409         * m4/Makefile (EXTRA_HEADERS): Adjust.
6410         * configure.ac (AC_CONFIG_FILES): Adjust.
6412         * m4/stdbool_.h: New file from gnulib for systems without their
6413         own.
6414         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6415         * config/stdbool.m4: New file.  Macros from gnulib for same.
6416         * configure.ac: Use it.
6418 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
6420         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6421         * config/gmp.m4: Ditto.
6422         * config/gnu-obstack.m4: Ditto.
6423         * config/stackovf.m4: Ditto.
6424         * m4/builtin.c: Ditto.
6425         * m4/debug.c: Ditto.
6426         * m4/error.c: Ditto.
6427         * m4/error.h: Ditto.
6428         * m4/gnu-obstack.h: Ditto.
6429         * m4/hash.c: Ditto.
6430         * m4/hash.h: Ditto.
6431         * m4/input.c: Ditto.
6432         * m4/m4.c: Ditto.
6433         * m4/m4module.h: Ditto.
6434         * m4/m4private.h: Ditto.
6435         * m4/macro.c: Ditto.
6436         * m4/module.c: Ditto.
6437         * m4/obstack.c: Ditto.
6438         * m4/output.c: Ditto.
6439         * m4/path.c: Ditto.
6440         * m4/regex.c: Ditto.
6441         * m4/regex.h: Ditto.
6442         * m4/strtol.c: Ditto.
6443         * m4/symtab.c: Ditto.
6444         * m4/syntax.c: Ditto.
6445         * m4/utility.c: Ditto.
6446         * m4/xmalloc.c: Ditto.
6447         * m4/xstrdup.c: Ditto.
6448         * m4/xstrzdup.c: Ditto.
6449         * modules/evalparse.c: Ditto.
6450         * modules/format.c: Ditto.
6451         * modules/gnu.c: Ditto.
6452         * modules/import.c: Ditto.
6453         * modules/load.c: Ditto.
6454         * modules/m4.c: Ditto.
6455         * modules/m4.h: Ditto.
6456         * modules/modtest.c: Ditto.
6457         * modules/mpeval.c: Ditto.
6458         * modules/perl.c: Ditto.
6459         * modules/shadow.c: Ditto.
6460         * modules/stdlib.c: Ditto.
6461         * modules/time.c: Ditto.
6462         * modules/traditional.c: Ditto.
6463         * src/freeze.c: Ditto.
6464         * src/getopt.c: Ditto.
6465         * src/getopt1.c: Ditto.
6466         * src/m4.h: Ditto.
6467         * src/main.c: Ditto.
6468         * src/stackovf.c: Ditto.
6470         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6471         ac_default_headers is an autoconf internal variable.
6472         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6473         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6475         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6476         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6477         delta.
6479 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
6481         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6482         C99 bool.
6483         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6484         possible or faking one with a typedef.  Changed all callers.
6486 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
6488         Still cleaning up the users' module API, by taking out the stuff
6489         that isn't used by any existing modules, and moving specialised
6490         functions out of libm4 and into the module they are used by.
6492         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
6493         * m4/utility.c (m4_skip_space): ...to here the home of its only
6494         use, made static and renamed to `skip_space'.  Changed all
6495         callers.
6496         * m4/m4module.h (m4_expand_ranges): Removed prototype.
6497         * m4/utility.c (m4_expand_ranges): Moved definition from here...
6498         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6499         ltdl.
6500         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6501         casting .
6502         * modules/gnu.c (builtin_syntax): Import and use in this
6503         builtin implementation.
6504         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6505         Not used.  Deleted.
6506         * m4/macro.c (trace_flush): Except here where the macro is now
6507         manually inlined.
6508         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6509         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6510         moved...
6511         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6512         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6514 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
6516         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6517         compiler based AC_CHECK_HEADER that was introduced in
6518         autoconf-2.56.
6519         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6520         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6521         * configure.ac: Use renamed M4_AC_LIB_GMP.
6523         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6524         macro that requires arguments! This stops the shell's bad
6525         substitution error at configure time.
6527         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6528         variables to the testsuite shell.  Set the value of USE_GMP so
6529         that the gmp test will run!
6530         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6532 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
6534         Libltdl already has an excellent mechanism for accessing C symbols
6535         in modules.  Lets use that!  Remove all the exporting cruft and
6536         just use lt_dlsym in conjunction with a few conventions to
6537         simplify module writers' jobs.  Also removed the table address
6538         caching code and otherwise simplified the module loader quite a
6539         bit.  To access exported symbols in other modules, first the
6540         exporting module must name the symbols <modname>_LTX_<symname>,
6541         and the importing module must define a function type called
6542         <symname>_func.  The importer then adds
6543         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6544         that wishes to call out to the exported functions.  Care must be
6545         taken that <symname> is non-NULL in the importing module incase
6546         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6547         definition was in the importers source.  Study
6548         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
6549         m4_module_import will attempt to automatically load a module
6550         required for symbol access if it is not loaded already.
6552         * TODO: Removed the items fixed in this delta.
6553         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6554         module name.
6555         * m4/ltdl.h (lt_dlhandle_find): Declare it.
6556         * m4/module.c (m4_module_unload): Use it.
6557         * src/freeze.c (reload_frozen_state): Ditto.
6558         * m4/m4module.h (m4_export): Deleted.  Removed all references.
6559         (M4_MODULE_IMPORT): New user convenience macro for importing
6560         arbitrary symbols from other modules.
6561         * m4/module.c (m4_module_import): New function to service
6562         M4_MODULE_IMPORT macro.
6563         (module_data): Removed.  Looking up the tables on demand with
6564         lt_dlsym, rather than caching their addresses here simplifies the
6565         code substantially.
6566         (m4_get_module_builtin_table, m4_get_module_macro_table):
6567         Removed.  Changed all callers.
6568         (set_module_macro_table, set_module_builtin_table): Renamed to
6569         install_macro_table and install_builtin_table respectively, and
6570         simplified now that the cache is no more.
6571         * modules/gnu.c (builtin_symbols): Use this new mechanism to
6572         import m4_dump_symbols from the m4 module.
6573         (builtin_esyscmd): Likewise for m4_set_sysval and
6574         m4_sysval_flush.
6575         * modules/m4.c (m4_export_table): Removed.  Functions are
6576         addressed with the new mechanism which doesn't need this.
6577         (m4_set_sysval): New exported accessor function to prevent
6578         problems with variable access on inferior architectures.
6579         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6580         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6581         that we can have some type safety.
6582         * modules/modtest.c (export_test): C level exported function for
6583         testing the new import mechanism.
6584         * modules/import.c: New file for the import end of the test.
6585         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
6586         * tests/modules.at: New test cases for intermodule symbol
6587         importing.
6589 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
6591         * m4/m4module.c (m4_string): Moved from here...
6592         * m4/m4private.c (m4_string): ...to here.
6594         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
6596 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
6598         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
6599         already available to module writers through
6600         m4_{get,set}_nesting_limit_opt(), so moved from here...
6601         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
6602         (m4_create): Use it.
6604 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
6606         Aside from auditing path.c for m4module.h api obfuscation, this
6607         delta introduces the concept of private struct members in opaque
6608         data types to GNU m4: See the STYLE file for details.
6610         * TODO: Remind ourselves that a rewrite of path.c is needed.
6611         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
6612         Moved from here...
6613         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
6614         here and renamed.  These type definitions are for internal api use
6615         only.  Changed all callers.
6616         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
6617         Moved from here...
6618         * m4/path.c (search_path_env_init, search_path_add): ...to here
6619         and renamed.  These calls were never used outside this file.
6620         Changed all callers.
6621         (dirpath): Moved functionality of this static declaration...
6622         * m4/m4private.h (struct m4): ...to this new internal only
6623         search_path field.  Changed all callers.
6624         (m4__get_search_path): Added new internal api accessor.
6625         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
6626         (m4_include_init): Removed...
6627         * m4/m4.c (m4_create): ...because the new m4 field is now
6628         initialised here.
6629         (m4_delete): Recycle search_path memory.
6630         * src/main.c (main): Don't call m4_include_init now that it's
6631         gone!
6632         * doc/STYLE: Document convention for private fields in opaque
6633         ADTs.
6635 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6637         Sometimes exporting the address of a symbol from a module isn't
6638         enough for other modules to call that symbol correctly.  If
6639         custom data types are used for function parameters, they need to
6640         be known to the caller.  This change introduces the concept of
6641         $(prefix)/include/modules/$(modulename).h to declare those
6642         structures.  Also we move m4_dump_symbols from libm4 to the m4
6643         module to show this concept in action.
6645         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
6646         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
6647         exporting data structures from modules/m4.c.
6648         * modules/m4.c, modules/gnu.c: Include it.
6649         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
6650         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
6651         prototypes.
6652         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
6653         Moved from here...
6654         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
6655         ...to here, with slight renaming.
6656         (m4_export_table): Prototype and add m4_dump_symbols.
6657         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
6658         definition of m4_dump_symbols.
6659         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
6660         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
6662 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6664         Create an export table in modules/m4.c in readiness for beefing up
6665         the module loader to track module exports and imports.
6667         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
6668         * m4/debug.c (m4_debug_flush_files): Moved...
6669         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
6670         * modules/gnu.c (builtin_esysval): Use it.
6671         * m4/m4module.h (m4_export): New type for declaring module symbols
6672         for export.
6673         * modules/m4.c (m4_export_table): List symbols exported from this
6674         module for use by other modules.
6676 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
6678         An experiment: There is loads of code in libm4 which should be in
6679         the m4 module, but is also used by another module. Just because
6680         some linkers won't cope with calls across dynamic runtime loaded
6681         objects I initially left the code in libm4.  It will tidy the
6682         module api immensely if this code moves to the right place, I just
6683         need to remember to invent a suitable calling mechanism at some
6684         point.  For now, only modules that are statically linked and
6685         preloaded will get this treatment, so the only platforms that will
6686         break are those that require all symbols to be resolved at link
6687         time.
6689         * TODO: Reminder that what I am doing could reduce portability
6690         unless I do something more robust later.
6691         * m4/m4module.h (m4_sysval): No longer exported from libm4.
6692         * m4/utility.c (m4_sysval): No longer declared in libm4.
6693         * modules/Makefile.am: Reformatting.
6694         * modules/m4.c (m4_sysval): Declare it at place of use.
6695         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
6697 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
6699         * m4/m4module.h: Reformatting and rearranging lines a bit.
6700         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
6701         all users.
6702         (m4_call_macro, m4_expand_input): Renamed...
6703         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
6704         callers.
6705         (m4_expansion_level, m4_process_macro): Moved...
6706         * m4/macro.c (expansion_level, process_macro): ...to here, and
6707         made static.
6709         * m4/m4module.h (program_name): Not used by modules at all, so
6710         moved...
6711         * src/main.c (program_name): ...to here.
6712         (print_program_name): Renamed...
6713         (print_program_name_CB): ...to conform to the STYLE guide.
6715 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
6717         More refactoring of the m4module.h API.  Replace #defines with an
6718         enum, and move non-public functions out of the public API.
6720         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
6721         inclusion.
6722         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
6723         * m4/debug.c (m4_debug, trace): Moved...
6724         * m4/m4private.h (struct m4): ...to fields of this struct.
6725         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
6726         for the new fields.
6727         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
6728         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
6729         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
6730         * m4/m4module.h (m4_context_field_table): Add entries for new
6731         debug_file and trace_messages fields.
6732         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
6733         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
6734         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
6735         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
6736         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
6737         (m4_is_debug_bit): New macro to simplfy checks against the debug
6738         bits above.
6739         (m4_trace_format, m4_trace_header, m4_trace_flush)
6740         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
6741         prototypes.
6742         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
6743         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
6744         * m4/macro.c (trace_format, trace_header, trace_flush)
6745         (trace_prepre, trace_pre, trace_post): ...to these newly static
6746         functions, since they are only ever used from this file.  Changed
6747         all callers.
6749 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
6751         Change the macros for checking syntax so that matching against
6752         multiple possible syntax classes can be done with a single
6753         comparison some of the time.  The various classes are now bits of
6754         an int that can be checked with bitwise logic operators.
6756         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
6757         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
6758         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
6759         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
6760         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
6761         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
6762         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
6763         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
6764         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
6765         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
6766         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
6767         Replace all calls with invocations of these...
6768         (m4_is_syntax, m4_has_syntax): ...New macros.
6769         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
6770         is no longer required with new macros.  Changed all callers.
6772 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
6774         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
6775         values are returned as part of the internal interface, so they
6776         need to be moved...
6777         * m4/private.h: ...to here.
6778         * m4/macro.c (expand_token): Check for out of range
6779         m4_peek_input() results before looking up in the syntax table.
6780         (collect_arguments): Ditto.
6782         * NEWS: Note `$' syntax class.
6784 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
6785             Gary V. Vaughan  <gary@gnu.org>
6787         Conform to POSIX if the POSIXLY_CORRECT environment is set.
6788         --traditional `define' now smashes all the definitions.
6790         * NEWS: Explain this.
6791         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
6792         (Extensions): Explain that extensions that are incompatible with
6793         POSIX are disabled if POSIXLY_CORRECT is set.
6794         (Incompatibilities): Remove.
6795         (Define, Other Incompat): Explain difference
6796         between GNU and POSIX behavior of define, pushdef, popdef.
6797         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
6798         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
6799         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
6800         (m4_get_posixly_correct_opt): New macro.
6801         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
6802         POSIXLY_CORRECT.
6803         * modules/m4.c (builtin_functions): defn now takes any number of args.
6804         (builtin_define): Smash all the definitions if
6805         POSIXLY_CORRECT.
6806         (builtin_defn)): Allow any number of arguments.
6807         (builtin_undivert): Do not allow nonnumeric arguments
6808         if POSIXLY_CORRECT.
6809         * src/main.c (main): Set posixly-correct behavior if either
6810         POSIXLY_CORRECT is set, or if -G is given.
6811         * tests/builtins.at: New test for smashed definitions.
6813 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
6815         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
6816         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
6817         not to slow the parser down.
6818         (M4__IS_STRING): New macro to test string syntax class membership.
6819         * m4/syntax.c: Adjust docucomment.
6820         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
6821         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
6822         * m4/input.c (init_builtin_token): Comment typo.
6823         (m4__next_token): Comment typo.
6824         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
6825         by using the new M4__IS_STRING macro.
6826         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
6827         variable references in macro expansions.
6829         * doc/m4.texinfo (Eregexp and Regexp): Typo.
6830         (Epatsubst and Patsubst): Typo.
6831         (Eval): Typo.
6833 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
6835         Move the global variables that pertain to syntax to a new `struct
6836         m4_syntax_table', and then add one of these to `struct m4'.  The
6837         ripple effect through the code to both change formerly global
6838         references, and make sure a suitable context is available in
6839         lexical scope is disproportionately large compared to the size of
6840         the change proper.  This change is a large part of decoupling
6841         syntax.c from the rest of the code that uses it.
6843         * m4/m4private.h (struct m4): Add a syntax field.
6844         * m4/m4.c (m4_create): Initialise it,
6845         (m4_delete): Recycle it.
6846         (m4_get_symtab): Remove hand coded version...
6847         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
6848         callers.
6849         * m4/m4module.h (m4_context_field_table): Add an extra field so we
6850         can generate m4_get_symbol_table.  Add a new row for
6851         m4_get_syntax_table.
6852         (M4SYNTAX): Syntactic sugar for module writers.
6853         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
6854         (m4_syntax_table): New home for syntax related formerly global
6855         variables.
6856         * m4/m4private.h (struct m4_syntax_table): Define it.
6857         * m4/input.c (m4_input_init): Initialisation of these formerly
6858         global variables moved...
6859         * m4/syntax.c (m4_syntax_create): ...to here.
6860         * m4/input.c (m4_input_exit): And similarly, recycling of the
6861         memory used by those values moved...
6862         * m4/syntax.c (m4_syntax_delete): ...to here.
6863         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
6864         Moved to m4/m4private.h.
6865         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6866         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6867         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6868         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
6869         objects.  Changed all callers that used to directly access the
6870         global equivalents.
6871         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
6872         Removed and incorporated into m4_syntax_table structure.
6873         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
6874         * m4/syntax.c (m4_set_syntax): Now returns an error status,
6875         instead of requiring a `struct m4' to generate its own errors.
6876         Changed all callers.
6877         * src/main.c (main): Now that the syntax table is initialised as
6878         part of m4_create, we have to manually wipe the syntax entries if
6879         we are about to read a frozen file.
6881 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
6883         * doc/STYLE: Added notes on callback naming schemes.
6885         * m4/module.c (m4_set_module_macro_table)
6886         (m4_set_module_builtin_table): Declarations weren't changed when
6887         definitions were renamed on 2003-06-19.
6889         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
6890         neither used nor particularly appropriate since it exposes the
6891         internal workings of the hash module.  I haven't yet decided
6892         whether to remove it entirely.
6894 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
6896         Two related changes, and a huge knockon effect throughout the
6897         source: Moved the option variables out of global space and into
6898         `struct m4'; made `m4_symtab' a real datatype, so that its api
6899         is not marred passing `struct m4' around just so it can decide
6900         whether to keep traced symbol names or not.  Added setters and
6901         getters for the formerly global option variables, and obviously
6902         changed a vast number of functions to take a `struct m4' and use
6903         the getter funcs to find option values.
6905         * m4/utility.c (interactive, sync_output, debug_level)
6906         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
6907         (max_debug_argument_length, warning_status, nesting_limit)
6908         (discard_comments): Removed.
6909         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
6910         (debug_level, max_debug_argument_length, prefix_all_builtins)
6911         (suppress_warnings, discard_comments, interactive, sync_output):
6912         Removed from here...
6913         * m4/m4private.h (struct m4): ...and equivalent fields added to
6914         this structure.
6915         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6916         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6917         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6918         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6919         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
6920         macros for the new fields.
6921         * m4/m4module.h (m4_context_field_table)
6922         (m4_context_opt_bit_table): Helper macros used to generate
6923         prototypes, setters and getters for new option fields
6924         consistently.
6925         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6926         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6927         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6928         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6929         (m4_get_interactive_opt, m4_get_sync_output_opt)
6930         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6931         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6932         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
6933         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
6934         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
6935         setter and getter functions generated by cpp from
6936         m4_context_field_table and m4_context_opt_bit_table, exported as
6937         part of the module api.  Changed all callers.
6938         * m4/symtab (struct m4_symtab): Used as the concrete type for
6939         m4_symtab now.
6940         (m4_symtab_create): Allocate and initialise a new struct.
6941         (m4_symtab_apply): New function that works like m4_hash_apply, but
6942         with different callbacks specific to symbol tables.  Changed all
6943         callers.
6944         (symbol_destroy, arg_destroy, arg_copy): Renamed
6945         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
6946         they have unused parameters for a reason!
6947         (dump_symbol_CB): New callback to dump the contents of a single
6948         symbol.
6949         (symtob_dump): Rewritten in terms of dump_symbol_CB.
6950         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
6951         Changed all callers.
6952         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
6953         of the contained `m4_symtab' at the `no_gnu_extensions' field.
6954         Although I'm not convinced these semantics are correct, they are
6955         at least consistent with how things were before this delta.  Also
6956         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
6958 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
6960         Tie down the interface to libm4 some more.  Make more structures
6961         opaque to modules by moving them to m4private.h, and writing
6962         setters and getters.  To win back the speed penalty for doing this
6963         also wrote macroized versions that do know about structure layout
6964         in m4private.h and #include that file into modules when NDEBUG is
6965         defined at compile time.  There are still some accessor macros in
6966         m4private.h that need to go, but that is not necessary to clean
6967         the module api up.
6969         * m4/m4module.h (m4_symbol_type): Moved...
6970         * m4/m4private.h (m4__symbol_type): ...to here.
6971         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
6972         (m4_set_symbol_traced, m4_set_symbol_name_traced)
6973         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6974         (m4_get_symbol_func, m4_symbol_value_create)
6975         (m4_symbol_value_delete, m4_set_symbol_value_text)
6976         (m4_set_symbol_value_func): New exported api to symbols.
6977         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
6978         and m4_is_symbol_value_func.
6979         * m4/m4module.h: Prototype these guys.
6980         * m4/module.c (m4_set_module_macro_table)
6981         (m4_set_module_builtin_table): Make these static, there is no
6982         reason to pollute the api with them.
6983         * m4/m4private.h: Reformatting.
6984         (m4_get_symtab): Only define when NDEBUG is defined.
6985         (m4_get_symbol_value, m4_get_symbol_traced)
6986         (m4_set_symbol_traced, m4_set_symbol_name_traced)
6987         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6988         (m4_get_symbol_func, m4_symbol_value_create)
6989         (m4_symbol_value_delete, m4_set_symbol_value_text)
6990         (m4_set_symbol_value_func): Macro implementations of the new
6991         functions when NDEBUG is defined.
6992         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
6993         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
6994         Superceded by the above.  All callers changed.
6995         (M4ARG): Removed.  This is no longer different to the
6996         m4/m4module.h definition.
6997         * modules/gnu.c, modules/m4.c: Only include m4private.h when
6998         NDEBUG is defined.  That way we exercise the same (albeit slower)
6999         api that external modules must use.
7001 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
7003         Renamed some of the types and their accessors to make more sense.
7004         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
7005         has a stack of SYMBOL_VALUEs.
7007         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
7008         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
7009         m4_get_symbol_value_type,  m4_get_symbol_value_text,
7010         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
7011         Changed all callers.
7012         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
7013         (m4_get_token_type): Renamed
7014         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
7015         to the internal api.
7016         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
7017         s/TOKEN_/VALUE_/
7018         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
7019         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
7020         (m4__token_type): Moved here from m4module.h.
7021         (m4__next_token): Renamed from m4_next_token.
7022         * m4/symtab.c: Removed some of the parameterised macro support
7023         functions for modularisation later.
7024         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
7025         m4_hash_dup to perform a true deep copy of the SRC.
7026         (arg_copy): Callback for m4_symbol_value_copy.
7027         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
7028         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
7029         m4_get_symbol_value_func.  Changed all callers.
7031 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
7033         Tidy up style of hash.[ch] in accordance with doc/STYLE.
7035         * m4/hash.c: Internal symbol renaming and formatting.
7036         (m4_hash_dup): New function to facilitate deep copies of hash
7037         tables.
7038         (m4_hash_apply_func): Returns a void* now, which is a richer type
7039         for returning exceptions (NULL means keep going).
7040         (m4_hash_apply): Ditto.
7041         * m4/hash.h: Declare exported symbols with an explicit extern.
7042         Reformated.
7044 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
7046         Still refactoring furiously.  This delta represents a change in
7047         semantics to symtab.c.  Instead of building temporary m4_tokens
7048         in the caller, and copying fields in the methods, we now create
7049         the actual m4_token for hashing in the caller so the methods just
7050         slot them in directly.  Also, this means that we don't lookup a
7051         symbol and get back an allocated but VOID token to copy fields
7052         into, we create the token we want to push and pass that to
7053         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
7054         a few other small changes to stop knowledge of the implementation
7055         of symtab.c leaking out into other files.
7057         * m4/macro.c (expand_argument): Comment typo corrected.
7058         * m4/symtab.c (symtab_fetch): New function to fetch the address of
7059         an interned symbol.
7060         (m4_symbol_pushdef): Take an extra value parameter and use this
7061         directly as the new top of the value stack.  All callers changed
7062         to build a token and pass responsibility for memory in, rather
7063         than copying as we used to.
7064         (m4_symbol_define): Also use the new value parameter directly as a
7065         replacement for the top of the value stack.  All callers changed
7066         to build a token as above.
7067         (m4_set_symbol_traced): New function to set the traced bit on the
7068         named symbol, creating it if necessary.
7069         (symbol_popval): The guts of the old m4_symbol_popdef.
7070         (m4_symbol_popdef): Use it.
7071         * m4/builtin.c (m4_symbol_set_token): Removed,
7072         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
7073         replaced...
7074         * m4/module.c (m4_set_module_builtin_table)
7075         (m4_set_module_macro_table): ...with these more orthogonal
7076         functions.
7077         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
7078         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
7079         required.
7080         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
7081         (m4_arg_signature_parse): Moved...
7082         * m4/symtab.c: ...to here.
7083         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
7084         screw something up. Moved...
7085         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
7086         actually does a proper deep copy of source to dest.
7088 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
7090         Further refactoring to stabilise the module API.  Renaming some
7091         functions for orthogonality, and judicious definition migration to
7092         move things out of the set of exported symbols.
7094         * doc/STYLE: New file.  Notes on coding style.
7095         * m4/m4module.c: Updated bitrotted docucomment at the top of the
7096         file.
7097         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
7098         m4_get_module_name, m4_get_module_builtin_table,
7099         m4_get_module_macro_table which are verb phrases.  Changed all
7100         callers.
7101         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
7102         Moved to...
7103         * m4/module.c (m4_set_module_builtin_table)
7104         (m4_set_module_macro_table): ...here, and renamed. Changed all
7105         callers.
7106         * m4/m4module.c (m4_module_data): This...
7107         * m4/m4private.c (struct m4_module_data): ...and this...
7108         * m4/module.c (module_data) ...consolidated here and no longer
7109         exported.  Changed all callers.
7111 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
7113         Begin work on lifting the curse of the global variables.  To start
7114         with create a `struct m4' context container, and replace
7115         `m4__symtab' with `context->symtab' throughout.  This means
7116         initialising a context container in main, and adjusting many
7117         functions between main and the module entry points so that the
7118         container gets passed through.  It would have been nice to
7119         defer this until after 1.5, but it has a major effect on the
7120         user's module writing ABI, so it needs to be addressed now - at
7121         least in the areas that impact the ABI.  An interrelated change
7122         in the symtab API removes the dependency on a global symbol table,
7123         and instead focuses on a passed table (from the context
7124         container).
7126         * TODO: Reminders for finishing context functionality.
7127         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
7128         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
7129         global variables and eventually allow m4 to be reentrant.
7130         * m4/m4private.h (m4): Define the new structure here...
7131         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
7132         don't carry the overhead of a function call.
7133         * m4/m4module.h: Prototype extern functions from m4/m4.c.
7134         (m4): Declare type for new struct m4 objects.
7135         (M4SYMTAB): User macro to ease finding the symbol table for the
7136         current context for module developers.
7137         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
7138         verb.
7139         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
7140         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
7141         (m4_call_macro, m4_dump_symbols, m4_expand_input)
7142         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
7143         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
7144         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
7145         m4* context parameter. Changed definitions and all callers.
7146         (m4_symtab): Alias for m4_hash to decouple the
7147         m4_symtab api from m4_hash.
7148         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
7149         m4_hash.
7150         (m4_symtab_create): New function to return an initialised
7151         m4_symtab.
7152         (m4_symtab_delete): New function to delete an m4_symtab's memory.
7153         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
7154         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
7155         instead of simply using the global m4__symtab.  Changed
7156         definitions and all callers.
7157         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
7158         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
7159         * src/main.c (main): Create a context and use that instead of the
7160         former global m4__symtab.
7162 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
7164         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
7165         to the callback.  Callbacks should not need to hardcode the
7166         hashtable they are working from, nor should we have to waste the
7167         userdata parameter to pass the table in.
7168         * m4/hash.h (m4_hash_apply_func): Require the initial table
7169         parameter.
7170         * m4/symtab.c (symtab_destroy): Use the passed table instead
7171         of hardcoding m4__symtab.
7172         (m4_symbol_popdef): Don't use the userdata parameter to pass the
7173         table to arg_destroy.
7174         (arg_destroy): Use the hash parameter, ignore userdata.
7175         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
7176         prototype.
7177         (traceon, traceoff): Call set_trace with the extra initial
7178         parameter.
7180 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
7182         More refactoring to stabilise the module api, this time for
7183         symtab.c.  Additionally, start to pay attention to function names
7184         that don't contain a verb like they should.
7186         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
7187         wrapper for m4_hash_apply to decouple the symtab module from the
7188         hash module.
7189         (m4_symbol_builtin, m4_symbol_macro): Renamed to
7190         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
7191         callers.
7192         (m4_symbol_delete): Create a macro version to save a function
7193         call.
7194         (m4_token_t, m4_data_t): These violate the POSIX reserved
7195         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
7196         all callers.
7197         (m4_token_type): Renamed to m4_token_get_type.
7198         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
7199         (m4_symtab_exit): Removed from the exported module
7200         api...
7201         * m4/m4private.h (m4__symtab, m4__symtab_init)
7202         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
7203         renamed and added to the internal api. Changed all callers.
7204         (m4_symtab_apply): A faster macro version of the function for
7205         users of the internal api.
7206         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
7207         symbol_destroy and arg_destroy.
7208         (symtab_debug): Added a prototype.
7209         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
7210         so that callers in this file get the faster macro versions from
7211         m4/m4private.h.
7213 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
7215         Refactoring modules to rationalise the API into an external
7216         documented (eventually!) API for use by modules in the `m4_'
7217         namespace declared in m4/m4module.h, an internal API between the
7218         source files we ship (including our shipped modules) in the `m4__'
7219         namespace declared in m4/m4private.h and making the rest as
7220         cohesive as possible with liberal use of the `static' keyword.
7221         This change represents an audit to m4/module.c along these
7222         guidelines.
7224         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
7225         Removed.  No longer used.
7226         (m4_module_close): Removed prototypes.
7227         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
7228         from the exported module api...
7229         * m4/m4private.h (m4__module_init, m4__module_open)
7230         (m4__module_exit): ...and renamed and added to the internal api.
7231         Changed all callers.
7232         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
7233         Centralised definitions after renaming...
7234         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
7235         (M4_FINISH_SYMBOL): ...and removing from here.
7236         (m4_module_dlerror, m4_module_remove, m4_module_close)
7237         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
7238         module_remove, module_close and caller_id.
7239         (MODULE_SELF_NAME): New macro to make reporting self errors
7240         easier.
7241         (m4_module_load, module_close, module_remove): Use it.
7242         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
7243         name.
7244         * src/main.c (main): Use it.
7246 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
7248         * README: Remove references to --enable-changeword, which has been
7249         removed from the code.
7251 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
7253         Getting rid of the annoying bug with configure --enable-debug,
7254         which spewed -e: command not found errors.  This was an interaction
7255         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
7256         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
7257         branch-1-5) to get the full fix.
7259         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
7260         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
7261         and then use the probed value of $SED.
7262         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
7263         this, it messes up the AC_REQUIRE stack.
7265 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
7267         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
7268         the destroy callback.
7269         (m4_arg_destroy): Use the hash address to free the hash node key
7270         field.
7272 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
7274         First cut at formal parameters in macros.
7276         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
7277         * m4/xstrzdup.c: New file.
7278         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
7279         associative array of parameter names to details.
7280         (m4_symbol_token): Capture macro names with parameter lists.
7281         (m4_arg_signature_parse): And build an associative array to hang
7282         from the symbol structure to map names to details.
7283         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
7284         m4_hash_resize idiom.  Now that we potentially add a little hash
7285         table to many of the entries in the symbol table, added an extra
7286         arg to set the initial size.  Changed all callers.
7287         (m4_hash_apply): New function that is basically a generalised
7288         version of...
7289         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
7290         all callers to call m4_hash_apply instead.
7291         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
7292         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
7293         m4_arg_signature association that might be attached to the symbol,
7294         * m4/hash.h (m4_hash_apply_func): Replacement type for...
7295         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
7296         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
7297         parameter lists.
7298         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
7299         (M4_IS_IDENT): Detect characters that can be safely used in
7300         parameter names.
7301         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
7302         * m4/macro.c: Corrected grammar in some comments.  Use `token'
7303         rather than `td' for m4_token variables.
7304         (m4_process_macro): If we find a dollar followed by some
7305         M4_IS_IDENT characters, replace that with the contents of the argv
7306         entry with offset stored in the m4_token_arg associated with the
7307         collected identifier.
7309 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
7311         Begin preparations for supporting formal parameters in m4 macros.
7313         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
7314         the details of a formal parameter.
7315         (m4_token): Add an arg_signature member to hold a hash table for
7316         looking up formal parameters.
7317         * m4/input.c: Update more bitrotted comments.
7318         (m4_push_builtin): Initialise arg_signature member.
7319         (init_builtin_token): Copy arg_signature member.
7320         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
7321         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7322         replace...
7323         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7324         (m4_macro_pushdef, m4_macro_define): ...these, And...
7325         (m4_symbol_token): ...wrapped around this new function, which
7326         vastly simplifies the arguments required by the functions it
7327         replaces.
7328         Changed all callers.
7330 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
7332         * m4/macro.c: Format changes.
7334 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
7336         * m4/input.c: Updated various bitrotted comments.
7337         (m4_push_builtin): Just pass the whole m4_token, rather than
7338         extracting all the fields in the caller.  This also allows us to
7339         check the token type for consistency.
7340         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7341         Renamed to builtin_funcs, builtin_peek, builtin_read,
7342         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7343         the code.  Changed all callers.
7344         (struct input_block): Similarly renamed u_m member to u_b, and
7345         changed all callers.
7346         (m4_next_token): Use bzero to initialise the data fields.
7347         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7349 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
7351         These changes were necessary to get m4 to build on my iBook
7352         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7353         (GCC) 3.1 20020420 (prerelease)":
7355         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7356         inclusion of module loader headers.
7357         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7358         * m4/Makefile.am: Ditto.
7359         (libm4_la_LIBADD): Added $(LTLIBINTL).
7360         * m4/utility.c (program_name): Removed declaration in favour of
7361         the one already in error.c!
7362         * m4/m4module.h (program_name): Define to program_invocation_name
7363         when using GNU C library. Use an explicit extern declaration.
7364         (interactive, sync_output, debug_level, hash_table_size)
7365         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7366         (suppress_warnings, warning_status, nesting_limit, discard_comments)
7367         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7368         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7369         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7370         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7371         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7372         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7373         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7374         (m4_current_line, m4_current_diversion, m4_output_current_line):
7375         Don't rely on default, use an explicit extern.
7376         * m4/error.h (error, error_at_line, error_print_progname)
7377         (error_message_count, error_one_per_line): Ditto.
7378         * m4/ltdl.c: Update from CVS libtool.
7379         * m4/ltdl.h: Ditto.
7380         * commit: Update from CVS cvs-utils.
7382 2002-11-04  gettextize  <bug-gnu-gettext@gnu.org>
7384         * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7385         * po/boldquot.sed: New file, from gettext-0.11.5.
7386         * po/en@boldquot.header: New file, from gettext-0.11.5.
7387         * po/en@quot.header: New file, from gettext-0.11.5.
7388         * po/insert-header.sin: New file, from gettext-0.11.5.
7389         * po/quot.sed: New file, from gettext-0.11.5.
7390         * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7391         * po/Rules-quot: New file, from gettext-0.11.5.
7393 2002-11-04  Akim Demaille  <akim@epita.fr>
7395         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7396         running m4 itself.
7397         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7399 2002-11-04  Akim Demaille  <akim@epita.fr>
7401         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7403 2002-11-04  Akim Demaille  <akim@epita.fr>
7405         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7406         used as `external', and Libtool 1.4.3.
7407         (LINGUAS): Remove.
7408         (LTLIBOBJS): Don't play with it.
7409         * intl/: Remove.
7410         * Makefile.am (SUBDIRS): Remove intl.
7411         (ACLOCAL_AMFLAGS): Add -I config.
7412         (EXTRA_DIST): Add config/config.rpath.
7413         * po/LINGUAS: New.
7414         * po/Makevars: New.
7415         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7417 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
7419         Preparations for refactoring syntax tables to allow reverse
7420         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7421         speed of normal lookups in an array of unsigned short.
7423         * m4/input.c (single_quotes, single_comments, use_macro_escape):
7424         Moved from here...
7425         * m4/m4private.h (m4__single_quotes, m4__single_comments,
7426         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
7427         is for internal symbols which unavoidably pollute the global
7428         namespace, but are not published APIs.
7429         Adjusted all callers.
7430         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7431         m4_set_comment, m4_set_syntax, set_syntax_internal,
7432         unset_syntax_attribute): Moved from this file...
7433         * m4/syntax.c: New. ...to this file.
7434         Also added an m4_syntax_exit stub for orthogonality.
7435         * src/main.c (main): Use it.
7436         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7437         * m4/m4module.h: Reformatting.  New prototypes.
7439 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
7441         * bootstrap (aclocal_apiversion): The aclocal apiversion is
7442         distinct from the automake release number (in that the apiversion
7443         apparently has no micro-version-component).
7444         (aclocal_apilibdir): Use it.
7446 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
7448         * m4/hash.c (m4_hash_resize): New function.
7449         * m4/hash.h: Add prototype.
7450         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
7451         benchmarking to find a good value for, say, autoconf.  This is
7452         already a little quicker than before for me.
7454         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7455         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7456         and reenamed.
7457         * m4/hash.h: Adjust prototypes.
7459 2002-01-22  Akim Demaille  <akim@epita.fr>
7461         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7462         APIVERSION scheme.
7463         * tests/Makefile.am (package.m4): New.
7464         * tests/atlocal.in: Adjust to CVS Autotest.
7465         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7466         * configure.ac: LIBOBJ is a forbidden string.
7467         Simplify AM_INIT_AUTOMAKE invocation.
7468         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7469         options.m4.
7471 2002-01-21  gettextize  <bug-gnu-utils@gnu.org>
7473         * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7475 2001-10-19  Akim Demaille  <akim@epita.fr>
7477         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7479 2001-10-19  Akim Demaille  <akim@epita.fr>
7481         * m4/input.c (m4_next_token): Display where was opened what is
7482         not closed.
7484 2001-10-19  Akim Demaille  <akim@epita.fr>
7486         * m4/macro.c (expand_argument): Display where was opened what is
7487         not closed.
7489 2001-10-18  Akim Demaille  <akim@epita.fr>
7491         * m4/input.c, modules/m4.c: Formatting changes.
7493 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
7495         * bootstrap: s/configure.in/configure.ac/
7497 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
7499         * m4/symtab.c (m4_symbol_destroy): This function calls
7500         m4_symbol_popdef, which recycles a symbols memory when the last
7501         definition is popped.  Since we were passing the address of the
7502         symbol name found in the symbol table, and it was being removed
7503         partway through m4_symbol_destroy() we were referencing freed
7504         memory for the balance of the function.  Now we take a copy of the
7505         symbol name tring and use that as a key into the symbol
7506         table... that way if the original symbol name is freed, the copy
7507         is still valid.
7509 2001-10-13  Akim Demaille  <akim@epita.fr>
7511         * m4/ltdl.c: Update.
7513 2001-10-13  Akim Demaille  <akim@epita.fr>
7515         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7516         Don't gettextize internal error messages.
7518 2001-10-13  Akim Demaille  <akim@epita.fr>
7520         * tests/macros.at (Arity and defn): New failing test.
7521         (Arity, defn, and freeze): New.
7523         Fix `Arity and defn'.
7525         * m4/input.c (m4_push_macro): Don't forget the arity.
7526         * modules/m4.c (defn): Likewise.
7528 2001-10-13  Akim Demaille  <akim@epita.fr>
7530         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7531         to...
7532         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7533         (Propagation of traceon, Propagation of --trace): this new file.
7535 2001-10-13  Akim Demaille  <akim@epita.fr>
7537         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7538         interface instead of (name, argc...).
7539         Upon failure, specify which argument was guilty.
7540         Adjust callers.
7542 2001-10-13  Akim Demaille  <akim@epita.fr>
7544         * modules/evalparse.c: Save translators' time: don't translate
7545         internal error messages.
7546         (m4_evaluate): Simplify/normalize error messages.
7547         * doc/m4.texinfo (Eval): Adjust.
7549 2001-10-13  Akim Demaille  <akim@epita.fr>
7551         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7552         where no checking is needed.
7553         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7554         interface instead of (name, argc...).
7555         Adjust callers.
7556         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7557         elsewhere.
7559 2001-10-13  Akim Demaille  <akim@epita.fr>
7561         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7562         exclude the builtin name from the count.
7563         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7564         calling ifelse with a single argument is valid.
7565         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7566         with 1 and 2 args, mostly to strengthen the test suite.
7568 2001-10-13  Akim Demaille  <akim@epita.fr>
7570         * m4/output.c (m4_make_diversion, m4_insert_file)
7571         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7573 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
7575         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
7576         since we call these things builtins in the rest of the code!
7578         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7580 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
7582         Rather than forcing each builtin definition to manage its own
7583         argument range checking, tabulate the maxima and minima for all
7584         builtins in each module.  This forces us to consider what the
7585         valid ranges for each builtin should be, and moves the checking
7586         code out of each builtin implementation and into the builtin
7587         caller infrastructure.
7589         * m4/m4module.h (struct m4_builtin): Add argument minima and
7590         maxima.
7591         * m4/m4private.h (struct m4_token): Reflect them here too.
7592         * m4/input.c (struct input_block): ...and here.
7593         (m4_token_copy): New function for token copying.
7594         (init_macro_token): Copy them from a token to the input stack.
7595         (m4_next_token): Don't forget to initialise them for text
7596         macros.
7597         * m4/macro.c (expand_argument): Use m4_token_copy, and also
7598         check argument counts before calling the builtin handler.
7599         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
7600         (m4_symbol_macro): Likewise.
7601         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
7602         parameters.  Updated all callers.
7603         (m4_builtin_define): Ditto.
7604         (m4_macro_pushdef, m4_macro_define): Ditto.
7605         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
7606         * modules/evalparse.c:  Declare argument counts for defined
7607         builtins and remove explicit calls to m4_bad_argc().
7608         * modules/gnu.c: Ditto.
7609         * modules/load.c: Ditto.
7610         * modules/m4.c: Ditto.
7611         * modules/modtest.c: Ditto.
7612         * modules/mpeval.c: Ditto.
7613         * modules/perl.c: Ditto.
7614         * modules/shadow.c: Ditto.
7615         * modules/stdlib.c: Ditto.
7616         * modules/time.c: Ditto.
7617         * TODO: Updated.
7619 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
7621         The trace semantics now attach the trace bit to a symbol name.
7622         For as long as a traceon(`foo') is active, calls to foo will be
7623         traced regardless of intervening undefines or module unloads.
7624         Fixed the flag propogation issues differently to the fixes
7625         reverted with the last attempt at nailing down trace:
7627         * m4/m4private.h:  This file is not visible outside of the m4
7628         source tree, so I removed all the `M4_' and `m4_' prefixes to save
7629         on typing.  Updated all clients.
7630         (m4_token): New typedef contains the fields that need to be passed
7631         around with the low level tokeniser.
7632         (m4_token_data):  Removed.
7633         (m4_symbol): Now contains the traced flag again.
7634         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
7635         the trace bit set.  This change is contained entirely within this
7636         module and doesn't leak out into the callers.  Updated all
7637         clients.
7638         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
7639         new fields in m4_token.  Updated all clients.
7640         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
7641         that `groks_macro_args' and `blind_if_no_args' flags are retained
7642         when defn() results are passed around in m4 code.  Updated all
7643         callers.
7644         (m4_builtin_define): Ditto.
7645         (m4_macro_pushdef, m4_macro_define): Ditto.
7646         * m4/input.c (struct input_block): Add a flags field to facilitate
7647         the above.
7648         (m4_push_macro):  ...use it.
7649         (init_macro_token):  Retrieve it.
7650         (m4_next_token): Initialise it.
7651         * m4/macro.c (expand_argument):  Copy it.
7652         * m4/m4module.h: Adjust.
7653         * tests/builtins.at:  Adjust the expected output of the trace
7654         tests to reflect the change in semantics.
7655         * tests/modules.at (modules: trace):  Check that unloading a
7656         module which supplies a traced symbol definition doesn't lose te
7657         trace bit.
7659 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
7661         * modules/gnu.c (m4_macro_table): Display the timetamp when
7662         expanding __m4_version__.
7664         * configure.ac (--with-modules): Forgot a comma in the
7665         AC_HELP_STRING parameter list.
7667 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
7669         * bootstrap: Remove aclocal.m4t when it is no longer required.
7671 2001-10-05  Akim Demaille  <akim@epita.fr>
7673         * tests/Makefile.am: Adjust for gnuprog2.
7674         * tests/m4.in: There can be a leading path.
7675         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
7676         * tests/testsuite.at: Adjust to the most recent Autotest.
7677         (AT_CHECK_M4_FILTER): Fix and rename as...
7678         (AT_TEST_M4): this.
7679         * tests/others.at: Use it.
7681         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
7682         variable in shell scripts, one uses `$'...
7684 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
7686         * configure.ac: `rm -f $m4_getopt_h' was lost.
7688 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
7690         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
7691         time.  Define it for config.h in order to...
7692         * src/main.c (main): ...display the timestamp for --version.
7694 2001-10-04  Akim Demaille  <akim@epita.fr>
7696         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
7697         previous builtins `regexp' and `patsubst'.
7698         (regexp, patsubst): Use them.
7699         (eregexp, epatsubst): New builtins.
7700         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
7701         (Epatsubst and Patsubst, Eregexp and Regexp): these.
7702         (Extensions): More info on REs.
7704 2001-10-04  Akim Demaille  <akim@epita.fr>
7706         * modules/modtest.c (init_handler): Consistently output to stderr.
7707         (finish_handler): New.
7708         (test): The `if' is an `assert'.
7709         * tests/modules.at: Adjust.
7711 2001-10-04  Akim Demaille  <akim@epita.fr>
7713         * m4/utility.c (m4_bad_argc): Detail the mismatches.
7715 2001-10-01  Akim Demaille  <akim@epita.fr>
7717         * tests/generate.awk: Tag the tests with `documentation'.
7718         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
7719         Use the make the existing modtest tests more uniform, and complete
7720         the set of possibilities.
7722 2001-10-01  Akim Demaille  <akim@epita.fr>
7724         * config/gmp.m4: Consult the user before using GMP: use
7725         --without-gmp.
7726         * configure.ac: Adjust.
7727         * modules/gmp.c: No protection needed as the module is not built
7728         if GMP is not used.
7730 2001-10-01  Akim Demaille  <akim@epita.fr>
7732         * tests/generate.awk: Remove debugging code.
7733         (fatal): Specify the current location.
7735         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
7736         * modules/gnu.c, modules/m4.c: Use M4ARG.
7738 2001-10-01  Akim Demaille  <akim@epita.fr>
7740         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
7741         (m4_regexp_compile): New.
7742         (regexp, patsubst): Use it.
7744 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7746         Reinstate the memory handling improvements from the patch I just
7747         reverted.  Relevant ChangeLog entries repeated here:
7749         * m4/module.c (m4_module_remove): New function that holds the core
7750         of the old m4_module_unload.
7751         (m4_module_unload): Use it.
7752         (m4_module_unload_all): When we know the modules will never be
7753         used again (i.e. on exit), free up as much module memory as
7754         possible.  There are still some artifacts from resident modules
7755         living inside ltdl.c, but everything else is freed.
7756         * m4/debug.c (m4_debug_exit): Free memory allocated in
7757         m4_debug_init().
7758         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7759         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7760         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7761         * m4/m4module.h: Updated prototypes.
7762         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7763         * m4/hash.h: Updated prototypes.
7764         * src/main.c (main): Use all these new functions to clean up as
7765         much memory as possible before exit.
7767 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7769         Reverted my large patch for removing the old m4_symbol
7770         structure on 2001-09-20.  We are still not happy about the way
7771         trace works in conjunction with defn and undefine, and leaving
7772         the reverted patch active prevents us from moving the traced
7773         bit from the definition back to the symbol.
7775 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
7777         * configure.in: Moved to...
7778         * configure.ac: ...here.  Added a libtool like timestamped
7779         banner, and tidied up the libltdl cruft.
7780         * config/mkstamp: Script to extract a timestamp from ChangeLog.
7781         * modules/Makefile.am (INCLTDL):  Removed.  This is required
7782         only when libltdl is configured in a subdirectory.
7783         * src/Makefile.am: Ditto.
7784         (LIBADD_DL):  No need to add this again, libtool already knows
7785         that libm4.la depends on it.
7786         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
7787         them.
7789         * TODO: stackovf.c is basically broken.
7790         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
7792 2001-09-28  Akim Demaille  <akim@epita.fr>
7794         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
7796 2001-09-27  Akim Demaille  <akim@epita.fr>
7798         * tests/m4.in: Don't use short options.
7799         Simplify the stderr signature normalization.
7801 2001-09-27  Akim Demaille  <akim@epita.fr>
7803         tests/m4 shall be position independent.
7805         * tests/m4.in: New.
7806         * tests/m4: Remove.
7807         * tests/testsuite.at: No args to AT_INIT.
7808         * configure.in, tests/Makefile.am: Adjust.
7810 2001-09-22  Akim Demaille  <akim@epita.fr>
7812         Autotest has changed again.
7814         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
7815         (package.m4): Remove.
7816         * configure.in: Adjust to LIBADD_GMP.
7818 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
7820         * config/gmp.m4 (AC_ARG_WITH): Removed.
7821         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
7822         (AC_LIB_GMP): When performing a test compile against libgmp,
7823         include the header gmp.h if possible, and link against -lgmp.  If
7824         they both work define USE_GMP.
7825         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
7826         (mpeval_LTX_init_func): Complain on load that there was no libgmp
7827         at compile time.
7829 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
7831         * m4/evalparse.c: Moved to...
7832         * modules/evalparse.c:  ...here.  This code is shared between
7833         modules/mpeval.c and modules/m4.c, so there is no need to pollute
7834         the libm4 API with its details.  Moderately rewritten to interface
7835         into its clients more simply.
7836         * m4/eval.c: Deleted.  Migrated functionality to...
7837         * modules/m4.c: ...here.
7838         (builtin_eval):  Implemented in terms of the new interface style.
7839         * modules/mpeval.c (builtin_mpeval): Ditto.
7840         * m4/m4module.h: Removed references to the former m4/eval.c.
7841         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
7842         (EXTRA_libm4_la_SOURCES): Deleted.
7843         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
7844         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
7846 2001-09-20  Akim Demaille  <akim@epita.fr>
7848         * config/gmp.m4 (AM_WITH_GMP): Rename as...
7849         (AC_LIB_GMP): this.
7850         By default, use gmp.
7851         Massive revamping.
7852         * configure.in: Adjust.
7853         Use Automake conditionals for USE_GMP.
7854         Always compute sizeof (long long int).
7855         This was a bug BTW, as `eval' (not `mpeval') depends on it:
7856         before, it was used _only_ if mpeval was not activated.
7857         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
7858         (mpeval_la_LIBADD): New macros.
7859         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
7860         Indent.
7861         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
7862         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
7863         WITH_GMP.
7865 2001-09-20  Akim Demaille  <akim@epita.fr>
7867         * tests/Makefile.am (package.m4): New.
7868         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
7870 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
7872         More cleanup.  After the last patch, m4_symbol holds nothing but
7873         the head of a chain of m4_token_data.  So I have removed the old
7874         m4_symbol, so that m4_token_data chains are stored directly in the
7875         value cell of a hash table node.  But there's more... m4_symbol
7876         was a more natural name for the symbol value cell, and now that it
7877         is gone I have renamed the former m4_token_data structure to
7878         m4_symbol.  This change turned out to be a pig to get right, since
7879         the original code didn't need to modify the value cell itself,
7880         since changing the chain happened inside the m4_symbol that used
7881         to be returned -- I had to pass the address of the value cell
7882         across various function calls, incase the head value changed.  I
7883         also tightened up the memory management to help me find a nasty
7884         memory corruption bug that took me all night to track down...
7886         * m4/m4private.h (struct m4_symbol): Removed.
7887         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
7888         all references.
7889         * m4/hash.c (m4_hash_iterator_value): Return the address of the
7890         value cell.  Updated all callers.
7891         * m4/symtab.c: Took advantage of the simplification in the data
7892         structures to rewrite a lot of this file more simply.  There is
7893         still some room for optimisation here, but we should tackle that
7894         systematically closer to the release.
7896         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7897         revealed.  This version is ahead of CVS libtool until I get chance
7898         to flush my changes.
7899         * m4/module.c (m4_module_remove): New function that holds the core
7900         of the old m4_module_unload.
7901         (m4_module_unload): Use it.
7902         (m4_module_unload_all): When we know the modules will never be
7903         used again (i.e. on exit), free up as much module memory as
7904         possible.  There are still some artifacts from resident modules
7905         living inside ltdl.c, but everything else is freed.
7906         * m4/debug.c (m4_debug_exit): Free memory allocated in
7907         m4_debug_init().
7908         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7909         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7910         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7911         * m4/m4module.h: Updated prototypes.
7912         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7913         * m4/hash.h: Updated prototypes.
7914         * src/main.c (main): Use all these new functions to clean up as
7915         much memory as possible before exit.
7917 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
7919         The `traced' flag needs to be attached to the definition of a
7920         symbol rather than the current symbol containing the definition.
7921         Implementing this showed up some long standing post 1.4 bugs in
7922         flag propogation which I also fixed.
7924         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
7925         (struct m4_token_data): And add it back in here.
7926         * m4/input.c (init_macro_token): Propogate the traced flag
7927         correctly.
7928         * m4/macro.c (expand_argument): Ditto.
7929         * tests/builtins.at (trace2, trace3): New tests based on Akim's
7930         sadistic email ;-)
7932 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7934         * m4/m4private.h (struct m4_token_data): Simplified by removing
7935         the redundant `traced' flag, and one level of structure nesting.
7936         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
7937         * m4/input.c (init_macro_token): No need to initialise removed
7938         `traced' field.
7939         * m4/macro.c (expand_argument): No need to copy it either.
7940         * m4/utility.c (m4_token_data_func_traced): Or provide an access
7941         function.
7943         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
7944         dependant on multiple symbols with the same key, so preserving
7945         relative symbol order in each bucket during resizing is no longer
7946         required.  The resize function is considerably faster as a result.
7948         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
7949         s/m4_symbol_insert/m4_symbol_define/g;
7950         s/m4_builtin_insert/m4_builtin_define/g;
7951         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
7953 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7955         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
7956         commits, the m4_lookup_symbol dispatch function is split into
7957         specialised functions that must be called directly.
7959         * m4/m4module.h (m4_symbol_lookup_t): Removed.
7960         * m4/symtab.c (m4_lookup_symbol): Removed.
7961         (m4_symbol_builtin, m4_symbol_macro): New functions.
7962         * m4/builtin.c (m4_builtin_define): Split into...
7963         (m4_builtin_pushdef, m4_builtin_insert): ...these.
7964         (m4_macro_define): Split into...
7965         (m4_macro_pushdef, m4_macro_insert): ...these.
7966         * src/main.c (main): Set command line macros from `-D' parameters
7967         using `m4_macro_define'.
7969 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
7971         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
7972         this from m4_remove_table_reference_symbols().
7973         * m4/m4module.h, m4/module.c: Updated all references.
7975 2001-09-07  Akim Demaille  <akim@epita.fr>
7977         * modules/stdlib.c, modules/times.c: Misc cleanups.
7979 2001-09-07  Akim Demaille  <akim@epita.fr>
7981         * configure.in: We now need Autoconf 2.52e.
7982         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
7983         and `M4_SYMBOL_DELETE'.
7984         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
7985         * src/main.c (main): Adjust.
7987 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
7989         Fix the obstack.h problem once and for all!  At configure time we
7990         can test for a system supplied obstack.h:  depending on the
7991         result, we now generate system.h with an #include of the correct
7992         header.  As a bonus, I've also added a --with-included-obstack,
7993         incase the user doesn't like the system obstack for some
7994         reason... and also we can test the shipped obstack on a system
7995         that has oe of its own.  We also now need to be careful to add
7996         build directories to the include search path, since the generated
7997         system.h will be in the build tree.
7999         * configure.in (AC_CONFIG_FILES): Generate system.h from
8000         system-h.in.
8001         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
8002         include the system obstack header or the copy shipped with M4.
8003         Allow the user to override configure and force the build to use
8004         the shipped version.
8005         * m4/system-h.in: New file, template for...
8006         * m4/system.h: ...this.  Now deleted.
8007         * m4/m4module.h: Include system.h before everything else.
8008         * src/freeze.c: Ditto.
8009         * m4/Makefile.am (dist-hook): Remove generated system.h.
8010         (INCLUDES): Check builddir for generated headers before checking
8011         srcdir.
8012         * modules/Makefile.am (INCLUDES): Ditto.
8013         * src/Makefile.am (INCLUDES): Ditto.
8015 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
8017         * TODO: Remove the items that have been addressed already.
8019 2001-09-05  Akim Demaille  <akim@epita.fr>
8021         * src/main.c (main): Standardize --version.
8023 2001-09-05  Akim Demaille  <akim@epita.fr>
8025         * modules/format.c (format): Have a bigger `str'.
8027 2001-09-05  Akim Demaille  <akim@epita.fr>
8029         Rationalize warnings, reporting the macro name as if it were a
8030         program name, and assertions.
8032         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
8033         (M4WARN): New.
8034         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
8035         (m4_symbol_delete):
8036         Use assert for internal errors.
8037         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
8038         M4WARN.
8039         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
8040         M4WARN and assert.
8041         * tests/builtins.at (pushpop): Adjust.
8043 2001-09-05  Akim Demaille  <akim@epita.fr>
8045         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
8046         with pointers.
8048 2001-09-05  Akim Demaille  <akim@epita.fr>
8050         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
8051         * m4/macro.c, m4/symtab.c: Adjust.
8053 2001-09-05  Akim Demaille  <akim@epita.fr>
8055         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
8056         (m4_symbol_pop, m4_symbol_del): this.
8057         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
8058         (m4_symbol_popdef, m4_symbol_delete): New.
8059         (m4_lookup_symbol): Adjust.
8060         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
8062 2001-09-05  Akim Demaille  <akim@epita.fr>
8064         * m4/m4module.h (m4_symbol_lookup): Rename as...
8065         (m4_symbol_lookup_t): this.
8067 2001-09-05  Akim Demaille  <akim@epita.fr>
8069         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
8070         unused.
8071         * m4/symtab.c (m4_lookup_symbol): Adjust.
8073 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
8075         Bootstrap will now work with Libtool 1.4.1 or higher:
8076         * bootstrap: Remove stale autom4te.cache files when
8077         rebootstrapping.
8078         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
8079         libtool.m4.
8080         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
8081         libtool.m4 directly.
8082         Run libtoolize to refresh ltmain.sh.
8083         * config/ltmain.sh:  Deleted.
8084         * acinclude.m4: Deleted.
8085         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
8087         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
8088         implementation for the cvs impaired libtool user.
8090 2001-09-03  Akim Demaille  <akim@epita.fr>
8092         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
8093         internal errors.
8094         Avoid using `default' in switch, as it hides useful compiler
8095         warnings when a case is forgotten.
8097 2001-09-03  Akim Demaille  <akim@epita.fr>
8099         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
8100         is no such thing as `WITH_MODULES'.
8102 2001-09-03  Akim Demaille  <akim@epita.fr>
8104         Improve the test suite's selfcontainedness.
8106         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
8107         (Include, Undivert): Tag the other input files.
8108         * tests/generate.awk: Catch `@comment file:'.
8109         `-I $src' is no longer needed.
8110         `next' is really like `return': the rest is skipped.
8111         Adjust to `input.m4'.
8112         (fatal): New function.
8113         * tests/foo, tests/incl.m4: Remove.
8115 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
8117         The shadowing mechanism and, infact, the whole symbol table
8118         implementation was creaking under the weight of the features piled
8119         on top of it.  We now have a separate hash table module which will
8120         dynamically resize to keep symbol density withing good performace
8121         limits, and a new symtab module layered above it.  Symbol lookups
8122         are now marginally more efficient (since the shadowed flag is no
8123         longer required) and symbol removal, such as on module unload, is
8124         considerably faster due to a reorganisation of the data structures
8125         used in symtab.c.
8127         * src/main.c (main):  Don't mention `-H'.
8128         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
8129         effect.
8130         * NEWS: Updated.
8131         * m4/hash.c: New generalised dynamic hash table data structure
8132         management module.
8133         * m4/hash.h: Public interface.
8134         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
8135         (libm4_la_SOURCES): Add hash.c.
8136         * m4/symtab.c: More or less rewritten from scratch, within the
8137         bounds of the previous API.
8138         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
8139         call.  Updated all callers.
8140         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
8141         declarations to reflect API changes.
8142         (M4INIT): Generate a declaration too, to avoid the warning with
8143         --enable-debug builds.
8144         (M4FINISH): Ditto.
8145         (HASHMAX): Removed.
8146         * m4/utility.c (hash_table_size):  Removed.
8147         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
8148         names, which are then looked up by builtin_dumpdef() as necessary.
8149         This implies a small speedup in builtin_symbols(), which discarded
8150         all of the symbol info under the old call.
8151         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
8152         shadowing is implicit in respect to the new data structures.
8153         symbol names are no longer duplicated here, they are stored in the
8154         key field of the hash table.
8155         Moved macro_args and blind_no_args...
8156         (m4_token_data): ...to here.
8157         m4/macro.c (expand_macro):  Added a name argument since the symbol
8158         name is no longer copied into each struct m4_symbol.  Modified all
8159         callers.
8160         (collect_arguments):  Ditto.
8161         * modules/m4.c (set_trace): Ditto.
8162         * modules/gnu.c (builtin_symbols): Updated.
8163         * src/freeze.c (produce_symbol_dump): Much improved in light of
8164         the improved symbol table layout.
8166 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
8168         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
8169         to M4_SYMBOL_NEXT.
8170         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
8171         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
8172         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
8173         SYMBOL_HANDLE): Ditto.
8174         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
8175         modules/gnu.c, modules/m4.c, src/freeze.c,
8176         src/main.c:  Updated all references.
8178         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
8179         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
8180         already listed in m4_LDADD... how did that ever used to work?
8181         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
8182         link.
8183         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
8184         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
8186         * tests/m4: Don't call the m4 wrapper script with libtool, it
8187         works fine all by itself.
8189 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
8191         The experimental `changeword' feature never took off, and has
8192         no obvious advantages over `changesyntax' to compensate the
8193         enormous speed penalty it carries:
8194         * configure.in (ENABLE_CHANGEWORD): Removed.
8195         * m4/m4module.h (m4_set_word_regexp): Removed.
8196         * m4/m4private.h (m4_token_data): Removed original_text field.
8197         * m4/utility.c (m4_token_data_orig_text): Removed.
8198         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
8199         * m4/macro.c: Ditto.
8200         * src/main.c: Ditto.
8201         * modules/Makefile.am (changeword.la): Removed.
8202         * modules/changeword.c: File removed.
8203         * doc/m4.texinfo: References to changeword and --word-regexp
8204         removed.
8205         * po/POTFILES.in: modules/changeword.c removed.
8206         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
8207         * tests/builtins.at (changeword): Test removed.
8209 2001-08-30  Akim Demaille  <akim@epita.fr>
8211         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
8212         This also help having a single list of m4 files: in
8213         config/Makefile.am.
8214         * config/Makefile.am (STANDARD_MACROS): Rename as...
8215         (ACLOCAL_MACROS): this.
8216         (list-standard-macros): Remove.
8217         (spy): New.
8219 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
8221         In an attempt to moderate my egomania...
8222         * tests/modules.at: Remove attributions.
8224         * tests/generate.awk: When making substitutions to "@&t@", either
8225         "&" or "\&" in the substitution string argument to gsub refer back
8226         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
8227         67 now pass for me.
8229 2001-08-29  Akim Demaille  <akim@epita.fr>
8231         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
8232         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
8233         (sync-lines, trace, translit, undivert, wrap): Move to...
8234         * tests/builtins.at: this new file.
8235         * tests/others.at (Discard comments, import-environment): Move to...
8236         * tests/options.at: this new file.
8238 2001-08-29  Akim Demaille  <akim@epita.fr>
8240         * tests/others.at (Freezing modules)
8241         (--module-directory: absolute path, modpath2, modpath3)
8242         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
8243         * tests/modules.at: here, new file.
8244         * tests/others.at, tests/generate.awk: Add a banner.
8245         * tests/testsuite.at: Adjust.
8246         (AT_CHECK_M4_FILTER): New, but unused.
8248 2001-08-29  Akim Demaille  <akim@epita.fr>
8250         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
8251         handle that.
8252         * tests/others.at (wrap): Inline wrap.m4.
8253         (shadow): Inline shadow.m4.
8254         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
8255         * tests/m4: Simplify.
8257 2001-08-29  Akim Demaille  <akim@epita.fr>
8259         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
8260         --language.
8262 2001-08-29  Akim Demaille  <akim@epita.fr>
8264         * tests/generate.awk (normalize): s/@__@/@&t@/.
8266 2001-08-28  Akim Demaille  <akim@epita.fr>
8268         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
8270 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
8272         * bootstrap (generate.awk): Generate test cases with new script.
8274 2001-08-27  Akim Demaille  <akim@epita.fr>
8276         * tests/Makefile.am (installcheck-local): Don't use
8277         `dc_install_base' which is not visible here, but `exec_prefix'
8278         which is clearly the RT anyway.
8279         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
8280         related to testing a now installed m4.
8281         * tests/m4: Do it here.
8283 2001-08-27  Akim Demaille  <akim@epita.fr>
8285         * tests/others.at (indir): Formatting change.
8287 2001-08-27  Akim Demaille  <akim@epita.fr>
8289         * tests/Makefile.am (installcheck-local): New.
8290         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
8291         the test suite.
8292         Prefer options over envvars.
8293         * src/main.c (main): First bug caught by the test suite (yeah!):
8294         --batch lacked a `break' which resulted in an accidental
8295         invocation of --discard-comments.
8297 2001-08-27  Akim Demaille  <akim@epita.fr>
8299         * tests/others.at (capitalize, changeword, comments, ddivert)
8300         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
8301         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
8302         (sysv-args, trace, translit, undivert): Don't rely on files in
8303         examples/: AT_DATA them.
8305 2001-08-27  Akim Demaille  <akim@epita.fr>
8307         Let the test suite use a wrapper around the not installed m4 to
8308         pretend it is (installed).
8310         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
8311         such a way that m4 does not process them.
8312         * configure.in: The package name seems to be `m4', not `M4'.
8313         * tests/m4: New.
8314         * tests/atlocal.in (at_package, M4): Remove.
8315         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
8317 2001-08-27  Akim Demaille  <akim@epita.fr>
8319         * tests/Makefile.am (CLEANFILES): Remove.
8320         (DISTCLEANFILES, clean-local): New.
8321         * examples/mktests.sh: Remove.
8323 2001-08-27  Akim Demaille  <akim@epita.fr>
8325         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8326         Don't use aclocal: it's written by hand.
8327         * aclocal.m4: m4_include all the files instead of being built by
8328         aclocal.
8329         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8330         until it reads the traces by itself.
8331         * configure.in: Require Autoconf 2.42c as we are now using
8332         AC_CONFIG_TESTDIR instead of AT_CONFIG.
8333         Catch unexpanded `jm_' macros.
8334         * config/atconfig.m4: Remove.
8335         * config/error.m4: new.
8336         * config/Makefile.am: Ship the files included by aclocal.m4.
8337         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8338         (TESTSUITE_AT): this, to please Automake.
8339         (TESTSUITE): This target uses autotest/autotest.m4, not
8340         autotest/general.m4.
8341         * tests/testsuite.at: Prereq Autotest 2.52c.
8342         * examples/Makefile.am (pkgdata_DATA): Rename as...
8343         (dist_pkgdata_DATA): this.
8344         * doc/Makefile.am (man_MANS): Rename as...
8345         (dist_man_mans): this.
8347 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
8349         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
8350         Robert Collins, building on Cygwin no longer requires Windows
8351         import and export symbol decorations.
8352         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
8353         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8354         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8355         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8356         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8357         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8358         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8359         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8360         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
8361         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
8362         anymore.
8363         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8364         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8366 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
8368         Ansify the source.  Previously we had a mix, where my code was
8369         in a K&R compatible style, and the preexisting code was in ANSI
8370         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
8371         and now the code base is much cleaner.
8373         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
8374         VOID macro and all users.
8375         * m4/m4module.h:  Ansify function prototypes and headers.
8376         * m4/builtin.c:  Ditto.
8377         * m4/evalparse.c:  Ditto.
8378         * m4/input.c:  Ditto.
8379         * m4/macro.c:  Ditto.
8380         * m4/module.c:  Ditto.
8381         * m4/output.c:  Ditto.
8382         * m4/path.c:  Ditto.
8383         * m4/symtab.c:  Ditto.
8384         * m4/utility.c:  Ditto.
8385         * modules/format.c:  Ditto.
8386         * modules/gnu.c:  Ditto.
8387         * modules/m4.c:  Ditto.
8388         * modules/mpeval.c:  Ditto.
8389         * src/freeze.c:  Ditto.
8390         * src/m4.h:  Ditto.
8391         * src/main.c:  Ditto.
8393 2001-08-20  Akim Demaille  <akim@epita.fr>
8395         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8396         generated with stock 2.52.
8398 2001-08-20  Akim Demaille  <akim@epita.fr>
8400         * config/atconfig.m4: New, until part of Autoconf per se.
8401         * configure.in (AT_CONFIG): Use it.
8402         Adjust.
8403         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8404         * tests/atlocal.in: New.
8405         * tests/generate.awk: For the time being, the empty quadrigraph is
8406         `@__@'.
8407         * tests/others.at (changeword, gmp): Check the configuration
8408         variable against `yes'.
8409         * tests/testsuite.at (dnl): Allow it, as it's used all over the
8410         place.
8412 2001-08-20  Akim Demaille  <akim@epita.fr>
8414         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8415         * modules/m4.c (undivert): Disable the possibility of undiverting
8416         several files at once: it is not documented, it is inconsistent
8417         with the other macros, it can be straightforwardly mocked by
8418         several invocations, and most importantly, it prevents the
8419         possibility of other kinds of extension.
8420         Use `m4_numeric_arg'.
8422 2001-08-20  Akim Demaille  <akim@epita.fr>
8424         * examples/include.m4: Typo.
8425         * tests/generate.awk: Really add it.
8426         * tests/Makefile.am: Adjust.
8427         * tests/others.at (Discard comments): It sure fails without `-c'.
8428         (include, undivert): Add -I examples/.
8430 2001-08-20  Akim Demaille  <akim@epita.fr>
8432         Use sprintf, not ecft and friends since it is standard, portable,
8433         simplifies the code, and since the latter is even deprecated
8434         according to the GNU libc documentation.
8436         * modules/format.c: Drop evct support.
8438 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
8440         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
8441         for `-pipe' here...
8442         * configure.in: ...do it here instead.
8444         * c-boxes.el: Deleted.
8445         * m4/builtin.c: Reformat box comments to be closer to GNU
8446         standards.
8447         * m4/debug.c:  Ditto.
8448         * m4/eval.c:  Ditto.
8449         * m4/evalparse.c:  Ditto.
8450         * m4/input.c:  Ditto.
8451         * m4/m4module.h:  Ditto.
8452         * m4/macro.c:  Ditto.
8453         * m4/output.c:  Ditto.
8454         * m4/symtab.c:  Ditto.
8455         * m4/utility.c:  Ditto.
8456         * modules/changeword.c:  Ditto.
8457         * modules/format.c:  Ditto.
8458         * modules/gnu.c:  Ditto.
8459         * modules/load.c:  Ditto.
8460         * modules/m4.c:  Ditto.
8461         * modules/modtest.c:  Ditto.
8462         * modules/mpeval.c:  Ditto.
8463         * modules/perl.c:  Ditto.
8464         * modules/shadow.c:  Ditto.
8465         * modules/stdlib.c:  Ditto.
8466         * modules/time.c:  Ditto.
8467         * src/freeze.c:  Ditto.
8468         * src/main.c:  Ditto.
8470 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
8472         * m4/module.c: Fixup some errors in the description comment.
8474 2001-08-17  Akim Demaille  <akim@epita.fr>
8476         * tests/others.at (iso8859): Specify the path to the M4 test file.
8477         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8478         files in error messages.
8480 2001-08-17  Akim Demaille  <akim@epita.fr>
8482         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8483         * tests/others.at: Adjust input files paths.
8484         * tests/atconfig.in: Set top_builddir.
8485         * tests/Makefile.am: Adjust.
8486         `testsuite' is in src, not build.
8488 2001-08-17  Akim Demaille  <akim@epita.fr>
8490         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8491         (generate.at): Install a temporary hack until the actual
8492         generate.awk is added to the repository.
8493         * tests/atconfig.in: New.
8495 2001-08-17  Akim Demaille  <akim@epita.fr>
8497         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8499 2001-08-17  Akim Demaille  <akim@epita.fr>
8501         * doc/m4.texinfo: Promote proper quotation.
8503 2001-08-17  Akim Demaille  <akim@epita.fr>
8505         Remove the non Autotest tests.
8507         * tests/other-tests/capitalize.test,
8508         * tests/other-tests/changeword.test,
8509         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8510         * tests/other-tests/debug.test,
8511         * tests/other-tests/discard-comments.m4,
8512         * tests/other-tests/discard-comments.test,
8513         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8514         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8515         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8516         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8517         * tests/other-tests/hanoi.test,
8518         * tests/other-tests/import-environment.m4,
8519         * tests/other-tests/import-environment.test,
8520         * tests/other-tests/include.test, tests/other-tests/indir.test,
8521         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8522         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8523         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8524         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8525         * tests/other-tests/modtest.test,
8526         * tests/other-tests/multiquotes.test,
8527         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8528         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8529         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8530         * tests/other-tests/sync-lines.m4,
8531         * tests/other-tests/sync-lines.test,
8532         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8533         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8534         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8535         * tests/other-tests/wrap.test: Remove.
8537         * tests/run-test, tests/get-them: Remove.
8538         * tests/Makefile.am: Adjust.
8540 2001-08-17  Akim Demaille  <akim@epita.fr>
8542         others.at no longer depends on other-tests/.
8544         * tests/others.at (stackovf): You're actually...
8545         (sync-lines): this.
8546         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8547         (unload.test): Keep their authorship.
8548         (discard-comments, gmp, import-environment, modfreeze)
8549         (sync-lines): Embed the input files.
8550         * tests/stackovf.test: Copy from other-tests/stackovf.test.
8551         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8553 2001-08-17  Akim Demaille  <akim@epita.fr>
8555         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8556         (M4exit): Tag the exit status of the example.
8557         * tests/get-them: Adjust.
8558         * tests/generate.awk: New, based on get-them.
8559         * tests/Makefile.am: Adjust to generate `generated.at'.
8560         * tests/testsuite.at: Adjust.
8561         (AT_CHECK_M4): Don't overquote.  Blush...
8563 2001-08-17  Akim Demaille  <akim@epita.fr>
8565         Start using Autotest.  atconfig creation is still lacking.
8567         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8568         * examples/reverse.m4, tests/other-tests/import-environment.m4,
8569         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8570         * tests/other-tests/import-environment.test: Don't check LANGUAGE
8571         as it might be `unset', or set to `C'.
8572         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
8573         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8574         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8575         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
8576         * tests/other-tests/shadow.test: Adjust.
8577         * tests/testsuite.at, tests/others.at: New.
8578         * tests/Makefile.am: Adjust.
8580 2001-08-17  Akim Demaille  <akim@epita.fr>
8582         Drop Autoconf 2.13 compatibility.
8584         * configure.in (changeword): No need to undefine it, as anyway if
8585         it's defined, M4sugar moved it as m4_changeword.
8586         And anyway, proper quotation is enough.
8587         (m4_pattern_allow): As it exists in 2.50, just use it.
8588         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
8589         Don't handle Gettext's duties, let it handle them.
8590         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
8592 2001-08-17  Akim Demaille  <akim@epita.fr>
8594         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
8595         (m4_errprint): Use fputs.
8596         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
8597         dumpdef are not concerned.
8598         (Dumpdef, Errprint): Emphasize their insensitivity to
8599         --error-output.
8600         * doc/Makefile.am: Add `TAGS' support.
8601         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
8602         in `config/' now.
8603         * config/Makefile.am (MAINTAINERCLEANFILES): New.
8605 2001-08-17  Akim Demaille  <akim@epita.fr>
8607         * modules/Makefile.am (ETAGS_ARGS): New.
8609 2001-08-17  Akim Demaille  <akim@epita.fr>
8611         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
8612         changes.
8614 2001-08-17  Akim Demaille  <akim@epita.fr>
8616         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
8618 2001-08-17  Akim Demaille  <akim@epita.fr>
8620         * m4/m4module.h (m4/list.h): Don't include it.
8622 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
8624         m4_modules are no more, we use lt_dlhandles directly and let
8625         latest libltdl features manage the list of loaded modules.
8626         * acinclude.m4: Regenerated.
8627         * m4/ltdl.c: Updated from master copy.
8628         * m4/module.c: Reimplemented to take advantage of advances in
8629         libltdl.
8630         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
8631         list with lt_dlhandle_next.
8632         (m4_builtin_find_by_func): Ditto.
8633         (m4_builtin_table_install): Use lt_dlhandle.
8634         (m4_macro_define): Ditto.
8635         (m4_macro_table_install): Ditto.
8636         m4/module.h: Prototype new module management API.
8637         (m4_modules): No longer required.
8638         (m4_module_init_t, m4_module_finish_t): POSIX namespace
8639         violations, renamed to...
8640         (m4_module_init_func, m4_module_finish_func): ...these,
8641         respectively.
8642         (M4INIT_HANDLER): Clean way to declare init functions in modules.
8643         (M4FINISH_HANDLER):  And similarly for finish functions.
8644         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
8645         -- Add indirection to the CONC macro so that arguments are
8646         correctly expanded.
8647         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
8648         * modules/shadow.c (m4_init_module):  Ditto.
8649         Due to new init function semantics, be careful to perform the
8650         initialisation only on first load.
8651         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
8652         (m4_finish_module): Replaced with M4FINISH_HANDLER.
8653         Due to new finish function semantics, be careful to perform the
8654         finalisation only on first load.
8655         * m4/m4private.h (m4_module): Removed in favour of...
8656         (m4_module_data): ...structure without all the wrapper fields.
8657         Instances of this new structure are stored associated lt_dlhandles
8658         with lt_dlcaller_data_set().
8659         * m4/builtin.c (m4_builtin_define): Takes a handle argument
8660         instead of the old module argument.
8661         (m4_builtin_table_install): Ditto.
8662         * modules/load.c (m4_resident_module):  Removed.  This is no
8663         longer implemented as a magic symbol...
8664         * modules/m4.c (m4_resident_module): Ditto.
8665         * modules/load.c (M4INIT_HANDLER): ...the module init function now
8666         uses the ltdl api to make the module resident.
8667         * modules/m4.c (M4INIT_HANDLER): Ditto.
8668         * modules/load.c (builtin_modules): Traverse the loaded module
8669         list with lt_dlhandle_next.
8670         (builtin_load): Much simplified in light of the reimplemented
8671         module loader.
8672         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
8673         light of the m4/module.c rewrite.
8674         (produce_symbol_dump): Ditto.
8675         (reload_frozen_state): Ditto.
8676         * m4/list.c, m4/list.h: Files deleted.  No longer required.
8677         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
8678         (libm4_la_SOURCES): Delete list.c reference.
8679         * m4/m4private.h (m4_token_data):  Add a handle field.  This
8680         eliminates many of the searches to find the handle associated with
8681         various tokens that are passed between functions.
8682         (struct m4_symbol):  Removed the module field.  The
8683         module association does not belong with the symbol...
8684         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
8685         that the module implementation code is from.  Added a handle
8686         field.
8687         (m4_push_macro): Add a `handle' argument.  Changed all callers.
8688         (init_macro_token):  Set the `handle' field for the
8689         m4_token_data.
8690         * m4/macro.c (expand_argument): Copy the new handle field during
8691         reassignment.
8692         * modules/m4.c (macro_install): Use the new handle field to
8693         optimise the search for the correct builtin structure, and pass
8694         the handle details to m4_builtin_define.
8696 2001-08-15  Akim Demaille  <akim@epita.fr>
8698         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
8699         when creating `m4/obstack.h'.
8700         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
8701         top_builddir.
8702         * tests/defs: Make them absolute.
8703         (CDPATH) Neutralize.
8704         * tests/gethem: Use them.
8706 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
8708         * config/ltmain.sh: Doh!  Import again for a quoting fix that
8709         prevented any regression test from passing.
8711         * m4/m4module.h (obstack.h): Choose between installed version
8712         and shipped version based on configure tests.
8713         * src/freeze.c (obstack.h): Ditto.
8715         * acconfig.h: Removed.  No longer required.
8717         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
8718         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
8719         them to AC_INIT and AM_INIT_AUTOMAKE.
8720         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
8721         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
8722         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
8723         shell variable m4_cv_func_obstack_h.
8724         * tests/defs (M4): Be more careful about relative path to libtool
8725         script and m4 binary by using $srcdir.
8727         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
8728         optargs to the existing libltdl search path.
8729         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
8730         * m4/ltdl.c: Updated.
8731         * m4/ltdl.h: Ditto.
8732         * config/ltmain.sh: Ditto.
8734 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
8736         * src/main.c (main): Add `-b' (for `batch') mode switch to force
8737         interactive mode off.
8739 2001-08-10  Akim Demaille  <akim@epita.fr>
8741         * configure.in: Require Autoconf 2.52.
8742         (AC_ARG_PROGRAM): Remove, handled by Automake.
8743         (m4_getopt): Rename as...
8744         (m4_getopt_h): this.
8745         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
8746         Undefine `changeword' only if defined.
8747         * config/gnu-obstack.m4: Require Autoconf 2.52.
8748         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
8749         Allow this token.
8751 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
8753         * doc/m4.texinfo: Fix some typos, and apply some small
8754         clarifications.
8756 2001-08-09  Andreas Schwab  <schwab@suse.de>
8758         * src/main.c (main): Fix improper uses of error (missing format
8759         string).
8761 2001-08-07  Akim Demaille  <akim@epita.fr>
8763         Improve `make distcheck'.
8765         * configure.in: Be sure to be able to run `mkconfig.sh' when src
8766         != build.
8767         * Makefile.am (dist-hook): Remove, as it is no longer needed.
8768         * doc/m4.texinfo (Include): Add missing blank.
8769         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
8770         obstack.c.
8772 2001-08-07  Akim Demaille  <akim@epita.fr>
8774         * m4/evalparse.c: A better introductory comment.
8775         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
8776         * m4/macro.c: Adjust old comments.
8777         * modules/README: Typo.
8779 2001-08-07  Akim Demaille  <akim@epita.fr>
8781         * config/gnu-obstack.m4: New.
8783 2001-08-07  Akim Demaille  <akim@epita.fr>
8785         * config/Makefile.am, config/stackovf.m4: New.
8786         * configure.in, Makefile.am: Adjust.
8788 2001-08-05  gettextize  <bug-gnu-utils@gnu.org>
8790         * po/Makefile.in.in: Upgrade to gettext-0.10.39.
8791         * po/cat-id-tbl.c: Remove file.
8792         * po/stamp-cat-id: Remove file.
8794 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
8796         * modules/format.c (format):  Formatting for %f was not
8797         interpreting the position of the decimal point correctly for
8798         whole numbers.
8800 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
8802         * TODO:  Removed m4exit bug.
8803         * modules/load.c (m4_resident_module): Make this module resident.
8804         * module/m4.c (m4_resident_module): Ditto.
8805         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
8806         feature to mark modules as resident if they export
8807         `m4_resident_module' as TRUE.
8808         (m4_module_unload): Do not remove resident modules, and take care
8809         with symbol insertion and deletion with resident modules.
8810         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
8811         use resident modules feature.
8813 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
8815         * TODO: Updated.  Removed some cruft that has since been fixed
8816         or implemented.  Added some more entries.
8817         * NEWS: Updated.
8818         * README: Updated.
8819         * modules/README: Updated.
8820         * doc/m4.texinfo: Updated.
8822         * modules/gnu.c (builtin_functions): Make indir orthogonal to
8823         builtin, in that each is recognised as a macro only with parameters
8824         (builtin_indir): Passing 0 arguments is now an error, as with
8825         builtin.
8827         * src/main.c (usage): Added missing description of `-c' option.
8829 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
8831         Consolidate the myriad of dispersed test scripts into the
8832         tests subdirectory.  I think I now have all the file where I
8833         want them, so there shouldn't be anymore upheaval =)O|
8834         Honest!
8835         * tests/Makefile.am: Updated to run the new tests added below.
8836         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
8837         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
8838         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8839         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8840         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8841         tests/other-tests/hanoi.test, tests/other-tests/include.test,
8842         tests/other-tests/indir.test, tests/other-tests/misc.test,
8843         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
8844         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8845         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8846         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
8847         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
8848         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
8849         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8850         tests/other-tests/translit.test, tests/other-tests/undivert.test,
8851         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8852         tests/other-tests/wrap.test:  New tests based on the contents
8853         of the tests removed below.
8854         * examples/Makefile.am, modules/Makefile.am:  Updated to
8855         reflect removed tests.
8856         * examples/defs,modules/defs: Removed.
8857         * examples/capitalize.test, examples/comments.test,
8858         examples/ddivert.test, examples/debug.test,
8859         examples/esyscmd.test, examples/exp.test,
8860         examples/foreach.test, examples/forloop.test,
8861         examples/fstab.test, examples/hanoi.test,
8862         examples/include.test, examples/indir.test,
8863         examples/misc.test, examples/multiquotes.test,
8864         examples/patsubst.test, examples/pushpop.test,
8865         examples/regexp.test, examples/reverse.test,
8866         examples/sysv-args.test, examples/trace.test,
8867         examples/translit.test, examples/undivert.test,
8868         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
8869         modules/modpath1.test, modules/modpath2.test,
8870         modules/modpath3.test, modules/modpath4.test,
8871         modules/modtest.test, modules/shadow.test,
8872         modules/unfrozen.m4, modules/unload.test: Removed.
8874         Move the implementation of GMP support for the mpeval() builtin
8875         into a loadable module that depends on libgmp.  mpeval() and
8876         eval() share a common parser, now in m4/evalparser.c; the code
8877         in m4/numb.c and m4/numb.h is now physically split between
8878         m4/eval.c (the eval() backend) and modules/mpeval.c (the
8879         mpeval() backend), rather than being differentiated by cpp
8880         macros and multiple inclusion.  The mpeval module is always
8881         built but will generate an diagnostic if it is used from an
8882         installation that didn't link in the gmp library.
8883         * modules/Makefile.am: build and install the new mpeval module.
8884         * modules/mpeval.c: Now contains the former parts of m4/numb.c
8885         and m4/numb.h that are required for gmp support in mpeval().
8886         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8887         * m4/evalmp.c:  Removed.
8888         * m4/m4module.h: Removed conditional prototype for
8889         m4_mp_evaluate().
8890         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
8891         and m4/numb.h that do not rely on gmp.
8892         * m4/evalparse.c:  New file, contains the shared parts of the
8893         eval() and evalmp() parser implementations, and is no longer
8894         unencumbered by cpp magic to uncover the right parts.
8895         * m4/numb.h:  Removed.  It's former contents are split between
8896         m4/eval.c and modules/mpeval.c.
8897         * m4/numb.c: ditto.
8899         * tests/other-tests/changeword.test: New test.  Rudimentary
8900         testing of changeword builtin runs only if --wnable-changeword
8901         was used at configure time.
8902         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8903         alternation correctly.  Split into two expressions to compensate.
8904         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
8905         * modules/Makefile.am: Build changeword module.
8906         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
8907         only when --enable-changeword was passed to configure.
8908         (builtin_changeword): If --enable-changeword was not used, then
8909         report that changeword() builtin has no support in m4 binary.
8911 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
8913         * src/main.c (main): Fixed a particularly nasty bug is
8914         user_search_path setting -- the -M flag processing must be
8915         extremely careful with search path ordering, or else the default
8916         installed module directory (possibly containing modules from a
8917         previous release) is placed earlier in the search path than any -M
8918         arguments (which are relied upon to load uninstalled modules with
8919         most of the tests in the regresion suite).
8921         * modules/load.c (builtin_load):  Nasty hack to prevent adding
8922         symbols to symtab again if a module is loaded more than once.
8923         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
8925         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
8926         possible NULL pointer dereference.
8928         * m4/module.c (m4_module_find_by_modname): Renamed from
8929         m4_module_modname_find.   Fixed all references.
8930         (m4_module_find_by_builtin):  New function.
8932         * modules/modfreeze.test: load the `load' module with each
8933         invocation.
8934         * src/freeze.c (produce_frozen_state): Simplified in light of
8935         module field in m4_symbol.  Allow a third argument for text macros
8936         to name the originating module.
8937         (reload_frozen_state): ditto.
8938         * m4/m4module.h:  Fixup prototypes.
8939         * m4/builtin.h (m4_builtin_define): Add a module argument so
8940         that symbols can be registered against the defining module.
8941         (m4_macro_define): ditto.
8942         * m4/m4private.h (m4_symbol): Make the module field const to save
8943         on casting in the rest of the code.
8944         (SYMBOL_MODULE): New macro.
8946         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
8947         symbol reference maintenance bugs when removing a symbol from the
8948         symtab.
8950         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
8952 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
8954         * configure.in (m4_cv_func_obstack): A better check for whether
8955         libc has an obstack implementation.
8956         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
8958         * configure.in (--with-modules): Changed semantics.  This
8959         option is now used to list modules to be preopened.
8960         * src/m4.h: #include "ltdl.h" unconditionally.
8961         * src/main.c: Removed all dependencies on WITH_MODULES.
8962         * src/freeze.c: ditto.
8963         * modules/Makefile.am: ditto.
8964         * m4/m4.c (builtin_m4exit): ditto.
8965         * modules/modpath1.test: ditto.
8966         * modules/modpath2.test: ditto.
8967         * modules/modpath3.test: ditto.
8968         * modules/modpath4.test: ditto.
8969         * modules/modtest.test: ditto.
8970         * modules/shadow.test: ditto.
8971         * modules/unload.test: ditto.
8973         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
8974         comes up on demand in LTLIBOBJS now.
8975         * configure.in (getopt_long):  Creating and relying on a link for
8976         getopt.h on hosts with no getopt_long() of thier own works
8977         correctly now.  This is necessary so that callers of getopt_long()
8978         can simply `#include <getopt.h>': the naive way of doing this
8979         would end up using our own getopt.h and the installed
8980         getopt_long(), which is asking for trouble!
8981         (obstack_init): A similar argument applies to obstack.h and
8982         obstack_init().
8984         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
8985         On Solaris-2.5 (at least) the native dlopen implementation
8986         gets confused about m4.o when looking for module "m4".  This
8987         version always looks for .la an .$lib_ext suffixed names first
8988         to work around the problem.  Sigh.
8990         * po/POTFILES.in: Take account of these file movements.
8991         * src/Makefile.am (m4_SOURCES): removed eval.c.
8992         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
8993         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
8994         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
8995         * modules/m4.c (builtin_eval): Use m4_evaluate().
8996         * m4/eval.c: Moved here from src/eval.c to facilitate
8997         implementation of eval() builtin as part of the `m4' loadable
8998         module.
8999         (m4_evaluate): renamed from evaluate for namespace cleanliness.
9000         * m4/numb.c: Moved here from src/numb.c, since it is #included
9001         into eval.c at compile time.
9002         * m4/m4module.h (m4_evaluate): Added prototype.
9003         * src/m4.h (evaluate): Removed prototype.
9005 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
9007         * modules/perl.c (builtin_perleval):  Use PL_na for
9008         compatibility with perl-5.6.
9010         * src/main.c (main):  It is now safe to
9011         ``m4_module_install("m4")'', without tripping over the m4
9012         binary itself!
9013         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
9014         versions having fixed the insidious module search order bug.
9016         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
9017         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
9019         * configure.in: Figure out whether to use the installed
9020         getopt.h or the supplied one.
9021         * src/Makefile.am: ditto.
9023         * po/POTFILES.in: List files in their new positions.
9025         * config/ltmain.sh:  This needs to be checked in to match the
9026         libtool macros copied to acinclude.m4 (until a released
9027         libtool copes with m4's needs).
9028         * bootstrap:  Run gettextize.
9030 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
9032         * AUTHORS:  Added my details.
9033         * TODO: updated.
9034         * NEWS: updated.
9035         * bootstrap: temporary update until released libtool catches up.
9037         * All files:  Use new GNU GPL copyright blurb with current contact
9038         address.
9040         * configure.in (LTLIBOBJS): Use canonical code for calculation of
9041         this variable.
9043         * config: renamed acm4 directory to config to be more like
9044         other autoconfiscated packages.
9046         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
9047         * config/debug.m4:  New file implementing configure macros to add
9048         suitable debug flags to the compiler invocation.
9050         * modules/load.c:  New file implementing the ``load'' and
9051         ``unload'' builtins.
9052         * tests/get-them:  Set the module search directory to the modules
9053         build directory in generated tests.
9054         * modules/shadow.test: ditto.
9055         * modules/modtest.test: ditto.
9056         * modules/modpath1.test: ditto.
9057         * modules/modpath2.test: ditto.
9058         * modules/modpath3.test: ditto.
9059         * modules/modpath4.test: ditto.
9060         * modules/modtest.test: ditto.
9061         * modules/modfreeze.test: ditto.
9062         * modules/unload.test: ditto.
9064         * modules/changeword.c:  New file implementing the ``changeword''
9065         builtin as a loadable module.
9066         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
9067         as a loadable module.
9069         * src/main.c (main):  Load the gnu module if m4 was started
9070         normally -- i.e. without the -G option.
9071         * modules/gnu.c:  New file implementing a new loadable module wuth
9072         definitions for all the gnu extension builtins.
9073         * modules/format.c:  Moved here from src/format.c.  Now included
9074         directly by gnu.c.
9076         * src/main.c (main):  Load the traditional module if m4 was
9077         started in `no_gnu_extensions' mode.
9078         * modules/traditional.c:  New file implementing the ``unix'' macro,
9079         required when m4 is executed in traditional mode, as a loadable
9080         module.
9082         * src/main.c:  Renamed from m4.c to avoid confusion with
9083         modules/m4.c.
9084         (main):  Always load the m4 module.
9085         * modules/m4.c:  New file implementing a new loadable module with
9086         definitions for all m4 builtins that are not gnu extensions.
9088         * m4/Makefile.am:  Adjusted to take new files below into account.
9089         * m4/m4module.h: Prototypes for exported functions and types moved
9090         to this directory from the src directory.
9091         * m4/m4private.h: Moved here from src/m4private.h to facilitate
9092         the migration of all builtin implementations to loadable modules.
9093         * m4/macro.c: Moved this file here from the src directory,
9094         renaming all exported symbols to use the prefix ``m4_''.
9095         * m4/builtin.c: ditto.
9096         * m4/module.c: ditto.
9097         * m4/symtab.c: ditto.
9098         * m4/debug.c: ditto.
9099         * m4/input.c: ditto.
9100         * m4/output.c: ditto.
9101         * m4/path.c: ditto.
9102         * m4/ltdl.h, m4/ltdl.c: ditto.
9103         * m4/utility.c: Odd functions moved here from files in the src
9104         directory to facilitate builtin migration.
9106 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
9108         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
9109         error message, to make translators' jobs a little easier.
9110         (builtin_builtin): ditto.
9111         (builtin_traceon): ditto.
9112         (builtin_traceoff): ditto.
9113         Reported by Akim Demaille <akim@epita.fr>
9115         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
9116         pkgincludedir instead.
9118         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
9119         it is exported globally.  Fixed all references.
9120         (lquote): ditto.
9121         (bcomm): ditto.
9122         (ecomm): ditto.
9123         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
9124         globally.  Fixed all references.
9125         (DEF_LQUOTE): ditto.
9126         (DEF_BCOMM): ditto.
9127         (DEF_ECOMM): ditto.
9129 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
9131         * NEWS: updated.
9132         * TODO: updated.
9134         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
9135         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
9137         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
9138         Removed `Prev', `Next' and `Up' fields of all @nodes now that
9139         makeinfo calculates them for us, and to make any future
9140         reorganisation easier.
9141         (Frozen files): Document format version 2.
9142         `V' now takes argument `2'.
9143         `F' can take a single argument if symbol and builtin names
9144         are the same, or 3 arguments if the builtin is from a module.
9145         New `S' specification for saving syntax table contents.
9146         New `M' specification for saving loaded module names.
9147         * src/freeze.c: Implement them.
9148         * src/input.c (syntax_code): For interpreting frozen syntax
9149         state.
9151         * examples/Makefile.am:  Add the contents of the WWW directory to
9152         the distribution.
9153         * examples/WWW/Makefile:  ditto,
9154         (%.htm): Compares file contents (not just sizes) to determine
9155         whether a change has occured.
9156         * examples/WWW/_header.htm: Bumped version number.
9157         * examples/WWW: Regenerated content.
9159         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
9160         compilers comes much easier without ansi2knr.
9161         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
9163         * m4/list.c: New generic list container type.
9164         * m4/list.h: Interface to new container type.
9165         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
9166         (libm4_la_SOURCES): compile and link list.c.
9167         * src/builtin.c (builtin_tables): Use list container.
9168         * src/module.c (symtab): ditto.
9169         * src/symtab.c (symtab): ditto.
9171         * m4/system.h: New file for common preprocessor definitions.
9172         * m4/Makefile.am (pkginc_HEADERS): install system.h.
9173         * m4/error.c: Use system.h in place of inline preprocessor.
9174         * m4/error.h: ditto.
9175         * m4/module.c: ditto.
9176         * m4/module.h: ditto.
9177         * m4/xmalloc.c: ditto.
9179         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
9180         compatibility.
9181         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
9183         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
9184         it is exported globally.  Fixed all references.
9185         (builtin): ditto.
9186         (module_init_t): ditto.
9187         (module_finish_t): ditto.
9188         (token_data): ditto.
9189         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
9190         it is exported globally.  Fixed all references.
9191         (SYNTAX_IGNORE): ditto.
9192         (SYNTAX_SPACE): ditto.
9193         (SYNTAX_OPEN): ditto.
9194         (SYNTAX_CLOSE): ditto.
9195         (SYNTAX_COMMA): ditto.
9196         (SYNTAX_DOLLAR): ditto.
9197         (SYNTAX_ACTIVE): ditto.
9198         (SYNTAX_ESCAPE): ditto.
9199         (SYNTAX_ALPHA): ditto.
9200         (SYNTAX_NUM): ditto.
9201         (SYNTAX_ALNUM): ditto.
9202         (SYNTAX_LQUOTE): ditto.
9203         (SYNTAX_RQUOTE): ditto.
9204         (SYNTAX_BCOMM): ditto.
9205         (SYNTAX_ECOMM): ditto.
9206         (SYNTAX_VALUE): ditto.
9207         (SYNTAX_MASKS): ditto.
9208         (IS_OTHER): ditto.
9209         (IS_IGNORE): ditto.
9210         (IS_SPACE): ditto.
9211         (IS_OPEN): ditto.
9212         (IS_CLOSE): ditto.
9213         (IS_COMMA): ditto.
9214         (IS_DOLLAR): ditto.
9215         (IS_ACTIVE): ditto.
9216         (IS_ESCAPE): ditto.
9217         (IS_ALPHA): ditto.
9218         (IS_NUM): ditto.
9219         (IS_ALNUM): ditto.
9220         (IS_LQUOTE): ditto.
9221         (IS_RQUOTE): ditto.
9222         (IS_BCOMM): ditto.
9223         (IS_ECOMM): ditto.
9224         (TOKEN_EOF): ditto.
9225         (TOKEN_NONE): ditto.
9226         (TOKEN_STRING): ditto.
9227         (TOKEN_SPACE): ditto.
9228         (TOKEN_WORD): ditto.
9229         (TOKEN_SIMPLE): ditto.
9230         (TOKEN_MACDEF): ditto.
9232         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
9233         consistency.  Fixed all references.
9234         (STRING): Renamed to `m4_string' for consistency, and because if
9235         is exported globally.  Fixed all references.
9236         (token_type): Renamed to `m4_token_t' for the same reasons.
9237         (token_data_type): Renamed to `m4_token_data_t' for the same
9238         reasons.
9240         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
9241         sizes.
9242         (XMALLOC): ditto.
9243         (XREALLOC): ditto.
9244         (XFREE): Wrapper macro which avoids freeing NULL pointers.
9246         * m4/m4module.h (m4_macro):  New type for module defined user
9247         macros.
9248         * modules/modtest.c (m4_macro_table):  Define module user macros.
9249         * modules/shadow.c (m4_macro_table):  ditto.
9251         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
9252         declared with M4BUILTIN.
9254         * m4/xmalloc.c: Use memset if bzero is not available when
9255         emulating calloc with malloc.
9256         (xcalloc): Fallback to malloc/bzero if calloc is not available.
9257         (xfree): Added for consistency.  Will not try to free NULL
9258         pointers.
9259         * src/m4.c (xfree):  Deleted in favour of the above.
9260         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
9261         linking with libdmalloc.
9262         * m4/xstrdup.c (WITH_DMALLOC): ditto.
9264         * modules/frozen.m4:  New test case.
9265         * modules/unfrozen.m4:  ditto.
9266         * modules/modfreeze.test:  New test.
9267         * modules/unload.test:  ditto.
9268         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
9269         (TESTS): Use them.
9270         * modules/modpath1.test:  Don't try this test if module support is
9271         not compiled in.
9272         * modules/modpath2.test: ditto.
9273         * modules/modpath3.test: ditto.
9274         * modules/modpath4.test: ditto.
9275         * modules/modtest.test: ditto.
9276         * modules/shadow.test: ditto.
9278         * modules/perl.c: New module.
9279         * modules/perl.m4: Example of using it.
9280         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
9282         * src/m4.c (main): Assume interactive mode if STDIN is connected
9283         to a tty.
9284         Changed startup sequence slightly so that syntax is not
9285         initialised from here when loading a frozen file.
9287         * src/builtin.c:  Much improved macro definition style.
9288         * src/m4private.h:  Internal structures for m4_builtin and
9289         m4_macro instances.  These are not exposed to module writers.
9290         * src/module.c (module_modname_find):  Find a module structure
9291         from the its name.
9292         (make_macro_table):  Build an internal macro table from a external
9293         definition.
9294         (make_builtin_table):  Build an internal builtin table from an
9295         external definition.
9297         * src/module.c (module_unload): Be extremely careful to remove
9298         builtins and macros that match the module being unloaded -- no
9299         longer assume that the top element can be removed incase another
9300         odule defines an identical name.
9301         * src/symtab.c (remove_table_reference_symbols): remove all symbol
9302         table entries which refer to a given builtin table.
9303         * src/builtin.c (remove_tables): Use it!
9305 2000-07-13  Thomas Tanner  <tanner@ffii.org>
9307         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
9308         * acm4/modules.m4: deleted
9309         * bootstrap: don't libtoolize libltdl!
9310         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
9311         if set, enable WITH_MODULES and add modules to DLPREOPEN
9312         * examples/misc.test: redirect standard output
9313         * lib/Makefile.am: don't use DLLDFLAGS
9314         * lib/m4module.c: include necessary headers to silence GCC -Wall
9315         * lib/m4regex.c: fixes to silence GCC -Wall
9316         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
9317           build modules conditionally
9318         * modules/shadow.c: define symbol aliases before using them
9319         * modules/test.c: define symbol aliases before using them
9320         * po/de.po: update translation
9321         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9322         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9323         LIBLTDL to LIBS.
9324         * src/m4.c: initialize libltdl's preloaded symbols via
9325         LTDL_SET_PRELOADED_SYMBOLS
9326         * src/module.c: libltdl's memory management must be initialized
9327         before calling lt_dlinit!, fix warnings
9329 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
9331         * README:  Caveat about nls not supported by dll architecture on
9332         Windows.
9334         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9336         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
9337         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
9338         * modules/Makefile.am (LIBS): ditto.
9339         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9340         $(top_srcdir)/m4 (for only <m4module.h>).
9341         * modules/shadow.test: fixed for VPATH.
9342         * modules/modtest.test: ditto.
9343         * modules/modpath4.test: ditto.
9344         * modules/modpath3.test: ditto.
9345         * modules/modpath2.test: ditto.
9346         * modules/modpath1.test: ditto.
9348         * modules/time.test: Removed due to timezone dependence,
9349         * modules/Makefile.am (TESTS): Removed time.test.
9351         * configure.in: Use $3 of AC_DEFINE so that we can,,,
9352         * acconfig.h: Remove everything except the gettext parameters.
9353         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9354         AC_DEFINE.
9355         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
9356         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
9357         increment serial number.
9359         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9360         src dir and immediately after libm4 is built for confidence that
9361         it doesn't rely on the src directory.
9362         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9363         makeinfo stop the build on cygwin (because they don't work).
9365         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9367         * m4/m4private.h: ...is not a public header, so moved to src.
9368         Add `#include <config.h>', `#define _COMPILING_M4' and
9369         `#include "m4.h".
9370         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9371         * src/Makefile.am (noinst_HEADERS): add m4private.h.
9372         * src/builtin.c: `#include "m4private.h"' now takes care of the
9373         above.  Duplicates removed.
9374         * src/debug.c: ditto.
9375         * src/eval.c: ditto.
9376         * src/evalmp.c: ditto.
9377         * src/format.c: ditto.
9378         * src/freeze.c: ditto.
9379         * src/input.c: ditto.
9380         * src/m4.c: ditto.
9381         * src/macro.c: ditto.
9382         * src/module.c: ditto.
9383         * src/numb.h: ditto.
9384         * src/output.c: ditto.
9385         * src/path.c: ditto.
9386         * stackovf.c: ditto.
9387         * symtab.c: ditto.
9389         * po/POTFILES.in: compensate for renaming of lib/*.
9390         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9391         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9392         and then in $(top_srcdir)/lib (for eg. "m4private.h").
9393         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9394         m4/libm4.la.
9395         * m4/m4error.h:  Renamed error.h, for installation to
9396         $prefix/include/m4..
9397         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
9398         * m4/m4regex.h: Renamed regex.h, for same reason.
9399         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
9400         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9401         * m4/m4regex.c: Renamed regex.c, and fix #includes.
9403         * lib: moved to m4 to easily support header installation to
9404         $prefix/include/m4.
9405         * Makefile.am (SUBDIRS): renamed lib dir to m4.
9406         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9407         * acm4/regex.m4: Point to m4/regex.c.
9409         * examples/foreach.m4:  Sanitise quoting.
9410         * examples/foreach.test:  New torture test.
9411         From Akim Demaille <akim@epita.fr>
9413 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
9415         * src/ltdl.c: Use access() to abort doomed module load attempts
9416         if module file does not exist.
9418         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9419         getopt1.o will already be used if appropriate, so I moved getopt.c
9420         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9422         * modules/modpath1.test: Use correct filename in header line.
9423         * modules/modpath2.test: ditto.
9424         * modules/modpath3.test: ditto.
9425         * modules/modpath4.test: ditto.
9427         Without these changes lt_dlopen("test") attempts to
9428         LoadLibrary("/bin/test") on Windows, which although harmless
9429         generates a spurious error message which spoils most of the tests:
9430         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9431         (TESTS): s/test.test /modtest.test /
9432         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9433         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9434         * modules/modpath1.test: s/test.m4 /modtest.m4 /
9435         * modules/modpath2.test: ditto.
9436         * modules/modpath4.test: ditto.
9437         * modules/modpath3.test: s/-m test /-m modtest /
9438         * modules/shadow.m4: use {un,}loadmodule(`modtest').
9440 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
9442         * src/ltdl.c (find_file): Updated to new version with fixed memory
9443         allocation bug in `next'.
9444         * src/ltdl.h: updated to match.
9446         * modules/Makefile.am:  Cleaned up and reordered.
9448 2000-01-16  René Seindal  <rene@seindal.dk>
9450         * modules/Makefile.am (TESTS): New tests for the module system.
9452         * modules/*.test: New files.
9454         * src/m4.c (main): Added call to module_init().
9455         Treats -M and -m as the arguments -D -U and -t, ie deferred.
9457         * src/m4.h: Added declaration of module_init().
9459         * src/module.c (module_init): No longer static
9461         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9462         Added to shut up automake about non standard libtool library
9463         names.
9465         * src/module.c: Disabled DEBUG by default.
9467         * modules/README: Changed example from unload.m4 to shadow.m4
9469         * modules/shadow.m4: Renamed from unload.m4
9471         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9473         * src/m4.c (main): Functionality for -m and -M were reversed.
9474         Fixed.
9476 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
9478         * doc/help2man.pl: updated to version 1.020.
9480         * lib/COPYING.LIB:  updated to version 2.1.
9482         * lib/m4module.h: restructure the M4_SCOPE code to work when
9483         creating a dll which links with libm4.la and both DLL_EXPORT
9484         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9485         both defined.
9487 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
9489         Merged the following changes from my tree:
9491         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
9493         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9494         ported to compile shared libs.
9496         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9497         use `__declspec(dllimport)' when linking libm4.la on win32.
9498         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9500         * configure.in (M4OBJS): Discover whether we need the shipped
9501         implementation of getopt_long.
9502         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9503         main binary here, as opposed to the module library in lib/libm4.la.
9505         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
9507         * modules/README: Updated to describe the improved libltdl based
9508         module scheme.
9509         * README (cygwin): Added some compilation notes for building m4
9510         correctly under cygwin.
9511         * TODO: Cleaned out the entries for the module system since they
9512         are now implemented.
9514         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9515         all instances of __P with M4_PARAMS.
9517         * lib/getdate.h: removed unreferenced file.
9519         * lib/m4private.h: New file to define the private interface to the
9520         token_data struct, which must be shared between m4module.c, and
9521         builtin.c but not exported to modules built from the installed
9522         m4module.h since it's size changes depending on compile time
9523         options.
9525         * src/m4.h: Lots of stuff moved to lib/m4module.h.
9527         * lib/m4module.h: New file to define the interface available when
9528         compiling m4 modules.
9529         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9530         necessary for module compilation into this new file.
9532         * lib/Makefile.am (include_HEADERS): install headers (renamed to
9533         avoid nameclash with other system headers) necessary for compiling
9534         modules.
9535         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9536         so that modules can include the (renamed) installed headers and
9537         be guaranteed a matching implementation.
9538         * lib/m4error.h: renamed from error.h.
9539         * lib/m4obstack.h: renamed from obstack.h.
9540         * lib/m4regex.h: renamed from regex.h.
9541         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
9542         implementation, simply include the shipped version
9543         unconditionally, otherwise it is hard for a module to know
9544         whether the m4obstack.h header it is using matches the
9545         implementation it ends up linking against.
9546         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
9547         the same reason.
9549         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
9551         * examples/misc.test: Don't run this test on machines which don't
9552         have a root user in /etc/passwd (e.g. cygwin).
9554         * tests/get-them (/^@example$/): Error messages might have a
9555         ``.exe'' suffix to the program name, or else use the libtool
9556         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
9557         of these cases are now catered for when comparing error messages
9558         in generated tests.
9559         * tests/other-tests/*.test: ditto.
9560         * examples/*.test: ditto.
9562         * tests/defs (M4): use libtool execute mode.
9563         * examples/defs (M4): ditto.
9565         * tests/get-them (END): explicitly close any open file.
9566         (printthem): In a regular expression, '{' is the start of a repeat
9567         count!  Use `[{]' for a literal open brace.
9568         (/^@node /): Don't use substr on a string shorter than the trim
9569         length.
9571         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
9573         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9574         substituted.
9575         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9577 2000-01-10  Andreas Schwab  <schwab@suse.de>
9579         * tests/other-tests/gmp.test: Find config.sh in build directory.
9581         * configure.in: Find tests/mkconfig.sh in $srcdir.
9583         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9584         <signal.h> (for SUS2 compliant systems).
9586         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
9587         HAVE_SIGINFO_H.
9589 2000-01-10  René Seindal  <rene@seindal.dk>
9591         * Prerelease 1.4o.
9593         * TODO, NEWS: Cleaned up and updated.
9595         * src/m4.c (main): New variable exit_status for exit status in
9596         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
9597         file cannot be read instead of EXIT_SUCCESS.
9599         * src/builtin.c (m4_indir): Changed error message to help
9600         translators (from Akim Demaille <demaille@inf.enst.fr>).
9602         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
9603         Cygnus.
9605         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
9606         from glic 2.1.2.
9608         * src/input.c (match_input): Reordering of code, to avoid multiple
9609         calls to push_string_init() from obstack_grow(), which can happen
9610         with some compilers (found and fixed by James Bonfield
9611         <jkb@mrc-lmb.cam.ac.uk>).
9613         * src/stackovf.c: Added prototypes for ultrix.
9614         (setup_stackovf_trap): Added __P to cast.
9615         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
9617 2000-01-09  René Seindal  <rene@seindal.dk>
9619         * doc/m4.texinfo (Changequote): Added comment about changing
9620         quotes when the old quote is a part of the new.
9622         * src/builtin.c (expand_ranges): Added break after trailing dash.
9623         This caused misbehavious on some systems (found and fixed by Akim
9624         Demaille <demaille@inf.enst.fr>).
9626         * AUTHORS: Thomas Tanner included
9628         * acconfig.h: Added entry for ss_sp (see below).
9630         * configure.in (use_stackovf): Added check for stack_t with member
9631         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
9632         <eggert@twinsun.com>).
9634         * doc/m4.texinfo (Frozen files): Added a simpler example for
9635         generating frozen files from several input files.
9637 1999-11-14  Paul Eggert  <eggert@twinsun.com>
9639         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
9640         lib/regex.c, lib/xmalloc.c.
9642 1999-11-10  René Seindal  <rene@seindal.dk>
9644         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
9646         * src/module.c: reindented.
9647         (module_load): return if this is a repeated load of same module.
9648         (module_init): slight change of logic to avoid repeated
9649         initialisation debug messages.
9651         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
9652         in the distribution.
9654         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
9655         automake warnings about missing lib prefix.
9656         (time_la_LDFLAGS): ditto
9657         (stdlib_la_LDFLAGS): ditto
9659 1999-11-10  Paul Eggert  <eggert@twinsun.com>
9661         * src/m4.h: Include error.h, since our macros use error.
9662         * src/m4.c: Don't need to include error.h.
9664 1999-11-09  Paul Eggert  <eggert@twinsun.com>
9666         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
9667         and zero, as Solaris 7 cc does.
9668         (bcopy): Remove macro; no longer needed with new obstack.h.
9670         * src/output.c (freeze_diversions): Don't assume that a
9671         diversion size can fit in `int'.  Check for diversion file
9672         size too large to be printed with `unsigned long'.
9674         * src/Makefile.am (CFLAGS): Omit -Wall.
9676         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
9678         * src/debug.c (trace_format):
9679         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
9681         * src/freeze.c (produce_frozen_state):
9682         Don't assume string lengths fit in int.
9684 1999-10-13  René Seindal  <rene@seindal.dk>
9686         * po/cs.po: Czech translation added.
9688         * po/sv.po: Updated Swedish translation.
9690         * po/ru.po: Updated Russian translation.
9692         * po/pl.po: Updated Polish translation.
9694         * po/el.po: Greek translation added.
9696 1999-10-13  René Seindal  <rene@seindal.dk>
9698         * configure.in (ALL_LINGUAS): Added Greek translation (el).
9699         (ALL_LINGUAS): Added Czech translation (cs).
9701 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
9703         * src/builtin.c: moved module loading functions into...
9704         * src/module.c: entirely new implementation using libltdl.
9705         * po/POTFILES.in: added src/module.c.
9706         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
9707         are modules, not linktime libraries.
9708         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
9709         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
9710         avoidance on exported symbols.
9711         * modules/test.c (m4_macro_table, m4_init_module,
9712         m4_finish_module): ditto.
9713         * modules/time.c (m4_macro_table): ditto.
9715         * modules/time2.m4: new file which requires command line loading
9716         of modules.
9717         * src/m4.c (--load-module): dynamically load named runtime module
9718         into running executable before reading the source.
9719         (--module-directory): prepend a directory to the module search
9720         path.
9721         (module_init()): Do this the first time we load a module instead;
9722         if the module subsystem is broken normal m4 scripts can still run.
9723         * src/m4.h (install_builtin_table): is now exported.
9725 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
9727         * src/module.c: removed.  No longer required.
9728         * po/POTFILES.in: removed src/module.c.
9730         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
9731         the bootstrap script can recreate.
9732         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
9733         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
9734         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
9735         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
9736         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
9737         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
9738         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
9739         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
9741         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
9742         better.
9743         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
9744         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
9745         the installed gettext.m4 file when running aclocal.
9747 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
9749         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
9750         distinguish this from the last prerelease.
9751         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
9752         in its own subdirectory.
9754         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
9755         lib prefix on a module" feature.
9756         (LDFLAGS): Added `-module -avoid-version' flags to build
9757         versionless module libraries.
9758         * src/builtin.c (m4_load_module): use libltdl.
9759         (module_unload_all): use libltdl.
9760         * src/m4.c (module_init): initialise module loading on demand for
9761         better diagnostics, and so that m4 will still work even if
9762         the module code is broken.
9763         * src/m4.h (module_init): removed.  No longer relevant.
9764         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
9765         exported symbols for compatibility with dlpreopening.
9766         * modules/test.c (m4_macro_table, m4_init_module,
9767         m4_finish_module): ditto.
9768         * modules/time.c (m4_macro_table): ditto.
9770         * bootstrap: New file.  Runs all the autoutils in the right order
9771         after a fresh checkout, or a make maintainer-clean.
9773 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
9775         * src/builtin.c (dump_symbols): New function, factoring common
9776         content of m4_dumpdef and m4_symbols.
9777         (m4_dumpdef): Use it.
9778         (m4_symbols): New function, implementing `symbols'.  Use it.
9779         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
9780         file compile with modern makeinfo.
9781         (Symbols): New node, documenting symbols.
9782         (direntry): Modernize.
9784 1998-12-11  René Seindal  <rene@seindal.dk>
9786         * src/builtin.c (predefined_tab): New predefined macros
9787         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
9788         configure time options.
9790 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
9792         * src/module.c (module_try_load): Don't try to be clever and
9793         overwrite argument string.  Instead allocate all constructed
9794         strings locally, since they can have arbitrary lengths.  Make
9795         arguments pointers to const.
9796         (module_search): Simplify due to above change.
9798 1998-11-29  René Seindal  <rene@seindal.dk>
9800         * Prerelease 1.4n.
9802         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
9804         * tests/other-tests/import-environment.{m4,test}: New test.
9806         * tests/other-tests/discard-comments.{m4,test}: New test.
9808         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
9810         * src/m4.c (main): New option -c --discard-comments.
9811         New global variable discard_comments.
9813         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
9814         discarded, ie never returned from next_token().
9815         Added declaration of discard_comments.
9817         * src/input.c (next_token): Now loops until token type is not
9818         TOKEN_NONE.  Comments are now given this type when comments should
9819         be discarded.
9821         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
9822         and mpeval.
9824 1998-11-28  René Seindal  <rene@seindal.dk>
9826         * src/m4.c (main): New option --import-environment (no single
9827         letter option).
9829         * When configured with --with-gmp both the normal (fast) eval()
9830         and the gmp aware mpeval() are defined.  To restore previous
9831         bahaviour use "define(`eval', defn(`mpeval'))".
9833         * tests/other-tests/gmp.m4: Changed to use mpeval().
9835         * src/evalmp.c: New file for compiling eval.c as gmp aware.
9836         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
9838         * src/eval.c: Now includes "numb.c" directly.  Everything in this
9839         file must by static, except evaluate(), which is changed to
9840         mp_evaluate() if USE_GMP in force.
9842         * src/numb.c: Changed to be included by eval.c instead of being
9843         compiled separately.  Everything is declared static.
9845         * src/numb.h: Removed declarations of functions, as numb.c is now
9846         included by eval.c.
9848         * src/builtin.c: Declaration of m4_mpeval() added.
9849         Inserted `mpeval' in builtin table.
9850         (do_eval): New function with common code for m4_eval and m4_mpeval.
9851         (m4_mpeval): New function for gmp version of eval.
9853         * src/m4.h: Declaration of mp_evaluate().
9855         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
9856         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
9858         * src/m4.c (main): m4 --version also shows which options were used
9859         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
9861 1998-11-27  René Seindal  <rene@seindal.dk>
9863         * Error messages now always print program name before input file
9864         name as specified by GNU coding standards.  Reported by Akim
9865         Demaille <demaille@inf.enst.fr>.
9867         * doc/m4.texinfo (Include): Change due to changed error message
9868         format.
9869         (Eval): Do.
9871         * tests/get-them: Minor change to sed script due to changed error
9872         message format.
9874         * src/m4.c (print_program_name): New func used to print program
9875         name, input file and line number in error ().  Used as an
9876         error_print_progname handler.
9877         (reference_error): Removed.
9878         (main): Assigns error_print_progname.
9880         * src/m4.h (M4ERROR): Removed reference_error ().
9882 1998-11-25  René Seindal  <rene@seindal.dk>
9884         * Updated to libtool 1.2b.
9886         * src/builtin.c (install_builtin_table): Added braces to avoid
9887         warning of ambiguous 'else'.
9889         * src/module.c: Inserted search path code from path.c modified to
9890         use new interface.
9891         (module_init): Configured default path used only if M4MODPATH is
9892         not set.
9893         (module_try_load): Now reads libMODULE.la as generated by libtool
9894         for actual module name.
9895         (module_load): Gives better error messages on failure.
9897         * src/m4.h: Added declarations of structures and functions for
9898         generic search path handling.
9900         * src/path.c: Removed all module specific code and introduced new
9901         functions of more generic search path handling.
9903 1998-11-24  René Seindal  <rene@seindal.dk>
9905         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
9906         included gettext, as <libintl.h> might not be found
9907         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
9909 1998-11-22  René Seindal  <rene@seindal.dk>
9911         * src/output.c (insert_diversion): Fixed bug that might cause m4
9912         to read from standard output!  Triggered by input
9913         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
9914         so now 'undivert(0)' does nothing.
9916 1998-11-18  René Seindal  <rene@seindal.dk>
9918         * Prerelease 1.4m.
9920         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
9921         could be changed when compiling a illegal regexp, causing later
9922         use of the regexp to dump core.
9924         * src/module.c (module_load): Changed error message to conform to
9925         standards.
9927         * src/m4.c (usage): Added message about reporting bugs.
9929         * doc/m4.texinfo (Changeword): Corrected a wrong example.
9930         (Changeword): Added note about the type of regexps used.
9932         * ltconfig, ltmain.sh: New files from Libtool 1.2.
9934         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
9935         and AM_PROG_LIBTOOL.
9937         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
9938         with libtool.
9940         * modules/Makefile.am: Changed completely to compile modules using
9941         libtool.  The modules are compiled as shared libraries, and are
9942         renamed when installed.
9944         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
9945         USE_SHL_LOAD to HAVE_SHL_LOAD
9947         * src/builtin.c (shipout_string): Now tests for a NULL string.
9949         * src/module.c: New level of indirection around non-portable
9950         functions to load shared objects.  Intended to encapsulate the non
9951         portable parts better and to reduce the number of #ifdefs in the
9952         code.
9954         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
9955         directory modules/ to the distribution.
9957 1998-11-15  René Seindal  <rene@seindal.dk>
9959         * Prerelease 1.4l.
9961         * modules/stdlib.c: New module `stdlib' defining some standard
9962         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
9963         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
9965         * src/builtin.c (shipout_string): New convenience function for
9966         builtins and modules.
9968         * src/module.c (module_load): Tentative support for
9969         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
9971         * Makefile.am (SUBDIRS): Directory modules added if configured.
9973         * modules/Makefile.am: Now correctly compiles and installs
9974         modules in pkglibexecdir.
9976         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
9977         These two are now initialised by autoconf macros.
9979         * src/path.c (module_env_init): MODULE_PATH is always on the
9980         search path.
9982         * src/Makefile.am: Now generated pathconf.h which defined the
9983         default MODULE_PATH.
9985         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
9986         where modules are installed.
9988         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
9989         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
9990         build and install automatically, and it is prepared for other
9991         interfacec than dlopen().
9993         * src/builtin.c (predefined_tab): Added __m4_version__ for the
9994         current version of GNU m4.  It is a GNU extension.
9996 1998-11-14  René Seindal  <rene@seindal.dk>
9998         * tests/Makefile.am (GENERATED_TESTS): Added new
9999         generated-tests/changesy.8.test
10001         * doc/m4.texinfo (Changesyntax): Documentation for escape
10002         syntax class.
10004         * src/macro.c (expand_token): Check for escaped macro call before
10005         symbol table lookup.
10007         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
10008         characters
10010         * src/input.c: New static variable use_macro_escape, which is TRUE
10011         iff some character has code SYNTAX_ESCAPE
10012         (input_init): Added initialisation of use_macro_escape.
10013         (check_use_macro_escape): New function to synchronise
10014         use_macro_escape with the syntax table.
10015         (set_quotes): Added call to check_use_macro_escape()
10016         (set_comment): Do.
10017         (set_syntax): Do.
10018         (next_token): Added new case for IS_ESCAPE.
10020         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
10022 1998-10-13  René Seindal  <rene@seindal.dk>
10024         * Prerelease 1.4k.
10026         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
10027         generated-tests.
10029         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
10030         maintained tests in tests/other-tests.  These currently tests for
10031         8-bit transparency, multiple precision arithmetic and sync-line
10032         output.  Test for stackoverflow detection does not work.
10034         * examples/Makefile.am (TESTS): Added tests for all example files.
10036         * examples/mktests.sh: New file.  Help program for creating test
10037         files.
10039         * tests/mkconfig.sh: New file to generate tests/config.m4 and
10040         tests/config.sh.  This is for tests of configure selectable
10041         features.  Picks up all set WITH_ and ENABLE_ veriables from
10042         config.h
10044         * src/path.c (path_search): Added argument 'char **expanded_name'
10045         to return the expanded name.
10047         * src/m4.h: Added 2nd argument to declaration of path_search().
10049         * src/m4.c (main): Added 2nd argument to path_search().
10051         * src/freeze.c (reload_frozen_state): Do.
10053         * src/builtin.c (m4_undivert): Do.
10054         (include): Do.
10056 1998-10-11  René Seindal  <rene@seindal.dk>
10058         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
10060         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
10062         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
10064         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
10066         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
10068         * intl/: Updated to GNU gettext 0.10.35.
10070         * doc/m4.texinfo (Format): Documented that format is blind.
10072         * src/builtin.c (builtin_tab): Builtin format marked as blind.
10074 1998-10-07  René Seindal  <rene@seindal.dk>
10076         * Prerelease 1.4j.
10078         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
10079         .test, as the files are no longer just m4 input.
10081         * tests/get-them (FILE): Changed .m4 extension to .test.
10083         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
10084         Otherwise quoted strings with leading whitespace first in a macro
10085         argument would be eliminated.
10087         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
10088         (expand_argument): Do.
10090         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
10091         grouped together iff both quote and comment strings are single
10092         character.  Otherwise they might include a comment/quote leader.
10093         (next_token): Returns new token type TOKEN_SPACE.
10095         * src/builtin.c (push_builtin_table): New function to push a
10096         builtin_table on the stack without installing its contents.
10097         (find_builtin_by_name): Added call to push_builtin_table() if
10098         reading frozen files.  Otherwise the builtins named in the frozen
10099         files could not be found.
10100         (install_builtin_table): Changed to use push_builtin_table()
10102 1998-10-04  René Seindal  <rene@seindal.dk>
10104         * po/pl.po: Polish translation added.
10106         * po/POTFILES.in: src/module.c added.
10108 1998-10-04  René Seindal  <rene@seindal.dk>
10110         * Prerelease 1.4i.
10112         * configure.in (ALL_LINGUAS): Added Polish pl.po
10114 1998-10-03  René Seindal  <rene@seindal.dk>
10116         * Many files: Incorporated changes to implement dynamic modules.
10117         Detailed comments in src/modules.c and modules/README
10119         * src/module.c: New file, implements the OS dependant parts of
10120         dynamic module loading.
10122         * src/Makefile.am (m4_SOURCES): Added module.c
10124         * src/builtin.h: New file, declares some functions from builtin.c
10125         that are of use for other modules (shipout_int, numeric_arg,
10126         skip_space, bad_argc), and the macros ARG() and DECLARE().
10128         * src/builtin.c (install_builtin_table): New function.  Each
10129         module brings in a builtin_table, which is pushed on a stack.
10130         (struct builtin_table): New struct for list of builtin_tables.
10131         (m4_loadmodule): New function to implement builtin "loadmodule".
10132         (shipout_int): No longer static, to be used by modules.
10133         (numeric_arg): do.
10134         (skip_space): do.
10135         (bad_argc): do.
10136         (builtin_init): changed to call install_builtin_table()
10137         (find_builtin_by_name): Now searches all builtin_tables
10138         (find_builtin_by_addr): do.
10140         * src/path.c: Reorganised to allow for two search paths, one for
10141         include files and one for modules.
10143         * src/m4.h: Added declarations for new functions in module.c and
10144         in path.c.
10146         * src/m4.c (main): Added call to module_init().
10148         * modules: New directory with a few demo modules.
10150         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
10151         in SUBDIRS.
10153         * configure.in: Added modules/Makefile to AC_OUTPUT.
10155         * configure.in: Added code to implement --with-modules.  Tests for
10156         <dlfcn.h> and -ldl.
10158         * acconfig.h: Added WITH_MODULES
10160 1998-10-02  René Seindal  <rene@seindal.dk>
10162         * examples/Makefile.am (pkgdata_DATA): Removed special target for
10163         check and variables TESTS.  These tests are now run from the
10164         tests/ directory.
10166         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
10167         directory.  The files stay there but the tests are run from the
10168         tests/ directory.
10170         * tests/Makefile.am (EXTRA_DIST): Added run-test.
10172         * tests/run-test: New file.  Run a test manually
10174         * tests/Makefile.am, tests/get_them: Moved automatically generated
10175         tests (from the manual) to sub directory tests/gentest/.  The
10176         tests/ directory had gotten a bit messy.
10178 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10180         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
10181         wrap}.test: Added a few testcases.
10183 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10185         * Prerelease 1.4h.
10187         * lib/Makefile.am (noinst_HEADERS): regex.h added
10189         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
10190         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
10192         * acm4/Makefile.am: created providing rules to create
10193         $(top_srcdir)/acinclude.m4 to be used by aclocal.
10195         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
10196         `C'. Reported by Ulrich Drepper.
10198         * Makefile.am (SUBDIRS): Removed checks directory
10199         * configure.in (AC_OUTPUT): Removed checks/Makefile
10201         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
10202         the space when m4.texinfo is edited and whitespace.el is active.
10203         (Defn,example): idem.
10205 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10207         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
10208         ../COPYING. ../Makefile is a file which is certainly present when
10209         test is executed in testSubDir. One can't be sure that the COPYING
10210         file is in .. or ../.. in all situations, the ../Makefile is
10211         always there.
10213         * doc/m4.texinfo (Include): adjusted expected test output
10214         according to new tests, i.e. the input will always come from the
10215         file `in' created by the test.
10217         * tests/Makefile.am: Added three lines at the top to get
10218         esyscmd.1.test working.
10220         * tests/get-them: modified to generate clearer tests who will need
10221         less maintenance when new test examples are created in
10222         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
10223         need the generic file `defs') shell scripts creating `in', `ok',
10224         `out' and when apropriate `okerr' and `err' in the directory
10225         `testSubDir' when executed. The compare of `ok' and `out'
10226         (and of `okerr' and `err') will be the exit status of the test.
10227         `out' must match `ok' (and `okerr' must match `err') for the test
10228         to be succesful.
10230         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
10231         the tests generated by tests/get-them getting it input normally
10232         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
10233         (dot) before the numeric part) is reserved for all other (hand
10234         written) tests. The `+' means one or more times.
10236 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10238         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
10239         supported short man page to refer to info documentation
10240         * helptoman.pl: added
10241         * configure.in: AC_PATH_PROG(PERL,perl)
10242         * Makefile.am (SUBDIRS): doc after src
10244         * libitized with libit 0.5 from
10245         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
10247         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
10248         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
10249          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
10250         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
10251           lib/rx.{c,h}: added
10252         * configure.in (AC_CHECK_FUNC): getopt_long
10254         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
10256         * TODO: added entry about dependencies
10258 1998-08-10  René Seindal  <rene@seindal.dk>
10260         * Prerelease 1.4f
10262         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
10263         "changesyntax".
10265         * src/builtin.c (m4_changesyntax): Added builtin macro
10266         "changesyntax" to modify the syntax table.
10268         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
10269         table.  All categories are assigned a syntax code and tokens are
10270         read according to this table.
10272 1998-08-09  René Seindal  <rene@seindal.dk>
10274         * src/numb.{c,h}: New files, implements multiple precision eval
10275         using GNU gmp.  Originally submitted by John Gerard Makecki
10276         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
10278         * doc/m4.texinfo (Eval): Added documentation for multiple
10279         precision arithmetic library support.
10281         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
10282         to accommodate multiple precision eval.
10284 1998-08-07  René Seindal  <rene@seindal.dk>
10286         * src/input.c (MATCH, match_input), src/m4.h: changed definition
10287         of comment and quote strings to `unsigned int' to allow eight bit
10288         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
10290         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
10291         patch from Mike Howard <mike@clove.com>
10293 1998-08-06  René Seindal  <rene@seindal.dk>
10295         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
10296         -lintl.
10298 1998-08-03  René Seindal  <rene@seindal.dk>
10300         * Prerelease 1.4e
10302         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
10303         and _ macro.  M4 now builds with --disable-nls.
10305         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
10306         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
10308         * configure.in (ALL_LINGUAS): Added complete list of translations:
10309         de fr it ja nl ru sv.
10311 1998-05-23  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10313         * po/nl.po: Dutch translation by Erick Branderhorst.
10315         * po/fr.po: French translation by Erick Branderhorst, based on the
10316         translations by François Pinard in fr.msg and m4.cod.
10318 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
10320         * Prerelease 1.4d.
10322         * src/m4.c: #include <signal.h> not <sys/signal.h>.
10324         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10326         * checks/Makefile.am: explicit list tests in CHECKS.
10328         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10329         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10330         mkinstalldirs, install-sh: Added automake (1.3) support.
10332         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10333         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10334         Used libitize (0.4) to update.
10336         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10337         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10338         README accordingly.
10340         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10341         stack overflow functionality.
10343 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
10345         * Prerelease 1.4.1.
10347         * Makefile.in (realclean-local): Delete stamp-h.in.
10349         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10350         Localize, adapting from how it is done in sharutils.
10352         * fr.tt: New file, for French.
10354         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10355         src/freeze.c: Rename PRODUCT to PACKAGE.
10357 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
10359         * configure.in: Check for <libintl.h> and <locale.h>.
10360         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10361         src/stackovf.c: Rename _ to __P.
10362         * src/m4.h: Declare _ as a macro returning its argument, or else,
10363         include <libintl.h> and declare _ as gettext.
10364         * src/m4.c: Possibly include <locale.h> and call setlocale.
10365         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10366         src/input.c, src/macro.c, src/output.c, src/path.c,
10367         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10368         strings.
10370 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
10372         * doc/Makefile.in (stamp-vti): Use new -r option to date.
10374         * configure.in: Put --with-gmp in place, in prevision for John
10375         Gerard's work.
10376         * acconfig.h: Document WITH_GMP.
10378 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
10380         * Release 1.4.
10382         * doc/Makefile.in (realclean): Also remove stamp-vti.
10383         Reported by Eric Backus.
10385 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
10387         * src/freeze.c (produce_frozen_state): If the frozen file cannot
10388         be opened, return immediately after producing the error message.
10389         Reported by Andreas Schwab.
10391         * configure.in: Check for const only after having found possible
10392         ANSIfying compiler flags, this is of no use to check it before.
10393         Reported by Alexander Lehmann.
10395 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
10397         * src/macro.c (collect_arguments): Cast obstack arguments to
10398         (voidstar), so avoiding compiler warnings.
10399         Reported by Joseph E. Sacco.
10401         * src/freeze.c (produce_frozen_state): Cast printed lengths to
10402         (int) so they correspond to %d format items.
10403         Reported by Joseph E. Sacco.
10405         * src/m4.c (main): Cast the argument to xfree to (voidstar).
10406         * src/symtab.c (free_symbol): Idem.
10407         Reported by Karl Vogel.
10409 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
10411         * Makefile.in (DISTFILES): Distribute BACKLOG.
10413         * configure.in: Define PRODUCT and VERSION.
10414         * acconfig.h: Document PRODUCT and VERSION.
10415         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10416         constant string m4 and variable or parameter named version.
10418 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
10420         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10421         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10422         defines __STDC__ to 0, for indicating it is *not* ANSI!
10423         Reported by Kaveh R. Ghazi.
10425         * configure.in: Added obsolescent tests for AIX and Minix.
10427         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10428         which texclean does not exist anymore.
10429         Reported by Eric Backus, Jim Meyering, John David Anglin and
10430         Joseph E. Sacco.
10432 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
10434         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10435         Reported by John David Anglin.
10437         * src/ansi2knr.c: New version, sent by Peter Deutsch.
10438         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10439         ANSI2KNR, depending on the fact the compiler is ANSI or not.
10440         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10441         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
10442         of $U, put underline in extensions rather than in basenames.  Use
10443         implicit rules, now that regularity makes this possible.
10444         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10445         of ansi2knr whenever it is needed.
10446         * configure.in: Adjusted for correct STACKOVF substitution.
10447         * src/debug.c (trace_format): When not __STDC__, use (...) as a
10448         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10449         Reported by David MacKenzie.
10451         * Makefile.in: Remove binprefix.  Use transform_name instead.
10452         Reported by David MacKenzie.
10454         * doc/Makefile.in: Create version.texi, use it, clean it.
10455         Reported by Jim Meyering.
10457 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
10459         * Makefile.in (all, install, uninstall): Depend on Makefile.
10461         * Makefile.in: For actions invoking $(MAKE) from within compound
10462         sh statements, exit non-zero if the sub-make fails.  Otherwise,
10463         the top-level make may exit successfully when it should fail.
10464         Reported by Jim Kingdon.
10466         * {,/*}Makefile.in: Use && after all cd, in case they fail.
10468         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10469         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10470         * configure.in: Substitute PRODUCT and VERSION.
10472         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10474 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
10476         * Makefile.in (mostlyclean-local): Do not remove *~.
10477         * */Makefile.in (mostlyclean): Idem.
10478         Reported by Robert E. Brown and Richard Stallman.
10480 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
10482         * src/m4.h: Get rid of CONFIG_BROKETS.
10484 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
10486         * configure.in: Use AC_ARG_PROGRAM.
10487         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10488         Reported by David MacKenzie.
10490 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
10492         * configure.in: Do not add -O to CFLAGS for GNU C, now that
10493         configure does it automatically.
10494         Reported by Jim Meyering.
10496 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
10498         * src/stackovf.c: Declare the handler_t typedef earlier in the
10499         code, use it for stackovf_handler.
10500         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10501         casting sigsegv_handler.
10502         Reported by Robert Bernstein.
10504         * src/m4.c (main): Initialize program_name to argv[0] without
10505         basename'ing it.
10506         Reported by Karl Berry.
10508 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
10510         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10511         Reported by Karl Berry.
10513 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
10515         * lib/Makefile.in (mostlyclean): Added.
10516         (TAGS): Make in $(srcdir).
10518         * configure.in: Use `choke me' in test, like everywhere!
10520         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10521         unreacheable and useless.
10523         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10525         * lib/Makefile.in (DISTFILES): Distribute TAGS.
10526         (distclean): Do not remove TAGS.
10527         (realclean): Remove it.
10528         * Makefile.in: Make TAGS in lib also, not just in src.
10529         Reported by Karl Berry.
10531         * Makefile.in (distclean, realclean): Instead of recursively
10532         calling $(MAKE) for the -local part, allow parallel execution of
10533         -recursive and -local, only delay the removal of config.status,
10534         which is repeated in both goals.
10536 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
10538         * Release 1.3.
10540         * Makefile.in: Group all *clean-recursive goals in one, using sed
10541         to remove `-recursive' while calling make recursively.  Also, use
10542         a subshell for each recursive $(MAKE).
10543         Reported by Jim Meyering.
10545         * src/m4.h (memcpy): Define with bcopy for BSD systems.
10546         Reported by Kaveh R. Ghazi.
10548         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10549         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10550         specify it.
10552         * configure.in: Use date instead of touch for stamp-h.
10553         * Makefile.in (stamp-h.in): Idem.
10555         * Makefile.in (distclean, realclean): Force serial execution of
10556         both goals, in case parallel makes are being used.
10557         Reported by Jim Meyering.
10559         * src/Makefile.in (DISTFILES): Distribute TAGS.
10560         (distclean): Do not remove TAGS.
10561         (realclean): Remove it.
10562         Reported by Karl Berry.
10564 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
10566         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
10567         to old names, for following Autoconf.
10569 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
10571         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10572         ./install.sh will not be correctly referred to in sub-Makefiles.
10573         Reported by John David Anglin.
10575         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10576         Reported by Eric Backus.
10578         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10579         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10580         config.status into remaking this directory's Makefile only.
10581         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10582         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10583         Reported by Jim Meyering.
10585 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
10587         * configure.in: Correct stack overflow detection logic, taking
10588         care of systems having only incomplete implementations (like for
10589         Pyramid 9820 OSx 5.0d).
10590         Reported by Kaveh R. Ghazi.
10592         * src/Makefile.in (TAGS): Remote -t from etags call.
10594 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
10596         * lib/Makefile.in (install): Depend on all.
10598 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
10600         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
10601         Reported by Jim Meyering and John David Anglin.
10603         * Makefile.in (distclean-local): Delete config.log.
10604         Reported by Jim Meyering.
10606         Solidify frozen files with respect to -P:
10607         * src/m4.c: Have -P set prefix_all_buitins variable instead of
10608         calling a function by that name.  Declare the variable.
10609         * src/m4.h: Adjust declaration for prefix_all_buitins.
10610         * src/builtin.c (builtin_init): Merge in functionality from
10611         previous prefix_all_buitins function, while making entries in the
10612         symbol table, but not modifying the builtin description itself.
10614         * src/freeze.c (reload_frozen_state): Add a useless `break;',
10615         because *many* compilers do not accept an empty `default:'.
10616         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
10617         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
10619         * configure.in: Use AC_TYPE_SIGNAL.
10620         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
10621         Reported by Robert Bernstein.
10623         * checks/Makefile.in (check): Modify PATH so check-them will find
10624         m4 in the src directory.
10625         * Makefile.in (check): Don't.
10626         Reported by Akiko Matsushita and Jim Meyering.
10628         * src/output.c (make_room_for, output_character_helper): New
10629         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
10630         a per buffer MAXIMUM_BUFFER_SIZE.
10632         * src/output.c (output_text): New function, for optimizing the
10633         output of strings of characters.  Use it.
10635 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
10637         * doc, src: New directories reorganizing the distribution.
10638         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
10639         files.
10640         * Makefile.in: Adjusted.
10641         * configure.in: Configure new Makefiles.
10643         * m4.h: Declare STRING typedef.  Use it for comment and quote
10644         strings, adjusting all references.  (This is the rudiments of a
10645         beginning for the eventual withdrawal of NUL terminated strings.)
10646         * output.c (shipout_text): Accept a length parameter, and use it.
10647         All callers adjusted.
10649 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
10651         * m4.h: Include <unistd.h> if it exists.
10652         * stackovf.c: Don't.
10654         Clean up for current_diversion variable:
10655         * output.c: Move current_diversion from builtin.c.
10656         * m4.h: Declare current_diversion so builtin.c can access it.
10657         * output.c (output_init, make_diversion): Initialize or update
10658         current_diversion.
10659         * builtin.c (builtin_init, m4_divert): Leave current_diversion
10660         alone.
10662         Remove limit on number of diversions:
10663         * output.c: Replace ndiversion by diversions, declare it.
10664         (output_init): Allocate only diversion 0.
10665         (make_diversion): Allocate new diversions as needed.
10666         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
10667         * m4.c: Still accept -N, but do nothing with it.
10668         Reported by David MacKenzie.
10670         Freeze diversions:
10671         * output.c (freeze_diversions): New function.
10672         * m4.h: Declare freeze_diversions.
10673         * freeze.c: Document frozen file format, revise it, call
10674         freeze_diversions to add diversions to frozen format, and code to
10675         reload them properly.
10676         * m4.c: Do not undivert automatically at end when status being
10677         frozen.  Do not call builtin_init when reloading frozen state.
10679         Speed up diversion processing:
10680         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
10681         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
10682         structure and variables, cached variables out of output_diversion,
10683         reallocate_diversion_for and OUTPUT_CHARACTER.
10684         (shipout_text, make_diversion, insert_diversion): Adapted to new
10685         structures.
10686         (insert_file): Use better buffering.
10687         Reported by David MacKenzie.
10689 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
10691         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
10692         dist works from another build directory.
10694 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
10696         * symtab.c (hack_all_symbols): Use hash_table_size instead of
10697         constant HASHMAX, for -H option to work better.
10699         * builtin.c (DECLARE): Simplify by using _ ().
10701         * freeze.c: New file.
10702         * Makefile.in: Compile it, distribute it.
10703         * m4.c: Recognize, document and process --freeze-state (-F) and
10704         --reload-state (-R) options.  Pass a true flag to builtin_init
10705         only if no reloading some state.
10706         * builtin.c (define_builtin): Remove static specifier.
10707         (find_builtin_by_name): Remove static specifier.
10708         (builtin_init): Accept and obey a flag argument.
10709         * m4.h: Add declarations for freeze.c, changes for builtin.c.
10711 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
10713         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
10714         specifier.
10716         * configure.in: Implement --with-dmalloc.
10717         * acconfig.h: Document WITH_DMALLOC.
10718         * m4.h: Add code for when WITH_DMALLOC.
10720 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
10722         * m4.c (long_options): Use "error-output", the dash was missing.
10723         Reported by Akiko Matsushita.
10725 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
10727         * m4.h: Include <sys/types.h>.
10728         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
10729         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
10730         int.
10731         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
10732         as size_t, not int.
10733         * builtin.c (dump_args): Declare len as size_t, not int.
10735         * debug.c: Prototype the forward declaration of debug_set_file.
10737         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
10738         shadowing of this variable.
10739         * output.c (insert_diversion): Idem.
10741         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
10742         (input_init): Duplicate default quote and comment strings.
10743         (set_quotes): Free previous quote strings in all cases.  Duplicate
10744         even default quote strings.
10745         (set_comment): Free previous comment strings in all cases.
10746         Duplicate even default comment strings.
10748         * configure.in: Updated for Autoconf 2.0.
10749         * Makefile.in (distclean-local): Also delete config.cache.
10751         * m4.c (usage): Reorganize the --help output by topic.  Include a
10752         description for debugging flags.
10754 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
10756         * configure.in: If sigaction is available and SA_ONSTACK defined,
10757         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
10758         defined, use sigvec.  Else don't compile stackovf.c.
10759         * stackovf.c (setup_stackovf_trap): Idem.
10760         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
10761         and Simon Leinen.
10763 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
10765         * m4.c (usage): Replace printf par fputs.
10767 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
10769         * Release 1.2
10771 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
10773         * configure.in: Check for sigaction and sigvec.  Add a new delayed
10774         check for RLIMIT_STACK, combine in the checking for getrlimit.
10775         All those things are not universally available.
10776         * stackovf.c: Split setting up the trap handler and catching
10777         signals, for better taking care of various configure outcomes.
10778         * examples/stackovf.sh: Correct a typo.
10779         Reported by Eric Backus, Jim Avera and Jim Meyering.
10781 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
10783         * ansi2knr.c: New version sent by its author, Peter Deutsch.
10785 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
10787         * Makefile.in: Modify so parallel make will not try making
10788         lib/libm4.a twice simultaneously.
10789         Reported by Jim Meyering.
10791 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
10793         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
10794         error message, for when no code possibility exists.  Even if this
10795         line is completely #ifdef'ed out, it brings a syntax error.
10796         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
10798         * Makefile.in (install): Have install depend on all too, for lib
10799         to be remade as needed.
10801         * examples/stackovf.sh: Try ksh, bsh and bash for shells
10802         providing ulimit, instead of using only ksh.
10803         Reported by Jim Avera and Joseph E. Sacco.
10805 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
10807         * Makefile.in (check): Have it depend on all instead of m4.  In
10808         this way, a change in lib will be detected and processed.
10810         * builtin.c (numeric_arg): Use strtol and verify the conversion,
10811         instead of using sscanf which stops as soon as there is a
10812         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
10813         and divert(1xyzzy) were all accepted without any warning or error
10814         messages.
10815         * m4.h: Declare strtol as long if not including stdlib.h.
10816         * configure.in: Check for limits.h, and replace strtol if missing.
10817         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
10818         * lib/strtol.c: New file, from elsewhere.
10819         Reported by Andreas Schwab.
10821 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
10823         * macro.c (expand_macro): Cast value to (boolean) prior to
10824         assigning it to traced.
10825         Reported by Tom McConnell.
10827         * Makefile.in (m4): Always make all in lib first.
10828         Reported by Jim Meyering.
10830 1994-07-06  Jim Avera <jima@netcom.com>
10832         * stackovf.c: Isolated OS-dependent sections; Improved portability,
10833         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
10834         handlers), and a default error message if the fault address is not
10835         available (when neither siginfo.h nor BSD sigcontext are supported).
10836         * configure.in: Changes for stackovf.h: Check for sigcontext,
10837         sigaction, sigstack, and define rlim_t as int if necessary.
10838         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
10839         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
10840         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
10842 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
10844         * configure.in: Use AC_SET_MAKE.
10845         * Makefile.in: Use @SET_MAKE@.
10846         Reported by Jim Meyering.
10848         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
10849         Reported by Ian Taylor.
10851 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
10853         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
10854         because siginfo.h is unrelated to standard headers, and siginfo.h
10855         is already checked for.
10856         Reported by Joseph E. Sacco.
10858         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
10859         PROTOTYPES.
10860         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
10861         AC_PROTOTYPES.
10863 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
10865         * builtin.c (substitute): Use \& to represent this part of the
10866         string which was matched by the whole regexp, instead of
10867         representing the whole string.  Any usage of \0 issues a warning
10868         and acts like \&, it will disappear in some subsequent release.
10870 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
10872         * m4.c: Complete prototype for forwarded declaration of usage.
10874         * input.c (init_macro_token): Correct own reference in error
10875         message.  Previous name get_macro_func was referred to instead.
10876         (next_char):  Correct own reference in error message.  Previous
10877         name advance_input was referred to instead.
10879         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10880         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10881         and_term, not_term, logical_not_term, cmp_term, shift_term,
10882         add_term, mult_term, exp_term, unary_term, simple_term): Add
10883         prototype to forwarded declarations.  Declare parameter v1 as
10884         eval_t * instead of int *.  Same for local variable v2 in dyadic
10885         functions.  Same for result in exp_term.
10886         * builtin.c (m4_eval): Declare value as eval_t instead of int.
10887         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
10888         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
10889         (shipout_int): Cast first argument of ntoa to eval_t.
10890         Reported by Thorsten Ohl.
10892         * macro.c: Complete the prototypes of forwarded expand_macro and
10893         expand_token.
10894         Reported by Thorsten Ohl.
10896         * m4.h: Define voidstar as void * or char * depending on __STDC__.
10897         The Ultrix 3.1 compiler cannot do much with void pointers.
10899         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10900         * m4.c (xfree):  Replace void * by voidstar.
10901         Reported by Tom McConnell.
10903         * ansi2knr.1: New, from elsewhere.
10904         * Makefile.in (DISTFILES): Distribute ansi2knr.1
10906         * Makefile.in (stamp-h.in): Avoid running ./config.status if
10907         stamp-h does not exist yet.  This avoids running it a second time
10908         just after the initial ./configure.
10909         Reported by David MacKenzie and Tom McConnell.
10911         * m4.h: Replace the enum debug_info declaration with a series of
10912         #define's.  The Ultrix 3.1 compiler would otherwise need casting
10913         (int) to most references, when used in expressions.
10914         Reported by Tom McConnell.
10916 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
10918         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
10919         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
10920         calls the compiler.  Previously, FP_PROTOTYPES was only calling
10921         the preprocessor; by not being subject to CFLAGS, this was
10922         discouraging those flags asking for ANSI compilation.
10923         * acconfig.h: Document HAVE_PROTOTYPES.
10924         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
10925         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
10926         Reported by Eric Backus.
10928         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
10929         from the environment.  Default CFLAGS to -g if not set.
10930         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
10931         * lib/Makefile.in: Have CFLAGS substituted from configure.
10932         Reported by Eric Backus and Tom McConnell.
10934         * configure.in: m4_undefine changeword before using AC_ENABLE.
10936         * m4.h: Declare prototypes for error (for ANSI compilers only),
10937         prefix_all_builtins and reference_error.
10938         Reported by Tom McConnell.
10940         * input.c (set_word_regexp): Do not try to initialize the array
10941         test from a string, this does not work with non-ANSI compilers.
10942         Reported by Eric Backus.
10944         * Makefile.in (dist): Clean examples/ before saving it.
10945         (distclean-local): Also remove stamp-h.
10946         Reported by Eric Backus.
10948         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
10949         non ANSI compilers.
10950         Reported by Tom McConnell.
10952         * checks/Makefile.in (clean): Depends on mostlyclean.
10953         (mostlyclean): New goal.
10955 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
10957         * Makefile.in (DISTFILES): Distribute install.sh.
10958         * install.sh: New file, copied from elsewhere.
10959         Reported by Assar Westerlund and Kaveh R. Ghazi.
10961 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
10963         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
10964         * acconfig.h: Explain ENABLE_CHANGEWORD.
10966         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
10967         from code provided by Pete Chown]
10968         * m4.h: Add original_text field to u_t variant of union u.
10969         Declare TOKEN_DATA_FUNC macro.
10970         * builtin.c: Declare changeword.
10971         (m4_changeword): New function.
10972         * input.c: Include "regex.h", define variables with word regexps.
10973         (input_init): Initialize the word regexp.
10974         (set_word_regexp): New.
10975         (next_token): Declare local variables, use the previous code if
10976         default_word_regexp is true.  Else, match using a new code.  Save
10977         the original text.
10978         * macro.c (expand_token): Ship out original text if not a macro
10979         name.
10980         Reported by Krste Asanovic and Pete Chown.
10982         [These modifs all depend upon ENABLE_CHANGEWORD]
10983         * m4.h: Declare external user_word_regexp.
10984         * m4.c: Declare user_word_regexp, and initialize it from
10985         --word-regexp or -W, or NULL if not specified.
10986         * input.c: Use user_word_regexp if specified, instead of
10987         DEFAULT_WORD_REGEXP.
10989         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
10990         agree with it.
10992         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
10993         * checks/Makefile.in: Empty the suffix list.
10994         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
10996         * m4.c: Declare nesting_limit and initialize it to 250.
10997         Implement -LNUMBER or --nesting-limit=NUMBER to change its
10998         value.
10999         * m4.h: Declare nesting_limit as external.
11000         * macro.c (expand_macro): Stop execution whenever nesting limit
11001         is exceeded.
11002         Reported by Bengt Mertensson.
11004         * eval.c (evaluate): Diagnose excess characters in eval input.
11005         Things like `eval(08)' used to return 0 with no diagnostic.
11007         * m4.h: Capitalize first letter of all macro arguments in
11008         definitions.
11010         * m4.c: Declare warning_status, initialize it to 0.  Add new
11011         option -E, or --fatal-warnings, which sets warning_status to
11012         EXIT_FAILURE instead.
11013         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
11014         EXIT_FAILURE if not otherwise done by header files.
11015         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
11016         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
11017         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
11018         argument of all M4ERROR calls.
11019         Reported by Noah Friedman.
11021         * examples/incl-test.m4: Renamed from incl_test.m4.
11022         * examples/include.m4: Include incl-test.m4 instead of
11023         incl_test.m4.
11024         * examples/multiquotes.m4: Renamed from multi-quotes.m.
11026 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
11028         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
11029         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
11030         also tested it on a Sun Sparc workstation running SunOS 4.x.
11032         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
11033         49.format check, abusing a `union values' argument with sprintf
11034         without selecting the proper field.  Now, save the formatting type
11035         first, delaying the fetch of the corresponding argument.
11036         Reported by Joseph E. Sacco and Tom Quinn.
11038         * format.c (format): Remove const from char *fmt declaration when
11039         not HAVE_EFGCVT, because a NUL may be forced into it.
11041         * m4.h: Declare atof() when not STDC_HEADERS.
11042         Reported by Joseph E. Sacco.
11044         * Regenerate configure using Autoconf 1.11, this corrects a
11045         problem about an incorrect cpp seting on NeXT 3.1.
11046         Reported by Alexander Lehmann.
11048 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
11050         * m4.h (_): Change argument from `x' to `Args'.
11052 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
11054         * m4.h: Rename Args() to _().
11055         * m4.h: Remove extern specifier from all function declarations.
11057 1994-04-22  Jim Avera <jima@netcom.com>
11059         * stackovf.c: New file implementing stack-overflow detection.
11060         * configure.in: Check for getrlimit, sigaction.  If all of
11061         standard headers, getrlimit and sigaction, define USE_STACKOVF and
11062         substitute ${U}stackovf.o for STACKOVF.
11063         * acconfig.h: Declare USE_STACKOVF.
11064         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
11065         * m4.h: Declare setup_stackovf_trap().
11066         * m4.c: Call setup_stackovf_trap().
11067         * tests/stackovf_test.sh: New file.
11069 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
11071         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
11073         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
11075 1994-01-30  François Pinard  <pinard@iro.umontreal.ca>
11077         * m4.h: Remove definition of volatile, not used anymore.
11078         Reported by Jim Meyering and Joseph E. Sacco.
11080         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
11081         of `if ... else /* nothing */' for if macros.
11082         Reported by Jim Meyering.
11084         * builtin.c (m4_regexp): Reorganize the code for avoiding a
11085         warning from gcc about `repl' possibly used before defined.
11086         Reported by Jim Meyering.
11088         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
11089         Reported by Jim Meyering.
11091 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
11093         * m4.h: Move the conditional definition of volatile after the
11094         inclusion of system files, because they may define it first.
11096 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
11098         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
11099         get around a problem with Alpha make seeing a syntax error, there.
11100         Reported by Vern Paxson.
11102 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
11104         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
11105         Reported by Richard Stallman.
11107 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
11109         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
11110         instead of AC_HAVE_FUNCS.
11111         Reported by Noah Friedman.
11113 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
11115         * m4.c: Initialize show_help and show_version to zero.
11117         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
11118         Use them in exit() and usage() calls.
11120 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
11122         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
11123         syserr() macro.  Delete errref, add reference_error and M4ERROR.
11124         * m4.c: Replace errref, which was returning an input reference
11125         string, with reference_error, which prints it on standard error.
11126         * builtin.c, output.c: Use errno as second parameter to error,
11127         instead of using syserr() with %s.
11128         * *.c: Use M4ERROR instead of error: no more errref() with %s.
11129         Doing so, the program name appears after the input reference
11130         instead of before, which eases M-x next-error processing.
11132 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
11134         * checks/get-them: Escape braces with backslashes in patterns,
11135         because HPUX-9.01 awk needs this.
11136         Reported by Jim Meyering.
11138 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
11140         * builtin.c: Declare "FILE *popen ();".
11142         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
11143         macros, replace error_message_prefix() declaration by errref()'s.
11144         Declare xrealloc, for use in errref().
11145         * m4.c: Delete error_message_prefix() function, add errref().
11146         * *.c: Use error() systematically in place of all error macros,
11147         now that error() flushes stdout first.  Make needed adjustments.
11149         * m4.h: Remove const in sys_errlist[] declaration, it creates
11150         conflicts on SGI and Alpha.
11151         Reported by Kaveh R. Ghazi.
11153 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
11155         * m4.c: Include <getopt.h> instead of "getopt.h".
11157         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
11158         * acconfig.h: New, for documenting HAVE_EFGCVT.
11159         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
11160         use them wherever appropriate.  Also use -I. for compilations.
11161         * lib/Makefile.in: Use -I.. for compilations.
11162         * *.c: Include <config.h> or "config.h".
11164         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
11165         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
11167 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
11169         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
11171         * input.c (input_init): Initialize quote and comment strings
11172         explicitely instead of calling set_quotes and set_comment: by
11173         doing so, we ensure we do not free uninitialized variables.
11175         * checks/check-them: Reverse arguments to both diff, so the
11176         expected is on the left and the obtained on the right.
11178         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
11179         macros. Delete declarations for m4error, warning, fatal and
11180         internal_error, add declaration for error_message_prefix.
11181         * m4.c:  Delete m4error, warning, fatal and internal_error
11182         routines, add error_message_prefix routine.
11183         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
11184         warning with WARNING*, fatal with FATAL* and internal_error with
11185         INTERNAL_ERROR*.
11186         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
11187         this is not needed anymore.
11189         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
11190         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
11191         and debug_message, add declaration for debug_message_prefix.
11192         * debug.c: Remove static specifier for FILE *debug declaration.
11193         Delete debug_print and debug_message routines, add
11194         debug_message_prefix routine.
11195         * builtin.c, debug.c: Replace debug_print routine calls with
11196         DEBUG_PRINT* macro calls.
11197         * input.c, path.c: Replace debug_message routine calls with
11198         DEBUG_MESSAGE* macro calls.
11200         * m4.h: Remove inclusion of <varargs.h>.
11201         * debug.c: Include <stdarg.h> or <varargs.h>.
11202         (trace_format): Use stdarg instead of varargs if __STDC__.
11204         * configure.in: Remove checks for vfprintf and _doprnt.  These
11205         implementations use varargs tricks which are not portable enough.
11206         * lib/vfprintf.c: Deleted.
11207         * lib/_doprnt.c: Deleted.
11208         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
11209         Reported by Joel Sherrill.
11211         * path.c (add_include_directory): Use xstrdup.
11213         * builtin.c (find_builtin_by_name): Declare static.
11215         * *.[ch]: Add const to a few "char *" declarations.
11217         * configure.in: Remove commented tests for fileno() and fstat().
11218         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
11220         * debug.c (debug_flush_files): New.
11221         * m4.h: Declares it.
11222         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
11223         Reported by Nicolas Pioch.
11225 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
11227         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
11228         Reported by Joel Sherrill.
11230         * builtin.c (prefix_all_builtins): Instead of the table size, use
11231         the null entry at end for stopping the loop.  It was overwritten.
11232         Reported by Andreas Schwab and Jim Meyering.
11234         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
11235         Reported by Kaveh R. Ghazi.
11237         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
11238         Reported by Karl Vogel.
11240 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
11242         * m4.h: Do not define volatile if already defined.
11243         Reported by René Seindal.
11245         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
11247         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
11248         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
11250 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
11252         * m4.h: Define strchr and strrchr in terms of index and rindex,
11253         instead of the other way around.
11254         * builtin.c, m4.c, path.c: Use strchr instead of index.
11256         * input.c (next_char): Remove a "break;" after a "return ...;".
11257         Reported by Tom McConnell.
11259 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
11261         * Release 1.1
11263         * configure.in: Do not copy check files in the build hierarchy.
11264         * checks/check-them: Identify the m4 version being checked.  For
11265         finding m4, look in $PATH instead of in the parent directory.
11266         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
11267         * checks/Makefile.in (.all-stamp): Always create check files in
11268         the source hierarchy, not anymore in the build hierarchy.
11269         (check): cd to the source hierarchy before performing checks.
11270         Do not copy nor clean COPYING anymore, take it from `..'.
11271         Reported by Tom McConnell.
11273         * Makefile.in (Makefile): Use $(SHELL).
11274         (config.status): Use $(SHELL).  Use "config.status --recheck"
11275         instead of "configure --no-create", which is obsolete.
11276         Reported by Tom McConnell.
11278 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
11280         * m4.c (usage): Use "%s" instead of "m4" in format string.
11281         Reported by Jim Meyering.
11283         * Makefile.in: Distribute mkinstalldirs.
11284         Reported by Pierre Gaumond.
11285         Reported by Jim Meyering.
11286         Reported by Tom McConnell.
11287         Reported by Andreas Gustafsson.
11289         * checks/check-them: Renamed from checks/check_them.
11290         * checks/get-them: Renamed from checks/get_them.
11291         * checks/.all-stamp: Renamed from checks/.all_stamp.
11292         * checks/Makefile.in: Changed accordingly.
11293         Reported by Jim Meyering.
11295 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
11297         * lib/Makefile.in (dist): Correct permissions on files.
11299         * output.c: Declare tmpfile, some systems don't.
11301 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
11303         * checks/Makefile.in (dist): Correct permissions on files.
11305         * Makefile.in (dist): Ensure recursive linking for subdirectory
11306         `examples', also set read/write permissions on all its files.
11308         * mkinstalldirs: New, from elsewhere.
11309         * Makefile.in: Use it.
11311         * debug.c: Synchronize debug messages and regular output when
11312         the debug file and stdout are redirected to the same file.
11313         * configure.in: Add (commented) checks for fileno and fstat.
11314         Reported by Jim Avera.
11316         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
11317         etc., arguments, then ignore the superfluous one.  m4 used to
11318         diagnose missing arguments and return the empty string.
11319         Reported by Nick S. Kanakakorn.
11321 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
11323         * m4.c (main): At end of all input, ensure all undiverted text
11324         goes to the main output stream.
11325         Reported by Andreas Gustafsson.
11327         * m4.c (main): exit (0), instead of return 0.
11329         * m4.c: Implement -P and --prefix-builtins.
11330         * builtin.c: Delete const specifier on builtin_tab.
11331         (prefix_all_builtins): New.
11332         Reported by Noah Friedman.
11333         Reported by Scott Bartram.
11335         * c-boxes.el: New, from elsewhere.
11336         * Makefile.in: Distribute it.
11338         * m4.h: Do not define bcopy if <string.h> defines it.
11339         Reported by Stephen Perkins.
11341         * builtin.c (define_macro): Allow a missing second argument, in
11342         which case it is implied empty.  Affects define and pushdef.
11343         Reported by Eric Allman.
11345 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
11347         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11348         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11349         * builtin.c: Initialize all the blindness fields in builtin_tab.
11350         (define_builtin): Copy the blindness of a builtin into its symbol.
11351         * macro.c (expand_token): Avoid processing a blind builtin if the
11352         next character is not an opening parenthesis.
11353         Reported by David MacKenzie.
11354         Reported by Noah Friedman.
11356         * configure.in: Ensure an exit status of 0 on completion.
11357         Reported by Vivek P. Singhal.
11359         * eval.c (eval_lex): Admit both lower and upper case letters for
11360         bases greater than 10.  Only lower case letters were accepted.
11362         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11363         Reported by Krste Asanovic.
11365         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
11366         * eval.c (logical_not_term): New name for not_term.
11367         * eval.c (xor_term): New, between or_term and and_term.
11368         * eval.c (not_term): New, between and_term and logical_not_term.
11369         * eval.c (shift_term): New, between cmp_term and add_term.
11370         Reported by Krste Asanovic: ~, ^, <<, >>.
11371         Reported by Ben A. Mesander: ** vs ^.
11373         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11374         * m4.h: Delete xrealloc.c.
11375         * lib/xmalloc.c: New, from elsewhere.
11376         * lib/xstrdup.c: New, from elsewhere.
11377         * lib/Makefile.in: Distribute and compile them.
11379         * m4.c: Change progname to program_name.
11380         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11381         * lib/error.c: New, from elsewhere.
11382         * lib/Makefile.in: Distribute and compile error.c.
11383         * configure.in: Check AC_VPRINTF and for strerror.
11384         * m4.c: Delete cmd_error.  Use error instead.
11385         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11387         * m4.h: Delete #define const, let Autoconf takes care of this.
11389         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11390         Merge parse_args into main.  Declare argv to be `char *const *',
11391         then remove superfluous casts.
11393         * m4.c: Rename --no-gnu-extensions to --traditional.
11394         Reported by Ben A. Mesander.
11396         * m4.c (usage): Add a status parameter.  Supply one in various
11397         calls.  Add --help processing.  Remove -V for --version.
11399         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11401         * lib/Makefile.in: Have an AR=ar declaration.
11402         Reported by Eric Backus.
11403         Reported by Bjorn R. Bjornsson.
11404         Reported by Tom Tromey.
11405         Reported by Kristine Lund.
11406         Reported by Marion Hakanson.
11408 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
11410         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11411         Reported by Noah Friedman.
11413 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
11415         * Makefile.in: Remove MDEFINES and cleanup.
11417 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
11419         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11420         Create a gzip file.
11422 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
11424         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11425         ensure 777 mode for directories, so older tar's will restore file
11426         modes properly.
11428 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
11430         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11431         so the installer can override automatically configured choices.
11432         Reported by Karl Berry.
11434 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
11436         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
11437         previous version was not working properly on m68k-hp-bsd4.3.
11438         Reported by Roland McGrath.
11440         * lib/_doprnt.c: Stolen from Oleo distribution.
11441         * configure.in: Check for _doprnt.c if vfprintf.c selected.
11442         * lib/Makefile.in: Distribute _doprnt.c.
11443         Do not distribute regex.[ch].old anymore.
11445 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
11447         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11448         Richard wants it there.
11450 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
11452         * Makefile.in: Add DEFS to MDEFINES.
11453         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11454         (libm4.a): Remove the library before creating it.
11455         (distclean): Remove tags and TAGS too.
11457 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
11459         * Makefile.in (dvi, m4.dvi): New goals.
11461         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11462         macro.c, output.c, path.c, symtab.c: Change Copyright from
11463         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11465         * examples/divert.m4: Deleted, this bug has been corrected.
11467         * Makefile.in (texclean, mostlyclean): New goals.
11469         * Makefile.in (clean): Remove clutter from ansi2knr.
11470         Reported by Pierre Gaumond.
11472 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
11474         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
11475         might well use CFLAGS is s/he needs it.
11477         * Makefile.in: Allow installation of info files from a separate
11478         build directory.
11479         Reported by Jason Merrill.
11480         Reported by David MacKenzie.
11481         Reported by Skip Montanaro.
11482         Reported by Erez Zadok.
11483         Reported by Assar Westerlund.
11485 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
11487         * Release 1.0.3
11488         This is still a beta release for the future GNU m4 version 1.1.
11490         * lib/alloca.c: New, from elsewhere.
11491         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
11493         * m4.h: Do not define index/rindex if already defined.  If
11494         FALSE/TRUE are already defined, do not redefine them, but merely
11495         define boolean typedef to int.
11497         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11498         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11499         because some C compilers do not like connectives with #ifdef.
11500         * m4.h: Define `volatile' only if __GNUC__, instead of once for
11501         __GNUC__ and once for __STDC__.
11502         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11504         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11505         Makefile dependencies.  Without it, make keeps destroying and
11506         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
11508         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11509         to diversion/DIVERSION, this was a spelling error.
11511         * m4.c: Declare version[], remove #include "version.h".
11512         * version.h: Deleted.
11513         * Makefile.in: Remove references to version.h.
11515         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11516         production, by using a simpler and more robust algorithm.  This
11517         solves the problem of synclines sometimes written in the middle of
11518         an output line.  Delete sync_line() and output_lines variable.
11519         * m4.h: Remove sync_line prototype and output_lines declaration.
11520         * input.c (next_char), output.c (shipout_text): Remove references
11521         to output_lines.
11522         * input.c (push_file, pop_file): Merely put the value -1 in
11523         output_current_line instead of calling sync_line, for delaying a
11524         single `#line NUM FILE' before next output line.  Do not test
11525         for sync_output, because this is unnecessary clutter.
11526         * output.c (make_divertion, insert_divertion): Idem.
11527         * input.c: Rename must_advance_line to start_of_input_line, for
11528         consistency.
11530         * debug.c (trace_header): Select a new debug line format, which
11531         better complies with GNU standards for formatting error messages.
11532         With option `-dfl', M-x next-error might be used on the output.
11533         * m4.c (vmesg): Adjust format of error output to GNU standards.
11534         * m4.texinfo: Adjust examples for `make check' to work.
11536         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11537         case for enum debug_info constants, which were all lower case.
11539         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11540         re_search_2.
11541         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11542         collected patches.  I tried a few times using newer regex.[ch], it
11543         mysteriously stopped aborting with this one.  Insecure feeling...
11544         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11546 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
11548         * m4.c: Change `--no-warnings' to `--silent'.
11549         Reported by David MacKenzie.
11551         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11552         leave it off for now.  See comment in m4.c for justification.
11553         Reported by David MacKenzie.
11555         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11556         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11558         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
11560         * Makefile.in: Ensure recursive cleaning is done before local
11561         cleaning for all clean goals.
11563         * builtin.c (ntoa): Ensure the value is always interpreted as a
11564         signed quantity, whatever the radix is.
11566 1992-11-18  Jim Meyering  <meyering@idefix>
11568         * builtin.c, format.c, input.c: Split long lines.
11569         * m4.c: Use typedef macro_definition instead of struct
11570         macro_definition.
11571         * symtab.c: Use typedef symbol instead of struct symbol.
11573 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
11575         * *.[ch]: Remove all trailing whitespace, in code and comments.
11577         * configure.in: Find some awk.
11578         * Makefile.in: Add $(AWK) to MDEFINES.
11579         * checks/Makefile.in: Transmit $(AWK) to get_them.
11580         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
11581         awk script when switching files, because without this, mawk runs
11582         out of file descriptors.
11584 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
11586         * Makefile.in (realclean): Delete m4.info*.
11587         Reported by Jim Meyering.
11589         * Makefile.in: Adjust and link with checks/Makefile.
11590         * checks/Makefile.in: New.
11591         * configure.in: Output checks/Makefile.
11593         * checks/get_them: Have the dnl header of each test more
11594         recognizable by next-error, also use a better message.
11596 1992-11-16  Jim Meyering  <meyering@idefix>
11598         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
11599         And use that only if __GNUC__ since we're using it's GCC-specific
11600         semantics that tell the compiler the associated function doesn't
11601         return.
11603         * builtin.c (substitute): Don't use character as an array index.
11604         (dumpdef_cmp): Make formal arguments `const void *' to avoid
11605         warnings with gcc -W -Wall on systems with qsort prototype.
11606         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
11607         from gcc -W -Wall.
11609         * eval.c (most functions): Add parentheses to assignments used
11610         as truth values go avoid warnings from gcc -Wall.
11612         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
11613         any functions that don't need external scope.
11615         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
11616         (many functions and arrays): Declare `const'.
11618 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
11620         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
11621         removing the declaration from m4.h.  Also rename false to FALSE
11622         and true to TRUE.
11624         * lib/Makefile.in (Makefile): New goal.
11626         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
11627         so heavily loaded.  It gets more easily overridable, calling make.
11628         Reported by Jim Meyering.
11630         * Makefile.in (dist): Get .fname from the current directory name,
11631         instead of from version.h.  I need updating many files manually,
11632         when the version changes, version.h is just one of them.
11634 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
11636         * m4.h: Remove the tag `boolean' on the enum introducing typedef
11637         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
11638         Reported by Tom McConnell.
11640 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
11642         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
11643         39.cleardiv, which were describing missing or spurious newlines.
11644         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
11645         do not depend on machine word size, `/bin/false' implementation,
11646         or `wc' output format.  `make check' is more dependable, now.
11648         * checks/check_them: Summarize the failed tests by listing their
11649         name, at end.  If none, issue `All checks successful'.  Output
11650         `Checking' instead of `Input file:'.
11652         * checks/get_them, checks/check_them: Reindented.
11654         * Makefile.in (dist): chmod a+r before making the tar file.
11656 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
11658         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
11660         * input.c (next_token): Reinitialize token_buttom just after using
11661         it as a watermark with obstack_free.  Or else, a future token, big
11662         enough for triggering reallocation of the obstack chunk, could
11663         void the initialized value of token_buttom, later causing panic in
11664         obstack_free.  Rename token_buttom to token_bottom everywhere.
11666         * m4.h: Before declaring errno, first include <errno.h> and
11667         ensure that it does not define errno.
11668         Reported by Richard Stallman.
11670 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
11672         * builtin.c: Define and use DECLARE macro for builtins.
11674         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
11675         argument, this is a common idiom for introducing long comments.
11677         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
11678         arguments.  The last argument was silently ignored.
11680         * m4.c (cmd_error): Add a missing semicolon before va_end().
11682 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
11684         * Makefile.in: Now handle protoized sources.  Define and use U.
11685         Compile and use ansi2knr with old compilers.  Update DISTFILES.
11686         Add `aclocal.m4' to `configure' dependencies.
11687         * ansi2knr.c: New, from Ghostscript distribution.
11688         * configure.in: Define U through FP_PROTOTYPES for old compilers.
11689         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
11690         * aclocal.m4: New, provide FP_PROTOTYPES.
11691         * m4.h: Conditionnaly protoized through Args, save for varags.
11692         * builtin.c: Protoized.  Then:
11693         Include <sys/types.h> if size_t is not defined, before "regex.h".
11694         (m4_ifelse): Fetch built-in name properly for diagnostic.
11695         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
11696         (m4_regexp): Add const to `msg' declaration.
11697         (m4_patsubst): Add const to `msg' declaration.
11698         * debug.c: Protoized, save for varargs.
11699         * eval.c: Protoized.
11700         * format.c: Protoized.
11701         * input.c: Protoized.
11702         * m4.c: Protoized, save for varargs.  Then:
11703         (xfree): Accept void * instead of char *.
11704         (xmalloc): Return void * instead of char *.
11705         (xrealloc): Accept and return void * instead of char *.
11706         * macro.c: Protoized.
11707         * output.c: Protoized.
11708         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
11709         * symtab.c: Protoized.
11711 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
11713         * m4.texinfo: Remove directory from diagnostics in 30.include,
11714         51.eval, 56.errprint and 57.m4exit tests.
11716         * m4.h: Remove declarations for int or void system functions, they
11717         cause more conflicting trouble than they make good.
11719         * configure.in: Avoid configuration header file.  Add some tests.
11720         * m4.h: Remove #include "config.h".
11721         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
11722         Then, rewritten for better compliance with GNU standards.
11724 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
11726         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
11727         because of a misplaced #endif.
11729         * Many *.[hc] files: Correct intra-line spacing here and there,
11730         according to GNU indent 1.6 advice.
11732         * configure.in: New, using Autoconf 1.2.
11733         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
11734         * Delete old configure.in, configure, etc/configure.in,
11735         etc/configure, lib/configure.in, lib/configure and config/*.
11736         Reported by Jason Merrill.
11738         * symtab.c (hash): Change (char) NULL to '\0'.
11739         Reported by Jason Merrill.
11741         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
11742         etc/nextvers.sh.  Release numbers will be edited `by hand'.
11743         * version.h: De-automatize, force value in.
11745         * m4.c: Changes in order to use a newer getopt.h.
11746         Reported by David MacKenzie.
11748         * checks/: New name for examples/.
11749         * checks/get_them: New location for etc/get_examples.
11750         * checks/check_them: New location for etc/check_examples.
11751         * Makefile.in, checks/get_them, checks/check_them: Adjust.
11752         * lib/vfprintf.c: New location for etc/vfprintf.c.
11753         * Delete empty etc/.
11754         * examples/: New name for test/.
11756 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
11758         * Makefile.in (check): Add m4 as dependency.
11760         * m4.c: Accept --no-warnings instead of --no_warnings, and
11761         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
11762         usage message more informative.
11763         Reported by David MacKenzie.
11765 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
11767         * etc/check_examples: New name for check_examples.sh.
11768         * etc/get_examples: New name for get_examples.sh.
11769         * Makefile.in, etc/Makefile.in: Use new names.
11771         * Makefile.in: Transmit $(CC) while making in lib.
11773         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
11774         code disposition by hand.
11776 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
11778         * m4.h: Delete definitions for abort() and exit().
11779         Reported by Richard Stallman.
11781         * config/hmake-unicos, config/s-unicos.h: New files.
11782         Reported by Hal Peterson.
11784         * eval.c (exp_term): Have N^0 return 1.
11785         Reported by Michael Fetterman.
11787         * eval.c, input.c, m4.h: Remove last comma in enums.
11788         Reported by Mike Lijewski.
11790         * Transfer of maintenance duties from René to François.
11792 1991-10-24  René Seindal <seindal@diku.dk>
11794         * Release 1.0.  Many thanks to those, who provided me with bug
11795         reports and feedback.
11797         * Uses GNU configure, taken from the gdb distribution.
11799         * Uses GNU getopt(), with long option names.
11801         * The -Q/+quiet option is added, which suppresses warnings about
11802         missing or superflous arguments to built-in macros.
11804         * Added default options via the M4OPTS environment variable.
11806         * The built-in format can now be configured to use sprintf as
11807         the formatting engine, for systems without [efg]cvt(3).
11809         * GNU library code is moved to the ./lib subdirectory; other
11810         utility files are now in ./etc.
11812         * Several minor bugs have been fixed.
11814 1991-07-26  René Seindal <seindal@diku.dk>
11816         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
11817         François Pinard and Roland H. Pesch for providing me with reports.
11819         * The builtins incr and decr are now implemented without use of
11820         eval.
11822         * The builtin indir is added, to allow for indirect macro calls
11823         (allows use of "illegal" macro names).
11825         * The debugging and tracing facilities has been enhanced
11826         considerably.  See the manual for details.
11828         * The -tMACRO option is added, marks MACRO for tracing as soon
11829         as it is defined.
11831         * Builtins are traced after renaming iff they were before.
11833         * Named files can now be undiverted.
11835         * The -Nnum option can be used to increase the number of
11836         divertions available.
11838         * Calling changecom without arguments now disables all comment
11839         handling.
11841         * The function m4_patsubst() is now consistently declared
11842         static.
11844         * A bug in dnl is fixed.
11846         * A bug in the multi-character quoting code is fixed.
11848         * Several typos in the manual has been corrected.  More probably
11849         persist.
11851         * The m4.info file is now installed along with the program.
11853 1990-11-15  René Seindal <seindal@diku.dk>
11855         * Updated and enhanced version.  Release 0.75, manual 0.07.
11857         * Implemented search path for include files (-I option and
11858         M4PATH envronment variable).
11860         * Implemented builtin "format" for printf-like formatting.
11862         * Implemented builtin "regexp" for searching for regular
11863         expressions.
11865         * Implemented builtin "patsubst" for substitution with regular
11866         expressions.
11868         * Implemented builtin "esyscmd", which expands to a shell
11869         commands output.
11871         * Implemented "__file__" and "__line__" for use in error
11872         messages.
11874         * Implemented character ranges in "translit".
11876         * Implemented control over debugging output.
11878         * Implemented multi-character quotes.
11880         * Implemented multi-character comment delimiters.
11882         * Changed predefined macro "gnu" to "__gnu__".
11884         * Changed predefined macro "unix" to "__unix__", when the -G
11885         option is not used.  With -G, "unix" is still defined.
11887         * Changed "shift", "$@" and "$*" to not insert spaces afters
11888         commas.
11890         * Added program name to error messages.
11892         * Fixed two missing null bytes bugs.
11894 1990-01-22  René Seindal <seindal@diku.dk>
11896         * Initial beta release.  Release 0.50, manual 0.05.
11899         -----
11901         Local Variables:
11902         coding: utf-8
11903         End:
11905         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
11906         2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
11908         Copying and distribution of this file, with or without
11909         modification, are permitted provided the copyright notice
11910         and this notice are preserved.