Test that regression in 1.4.9's eval doesn't recur.
[m4.git] / ChangeLog
blob8aa7d17ff4ad154a16b3dee775b5f857c0341d24
1 2007-04-25  Eric Blake  <ebb9@byu.net>
3         Test that regression in 1.4.9's eval doesn't recur.
4         * doc/m4.texinfo (Eval): Check negative division.
5         * THANKS: Update.
7 2007-04-12  Eric Blake  <ebb9@byu.net>
9         Allow for running test in sticky or setgid directory.
10         * tests/builtins.at (mkdtemp): Adjust test.
12         Don't test for broken sed too soon.
13         * tests/others.at (stdin seekable): Rearrange subtests.
15         Work around 'stdin seekable' shortcoming on glibc.
16         * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
17         * tests/others.at (stdin closed): Adjust to new output.
18         * src/main.c (process_file): No need to return anything.
19         (main): Use close_stdin instead of close_stdout.
20         Reported by Ralf Wildenhues.
22         Enable autobuild usage.
23         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
24         autobuild'.
25         * configure.ac (AB_INIT): Output autobuild information.
27 2007-04-11  Eric Blake  <ebb9@byu.net>
29         Address testsuite shortcoming in 'stdout full' on glibc.
30         * tests/others.at (stdout full): Adjust expected output when more
31         than 1k text is printed to /dev/full.
32         Reported by Ralf Wildenhues.
34 2007-04-10  Eric Blake  <ebb9@byu.net>
36         * tests/macros.at (Arity and defn): Fix quoting.
38 2007-04-09  Eric Blake  <ebb9@byu.net>
40         Address failure of 'seekable stdin' on Mac OS X.
41         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
42         fflush'.
44 2007-04-07  Eric Blake  <ebb9@byu.net>
46         Include <config.h> first in all C files, and not in headers.
47         Fixes regression for --disable-assert builds from 2007-04-02.
48         * src/m4.h (includes): Don't include config.h here.
49         * m4/m4private.h (includes): Likewise.
50         * m4/builtin.c: Include config.h before anything else.
51         * m4/debug.c: Likewise.
52         * m4/hash.c: Likewise.
53         * m4/input.c: Likewise.
54         * m4/m4.c: Likewise.
55         * m4/macro.c: Likewise.
56         * m4/module.c: Likewise.
57         * m4/symtab.c: Likewise.
58         * m4/syntax.c: Likewise.
59         * m4/utility.c: Likewise.
60         * src/freeze.c: Likewise.
61         * src/stackovf.c: Likewise.
63 2007-04-03  Eric Blake  <ebb9@byu.net>
65         * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
66         SIGFPE on x86 architectures.
67         Reported by Ralf Wildenhues.
69 2007-04-02  Eric Blake  <ebb9@byu.net>
71         Fix warnings from last commit.
72         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
73         fprintf-posix sprintf-posix'.
74         * m4/macro.c (expand_macro, trace_format): Use correct specifier
75         for size_t.
76         (process_macro): Avoid negative array index.
77         * src/freeze.c (produce_resyntax_dump, produce_module_dump)
78         (dump_symbol_CB, produce_frozen_state): Use correct specifier for
79         size_t.
81 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
83         Get rid of the last 'differs in signedness' compiler warnings:
85         * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
86         a regular 'char *', so variables to store the return address,
87         and iterate through it should be regular 'char *' too.
88         * m4/input.c (m4_input_block): The start and current members of
89         the string part of this union store regular 'char *' types, so
90         they should be regular 'char *' types too.
92 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
94         M4 was designed to have a small number of header files defining
95         the interfaces to several source files each.  Keeping this in
96         mind allows us to tidy things up considerably.  Having done this,
97         it becomes clear that some of the installed headers reference
98         other headers which are not installed (but that's another patch):
100         * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
101         here...
102         * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
103         ...to here, so client modules can benefit too.
104         (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
105         lowest level to save doing it multiple times elsewhere.
106         * m4/debug.c (stdio.h): Removed.  The portable <gnu/stdio--.h>
107         is already included via m4private.h.
108         * modules/time.c (stdio.h): Ditto.
109         * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
110         * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
111         and <gnu/unistd--.h>,
112         * m4/m4private.h (m4module.h): Use angle brackets for an installed
113         file.
114         * m4/hash.h (system.h): Ditto.
115         * modules/gnu.c (progname.h): Removed.
116         * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
117         * m4/m4private.h (assert.h, errno.h): Already included via
118         m4/m4module.h.
119         * m4/input.c (ctype.h): Ditto.
120         * m4/module.c (ltdl.h): Ditto.
121         * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
122         (unistd.h): Ditto.
123         * m4/path.c (config.h, stdlib.h): Ditto.
124         * m4/utility.c (config.h): Ditto.
125         * modules/evalparse.c (assert.h, ctype.h): Ditto.
126         * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
127         * modules/import.c (assert.h): Ditto.
128         * modules/m4.c (assert.h, errno.h): Ditto.
129         * modules/modtest.c (assert.h): Ditto.
130         * modules/stdlib.c (sys/types.h): DittAo.
131         * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
132         Ditto.
133         * src/stackovf.c (assert.h): Ditto.
134         * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
135         private interfaces when NDEBUG is defined.
136         * modules/import.c (m4/m4module.h, m4private.h): Ditto.
137         * modules/load.c (m4/m4module.h, m4private.h): Ditto.
138         * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
139         * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
140         * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
141         * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
142         * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
143         * modules/time.c (m4/m4module.h, m4private.h): Ditto.
144         * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
145         * src/m4.h (locale.h): Moved from here...
146         * src/main.h: ...to here.
147         (m4private.h): Already included via m4.h.
148         * src/stackovf.c (m4private.h): Ditto.
150 2007-03-28  Gary V. Vaughan  <gary@gnu.org>
152         * Makefile.am (stamp-vcl): Removed.
153         (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
155 2007-03-28  Eric Blake  <ebb9@byu.net>
157         * src/main.c (usage): Improve note to TRANSLATORS.
158         * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
160         * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
161         empty.
163 2007-03-24  Eric Blake  <ebb9@byu.net>
165         * m4/output.c (m4_output_init): Update to latest gnulib.
166         * bootstrap (ltdl/m4/.cvsignore): No longer track generated
167         .cvsignore in CVS.
168         * NEWS: Reflect release of 1.4.9.
169         * THANKS: Update.
171 2007-03-07  Eric Blake  <ebb9@byu.net>
173         * AUTHORS: Update
175         Exercise gnulib's new POSIX *printf modules.
176         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
177         vasprintf-posix'.
178         * modules/format.c (format): Support %a and %A.
179         * doc/m4.texinfo (Format): Test this addition.
180         * NEWS: Document this addition.
182 2007-03-03  Eric Blake  <ebb9@byu.net>
184         * m4/input.c (m4__next_token): Fix synclines when in batch mode.
185         * doc/m4.texinfo (M4exit): Synch another section.
186         (Syncoutput): Make similar to other sections.
188 2007-03-01  Eric Blake  <ebb9@byu.net>
190         * doc/m4.texinfo: Improve the indices.
191         (Concept index): Rearrange to be last.
192         (Sysval): Merge from branch.
194         * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
196 2007-02-28  Eric Blake  <ebb9@byu.net>
198         POSIX XCU ERN 137 was approved.
199         * modules/mpeval.c (numb_extension): Delete.
200         * modules/m4.c (numb_extension): Likewise.
201         * modules/evalparse.c (comma_term, condition_term): Always
202         implement ?: and , operators.
203         * m4/symtab.c: Update comment to match reality.
204         * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
205         dereferencing context directly when accessor exists.
206         * src/main.c (usage): Prefer GNU_M4 over EMACS.
207         (struct macro_definition): Rename...
208         (struct deferred): ...to match usage.  All uses changed.
209         * doc/m4.texinfo (Eval): Document this change.
210         (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
211         over emacs.
212         (Preprocessor features, Changesyntax): Fix inaccuracies.
213         * NEWS: Import branch NEWS items for 1.4.x series.  Document
214         change in eval.
216         POSIX XCU ERN 118 was approved.
217         * modules/m4.c (define): Kill posixly_correct distinction in
218         define behavior, since POSIX says GNU behavior complies.
219         * tests/builtins.at (define): Restore original semantics.
220         * doc/m4.texinfo (Pushdef): Document portability issues with
221         define.
222         (Incompatibilities): Clean up wording of what POSIX requires.
223         * NEWS: Document this.
225 2007-02-26  Eric Blake  <ebb9@byu.net>
227         Re-enable clean bootstrap on cygwin.
228         * Makefile.am (AM_LDFLAGS): For now, export all symbols from
229         modules, since otherwise we run afoul of current libtool
230         limitations on cygwin and mingw.
232 2007-02-25  M. Levinson  <levinsm@users.sourceforge.net>  (tiny change)
234         * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
235         memory.  Fixes regression introduced 2007-01-20.
237 2007-02-25  Eric Blake  <ebb9@byu.net>
239         * tests/freeze.at (loading format 2): Augment test to catch
240         regression introduced on 2007-01-20.
241         * THANKS: Update.
242         Reported by M. Levinson.
244         * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
245         latest gnulib.
247 2007-02-05  Eric Blake  <ebb9@byu.net>
249         * tests/options.at (--fatal-warnings): New test.
250         * tests/others.at (stdin seekable): Exit on error.
251         * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
252         (m4_get_warnings_exit_opt): Access it.
253         * m4/m4module.h (m4_context_opt_bit_table): Access it.
254         * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
255         on -EE.
256         (m4_warn, m4_warn_at_line): Change exit status on -E, and force
257         exit on -EE.
258         * src/m4.c (usage): Document new -E behavior.
259         (main): Make -E an additive option.
260         * doc/m4.texinfo (Operation modes): Document the change.
261         Reported by Ralf Wildenhues.
263         * tests/others.at (stdin seekable): Fix bug in test.
264         * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
266         * m4/input.c (struct m4_input_block): Remove unused field traced.
268 2007-02-03  Eric Blake  <ebb9@byu.net>
269         and Bruno Haible  <bruno@clisp.org>  (tiny change)
271         * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
272         the examples.
273         Reported by Bruno Haible.
275 2007-01-31  Eric Blake  <ebb9@byu.net>
277         * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
278         failure.
280 2007-01-26  Eric Blake  <ebb9@byu.net>
282         * m4/symtab.c (includes): Adjust to latest gnulib.
283         * modules/m4.c (includes): Likewise.
285 2007-01-23  Eric Blake  <ebb9@byu.net>
287         * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
288         extension to make enough room.
289         (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
290         code in input.c special cases this category.
291         (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
292         for define(eleventh,${11}) extension.
293         * m4/syntax.c: Update comments accordingly.
294         (m4_syntax_create, m4_syntax_code): Handle { and }.
295         * m4/input.c (m4__next_token): Likewise.
296         * src/freeze.c (produce_frozen_state): Support new categories.
297         (reload_frozen_state): When loading version 1, disable syntax
298         features not present in 1.4.x.
299         * tests/freeze.at: Sort and rename existing tests.
300         (loading format 1): Ensure we don't break v1 frozen files that
301         used raw ${.
302         (loading format 2, reloading changecom, reloading changesyntax):
303         New tests.
304         * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
305         the new syntax categories.
306         (Arguments): Update the FIXME comment.
307         (M4wrap): Merge examples from branch, before worrying about fixing
308         m4wrap to obey POSIX.
309         (Using frozen files): Start merging from branch.
310         * NEWS: Update.
312 2007-01-20  Eric Blake  <ebb9@byu.net>
314         * src/freeze.c (produce_char_dump): Delete.  Replace with...
315         (produce_mem_dump): ...this new function, to encode more strings.
316         Also make the coding easier to read and slightly more compact.
317         (produce_syntax_dump): Only dump non-default syntax codes.
318         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
319         Encode non-ASCII characters in user-supplied strings.
320         (GET_STRING): Accept escape sequences in version 2.
321         * NEWS: Document this change.
322         * TODO: Update.
324 2007-01-16  Eric Blake  <ebb9@byu.net>
326         Port patch from branch for stack overflow detection on BSD/OS.
327         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
328         * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
329         ! HAVE_STACK_T_SS_SP]: Use this check.
330         Reported by Chris McGuire.
332 2007-01-15  Eric Blake  <ebb9@byu.net>
334         * tests/builtins.at (__m4_version__): New test.
335         * modules/traditional.c (m4_macro_table): Provide windows and os2
336         macros, as appropriate.  Add __traditional__ macro.
337         * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
338         not __gmp__, to match module name.
339         * modules/load.c (m4_macro_table): Name the macro __load__, not
340         __modules__, to match module name.
341         * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
342         from the branch.
343         (Standard Modules): Improve wording.
344         (Incompatibilities): Move platform macros into their own node.
345         (Load, Unload): Use actual examples.
346         * NEWS: Document this change.
347         * THANKS: Update.
349 2007-01-13  Eric Blake  <ebb9@byu.net>
351         * doc/m4.texinfo (Mpeval): Add tests.
352         * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
353         * tests/builtins.at (gmp): ...here.  Rename test to...
354         (mpeval): ...this.
355         * tests/generate.awk (new_test): Filter out mpeval tests when gmp
356         is not available.
357         * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
358         no_gnu_extensions with posixly_correct_opt, since they were set in
359         sync.
360         * m4/m4private.h (struct m4): Remove no_gnu_extensions.
361         * src/main.c (main): Update caller.
362         * src/freeze.c (reload_frozen_state): Likewise.
363         * modules/m4.c (m4wrap): Likewise.
365 2007-01-12  Eric Blake  <ebb9@byu.net>
367         * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
368         POSIX, so update the comment.
369         * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
370         approved by POSIX, so we can always have blind macros, even when
371         POSIXLY_CORRECT.
372         (Ifelse): Mention the term `blind builtin'.
374 2007-01-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
376         * doc/m4.texinfo: Fix a couple of typos.
378 2007-01-08  Eric Blake  <ebb9@byu.net>
380         * ltdl/m4/gnulib-cache.m4: Update for new year.
381         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
382         Reported by Ralf Wildenhues.
384 2007-01-06  Eric Blake  <ebb9@byu.net>
386         * m4/m4private.h (to_uchar): Move...
387         * m4/m4module.h: here, so modules can use it.
388         * src/main.c (usage, long_options): Support --posix as a synonym
389         for --traditional.
390         * modules/m4.c (numb_invert): Detect unsupported x**-y.
391         (numb_incr, numb_urshift, numb_extension): New macros.
392         (numb_obstack): Port patch from branch to support radix 1 output.
393         * modules/mpeval.c (numb_obstack): Use \ for ratios.
394         (numb_incr, numb_urshift, numb_extension): New macros.
395         (mpq2mpz): Warn rather than error.
396         * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
397         enumerators.
398         (eval_error): Rearrange, so that all ignorable errors are less
399         than SYNTAX_ERROR.
400         (eval_text, last_text): Obey C++ type safety rules.
401         (numb_pow): Change return type.
402         (exp_term): Adjust caller.
403         (m4_evaluate): Fail on bad exponent.
404         (logical_or_term, logical_and_term): Ignore failed ** in short
405         circuit.
406         (eval_lex): Fix typos when detecting <<= and >>=.  Use \ instead
407         of : for ratio.  Support >>>, ,, and ?:.  Port patch from branch
408         to parse radix 1 numbers.
409         (condition_term, comma_term): New parse functions.
410         (shift_term): Support >>>.
411         (m4_evaluate): Port patch from branch to output radix 1 numbers.
412         Warn instead of error for most parse problems.
413         * doc/m4.texinfo (Limits control, Eval): Document these changes.
414         * NEWS: Document new operators and new command line option.
416 2007-01-04  Eric Blake  <ebb9@byu.net>
418         * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
420 2007-01-03  Eric Blake  <ebb9@byu.net>
422         * doc/m4.texinfo (Format, Incr): More merges.
423         (Eval): Ensure C precedence rules are met.
424         * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
425         (not_term, logical_not_term): Delete; these are same precedence
426         as other unary operators.
427         (equality_term): New; these are lower precedence than relational
428         operators.
429         (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
430         operators for better error messages.
431         (logical_or_term, logical_and_term): Short-circuit out the error
432         of division by zero.
433         (unary_term): Allow consecutive unary operators.
434         * modules/m4.c (int2numb, numb2int): Delete; these potentially
435         truncate bits.
436         (numb_not, numb_eor, numb_ior, numb_and): Update callers.
437         * modules/mpeval.c (reduce1, reduce2): Protect macros better.
438         * NEWS: Document this change.
440 2006-12-27  Eric Blake  <ebb9@byu.net>
442         * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
443         branch.
444         * modules/m4.c (substr): Merge from branch.
446 2006-12-26  Eric Blake  <ebb9@byu.net>
448         * doc/m4.texinfo (Changesyntax): Check for regressions with
449         changesyntax(W=...).
451 2006-12-22  Eric Blake  <ebb9@byu.net>
453         * m4/m4module.h (m4_set_syntax): Change signature.
454         * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
455         warning.
456         (changesyntax): Likewise, and update caller.
457         * m4/m4private.h (m4_syntax_table): Add orig member.
458         * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
459         Don't set is_single_quotes and is_single_comments when the begin
460         character is shadowed by another syntax type.
461         (m4_syntax_create): Populate default syntax table.
462         (add_syntax_attribute): Don't lose quote assignment.
463         (remove_syntax_attribute): Only allow removing rquote or ecomm.
464         (add_syntax_set, subtract_syntax_set, set_syntax_set)
465         (reset_syntax_set): New helper routines.
466         (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
467         to default, and empty chars reverts that key to default.
468         (check_is_single_quotes, check_is_single_comments): New helper
469         routines.
470         * modules/m4.c (changecom): Merge from branch.
471         * m4/input.c (m4__next_token): Rearrange token recognition order
472         to macro, quote, comment, in order to match traditional
473         implementations.
474         * src/freeze.c (reload_frozen_state): Update caller.
475         * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
476         modifications.
477         (Changeresyntax): Revise to match style of surrounding sections
478         and add more examples.
479         (Changesyntax): Likewise, and update to new semantics.
480         * NEWS: Document this change.
482         * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
483         (M4wrap, Eval, Errprint): Fix typos.
484         (Divnum): Not necessary to redivert in example.
486 2006-12-21  Eric Blake  <ebb9@byu.net>
488         * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
489         from branch.
491 2006-12-19  Eric Blake  <ebb9@byu.net>
493         * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
494         * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
495         can track write errors without all other callers warning multiple
496         times.
497         (sysval_flush_helper): New function.
498         (dumpdef, syscmd, errprint, m4exit): Adjust callers.
499         * modules/gnu.c (esyscmd): Likewise.
500         * tests/others.at (stdout closed, stdout full): Error message
501         update.
503 2006-12-16  Eric Blake  <ebb9@byu.net>
505         * src/main.c: Fix missing include.
507         * src/main.c (main): Check for errors when closing stdin.
508         * modules/m4.c (m4exit): Missed part of previous patch: flush
509         stdin before a successful exit.
510         Reported by Ralf Wildenhues.
512 2006-12-14  Eric Blake  <ebb9@byu.net>
514         * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
515         required by POSIX.
516         * tests/others.at (stdin seekable): New test.
518 2006-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
520         * doc/m4.texinfo: Fix some typos.
522 2006-12-04  Eric Blake  <ebb9@byu.net>
524         * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
525         sections.
526         (Modules): Make style consistent.
528 2006-11-16  Eric Blake  <ebb9@byu.net>
530         * bootstrap: Relax m4 requirement, thanks to...
531         * configure.ac (Gettext support): ...this workaround to the 1.4.4
532         bug.  Undoes restriction added on 2006-11-09.
534         * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
535         diversions are now closed when not active.
536         (divert): Remove check now in the manual.
537         * tests/others.at (stderr closed): Likewise.
538         (stdout closed): Add a check.
539         * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
540         more docs with branch.
542 2006-11-14  Eric Blake  <ebb9@byu.net>
544         Remerge sparse diversion handling from branch.
545         * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
546         avltree-oset.
547         * m4/output.c (diversion_table): Change type to gl_oset_t.
548         (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
549         (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
550         (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
551         (div0, diversion_storage): New variables.
552         (diversions, equal_diversion_CB): Deleted.
553         (threshold_diversion_CB): New callback.
554         (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
555         functions.
556         (m4_tmpfile): Move cloexec action here.
558         * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
559         char.
561 2006-11-13  Eric Blake  <ebb9@byu.net>
563         Add several new command line options.
564         * src/main.c (usage): Update.
565         (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
566         --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
567         Make --regexp-syntax argument optional.
568         (main): Support new options.  Fix regression in interactive
569         behavior from Nov 8.
570         * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
571         M4_OPT_SYNC_OUTPUT_BIT.
572         * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
573         syncoutput, to match option.
574         (m4_parse_truth_arg): New prototype.
575         * m4/utility.c (m4_parse_truth_arg): Implement it.
576         * m4/output.c (m4_shipout_text): Adjust sync_output caller.
577         * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
578         m4_parse_truth_arg.
579         * doc/m4.texinfo (Operation modes, Dynamic loading features)
580         (Preprocessor features, Limits control, Debugging options)
581         (Command line files): Update documentation.
582         * tests/builtins.at (mkstemp): Simplify.
583         * tests/macros.at (Command line pushdef): New test.
584         (Command line define): Improve.
585         * tests/options.at (--traceon and --traceoff, --syncoutput): New
586         tests.
587         (POSIXLY_CORRECT): Likewise.
588         (deprecated options): Augment.
589         (--regexp-syntax): Update, now that -r takes optional arg.
590         * NEWS: Reformat.  Document new options.
592 2006-11-11  Eric Blake  <ebb9@byu.net>
594         One step closer to allowing C++ compilation - don't blindly
595         convert between char* and unsigned char*.
596         * m4/m4module.h (m4_set_syntax): Change signature.
597         * m4/m4private.h (m4_string): Use signed char.
598         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
599         (m4_get_syntax_ecomm): No longer a need to cast.
600         * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
601         Reflect this change.
602         * m4/macro.c (expand_argument): Simplify.
603         (expand_token): Use proper type.
604         * src/freeze.c (reload_frozen_state): Likewise.
605         * m4/input.c (MATCH, match_input): Likewise.
606         * modules/m4.c (translit): Likewise.
607         * modules/gnu.c (substitute): Simplify.
609         * m4/macro.c (trace_format): Use canonical type name.
610         * m4/output.c (m4_freeze_diversions): Likewise.
611         * src/freeze.c (produce_module_dump, dump_symbol_CB)
612         (produce_frozen_state): Likewise.
613         * m4/m4private.h (to_uchar): Grab from branch.
614         * m4/input.c (string_peek, string_read): Use it.
615         * m4/utility.c (skip_space): Likewise.
616         * src/main.c (main): Likewise.
617         * doc/m4.texinfo (Translit): Remerge from branch.
618         * tests/builtins.at (translit): Test 8-bit range.
619         * modules/m4.c (m4_expand_ranges): Merge from branch.
621 2006-11-09  Eric Blake  <ebb9@byu.net>
623         * bootstrap: Validate that installed M4 is powerful enough.
624         Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
626 2006-11-08  Eric Blake  <ebb9@byu.net>
628         Merge deferred handling of -D option from branch.
629         * doc/m4.texinfo (Debugging options, Preprocessor features)
630         (Dynamic loading features, Operation modes, Invoking m4):
631         Document this change.
632         * src/main.c (OPTSTRING): Specify in-order processing.
633         (process_file): New function.
634         (main): Use it to interleave files and deferred options.
635         * tests/macros.at (Command line define): New test.
636         * tests/generate.awk: Allow '@comment file' as first example
637         within a node.
638         * tests/options.at (option grouping): Update to reflect actual
639         POSIX semantics.
640         (file names): New test.
642 2006-11-07  Eric Blake  <ebb9@byu.net>
644         * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
645         for failure.
647         * tests/builtins.at (m4exit): New test; failed on cygwin before
648         this patch.
649         * m4/output.c (cleanup_tmpfile): Close files before removing
650         directory.
651         (make_room_for, m4_output_exit): Ensure that atexit handler
652         invoked from m4_error sees consistent state.
654         * doc/m4.texinfo (Errprint): Merge another doc node.
655         * tests/builtins.at (dumpdef, errprint): New tests.
656         * modules/m4.c (errprint): Merge from branch: flush before
657         printing to stderr.
659 2006-11-02  Eric Blake  <ebb9@byu.net>
661         * bootstrap: Update bootstrap requirement wording.
662         Reported by Bruno Haible.
664 2006-10-31  Eric Blake  <ebb9@byu.net>
666         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
667         strstr'.
668         * doc/m4.texinfo (Translit): Merge from branch.
669         * modules/m4.c (divert, substr): Ignore excess arguments.
670         (index, translit): Merge from branch.
671         * tests/builtins.at (translit): Add a test.
673 2006-10-30  Eric Blake  <ebb9@byu.net>
675         * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
676         checkin.
677         * m4/symtab.c (m4_get_symbol_value_module): Likewise.
679         * modules/m4.c (m4_make_temp): Make safe across libtool.
680         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
681         * configure.ac (--with-modules): Accomodate changed module
682         location when doing './configure --enable-debug'.
684 2006-10-28  Eric Blake  <ebb9@byu.net>
686         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
687         config-h.'
689 2006-10-27  Eric Blake  <ebb9@byu.net>
691         * bootstrap (gnulib): No longer a need to patch after gnulib-tool
692         --update.
693         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
694         0.16, since 0.15 is incompatible with our automake requirement.
696         * m4/macro.c (expand_argument): Fix missing initialization.
697         * m4/m4private.h (struct m4_symbol_value): Store entire
698         m4_builtin, not just the func.
699         (m4_get_symbol_value_func): Update.
700         (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
701         fast accessors.
702         * m4/m4module.h (m4_get_symbol_value_builtin)
703         (m4_get_symbol_builtin): New prototypes.
704         (m4_set_symbol_value_func): Delete, replace with...
705         (m4_set_symbol_value_builtin): New function.
706         (m4_builtin_find_by_name): Change signature.
707         * m4/symtab.c (m4_symbol_value_print): Simplify.
708         (m4_get_symbol_value_func): Update.
709         (m4_get_symbol_value_builtin): New function.
710         (m4_set_symbol_value_func): Delete, replace with...
711         (m4_set_symbol_value_builtin): New function.
712         (dump_symbol_CB) [DEBUG_SYM]: Simplify.
713         * m4/builtin.c (m4_builtin_find_by_name): Change signature.
714         * m4/input.c (struct m4_input_block): Remove unused trace member.
715         (m4_push_builtin, builtin_print, init_builtin_token): Update
716         callers.
717         * m4/module.c (install_builtin_table): Likewise.
718         * src/freeze.c (reload_frozen_state): Likewise.
719         * modules/gnu.c (builtin): Make it possible to retrieve a builtin
720         token, even after the builtin has been undefined.
721         * doc/m4.texinfo (Builtin): Document new capability.
722         * NEWS: Likewise.
724         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
725         tempname'.
726         * modules/m4.c (m4_make_temp): Use it.
727         * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
729 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
731         * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
732         files.
734 2006-10-26  Eric Blake  <ebb9@byu.net>
736         Silence -O2 -Wall -Wwrite-strings warnings.
737         * m4/m4private.h (m4_symbol_value): Const-ify text.
738         * m4/m4module.h (m4_get_symbol_value_text)
739         (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
740         (m4_set_symbol_value_placeholder): Likewise.
741         * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
742         fallout.
743         * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
744         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
745         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
746         Likewise.
747         * modules/format.c (format): Likewise.
748         * src/main.c (main): Likewise.
749         * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
750         * modules/shadow.c (shadow, test): Likewise.
751         * m4/output.c (m4_make_diversion): Don't hold on to empty
752         diversions.
753         (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
754         (m4_freeze_diversions): Likewise.  Don't use uninitialized
755         variable.
757         Convert diversions to list instead of sparse array, part 2.
758         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
759         avltree-list'.
760         * m4/output.c (m4_diversion): Add next pointer and divnum members.
761         (diversion_table): Convert to a list instead of a sparse array.
762         (free_list): Maintain free list of reclaimed diversions.
763         (equal_diversion_CB, cmp_diversion_CB): New functions.
764         (m4_output_init): Set up list.
765         (m4_output_exit): Tear down list.
766         (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
767         list iteration.
768         (m4_make_diversion): Change creation of new diversions.
769         (m4_insert_diversion_helper): New function, to avoid list
770         searches.
771         * tests/builtins.at (divert): The test now passes.
772         * NEWS: Document this improvement.
774         Convert diversions to list instead of sparse array, part 1.
775         * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
776         for length.
777         * m4/output.c (diversion, total_buffer_size, output_unused):
778         Track size in size_t.  All users changed.
779         (struct diversion): Reduce size now, to compensate for part 2.
780         (m4_make_diversion, make_room_for): Avoid malloc overflow.
781         (m4_output_exit): Fix typo in assert.
782         (m4_output_init, make_room_for, m4_make_diversion)
783         (m4_insert_diversion, m4_freeze_diversions): Adjust users of
784         struct m4_diversion to disambiguate the new union.
785         * tests/builtins.at (divert): Detect this failure.
787 2006-10-25  Eric Blake  <ebb9@byu.net>
789         * m4/m4module.h (m4_push_builtin): Add parameter.
790         * modules/m4.c (defn): Update caller.
791         * m4/input.c (file_read_init, string_read_init): No longer
792         needed.
793         (input_funcs): Change signature of read_func, all callers
794         updated.
795         (composite_peek, composite_read, composite_unget),
796         (composite_print, composite_funcs): New input type.  Not yet
797         fully utilized, but one step closer to fixing defn.
798         (m4_input_block): Make every input block track current file and
799         line.  Rename some members.  Remove unused out_line.  Add support
800         for composite input block.
801         (input_change): New flag.
802         (file_peek, file_read, file_clean, file_unget, file_print):
803         Update callers.
804         (m4_push_file, m4_push_builtin, m4_push_string_init)
805         (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
806         (m4_skip_line, pop_input): Track input block changes.
807         (m4_pop_wrapup): Avoid overflow.
808         (init_builtin_token): Handle composite input.
809         (next_char): Handle input block changes.
810         * doc/m4.texinfo (Location): Remerge from branch.
812         * src/m4.h (includes): Need <locale.h> after all; fixes
813         regression from yesterday.
815         * m4/system_.h (obstack_regrow): New macro.  Hopefully glibc will
816         accept it someday.
817         * m4/macro.c (expand_macro): Avoid referencing invalid memory.
818         Handle nesting the argc obstack.
819         (expand_token): Avoid unnecessary malloc.
820         (collect_arguments): Copy name before invalidating it.
821         (argc_stack, argv_stack): New variables.
822         (m4_macro_expand_input): Initialize argc and argv stacks once per
823         file, instead of once per macro.
825 2006-10-24  Eric Blake  <ebb9@byu.net>
827         * src/m4.h (includes): Add gettext.h, for N_.  Assume setlocale.
829 2006-10-23  Eric Blake  <ebb9@byu.net>
831         * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
832         from branch regarding stripped leading whitespace.
834         * modules/m4.c (includes): Use safe headers even when configured
835         with --enable-assert.
836         (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
837         #defined as mkstemp_safer.
839 2006-10-21  Eric Blake  <ebb9@byu.net>
841         * modules/m4.c (m4_make_temp): Change signature.
842         (maketemp, mkstemp): Update callers.
843         * modules/m4.h (m4_make_temp_func): New export.
844         * modules/gnu.c (mkdtemp): New macro.
845         * doc/m4.texinfo (Operation modes): Document interaction with
846         --safer.
847         (Mkdtemp): New node.
848         * tests/builtins.at (mkdtemp): New test.
849         (mkstemp): Check for umask effect.
850         * NEWS: Document new builtin.
852         * tests/generate.awk (normalize): Update recognition of trailing
853         spaces in tests.
854         * doc/m4.texinfo: Minor formatting fixes from branch.
855         (Foreach, Improved foreach): Merge from branch.
856         * examples/foreach.m4: Merge from branch.
857         * examples/foreachq.m4: New file from branch.
858         * examples/foreach2.m4: Likewise.
859         * examples/foreachq2.m4: Likewise.
861         * doc/m4.texinfo (titlepage): Add myself as author.
862         * src/main.c (AUTHORS): Likewise.
864 2006-10-19  Eric Blake  <ebb9@byu.net>
866         * modules/m4.c (m4_make_temp, mkstemp): New functions.
867         (maketemp): Add POSIX behavior and a warning.
868         * tests/others.at (maketemp): Move this test...
869         * tests/builtins.at (mkstemp): ...to here, and beef up.
870         * tests/options.at (--safer): Update to new warning message.
871         * doc/m4.texinfo (Mkstemp): Sync from branch.
872         (Extensions): Update maketemp behavior.
873         * NEWS: Document that maketemp now always warns.
875         * tests/generate.awk: For ease of doc-writing, simplify selection
876         of '-Ipath/to/examples' to '@comment examples'.
877         * examples/forloop.m4: Simplify.
878         * examples/forloop2.m4: New file.
879         * examples/quote.m4: New file.
880         * doc/m4.texinfo (Improved forloop): New node.
881         (Manual): Clarify use of examples directory.
882         (Shift, Forloop): Resync from branch.
883         (Include, Location): Update to new usage of examples directory.
885         * m4/system_.h (includes): Pick up <unistd.h> before checking for
886         _POSIX_VERSION.
887         (gettext_noop): Don't define here, let gettext.h do it instead.
888         * po/POTFILES.in: Update entries to reflect gnulib imports.
890 2006-10-16  Eric Blake  <ebb9@byu.net>
892         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
893         configmake'.
894         * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
895         pkglibexecdir support.
896         * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
897         worry about pathconf.h, now that gnulib does it for us.
898         (pkgmodincludedir): Simplify.
899         (pkglibexecdir): Delete, now that automake does this.
900         * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
901         * src/main.c (usage): Likewise.
902         * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
904         * doc/m4.texinfo: Port some changes from the branch.
905         (Invoking m4): Promote to a chapter, instead of a section of
906         Preliminaries.
907         (Operation modes, Dynamic loading features, Preprocessor features)
908         (Limits control Frozen state, Debugging options)
909         (Command line files): Subdivide into new sections.
910         (Cleardivert): Rename from cleardiv.
912 2006-10-14  Eric Blake  <ebb9@byu.net>
914         * tests/others.at (stdin closed): Update to match previous patch.
916         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
917         is not portable.
918         Reported by Ralf Wildenhues.
920         * modules/m4.c (undivert): Merge from branch.
921         * doc/m4.texinfo (Improved fatal_error): Fix typo.
922         (Improved exch): New node, copied from branch.
923         (Improved cleardivert): Update from branch.
924         * THANKS: Update.
926 2006-10-13  Eric Blake  <ebb9@byu.net>
928         * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
929         not config-h.in.
930         * modules/gnu.c (builtin, indir): Transparently handle builtin
931         tokens from defn.
932         * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
933         * m4/input.c (m4_pop_wrapup): Display debug message when switching
934         to wrapped text.
935         (m4_input_init): No need to use empty file any more.
936         (file_print): Display correct file name.
937         * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
938         dereference a NULL file name.
939         * m4/m4module.h (m4_pop_wrapup): New parameter.
940         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
941         prototypes.
942         * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
943         * m4/symtab.c (m4_symbol_value_groks_macro): New method.
944         * src/main.c (main): Adjust caller.
945         * tests/options.at (--debugmode): Test more output from -dV.
947 2006-10-12  Eric Blake  <ebb9@byu.net>
949         * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
951         * m4/m4private.h (m4__next_token_is_open): New prototype.
952         * m4/m4module.h (m4_push_single): Delete; push_string is an
953         adequate interface, and removing support for this simplifies the
954         input engine.
955         (m4_push_wrapup): New parameter.
956         (m4_is_syntax): Delete; m4_has_syntax is sufficient.
957         (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
958         start-quote and start-comment exclusive from other syntax
959         categories.
960         * m4/syntax.c: Likewise.
961         * m4/input.c (input_funcs): Make polymorphic without requiring
962         clients to know whether they are located at isp.  All users
963         changed.
964         (file_names): New variable.
965         (m4_input_init): Initialize it.
966         (m4_push_file): Use it.
967         (m4_input_exit): Free it after use.
968         (m4__next_token): Simplify slightly.
969         (m4__peek_token): Rename and simplify...
970         (m4__next_token_is_open): ... to this.  In particular, this
971         allows us to avoid a double ungetc, which POSIX doesn't
972         guarantee.
973         (struct m4_input_block, m4_push_single, single_peek, single_read):
974         Remove support for single characters, as the input engine now
975         guarantees we don't need it.
976         (file_unget, string_unget, m4_input_print, unget_input):
977         Strengthen assertions.
978         (file_init_funcs, file_read_init): New for file reading.
979         (string_init_funcs, string_read_init): New for wrapped text.
980         (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
981         Support wrapped text with locations.
982         (m4_skip_line): Support dnl across include file boundary.
983         (peek_char): Don't pop input when peeking.
984         (file_peek): Peek can be called at the end of the file.
985         (string_read): Don't read beyond string bounds.
986         * m4/macro.c (expand_token, collect_arguments): Update callers.
987         (expand_macro): Report errors at location of open parenthesis.
988         (expand_token, expand_argument, process_macro): Avoid negative
989         array dereferences with m4_has_syntax.
990         * m4/utility.c (skip_space): Likewise.
991         * modules/m4.c (m4wrap): Update caller.
992         * tests/builtins.at (__file__, __line__, dnl): New tests.
993         * tests/options.at (--debugmode): Normalize the output.
994         * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
995         Remerge recent changes from branch.
996         (Improved fatal_error): New node from branch.
998 2006-10-11  Eric Blake  <ebb9@byu.net>
1000         * src/main.c (usage, long_options): Add --debugmode as an alias
1001         for --debug, to match macro name.
1002         * tests/options.at (--debugmode): Rename from --debug, and test
1003         for new alias.
1004         (--discard-comments): Augment test.
1005         * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
1006         * NEWS: Likewise.
1008 2006-10-10  Eric Blake  <ebb9@byu.net>
1010         Trace improvements: debugmode(c) was always printing the last two
1011         lines paired, combine them; and show non-text expansions.
1012         * m4/macro.c (trace_prepre): Update to show what the macro will
1013         expand to.
1014         (trace_pre): No need to special-case on debugmode(c).
1015         (trace_post): Likewise.  Also, show non-text expansions.
1016         (expand_macro): Update caller.  Collecting arguments can change
1017         debug mode, so cache values beforehand.
1018         (trace_format): Remove support for unused %l%S%r, and fix support
1019         for %z to match gcc's attribute((printf)).
1020         (trace_header): Update caller.
1021         * m4/input.c (struct m4_input_block): Rename from input_block.
1022         (struct input_funcs): Add print_func member.
1023         (file_print, builtin_unget, builtin_print, string_print)
1024         (m4_input_print): New functions.
1025         (m4_push_string_finish): Change return type.
1026         (m4_push_file): Fix missing use of close parameter.
1027         * m4/debug.c (m4_debug_decode): Don't clear pending traces.
1028         * m4/m4module.h (m4_input_print): New prototype.
1029         * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
1030         to match behavior change.
1031         * tests/options.at (--debug): Likewise.
1032         * tests/macros.at (Propagation of traceon)
1033         (Propagation of --trace): Likewise.
1034         * tests/others.at (stderr closed, stdout closed, stdin closed):
1035         Likewise.
1036         * doc/m4.texinfo (Forloop): Simplify.
1037         (Trace): Update to changed behavior.
1038         (Debugmode): Document this change.
1039         * src/main.c (usage): Likewise.
1040         * NEWS: Likewise.
1042 2006-10-09  Eric Blake  <ebb9@byu.net>
1044         * m4/path.c (m4_include_env_init): Don't alter result of getenv.
1045         Reported by Ralf Wildenhues.
1047         * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
1049 2006-10-07  Eric Blake  <ebb9@byu.net>
1051         * m4/m4module.h (m4_set_exit_failure): New prototype.
1052         * m4/utility.c (m4_set_exit_failure): New function.
1053         * modules/m4.c (m4exit): Use it to avoid yet another global
1054         variable export in libm4.
1056 2006-10-06  Eric Blake  <ebb9@byu.net>
1058         * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
1059         up.
1060         * tests/others.at (stdout closed): Fix final check.
1062         Replace uses of tmpfile with clean-temp, since tmpfile is
1063         incompatible with closeout.
1064         * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
1065         exit status of m4.
1066         * tests/others.at (stderr closed): Likewise.
1067         * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
1068         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1069         clean-temp.
1070         * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
1071         (m4_tmpfile, cleanup_tmpfile): New functions.
1072         (make_room_for, m4_insert_diversion): Use clean-temp module.
1073         * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
1074         tmpfile.
1075         * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
1077         * m4/utility.c (m4_numeric_arg): Merge from branch.
1078         * modules/gnu.c (debuglen): New builtin.
1079         * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
1080         Rename --arglength to --debuglen.
1081         * tests/options.at (--arglength): Rename to --debuglen.
1082         (deprecated options): Augment test.
1083         * doc/m4.texinfo (Invoking m4): Document the name change.
1084         (Debugmode): Rename from Debug Levels.
1085         (Debugfile): Rename from Debug Output.
1086         (Debuglen): New node.
1087         * NEWS: Document these changes.
1089         * modules/m4.c (m4exit): Fix typo.  Ensure desired exit status in
1090         case closing a module exits.
1092         * modules/m4.c (m4exit): Merge from branch.
1093         * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
1095 2006-10-05  Eric Blake  <ebb9@byu.net>
1097         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1098         closeout.
1099         * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
1100         * src/main.c (main): Close stdout on exit.
1101         * m4/debug.c (set_debug_file): Check for write failure.
1102         * m4/m4.c (m4_delete): Don't mask write failure.
1103         * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
1104         macros before calling AT_CHECK.
1105         (M4_ONE_MEG_DEFN): New helper macro.
1106         * tests/others.at (stdout full): New test.
1107         (stderr closed, stdin closed, stdout closed): Augment.
1108         * tests/builtins.at (syscmd): New test.
1109         (esyscmd): Augment.
1111 2006-10-04  Eric Blake  <ebb9@byu.net>
1113         * tests/builtins.at: Alphabetize tests.
1114         * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
1115         * tests/generate.awk (new_test): Fix underquoting.
1116         * tests/others.at (maketemp): Rename from misc.
1117         (stdin closed, stdout closed, stderr closed): New tests.
1119 2006-10-03  Eric Blake  <ebb9@byu.net>
1121         Avoid all global variables in modules, so that --disable-static
1122         can work on cygwin.
1123         * examples/incl.m4: New file, from branch.
1124         * Makefile.am (dist_pkgdata_DATA): Distribute it.
1125         * doc/m4.texinfo (Location): Merge this section from branch.
1126         (Include): Update the test.
1127         * tests/generate.awk (new_test): Allow for VPATH build
1128         pre-processing of expected __program__ output.
1129         * m4/m4module.h (m4_current_diversion, m4_output_current_line):
1130         Avoid global variables.
1131         (m4_context_field_table): Add current_diversion, output_line.
1132         (m4_output_init, m4_make_diversion): Add parameter.
1133         (m4_get_program_name, m4_set_program_name): New accessors.
1134         * m4/m4private.h (m4_get_current_diversion),
1135         (m4_set_current_diversion, m4_get_output_line)
1136         (m4_set_output_line): New accessors.
1137         * m4/utility.c (m4_get_program_name, m4_set_program_name): New
1138         methods.
1139         * modules/m4.c (divnum, divert): Adjust callers.
1140         * modules/gnu.c (__program__): Likewise.
1141         * m4/output.c (m4_output_init, m4_make_diversion)
1142         (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
1143         (m4_insert_diversion): Likewise.
1144         * m4/input.c (file_clean, m4_push_file): Likewise.
1145         * src/freeze.c (reload_frozen_state): Likewise.
1146         * src/main.c (main, usage): Likewise.
1148         Partially plug memory leak when unloading gnu module.
1149         * tests/modules.at (unload gnu module): New test.
1150         * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
1151         (m4_regexp_compile): Move static storage to module visibility.
1152         * tests/options.at (--debug): Adjust to new output.
1154 2006-09-29  Eric Blake  <ebb9@byu.net>
1156         Even when not the first option, --help can't have side effects.
1157         * tests/options.at (--debugfile): Detect bugs in this area.
1158         * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
1159         stderr.
1160         * src/main.c (main): Fix it by deferring debugfile change.  Also,
1161         defer closing streams until after module tracing is done.
1162         * modules/gnu.c (debugfile): Make message consistent with command
1163         line.
1164         * doc/m4.texinfo (Invoking m4): Touch up the documentation.
1165         * NEWS: Document this fix.
1167         * modules/m4.c (dnl): Include macro name in warning message.
1168         * m4/input.c (m4_skip_line): Add parameter.
1169         * m4/m4module.h (m4_skip_line): Likewise.
1170         * src/main.c (usage): Update wording.
1171         * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
1172         issue of blind macros vs. POSIX is resolved.
1173         (Dnl): Merge another node from branch.
1175         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1176         xstrtol.
1177         * m4/system_.h (N_): Define.
1178         * src/main.c (main): Validate numeric arguments.
1179         (size_opt): New function, idea borrowed from coreutils.
1180         * m4/macro.c (expand_macro): -L0 implies no limit.
1181         * doc/m4.texinfo (Invoking m4): Document this change.
1182         * NEWS: Likewise.
1183         * tests/options.at: (--arglength, --nesting-limit)
1184         (--regexp-syntax): New tests of argument validation.
1186 2006-09-28  Eric Blake  <ebb9@byu.net>
1188         * tests/options.at: Alphabetize the tests.
1190 2006-09-27  Eric Blake  <ebb9@byu.net>
1192         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
1193         another parameter to print module info.
1194         * m4/macro.c (trace_pre): Adjust caller.
1195         * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
1196         * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
1197         * NEWS: Document this.
1199         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1200         strnlen.
1201         * m4/symtab.c (symbol_value_print): Rename to...
1202         (m4_symbol_value_print): ...this, and...
1203         (m4_symbol_print): Update to allow -L length truncation.  Now
1204         truncation also affects dumpdef output and builtin names.
1205         * m4/m4private.h (nesting_limit, max_debug_argument_length):
1206         Switch to size_t.
1207         * m4/m4module.h (m4_symbol_print): Add parameter.
1208         (m4_symbol_value_print): New function.
1209         * modules/m4.c (dumpdef): Allow length truncation.
1210         * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
1211         repeating code.
1212         * doc/m4.texinfo (Invoking m4): Document -l better.
1213         (Dumpdef, Debug Levels): Document the effect of -l.
1214         * NEWS: Document this change.
1216         * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
1217         (m4_expand_ranges): Ensure we aren't picking up partial object on
1218         obstack.
1219         * modules/stdlib.c (setenv): Allow extra arguments.
1220         * modules/time.c (ctime): Avoid side effect in call to
1221         obstack_grow.
1222         * modules/gnu.c (m4_regexp_substitute): Likewise.
1223         (renamesyms): Avoid extra obstack_init.
1224         * src/freeze.c (reload_frozen_state): Remove debug comment.
1225         (produce_frozen_state): Simplify fprintf to puts where possible.
1226         * modules/modtest.c (modtest_init, modtest_finish): Likewise.
1227         * modules/import.c (import, symbol_fail, modules_fail): Likewise.
1228         * m4/macro.c (trace_flush): Likewise.
1229         * m4/debug.c (m4_debug_message_prefix): Likewise.
1230         * m4/path.c (include_dump): Likewise.
1231         * m4/module.c (module_remove): Likewise.
1232         (install_builtin_table): Simplify malloc and string
1233         concatenation.
1235 2006-09-26  Eric Blake  <ebb9@byu.net>
1237         * m4/m4module.h (m4_symbol_print): New prototype.
1238         (M4_DEBUG_TRACE_STACK): New enumerator.
1239         (m4_is_debug_bit): Allow use without requiring m4private.h.
1240         * m4/symtab.c (symbol_value_print, m4_symbol_print): New
1241         functions.
1242         * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
1243         callback.
1244         (dumpdef): Allow printing pushdef'd stacks.
1245         * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
1246         * src/main.c (usage): Document it.
1247         * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
1248         * NEWS: Likewise.
1250         * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
1251         gnulib headers.
1252         * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
1253         of lines during make.
1254         (AM_CPPFLAGS): Remove unneeded include path.
1255         (src_m4_CPPFLAGS): Remove redundant include path.
1256         * m4/system_.h Make preprocessor indentation consistent.
1257         (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
1258         macros.
1259         (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
1260         branch.
1261         (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
1262         (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
1263         (bool, true, false): Don't undefine here; stdbool takes care of
1264         that.
1265         * src/m4.h (includes): Assume config.h, and several standard
1266         headers.
1267         (__CYGWIN__, WIN32): Don't define here; let system.h do it.
1268         * m4/m4private.h: Assume config.h.
1269         * m4/output.c: Likewise.
1270         * m4/path.c: Likewise.
1271         * m4/resyntax.c: Likewise.
1272         * m4/utility.c: Likewise.
1273         * modules/gnu.c: Likewise.
1274         * modules/import.c: Likewise.
1275         * modules/load.c: Likewise.
1276         * modules/m4.c: Likewise.
1277         * modules/modtest.c: Likewise.
1278         * modules/mpeval.c: Likewise.
1279         * modules/perl.c: Likewise.
1280         * modules/shadow.c: Likewise.
1281         * modules/stdlib.c: Likewise.
1282         * modules/time.c: Likewise.
1283         * modules/traditional.c: Likewise.
1285 2006-09-21  Eric Blake  <ebb9@byu.net>
1287         * doc/m4.texinfo (Invoking m4): Add clarification on option
1288         processing behavior.
1289         * tests/options.at (option grouping): Test this.
1290         * THANKS: Update.
1291         Reported by Mikhail Teterin.
1293         * bootstrap: Add --force option, based on idea from coreutils.
1294         * README: Document that ./bootstrap and autoreconf are for
1295         developers, and not lightly done in tarballs.
1297 2006-09-20  Eric Blake  <ebb9@byu.net>
1299         * src/main.c (usage, OPTSTRING, main): Rename -e to -i.  Make
1300         warnings consistent.
1301         (long_options, HASHSIZE_OPTION): Warn on -H.
1302         * doc/m4.texinfo (Invoking m4): Document this.
1303         * tests/options.at (deprecated options): Update.
1305         Change the default of interactive sessions to match sh.
1306         * src/main.c (usage): Document this.
1307         (enum interactive_choice): New enum.
1308         (main): Use it to defer decision of interactive until after
1309         argument processing.
1310         * doc/m4.texinfo (Invoking m4): Document this.
1311         * NEWS: Likewise, plus add missing mention of -b.
1312         Reported by Stepan Kasal.
1314 2006-09-19  Eric Blake  <ebb9@byu.net>
1316         * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
1317         well as --error-output; the goal is to add -o/--output in some
1318         future version with semantics like gcc or autom4te.
1319         * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
1320         (Extensions): Reflect this update.
1321         (Renamesyms): Add another test.
1322         (Defn): Xfail for now, so that `make check' is happy.
1323         * NEWS: Document this change.
1324         * tests/generate.awk: Mark dynamic loading tests as such.  Allow
1325         xfailing tests.
1326         * tests/macros.at (Renamesyms collisions): New test, exposing
1327         renamesyms' coredump.
1328         * tests/options.at (--debugfile, --safer): Update to match
1329         change.
1331         * m4/debug.c (set_debug_file): Fix regression in -o when stdout
1332         and stderr are same file, introduced 2003-07-23.
1333         * tests/options.at (--debugfile): New test, to catch the bug.
1334         (deprecated options): Test --error-output.
1335         * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
1336         Deprecate --error-output, and replace it with --debugfile.
1337         * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
1338         Document this change.
1339         * NEWS: Likewise.
1341 2006-09-18  Eric Blake  <ebb9@byu.net>
1343         * modules/load.c (modules): Rename to...
1344         (m4modules): ...this, since it is an English word with 0
1345         arguments.
1346         * modules/gnu.c (symbols, m4symbols): Likewise.
1347         * doc/m4.texinfo (Listing Modules): Rename to...
1348         (M4modules): ...this.
1349         (Symbols): Rename to...
1350         (M4symbols): ...this.
1351         (Load, Foreach, Trace, Answers): Update to new spellings.
1352         * NEWS: Document this.
1354         * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
1355         such that without arguments, the global trace flag is changed
1356         rather than walking the table of all currently-defined macros.
1357         (set_trace_CB): No longer needed.
1358         * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
1359         (m4_set_symbol_traced): Delete.
1360         (m4_symtab_create): Nuke the nuke parameter.
1361         * m4/m4private.h (m4_get_symbol_value): Delete.
1362         * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
1363         (m4_set_symbol_name_traced): Free undefined entries that are no
1364         longer traced.
1365         (symbol_destroy_CB): Update caller.
1366         * m4/m4.c (m4_create): Update caller.
1367         * src/main.c (main): Likewise.
1368         (usage): Fix typo in last commit.
1369         * doc/m4.texinfo: Minor cleanups throughout.
1370         (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
1371         more nodes from branch.
1372         (Trace): Document new semantics, and how to simulate the old.
1373         * tests/builtins.at (multiquotes): Adjust to new semantics.
1374         * NEWS: Update somewhat.
1376 2006-09-14  Eric Blake  <ebb9@byu.net>
1378         Add --safer option, per debian bug 5898.
1379         * src/main.c (usage): Document new option.
1380         (SAFER_OPTION): New enumerator.
1381         (main): Set the option bit.
1382         * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
1383         accessors.
1384         * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
1385         (m4_get_safer_opt): New accessor.
1386         * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
1387         * modules/m4.c (syscmd, maketemp): Likewise.
1388         * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
1389         (Sysval, Maketemp): Add tests of this.
1390         * tests/options.at (--safer): Likewise.
1392 2006-09-13  Eric Blake  <ebb9@byu.net>
1394         * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
1395         stderr filtering.
1396         Reported by Ralf Wildenhues.
1398         Fix installcheck.
1399         * Makefile.am (check_LTLIBRARIES): Build test libraries in the
1400         tests directory, so we can be sure an installed build is not
1401         picking up uninstalled non-test libraries.
1402         (check-local, installcheck-local): Depend on test libraries.
1403         * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
1404         after file name.  Fix quoting.  Remove skipping the test, now
1405         that makefile guarantees test modules will exist.
1406         (Freezing modules, modules: shadow, modules: unload)
1407         (modules: trace): Always put test modules in module path.
1408         (modules: importing): Likewise, and rely on AT_CHECK_M4 for
1409         stderr munging.
1410         * src/main.c (usage): Document default module search path.
1411         (import_environment, frozen_file_to_read, frozen_file_to_write):
1412         Move...
1413         (main): ...here.
1414         * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
1415         * tests/m4.in: ...not here.
1416         Reported by Ralf Wildenhues.
1418 2006-09-08  Eric Blake  <ebb9@byu.net>
1420         * bootstrap: Kill unrelated copy-n-paste code from argument
1421         parsing.  Let Makefile generate testsuite.
1422         * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
1424 2006-09-07  Eric Blake  <ebb9@byu.net>
1426         * m4/m4module.h (m4_peek_input): No longer export.
1427         (m4_error_at_line, m4_warn_at_line): New prototypes.
1428         (m4_is_symbol_void): New macro.
1429         (m4_push_file): Update prototype.
1430         * m4/m4private.h (m4__peek_token): New prototype.
1431         (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
1432         * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
1433         * src/main.c (main): Allow reading from stdin twice.
1434         * modules/m4.c (include): Adjust to new prototype.
1435         * m4/input.c: General comment cleanup.
1436         (file_peek, file_read, file_unget, push_file): Set end flag on
1437         EOF, so that we don't call getc twice.
1438         (push_file, file_clean): Port fix from branch to avoid closing
1439         stdin prematurely.
1440         (pop_input): Port fix from branch to avoid reading free'd memory
1441         when input ends mid-string.
1442         (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
1443         (string_peek, string_read): Always use unsigned char.
1444         (m4_skip_line): Warn when dnl cut short by EOF.
1445         (peek_input): Rename from m4_peek_input.
1446         (match_input): Update signature, to distinguish between `(' token
1447         and multi-char quote or comment beginning with `('.
1448         (m4_input_exit): Cleanup now done in m4_pop_wrapup.
1449         (m4__peek_token): New function, ported from branch.
1450         (m4__next_token): Update to new token types.
1451         * m4/macro.c (expand_token, expand_argument): Use peek_token.
1452         * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
1453         (Invoking m4): Remerge from branch.
1455         * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
1456         (check-local): and put dependency here.
1457         Reported by Ralf Wildenhues.
1459 2006-09-05  Eric Blake  <ebb9@byu.net>
1461         * m4/m4module.h (m4_debug_message): New prototype.
1462         (M4_DEBUG_TRACE_MODULE): New debug bit.
1463         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
1464         (M4_DEBUG_MESSAGE2): Delete these macros.
1465         * m4/debug.c (m4_debug_message): New method.
1466         (m4_debug_decode): Add module tracing as flag `m'.
1467         * m4/input.c (m4_push_file, file_clean): Use new method.
1468         * m4/path.c (m4_path_search): Likewise.
1469         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
1470         * m4/module.c (install_builtin_table, install_macro_table)
1471         (m4__module_open, module_close, module_remove): Promote several
1472         module debug messages outside of DEBUG_MODULES.
1473         (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
1474         DEBUG_MODULES with normal trace output.
1475         * src/main.c (usage): Document new flag.
1476         * doc/m4.texinfo (Debug Levels): Likewise.
1477         * Makefile.am ($(TESTSUITE)): Add missing dependency.
1478         * tests/m4.in: Neutralize platform-dependent module filenames.
1479         * tests/options.at (--debug): Update expected output.
1481 2006-09-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1483         * doc/m4.texinfo: Fix some typos.
1484         * tests/others.at: Likewise.
1486 2006-09-05  Eric Blake  <ebb9@byu.net>
1488         * m4/input.c (lex_debug): Remove dead code that broke compilation
1489         with --enable-debug.
1490         * m4/module.c (install_builtin_table, install_macro_table)
1491         (m4__module_init, m4__module_open, module_close)
1492         (module_remove): Fix compilation when --enable-debug.
1493         * m4/output.c (m4_shipout_text): Likewise.
1494         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
1495         libraries when --enable-debug.
1496         * configure.ac (DYNAMIC_MODULES): New variable, to pass
1497         information to testsuite.
1498         (modules to preload): Determine modules after we know whether
1499         shared libraries are supported.
1500         * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
1501         testsuite.
1502         * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
1503         * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
1504         (modules: shadow, modules: unload, modules: importing)
1505         (modules: trace): Use new macro.
1506         * tests/builtins.at (gmp): Likewise.
1508         * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
1509         All users updated.
1510         (expand_token): Avoid assertion just added to docs.
1511         (expand_macro): Track pending expansions, for when a symbol's
1512         definition changes during argument collection.
1513         (m4_macro_call, process_macro): Operate on symbol value, not
1514         symbol, since symbol may have changed during argument collection.
1515         * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
1516         (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
1517         (m4_get_symbol_value): Add fast macro version.
1518         * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
1519         (m4_macro_call): Adjust prototype.
1520         * m4/module.c (install_builtin_table): Check that flags are valid
1521         when creating builtin.
1522         * m4/symtab.c (m4__symtab_remove_module_references): Use
1523         m4_symbol_value_delete, rather than inlining it.
1524         (m4_symbol_value_copy): Copy placeholder text.
1525         (symbol_popval): Use m4_symbol_value_delete.
1526         (m4_symbol_value_delete): Implementation was missing when NDEBUG.
1527         Handle pending expansions.
1528         * modules/gnu.c (indir): Update to new prototype.
1529         * doc/m4.texinfo: Fix menus to be consistent with section names.
1530         (Defn): Add test that macro tokens flatten to empty string;
1531         triggered an assert before this patch.
1532         (Ifelse): Merge another node.
1533         (Loops): Split into...
1534         (Forloop, Foreach): New nodes; work is still underway on them.
1535         (Answers): Add more info on foreach macro; work is still underway.
1536         (Indir): Add test that indir collects arguments before looking up
1537         macro.
1538         * TODO: Update based on this patch.
1540 2006-09-01  Eric Blake  <ebb9@byu.net>
1542         * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
1543         * m4/hash.h (m4_free_hash_iterator): New prototype.
1544         * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
1545         ensure we don't do unsafe things while iterating.
1546         (HASH_ITER, ITER_CHAIN): New accessor macros.
1547         (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
1548         (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
1549         (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
1550         (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
1551         to catch unsafe actions.
1552         (m4_free_hash_iterator): New function, to avoid memory leaks, and
1553         when debugging, to track safe actions.
1554         (m4_hash_apply): Avoid memory leak.
1555         * m4/symtab.c (m4_symtab_apply): Likewise.
1556         * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
1557         in manually to src/ for now.
1558         * tests/builtins.at (gmp): Add keyword module.
1559         * tests/modules.at (Freezing modules, modules: shadow)
1560         (modules: unload, modules: importing, modules: trace): Likewise.
1562 2006-08-30  Eric Blake  <ebb9@byu.net>
1564         * m4/utility.c (m4_warn): Factor "Warning" out of messages into
1565         here.
1566         (m4_bad_argc, m4_numeric_arg): Update all callers.
1567         * m4/macro.c (m4_macro_call): Likewise.
1568         * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
1569         (Indir, Builtin, Ifdef): More doc merges.
1570         (Loops): Mention that documenting foreach would be nice.
1571         (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
1572         (Include, Eval, Location, M4exit): s/input.m4/stdin/.
1573         * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
1574         (substitute, syncoutput): Update all m4_warn callers.
1575         * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
1576         (traceon, traceoff): Make warning message consistent.
1577         (define, pushdef): Update all m4_warn callers.
1578         * tests/generate.awk: Choose file name so that documentation can
1579         show command-line behavior.
1580         * tests/builtins.at (define): Update to new wording.
1581         * tests/macros.at (pushdef/popdef): Likewise.
1582         * tests/freeze.at (loading format 1): Likewise.
1583         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
1585         * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
1586         the branch.
1587         (Defn): Add failing test case for mixing text and builtin.
1588         (Renamesyms): Improve wording, and identify core dump that needs
1589         fixing.
1591 2006-08-29  Eric Blake  <ebb9@byu.net>
1593         * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
1594         (Arguments, Pseudo Arguments): More doc merges from the branch.
1595         (Macro expansion): Turn example into test.
1596         (Pseudo Arguments): Add example of avoiding argument.
1597         * modules/m4.c (undefine, popdef): Accept multiple arguments.
1598         (define, pushdef): Warn on non-text macro name.
1599         (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
1600         warning/error messages.
1601         (ifdef): Ignore extra arguments.
1602         * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
1603         (m4__symtab_remove_module_references): Check that there is no leak.
1604         * tests/macros.at (pushdef/popdef): Update to new message.
1605         * tests/builtins.at (define): Likewise.
1606         * tests/freeze.at (loading format 1): Likewise.
1607         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
1609         * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
1610         (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
1611         as accessor function, to avoid compiler warning.
1612         * m4/module.c (m4__module_open): Move declaration of variable to
1613         avoid compiler warning.
1614         * src/main.c (main): Avoid shadowing a global variable.
1615         * src/freeze.c (produce_symbol_dump): Avoid unused variable
1616         warning when NDEBUG.
1617         * tests/options.at (--discard-comments, --import-environment)
1618         (--debug, --prepend-include, --help and --version): Rename tests
1619         to name option tested.
1621 2006-08-28  Eric Blake  <ebb9@byu.net>
1623         * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
1624         * m4/module.c (install_builtin_table): ...to here, and add
1625         assertion that blind macros require arguments.
1626         * m4/m4module.h (struct m4_builtin): Document restrictions that
1627         must be met during module loading.
1628         * modules/gnu.c (changeresyntax, changesyntax): These are blind,
1629         so require an argument to avoid triggering assertion.
1630         (debugfile): Tweak error message.
1632 2006-08-25  Eric Blake  <ebb9@byu.net>
1634         * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
1635         (M4_BUILTIN_SIDE_EFFECT): New enumerators.
1636         (struct m4_builtin): New member flags replaces groks_macro_args,
1637         blind_if_no_args.  min_args and max_args are now 0-based.
1638         Rearrange members to reduce size on platforms where function
1639         pointers are 64 bits but regular pointers are 32.
1640         (m4_bad_argc): Add argument.
1641         * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
1642         * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
1643         effect into account.
1644         * m4/module.c (install_builtin_table): Adjust all users affected
1645         by this API change.
1646         * m4/macro.c (m4_macro_call): Likewise.
1647         * src/freeze.c (reload_frozen_state): Likewise.
1648         * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
1649         * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
1650         * modules/import.c (builtin_functions): Likewise.
1651         * modules/load.c (builtin_functions): Likewise.
1652         * modules/modtest.c (builtin_functions): Likewise.
1653         * modules/mpeval.c (builtin_functions): Likewise.
1654         * modules/perl.c (builtin_functions): Likewise.
1655         * modules/shadow.c (builtin_functions): Likewise.
1656         * modules/stdlib.c (builtin_functions): Likewise.
1657         * modules/time.c (builtin_functions, mktime_functions)
1658         (strftime_functions): Likewise.
1659         * doc/m4.texinfo (Loops): Update test now that shift is blind.
1660         (Macro Arguments): Fix typo in test.
1661         (Patsubst): Fix typo in test.
1662         * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
1663         end of string.  Fix return value when ignore_duplicates.
1664         * tests/builtins.at (patsubst): Fix typo in test.
1666         * tests/options.at (debug-flags): Update to reflect new message.
1667         (deprecated options, prepend-include, help and version): New
1668         tests.
1669         * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
1670         test omits an input file name.
1671         * src/main.c (long_options, main): Add -B/--prepend-include.
1672         (usage): Document it.
1673         (main): `m4 --help --version' now displays help, not version.
1674         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1675         dirname filenamecat.
1676         * m4/m4module.h (m4_add_include_directory): Add parameter.
1677         * m4/m4private.h (m4__include_init): New prototype.
1678         * m4/m4.c (m4_create): Put `.' on path before options are
1679         collected.
1680         * m4/path.c (includes): Assume C89.  Use gnulib for file name
1681         management.
1682         (m4__include_init): New function.
1683         (search_path_add): Allow prepending.
1684         (m4_add_include_directory, search_path_env_init): Adjust callers.
1685         (m4_path_search): Relative names now invoke path search, since
1686         `.' might not be first.
1687         * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
1689 2006-08-25  Bruno Haible  <bruno@clisp.org>  (tiny change)
1690         and Eric Blake  <ebb9@byu.net>
1692         * bootstrap: Run autopoint before gnulib-tool, since autopoint
1693         0.15 installs macros obsoleted by current gnulib.
1695 2006-08-25  Eric Blake  <ebb9@byu.net>
1697         * doc/m4.texinfo (Macro Arguments): Another section merged;
1698         testsuite failures now exposed.
1700 2006-08-23  Eric Blake  <ebb9@byu.net>
1702         * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
1703         (Input processing): More doc merges from the branch.
1704         (Regular expression syntax): Add introductory text.
1705         (Inhibiting Invocation): More doc merges from the branch.
1706         (Other tokens): Reorder after comments.
1707         * tests/generate.awk: Allow passing options to doc examples.
1709 2006-08-22  Eric Blake  <ebb9@byu.net>
1711         * tests/options.at (debug-flags): New test.
1712         * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
1713         not negative, to distinguish failure in m4_debug_decode.
1714         (m4_debug_decode): Add new parameter.
1715         * modules/gnu.c (regexp): Slight cleanup.
1716         (renamesyms): Ignore excess arguments.
1717         (syncoutput): Make case-insensitive, warn on bad argument.
1718         (debugmode): Factor -+ handling out to...
1719         * m4/debug.c (m4_debug_decode): ...here.
1720         (m4_debug_message_prefix): Fix spacing.
1721         * src/main.c (main): Let -d option adjust flags.
1722         * m4/input.c (file_clean): Avoid printing empty file name.
1723         * doc/m4.texinfo (Syncoutput): Document new range of input.
1724         (Invoking m4): Document use of multiple -d flags.
1726         Start porting various fixes from the branch that use gnulib.
1727         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1728         binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
1729         regexprops-generic stdlib-safer unlocked-io.
1730         * m4/debug.c (m4_debug_set_output): Close debug file on exec.
1731         * m4/path.c (m4_path_search): Close input file on exec, reject
1732         empty file name, fix parameter naming.
1733         * m4/output.c (make_room_for): Close diversion file on exec.
1734         (includes): Assume C89 headers.
1735         (tmpfile): For now, we don't want tmpfile-safer, because we want
1736         clean-temp later.
1737         * m4/m4private.h (includes): Use various gnulib headers.
1738         * doc/regexprops-generic.texi: Use gnulib's copy.
1740         * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
1741         * AUTHORS: Add copyright.
1742         * ChangeLog: Likewise.
1743         * README: Likewise.  Require automake 1.9b or later.
1744         * HACKING: New file.
1745         * README-alpha: Add copyright.
1746         * THANKS: Likewise.  Update.
1747         * doc/STYLE: Add copyright, and tweak for changed directories.
1748         * modules/README: Add copyright, and tweak for libtool version.
1749         * examples/COPYING: New file.
1750         * examples/WWW/COPYING: Likewise.
1751         * examples/WWW/m4lib/COPYING: Likewise.
1752         * modules/shadow.m4: Add copyright.
1753         * modules/perl.m4: Likewise.
1754         * modules/modtest.m4: Likewise.
1755         * modules/stdlib.m4: Likewise.
1756         * modules/time.m4: Likewise.
1757         * modules/time2.m4: Likewise.
1758         * po/Makevars: Likewise.
1759         * tests/iso8859.m4: Likewise.
1760         * tests/m4.in: Likewise.
1761         * NEWS: Add (C) to copyright.
1762         * TODO: Likewise.
1763         * m4/system_.h: Likewise.
1764         * tests/atlocal.in: Likewise.
1765         * tests/builtins.at: Likewise.
1766         * tests/freeze.at: Likewise.
1767         * tests/generate.awk: Likewise.
1768         * tests/macros.at: Likewise.
1769         * tests/modules.at: Likewise.
1770         * tests/options.at: Likewise.
1771         * tests/others.at: Likewise.
1772         * tests/testsuite.at: Likewise.
1773         * m4/utility.c: Spell out copyright years.
1774         * src/main.c: Likewise.
1776         * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
1778 2006-08-21  Eric Blake  <ebb9@byu.net>
1780         * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
1781         * modules/gnu.c (esyscmd): Use -1 for failure.  Set sysval to 0
1782         when no arguments are given, but without losing warning about 0
1783         arguments.
1784         * modules/m4.c (syscmd): Likewise.
1785         (includes): Assume C89.
1786         (m4_sysval): Make static.
1787         (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
1788         (sysval): Port calculation from branch.
1790 2006-08-20  Eric Blake  <ebb9@byu.net>
1792         * m4/macro.c (expand_macro): Move argument check...
1793         (m4_macro_call): ...to here, so indir will warn.
1794         * modules/gnu.c (__program__): New macro, ported from branch.
1795         (builtin): Perform argument check.
1796         (changesyntax): Avoid out-of-bounds read.
1798         * modules/gnu.c (includes): Assume stdlib.h, errno.
1799         (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
1800         (substitute): Add caller parameter, avoid out-of-bounds memory
1801         references.
1802         (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
1803         callers.
1805 2006-08-16  Eric Blake  <ebb9@byu.net>
1807         * po/POTFILES.in: Add more files that contain translatable
1808         strings.
1809         * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
1810         information to translators.
1811         (USE_MSGCTXT): New var for gettext 0.15.
1812         * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
1813         debug/trace messages in lower case.
1814         * m4/macro.c (expand_argument): Likewise.
1815         * m4/path.c (m4_path_search): Likewise.
1816         * src/main.c (main): Likewise.
1818 2006-08-14  Eric Blake  <ebb9@byu.net>
1820         * src/main.c (usage): Document --import-environment.
1821         * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
1823 2006-08-11  Eric Blake  <ebb9@byu.net>
1825         * bootstrap (func_get_translations): Only remove files when doing
1826         full update.
1827         (func_update_po): Avoid CDPATH problems.
1829 2006-08-10  Eric Blake  <ebb9@byu.net>
1831         * bootstrap (func_get_translations): New function.
1832         (func_update_po): Borrow ideas from tar to correctly pull in
1833         translations from newer location.
1835 2006-08-09  Eric Blake  <ebb9@byu.net>
1837         * bootstrap: Recent gnulib no longer has jm_* macros to worry
1838         about.
1839         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1840         verror.
1841         * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
1842         (m4_error, m4_warn): ... these new prototypes.
1843         (m4_current_file, m4_current_line): Move into context, rather
1844         than leaving as globals.
1845         (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
1846         (m4_undivert_all, m4_input_init): Now takes context.
1847         * m4/utility.c (m4_error, m4_warn): New functions.
1848         * m4/m4private.h: Assume errno exists.
1849         (struct m4): Move warning_status to a bit flag,
1850         and add exit_status.  Adjust accessors accordingly.
1851         * src/main.c (print_program_name_CB): No longer needed.
1852         (main): Use new m4_get_fatal_warnings_opt.
1853         * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
1854         instead of issuing "INTERNAL ERROR".  Pass context when needed,
1855         and use new accessors.
1856         * m4/input.c: Likewise.
1857         * m4/macro.c: Likewise.
1858         * m4/output.c: Likewise.
1859         * m4/utility.c: Likewise.
1860         * modules/evalparse.c: Likewise.
1861         * modules/gnu.c: Likewise.
1862         * modules/load.c: Likewise.
1863         * modules/m4.c: Likewise.
1864         * modules/mpeval.c: Likewise.
1865         * src/freeze.c: Likewise.
1866         * src/main.c: Likewise.
1867         * tests/macros.at: Adjust to new message format.
1868         * tests/builtins.at: Likewise.
1869         * tests/freeze.at: Likewise.
1870         * tests/modules.at: Likewise.
1871         * doc/m4.texinfo: Likewise.
1873         * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
1874         newer gettext 0.15.
1876 2006-08-03  Eric Blake  <ebb9@byu.net>
1878         * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
1879         gracefully handle ENOSYS.
1880         * TODO: Update.
1881         * THANKS: Update.
1883 2006-07-28  Eric Blake  <ebb9@byu.net>
1885         * src/freeze.c (reload_frozen_state): Copy string when creating
1886         placeholder, to avoid memory corruption.
1887         * m4/symtab.c (symbol_popval): Avoid memory leak.
1888         (m4_symbol_rename): Avoid shadowing rename function.
1889         (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
1890         * tests/freeze.at (reloading unknown builtin): Add test.
1891         * tests/generate.awk: Capture m4.texinfo line number in
1892         testsuite.log, not just generated.at.
1894         Port idea from branch that a frozen file can request an unknown
1895         builtin without producing a warning unless the builtin is
1896         actually used.
1897         * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
1898         (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
1899         (m4_set_symbol_value_placeholder): New accessors.
1900         * m4/m4module.h (m4_is_symbol_placeholder),
1901         (m4_get_symbol_value_placeholder),
1902         (m4_set_symbol_value_placeholder),
1903         (m4_get_symbol_placeholder): Likewise.
1904         * m4/symtab.c (m4_is_symbol_value_placeholder),
1905         (m4_get_symbol_value_placeholder),
1906         (m4_set_symbol_value_placeholder): Likewise.
1907         (dump_symbol_CB): Handle new symbol type.
1908         * m4/macro.c (trace_pre): Likewise.
1909         (m4_macro_call): Warn when invoking a placeholder.
1910         * modules/m4.c (dumpdef): Handle dumping a placeholder.
1911         (defn): Warn when referencing a placeholder.
1912         * src/freeze.c (dump_symbol_CB): Ignore placeholder when
1913         freezing.
1914         (reload_frozen_state): When reloading unknown builtin, install a
1915         placeholder instead of warning.
1916         * tests/freeze.at (loading format 1): Allow warning when
1917         popdef'ing undefined function.
1919 2006-07-27  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
1921         * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
1922         function. Shift by 7, not 3, for consistency with
1923         gnulib/lib/hash.c. Don't assume hash word is 32 bits.
1925 2006-07-27  Eric Blake  <ebb9@byu.net>
1927         * src/main.c (usage): Update to match branch.
1928         (main): Update --version info to distinguish between program name
1929         `m4' and package name `GNU M4'.
1930         (AUTHORS): Translate René Seindal's name.
1931         * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
1932         * Makefile.am (doc/m4.1): Update to match branch.
1933         * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
1934         branch.
1936         * m4/system_.h (EXIT_MISMATCH): Define.
1937         * src/main.c (main): Don't clear syntax table for version 1.
1938         (usage): Document exit status.
1939         * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
1940         branch, and require V directive to appear first in file.  Fix
1941         broken logic for detecting F and T in version 1 files.
1943 2006-07-22  Eric Blake  <ebb9@byu.net>
1945         * src/main.c (stackovf_handler): Document the problems in our
1946         overflow handler.
1947         * src/stackovf.c: Forward port changes in branch to use POSIX
1948         sa_sigaction when available.
1949         (process_sigsegv): Avoid buffer overrun when error string is
1950         translated, although the fact that we translate in a signal
1951         handler is still a bug.
1952         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
1953         from branch to modernize checks.
1955         * modules/format.c (format): Avoid compiler warning that str may
1956         be used uninitialized.
1958         * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
1959         spelling.
1960         (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
1961         (DEBUG_MACRO): Remove unused macro.
1962         * src/stackovf.c: Avoid compiler warnings.
1963         * m4/input.c: Likewise.
1964         * m4/module.c: Likewise.
1965         * m4/output.c: Likewise.
1966         * m4/path.c: Likewise.
1967         * m4/symtab.c: Likewise.
1968         * m4/syntax.c: Likewise.
1970 2006-07-20  Eric Blake  <ebb9@byu.net>
1972         * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
1973         Regenerate to explicitly ask for --assume-autoconf=2.60.
1975 2006-07-19  Eric Blake  <ebb9@byu.net>
1977         * po/ChangeLog: Merge into main ChangeLog, then delete file.
1978         * THANKS: Update.
1980         * doc/m4.texinfo (copying): Relax restriction on front-cover and
1981         back-cover texts.
1983 2006-07-17  Eric Blake  <ebb9@byu.net>
1985         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
1986         0.14.5.
1988         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
1989         xvasprintf'.
1990         * modules/format.c (includes): Use xvasprintf.h.
1991         (format): Make static.  Avoid buffer overflow, that can lead to
1992         arbitrary code execution exploit.  Only pass unsigned char to
1993         is*().  Support F, g, and G specifiers.
1994         * doc/m4.texinfo (Format): Expose buffer overrun bug.  Document
1995         new specifiers.
1997 2006-07-17  Gary V. Vaughan  <gary@gnu.org>
1999         Ensure M4 compiles correctly with -DDEBUG, and use a single
2000         consistent definition of various /DEBUG_[A-Z]+/ symbols:
2002         * m4/input.c: Have commented out out DEBUG_INPUT only by default.
2003         (m4_print_token): Use m4_get_symbol_value_text and
2004         m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
2005         and VALUE_FUNC respectively.
2006         (m4__next_token): Use m4_print_token call instead of obsolescent
2007         print_token symbol.
2008         * m4/module.c: Have commented out out DEBUG_MODULE only by default.
2009         * m4/output.c: Similarly for DEBUG_OUTPUT.
2010         * m4/path.c: Similarly for DEBUG_INCL.
2011         * m4/symtax.c: Similarly for DEBUG_SYM.
2012         * m4/syntax.c: Similarly for DEBUG_SYNTAX.
2013         * src/stackovf.c: Similarly for DEBUG_STACKOVF.
2014         * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
2015         preprocessor macros defined with -DDEBUG compiles.
2017 2006-07-17  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
2019         * bootstrap: Correct typo in --download-po argument parsing.
2021 2006-07-15  Eric Blake  <ebb9@byu.net>
2023         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
2024         gendocs fdl'.
2025         * tests/generate.awk (normalize): Recognize @tabchar.
2026         * doc/m4.texinfo (Top): Start merging from branch.  Remove tabs.
2027         Fix menus.  Upgrade FDL license from 1.1 to 1.2.  Fix overfull
2028         hboxes.
2029         (Index macro, Shell commands, Incompatiblities): Rename nodes
2030         from Index, UNIX commands, Other incompat.
2031         (Platform macros, Using frozen files, Frozen file format 1)
2032         (Frozen file format 2, Copying This Manual, Indices): New nodes.
2033         * Makefile.am (EXTRA_DIST): Distribute gendocs.
2034         (MAINTAINERCLEANFILES): Clean up files from gnulib.
2035         (doc_m4_TEXINFOS): Depend on fdl.texi.
2036         (web-manual): New maintainer target.
2038 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
2040         * doc/m4.texinfo (Modules):  RMS asked me for an explanation of
2041         the modular architecture of M4.  The result is paraphrased here
2042         for the benefit of future readers of the manual.
2044 2006-07-14  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
2046         * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
2048 2006-07-14  Eric Blake  <ebb9@byu.net>
2050         * src/main.c (main): Avoid compiler warning.
2051         * modules/gnu.c (renamesyms): Remove unused variable.
2053 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
2055         * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
2056         (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
2057         new functions for managing regexp syntax options.
2058         * m4/m4private.h (m4): Add regexp_syntax field.
2059         * m4/resyntax.c: New file implements the above.
2060         * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
2061         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
2062         (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
2063         (m4_patsubst_do, m4_renamesyms_do): Removed.
2064         (builtin_changeresyntax): New builtin to change regular expression
2065         syntax.
2066         (m4_resyntax_encode_safe): Factor out diagnostics code.
2067         * src/freeze.c (produce_resyntax_dump): New function to dump
2068         default regexp syntax specifier to frozen file.
2069         (reload_frozen_state): Updated to action 'R' directive.
2070         * src/main.c (usage): Describe new -r option.
2071         (long_options, OPTSTRING): Declare it.
2072         (main): Encode and store cli regexp syntax option argument.
2073         * tests/freeze.at (regexp syntax): New test that regexp syntax
2074         survives freezing.
2075         * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
2076         * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
2077         (Epatsubst and Patsubst): Renamed to...
2078         (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
2079         documentation and added new examples.
2080         (Changeresyntax): New section describing changeresyntax builtin,
2081         and regexp syntax names.
2082         (Regular expression syntax): New section describing differences
2083         between various regular expression syntaxes.
2084         (Frozen files): Document 'R' directive.
2085         * NEWS: Updated.
2087 2006-07-13  Gary V. Vaughan  <gary@gnu.org>
2089         * bootstrap: Enhanced to work more like our other scripts:
2090         Add a copyright statement; support --version and --help; accept a
2091         --download-po option with argument as a substitute for DOWNLOAD_PO
2092         in the environment.
2094 2006-07-11  Eric Blake  <ebb9@byu.net>
2096         * Makefile.am (doc/m4.1): Port patch from branch that avoids
2097         intermediate file.
2098         * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
2099         changed.
2101 2006-07-10  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
2103         * tests/builtin.at (patsubst, regexp):  Adjust these tests, now
2104         that `\0' is no longer accepted.
2106         * src/main.c (usage): Alphabetize options within their sections.
2108         * modules/gnu.c (m4_regexp_search, regsub, substitute)
2109         (esyscmd):  Improve comments.
2111         * modules/gnu.c (substitute): Remove old warning for \0.
2112         (substitute_warned): No longer required.  Removed.
2114         * modules/gnu.c: Put macro definitions into alphabetical order.
2116 2006-07-07  Eric Blake  <ebb9@byu.net>
2118         * tests/freeze.at (loading format 1): New file, with new test.
2119         * tests/testsuite.at: Include it.
2120         * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
2121         * tests/modules.at (Freezing modules): Likewise.
2123         * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
2124         (AC_CHECK_HEADERS): Assume signal.h.
2125         (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
2126         (AC_CHECK_FUNCS_ONCE): Likewise.
2127         * src/m4.h (includes): Assume signal.h.
2129 2006-07-05  Eric Blake  <ebb9@byu.net>
2131         Fix all testsuite failures on cygwin.
2132         * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
2133         branch-1_4.  Solves testsuite failure when uninstalled m4 is
2134         shadowed by redefinition of PATH in libtool wrapper.
2135         * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
2136         contains the -no-undefined required by cygwin.
2137         (TESTS_ENVIRONMENT): Export abs_top_builddir.
2138         * tests/others.at (misc): Port to platforms where /etc/passwd
2139         does not exist or does not contain user named root.
2140         * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
2141         directory.
2142         * tests/builtins.at (define, divert): Avoid overquoting.
2143         * tests/generate.awk (new_group): Likewise.
2145 2006-07-05  Gary V. Vaughan  <gary@gnu.org>
2147         The regs_allocated field in a struct re_pattern_buffer refers
2148         to the state of a particular re_registers struct when used in
2149         successive matches using the same compiled pattern.  Avoid a
2150         SEGV in `renamesyms' resulting from using a new re_registers
2151         with an existing re_pattern_buffer:
2153         * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
2154         pattern buffer and registers.
2155         (m4_regexp_search): New function to call re_regexp_search with
2156         correctly matched pattern buffer and register instantiations.
2157         (m4_regexp_compile): Return an m4_pattern_buffer.  Adust all
2158         callers.
2160 2006-07-04  Gary V. Vaughan  <gary@gnu.org>
2162         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
2163         changes to gnulib getopt.m4 since last build.
2164         * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
2165         if the system getopt fails M4_GETOPT tests.
2167 2006-06-22  Eric Blake  <ebb9@byu.net>
2169         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
2170         Reported by Bruno Haible.
2172 2006-06-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2174         * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
2176 2006-06-19  Eric Blake  <ebb9@byu.net>
2178         * THANKS: Update.
2180 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2182         * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
2183         (clean-local): Split into and depend upon...
2184         (clean-local-tests, clean-local-src): ...these two.  The latter
2185         removes the libtool object directory below `src', to work around
2186         a buglet in Automake, failing to list it.
2187         (EXTRA_DIST): Distribute modules/perl.c.
2189 2006-06-19  Eric Blake  <ebb9@byu.net>
2191         * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
2192         right side of dependency; VPATH does that.
2193         (stamp-vcl): Update to use libtool's algorithm.
2194         (EXTRA_DIST): Distribute stamp-vcl.
2195         Reported by Ralf Wildenhues.
2196         (TESTSUITE): Revert earlier change that used absolute path, as
2197         that broke 'make dist' in VPATH.  Stick with $(srcdir) instead.
2198         (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
2199         (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
2200         atlocal takes care of it instead.
2201         (check-local, installcheck-local, clean-local): Inline absolute
2202         path to testsuite here, rather than relative path to testsuite
2203         elsewhere.
2205 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2207         * m4/m4private.h (DELETE): Cast away const here...
2208         * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
2209         * src/freeze.c (reload_frozen_state): Avoid uninitialized
2210         variable warning.
2212 2006-06-19  Eric Blake  <ebb9@byu.net>
2214         * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
2215         .info pages are built.
2216         Reported by Ralf Wildenhues.
2217         (EXTRA_DIST): Inline definition of testsuite, so that make dist
2218         works again.
2220 2006-06-16  Eric Blake  <ebb9@byu.net>
2222         Follow recommendations from autoconf manual for autotest.
2223         * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
2224         turn it into an absolute path until autotest provides an option
2225         that allows us to avoid changing directories.  Properly quote
2226         throughout.
2227         (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
2228         (check-recursive): Delete unused target.
2229         ($(TESTSUITE)): Atomically update testsuite.
2230         (CD_TESTDIR): Simplify.
2231         (m4__cd): Delete unused macro.
2232         (check-local): Let TESTSUITEFLAGS influence the run.
2233         (installcheck-local): Let TESTSUITEFLAGS override
2234         AUTOTEST_PATH.  Add dependencies.
2235         (clean-local): Clean up.
2236         (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
2237         * README: Document how to use the testsuite.
2239 2006-06-15  Eric Blake  <ebb9@byu.net>
2241         * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
2243         * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
2244         clashes with m4sugar.
2245         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
2246         * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
2247         * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
2248         * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
2249         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
2250         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
2251         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
2252         * configure.ac: Likewise.
2253         (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
2254         * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
2255         conditional.
2256         * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
2258         Reduce compiler warnings.  Inside GMP, mpq_t is an array type, so
2259         const mpq_t is not assignable from plain mpq_t.  Avoid
2260         type-punning warnings caused trying to mix these types.
2261         * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
2262         (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
2263         * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
2264         (mult_term, exp_term): Remove type-punning casts.
2265         (numb_pow): Remove const qualifier.
2266         * src/freeze.c (reload_frozen_state): Fix typo in messages.
2267         Fix variables that can be used uninitialized, which fixes
2268         security hole where malicious frozen file can execute arbitrary
2269         code.
2271 2006-06-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2273         * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
2275 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2276         and Eric Blake  <ebb9@byu.net>
2278         Allow `make dist' to work again.
2279         * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
2280         (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
2281         (cvs-dist): Fix typo.
2282         * NEWS: Match current version number.
2284 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2286         * Makefile.am (AM_CPPFLAGS):  Add $(LTDLINCL), so the right
2287         ltdl.h is used.
2289         * bootstrap: Do not run libtoolize manually, this is done
2290         correctly by autoreconf.  Invoke autoreconf with --no-recursive
2291         to avoid unnecessary rerunning of autotools for libltdl.
2293 2006-06-13  Eric Blake  <ebb9@byu.net>
2295         * THANKS: Update.
2297 2006-06-12  Eric Blake  <ebb9@byu.net>
2299         * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
2300         bother with mktemp.
2301         * src/m4.h: Don't declare mktemp.
2302         * m4/input.c (m4__next_token): Avoid bzero.
2303         * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
2304         * Makefile.am (doc/m4.1): Depend on installed help2man, rather
2305         than distributing outdated helptoman.pl.
2306         * doc/helptoman.pl: Delete.
2308 2006-06-10  Eric Blake  <ebb9@byu.net>
2310         * README (Patches): Document the current dependence on CVS
2311         builds of autotools.
2312         * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
2313         * configure.ac: Use consistent quoting throughout.
2314         (AC_PREREQ): Bump to 2.59d.
2315         (AC_INIT): Package name begins with uppercase.
2316         (AC_ARG_WITH): Use AS_HELP_STRING.
2317         (AM_INIT_AUTOMAKE): Enable gnits mode.
2318         (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
2319         (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
2320         (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
2321         done by gnulib or automake, or which autoconf has declared
2322         obsolete.
2323         * m4/m4private.h (Includes): Assume C89 or better, and use errno
2324         unconditionally.
2325         * m4/output.c (Includes): Likewise.
2326         * modules/gnu.c (Includes): Likewise.
2327         * modules/m4.c (Includes): Likewise.
2328         * src/m4.h (Includes): Likewise.
2330         * README-alpha: Update web address.
2331         * README: Likewise. Change encoding to ASCII.  Remove old advice
2332         about cygwin.  Document bootstrapping dependency.
2333         * AUTHORS: Update from branch-1_4.
2334         * THANKS: Likewise.  Change encoding to UTF-8.
2335         * BACKLOG: Delete.  This file is too old and unmaintained to be
2336         worthwhile.
2337         * ChangeLog: Change encoding to UTF-8.
2339         Avoid compiler warnings.
2340         * m4/macro.c (trace_format): Don't mark this as a printf format,
2341         since we don't accept the same set of modifiers as printf.  It
2342         would be nice if gcc let us specify a custom format archetype.
2343         * src/main.c (main): Cast away const.
2345 2006-06-10  Andreas Schwab  <schwab@suse.de>  (tiny change)
2346             Eric Blake  <ebb9@byu.net>
2348         * modules/time.c (ctime): Pass correctly typed variable to
2349         m4_numeric_arg.
2350         (gmtime): Likewise.
2351         (localtime): Likewise.
2352         (strftime): Likewise.
2353         * m4/utility.c (m4_numeric_arg): For now, document arbitrary
2354         limit inherent in this interface.
2356 2006-05-08  Bruno Haible  <bruno@clisp.org>  (tiny change)
2358         * modules/m4.c (WEXITSTATUS): Provide fallback definition.
2359         (sysval): Use WEXITSTATUS.
2360         * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
2361         big-endian and little-endian wait status definitions.
2363 2006-05-06  Eric Blake  <ebb9@byu.net>
2365         * po/Makevars (MSGID_BUGS_ADDRESS): Add.
2366         * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
2367         in src, not gnu.
2369 2006-05-06  Eric Blake  <ebb9@byu.net>
2371         * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
2372         subdirectory to use.
2373         (support for -pipe): Move after LT_INIT, since it relies on
2374         libtool internals.
2376 2006-05-05  Eric Blake  <ebb9@byu.net>
2378         * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
2380         * THANKS: Update.
2382 2006-05-05  Bruno Haible  <bruno@clisp.org>
2383         and Eric Blake  <ebb9@byu.net>
2385         * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
2386         * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
2387         usage pattern.
2388         * bootstrap: Update usage of gnulib-tool.
2390 2006-05-04  Eric Blake  <ebb9@byu.net>
2392         * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
2393         Cleanup whitespace.
2395 2005-12-05  Gary V. Vaughan  <gary@gnu.org>
2397         * bootstrap (func_update_po): Synch with CVS GNU tar.  wget 1.9.x
2398         and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
2399         Reported by Eric Blake <ebb9@byu.net>
2401 2005-12-04  Gary V. Vaughan  <gary@gnu.org>
2403         * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
2404         http caching as -C is no longer supported by wget 1.10.x.
2405         Reported by Eric Blake <ebb9@byu.net>
2407 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
2409         * m4/module.c (caller_id): To match libtool-2.0 interface, changed
2410         to ...
2411         (iface_id): ...an lt_dlinterface_id type.
2412         (m4__module_find): New abstraction for lt_dlhandle_fetch.  Use
2413         throughout, instead of calling obsolete lt_dlhandle_find directly.
2414         (m4__module_next): Use multiloader-safe lt_dlhandle_iterate.  Use
2415         throughout, instead of calling obsolete lt_dlhandle_next.
2416         * m4/m4private.h (m4__module_find): Declare it.
2417         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2418         Use m4__module_next instead of obsolete lt_dlhandle_next.
2420 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
2422         * bootstrap (func_update_po): Update pofiles directly from the
2423         translation project.
2424         * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
2425         po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
2426         these files under source control anymore.
2427         Suggested by Eric Blake <ebb9@byu.net>
2429 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
2431         * ltdl/m4/m4-gnulib.m4: Update FSF contact address.  Somehow this
2432         file escaped the address updates on 2005-05-01.
2434 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
2436         * bootstrap: Allow user overriding of gnulib-tool location, and
2437         correctly determine module source directories whether gnulib-tool
2438         is given as a relative or absolute path, or is found by searching
2439         PATH.
2440         Reported by Eric Blake <ebb9@byu.net>
2442 2005-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2444         * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
2445         and $RM are defined for various versions of
2446         AC_LIBTOOL_COMPILER_OPTION.
2448         * bootstrap (AUTORECONF): New variable to allow user overriding of
2449         autoreconf path.
2451 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
2453         * doc/m4.texinfo (History): Add better notes on the ancestory of
2454         GNU m4, and other historical interest.
2456 2005-05-08  Gary V. Vaughan  <gary@gnu.org>
2458         * m4/symtab.c (m4_symbol_rename): New function that performs a low
2459         level symbol rename.
2460         * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
2461         * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
2462         (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
2463         regsub...
2464         (erenamesyms, renamesyms): ...builtins that use these to implement
2465         macro renaming by regular expression.
2466         * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
2467         * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
2468         to stop the new generated tests from choking.
2470 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
2472         Since most of the build is handled from a single Makefile.am now,
2473         we can teach make about the dependencies between the m4 binary and
2474         the preopened modules it is built against:
2476         * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
2477         preopened modules.
2478         * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
2479         of the preopened modules have changed.
2481 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
2483         * configure.ac (gl_MODULES): Add mkstemp for machines that don't
2484         have a native implementation.
2486 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
2488         * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed.  These are
2489         handled already by gnu/exit.h.
2491         * configure.ac (gl_MODULES): Add assert to support a
2492         --disable-assert configure time option for NDEBUG setting.
2494         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
2495         * bootstrap (src_modules): Add version-etc-fsf.
2496         * src/main.c (version_etc_copyright): Removed.
2498         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
2500 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
2502         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
2503         recognition macros.
2504         * src/freeze.c (produce_frozen_state): Use \n line-endings even
2505         on Windows, so that the frozen file reader will work.
2506         Reported by Josef T. Burger <bolo@bolo.com>
2508 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
2510         Forward port of a patch that allowed m4-1.4.2 to compile on
2511         QNX 6.3:
2513         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
2514         sys/signal.h.
2515         * src/m4.h: And include them as appropriate.
2516         * src/main.c, src/stackovf.h: Don't include signal.h literally;
2517         m4.h will include the correct file.
2519 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
2521         * m4/m4private.h: Make errno visible for the sources patched
2522         below.
2524 2005-05-04  Paul Eggert  <eggert@twinsun.com>
2526         * src/main.c (print_program_name_CB): Preserve errno, since
2527         M4ERROR relies on this.
2528         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
2529         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
2530         * m4/path.c (m4_path_search): Don't let "free" trash errno when
2531         returning NULL.
2533         * m4/output.c (m4_insert_file): Don't assume errno has a valid
2534         value simply because fread returns zero.  This fixes a
2535         portability bug reported by Marion Hakanson in
2536         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
2538 2005-05-04  Santiago Vila  <sanvila@debian.org>
2540         * tests/stackovf.test: Use tempfile if available.
2542 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
2544         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
2545         * m4/output.c (m4_insert_file): Do not mix buffered and
2546         unbuffered I/O, as this breaks on the Hurd.
2548 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
2550         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
2551         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
2552         and libtoolize does a better job of ltdl importing now too, so
2553         take advantage of that while updating the tree:
2555         * acm4, config: Moved from here...
2556         * ltdl/m4, ltdl/config: ...to here.
2557         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
2558         src/Makefile.am, tests/Makefile.am: Removed...
2559         * Makefile.am: ...and migrated to here, with adjustments to
2560         compensate for relative path differences.
2561         * commit: Adjust relative paths.
2562         * configure.ac: Adjust relative paths.
2563         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
2564         patch.
2565         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
2566         the meanwhile, CVS HEAD libtool is needed.
2567         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
2568         stricly new enough, we also need a patch.
2569         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
2570         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
2571         (gl_MODULES): Don't list getopt and version-etc, as they don't
2572         belong in libm4.
2573         * bootstrap: After running gnulib-tool to import the listed
2574         modules, fetch getopt and version-etc into src manually.
2575         (ltdldir): Change to ltdl.
2576         * src/main.c: Adjust for changes in version-etc API.
2577         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
2578         but works when the getopt module isn't to be included in the lib.
2579         * README: Add note about patching autoconf and automake to
2580         bootstrap CVS m4.
2582 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
2584         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
2585         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
2586         empty file rather than to a nonexistent file.  This closes a
2587         common security hole.
2588         * modules/m4.c (m4_maketemp): Implement the above, by using
2589         mkstemp rather than mktemp.
2591 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
2593         The FSF are moving offices today.  Changed their contact address
2594         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
2595         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
2597 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
2599         * tests/Makefile (clean-local): Ignore testsuite cleanup
2600         failures.
2602 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
2604         * tests/Makefile (clean-local): Only run the testsuite cleanup
2605         if the testsuite has been generated.
2607 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
2609         * TODO: slight clarification of the example of qindir usage.
2611 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
2613         * TODO: Add qindir requirement, and defn bug.
2614         From Stepan Kasal  <kasal@ucw.cz>
2616 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
2618         * TODO: Add ``execution stack'', fix a typo.
2619         * doc/m4.texinfo: Typos.
2621 2004-12-24  Eric Blake  <ebb9@byu.net>
2623         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
2624         to the gnu subdirectory.
2625         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
2626         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
2627         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
2628         * m4/system_.h: Likewise, in non-configured includes.
2630 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
2631             Gary V. Vaughan  <gary@gnu.org>
2633         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
2634         Protect definitions from macro expansion under -DNDEBUG by
2635         parenthesising the expanded function names.
2636         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
2637         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
2638         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
2639         (m4_is_syntax_macro_escaped): Similarly protect function
2640         definitions from macro expansion under -DNDEBUG by #undefing the
2641         matching macro names before each definition.  Also, move all the
2642         function definitions to the end of the file so that any
2643         invocations in the rest of the file pick up the fast macro
2644         versions.
2645         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
2646         (m4_set_debug_file, m4_set_trace_messages)
2647         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
2648         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
2649         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
2650         option setter functions.
2652 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
2654         * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
2655         to gnu.
2657 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
2659         * src/main.c: Include gnulib files from the correct directory.
2661         * gnulib/*: Don't store any of the gnulib files in arch, as they
2662         generate spurious changes.
2663         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
2664         gnulib macros now share our macro directory.
2665         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
2666         * bootstrap: Call gnulib-tool to import from the gnulib tree.
2667         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
2668         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
2669         the gettext macros from autopoint that overwrite the gnulib-tool
2670         imported versions.  Import sources and Makefile.am into the `gnu'
2671         directory.  Changed all callers.
2672         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
2673         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
2674         for imported modules.
2675         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
2676         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
2677         hardcoding the gnulib macros they wrap.
2679 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
2681         Latest CVS libtool can preload modules in libraries, including
2682         its own module loaders!  Tweak m4 so that it doesn't try to treat
2683         libltdl's module loaders as m4 modules when freezing and on exit:
2685         * gnulib/acm4/*.m4: Don't store these files in arch since they
2686         generate spurious changes.
2687         * bootstrap: Simplify initial libtoolize call, since CVS
2688         libtoolize is smarter these days.
2689         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
2690         build.
2691         * m4/module.h (m4__module_exit): Missing declaration.
2692         * m4/m4private.h (m4__module_next): New function declaration.
2693         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
2694         encapsulation.  Changed all callers.
2695         (m4__module_interface): New function to verify m4 loadable module
2696         interfaces.
2697         (m4__module_init): Register the interface validator.
2698         (m4__module_exit): Only close my own modules.
2699         * modules/m4.c (unistd.h): Provide missing declaration.
2700         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
2701         (m4_expand_ranges): More missing declarations.
2702         * modules/modtest.c (export_test): Ditto.
2703         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
2704         * src/main.c (main): Bump copyright year.
2705         * tests/modules.at: Fix sed syntax error.
2708 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
2710         Tweaking to enable compilation with latest CVS libtool and
2711         libltdl.  We can't just dump the library files directly into the
2712         m4 directory anymore now that libltdl is built from pieces itself:
2714         * bootstrap: Rewritten to use latest libtoolize sanely, and to
2715         set up libltdl subdirectory.
2716         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
2717         gnulib subdirectory's config.
2718         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
2719         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
2720         macros from gnulib.
2721         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
2722         configure.ac, so use AC_WITH_LTDL instead.
2723         * Makefile.am (SUBDIRS): Add libltdl.
2724         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
2725         gl_INCLUDED_REGEX.
2726         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
2727         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
2728         (libm4_la_LIBADD): Add LIBLTDL.
2729         * m4/ltdl.c, m4/ltdl.h: Removed.
2730         * m4/m4module.h: Include canonical ltdl.h.
2731         * po/*.po: Updated.
2733 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
2735         * gnulib/import: Now updates makefile fragments, and configure.ac.
2736         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
2737         * gnulib/m4/Makefile.am: include it.
2738         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
2739         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
2740         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
2741         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
2742         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
2743         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
2744         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
2745         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
2746         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
2747         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
2748         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
2749         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
2750         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
2751         import.
2752         * gnulib/m4/getopt_int.h: New source file from latest gnulib
2753         import.
2754         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
2755         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
2756         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
2757         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
2758         Updated source files from latest gnulib.
2760 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
2762         * config/mailnotify: New file for mailing commit notifications,
2763         imported from cvs-utils.
2764         * commit: Updated from cvs-utils and tweaked for m4.
2766 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
2768         * config/mkstamp: Updated from CVS libtool.
2769         * configure.ac: Generate a gnu coding standards compliant version
2770         number, and use it for the banner.
2771         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
2772         mhen the TIMESTAMP changes in ChangeLog, but the file modification
2773         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
2774         contain the previous version number.
2775         * src/main.c: Make --version output conform to the GNU standard.
2777         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
2778         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
2779         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
2780         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
2781         time_la_SOURCES): ...so that these are defaulted correctly, and
2782         can be removed from this file.
2783         (AM_LDFLAGS): Add -module...
2784         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
2785         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
2786         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
2787         the individual settings can be removed.
2788         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
2789         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
2790         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
2791         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
2792         time_la_LIBADD): ...so that these are picked up as a deplib of
2793         libm4 and don't need to be set explicitly.
2795 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
2797         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
2798         from the standard build.  It is too fragile.
2800         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
2801         CVS libtool after merging m4 changes across to libtool.
2803         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
2804         * m4/path.c (search_path_add): Ditto.
2806 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
2808         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
2809         libtool tags we don't use in configure.  This reduces the size
2810         of the script from over 1Mb to under 700Kb.
2812 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
2814         The import script was not written properly, and the last gnulib
2815         import was incomplete.  Fixed that problem, and reimport our
2816         gnulib dependencies, which picks up the address calculation
2817         overflow checks described by Paul below.  Also tweak the clients
2818         of the gnulib xalloc module not to use deprecated macros:
2820         * gnulib/import: Recurse through module dependencies rather than
2821         naively descending only one level.
2822         * configure.ac: Add calls to gnulib's strnlen and extension module
2823         macros.
2824         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
2825         extension modules.
2826         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
2827         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
2828         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
2829         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
2830         gnulib.
2831         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
2832         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
2833         place of `xcalloc (1, S)'.
2834         * m4/m4.c (m4_create): Likewise.
2835         * m4/m4private.h (m4_symbol_value_create): Likewise.
2836         * m4/symtab.c (symtab_fetch): Likewise.
2837         * m4/syntax.c (m4_syntax_create): Likewise.
2838         * src/freeze.c (reload_frozen_state): Likewise.
2839         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
2840         macro.
2841         * m4/symtab.c (m4_symtab_create): Likewise.
2843 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
2845         * tests/module.at: Comment typo.
2847 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
2849         * tests/modules.at (modules: importing): Apply some lateral
2850         thinking, and use AT_CHECK to compare the output of a sed pass
2851         over stderr against the canonical strerror string.
2853         * tests/modules.at (modules: importing): Edit the generated stderr
2854         output to canonicalize strerror output, before a comparison.
2856 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
2858         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
2859         careful not to trip over the mess:
2861         * modules/perl.c: Some builds of perl install headers that contain
2862         `#define try __builtin_try'.  Be sure to undefine that macro
2863         before `m4/hash.h' gets included, which uses the `try' symbol.
2864         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
2865         `false' before including `stdbool.h'.
2866         (DELETE):  This symbol is not in m4's namespace, and is in any
2867         case only used internally...
2868         * m4/m4private.h (DELETE): ...so move it to here.
2869         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
2871 2003-10-08  Paul Eggert  <eggert@twinsun.com>
2873         Don't use XMALLOC and XCALLOC.  Once we install the
2874         corresponding patch into gnulib, this will fix some
2875         address-calculation overflow bugs on hosts where calloc (A, B)
2876         returns garbage when A*B overflows.
2878         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
2879         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
2880         xmalloc, XCALLOC with xcalloc.
2881         * m4/m4.c (m4_create): Likewise.
2882         * m4/m4private.h (m4_symbol_value_create): Likewise.
2883         * m4/output.c (m4_output_init): Likewise.
2884         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
2885         * m4/syntax.c (remove_syntax_attribute): Likewise.
2886         * src/freeze.c (reload_frozen_state): Likewise.
2887         * src/main.c (main): Likewise.
2889 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
2891         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
2892         gnulib/acm4 directories for aclocal m4 macros.
2893         * gnulib/Makefile.am (EXTRA_DIST): Removed.
2894         (MAINTAINERCLEANFILES): Add Makefile.in.
2895         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
2896         modules we use.
2897         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
2898         * gnulib/import: New file.  Temporary script for updating gnulib
2899         imported files, until gnulib-tool is working.
2900         * gnulib/config/codeset.m4, gnulib/config/error.m4,
2901         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
2902         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
2903         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
2904         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
2905         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
2906         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
2907         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
2908         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
2909         gnulib/config/nls.m4, gnulib/config/obstack.m4,
2910         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
2911         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
2912         gnulib/config/regex.m4, gnulib/config/restrict.m4.
2913         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
2914         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
2915         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
2916         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
2917         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
2918         gnulib/config/xstrndup.m4: Removed.
2919         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
2920         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
2921         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
2922         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
2923         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
2924         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
2925         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
2926         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
2927         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
2928         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
2929         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
2930         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
2931         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
2932         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
2933         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
2934         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
2935         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
2936         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
2937         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
2938         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
2939         gnulib/import script.
2940         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
2941         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
2942         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
2943         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
2944         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
2945         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
2946         gnulib with gnulib/import script.
2947         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
2948         guards ready for gnulib-tool to autoupdate on import.
2949         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
2950         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
2951         config/stackovf.m4: Moved from here...
2952         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
2953         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
2954         acm4/stackovf.m4: ...to here, to separate aclocal macros from
2955         configure time helper scripts.
2956         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
2957         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
2958         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
2959         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
2960         gnulib xalloc.h.
2961         * src/main.c (version_etc_copyright): Only output the current
2962         year.
2963         (version_etc): Call with new variadic API.
2965 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
2967         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
2968         version-etc module from CVS gnulib.
2969         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
2970         * src/Makefile.am: Build it.
2971         * src/main.c: Use it.
2973         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
2974         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
2975         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
2976         exit.h instead.
2978 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
2979             Gary V. Vaughan  <gary@gnu.org>
2981         * bootstrap: Separate options.
2982         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
2983         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
2984         not set.
2985         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
2986         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
2987         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
2988         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
2989         $(LTLIBINTL) for gettext support on cygwin.
2990         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
2991         have $(LTLIBINTL) from the preloaded module la files.
2992         * README: Remove the warning about using --disable-nls on Windows
2993         machines.
2995 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
2997         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
2998         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
2999         is required.
3001 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
3003         * doc/STYLE: Document the gnulib header naming conventions, and
3004         #include policy.
3005         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
3006         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
3007         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
3008         respectively.
3009         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
3011         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
3012         module from CVS gnulib.
3013         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
3014         (gl_FUNC_STRTOL): In favour of the module macro.
3016 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
3018         Replace the getopt code with CVS gnulib getopt.  The source files
3019         detect whether they are in a glibc environment and preprocess away
3020         all of the code if there is a system getopt, so we can compile
3021         them into the m4 executable unconditionally:
3023         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
3024         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
3025         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
3026         macros.
3027         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
3028         version.
3029         * src/Makefile.am: Adjust.
3030         * src/main.c: Always include our shipped getopt.h.
3031         * po/POTFILES.in: Use new location of getopt.c.
3033 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
3035         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
3036         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
3037         in this directory automatically.
3038         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
3040         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
3041         isn't set yet.
3042         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
3043         inline.
3044         * modules/Makefile.am (pkglibexecdir): Set it here.
3045         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
3047         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
3048         Import regex module from CVS gnulib.
3049         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
3050         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
3051         do extra substitutions for Makefile.
3052         * configure.ac: Use it.
3053         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
3054         from regex_.h if necessary.
3055         * m4/system_.h: Include the correct version of regex.h.
3056         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
3057         version.
3058         * po/POTFILES.in: Use new location of regex.c.
3060         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
3061         realloc.c: automake distributes these files already.
3063 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
3065         Replace the xstrzdup code by importing the xstrndup module from
3066         CVS gnulib, along with its dependencies: strndup and strnlen:
3068         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
3069         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
3070         gnulib.
3071         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
3072         gnulib/config/strndup.m4: Ditto wrt strndup.
3073         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
3074         strnlen.
3075         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
3076         However, contrary to gnulib, we install xstrndup.h.
3077         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
3078         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
3079         is an artifact of the old m4 portability layer.
3080         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
3081         * m4/system_.h: Include xstrndup.h.
3082         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
3084 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
3086         Reimport the latest xalloc module from CVS gnulib, and adjust the
3087         m4 sources to take advantage of xalloc xfree.  Also create a new
3088         macro DELETE with the same semantics as the old m4 XFREE macro,
3089         and carefully tweak callers:
3091         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
3092         gnulib.
3093         * m4/utility.c (xfree): Removed.  This function is now supplied by
3094         gnulib xalloc.
3095         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
3096         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
3097         * m4/symtab.c (m4_symtab_create): Ditto.
3098         * m4/system_.h: Removed XFREE redefine.
3099         (DELETE): New macro with same functionality as the original m4
3100         XFREE macro, but based on xalloc.h now.  Changed all callers.
3101         * src/main.c (main): Use XMALLOC macro.
3102         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
3103         instead of XFREE.
3104         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
3106 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
3108         Import the xalloc module from CVS gnulib, along with its
3109         dependencies: exitfail, malloc and realloc. We had different
3110         semantics for our XFREE and a function xfree() not supplied by
3111         gnulib, so also a bit of work to keep everything running
3112         smoothly:
3114         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
3115         (gl_XALLOC): Use gnulib equivalents.
3116         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
3117         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
3118         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
3119         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
3120         realloc.
3121         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
3122         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
3123         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
3124         imported modules.
3125         (pkgincdir): Removed.  Use pkgincludedir instead.
3126         * m4/m4private.h (XFREE): xfree already checks for NULL.
3127         * m4/system_.h: Use xalloc module, and remove macros already
3128         supplied by xalloc.h.
3129         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
3130         moved the old definition from m4/xmalloc.c to here for now.
3132 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
3134         Import the error and progname modules from CVS gnulib.  Our old
3135         error.c subsumed the functionality of both, so a little adjustment
3136         was required to accomodate the split in sources.  Also added more
3137         wrapper macros to choose between a system installed error.h or our
3138         shipped gnulib error module:
3140         * m4/error.c, m4/error.h: Removed.
3141         * m4/Makefile.am: Adjust.
3142         (pkgincdir): Removed.  Use pkgincludedir instead.
3143         * m4/module.h, src/main.c: Don't include `m4/error.h'.
3144         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
3145         error.h.
3146         * gnulib/m4/progname.c: Imported from CVS gnulib.
3147         * gnulib/m4/progname.h: Ditto.
3148         * src/main.c: Adjust to use progname module.
3149         * gnulib/m4/error.c: Imported from CVS gnulib.
3150         * gnulib/m4/error_.h: Ditto.
3151         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
3152         if appropriate, and link a local error.h if the system version is
3153         missing.
3154         (libgnu_la_SOURCES) Add progname module sources.
3155         * gnulib/config/error.m4: Imported from CVS gnulib.
3156         * gnulib/config/strerror_r.m4: Ditto.
3157         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
3158         to have ERROR_H for Makefile substitutions and tell system.h
3159         whether the system error.h should be used, or a locally installed
3160         version.
3161         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
3163 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
3165         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
3166         s/gettext_.h/gettext.h/.
3168         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
3169         automake have been fixed.
3171         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
3172         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
3173         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
3174         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
3176 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
3178         The gnulib obstack module requires the gnulib gettext module for
3179         systems that do not have GNU gettext installed.  Because we use
3180         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
3181         that directory incase it clashes with the system gettext.h.  This
3182         delta uses gettext_.h and extra rules in the Makefile to make a
3183         link to gettext.h when needed:
3185         * Makefile.am (auxdir): Removed.  No longer used.
3186         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
3187         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
3188         moved.
3189         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
3190         Makefile based build.
3191         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
3192         of the macros are kept.
3193         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
3194         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
3195         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
3196         distributes these automatically.
3197         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
3198         warning from automake-1.7a.
3199         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
3200         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
3201         all callers.
3202         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
3203         wrt. m4_FUNC_OBSTACK.
3204         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
3205         wrt. m4_sys_STACKOVF.
3206         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
3207         wrt. _m4_LIB_GMP, m4_LIB_GMP.
3208         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
3209         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
3210         respectively.
3211         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
3212         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
3213         gettext.h link on deficient systems.
3214         (pkginc_HEADERS): Mention $(GETTEXT_H).
3215         (EXTRA_HEADERS): Mention gettext.h.
3216         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
3217         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
3218         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
3219         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
3220         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
3221         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
3222         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
3223         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
3224         gnulib/config/po.m4, gnulib/config/progtest.m4,
3225         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
3226         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
3228 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
3230         We can't mirror the gnulib directory structure here, since we need
3231         to be able to eg. `#include <m4/obstack.h>' from our source files,
3232         which is much easier if the local obstack.h is created in a
3233         directory named m4.  Rather than trying to symlink everything into
3234         the m4 directory, now we build a libtool convenience library from
3235         the sources we get from gnulib and link that with libm4.la:
3237         * gnulib/config/extensions.m4: Imported from CVS gnulib.
3238         * gnulib/config/unlocked-io.m4: Ditto.
3239         * gnulib/m4/unlocked-io.h: Ditto.
3240         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
3241         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
3242         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
3243         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
3244         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
3245         * m4/Makefile.am: Adjust.
3246         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
3247         macros we redistribute.
3248         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
3249         library among others.
3250         (GNULIB_SRCS, GNULIB_MACROS): Removed.
3251         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
3252         * config/m4-obstack.m4: Adjust.
3253         * po/POTFILES.in: Adjust.
3254         * configure.ac: Reformatting.  Call newly imported gnulib macros.
3255         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
3256         bogus calls of `#include "m4.h"'.
3257         * Makefile.am: INCLUDES has been deprecated in favour of
3258         AM_CPPFLAGS.
3259         * m4/Makefile.am: Ditto.
3260         * modules/Makefile.am: Ditto.
3261         * src/Makefile.am: Ditto.
3263 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
3265         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
3267 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
3269         Migrate the obstack support into the gnulib directories for easy
3270         synchronisation with upstream files in gnulib:
3272         * config/gnu-obstack.m4: Moved from here...
3273         * config/m4-obstack.m4: ...to here.
3274         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
3275         * m4/obstack.c, m4/obstack_.h: Moved from here...
3276         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
3277         * po/POTFILES.in: Adjust.
3278         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
3279         * m4/Makefile.am: Add a whole new section to link the obstack
3280         sources from the gnulib tree if necessary.
3281         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
3282         from gnulib.
3283         * config/m4-obstack.m4: Rewrite as a wrapper for
3284         gnulib/m4/obstack.m4.
3286 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
3288         GNU M4 currently builds with a number of files adapted from
3289         upstream sources.  Recently the gnulib project on savannah.gnu.org
3290         has pulled together a great many of these externally maintained
3291         files.  This delta is the beginnings of isolating those files
3292         maintained in gnulib to make it easy to synchronise M4 with the
3293         upstream files prior to releases.
3295         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
3296         directory.
3297         (SUBDIRS): Added new gnulib subdirectory.
3298         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
3299         * config/stdbool.m4: Moved from here...
3300         * gnulib/m4/stdbool.m4: ...to here.
3301         * m4/stdbool_.h: Moved from here...
3302         * gnulib/lib/stdbool_.h: ...to here.
3303         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
3304         distributed.
3305         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
3306         code to work with new stdbool_.h location.
3307         (gnulib_srcdir): New.
3309 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
3311         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
3312         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
3313         builds to work.
3314         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
3315         (EXTRA_DIST): Use it.
3317         * bootstrap: CVS autoreconf leaves file droppings.  Remove
3318         aclocal.m4t incase autoreconf doesn't.
3320 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
3322         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
3323         the other gnulib imports, renamed to m4/obstack_.h.
3324         * m4/obstack.c: Updated from CVS gnulib.
3325         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
3326         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
3327         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
3328         about vpath already, and $top_srcdir upsets CVS Automake, so the
3329         $top_srcdir reference was removed.
3331         * m4/system-h.in: For consistency with the gnulib imports, renamed
3332         to m4/system_.h.
3333         * m4/Makefile (EXTRA_HEADERS): Adjust.
3334         * configure.ac (AC_CONFIG_FILES): Adjust.
3336         * m4/stdbool_.h: New file from gnulib for systems without their
3337         own.
3338         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
3339         * config/stdbool.m4: New file.  Macros from gnulib for same.
3340         * configure.ac: Use it.
3342 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
3344         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
3345         * config/gmp.m4: Ditto.
3346         * config/gnu-obstack.m4: Ditto.
3347         * config/stackovf.m4: Ditto.
3348         * m4/builtin.c: Ditto.
3349         * m4/debug.c: Ditto.
3350         * m4/error.c: Ditto.
3351         * m4/error.h: Ditto.
3352         * m4/gnu-obstack.h: Ditto.
3353         * m4/hash.c: Ditto.
3354         * m4/hash.h: Ditto.
3355         * m4/input.c: Ditto.
3356         * m4/m4.c: Ditto.
3357         * m4/m4module.h: Ditto.
3358         * m4/m4private.h: Ditto.
3359         * m4/macro.c: Ditto.
3360         * m4/module.c: Ditto.
3361         * m4/obstack.c: Ditto.
3362         * m4/output.c: Ditto.
3363         * m4/path.c: Ditto.
3364         * m4/regex.c: Ditto.
3365         * m4/regex.h: Ditto.
3366         * m4/strtol.c: Ditto.
3367         * m4/symtab.c: Ditto.
3368         * m4/syntax.c: Ditto.
3369         * m4/utility.c: Ditto.
3370         * m4/xmalloc.c: Ditto.
3371         * m4/xstrdup.c: Ditto.
3372         * m4/xstrzdup.c: Ditto.
3373         * modules/evalparse.c: Ditto.
3374         * modules/format.c: Ditto.
3375         * modules/gnu.c: Ditto.
3376         * modules/import.c: Ditto.
3377         * modules/load.c: Ditto.
3378         * modules/m4.c: Ditto.
3379         * modules/m4.h: Ditto.
3380         * modules/modtest.c: Ditto.
3381         * modules/mpeval.c: Ditto.
3382         * modules/perl.c: Ditto.
3383         * modules/shadow.c: Ditto.
3384         * modules/stdlib.c: Ditto.
3385         * modules/time.c: Ditto.
3386         * modules/traditional.c: Ditto.
3387         * src/freeze.c: Ditto.
3388         * src/getopt.c: Ditto.
3389         * src/getopt1.c: Ditto.
3390         * src/m4.h: Ditto.
3391         * src/main.c: Ditto.
3392         * src/stackovf.c: Ditto.
3394         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
3395         ac_default_headers is an autoconf internal variable.
3396         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
3397         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
3399         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
3400         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
3401         delta.
3403 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
3405         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
3406         C99 bool.
3407         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
3408         possible or faking one with a typedef.  Changed all callers.
3410 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
3412         Still cleaning up the users' module API, by taking out the stuff
3413         that isn't used by any existing modules, and moving specialised
3414         functions out of libm4 and into the module they are used by.
3416         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
3417         * m4/utility.c (m4_skip_space): ...to here the home of its only
3418         use, made static and renamed to `skip_space'.  Changed all
3419         callers.
3420         * m4/m4module.h (m4_expand_ranges): Removed prototype.
3421         * m4/utility.c (m4_expand_ranges): Moved definition from here...
3422         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
3423         ltdl.
3424         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
3425         casting .
3426         * modules/gnu.c (builtin_syntax): Import and use in this
3427         builtin implementation.
3428         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
3429         Not used.  Deleted.
3430         * m4/macro.c (trace_flush): Except here where the macro is now
3431         manually inlined.
3432         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
3433         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
3434         moved...
3435         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
3436         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
3438 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
3440         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
3441         compiler based AC_CHECK_HEADER that was introduced in
3442         autoconf-2.56.
3443         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
3444         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
3445         * configure.ac: Use renamed M4_AC_LIB_GMP.
3447         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
3448         macro that requires arguments! This stops the shell's bad
3449         substitution error at configure time.
3451         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
3452         variables to the testsuite shell.  Set the value of USE_GMP so
3453         that the gmp test will run!
3454         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
3456 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
3458         Libltdl already has an excellent mechanism for accessing C symbols
3459         in modules.  Lets use that!  Remove all the exporting cruft and
3460         just use lt_dlsym in conjunction with a few conventions to
3461         simplify module writers' jobs.  Also removed the table address
3462         caching code and otherwise simplified the module loader quite a
3463         bit.  To access exported symbols in other modules, first the
3464         exporting module must name the symbols <modname>_LTX_<symname>,
3465         and the importing module must define a function type called
3466         <symname>_func.  The importer then adds
3467         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
3468         that wishes to call out to the exported functions.  Care must be
3469         taken that <symname> is non-NULL in the importing module incase
3470         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
3471         definition was in the importers source.  Study
3472         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
3473         m4_module_import will attempt to automatically load a module
3474         required for symbol access if it is not loaded already.
3476         * TODO: Removed the items fixed in this delta.
3477         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
3478         module name.
3479         * m4/ltdl.h (lt_dlhandle_find): Declare it.
3480         * m4/module.c (m4_module_unload): Use it.
3481         * src/freeze.c (reload_frozen_state): Ditto.
3482         * m4/m4module.h (m4_export): Deleted.  Removed all references.
3483         (M4_MODULE_IMPORT): New user convenience macro for importing
3484         arbitrary symbols from other modules.
3485         * m4/module.c (m4_module_import): New function to service
3486         M4_MODULE_IMPORT macro.
3487         (module_data): Removed.  Looking up the tables on demand with
3488         lt_dlsym, rather than caching their addresses here simplifies the
3489         code substantially.
3490         (m4_get_module_builtin_table, m4_get_module_macro_table):
3491         Removed.  Changed all callers.
3492         (set_module_macro_table, set_module_builtin_table): Renamed to
3493         install_macro_table and install_builtin_table respectively, and
3494         simplified now that the cache is no more.
3495         * modules/gnu.c (builtin_symbols): Use this new mechanism to
3496         import m4_dump_symbols from the m4 module.
3497         (builtin_esyscmd): Likewise for m4_set_sysval and
3498         m4_sysval_flush.
3499         * modules/m4.c (m4_export_table): Removed.  Functions are
3500         addressed with the new mechanism which doesn't need this.
3501         (m4_set_sysval): New exported accessor function to prevent
3502         problems with variable access on inferior architectures.
3503         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
3504         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
3505         that we can have some type safety.
3506         * modules/modtest.c (export_test): C level exported function for
3507         testing the new import mechanism.
3508         * modules/import.c: New file for the import end of the test.
3509         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
3510         * tests/modules.at: New test cases for intermodule symbol
3511         importing.
3513 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
3515         * m4/m4module.c (m4_string): Moved from here...
3516         * m4/m4private.c (m4_string): ...to here.
3518         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
3520 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
3522         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
3523         already available to module writers through
3524         m4_{get,set}_nesting_limit_opt(), so moved from here...
3525         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
3526         (m4_create): Use it.
3528 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
3530         Aside from auditing path.c for m4module.h api obfuscation, this
3531         delta introduces the concept of private struct members in opaque
3532         data types to GNU m4: See the STYLE file for details.
3534         * TODO: Remind ourselves that a rewrite of path.c is needed.
3535         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
3536         Moved from here...
3537         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
3538         here and renamed.  These type definitions are for internal api use
3539         only.  Changed all callers.
3540         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
3541         Moved from here...
3542         * m4/path.c (search_path_env_init, search_path_add): ...to here
3543         and renamed.  These calls were never used outside this file.
3544         Changed all callers.
3545         (dirpath): Moved functionality of this static declaration...
3546         * m4/m4private.h (struct m4): ...to this new internal only
3547         search_path field.  Changed all callers.
3548         (m4__get_search_path): Added new internal api accessor.
3549         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
3550         (m4_include_init): Removed...
3551         * m4/m4.c (m4_create): ...because the new m4 field is now
3552         initialised here.
3553         (m4_delete): Recycle search_path memory.
3554         * src/main.c (main): Don't call m4_include_init now that it's
3555         gone!
3556         * doc/STYLE: Document convention for private fields in opaque
3557         ADTs.
3559 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
3561         Sometimes exporting the address of a symbol from a module isn't
3562         enough for other modules to call that symbol correctly.  If
3563         custom data types are used for function parameters, they need to
3564         be known to the caller.  This change introduces the concept of
3565         $(prefix)/include/modules/$(modulename).h to declare those
3566         structures.  Also we move m4_dump_symbols from libm4 to the m4
3567         module to show this concept in action.
3569         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
3570         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
3571         exporting data structures from modules/m4.c.
3572         * modules/m4.c, modules/gnu.c: Include it.
3573         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
3574         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
3575         prototypes.
3576         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
3577         Moved from here...
3578         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
3579         ...to here, with slight renaming.
3580         (m4_export_table): Prototype and add m4_dump_symbols.
3581         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
3582         definition of m4_dump_symbols.
3583         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
3584         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
3586 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
3588         Create an export table in modules/m4.c in readiness for beefing up
3589         the module loader to track module exports and imports.
3591         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
3592         * m4/debug.c (m4_debug_flush_files): Moved...
3593         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
3594         * modules/gnu.c (builtin_esysval): Use it.
3595         * m4/m4module.h (m4_export): New type for declaring module symbols
3596         for export.
3597         * modules/m4.c (m4_export_table): List symbols exported from this
3598         module for use by other modules.
3600 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
3602         An experiment: There is loads of code in libm4 which should be in
3603         the m4 module, but is also used by another module. Just because
3604         some linkers won't cope with calls across dynamic runtime loaded
3605         objects I initially left the code in libm4.  It will tidy the
3606         module api immensely if this code moves to the right place, I just
3607         need to remember to invent a suitable calling mechanism at some
3608         point.  For now, only modules that are statically linked and
3609         preloaded will get this treatment, so the only platforms that will
3610         break are those that require all symbols to be resolved at link
3611         time.
3613         * TODO: Reminder that what I am doing could reduce portability
3614         unless I do something more robust later.
3615         * m4/m4module.h (m4_sysval): No longer exported from libm4.
3616         * m4/utility.c (m4_sysval): No longer declared in libm4.
3617         * modules/Makefile.am: Reformatting.
3618         * modules/m4.c (m4_sysval): Declare it at place of use.
3619         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
3621 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
3623         * m4/m4module.h: Reformatting and rearranging lines a bit.
3624         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
3625         all users.
3626         (m4_call_macro, m4_expand_input): Renamed...
3627         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
3628         callers.
3629         (m4_expansion_level, m4_process_macro): Moved...
3630         * m4/macro.c (expansion_level, process_macro): ...to here, and
3631         made static.
3633         * m4/m4module.h (program_name): Not used by modules at all, so
3634         moved...
3635         * src/main.c (program_name): ...to here.
3636         (print_program_name): Renamed...
3637         (print_program_name_CB): ...to conform to the STYLE guide.
3639 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
3641         More refactoring of the m4module.h API.  Replace #defines with an
3642         enum, and move non-public functions out of the public API.
3644         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
3645         inclusion.
3646         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
3647         * m4/debug.c (m4_debug, trace): Moved...
3648         * m4/m4private.h (struct m4): ...to fields of this struct.
3649         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
3650         for the new fields.
3651         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
3652         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
3653         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
3654         * m4/m4module.h (m4_context_field_table): Add entries for new
3655         debug_file and trace_messages fields.
3656         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
3657         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
3658         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
3659         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
3660         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
3661         (m4_is_debug_bit): New macro to simplfy checks against the debug
3662         bits above.
3663         (m4_trace_format, m4_trace_header, m4_trace_flush)
3664         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
3665         prototypes.
3666         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
3667         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
3668         * m4/macro.c (trace_format, trace_header, trace_flush)
3669         (trace_prepre, trace_pre, trace_post): ...to these newly static
3670         functions, since they are only ever used from this file.  Changed
3671         all callers.
3673 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
3675         Change the macros for checking syntax so that matching against
3676         multiple possible syntax classes can be done with a single
3677         comparison some of the time.  The various classes are now bits of
3678         an int that can be checked with bitwise logic operators.
3680         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
3681         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
3682         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
3683         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
3684         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
3685         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
3686         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
3687         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
3688         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
3689         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
3690         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
3691         Replace all calls with invocations of these...
3692         (m4_is_syntax, m4_has_syntax): ...New macros.
3693         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
3694         is no longer required with new macros.  Changed all callers.
3696 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
3698         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
3699         values are returned as part of the internal interface, so they
3700         need to be moved...
3701         * m4/private.h: ...to here.
3702         * m4/macro.c (expand_token): Check for out of range
3703         m4_peek_input() results before looking up in the syntax table.
3704         (collect_arguments): Ditto.
3706         * NEWS: Note `$' syntax class.
3708 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
3709             Gary V. Vaughan  <gary@gnu.org>
3711         Conform to POSIX if the POSIXLY_CORRECT environment is set.
3712         --traditional `define' now smashes all the definitions.
3714         * NEWS: Explain this.
3715         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
3716         (Extensions): Explain that extensions that are incompatible with
3717         POSIX are disabled if POSIXLY_CORRECT is set.
3718         (Incompatibilities): Remove.
3719         (Define, Other Incompat): Explain difference
3720         between GNU and POSIX behavior of define, pushdef, popdef.
3721         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
3722         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
3723         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
3724         (m4_get_posixly_correct_opt): New macro.
3725         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
3726         POSIXLY_CORRECT.
3727         * modules/m4.c (builtin_functions): defn now takes any number of args.
3728         (builtin_define): Smash all the definitions if
3729         POSIXLY_CORRECT.
3730         (builtin_defn)): Allow any number of arguments.
3731         (builtin_undivert): Do not allow nonnumeric arguments
3732         if POSIXLY_CORRECT.
3733         * src/main.c (main): Set posixly-correct behavior if either
3734         POSIXLY_CORRECT is set, or if -G is given.
3735         * tests/builtins.at: New test for smashed definitions.
3737 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
3739         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
3740         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
3741         not to slow the parser down.
3742         (M4__IS_STRING): New macro to test string syntax class membership.
3743         * m4/syntax.c: Adjust docucomment.
3744         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
3745         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
3746         * m4/input.c (init_builtin_token): Comment typo.
3747         (m4__next_token): Comment typo.
3748         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
3749         by using the new M4__IS_STRING macro.
3750         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
3751         variable references in macro expansions.
3753         * doc/m4.texinfo (Eregexp and Regexp): Typo.
3754         (Epatsubst and Patsubst): Typo.
3755         (Eval): Typo.
3757 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
3759         Move the global variables that pertain to syntax to a new `struct
3760         m4_syntax_table', and then add one of these to `struct m4'.  The
3761         ripple effect through the code to both change formerly global
3762         references, and make sure a suitable context is available in
3763         lexical scope is disproportionately large compared to the size of
3764         the change proper.  This change is a large part of decoupling
3765         syntax.c from the rest of the code that uses it.
3767         * m4/m4private.h (struct m4): Add a syntax field.
3768         * m4/m4.c (m4_create): Initialise it,
3769         (m4_delete): Recycle it.
3770         (m4_get_symtab): Remove hand coded version...
3771         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
3772         callers.
3773         * m4/m4module.h (m4_context_field_table): Add an extra field so we
3774         can generate m4_get_symbol_table.  Add a new row for
3775         m4_get_syntax_table.
3776         (M4SYNTAX): Syntactic sugar for module writers.
3777         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
3778         (m4_syntax_table): New home for syntax related formerly global
3779         variables.
3780         * m4/m4private.h (struct m4_syntax_table): Define it.
3781         * m4/input.c (m4_input_init): Initialisation of these formerly
3782         global variables moved...
3783         * m4/syntax.c (m4_syntax_create): ...to here.
3784         * m4/input.c (m4_input_exit): And similarly, recycling of the
3785         memory used by those values moved...
3786         * m4/syntax.c (m4_syntax_delete): ...to here.
3787         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
3788         Moved to m4/m4private.h.
3789         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
3790         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
3791         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
3792         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
3793         objects.  Changed all callers that used to directly access the
3794         global equivalents.
3795         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
3796         Removed and incorporated into m4_syntax_table structure.
3797         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
3798         * m4/syntax.c (m4_set_syntax): Now returns an error status,
3799         instead of requiring a `struct m4' to generate its own errors.
3800         Changed all callers.
3801         * src/main.c (main): Now that the syntax table is initialised as
3802         part of m4_create, we have to manually wipe the syntax entries if
3803         we are about to read a frozen file.
3805 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
3807         * doc/STYLE: Added notes on callback naming schemes.
3809         * m4/module.c (m4_set_module_macro_table)
3810         (m4_set_module_builtin_table): Declarations weren't changed when
3811         definitions were renamed on 2003-06-19.
3813         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
3814         neither used nor particularly appropriate since it exposes the
3815         internal workings of the hash module.  I haven't yet decided
3816         whether to remove it entirely.
3818 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
3820         Two related changes, and a huge knockon effect throughout the
3821         source: Moved the option variables out of global space and into
3822         `struct m4'; made `m4_symtab' a real datatype, so that its api
3823         is not marred passing `struct m4' around just so it can decide
3824         whether to keep traced symbol names or not.  Added setters and
3825         getters for the formerly global option variables, and obviously
3826         changed a vast number of functions to take a `struct m4' and use
3827         the getter funcs to find option values.
3829         * m4/utility.c (interactive, sync_output, debug_level)
3830         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
3831         (max_debug_argument_length, warning_status, nesting_limit)
3832         (discard_comments): Removed.
3833         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
3834         (debug_level, max_debug_argument_length, prefix_all_builtins)
3835         (suppress_warnings, discard_comments, interactive, sync_output):
3836         Removed from here...
3837         * m4/m4private.h (struct m4): ...and equivalent fields added to
3838         this structure.
3839         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
3840         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
3841         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
3842         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
3843         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
3844         macros for the new fields.
3845         * m4/m4module.h (m4_context_field_table)
3846         (m4_context_opt_bit_table): Helper macros used to generate
3847         prototypes, setters and getters for new option fields
3848         consistently.
3849         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
3850         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
3851         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
3852         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
3853         (m4_get_interactive_opt, m4_get_sync_output_opt)
3854         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
3855         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
3856         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
3857         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
3858         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
3859         setter and getter functions generated by cpp from
3860         m4_context_field_table and m4_context_opt_bit_table, exported as
3861         part of the module api.  Changed all callers.
3862         * m4/symtab (struct m4_symtab): Used as the concrete type for
3863         m4_symtab now.
3864         (m4_symtab_create): Allocate and initialise a new struct.
3865         (m4_symtab_apply): New function that works like m4_hash_apply, but
3866         with different callbacks specific to symbol tables.  Changed all
3867         callers.
3868         (symbol_destroy, arg_destroy, arg_copy): Renamed
3869         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
3870         they have unused parameters for a reason!
3871         (dump_symbol_CB): New callback to dump the contents of a single
3872         symbol.
3873         (symtob_dump): Rewritten in terms of dump_symbol_CB.
3874         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
3875         Changed all callers.
3876         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
3877         of the contained `m4_symtab' at the `no_gnu_extensions' field.
3878         Although I'm not convinced these semantics are correct, they are
3879         at least consistent with how things were before this delta.  Also
3880         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
3882 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
3884         Tie down the interface to libm4 some more.  Make more structures
3885         opaque to modules by moving them to m4private.h, and writing
3886         setters and getters.  To win back the speed penalty for doing this
3887         also wrote macroized versions that do know about structure layout
3888         in m4private.h and #include that file into modules when NDEBUG is
3889         defined at compile time.  There are still some accessor macros in
3890         m4private.h that need to go, but that is not necessary to clean
3891         the module api up.
3893         * m4/m4module.h (m4_symbol_type): Moved...
3894         * m4/m4private.h (m4__symbol_type): ...to here.
3895         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
3896         (m4_set_symbol_traced, m4_set_symbol_name_traced)
3897         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
3898         (m4_get_symbol_func, m4_symbol_value_create)
3899         (m4_symbol_value_delete, m4_set_symbol_value_text)
3900         (m4_set_symbol_value_func): New exported api to symbols.
3901         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
3902         and m4_is_symbol_value_func.
3903         * m4/m4module.h: Prototype these guys.
3904         * m4/module.c (m4_set_module_macro_table)
3905         (m4_set_module_builtin_table): Make these static, there is no
3906         reason to pollute the api with them.
3907         * m4/m4private.h: Reformatting.
3908         (m4_get_symtab): Only define when NDEBUG is defined.
3909         (m4_get_symbol_value, m4_get_symbol_traced)
3910         (m4_set_symbol_traced, m4_set_symbol_name_traced)
3911         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
3912         (m4_get_symbol_func, m4_symbol_value_create)
3913         (m4_symbol_value_delete, m4_set_symbol_value_text)
3914         (m4_set_symbol_value_func): Macro implementations of the new
3915         functions when NDEBUG is defined.
3916         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
3917         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
3918         Superceded by the above.  All callers changed.
3919         (M4ARG): Removed.  This is no longer different to the
3920         m4/m4module.h definition.
3921         * modules/gnu.c, modules/m4.c: Only include m4private.h when
3922         NDEBUG is defined.  That way we exercise the same (albeit slower)
3923         api that external modules must use.
3925 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
3927         Renamed some of the types and their accessors to make more sense.
3928         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
3929         has a stack of SYMBOL_VALUEs.
3931         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
3932         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
3933         m4_get_symbol_value_type,  m4_get_symbol_value_text,
3934         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
3935         Changed all callers.
3936         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
3937         (m4_get_token_type): Renamed
3938         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
3939         to the internal api.
3940         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
3941         s/TOKEN_/VALUE_/
3942         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
3943         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
3944         (m4__token_type): Moved here from m4module.h.
3945         (m4__next_token): Renamed from m4_next_token.
3946         * m4/symtab.c: Removed some of the parameterised macro support
3947         functions for modularisation later.
3948         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
3949         m4_hash_dup to perform a true deep copy of the SRC.
3950         (arg_copy): Callback for m4_symbol_value_copy.
3951         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
3952         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
3953         m4_get_symbol_value_func.  Changed all callers.
3955 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
3957         Tidy up style of hash.[ch] in accordance with doc/STYLE.
3959         * m4/hash.c: Internal symbol renaming and formatting.
3960         (m4_hash_dup): New function to facilitate deep copies of hash
3961         tables.
3962         (m4_hash_apply_func): Returns a void* now, which is a richer type
3963         for returning exceptions (NULL means keep going).
3964         (m4_hash_apply): Ditto.
3965         * m4/hash.h: Declare exported symbols with an explicit extern.
3966         Reformated.
3968 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
3970         Still refactoring furiously.  This delta represents a change in
3971         semantics to symtab.c.  Instead of building temporary m4_tokens
3972         in the caller, and copying fields in the methods, we now create
3973         the actual m4_token for hashing in the caller so the methods just
3974         slot them in directly.  Also, this means that we don't lookup a
3975         symbol and get back an allocated but VOID token to copy fields
3976         into, we create the token we want to push and pass that to
3977         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
3978         a few other small changes to stop knowledge of the implementation
3979         of symtab.c leaking out into other files.
3981         * m4/macro.c (expand_argument): Comment typo corrected.
3982         * m4/symtab.c (symtab_fetch): New function to fetch the address of
3983         an interned symbol.
3984         (m4_symbol_pushdef): Take an extra value parameter and use this
3985         directly as the new top of the value stack.  All callers changed
3986         to build a token and pass responsibility for memory in, rather
3987         than copying as we used to.
3988         (m4_symbol_define): Also use the new value parameter directly as a
3989         replacement for the top of the value stack.  All callers changed
3990         to build a token as above.
3991         (m4_set_symbol_traced): New function to set the traced bit on the
3992         named symbol, creating it if necessary.
3993         (symbol_popval): The guts of the old m4_symbol_popdef.
3994         (m4_symbol_popdef): Use it.
3995         * m4/builtin.c (m4_symbol_set_token): Removed,
3996         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
3997         replaced...
3998         * m4/module.c (m4_set_module_builtin_table)
3999         (m4_set_module_macro_table): ...with these more orthogonal
4000         functions.
4001         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
4002         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
4003         required.
4004         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
4005         (m4_arg_signature_parse): Moved...
4006         * m4/symtab.c: ...to here.
4007         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
4008         screw something up. Moved...
4009         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
4010         actually does a proper deep copy of source to dest.
4012 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
4014         Further refactoring to stabilise the module API.  Renaming some
4015         functions for orthogonality, and judicious definition migration to
4016         move things out of the set of exported symbols.
4018         * doc/STYLE: New file.  Notes on coding style.
4019         * m4/m4module.c: Updated bitrotted docucomment at the top of the
4020         file.
4021         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
4022         m4_get_module_name, m4_get_module_builtin_table,
4023         m4_get_module_macro_table which are verb phrases.  Changed all
4024         callers.
4025         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
4026         Moved to...
4027         * m4/module.c (m4_set_module_builtin_table)
4028         (m4_set_module_macro_table): ...here, and renamed. Changed all
4029         callers.
4030         * m4/m4module.c (m4_module_data): This...
4031         * m4/m4private.c (struct m4_module_data): ...and this...
4032         * m4/module.c (module_data) ...consolidated here and no longer
4033         exported.  Changed all callers.
4035 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
4037         Begin work on lifting the curse of the global variables.  To start
4038         with create a `struct m4' context container, and replace
4039         `m4__symtab' with `context->symtab' throughout.  This means
4040         initialising a context container in main, and adjusting many
4041         functions between main and the module entry points so that the
4042         container gets passed through.  It would have been nice to
4043         defer this until after 1.5, but it has a major effect on the
4044         user's module writing ABI, so it needs to be addressed now - at
4045         least in the areas that impact the ABI.  An interrelated change
4046         in the symtab API removes the dependency on a global symbol table,
4047         and instead focuses on a passed table (from the context
4048         container).
4050         * TODO: Reminders for finishing context functionality.
4051         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
4052         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
4053         global variables and eventually allow m4 to be reentrant.
4054         * m4/m4private.h (m4): Define the new structure here...
4055         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
4056         don't carry the overhead of a function call.
4057         * m4/m4module.h: Prototype extern functions from m4/m4.c.
4058         (m4): Declare type for new struct m4 objects.
4059         (M4SYMTAB): User macro to ease finding the symbol table for the
4060         current context for module developers.
4061         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
4062         verb.
4063         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
4064         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
4065         (m4_call_macro, m4_dump_symbols, m4_expand_input)
4066         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
4067         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
4068         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
4069         m4* context parameter. Changed definitions and all callers.
4070         (m4_symtab): Alias for m4_hash to decouple the
4071         m4_symtab api from m4_hash.
4072         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
4073         m4_hash.
4074         (m4_symtab_create): New function to return an initialised
4075         m4_symtab.
4076         (m4_symtab_delete): New function to delete an m4_symtab's memory.
4077         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
4078         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
4079         instead of simply using the global m4__symtab.  Changed
4080         definitions and all callers.
4081         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
4082         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
4083         * src/main.c (main): Create a context and use that instead of the
4084         former global m4__symtab.
4086 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
4088         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
4089         to the callback.  Callbacks should not need to hardcode the
4090         hashtable they are working from, nor should we have to waste the
4091         userdata parameter to pass the table in.
4092         * m4/hash.h (m4_hash_apply_func): Require the initial table
4093         parameter.
4094         * m4/symtab.c (symtab_destroy): Use the passed table instead
4095         of hardcoding m4__symtab.
4096         (m4_symbol_popdef): Don't use the userdata parameter to pass the
4097         table to arg_destroy.
4098         (arg_destroy): Use the hash parameter, ignore userdata.
4099         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
4100         prototype.
4101         (traceon, traceoff): Call set_trace with the extra initial
4102         parameter.
4104 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
4106         More refactoring to stabilise the module api, this time for
4107         symtab.c.  Additionally, start to pay attention to function names
4108         that don't contain a verb like they should.
4110         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
4111         wrapper for m4_hash_apply to decouple the symtab module from the
4112         hash module.
4113         (m4_symbol_builtin, m4_symbol_macro): Renamed to
4114         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
4115         callers.
4116         (m4_symbol_delete): Create a macro version to save a function
4117         call.
4118         (m4_token_t, m4_data_t): These violate the POSIX reserved
4119         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
4120         all callers.
4121         (m4_token_type): Renamed to m4_token_get_type.
4122         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
4123         (m4_symtab_exit): Removed from the exported module
4124         api...
4125         * m4/m4private.h (m4__symtab, m4__symtab_init)
4126         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
4127         renamed and added to the internal api. Changed all callers.
4128         (m4_symtab_apply): A faster macro version of the function for
4129         users of the internal api.
4130         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
4131         symbol_destroy and arg_destroy.
4132         (symtab_debug): Added a prototype.
4133         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
4134         so that callers in this file get the faster macro versions from
4135         m4/m4private.h.
4137 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
4139         Refactoring modules to rationalise the API into an external
4140         documented (eventually!) API for use by modules in the `m4_'
4141         namespace declared in m4/m4module.h, an internal API between the
4142         source files we ship (including our shipped modules) in the `m4__'
4143         namespace declared in m4/m4private.h and making the rest as
4144         cohesive as possible with liberal use of the `static' keyword.
4145         This change represents an audit to m4/module.c along these
4146         guidelines.
4148         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
4149         Removed.  No longer used.
4150         (m4_module_close): Removed prototypes.
4151         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
4152         from the exported module api...
4153         * m4/m4private.h (m4__module_init, m4__module_open)
4154         (m4__module_exit): ...and renamed and added to the internal api.
4155         Changed all callers.
4156         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
4157         Centralised definitions after renaming...
4158         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
4159         (M4_FINISH_SYMBOL): ...and removing from here.
4160         (m4_module_dlerror, m4_module_remove, m4_module_close)
4161         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
4162         module_remove, module_close and caller_id.
4163         (MODULE_SELF_NAME): New macro to make reporting self errors
4164         easier.
4165         (m4_module_load, module_close, module_remove): Use it.
4166         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
4167         name.
4168         * src/main.c (main): Use it.
4170 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
4172         * README: Remove references to --enable-changeword, which has been
4173         removed from the code.
4175 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
4177         Getting rid of the annoying bug with configure --enable-debug,
4178         which spewed -e: command not found errors.  This was an interaction
4179         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
4180         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
4181         branch-1-5) to get the full fix.
4183         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
4184         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
4185         and then use the probed value of $SED.
4186         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
4187         this, it messes up the AC_REQUIRE stack.
4189 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
4191         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
4192         the destroy callback.
4193         (m4_arg_destroy): Use the hash address to free the hash node key
4194         field.
4196 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
4198         First cut at formal parameters in macros.
4200         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
4201         * m4/xstrzdup.c: New file.
4202         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
4203         associative array of parameter names to details.
4204         (m4_symbol_token): Capture macro names with parameter lists.
4205         (m4_arg_signature_parse): And build an associative array to hang
4206         from the symbol structure to map names to details.
4207         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
4208         m4_hash_resize idiom.  Now that we potentially add a little hash
4209         table to many of the entries in the symbol table, added an extra
4210         arg to set the initial size.  Changed all callers.
4211         (m4_hash_apply): New function that is basically a generalised
4212         version of...
4213         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
4214         all callers to call m4_hash_apply instead.
4215         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
4216         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
4217         m4_arg_signature association that might be attached to the symbol,
4218         * m4/hash.h (m4_hash_apply_func): Replacement type for...
4219         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
4220         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
4221         parameter lists.
4222         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
4223         (M4_IS_IDENT): Detect characters that can be safely used in
4224         parameter names.
4225         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
4226         * m4/macro.c: Corrected grammar in some comments.  Use `token'
4227         rather than `td' for m4_token variables.
4228         (m4_process_macro): If we find a dollar followed by some
4229         M4_IS_IDENT characters, replace that with the contents of the argv
4230         entry with offset stored in the m4_token_arg associated with the
4231         collected identifier.
4233 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
4235         Begin preparations for supporting formal parameters in m4 macros.
4237         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
4238         the details of a formal parameter.
4239         (m4_token): Add an arg_signature member to hold a hash table for
4240         looking up formal parameters.
4241         * m4/input.c: Update more bitrotted comments.
4242         (m4_push_builtin): Initialise arg_signature member.
4243         (init_builtin_token): Copy arg_signature member.
4244         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
4245         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
4246         replace...
4247         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
4248         (m4_macro_pushdef, m4_macro_define): ...these, And...
4249         (m4_symbol_token): ...wrapped around this new function, which
4250         vastly simplifies the arguments required by the functions it
4251         replaces.
4252         Changed all callers.
4254 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
4256         * m4/macro.c: Format changes.
4258 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
4260         * m4/input.c: Updated various bitrotted comments.
4261         (m4_push_builtin): Just pass the whole m4_token, rather than
4262         extracting all the fields in the caller.  This also allows us to
4263         check the token type for consistency.
4264         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
4265         Renamed to builtin_funcs, builtin_peek, builtin_read,
4266         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
4267         the code.  Changed all callers.
4268         (struct input_block): Similarly renamed u_m member to u_b, and
4269         changed all callers.
4270         (m4_next_token): Use bzero to initialise the data fields.
4271         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
4273 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
4275         These changes were necessary to get m4 to build on my iBook
4276         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
4277         (GCC) 3.1 20020420 (prerelease)":
4279         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
4280         inclusion of module loader headers.
4281         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
4282         * m4/Makefile.am: Ditto.
4283         (libm4_la_LIBADD): Added $(LTLIBINTL).
4284         * m4/utility.c (program_name): Removed declaration in favour of
4285         the one already in error.c!
4286         * m4/m4module.h (program_name): Define to program_invocation_name
4287         when using GNU C library. Use an explicit extern declaration.
4288         (interactive, sync_output, debug_level, hash_table_size)
4289         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
4290         (suppress_warnings, warning_status, nesting_limit, discard_comments)
4291         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
4292         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
4293         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
4294         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
4295         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
4296         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
4297         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
4298         (m4_current_line, m4_current_diversion, m4_output_current_line):
4299         Don't rely on default, use an explicit extern.
4300         * m4/error.h (error, error_at_line, error_print_progname)
4301         (error_message_count, error_one_per_line): Ditto.
4302         * m4/ltdl.c: Update from CVS libtool.
4303         * m4/ltdl.h: Ditto.
4304         * commit: Update from CVS cvs-utils.
4306 2002-11-04  gettextize  <bug-gnu-gettext@gnu.org>
4308         * po/Makefile.in.in: Upgrade to gettext-0.11.5.
4309         * po/boldquot.sed: New file, from gettext-0.11.5.
4310         * po/en@boldquot.header: New file, from gettext-0.11.5.
4311         * po/en@quot.header: New file, from gettext-0.11.5.
4312         * po/insert-header.sin: New file, from gettext-0.11.5.
4313         * po/quot.sed: New file, from gettext-0.11.5.
4314         * po/remove-potcdate.sin: New file, from gettext-0.11.5.
4315         * po/Rules-quot: New file, from gettext-0.11.5.
4317 2002-11-04  Akim Demaille  <akim@epita.fr>
4319         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
4320         running m4 itself.
4321         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
4323 2002-11-04  Akim Demaille  <akim@epita.fr>
4325         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
4327 2002-11-04  Akim Demaille  <akim@epita.fr>
4329         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
4330         used as `external', and Libtool 1.4.3.
4331         (LINGUAS): Remove.
4332         (LTLIBOBJS): Don't play with it.
4333         * intl/: Remove.
4334         * Makefile.am (SUBDIRS): Remove intl.
4335         (ACLOCAL_AMFLAGS): Add -I config.
4336         (EXTRA_DIST): Add config/config.rpath.
4337         * po/LINGUAS: New.
4338         * po/Makevars: New.
4339         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
4341 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
4343         Preparations for refactoring syntax tables to allow reverse
4344         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
4345         speed of normal lookups in an array of unsigned short.
4347         * m4/input.c (single_quotes, single_comments, use_macro_escape):
4348         Moved from here...
4349         * m4/m4private.h (m4__single_quotes, m4__single_comments,
4350         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
4351         is for internal symbols which unavoidably pollute the global
4352         namespace, but are not published APIs.
4353         Adjusted all callers.
4354         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
4355         m4_set_comment, m4_set_syntax, set_syntax_internal,
4356         unset_syntax_attribute): Moved from this file...
4357         * m4/syntax.c: New. ...to this file.
4358         Also added an m4_syntax_exit stub for orthogonality.
4359         * src/main.c (main): Use it.
4360         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
4361         * m4/m4module.h: Reformatting.  New prototypes.
4363 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
4365         * bootstrap (aclocal_apiversion): The aclocal apiversion is
4366         distinct from the automake release number (in that the apiversion
4367         apparently has no micro-version-component).
4368         (aclocal_apilibdir): Use it.
4370 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
4372         * m4/hash.c (m4_hash_resize): New function.
4373         * m4/hash.h: Add prototype.
4374         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
4375         benchmarking to find a good value for, say, autoconf.  This is
4376         already a little quicker than before for me.
4378         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
4379         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
4380         and reenamed.
4381         * m4/hash.h: Adjust prototypes.
4383 2002-01-22  Akim Demaille  <akim@epita.fr>
4385         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
4386         APIVERSION scheme.
4387         * tests/Makefile.am (package.m4): New.
4388         * tests/atlocal.in: Adjust to CVS Autotest.
4389         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
4390         * configure.ac: LIBOBJ is a forbidden string.
4391         Simplify AM_INIT_AUTOMAKE invocation.
4392         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
4393         options.m4.
4395 2002-01-21  gettextize  <bug-gnu-utils@gnu.org>
4397         * po/Makefile.in.in: Upgrade to gettext-0.10.40.
4399 2001-10-19  Akim Demaille  <akim@epita.fr>
4401         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
4403 2001-10-19  Akim Demaille  <akim@epita.fr>
4405         * m4/input.c (m4_next_token): Display where was opened what is
4406         not closed.
4408 2001-10-19  Akim Demaille  <akim@epita.fr>
4410         * m4/macro.c (expand_argument): Display where was opened what is
4411         not closed.
4413 2001-10-18  Akim Demaille  <akim@epita.fr>
4415         * m4/input.c, modules/m4.c: Formatting changes.
4417 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
4419         * bootstrap: s/configure.in/configure.ac/
4421 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
4423         * m4/symtab.c (m4_symbol_destroy): This function calls
4424         m4_symbol_popdef, which recycles a symbols memory when the last
4425         definition is popped.  Since we were passing the address of the
4426         symbol name found in the symbol table, and it was being removed
4427         partway through m4_symbol_destroy() we were referencing freed
4428         memory for the balance of the function.  Now we take a copy of the
4429         symbol name tring and use that as a key into the symbol
4430         table... that way if the original symbol name is freed, the copy
4431         is still valid.
4433 2001-10-13  Akim Demaille  <akim@epita.fr>
4435         * m4/ltdl.c: Update.
4437 2001-10-13  Akim Demaille  <akim@epita.fr>
4439         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
4440         Don't gettextize internal error messages.
4442 2001-10-13  Akim Demaille  <akim@epita.fr>
4444         * tests/macros.at (Arity and defn): New failing test.
4445         (Arity, defn, and freeze): New.
4447         Fix `Arity and defn'.
4449         * m4/input.c (m4_push_macro): Don't forget the arity.
4450         * modules/m4.c (defn): Likewise.
4452 2001-10-13  Akim Demaille  <akim@epita.fr>
4454         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
4455         to...
4456         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
4457         (Propagation of traceon, Propagation of --trace): this new file.
4459 2001-10-13  Akim Demaille  <akim@epita.fr>
4461         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
4462         interface instead of (name, argc...).
4463         Upon failure, specify which argument was guilty.
4464         Adjust callers.
4466 2001-10-13  Akim Demaille  <akim@epita.fr>
4468         * modules/evalparse.c: Save translators' time: don't translate
4469         internal error messages.
4470         (m4_evaluate): Simplify/normalize error messages.
4471         * doc/m4.texinfo (Eval): Adjust.
4473 2001-10-13  Akim Demaille  <akim@epita.fr>
4475         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
4476         where no checking is needed.
4477         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
4478         interface instead of (name, argc...).
4479         Adjust callers.
4480         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
4481         elsewhere.
4483 2001-10-13  Akim Demaille  <akim@epita.fr>
4485         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
4486         exclude the builtin name from the count.
4487         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
4488         calling ifelse with a single argument is valid.
4489         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
4490         with 1 and 2 args, mostly to strengthen the test suite.
4492 2001-10-13  Akim Demaille  <akim@epita.fr>
4494         * m4/output.c (m4_make_diversion, m4_insert_file)
4495         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
4497 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
4499         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
4500         since we call these things builtins in the rest of the code!
4502         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
4504 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
4506         Rather than forcing each builtin definition to manage its own
4507         argument range checking, tabulate the maxima and minima for all
4508         builtins in each module.  This forces us to consider what the
4509         valid ranges for each builtin should be, and moves the checking
4510         code out of each builtin implementation and into the builtin
4511         caller infrastructure.
4513         * m4/m4module.h (struct m4_builtin): Add argument minima and
4514         maxima.
4515         * m4/m4private.h (struct m4_token): Reflect them here too.
4516         * m4/input.c (struct input_block): ...and here.
4517         (m4_token_copy): New function for token copying.
4518         (init_macro_token): Copy them from a token to the input stack.
4519         (m4_next_token): Don't forget to initialise them for text
4520         macros.
4521         * m4/macro.c (expand_argument): Use m4_token_copy, and also
4522         check argument counts before calling the builtin handler.
4523         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
4524         (m4_symbol_macro): Likewise.
4525         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
4526         parameters.  Updated all callers.
4527         (m4_builtin_define): Ditto.
4528         (m4_macro_pushdef, m4_macro_define): Ditto.
4529         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
4530         * modules/evalparse.c:  Declare argument counts for defined
4531         builtins and remove explicit calls to m4_bad_argc().
4532         * modules/gnu.c: Ditto.
4533         * modules/load.c: Ditto.
4534         * modules/m4.c: Ditto.
4535         * modules/modtest.c: Ditto.
4536         * modules/mpeval.c: Ditto.
4537         * modules/perl.c: Ditto.
4538         * modules/shadow.c: Ditto.
4539         * modules/stdlib.c: Ditto.
4540         * modules/time.c: Ditto.
4541         * TODO: Updated.
4543 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
4545         The trace semantics now attach the trace bit to a symbol name.
4546         For as long as a traceon(`foo') is active, calls to foo will be
4547         traced regardless of intervening undefines or module unloads.
4548         Fixed the flag propogation issues differently to the fixes
4549         reverted with the last attempt at nailing down trace:
4551         * m4/m4private.h:  This file is not visible outside of the m4
4552         source tree, so I removed all the `M4_' and `m4_' prefixes to save
4553         on typing.  Updated all clients.
4554         (m4_token): New typedef contains the fields that need to be passed
4555         around with the low level tokeniser.
4556         (m4_token_data):  Removed.
4557         (m4_symbol): Now contains the traced flag again.
4558         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
4559         the trace bit set.  This change is contained entirely within this
4560         module and doesn't leak out into the callers.  Updated all
4561         clients.
4562         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
4563         new fields in m4_token.  Updated all clients.
4564         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
4565         that `groks_macro_args' and `blind_if_no_args' flags are retained
4566         when defn() results are passed around in m4 code.  Updated all
4567         callers.
4568         (m4_builtin_define): Ditto.
4569         (m4_macro_pushdef, m4_macro_define): Ditto.
4570         * m4/input.c (struct input_block): Add a flags field to facilitate
4571         the above.
4572         (m4_push_macro):  ...use it.
4573         (init_macro_token):  Retrieve it.
4574         (m4_next_token): Initialise it.
4575         * m4/macro.c (expand_argument):  Copy it.
4576         * m4/m4module.h: Adjust.
4577         * tests/builtins.at:  Adjust the expected output of the trace
4578         tests to reflect the change in semantics.
4579         * tests/modules.at (modules: trace):  Check that unloading a
4580         module which supplies a traced symbol definition doesn't lose te
4581         trace bit.
4583 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
4585         * modules/gnu.c (m4_macro_table): Display the timetamp when
4586         expanding __m4_version__.
4588         * configure.ac (--with-modules): Forgot a comma in the
4589         AC_HELP_STRING parameter list.
4591 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
4593         * bootstrap: Remove aclocal.m4t when it is no longer required.
4595 2001-10-05  Akim Demaille  <akim@epita.fr>
4597         * tests/Makefile.am: Adjust for gnuprog2.
4598         * tests/m4.in: There can be a leading path.
4599         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
4600         * tests/testsuite.at: Adjust to the most recent Autotest.
4601         (AT_CHECK_M4_FILTER): Fix and rename as...
4602         (AT_TEST_M4): this.
4603         * tests/others.at: Use it.
4605         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
4606         variable in shell scripts, one uses `$'...
4608 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
4610         * configure.ac: `rm -f $m4_getopt_h' was lost.
4612 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
4614         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
4615         time.  Define it for config.h in order to...
4616         * src/main.c (main): ...display the timestamp for --version.
4618 2001-10-04  Akim Demaille  <akim@epita.fr>
4620         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
4621         previous builtins `regexp' and `patsubst'.
4622         (regexp, patsubst): Use them.
4623         (eregexp, epatsubst): New builtins.
4624         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
4625         (Epatsubst and Patsubst, Eregexp and Regexp): these.
4626         (Extensions): More info on REs.
4628 2001-10-04  Akim Demaille  <akim@epita.fr>
4630         * modules/modtest.c (init_handler): Consistently output to stderr.
4631         (finish_handler): New.
4632         (test): The `if' is an `assert'.
4633         * tests/modules.at: Adjust.
4635 2001-10-04  Akim Demaille  <akim@epita.fr>
4637         * m4/utility.c (m4_bad_argc): Detail the mismatches.
4639 2001-10-01  Akim Demaille  <akim@epita.fr>
4641         * tests/generate.awk: Tag the tests with `documentation'.
4642         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
4643         Use the make the existing modtest tests more uniform, and complete
4644         the set of possibilities.
4646 2001-10-01  Akim Demaille  <akim@epita.fr>
4648         * config/gmp.m4: Consult the user before using GMP: use
4649         --without-gmp.
4650         * configure.ac: Adjust.
4651         * modules/gmp.c: No protection needed as the module is not built
4652         if GMP is not used.
4654 2001-10-01  Akim Demaille  <akim@epita.fr>
4656         * tests/generate.awk: Remove debugging code.
4657         (fatal): Specify the current location.
4659         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
4660         * modules/gnu.c, modules/m4.c: Use M4ARG.
4662 2001-10-01  Akim Demaille  <akim@epita.fr>
4664         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
4665         (m4_regexp_compile): New.
4666         (regexp, patsubst): Use it.
4668 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
4670         Reinstate the memory handling improvements from the patch I just
4671         reverted.  Relevant ChangeLog entries repeated here:
4673         * m4/module.c (m4_module_remove): New function that holds the core
4674         of the old m4_module_unload.
4675         (m4_module_unload): Use it.
4676         (m4_module_unload_all): When we know the modules will never be
4677         used again (i.e. on exit), free up as much module memory as
4678         possible.  There are still some artifacts from resident modules
4679         living inside ltdl.c, but everything else is freed.
4680         * m4/debug.c (m4_debug_exit): Free memory allocated in
4681         m4_debug_init().
4682         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
4683         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
4684         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
4685         * m4/m4module.h: Updated prototypes.
4686         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
4687         * m4/hash.h: Updated prototypes.
4688         * src/main.c (main): Use all these new functions to clean up as
4689         much memory as possible before exit.
4691 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
4693         Reverted my large patch for removing the old m4_symbol
4694         structure on 2001-09-20.  We are still not happy about the way
4695         trace works in conjunction with defn and undefine, and leaving
4696         the reverted patch active prevents us from moving the traced
4697         bit from the definition back to the symbol.
4699 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
4701         * configure.in: Moved to...
4702         * configure.ac: ...here.  Added a libtool like timestamped
4703         banner, and tidied up the libltdl cruft.
4704         * config/mkstamp: Script to extract a timestamp from ChangeLog.
4705         * modules/Makefile.am (INCLTDL):  Removed.  This is required
4706         only when libltdl is configured in a subdirectory.
4707         * src/Makefile.am: Ditto.
4708         (LIBADD_DL):  No need to add this again, libtool already knows
4709         that libm4.la depends on it.
4710         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
4711         them.
4713         * TODO: stackovf.c is basically broken.
4714         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
4716 2001-09-28  Akim Demaille  <akim@epita.fr>
4718         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
4720 2001-09-27  Akim Demaille  <akim@epita.fr>
4722         * tests/m4.in: Don't use short options.
4723         Simplify the stderr signature normalization.
4725 2001-09-27  Akim Demaille  <akim@epita.fr>
4727         tests/m4 shall be position independent.
4729         * tests/m4.in: New.
4730         * tests/m4: Remove.
4731         * tests/testsuite.at: No args to AT_INIT.
4732         * configure.in, tests/Makefile.am: Adjust.
4734 2001-09-22  Akim Demaille  <akim@epita.fr>
4736         Autotest has changed again.
4738         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
4739         (package.m4): Remove.
4740         * configure.in: Adjust to LIBADD_GMP.
4742 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
4744         * config/gmp.m4 (AC_ARG_WITH): Removed.
4745         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
4746         (AC_LIB_GMP): When performing a test compile against libgmp,
4747         include the header gmp.h if possible, and link against -lgmp.  If
4748         they both work define USE_GMP.
4749         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
4750         (mpeval_LTX_init_func): Complain on load that there was no libgmp
4751         at compile time.
4753 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
4755         * m4/evalparse.c: Moved to...
4756         * modules/evalparse.c:  ...here.  This code is shared between
4757         modules/mpeval.c and modules/m4.c, so there is no need to pollute
4758         the libm4 API with its details.  Moderately rewritten to interface
4759         into its clients more simply.
4760         * m4/eval.c: Deleted.  Migrated functionality to...
4761         * modules/m4.c: ...here.
4762         (builtin_eval):  Implemented in terms of the new interface style.
4763         * modules/mpeval.c (builtin_mpeval): Ditto.
4764         * m4/m4module.h: Removed references to the former m4/eval.c.
4765         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
4766         (EXTRA_libm4_la_SOURCES): Deleted.
4767         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
4768         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
4770 2001-09-20  Akim Demaille  <akim@epita.fr>
4772         * config/gmp.m4 (AM_WITH_GMP): Rename as...
4773         (AC_LIB_GMP): this.
4774         By default, use gmp.
4775         Massive revamping.
4776         * configure.in: Adjust.
4777         Use Automake conditionals for USE_GMP.
4778         Always compute sizeof (long long int).
4779         This was a bug BTW, as `eval' (not `mpeval') depends on it:
4780         before, it was used _only_ if mpeval was not activated.
4781         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
4782         (mpeval_la_LIBADD): New macros.
4783         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
4784         Indent.
4785         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
4786         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
4787         WITH_GMP.
4789 2001-09-20  Akim Demaille  <akim@epita.fr>
4791         * tests/Makefile.am (package.m4): New.
4792         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
4794 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
4796         More cleanup.  After the last patch, m4_symbol holds nothing but
4797         the head of a chain of m4_token_data.  So I have removed the old
4798         m4_symbol, so that m4_token_data chains are stored directly in the
4799         value cell of a hash table node.  But there's more... m4_symbol
4800         was a more natural name for the symbol value cell, and now that it
4801         is gone I have renamed the former m4_token_data structure to
4802         m4_symbol.  This change turned out to be a pig to get right, since
4803         the original code didn't need to modify the value cell itself,
4804         since changing the chain happened inside the m4_symbol that used
4805         to be returned -- I had to pass the address of the value cell
4806         across various function calls, incase the head value changed.  I
4807         also tightened up the memory management to help me find a nasty
4808         memory corruption bug that took me all night to track down...
4810         * m4/m4private.h (struct m4_symbol): Removed.
4811         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
4812         all references.
4813         * m4/hash.c (m4_hash_iterator_value): Return the address of the
4814         value cell.  Updated all callers.
4815         * m4/symtab.c: Took advantage of the simplification in the data
4816         structures to rewrite a lot of this file more simply.  There is
4817         still some room for optimisation here, but we should tackle that
4818         systematically closer to the release.
4820         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
4821         revealed.  This version is ahead of CVS libtool until I get chance
4822         to flush my changes.
4823         * m4/module.c (m4_module_remove): New function that holds the core
4824         of the old m4_module_unload.
4825         (m4_module_unload): Use it.
4826         (m4_module_unload_all): When we know the modules will never be
4827         used again (i.e. on exit), free up as much module memory as
4828         possible.  There are still some artifacts from resident modules
4829         living inside ltdl.c, but everything else is freed.
4830         * m4/debug.c (m4_debug_exit): Free memory allocated in
4831         m4_debug_init().
4832         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
4833         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
4834         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
4835         * m4/m4module.h: Updated prototypes.
4836         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
4837         * m4/hash.h: Updated prototypes.
4838         * src/main.c (main): Use all these new functions to clean up as
4839         much memory as possible before exit.
4841 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
4843         The `traced' flag needs to be attached to the definition of a
4844         symbol rather than the current symbol containing the definition.
4845         Implementing this showed up some long standing post 1.4 bugs in
4846         flag propogation which I also fixed.
4848         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
4849         (struct m4_token_data): And add it back in here.
4850         * m4/input.c (init_macro_token): Propogate the traced flag
4851         correctly.
4852         * m4/macro.c (expand_argument): Ditto.
4853         * tests/builtins.at (trace2, trace3): New tests based on Akim's
4854         sadistic email ;-)
4856 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
4858         * m4/m4private.h (struct m4_token_data): Simplified by removing
4859         the redundant `traced' flag, and one level of structure nesting.
4860         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
4861         * m4/input.c (init_macro_token): No need to initialise removed
4862         `traced' field.
4863         * m4/macro.c (expand_argument): No need to copy it either.
4864         * m4/utility.c (m4_token_data_func_traced): Or provide an access
4865         function.
4867         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
4868         dependant on multiple symbols with the same key, so preserving
4869         relative symbol order in each bucket during resizing is no longer
4870         required.  The resize function is considerably faster as a result.
4872         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
4873         s/m4_symbol_insert/m4_symbol_define/g;
4874         s/m4_builtin_insert/m4_builtin_define/g;
4875         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
4877 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
4879         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
4880         commits, the m4_lookup_symbol dispatch function is split into
4881         specialised functions that must be called directly.
4883         * m4/m4module.h (m4_symbol_lookup_t): Removed.
4884         * m4/symtab.c (m4_lookup_symbol): Removed.
4885         (m4_symbol_builtin, m4_symbol_macro): New functions.
4886         * m4/builtin.c (m4_builtin_define): Split into...
4887         (m4_builtin_pushdef, m4_builtin_insert): ...these.
4888         (m4_macro_define): Split into...
4889         (m4_macro_pushdef, m4_macro_insert): ...these.
4890         * src/main.c (main): Set command line macros from `-D' parameters
4891         using `m4_macro_define'.
4893 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
4895         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
4896         this from m4_remove_table_reference_symbols().
4897         * m4/m4module.h, m4/module.c: Updated all references.
4899 2001-09-07  Akim Demaille  <akim@epita.fr>
4901         * modules/stdlib.c, modules/times.c: Misc cleanups.
4903 2001-09-07  Akim Demaille  <akim@epita.fr>
4905         * configure.in: We now need Autoconf 2.52e.
4906         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
4907         and `M4_SYMBOL_DELETE'.
4908         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
4909         * src/main.c (main): Adjust.
4911 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
4913         Fix the obstack.h problem once and for all!  At configure time we
4914         can test for a system supplied obstack.h:  depending on the
4915         result, we now generate system.h with an #include of the correct
4916         header.  As a bonus, I've also added a --with-included-obstack,
4917         incase the user doesn't like the system obstack for some
4918         reason... and also we can test the shipped obstack on a system
4919         that has oe of its own.  We also now need to be careful to add
4920         build directories to the include search path, since the generated
4921         system.h will be in the build tree.
4923         * configure.in (AC_CONFIG_FILES): Generate system.h from
4924         system-h.in.
4925         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
4926         include the system obstack header or the copy shipped with M4.
4927         Allow the user to override configure and force the build to use
4928         the shipped version.
4929         * m4/system-h.in: New file, template for...
4930         * m4/system.h: ...this.  Now deleted.
4931         * m4/m4module.h: Include system.h before everything else.
4932         * src/freeze.c: Ditto.
4933         * m4/Makefile.am (dist-hook): Remove generated system.h.
4934         (INCLUDES): Check builddir for generated headers before checking
4935         srcdir.
4936         * modules/Makefile.am (INCLUDES): Ditto.
4937         * src/Makefile.am (INCLUDES): Ditto.
4939 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
4941         * TODO: Remove the items that have been addressed already.
4943 2001-09-05  Akim Demaille  <akim@epita.fr>
4945         * src/main.c (main): Standardize --version.
4947 2001-09-05  Akim Demaille  <akim@epita.fr>
4949         * modules/format.c (format): Have a bigger `str'.
4951 2001-09-05  Akim Demaille  <akim@epita.fr>
4953         Rationalize warnings, reporting the macro name as if it were a
4954         program name, and assertions.
4956         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
4957         (M4WARN): New.
4958         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
4959         (m4_symbol_delete):
4960         Use assert for internal errors.
4961         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
4962         M4WARN.
4963         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
4964         M4WARN and assert.
4965         * tests/builtins.at (pushpop): Adjust.
4967 2001-09-05  Akim Demaille  <akim@epita.fr>
4969         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
4970         with pointers.
4972 2001-09-05  Akim Demaille  <akim@epita.fr>
4974         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
4975         * m4/macro.c, m4/symtab.c: Adjust.
4977 2001-09-05  Akim Demaille  <akim@epita.fr>
4979         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
4980         (m4_symbol_pop, m4_symbol_del): this.
4981         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
4982         (m4_symbol_popdef, m4_symbol_delete): New.
4983         (m4_lookup_symbol): Adjust.
4984         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
4986 2001-09-05  Akim Demaille  <akim@epita.fr>
4988         * m4/m4module.h (m4_symbol_lookup): Rename as...
4989         (m4_symbol_lookup_t): this.
4991 2001-09-05  Akim Demaille  <akim@epita.fr>
4993         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
4994         unused.
4995         * m4/symtab.c (m4_lookup_symbol): Adjust.
4997 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
4999         Bootstrap will now work with Libtool 1.4.1 or higher:
5000         * bootstrap: Remove stale autom4te.cache files when
5001         rebootstrapping.
5002         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
5003         libtool.m4.
5004         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
5005         libtool.m4 directly.
5006         Run libtoolize to refresh ltmain.sh.
5007         * config/ltmain.sh:  Deleted.
5008         * acinclude.m4: Deleted.
5009         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
5011         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
5012         implementation for the cvs impaired libtool user.
5014 2001-09-03  Akim Demaille  <akim@epita.fr>
5016         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
5017         internal errors.
5018         Avoid using `default' in switch, as it hides useful compiler
5019         warnings when a case is forgotten.
5021 2001-09-03  Akim Demaille  <akim@epita.fr>
5023         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
5024         is no such thing as `WITH_MODULES'.
5026 2001-09-03  Akim Demaille  <akim@epita.fr>
5028         Improve the test suite's selfcontainedness.
5030         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
5031         (Include, Undivert): Tag the other input files.
5032         * tests/generate.awk: Catch `@comment file:'.
5033         `-I $src' is no longer needed.
5034         `next' is really like `return': the rest is skipped.
5035         Adjust to `input.m4'.
5036         (fatal): New function.
5037         * tests/foo, tests/incl.m4: Remove.
5039 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
5041         The shadowing mechanism and, infact, the whole symbol table
5042         implementation was creaking under the weight of the features piled
5043         on top of it.  We now have a separate hash table module which will
5044         dynamically resize to keep symbol density withing good performace
5045         limits, and a new symtab module layered above it.  Symbol lookups
5046         are now marginally more efficient (since the shadowed flag is no
5047         longer required) and symbol removal, such as on module unload, is
5048         considerably faster due to a reorganisation of the data structures
5049         used in symtab.c.
5051         * src/main.c (main):  Don't mention `-H'.
5052         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
5053         effect.
5054         * NEWS: Updated.
5055         * m4/hash.c: New generalised dynamic hash table data structure
5056         management module.
5057         * m4/hash.h: Public interface.
5058         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
5059         (libm4_la_SOURCES): Add hash.c.
5060         * m4/symtab.c: More or less rewritten from scratch, within the
5061         bounds of the previous API.
5062         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
5063         call.  Updated all callers.
5064         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
5065         declarations to reflect API changes.
5066         (M4INIT): Generate a declaration too, to avoid the warning with
5067         --enable-debug builds.
5068         (M4FINISH): Ditto.
5069         (HASHMAX): Removed.
5070         * m4/utility.c (hash_table_size):  Removed.
5071         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
5072         names, which are then looked up by builtin_dumpdef() as necessary.
5073         This implies a small speedup in builtin_symbols(), which discarded
5074         all of the symbol info under the old call.
5075         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
5076         shadowing is implicit in respect to the new data structures.
5077         symbol names are no longer duplicated here, they are stored in the
5078         key field of the hash table.
5079         Moved macro_args and blind_no_args...
5080         (m4_token_data): ...to here.
5081         m4/macro.c (expand_macro):  Added a name argument since the symbol
5082         name is no longer copied into each struct m4_symbol.  Modified all
5083         callers.
5084         (collect_arguments):  Ditto.
5085         * modules/m4.c (set_trace): Ditto.
5086         * modules/gnu.c (builtin_symbols): Updated.
5087         * src/freeze.c (produce_symbol_dump): Much improved in light of
5088         the improved symbol table layout.
5090 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
5092         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
5093         to M4_SYMBOL_NEXT.
5094         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
5095         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
5096         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
5097         SYMBOL_HANDLE): Ditto.
5098         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
5099         modules/gnu.c, modules/m4.c, src/freeze.c,
5100         src/main.c:  Updated all references.
5102         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
5103         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
5104         already listed in m4_LDADD... how did that ever used to work?
5105         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
5106         link.
5107         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
5108         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
5110         * tests/m4: Don't call the m4 wrapper script with libtool, it
5111         works fine all by itself.
5113 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
5115         The experimental `changeword' feature never took off, and has
5116         no obvious advantages over `changesyntax' to compensate the
5117         enormous speed penalty it carries:
5118         * configure.in (ENABLE_CHANGEWORD): Removed.
5119         * m4/m4module.h (m4_set_word_regexp): Removed.
5120         * m4/m4private.h (m4_token_data): Removed original_text field.
5121         * m4/utility.c (m4_token_data_orig_text): Removed.
5122         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
5123         * m4/macro.c: Ditto.
5124         * src/main.c: Ditto.
5125         * modules/Makefile.am (changeword.la): Removed.
5126         * modules/changeword.c: File removed.
5127         * doc/m4.texinfo: References to changeword and --word-regexp
5128         removed.
5129         * po/POTFILES.in: modules/changeword.c removed.
5130         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
5131         * tests/builtins.at (changeword): Test removed.
5133 2001-08-30  Akim Demaille  <akim@epita.fr>
5135         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
5136         This also help having a single list of m4 files: in
5137         config/Makefile.am.
5138         * config/Makefile.am (STANDARD_MACROS): Rename as...
5139         (ACLOCAL_MACROS): this.
5140         (list-standard-macros): Remove.
5141         (spy): New.
5143 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
5145         In an attempt to moderate my egomania...
5146         * tests/modules.at: Remove attributions.
5148         * tests/generate.awk: When making substitutions to "@&t@", either
5149         "&" or "\&" in the substitution string argument to gsub refer back
5150         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
5151         67 now pass for me.
5153 2001-08-29  Akim Demaille  <akim@epita.fr>
5155         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
5156         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
5157         (sync-lines, trace, translit, undivert, wrap): Move to...
5158         * tests/builtins.at: this new file.
5159         * tests/others.at (Discard comments, import-environment): Move to...
5160         * tests/options.at: this new file.
5162 2001-08-29  Akim Demaille  <akim@epita.fr>
5164         * tests/others.at (Freezing modules)
5165         (--module-directory: absolute path, modpath2, modpath3)
5166         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
5167         * tests/modules.at: here, new file.
5168         * tests/others.at, tests/generate.awk: Add a banner.
5169         * tests/testsuite.at: Adjust.
5170         (AT_CHECK_M4_FILTER): New, but unused.
5172 2001-08-29  Akim Demaille  <akim@epita.fr>
5174         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
5175         handle that.
5176         * tests/others.at (wrap): Inline wrap.m4.
5177         (shadow): Inline shadow.m4.
5178         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
5179         * tests/m4: Simplify.
5181 2001-08-29  Akim Demaille  <akim@epita.fr>
5183         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
5184         --language.
5186 2001-08-29  Akim Demaille  <akim@epita.fr>
5188         * tests/generate.awk (normalize): s/@__@/@&t@/.
5190 2001-08-28  Akim Demaille  <akim@epita.fr>
5192         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
5194 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
5196         * bootstrap (generate.awk): Generate test cases with new script.
5198 2001-08-27  Akim Demaille  <akim@epita.fr>
5200         * tests/Makefile.am (installcheck-local): Don't use
5201         `dc_install_base' which is not visible here, but `exec_prefix'
5202         which is clearly the RT anyway.
5203         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
5204         related to testing a now installed m4.
5205         * tests/m4: Do it here.
5207 2001-08-27  Akim Demaille  <akim@epita.fr>
5209         * tests/others.at (indir): Formatting change.
5211 2001-08-27  Akim Demaille  <akim@epita.fr>
5213         * tests/Makefile.am (installcheck-local): New.
5214         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
5215         the test suite.
5216         Prefer options over envvars.
5217         * src/main.c (main): First bug caught by the test suite (yeah!):
5218         --batch lacked a `break' which resulted in an accidental
5219         invocation of --discard-comments.
5221 2001-08-27  Akim Demaille  <akim@epita.fr>
5223         * tests/others.at (capitalize, changeword, comments, ddivert)
5224         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
5225         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
5226         (sysv-args, trace, translit, undivert): Don't rely on files in
5227         examples/: AT_DATA them.
5229 2001-08-27  Akim Demaille  <akim@epita.fr>
5231         Let the test suite use a wrapper around the not installed m4 to
5232         pretend it is (installed).
5234         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
5235         such a way that m4 does not process them.
5236         * configure.in: The package name seems to be `m4', not `M4'.
5237         * tests/m4: New.
5238         * tests/atlocal.in (at_package, M4): Remove.
5239         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
5241 2001-08-27  Akim Demaille  <akim@epita.fr>
5243         * tests/Makefile.am (CLEANFILES): Remove.
5244         (DISTCLEANFILES, clean-local): New.
5245         * examples/mktests.sh: Remove.
5247 2001-08-27  Akim Demaille  <akim@epita.fr>
5249         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
5250         Don't use aclocal: it's written by hand.
5251         * aclocal.m4: m4_include all the files instead of being built by
5252         aclocal.
5253         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
5254         until it reads the traces by itself.
5255         * configure.in: Require Autoconf 2.42c as we are now using
5256         AC_CONFIG_TESTDIR instead of AT_CONFIG.
5257         Catch unexpanded `jm_' macros.
5258         * config/atconfig.m4: Remove.
5259         * config/error.m4: new.
5260         * config/Makefile.am: Ship the files included by aclocal.m4.
5261         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
5262         (TESTSUITE_AT): this, to please Automake.
5263         (TESTSUITE): This target uses autotest/autotest.m4, not
5264         autotest/general.m4.
5265         * tests/testsuite.at: Prereq Autotest 2.52c.
5266         * examples/Makefile.am (pkgdata_DATA): Rename as...
5267         (dist_pkgdata_DATA): this.
5268         * doc/Makefile.am (man_MANS): Rename as...
5269         (dist_man_mans): this.
5271 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
5273         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
5274         Robert Collins, building on Cygwin no longer requires Windows
5275         import and export symbol decorations.
5276         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
5277         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
5278         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
5279         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
5280         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
5281         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
5282         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
5283         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
5284         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
5285         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
5286         anymore.
5287         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
5288         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
5290 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
5292         Ansify the source.  Previously we had a mix, where my code was
5293         in a K&R compatible style, and the preexisting code was in ANSI
5294         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
5295         and now the code base is much cleaner.
5297         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
5298         VOID macro and all users.
5299         * m4/m4module.h:  Ansify function prototypes and headers.
5300         * m4/builtin.c:  Ditto.
5301         * m4/evalparse.c:  Ditto.
5302         * m4/input.c:  Ditto.
5303         * m4/macro.c:  Ditto.
5304         * m4/module.c:  Ditto.
5305         * m4/output.c:  Ditto.
5306         * m4/path.c:  Ditto.
5307         * m4/symtab.c:  Ditto.
5308         * m4/utility.c:  Ditto.
5309         * modules/format.c:  Ditto.
5310         * modules/gnu.c:  Ditto.
5311         * modules/m4.c:  Ditto.
5312         * modules/mpeval.c:  Ditto.
5313         * src/freeze.c:  Ditto.
5314         * src/m4.h:  Ditto.
5315         * src/main.c:  Ditto.
5317 2001-08-20  Akim Demaille  <akim@epita.fr>
5319         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
5320         generated with stock 2.52.
5322 2001-08-20  Akim Demaille  <akim@epita.fr>
5324         * config/atconfig.m4: New, until part of Autoconf per se.
5325         * configure.in (AT_CONFIG): Use it.
5326         Adjust.
5327         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
5328         * tests/atlocal.in: New.
5329         * tests/generate.awk: For the time being, the empty quadrigraph is
5330         `@__@'.
5331         * tests/others.at (changeword, gmp): Check the configuration
5332         variable against `yes'.
5333         * tests/testsuite.at (dnl): Allow it, as it's used all over the
5334         place.
5336 2001-08-20  Akim Demaille  <akim@epita.fr>
5338         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
5339         * modules/m4.c (undivert): Disable the possibility of undiverting
5340         several files at once: it is not documented, it is inconsistent
5341         with the other macros, it can be straightforwardly mocked by
5342         several invocations, and most importantly, it prevents the
5343         possibility of other kinds of extension.
5344         Use `m4_numeric_arg'.
5346 2001-08-20  Akim Demaille  <akim@epita.fr>
5348         * examples/include.m4: Typo.
5349         * tests/generate.awk: Really add it.
5350         * tests/Makefile.am: Adjust.
5351         * tests/others.at (Discard comments): It sure fails without `-c'.
5352         (include, undivert): Add -I examples/.
5354 2001-08-20  Akim Demaille  <akim@epita.fr>
5356         Use sprintf, not ecft and friends since it is standard, portable,
5357         simplifies the code, and since the latter is even deprecated
5358         according to the GNU libc documentation.
5360         * modules/format.c: Drop evct support.
5362 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
5364         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
5365         for `-pipe' here...
5366         * configure.in: ...do it here instead.
5368         * c-boxes.el: Deleted.
5369         * m4/builtin.c: Reformat box comments to be closer to GNU
5370         standards.
5371         * m4/debug.c:  Ditto.
5372         * m4/eval.c:  Ditto.
5373         * m4/evalparse.c:  Ditto.
5374         * m4/input.c:  Ditto.
5375         * m4/m4module.h:  Ditto.
5376         * m4/macro.c:  Ditto.
5377         * m4/output.c:  Ditto.
5378         * m4/symtab.c:  Ditto.
5379         * m4/utility.c:  Ditto.
5380         * modules/changeword.c:  Ditto.
5381         * modules/format.c:  Ditto.
5382         * modules/gnu.c:  Ditto.
5383         * modules/load.c:  Ditto.
5384         * modules/m4.c:  Ditto.
5385         * modules/modtest.c:  Ditto.
5386         * modules/mpeval.c:  Ditto.
5387         * modules/perl.c:  Ditto.
5388         * modules/shadow.c:  Ditto.
5389         * modules/stdlib.c:  Ditto.
5390         * modules/time.c:  Ditto.
5391         * src/freeze.c:  Ditto.
5392         * src/main.c:  Ditto.
5394 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
5396         * m4/module.c: Fixup some errors in the description comment.
5398 2001-08-17  Akim Demaille  <akim@epita.fr>
5400         * tests/others.at (iso8859): Specify the path to the M4 test file.
5401         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
5402         files in error messages.
5404 2001-08-17  Akim Demaille  <akim@epita.fr>
5406         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
5407         * tests/others.at: Adjust input files paths.
5408         * tests/atconfig.in: Set top_builddir.
5409         * tests/Makefile.am: Adjust.
5410         `testsuite' is in src, not build.
5412 2001-08-17  Akim Demaille  <akim@epita.fr>
5414         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
5415         (generate.at): Install a temporary hack until the actual
5416         generate.awk is added to the repository.
5417         * tests/atconfig.in: New.
5419 2001-08-17  Akim Demaille  <akim@epita.fr>
5421         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
5423 2001-08-17  Akim Demaille  <akim@epita.fr>
5425         * doc/m4.texinfo: Promote proper quotation.
5427 2001-08-17  Akim Demaille  <akim@epita.fr>
5429         Remove the non Autotest tests.
5431         * tests/other-tests/capitalize.test,
5432         * tests/other-tests/changeword.test,
5433         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
5434         * tests/other-tests/debug.test,
5435         * tests/other-tests/discard-comments.m4,
5436         * tests/other-tests/discard-comments.test,
5437         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
5438         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
5439         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
5440         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
5441         * tests/other-tests/hanoi.test,
5442         * tests/other-tests/import-environment.m4,
5443         * tests/other-tests/import-environment.test,
5444         * tests/other-tests/include.test, tests/other-tests/indir.test,
5445         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
5446         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
5447         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
5448         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
5449         * tests/other-tests/modtest.test,
5450         * tests/other-tests/multiquotes.test,
5451         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
5452         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
5453         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
5454         * tests/other-tests/sync-lines.m4,
5455         * tests/other-tests/sync-lines.test,
5456         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
5457         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
5458         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
5459         * tests/other-tests/wrap.test: Remove.
5461         * tests/run-test, tests/get-them: Remove.
5462         * tests/Makefile.am: Adjust.
5464 2001-08-17  Akim Demaille  <akim@epita.fr>
5466         others.at no longer depends on other-tests/.
5468         * tests/others.at (stackovf): You're actually...
5469         (sync-lines): this.
5470         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
5471         (unload.test): Keep their authorship.
5472         (discard-comments, gmp, import-environment, modfreeze)
5473         (sync-lines): Embed the input files.
5474         * tests/stackovf.test: Copy from other-tests/stackovf.test.
5475         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
5477 2001-08-17  Akim Demaille  <akim@epita.fr>
5479         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
5480         (M4exit): Tag the exit status of the example.
5481         * tests/get-them: Adjust.
5482         * tests/generate.awk: New, based on get-them.
5483         * tests/Makefile.am: Adjust to generate `generated.at'.
5484         * tests/testsuite.at: Adjust.
5485         (AT_CHECK_M4): Don't overquote.  Blush...
5487 2001-08-17  Akim Demaille  <akim@epita.fr>
5489         Start using Autotest.  atconfig creation is still lacking.
5491         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
5492         * examples/reverse.m4, tests/other-tests/import-environment.m4,
5493         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
5494         * tests/other-tests/import-environment.test: Don't check LANGUAGE
5495         as it might be `unset', or set to `C'.
5496         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
5497         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
5498         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
5499         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
5500         * tests/other-tests/shadow.test: Adjust.
5501         * tests/testsuite.at, tests/others.at: New.
5502         * tests/Makefile.am: Adjust.
5504 2001-08-17  Akim Demaille  <akim@epita.fr>
5506         Drop Autoconf 2.13 compatibility.
5508         * configure.in (changeword): No need to undefine it, as anyway if
5509         it's defined, M4sugar moved it as m4_changeword.
5510         And anyway, proper quotation is enough.
5511         (m4_pattern_allow): As it exists in 2.50, just use it.
5512         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
5513         Don't handle Gettext's duties, let it handle them.
5514         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
5516 2001-08-17  Akim Demaille  <akim@epita.fr>
5518         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
5519         (m4_errprint): Use fputs.
5520         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
5521         dumpdef are not concerned.
5522         (Dumpdef, Errprint): Emphasize their insensitivity to
5523         --error-output.
5524         * doc/Makefile.am: Add `TAGS' support.
5525         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
5526         in `config/' now.
5527         * config/Makefile.am (MAINTAINERCLEANFILES): New.
5529 2001-08-17  Akim Demaille  <akim@epita.fr>
5531         * modules/Makefile.am (ETAGS_ARGS): New.
5533 2001-08-17  Akim Demaille  <akim@epita.fr>
5535         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
5536         changes.
5538 2001-08-17  Akim Demaille  <akim@epita.fr>
5540         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
5542 2001-08-17  Akim Demaille  <akim@epita.fr>
5544         * m4/m4module.h (m4/list.h): Don't include it.
5546 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
5548         m4_modules are no more, we use lt_dlhandles directly and let
5549         latest libltdl features manage the list of loaded modules.
5550         * acinclude.m4: Regenerated.
5551         * m4/ltdl.c: Updated from master copy.
5552         * m4/module.c: Reimplemented to take advantage of advances in
5553         libltdl.
5554         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
5555         list with lt_dlhandle_next.
5556         (m4_builtin_find_by_func): Ditto.
5557         (m4_builtin_table_install): Use lt_dlhandle.
5558         (m4_macro_define): Ditto.
5559         (m4_macro_table_install): Ditto.
5560         m4/module.h: Prototype new module management API.
5561         (m4_modules): No longer required.
5562         (m4_module_init_t, m4_module_finish_t): POSIX namespace
5563         violations, renamed to...
5564         (m4_module_init_func, m4_module_finish_func): ...these,
5565         respectively.
5566         (M4INIT_HANDLER): Clean way to declare init functions in modules.
5567         (M4FINISH_HANDLER):  And similarly for finish functions.
5568         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
5569         -- Add indirection to the CONC macro so that arguments are
5570         correctly expanded.
5571         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
5572         * modules/shadow.c (m4_init_module):  Ditto.
5573         Due to new init function semantics, be careful to perform the
5574         initialisation only on first load.
5575         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
5576         (m4_finish_module): Replaced with M4FINISH_HANDLER.
5577         Due to new finish function semantics, be careful to perform the
5578         finalisation only on first load.
5579         * m4/m4private.h (m4_module): Removed in favour of...
5580         (m4_module_data): ...structure without all the wrapper fields.
5581         Instances of this new structure are stored associated lt_dlhandles
5582         with lt_dlcaller_data_set().
5583         * m4/builtin.c (m4_builtin_define): Takes a handle argument
5584         instead of the old module argument.
5585         (m4_builtin_table_install): Ditto.
5586         * modules/load.c (m4_resident_module):  Removed.  This is no
5587         longer implemented as a magic symbol...
5588         * modules/m4.c (m4_resident_module): Ditto.
5589         * modules/load.c (M4INIT_HANDLER): ...the module init function now
5590         uses the ltdl api to make the module resident.
5591         * modules/m4.c (M4INIT_HANDLER): Ditto.
5592         * modules/load.c (builtin_modules): Traverse the loaded module
5593         list with lt_dlhandle_next.
5594         (builtin_load): Much simplified in light of the reimplemented
5595         module loader.
5596         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
5597         light of the m4/module.c rewrite.
5598         (produce_symbol_dump): Ditto.
5599         (reload_frozen_state): Ditto.
5600         * m4/list.c, m4/list.h: Files deleted.  No longer required.
5601         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
5602         (libm4_la_SOURCES): Delete list.c reference.
5603         * m4/m4private.h (m4_token_data):  Add a handle field.  This
5604         eliminates many of the searches to find the handle associated with
5605         various tokens that are passed between functions.
5606         (struct m4_symbol):  Removed the module field.  The
5607         module association does not belong with the symbol...
5608         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
5609         that the module implementation code is from.  Added a handle
5610         field.
5611         (m4_push_macro): Add a `handle' argument.  Changed all callers.
5612         (init_macro_token):  Set the `handle' field for the
5613         m4_token_data.
5614         * m4/macro.c (expand_argument): Copy the new handle field during
5615         reassignment.
5616         * modules/m4.c (macro_install): Use the new handle field to
5617         optimise the search for the correct builtin structure, and pass
5618         the handle details to m4_builtin_define.
5620 2001-08-15  Akim Demaille  <akim@epita.fr>
5622         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
5623         when creating `m4/obstack.h'.
5624         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
5625         top_builddir.
5626         * tests/defs: Make them absolute.
5627         (CDPATH) Neutralize.
5628         * tests/gethem: Use them.
5630 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
5632         * config/ltmain.sh: Doh!  Import again for a quoting fix that
5633         prevented any regression test from passing.
5635         * m4/m4module.h (obstack.h): Choose between installed version
5636         and shipped version based on configure tests.
5637         * src/freeze.c (obstack.h): Ditto.
5639         * acconfig.h: Removed.  No longer required.
5641         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
5642         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
5643         them to AC_INIT and AM_INIT_AUTOMAKE.
5644         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
5645         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
5646         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
5647         shell variable m4_cv_func_obstack_h.
5648         * tests/defs (M4): Be more careful about relative path to libtool
5649         script and m4 binary by using $srcdir.
5651         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
5652         optargs to the existing libltdl search path.
5653         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
5654         * m4/ltdl.c: Updated.
5655         * m4/ltdl.h: Ditto.
5656         * config/ltmain.sh: Ditto.
5658 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
5660         * src/main.c (main): Add `-b' (for `batch') mode switch to force
5661         interactive mode off.
5663 2001-08-10  Akim Demaille  <akim@epita.fr>
5665         * configure.in: Require Autoconf 2.52.
5666         (AC_ARG_PROGRAM): Remove, handled by Automake.
5667         (m4_getopt): Rename as...
5668         (m4_getopt_h): this.
5669         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
5670         Undefine `changeword' only if defined.
5671         * config/gnu-obstack.m4: Require Autoconf 2.52.
5672         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
5673         Allow this token.
5675 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
5677         * doc/m4.texinfo: Fix some typos, and apply some small
5678         clarifications.
5680 2001-08-09  Andreas Schwab  <schwab@suse.de>
5682         * src/main.c (main): Fix improper uses of error (missing format
5683         string).
5685 2001-08-07  Akim Demaille  <akim@epita.fr>
5687         Improve `make distcheck'.
5689         * configure.in: Be sure to be able to run `mkconfig.sh' when src
5690         != build.
5691         * Makefile.am (dist-hook): Remove, as it is no longer needed.
5692         * doc/m4.texinfo (Include): Add missing blank.
5693         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
5694         obstack.c.
5696 2001-08-07  Akim Demaille  <akim@epita.fr>
5698         * m4/evalparse.c: A better introductory comment.
5699         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
5700         * m4/macro.c: Adjust old comments.
5701         * modules/README: Typo.
5703 2001-08-07  Akim Demaille  <akim@epita.fr>
5705         * config/gnu-obstack.m4: New.
5707 2001-08-07  Akim Demaille  <akim@epita.fr>
5709         * config/Makefile.am, config/stackovf.m4: New.
5710         * configure.in, Makefile.am: Adjust.
5712 2001-08-05  gettextize  <bug-gnu-utils@gnu.org>
5714         * po/Makefile.in.in: Upgrade to gettext-0.10.39.
5715         * po/cat-id-tbl.c: Remove file.
5716         * po/stamp-cat-id: Remove file.
5718 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
5720         * modules/format.c (format):  Formatting for %f was not
5721         interpreting the position of the decimal point correctly for
5722         whole numbers.
5724 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
5726         * TODO:  Removed m4exit bug.
5727         * modules/load.c (m4_resident_module): Make this module resident.
5728         * module/m4.c (m4_resident_module): Ditto.
5729         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
5730         feature to mark modules as resident if they export
5731         `m4_resident_module' as TRUE.
5732         (m4_module_unload): Do not remove resident modules, and take care
5733         with symbol insertion and deletion with resident modules.
5734         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
5735         use resident modules feature.
5737 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
5739         * TODO: Updated.  Removed some cruft that has since been fixed
5740         or implemented.  Added some more entries.
5741         * NEWS: Updated.
5742         * README: Updated.
5743         * modules/README: Updated.
5744         * doc/m4.texinfo: Updated.
5746         * modules/gnu.c (builtin_functions): Make indir orthogonal to
5747         builtin, in that each is recognised as a macro only with parameters
5748         (builtin_indir): Passing 0 arguments is now an error, as with
5749         builtin.
5751         * src/main.c (usage): Added missing description of `-c' option.
5753 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
5755         Consolidate the myriad of dispersed test scripts into the
5756         tests subdirectory.  I think I now have all the file where I
5757         want them, so there shouldn't be anymore upheaval =)O|
5758         Honest!
5759         * tests/Makefile.am: Updated to run the new tests added below.
5760         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
5761         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
5762         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
5763         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
5764         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
5765         tests/other-tests/hanoi.test, tests/other-tests/include.test,
5766         tests/other-tests/indir.test, tests/other-tests/misc.test,
5767         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
5768         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
5769         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
5770         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
5771         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
5772         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
5773         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
5774         tests/other-tests/translit.test, tests/other-tests/undivert.test,
5775         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
5776         tests/other-tests/wrap.test:  New tests based on the contents
5777         of the tests removed below.
5778         * examples/Makefile.am, modules/Makefile.am:  Updated to
5779         reflect removed tests.
5780         * examples/defs,modules/defs: Removed.
5781         * examples/capitalize.test, examples/comments.test,
5782         examples/ddivert.test, examples/debug.test,
5783         examples/esyscmd.test, examples/exp.test,
5784         examples/foreach.test, examples/forloop.test,
5785         examples/fstab.test, examples/hanoi.test,
5786         examples/include.test, examples/indir.test,
5787         examples/misc.test, examples/multiquotes.test,
5788         examples/patsubst.test, examples/pushpop.test,
5789         examples/regexp.test, examples/reverse.test,
5790         examples/sysv-args.test, examples/trace.test,
5791         examples/translit.test, examples/undivert.test,
5792         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
5793         modules/modpath1.test, modules/modpath2.test,
5794         modules/modpath3.test, modules/modpath4.test,
5795         modules/modtest.test, modules/shadow.test,
5796         modules/unfrozen.m4, modules/unload.test: Removed.
5798         Move the implementation of GMP support for the mpeval() builtin
5799         into a loadable module that depends on libgmp.  mpeval() and
5800         eval() share a common parser, now in m4/evalparser.c; the code
5801         in m4/numb.c and m4/numb.h is now physically split between
5802         m4/eval.c (the eval() backend) and modules/mpeval.c (the
5803         mpeval() backend), rather than being differentiated by cpp
5804         macros and multiple inclusion.  The mpeval module is always
5805         built but will generate an diagnostic if it is used from an
5806         installation that didn't link in the gmp library.
5807         * modules/Makefile.am: build and install the new mpeval module.
5808         * modules/mpeval.c: Now contains the former parts of m4/numb.c
5809         and m4/numb.h that are required for gmp support in mpeval().
5810         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
5811         * m4/evalmp.c:  Removed.
5812         * m4/m4module.h: Removed conditional prototype for
5813         m4_mp_evaluate().
5814         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
5815         and m4/numb.h that do not rely on gmp.
5816         * m4/evalparse.c:  New file, contains the shared parts of the
5817         eval() and evalmp() parser implementations, and is no longer
5818         unencumbered by cpp magic to uncover the right parts.
5819         * m4/numb.h:  Removed.  It's former contents are split between
5820         m4/eval.c and modules/mpeval.c.
5821         * m4/numb.c: ditto.
5823         * tests/other-tests/changeword.test: New test.  Rudimentary
5824         testing of changeword builtin runs only if --wnable-changeword
5825         was used at configure time.
5826         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
5827         alternation correctly.  Split into two expressions to compensate.
5828         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
5829         * modules/Makefile.am: Build changeword module.
5830         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
5831         only when --enable-changeword was passed to configure.
5832         (builtin_changeword): If --enable-changeword was not used, then
5833         report that changeword() builtin has no support in m4 binary.
5835 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
5837         * src/main.c (main): Fixed a particularly nasty bug is
5838         user_search_path setting -- the -M flag processing must be
5839         extremely careful with search path ordering, or else the default
5840         installed module directory (possibly containing modules from a
5841         previous release) is placed earlier in the search path than any -M
5842         arguments (which are relied upon to load uninstalled modules with
5843         most of the tests in the regresion suite).
5845         * modules/load.c (builtin_load):  Nasty hack to prevent adding
5846         symbols to symtab again if a module is loaded more than once.
5847         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
5849         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
5850         possible NULL pointer dereference.
5852         * m4/module.c (m4_module_find_by_modname): Renamed from
5853         m4_module_modname_find.   Fixed all references.
5854         (m4_module_find_by_builtin):  New function.
5856         * modules/modfreeze.test: load the `load' module with each
5857         invocation.
5858         * src/freeze.c (produce_frozen_state): Simplified in light of
5859         module field in m4_symbol.  Allow a third argument for text macros
5860         to name the originating module.
5861         (reload_frozen_state): ditto.
5862         * m4/m4module.h:  Fixup prototypes.
5863         * m4/builtin.h (m4_builtin_define): Add a module argument so
5864         that symbols can be registered against the defining module.
5865         (m4_macro_define): ditto.
5866         * m4/m4private.h (m4_symbol): Make the module field const to save
5867         on casting in the rest of the code.
5868         (SYMBOL_MODULE): New macro.
5870         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
5871         symbol reference maintenance bugs when removing a symbol from the
5872         symtab.
5874         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
5876 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
5878         * configure.in (m4_cv_func_obstack): A better check for whether
5879         libc has an obstack implementation.
5880         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
5882         * configure.in (--with-modules): Changed semantics.  This
5883         option is now used to list modules to be preopened.
5884         * src/m4.h: #include "ltdl.h" unconditionally.
5885         * src/main.c: Removed all dependencies on WITH_MODULES.
5886         * src/freeze.c: ditto.
5887         * modules/Makefile.am: ditto.
5888         * m4/m4.c (builtin_m4exit): ditto.
5889         * modules/modpath1.test: ditto.
5890         * modules/modpath2.test: ditto.
5891         * modules/modpath3.test: ditto.
5892         * modules/modpath4.test: ditto.
5893         * modules/modtest.test: ditto.
5894         * modules/shadow.test: ditto.
5895         * modules/unload.test: ditto.
5897         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
5898         comes up on demand in LTLIBOBJS now.
5899         * configure.in (getopt_long):  Creating and relying on a link for
5900         getopt.h on hosts with no getopt_long() of thier own works
5901         correctly now.  This is necessary so that callers of getopt_long()
5902         can simply `#include <getopt.h>': the naive way of doing this
5903         would end up using our own getopt.h and the installed
5904         getopt_long(), which is asking for trouble!
5905         (obstack_init): A similar argument applies to obstack.h and
5906         obstack_init().
5908         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
5909         On Solaris-2.5 (at least) the native dlopen implementation
5910         gets confused about m4.o when looking for module "m4".  This
5911         version always looks for .la an .$lib_ext suffixed names first
5912         to work around the problem.  Sigh.
5914         * po/POTFILES.in: Take account of these file movements.
5915         * src/Makefile.am (m4_SOURCES): removed eval.c.
5916         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
5917         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
5918         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
5919         * modules/m4.c (builtin_eval): Use m4_evaluate().
5920         * m4/eval.c: Moved here from src/eval.c to facilitate
5921         implementation of eval() builtin as part of the `m4' loadable
5922         module.
5923         (m4_evaluate): renamed from evaluate for namespace cleanliness.
5924         * m4/numb.c: Moved here from src/numb.c, since it is #included
5925         into eval.c at compile time.
5926         * m4/m4module.h (m4_evaluate): Added prototype.
5927         * src/m4.h (evaluate): Removed prototype.
5929 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
5931         * modules/perl.c (builtin_perleval):  Use PL_na for
5932         compatibility with perl-5.6.
5934         * src/main.c (main):  It is now safe to
5935         ``m4_module_install("m4")'', without tripping over the m4
5936         binary itself!
5937         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
5938         versions having fixed the insidious module search order bug.
5940         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
5941         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
5943         * configure.in: Figure out whether to use the installed
5944         getopt.h or the supplied one.
5945         * src/Makefile.am: ditto.
5947         * po/POTFILES.in: List files in their new positions.
5949         * config/ltmain.sh:  This needs to be checked in to match the
5950         libtool macros copied to acinclude.m4 (until a released
5951         libtool copes with m4's needs).
5952         * bootstrap:  Run gettextize.
5954 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
5956         * AUTHORS:  Added my details.
5957         * TODO: updated.
5958         * NEWS: updated.
5959         * bootstrap: temporary update until released libtool catches up.
5961         * All files:  Use new GNU GPL copyright blurb with current contact
5962         address.
5964         * configure.in (LTLIBOBJS): Use canonical code for calculation of
5965         this variable.
5967         * config: renamed acm4 directory to config to be more like
5968         other autoconfiscated packages.
5970         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
5971         * config/debug.m4:  New file implementing configure macros to add
5972         suitable debug flags to the compiler invocation.
5974         * modules/load.c:  New file implementing the ``load'' and
5975         ``unload'' builtins.
5976         * tests/get-them:  Set the module search directory to the modules
5977         build directory in generated tests.
5978         * modules/shadow.test: ditto.
5979         * modules/modtest.test: ditto.
5980         * modules/modpath1.test: ditto.
5981         * modules/modpath2.test: ditto.
5982         * modules/modpath3.test: ditto.
5983         * modules/modpath4.test: ditto.
5984         * modules/modtest.test: ditto.
5985         * modules/modfreeze.test: ditto.
5986         * modules/unload.test: ditto.
5988         * modules/changeword.c:  New file implementing the ``changeword''
5989         builtin as a loadable module.
5990         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
5991         as a loadable module.
5993         * src/main.c (main):  Load the gnu module if m4 was started
5994         normally -- i.e. without the -G option.
5995         * modules/gnu.c:  New file implementing a new loadable module wuth
5996         definitions for all the gnu extension builtins.
5997         * modules/format.c:  Moved here from src/format.c.  Now included
5998         directly by gnu.c.
6000         * src/main.c (main):  Load the traditional module if m4 was
6001         started in `no_gnu_extensions' mode.
6002         * modules/traditional.c:  New file implementing the ``unix'' macro,
6003         required when m4 is executed in traditional mode, as a loadable
6004         module.
6006         * src/main.c:  Renamed from m4.c to avoid confusion with
6007         modules/m4.c.
6008         (main):  Always load the m4 module.
6009         * modules/m4.c:  New file implementing a new loadable module with
6010         definitions for all m4 builtins that are not gnu extensions.
6012         * m4/Makefile.am:  Adjusted to take new files below into account.
6013         * m4/m4module.h: Prototypes for exported functions and types moved
6014         to this directory from the src directory.
6015         * m4/m4private.h: Moved here from src/m4private.h to facilitate
6016         the migration of all builtin implementations to loadable modules.
6017         * m4/macro.c: Moved this file here from the src directory,
6018         renaming all exported symbols to use the prefix ``m4_''.
6019         * m4/builtin.c: ditto.
6020         * m4/module.c: ditto.
6021         * m4/symtab.c: ditto.
6022         * m4/debug.c: ditto.
6023         * m4/input.c: ditto.
6024         * m4/output.c: ditto.
6025         * m4/path.c: ditto.
6026         * m4/ltdl.h, m4/ltdl.c: ditto.
6027         * m4/utility.c: Odd functions moved here from files in the src
6028         directory to facilitate builtin migration.
6030 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
6032         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
6033         error message, to make translators' jobs a little easier.
6034         (builtin_builtin): ditto.
6035         (builtin_traceon): ditto.
6036         (builtin_traceoff): ditto.
6037         Reported by Akim Demaille <akim@epita.fr>
6039         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
6040         pkgincludedir instead.
6042         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
6043         it is exported globally.  Fixed all references.
6044         (lquote): ditto.
6045         (bcomm): ditto.
6046         (ecomm): ditto.
6047         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
6048         globally.  Fixed all references.
6049         (DEF_LQUOTE): ditto.
6050         (DEF_BCOMM): ditto.
6051         (DEF_ECOMM): ditto.
6053 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
6055         * NEWS: updated.
6056         * TODO: updated.
6058         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
6059         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
6061         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
6062         Removed `Prev', `Next' and `Up' fields of all @nodes now that
6063         makeinfo calculates them for us, and to make any future
6064         reorganisation easier.
6065         (Frozen files): Document format version 2.
6066         `V' now takes argument `2'.
6067         `F' can take a single argument if symbol and builtin names
6068         are the same, or 3 arguments if the builtin is from a module.
6069         New `S' specification for saving syntax table contents.
6070         New `M' specification for saving loaded module names.
6071         * src/freeze.c: Implement them.
6072         * src/input.c (syntax_code): For interpreting frozen syntax
6073         state.
6075         * examples/Makefile.am:  Add the contents of the WWW directory to
6076         the distribution.
6077         * examples/WWW/Makefile:  ditto,
6078         (%.htm): Compares file contents (not just sizes) to determine
6079         whether a change has occured.
6080         * examples/WWW/_header.htm: Bumped version number.
6081         * examples/WWW: Regenerated content.
6083         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
6084         compilers comes much easier without ansi2knr.
6085         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
6087         * m4/list.c: New generic list container type.
6088         * m4/list.h: Interface to new container type.
6089         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
6090         (libm4_la_SOURCES): compile and link list.c.
6091         * src/builtin.c (builtin_tables): Use list container.
6092         * src/module.c (symtab): ditto.
6093         * src/symtab.c (symtab): ditto.
6095         * m4/system.h: New file for common preprocessor definitions.
6096         * m4/Makefile.am (pkginc_HEADERS): install system.h.
6097         * m4/error.c: Use system.h in place of inline preprocessor.
6098         * m4/error.h: ditto.
6099         * m4/module.c: ditto.
6100         * m4/module.h: ditto.
6101         * m4/xmalloc.c: ditto.
6103         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
6104         compatibility.
6105         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
6107         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
6108         it is exported globally.  Fixed all references.
6109         (builtin): ditto.
6110         (module_init_t): ditto.
6111         (module_finish_t): ditto.
6112         (token_data): ditto.
6113         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
6114         it is exported globally.  Fixed all references.
6115         (SYNTAX_IGNORE): ditto.
6116         (SYNTAX_SPACE): ditto.
6117         (SYNTAX_OPEN): ditto.
6118         (SYNTAX_CLOSE): ditto.
6119         (SYNTAX_COMMA): ditto.
6120         (SYNTAX_DOLLAR): ditto.
6121         (SYNTAX_ACTIVE): ditto.
6122         (SYNTAX_ESCAPE): ditto.
6123         (SYNTAX_ALPHA): ditto.
6124         (SYNTAX_NUM): ditto.
6125         (SYNTAX_ALNUM): ditto.
6126         (SYNTAX_LQUOTE): ditto.
6127         (SYNTAX_RQUOTE): ditto.
6128         (SYNTAX_BCOMM): ditto.
6129         (SYNTAX_ECOMM): ditto.
6130         (SYNTAX_VALUE): ditto.
6131         (SYNTAX_MASKS): ditto.
6132         (IS_OTHER): ditto.
6133         (IS_IGNORE): ditto.
6134         (IS_SPACE): ditto.
6135         (IS_OPEN): ditto.
6136         (IS_CLOSE): ditto.
6137         (IS_COMMA): ditto.
6138         (IS_DOLLAR): ditto.
6139         (IS_ACTIVE): ditto.
6140         (IS_ESCAPE): ditto.
6141         (IS_ALPHA): ditto.
6142         (IS_NUM): ditto.
6143         (IS_ALNUM): ditto.
6144         (IS_LQUOTE): ditto.
6145         (IS_RQUOTE): ditto.
6146         (IS_BCOMM): ditto.
6147         (IS_ECOMM): ditto.
6148         (TOKEN_EOF): ditto.
6149         (TOKEN_NONE): ditto.
6150         (TOKEN_STRING): ditto.
6151         (TOKEN_SPACE): ditto.
6152         (TOKEN_WORD): ditto.
6153         (TOKEN_SIMPLE): ditto.
6154         (TOKEN_MACDEF): ditto.
6156         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
6157         consistency.  Fixed all references.
6158         (STRING): Renamed to `m4_string' for consistency, and because if
6159         is exported globally.  Fixed all references.
6160         (token_type): Renamed to `m4_token_t' for the same reasons.
6161         (token_data_type): Renamed to `m4_token_data_t' for the same
6162         reasons.
6164         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
6165         sizes.
6166         (XMALLOC): ditto.
6167         (XREALLOC): ditto.
6168         (XFREE): Wrapper macro which avoids freeing NULL pointers.
6170         * m4/m4module.h (m4_macro):  New type for module defined user
6171         macros.
6172         * modules/modtest.c (m4_macro_table):  Define module user macros.
6173         * modules/shadow.c (m4_macro_table):  ditto.
6175         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
6176         declared with M4BUILTIN.
6178         * m4/xmalloc.c: Use memset if bzero is not available when
6179         emulating calloc with malloc.
6180         (xcalloc): Fallback to malloc/bzero if calloc is not available.
6181         (xfree): Added for consistency.  Will not try to free NULL
6182         pointers.
6183         * src/m4.c (xfree):  Deleted in favour of the above.
6184         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
6185         linking with libdmalloc.
6186         * m4/xstrdup.c (WITH_DMALLOC): ditto.
6188         * modules/frozen.m4:  New test case.
6189         * modules/unfrozen.m4:  ditto.
6190         * modules/modfreeze.test:  New test.
6191         * modules/unload.test:  ditto.
6192         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
6193         (TESTS): Use them.
6194         * modules/modpath1.test:  Don't try this test if module support is
6195         not compiled in.
6196         * modules/modpath2.test: ditto.
6197         * modules/modpath3.test: ditto.
6198         * modules/modpath4.test: ditto.
6199         * modules/modtest.test: ditto.
6200         * modules/shadow.test: ditto.
6202         * modules/perl.c: New module.
6203         * modules/perl.m4: Example of using it.
6204         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
6206         * src/m4.c (main): Assume interactive mode if STDIN is connected
6207         to a tty.
6208         Changed startup sequence slightly so that syntax is not
6209         initialised from here when loading a frozen file.
6211         * src/builtin.c:  Much improved macro definition style.
6212         * src/m4private.h:  Internal structures for m4_builtin and
6213         m4_macro instances.  These are not exposed to module writers.
6214         * src/module.c (module_modname_find):  Find a module structure
6215         from the its name.
6216         (make_macro_table):  Build an internal macro table from a external
6217         definition.
6218         (make_builtin_table):  Build an internal builtin table from an
6219         external definition.
6221         * src/module.c (module_unload): Be extremely careful to remove
6222         builtins and macros that match the module being unloaded -- no
6223         longer assume that the top element can be removed incase another
6224         odule defines an identical name.
6225         * src/symtab.c (remove_table_reference_symbols): remove all symbol
6226         table entries which refer to a given builtin table.
6227         * src/builtin.c (remove_tables): Use it!
6229 2000-07-13  Thomas Tanner  <tanner@ffii.org>
6231         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
6232         * acm4/modules.m4: deleted
6233         * bootstrap: don't libtoolize libltdl!
6234         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
6235         if set, enable WITH_MODULES and add modules to DLPREOPEN
6236         * examples/misc.test: redirect standard output
6237         * lib/Makefile.am: don't use DLLDFLAGS
6238         * lib/m4module.c: include necessary headers to silence GCC -Wall
6239         * lib/m4regex.c: fixes to silence GCC -Wall
6240         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
6241           build modules conditionally
6242         * modules/shadow.c: define symbol aliases before using them
6243         * modules/test.c: define symbol aliases before using them
6244         * po/de.po: update translation
6245         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
6246         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
6247         LIBLTDL to LIBS.
6248         * src/m4.c: initialize libltdl's preloaded symbols via
6249         LTDL_SET_PRELOADED_SYMBOLS
6250         * src/module.c: libltdl's memory management must be initialized
6251         before calling lt_dlinit!, fix warnings
6253 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
6255         * README:  Caveat about nls not supported by dll architecture on
6256         Windows.
6258         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
6260         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
6261         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
6262         * modules/Makefile.am (LIBS): ditto.
6263         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
6264         $(top_srcdir)/m4 (for only <m4module.h>).
6265         * modules/shadow.test: fixed for VPATH.
6266         * modules/modtest.test: ditto.
6267         * modules/modpath4.test: ditto.
6268         * modules/modpath3.test: ditto.
6269         * modules/modpath2.test: ditto.
6270         * modules/modpath1.test: ditto.
6272         * modules/time.test: Removed due to timezone dependence,
6273         * modules/Makefile.am (TESTS): Removed time.test.
6275         * configure.in: Use $3 of AC_DEFINE so that we can,,,
6276         * acconfig.h: Remove everything except the gettext parameters.
6277         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
6278         AC_DEFINE.
6279         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
6280         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
6281         increment serial number.
6283         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
6284         src dir and immediately after libm4 is built for confidence that
6285         it doesn't rely on the src directory.
6286         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
6287         makeinfo stop the build on cygwin (because they don't work).
6289         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
6291         * m4/m4private.h: ...is not a public header, so moved to src.
6292         Add `#include <config.h>', `#define _COMPILING_M4' and
6293         `#include "m4.h".
6294         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
6295         * src/Makefile.am (noinst_HEADERS): add m4private.h.
6296         * src/builtin.c: `#include "m4private.h"' now takes care of the
6297         above.  Duplicates removed.
6298         * src/debug.c: ditto.
6299         * src/eval.c: ditto.
6300         * src/evalmp.c: ditto.
6301         * src/format.c: ditto.
6302         * src/freeze.c: ditto.
6303         * src/input.c: ditto.
6304         * src/m4.c: ditto.
6305         * src/macro.c: ditto.
6306         * src/module.c: ditto.
6307         * src/numb.h: ditto.
6308         * src/output.c: ditto.
6309         * src/path.c: ditto.
6310         * stackovf.c: ditto.
6311         * symtab.c: ditto.
6313         * po/POTFILES.in: compensate for renaming of lib/*.
6314         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
6315         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
6316         and then in $(top_srcdir)/lib (for eg. "m4private.h").
6317         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
6318         m4/libm4.la.
6319         * m4/m4error.h:  Renamed error.h, for installation to
6320         $prefix/include/m4..
6321         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
6322         * m4/m4regex.h: Renamed regex.h, for same reason.
6323         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
6324         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
6325         * m4/m4regex.c: Renamed regex.c, and fix #includes.
6327         * lib: moved to m4 to easily support header installation to
6328         $prefix/include/m4.
6329         * Makefile.am (SUBDIRS): renamed lib dir to m4.
6330         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
6331         * acm4/regex.m4: Point to m4/regex.c.
6333         * examples/foreach.m4:  Sanitise quoting.
6334         * examples/foreach.test:  New torture test.
6335         From Akim Demaille <akim@epita.fr>
6337 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
6339         * src/ltdl.c: Use access() to abort doomed module load attempts
6340         if module file does not exist.
6342         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
6343         getopt1.o will already be used if appropriate, so I moved getopt.c
6344         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
6346         * modules/modpath1.test: Use correct filename in header line.
6347         * modules/modpath2.test: ditto.
6348         * modules/modpath3.test: ditto.
6349         * modules/modpath4.test: ditto.
6351         Without these changes lt_dlopen("test") attempts to
6352         LoadLibrary("/bin/test") on Windows, which although harmless
6353         generates a spurious error message which spoils most of the tests:
6354         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
6355         (TESTS): s/test.test /modtest.test /
6356         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
6357         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
6358         * modules/modpath1.test: s/test.m4 /modtest.m4 /
6359         * modules/modpath2.test: ditto.
6360         * modules/modpath4.test: ditto.
6361         * modules/modpath3.test: s/-m test /-m modtest /
6362         * modules/shadow.m4: use {un,}loadmodule(`modtest').
6364 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
6366         * src/ltdl.c (find_file): Updated to new version with fixed memory
6367         allocation bug in `next'.
6368         * src/ltdl.h: updated to match.
6370         * modules/Makefile.am:  Cleaned up and reordered.
6372 2000-01-16  René Seindal  <rene@seindal.dk>
6374         * modules/Makefile.am (TESTS): New tests for the module system.
6376         * modules/*.test: New files.
6378         * src/m4.c (main): Added call to module_init().
6379         Treats -M and -m as the arguments -D -U and -t, ie deferred.
6381         * src/m4.h: Added declaration of module_init().
6383         * src/module.c (module_init): No longer static
6385         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
6386         Added to shut up automake about non standard libtool library
6387         names.
6389         * src/module.c: Disabled DEBUG by default.
6391         * modules/README: Changed example from unload.m4 to shadow.m4
6393         * modules/shadow.m4: Renamed from unload.m4
6395         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
6397         * src/m4.c (main): Functionality for -m and -M were reversed.
6398         Fixed.
6400 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
6402         * doc/help2man.pl: updated to version 1.020.
6404         * lib/COPYING.LIB:  updated to version 2.1.
6406         * lib/m4module.h: restructure the M4_SCOPE code to work when
6407         creating a dll which links with libm4.la and both DLL_EXPORT
6408         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
6409         both defined.
6411 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
6413         Merged the following changes from my tree:
6415         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
6417         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
6418         ported to compile shared libs.
6420         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
6421         use `__declspec(dllimport)' when linking libm4.la on win32.
6422         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
6424         * configure.in (M4OBJS): Discover whether we need the shipped
6425         implementation of getopt_long.
6426         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
6427         main binary here, as opposed to the module library in lib/libm4.la.
6429         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
6431         * modules/README: Updated to describe the improved libltdl based
6432         module scheme.
6433         * README (cygwin): Added some compilation notes for building m4
6434         correctly under cygwin.
6435         * TODO: Cleaned out the entries for the module system since they
6436         are now implemented.
6438         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
6439         all instances of __P with M4_PARAMS.
6441         * lib/getdate.h: removed unreferenced file.
6443         * lib/m4private.h: New file to define the private interface to the
6444         token_data struct, which must be shared between m4module.c, and
6445         builtin.c but not exported to modules built from the installed
6446         m4module.h since it's size changes depending on compile time
6447         options.
6449         * src/m4.h: Lots of stuff moved to lib/m4module.h.
6451         * lib/m4module.h: New file to define the interface available when
6452         compiling m4 modules.
6453         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
6454         necessary for module compilation into this new file.
6456         * lib/Makefile.am (include_HEADERS): install headers (renamed to
6457         avoid nameclash with other system headers) necessary for compiling
6458         modules.
6459         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
6460         so that modules can include the (renamed) installed headers and
6461         be guaranteed a matching implementation.
6462         * lib/m4error.h: renamed from error.h.
6463         * lib/m4obstack.h: renamed from obstack.h.
6464         * lib/m4regex.h: renamed from regex.h.
6465         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
6466         implementation, simply include the shipped version
6467         unconditionally, otherwise it is hard for a module to know
6468         whether the m4obstack.h header it is using matches the
6469         implementation it ends up linking against.
6470         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
6471         the same reason.
6473         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
6475         * examples/misc.test: Don't run this test on machines which don't
6476         have a root user in /etc/passwd (e.g. cygwin).
6478         * tests/get-them (/^@example$/): Error messages might have a
6479         ``.exe'' suffix to the program name, or else use the libtool
6480         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
6481         of these cases are now catered for when comparing error messages
6482         in generated tests.
6483         * tests/other-tests/*.test: ditto.
6484         * examples/*.test: ditto.
6486         * tests/defs (M4): use libtool execute mode.
6487         * examples/defs (M4): ditto.
6489         * tests/get-them (END): explicitly close any open file.
6490         (printthem): In a regular expression, '{' is the start of a repeat
6491         count!  Use `[{]' for a literal open brace.
6492         (/^@node /): Don't use substr on a string shorter than the trim
6493         length.
6495         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
6497         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
6498         substituted.
6499         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
6501 2000-01-10  Andreas Schwab  <schwab@suse.de>
6503         * tests/other-tests/gmp.test: Find config.sh in build directory.
6505         * configure.in: Find tests/mkconfig.sh in $srcdir.
6507         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
6508         <signal.h> (for SUS2 compliant systems).
6510         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
6511         HAVE_SIGINFO_H.
6513 2000-01-10  René Seindal  <rene@seindal.dk>
6515         * Prerelease 1.4o.
6517         * TODO, NEWS: Cleaned up and updated.
6519         * src/m4.c (main): New variable exit_status for exit status in
6520         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
6521         file cannot be read instead of EXIT_SUCCESS.
6523         * src/builtin.c (m4_indir): Changed error message to help
6524         translators (from Akim Demaille <demaille@inf.enst.fr>).
6526         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
6527         Cygnus.
6529         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
6530         from glic 2.1.2.
6532         * src/input.c (match_input): Reordering of code, to avoid multiple
6533         calls to push_string_init() from obstack_grow(), which can happen
6534         with some compilers (found and fixed by James Bonfield
6535         <jkb@mrc-lmb.cam.ac.uk>).
6537         * src/stackovf.c: Added prototypes for ultrix.
6538         (setup_stackovf_trap): Added __P to cast.
6539         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
6541 2000-01-09  René Seindal  <rene@seindal.dk>
6543         * doc/m4.texinfo (Changequote): Added comment about changing
6544         quotes when the old quote is a part of the new.
6546         * src/builtin.c (expand_ranges): Added break after trailing dash.
6547         This caused misbehavious on some systems (found and fixed by Akim
6548         Demaille <demaille@inf.enst.fr>).
6550         * AUTHORS: Thomas Tanner included
6552         * acconfig.h: Added entry for ss_sp (see below).
6554         * configure.in (use_stackovf): Added check for stack_t with member
6555         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
6556         <eggert@twinsun.com>).
6558         * doc/m4.texinfo (Frozen files): Added a simpler example for
6559         generating frozen files from several input files.
6561 1999-11-14  Paul Eggert  <eggert@twinsun.com>
6563         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
6564         lib/regex.c, lib/xmalloc.c.
6566 1999-11-10  René Seindal  <rene@seindal.dk>
6568         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
6570         * src/module.c: reindented.
6571         (module_load): return if this is a repeated load of same module.
6572         (module_init): slight change of logic to avoid repeated
6573         initialisation debug messages.
6575         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
6576         in the distribution.
6578         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
6579         automake warnings about missing lib prefix.
6580         (time_la_LDFLAGS): ditto
6581         (stdlib_la_LDFLAGS): ditto
6583 1999-11-10  Paul Eggert  <eggert@twinsun.com>
6585         * src/m4.h: Include error.h, since our macros use error.
6586         * src/m4.c: Don't need to include error.h.
6588 1999-11-09  Paul Eggert  <eggert@twinsun.com>
6590         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
6591         and zero, as Solaris 7 cc does.
6592         (bcopy): Remove macro; no longer needed with new obstack.h.
6594         * src/output.c (freeze_diversions): Don't assume that a
6595         diversion size can fit in `int'.  Check for diversion file
6596         size too large to be printed with `unsigned long'.
6598         * src/Makefile.am (CFLAGS): Omit -Wall.
6600         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
6602         * src/debug.c (trace_format):
6603         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
6605         * src/freeze.c (produce_frozen_state):
6606         Don't assume string lengths fit in int.
6608 1999-10-13  René Seindal  <rene@seindal.dk>
6610         * po/cs.po: Czech translation added.
6612         * po/sv.po: Updated Swedish translation.
6614         * po/ru.po: Updated Russian translation.
6616         * po/pl.po: Updated Polish translation.
6618         * po/el.po: Greek translation added.
6620 1999-10-13  René Seindal  <rene@seindal.dk>
6622         * configure.in (ALL_LINGUAS): Added Greek translation (el).
6623         (ALL_LINGUAS): Added Czech translation (cs).
6625 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
6627         * src/builtin.c: moved module loading functions into...
6628         * src/module.c: entirely new implementation using libltdl.
6629         * po/POTFILES.in: added src/module.c.
6630         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
6631         are modules, not linktime libraries.
6632         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
6633         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
6634         avoidance on exported symbols.
6635         * modules/test.c (m4_macro_table, m4_init_module,
6636         m4_finish_module): ditto.
6637         * modules/time.c (m4_macro_table): ditto.
6639         * modules/time2.m4: new file which requires command line loading
6640         of modules.
6641         * src/m4.c (--load-module): dynamically load named runtime module
6642         into running executable before reading the source.
6643         (--module-directory): prepend a directory to the module search
6644         path.
6645         (module_init()): Do this the first time we load a module instead;
6646         if the module subsystem is broken normal m4 scripts can still run.
6647         * src/m4.h (install_builtin_table): is now exported.
6649 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
6651         * src/module.c: removed.  No longer required.
6652         * po/POTFILES.in: removed src/module.c.
6654         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
6655         the bootstrap script can recreate.
6656         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
6657         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
6658         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
6659         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
6660         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
6661         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
6662         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
6663         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
6665         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
6666         better.
6667         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
6668         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
6669         the installed gettext.m4 file when running aclocal.
6671 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
6673         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
6674         distinguish this from the last prerelease.
6675         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
6676         in its own subdirectory.
6678         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
6679         lib prefix on a module" feature.
6680         (LDFLAGS): Added `-module -avoid-version' flags to build
6681         versionless module libraries.
6682         * src/builtin.c (m4_load_module): use libltdl.
6683         (module_unload_all): use libltdl.
6684         * src/m4.c (module_init): initialise module loading on demand for
6685         better diagnostics, and so that m4 will still work even if
6686         the module code is broken.
6687         * src/m4.h (module_init): removed.  No longer relevant.
6688         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
6689         exported symbols for compatibility with dlpreopening.
6690         * modules/test.c (m4_macro_table, m4_init_module,
6691         m4_finish_module): ditto.
6692         * modules/time.c (m4_macro_table): ditto.
6694         * bootstrap: New file.  Runs all the autoutils in the right order
6695         after a fresh checkout, or a make maintainer-clean.
6697 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
6699         * src/builtin.c (dump_symbols): New function, factoring common
6700         content of m4_dumpdef and m4_symbols.
6701         (m4_dumpdef): Use it.
6702         (m4_symbols): New function, implementing `symbols'.  Use it.
6703         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
6704         file compile with modern makeinfo.
6705         (Symbols): New node, documenting symbols.
6706         (direntry): Modernize.
6708 1998-12-11  René Seindal  <rene@seindal.dk>
6710         * src/builtin.c (predefined_tab): New predefined macros
6711         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
6712         configure time options.
6714 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
6716         * src/module.c (module_try_load): Don't try to be clever and
6717         overwrite argument string.  Instead allocate all constructed
6718         strings locally, since they can have arbitrary lengths.  Make
6719         arguments pointers to const.
6720         (module_search): Simplify due to above change.
6722 1998-11-29  René Seindal  <rene@seindal.dk>
6724         * Prerelease 1.4n.
6726         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
6728         * tests/other-tests/import-environment.{m4,test}: New test.
6730         * tests/other-tests/discard-comments.{m4,test}: New test.
6732         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
6734         * src/m4.c (main): New option -c --discard-comments.
6735         New global variable discard_comments.
6737         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
6738         discarded, ie never returned from next_token().
6739         Added declaration of discard_comments.
6741         * src/input.c (next_token): Now loops until token type is not
6742         TOKEN_NONE.  Comments are now given this type when comments should
6743         be discarded.
6745         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
6746         and mpeval.
6748 1998-11-28  René Seindal  <rene@seindal.dk>
6750         * src/m4.c (main): New option --import-environment (no single
6751         letter option).
6753         * When configured with --with-gmp both the normal (fast) eval()
6754         and the gmp aware mpeval() are defined.  To restore previous
6755         bahaviour use "define(`eval', defn(`mpeval'))".
6757         * tests/other-tests/gmp.m4: Changed to use mpeval().
6759         * src/evalmp.c: New file for compiling eval.c as gmp aware.
6760         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
6762         * src/eval.c: Now includes "numb.c" directly.  Everything in this
6763         file must by static, except evaluate(), which is changed to
6764         mp_evaluate() if USE_GMP in force.
6766         * src/numb.c: Changed to be included by eval.c instead of being
6767         compiled separately.  Everything is declared static.
6769         * src/numb.h: Removed declarations of functions, as numb.c is now
6770         included by eval.c.
6772         * src/builtin.c: Declaration of m4_mpeval() added.
6773         Inserted `mpeval' in builtin table.
6774         (do_eval): New function with common code for m4_eval and m4_mpeval.
6775         (m4_mpeval): New function for gmp version of eval.
6777         * src/m4.h: Declaration of mp_evaluate().
6779         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
6780         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
6782         * src/m4.c (main): m4 --version also shows which options were used
6783         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
6785 1998-11-27  René Seindal  <rene@seindal.dk>
6787         * Error messages now always print program name before input file
6788         name as specified by GNU coding standards.  Reported by Akim
6789         Demaille <demaille@inf.enst.fr>.
6791         * doc/m4.texinfo (Include): Change due to changed error message
6792         format.
6793         (Eval): Do.
6795         * tests/get-them: Minor change to sed script due to changed error
6796         message format.
6798         * src/m4.c (print_program_name): New func used to print program
6799         name, input file and line number in error ().  Used as an
6800         error_print_progname handler.
6801         (reference_error): Removed.
6802         (main): Assigns error_print_progname.
6804         * src/m4.h (M4ERROR): Removed reference_error ().
6806 1998-11-25  René Seindal  <rene@seindal.dk>
6808         * Updated to libtool 1.2b.
6810         * src/builtin.c (install_builtin_table): Added braces to avoid
6811         warning of ambiguous 'else'.
6813         * src/module.c: Inserted search path code from path.c modified to
6814         use new interface.
6815         (module_init): Configured default path used only if M4MODPATH is
6816         not set.
6817         (module_try_load): Now reads libMODULE.la as generated by libtool
6818         for actual module name.
6819         (module_load): Gives better error messages on failure.
6821         * src/m4.h: Added declarations of structures and functions for
6822         generic search path handling.
6824         * src/path.c: Removed all module specific code and introduced new
6825         functions of more generic search path handling.
6827 1998-11-24  René Seindal  <rene@seindal.dk>
6829         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
6830         included gettext, as <libintl.h> might not be found
6831         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
6833 1998-11-22  René Seindal  <rene@seindal.dk>
6835         * src/output.c (insert_diversion): Fixed bug that might cause m4
6836         to read from standard output!  Triggered by input
6837         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
6838         so now 'undivert(0)' does nothing.
6840 1998-11-18  René Seindal  <rene@seindal.dk>
6842         * Prerelease 1.4m.
6844         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
6845         could be changed when compiling a illegal regexp, causing later
6846         use of the regexp to dump core.
6848         * src/module.c (module_load): Changed error message to conform to
6849         standards.
6851         * src/m4.c (usage): Added message about reporting bugs.
6853         * doc/m4.texinfo (Changeword): Corrected a wrong example.
6854         (Changeword): Added note about the type of regexps used.
6856         * ltconfig, ltmain.sh: New files from Libtool 1.2.
6858         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
6859         and AM_PROG_LIBTOOL.
6861         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
6862         with libtool.
6864         * modules/Makefile.am: Changed completely to compile modules using
6865         libtool.  The modules are compiled as shared libraries, and are
6866         renamed when installed.
6868         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
6869         USE_SHL_LOAD to HAVE_SHL_LOAD
6871         * src/builtin.c (shipout_string): Now tests for a NULL string.
6873         * src/module.c: New level of indirection around non-portable
6874         functions to load shared objects.  Intended to encapsulate the non
6875         portable parts better and to reduce the number of #ifdefs in the
6876         code.
6878         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
6879         directory modules/ to the distribution.
6881 1998-11-15  René Seindal  <rene@seindal.dk>
6883         * Prerelease 1.4l.
6885         * modules/stdlib.c: New module `stdlib' defining some standard
6886         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
6887         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
6889         * src/builtin.c (shipout_string): New convenience function for
6890         builtins and modules.
6892         * src/module.c (module_load): Tentative support for
6893         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
6895         * Makefile.am (SUBDIRS): Directory modules added if configured.
6897         * modules/Makefile.am: Now correctly compiles and installs
6898         modules in pkglibexecdir.
6900         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
6901         These two are now initialised by autoconf macros.
6903         * src/path.c (module_env_init): MODULE_PATH is always on the
6904         search path.
6906         * src/Makefile.am: Now generated pathconf.h which defined the
6907         default MODULE_PATH.
6909         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
6910         where modules are installed.
6912         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
6913         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
6914         build and install automatically, and it is prepared for other
6915         interfacec than dlopen().
6917         * src/builtin.c (predefined_tab): Added __m4_version__ for the
6918         current version of GNU m4.  It is a GNU extension.
6920 1998-11-14  René Seindal  <rene@seindal.dk>
6922         * tests/Makefile.am (GENERATED_TESTS): Added new
6923         generated-tests/changesy.8.test
6925         * doc/m4.texinfo (Changesyntax): Documentation for escape
6926         syntax class.
6928         * src/macro.c (expand_token): Check for escaped macro call before
6929         symbol table lookup.
6931         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
6932         characters
6934         * src/input.c: New static variable use_macro_escape, which is TRUE
6935         iff some character has code SYNTAX_ESCAPE
6936         (input_init): Added initialisation of use_macro_escape.
6937         (check_use_macro_escape): New function to synchronise
6938         use_macro_escape with the syntax table.
6939         (set_quotes): Added call to check_use_macro_escape()
6940         (set_comment): Do.
6941         (set_syntax): Do.
6942         (next_token): Added new case for IS_ESCAPE.
6944         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
6946 1998-10-13  René Seindal  <rene@seindal.dk>
6948         * Prerelease 1.4k.
6950         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
6951         generated-tests.
6953         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
6954         maintained tests in tests/other-tests.  These currently tests for
6955         8-bit transparency, multiple precision arithmetic and sync-line
6956         output.  Test for stackoverflow detection does not work.
6958         * examples/Makefile.am (TESTS): Added tests for all example files.
6960         * examples/mktests.sh: New file.  Help program for creating test
6961         files.
6963         * tests/mkconfig.sh: New file to generate tests/config.m4 and
6964         tests/config.sh.  This is for tests of configure selectable
6965         features.  Picks up all set WITH_ and ENABLE_ veriables from
6966         config.h
6968         * src/path.c (path_search): Added argument 'char **expanded_name'
6969         to return the expanded name.
6971         * src/m4.h: Added 2nd argument to declaration of path_search().
6973         * src/m4.c (main): Added 2nd argument to path_search().
6975         * src/freeze.c (reload_frozen_state): Do.
6977         * src/builtin.c (m4_undivert): Do.
6978         (include): Do.
6980 1998-10-11  René Seindal  <rene@seindal.dk>
6982         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
6984         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
6986         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
6988         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
6990         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
6992         * intl/: Updated to GNU gettext 0.10.35.
6994         * doc/m4.texinfo (Format): Documented that format is blind.
6996         * src/builtin.c (builtin_tab): Builtin format marked as blind.
6998 1998-10-07  René Seindal  <rene@seindal.dk>
7000         * Prerelease 1.4j.
7002         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
7003         .test, as the files are no longer just m4 input.
7005         * tests/get-them (FILE): Changed .m4 extension to .test.
7007         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
7008         Otherwise quoted strings with leading whitespace first in a macro
7009         argument would be eliminated.
7011         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
7012         (expand_argument): Do.
7014         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
7015         grouped together iff both quote and comment strings are single
7016         character.  Otherwise they might include a comment/quote leader.
7017         (next_token): Returns new token type TOKEN_SPACE.
7019         * src/builtin.c (push_builtin_table): New function to push a
7020         builtin_table on the stack without installing its contents.
7021         (find_builtin_by_name): Added call to push_builtin_table() if
7022         reading frozen files.  Otherwise the builtins named in the frozen
7023         files could not be found.
7024         (install_builtin_table): Changed to use push_builtin_table()
7026 1998-10-04  René Seindal  <rene@seindal.dk>
7028         * po/pl.po: Polish translation added.
7030         * po/POTFILES.in: src/module.c added.
7032 1998-10-04  René Seindal  <rene@seindal.dk>
7034         * Prerelease 1.4i.
7036         * configure.in (ALL_LINGUAS): Added Polish pl.po
7038 1998-10-03  René Seindal  <rene@seindal.dk>
7040         * Many files: Incorporated changes to implement dynamic modules.
7041         Detailed comments in src/modules.c and modules/README
7043         * src/module.c: New file, implements the OS dependant parts of
7044         dynamic module loading.
7046         * src/Makefile.am (m4_SOURCES): Added module.c
7048         * src/builtin.h: New file, declares some functions from builtin.c
7049         that are of use for other modules (shipout_int, numeric_arg,
7050         skip_space, bad_argc), and the macros ARG() and DECLARE().
7052         * src/builtin.c (install_builtin_table): New function.  Each
7053         module brings in a builtin_table, which is pushed on a stack.
7054         (struct builtin_table): New struct for list of builtin_tables.
7055         (m4_loadmodule): New function to implement builtin "loadmodule".
7056         (shipout_int): No longer static, to be used by modules.
7057         (numeric_arg): do.
7058         (skip_space): do.
7059         (bad_argc): do.
7060         (builtin_init): changed to call install_builtin_table()
7061         (find_builtin_by_name): Now searches all builtin_tables
7062         (find_builtin_by_addr): do.
7064         * src/path.c: Reorganised to allow for two search paths, one for
7065         include files and one for modules.
7067         * src/m4.h: Added declarations for new functions in module.c and
7068         in path.c.
7070         * src/m4.c (main): Added call to module_init().
7072         * modules: New directory with a few demo modules.
7074         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
7075         in SUBDIRS.
7077         * configure.in: Added modules/Makefile to AC_OUTPUT.
7079         * configure.in: Added code to implement --with-modules.  Tests for
7080         <dlfcn.h> and -ldl.
7082         * acconfig.h: Added WITH_MODULES
7084 1998-10-02  René Seindal  <rene@seindal.dk>
7086         * examples/Makefile.am (pkgdata_DATA): Removed special target for
7087         check and variables TESTS.  These tests are now run from the
7088         tests/ directory.
7090         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
7091         directory.  The files stay there but the tests are run from the
7092         tests/ directory.
7094         * tests/Makefile.am (EXTRA_DIST): Added run-test.
7096         * tests/run-test: New file.  Run a test manually
7098         * tests/Makefile.am, tests/get_them: Moved automatically generated
7099         tests (from the manual) to sub directory tests/gentest/.  The
7100         tests/ directory had gotten a bit messy.
7102 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
7104         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
7105         wrap}.test: Added a few testcases.
7107 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
7109         * Prerelease 1.4h.
7111         * lib/Makefile.am (noinst_HEADERS): regex.h added
7113         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
7114         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
7116         * acm4/Makefile.am: created providing rules to create
7117         $(top_srcdir)/acinclude.m4 to be used by aclocal.
7119         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
7120         `C'. Reported by Ulrich Drepper.
7122         * Makefile.am (SUBDIRS): Removed checks directory
7123         * configure.in (AC_OUTPUT): Removed checks/Makefile
7125         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
7126         the space when m4.texinfo is edited and whitespace.el is active.
7127         (Defn,example): idem.
7129 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
7131         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
7132         ../COPYING. ../Makefile is a file which is certainly present when
7133         test is executed in testSubDir. One can't be sure that the COPYING
7134         file is in .. or ../.. in all situations, the ../Makefile is
7135         always there.
7137         * doc/m4.texinfo (Include): adjusted expected test output
7138         according to new tests, i.e. the input will always come from the
7139         file `in' created by the test.
7141         * tests/Makefile.am: Added three lines at the top to get
7142         esyscmd.1.test working.
7144         * tests/get-them: modified to generate clearer tests who will need
7145         less maintenance when new test examples are created in
7146         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
7147         need the generic file `defs') shell scripts creating `in', `ok',
7148         `out' and when apropriate `okerr' and `err' in the directory
7149         `testSubDir' when executed. The compare of `ok' and `out'
7150         (and of `okerr' and `err') will be the exit status of the test.
7151         `out' must match `ok' (and `okerr' must match `err') for the test
7152         to be succesful.
7154         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
7155         the tests generated by tests/get-them getting it input normally
7156         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
7157         (dot) before the numeric part) is reserved for all other (hand
7158         written) tests. The `+' means one or more times.
7160 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
7162         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
7163         supported short man page to refer to info documentation
7164         * helptoman.pl: added
7165         * configure.in: AC_PATH_PROG(PERL,perl)
7166         * Makefile.am (SUBDIRS): doc after src
7168         * libitized with libit 0.5 from
7169         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
7171         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
7172         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
7173          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
7174         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
7175           lib/rx.{c,h}: added
7176         * configure.in (AC_CHECK_FUNC): getopt_long
7178         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
7180         * TODO: added entry about dependencies
7182 1998-08-10  René Seindal  <rene@seindal.dk>
7184         * Prerelease 1.4f
7186         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
7187         "changesyntax".
7189         * src/builtin.c (m4_changesyntax): Added builtin macro
7190         "changesyntax" to modify the syntax table.
7192         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
7193         table.  All categories are assigned a syntax code and tokens are
7194         read according to this table.
7196 1998-08-09  René Seindal  <rene@seindal.dk>
7198         * src/numb.{c,h}: New files, implements multiple precision eval
7199         using GNU gmp.  Originally submitted by John Gerard Makecki
7200         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
7202         * doc/m4.texinfo (Eval): Added documentation for multiple
7203         precision arithmetic library support.
7205         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
7206         to accommodate multiple precision eval.
7208 1998-08-07  René Seindal  <rene@seindal.dk>
7210         * src/input.c (MATCH, match_input), src/m4.h: changed definition
7211         of comment and quote strings to `unsigned int' to allow eight bit
7212         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
7214         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
7215         patch from Mike Howard <mike@clove.com>
7217 1998-08-06  René Seindal  <rene@seindal.dk>
7219         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
7220         -lintl.
7222 1998-08-03  René Seindal  <rene@seindal.dk>
7224         * Prerelease 1.4e
7226         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
7227         and _ macro.  M4 now builds with --disable-nls.
7229         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
7230         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
7232         * configure.in (ALL_LINGUAS): Added complete list of translations:
7233         de fr it ja nl ru sv.
7235 1998-05-23  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
7237         * po/nl.po: Dutch translation by Erick Branderhorst.
7239         * po/fr.po: French translation by Erick Branderhorst, based on the
7240         translations by François Pinard in fr.msg and m4.cod.
7242 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
7244         * Prerelease 1.4d.
7246         * src/m4.c: #include <signal.h> not <sys/signal.h>.
7248         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
7250         * checks/Makefile.am: explicit list tests in CHECKS.
7252         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
7253         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
7254         mkinstalldirs, install-sh: Added automake (1.3) support.
7256         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
7257         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
7258         Used libitize (0.4) to update.
7260         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
7261         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
7262         README accordingly.
7264         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
7265         stack overflow functionality.
7267 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
7269         * Prerelease 1.4.1.
7271         * Makefile.in (realclean-local): Delete stamp-h.in.
7273         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
7274         Localize, adapting from how it is done in sharutils.
7276         * fr.tt: New file, for French.
7278         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
7279         src/freeze.c: Rename PRODUCT to PACKAGE.
7281 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
7283         * configure.in: Check for <libintl.h> and <locale.h>.
7284         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
7285         src/stackovf.c: Rename _ to __P.
7286         * src/m4.h: Declare _ as a macro returning its argument, or else,
7287         include <libintl.h> and declare _ as gettext.
7288         * src/m4.c: Possibly include <locale.h> and call setlocale.
7289         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
7290         src/input.c, src/macro.c, src/output.c, src/path.c,
7291         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
7292         strings.
7294 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
7296         * doc/Makefile.in (stamp-vti): Use new -r option to date.
7298         * configure.in: Put --with-gmp in place, in prevision for John
7299         Gerard's work.
7300         * acconfig.h: Document WITH_GMP.
7302 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
7304         * Release 1.4.
7306         * doc/Makefile.in (realclean): Also remove stamp-vti.
7307         Reported by Eric Backus.
7309 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
7311         * src/freeze.c (produce_frozen_state): If the frozen file cannot
7312         be opened, return immediately after producing the error message.
7313         Reported by Andreas Schwab.
7315         * configure.in: Check for const only after having found possible
7316         ANSIfying compiler flags, this is of no use to check it before.
7317         Reported by Alexander Lehmann.
7319 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
7321         * src/macro.c (collect_arguments): Cast obstack arguments to
7322         (voidstar), so avoiding compiler warnings.
7323         Reported by Joseph E. Sacco.
7325         * src/freeze.c (produce_frozen_state): Cast printed lengths to
7326         (int) so they correspond to %d format items.
7327         Reported by Joseph E. Sacco.
7329         * src/m4.c (main): Cast the argument to xfree to (voidstar).
7330         * src/symtab.c (free_symbol): Idem.
7331         Reported by Karl Vogel.
7333 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
7335         * Makefile.in (DISTFILES): Distribute BACKLOG.
7337         * configure.in: Define PRODUCT and VERSION.
7338         * acconfig.h: Document PRODUCT and VERSION.
7339         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
7340         constant string m4 and variable or parameter named version.
7342 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
7344         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
7345         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
7346         defines __STDC__ to 0, for indicating it is *not* ANSI!
7347         Reported by Kaveh R. Ghazi.
7349         * configure.in: Added obsolescent tests for AIX and Minix.
7351         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
7352         which texclean does not exist anymore.
7353         Reported by Eric Backus, Jim Meyering, John David Anglin and
7354         Joseph E. Sacco.
7356 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
7358         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
7359         Reported by John David Anglin.
7361         * src/ansi2knr.c: New version, sent by Peter Deutsch.
7362         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
7363         ANSI2KNR, depending on the fact the compiler is ANSI or not.
7364         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
7365         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
7366         of $U, put underline in extensions rather than in basenames.  Use
7367         implicit rules, now that regularity makes this possible.
7368         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
7369         of ansi2knr whenever it is needed.
7370         * configure.in: Adjusted for correct STACKOVF substitution.
7371         * src/debug.c (trace_format): When not __STDC__, use (...) as a
7372         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
7373         Reported by David MacKenzie.
7375         * Makefile.in: Remove binprefix.  Use transform_name instead.
7376         Reported by David MacKenzie.
7378         * doc/Makefile.in: Create version.texi, use it, clean it.
7379         Reported by Jim Meyering.
7381 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
7383         * Makefile.in (all, install, uninstall): Depend on Makefile.
7385         * Makefile.in: For actions invoking $(MAKE) from within compound
7386         sh statements, exit non-zero if the sub-make fails.  Otherwise,
7387         the top-level make may exit successfully when it should fail.
7388         Reported by Jim Kingdon.
7390         * {,/*}Makefile.in: Use && after all cd, in case they fail.
7392         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
7393         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
7394         * configure.in: Substitute PRODUCT and VERSION.
7396         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
7398 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
7400         * Makefile.in (mostlyclean-local): Do not remove *~.
7401         * */Makefile.in (mostlyclean): Idem.
7402         Reported by Robert E. Brown and Richard Stallman.
7404 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
7406         * src/m4.h: Get rid of CONFIG_BROKETS.
7408 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
7410         * configure.in: Use AC_ARG_PROGRAM.
7411         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
7412         Reported by David MacKenzie.
7414 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
7416         * configure.in: Do not add -O to CFLAGS for GNU C, now that
7417         configure does it automatically.
7418         Reported by Jim Meyering.
7420 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
7422         * src/stackovf.c: Declare the handler_t typedef earlier in the
7423         code, use it for stackovf_handler.
7424         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
7425         casting sigsegv_handler.
7426         Reported by Robert Bernstein.
7428         * src/m4.c (main): Initialize program_name to argv[0] without
7429         basename'ing it.
7430         Reported by Karl Berry.
7432 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
7434         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
7435         Reported by Karl Berry.
7437 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
7439         * lib/Makefile.in (mostlyclean): Added.
7440         (TAGS): Make in $(srcdir).
7442         * configure.in: Use `choke me' in test, like everywhere!
7444         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
7445         unreacheable and useless.
7447         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
7449         * lib/Makefile.in (DISTFILES): Distribute TAGS.
7450         (distclean): Do not remove TAGS.
7451         (realclean): Remove it.
7452         * Makefile.in: Make TAGS in lib also, not just in src.
7453         Reported by Karl Berry.
7455         * Makefile.in (distclean, realclean): Instead of recursively
7456         calling $(MAKE) for the -local part, allow parallel execution of
7457         -recursive and -local, only delay the removal of config.status,
7458         which is repeated in both goals.
7460 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
7462         * Release 1.3.
7464         * Makefile.in: Group all *clean-recursive goals in one, using sed
7465         to remove `-recursive' while calling make recursively.  Also, use
7466         a subshell for each recursive $(MAKE).
7467         Reported by Jim Meyering.
7469         * src/m4.h (memcpy): Define with bcopy for BSD systems.
7470         Reported by Kaveh R. Ghazi.
7472         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
7473         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
7474         specify it.
7476         * configure.in: Use date instead of touch for stamp-h.
7477         * Makefile.in (stamp-h.in): Idem.
7479         * Makefile.in (distclean, realclean): Force serial execution of
7480         both goals, in case parallel makes are being used.
7481         Reported by Jim Meyering.
7483         * src/Makefile.in (DISTFILES): Distribute TAGS.
7484         (distclean): Do not remove TAGS.
7485         (realclean): Remove it.
7486         Reported by Karl Berry.
7488 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
7490         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
7491         to old names, for following Autoconf.
7493 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
7495         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
7496         ./install.sh will not be correctly referred to in sub-Makefiles.
7497         Reported by John David Anglin.
7499         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
7500         Reported by Eric Backus.
7502         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
7503         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
7504         config.status into remaking this directory's Makefile only.
7505         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
7506         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
7507         Reported by Jim Meyering.
7509 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
7511         * configure.in: Correct stack overflow detection logic, taking
7512         care of systems having only incomplete implementations (like for
7513         Pyramid 9820 OSx 5.0d).
7514         Reported by Kaveh R. Ghazi.
7516         * src/Makefile.in (TAGS): Remote -t from etags call.
7518 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
7520         * lib/Makefile.in (install): Depend on all.
7522 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
7524         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
7525         Reported by Jim Meyering and John David Anglin.
7527         * Makefile.in (distclean-local): Delete config.log.
7528         Reported by Jim Meyering.
7530         Solidify frozen files with respect to -P:
7531         * src/m4.c: Have -P set prefix_all_buitins variable instead of
7532         calling a function by that name.  Declare the variable.
7533         * src/m4.h: Adjust declaration for prefix_all_buitins.
7534         * src/builtin.c (builtin_init): Merge in functionality from
7535         previous prefix_all_buitins function, while making entries in the
7536         symbol table, but not modifying the builtin description itself.
7538         * src/freeze.c (reload_frozen_state): Add a useless `break;',
7539         because *many* compilers do not accept an empty `default:'.
7540         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
7541         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
7543         * configure.in: Use AC_TYPE_SIGNAL.
7544         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
7545         Reported by Robert Bernstein.
7547         * checks/Makefile.in (check): Modify PATH so check-them will find
7548         m4 in the src directory.
7549         * Makefile.in (check): Don't.
7550         Reported by Akiko Matsushita and Jim Meyering.
7552         * src/output.c (make_room_for, output_character_helper): New
7553         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
7554         a per buffer MAXIMUM_BUFFER_SIZE.
7556         * src/output.c (output_text): New function, for optimizing the
7557         output of strings of characters.  Use it.
7559 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
7561         * doc, src: New directories reorganizing the distribution.
7562         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
7563         files.
7564         * Makefile.in: Adjusted.
7565         * configure.in: Configure new Makefiles.
7567         * m4.h: Declare STRING typedef.  Use it for comment and quote
7568         strings, adjusting all references.  (This is the rudiments of a
7569         beginning for the eventual withdrawal of NUL terminated strings.)
7570         * output.c (shipout_text): Accept a length parameter, and use it.
7571         All callers adjusted.
7573 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
7575         * m4.h: Include <unistd.h> if it exists.
7576         * stackovf.c: Don't.
7578         Clean up for current_diversion variable:
7579         * output.c: Move current_diversion from builtin.c.
7580         * m4.h: Declare current_diversion so builtin.c can access it.
7581         * output.c (output_init, make_diversion): Initialize or update
7582         current_diversion.
7583         * builtin.c (builtin_init, m4_divert): Leave current_diversion
7584         alone.
7586         Remove limit on number of diversions:
7587         * output.c: Replace ndiversion by diversions, declare it.
7588         (output_init): Allocate only diversion 0.
7589         (make_diversion): Allocate new diversions as needed.
7590         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
7591         * m4.c: Still accept -N, but do nothing with it.
7592         Reported by David MacKenzie.
7594         Freeze diversions:
7595         * output.c (freeze_diversions): New function.
7596         * m4.h: Declare freeze_diversions.
7597         * freeze.c: Document frozen file format, revise it, call
7598         freeze_diversions to add diversions to frozen format, and code to
7599         reload them properly.
7600         * m4.c: Do not undivert automatically at end when status being
7601         frozen.  Do not call builtin_init when reloading frozen state.
7603         Speed up diversion processing:
7604         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
7605         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
7606         structure and variables, cached variables out of output_diversion,
7607         reallocate_diversion_for and OUTPUT_CHARACTER.
7608         (shipout_text, make_diversion, insert_diversion): Adapted to new
7609         structures.
7610         (insert_file): Use better buffering.
7611         Reported by David MacKenzie.
7613 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
7615         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
7616         dist works from another build directory.
7618 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
7620         * symtab.c (hack_all_symbols): Use hash_table_size instead of
7621         constant HASHMAX, for -H option to work better.
7623         * builtin.c (DECLARE): Simplify by using _ ().
7625         * freeze.c: New file.
7626         * Makefile.in: Compile it, distribute it.
7627         * m4.c: Recognize, document and process --freeze-state (-F) and
7628         --reload-state (-R) options.  Pass a true flag to builtin_init
7629         only if no reloading some state.
7630         * builtin.c (define_builtin): Remove static specifier.
7631         (find_builtin_by_name): Remove static specifier.
7632         (builtin_init): Accept and obey a flag argument.
7633         * m4.h: Add declarations for freeze.c, changes for builtin.c.
7635 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
7637         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
7638         specifier.
7640         * configure.in: Implement --with-dmalloc.
7641         * acconfig.h: Document WITH_DMALLOC.
7642         * m4.h: Add code for when WITH_DMALLOC.
7644 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
7646         * m4.c (long_options): Use "error-output", the dash was missing.
7647         Reported by Akiko Matsushita.
7649 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
7651         * m4.h: Include <sys/types.h>.
7652         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
7653         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
7654         int.
7655         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
7656         as size_t, not int.
7657         * builtin.c (dump_args): Declare len as size_t, not int.
7659         * debug.c: Prototype the forward declaration of debug_set_file.
7661         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
7662         shadowing of this variable.
7663         * output.c (insert_diversion): Idem.
7665         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
7666         (input_init): Duplicate default quote and comment strings.
7667         (set_quotes): Free previous quote strings in all cases.  Duplicate
7668         even default quote strings.
7669         (set_comment): Free previous comment strings in all cases.
7670         Duplicate even default comment strings.
7672         * configure.in: Updated for Autoconf 2.0.
7673         * Makefile.in (distclean-local): Also delete config.cache.
7675         * m4.c (usage): Reorganize the --help output by topic.  Include a
7676         description for debugging flags.
7678 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
7680         * configure.in: If sigaction is available and SA_ONSTACK defined,
7681         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
7682         defined, use sigvec.  Else don't compile stackovf.c.
7683         * stackovf.c (setup_stackovf_trap): Idem.
7684         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
7685         and Simon Leinen.
7687 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
7689         * m4.c (usage): Replace printf par fputs.
7691 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
7693         * Release 1.2
7695 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
7697         * configure.in: Check for sigaction and sigvec.  Add a new delayed
7698         check for RLIMIT_STACK, combine in the checking for getrlimit.
7699         All those things are not universally available.
7700         * stackovf.c: Split setting up the trap handler and catching
7701         signals, for better taking care of various configure outcomes.
7702         * examples/stackovf.sh: Correct a typo.
7703         Reported by Eric Backus, Jim Avera and Jim Meyering.
7705 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
7707         * ansi2knr.c: New version sent by its author, Peter Deutsch.
7709 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
7711         * Makefile.in: Modify so parallel make will not try making
7712         lib/libm4.a twice simultaneously.
7713         Reported by Jim Meyering.
7715 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
7717         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
7718         error message, for when no code possibility exists.  Even if this
7719         line is completely #ifdef'ed out, it brings a syntax error.
7720         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
7722         * Makefile.in (install): Have install depend on all too, for lib
7723         to be remade as needed.
7725         * examples/stackovf.sh: Try ksh, bsh and bash for shells
7726         providing ulimit, instead of using only ksh.
7727         Reported by Jim Avera and Joseph E. Sacco.
7729 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
7731         * Makefile.in (check): Have it depend on all instead of m4.  In
7732         this way, a change in lib will be detected and processed.
7734         * builtin.c (numeric_arg): Use strtol and verify the conversion,
7735         instead of using sscanf which stops as soon as there is a
7736         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
7737         and divert(1xyzzy) were all accepted without any warning or error
7738         messages.
7739         * m4.h: Declare strtol as long if not including stdlib.h.
7740         * configure.in: Check for limits.h, and replace strtol if missing.
7741         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
7742         * lib/strtol.c: New file, from elsewhere.
7743         Reported by Andreas Schwab.
7745 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
7747         * macro.c (expand_macro): Cast value to (boolean) prior to
7748         assigning it to traced.
7749         Reported by Tom McConnell.
7751         * Makefile.in (m4): Always make all in lib first.
7752         Reported by Jim Meyering.
7754 1994-07-06  Jim Avera <jima@netcom.com>
7756         * stackovf.c: Isolated OS-dependent sections; Improved portability,
7757         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
7758         handlers), and a default error message if the fault address is not
7759         available (when neither siginfo.h nor BSD sigcontext are supported).
7760         * configure.in: Changes for stackovf.h: Check for sigcontext,
7761         sigaction, sigstack, and define rlim_t as int if necessary.
7762         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
7763         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
7764         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
7766 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
7768         * configure.in: Use AC_SET_MAKE.
7769         * Makefile.in: Use @SET_MAKE@.
7770         Reported by Jim Meyering.
7772         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
7773         Reported by Ian Taylor.
7775 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
7777         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
7778         because siginfo.h is unrelated to standard headers, and siginfo.h
7779         is already checked for.
7780         Reported by Joseph E. Sacco.
7782         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
7783         PROTOTYPES.
7784         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
7785         AC_PROTOTYPES.
7787 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
7789         * builtin.c (substitute): Use \& to represent this part of the
7790         string which was matched by the whole regexp, instead of
7791         representing the whole string.  Any usage of \0 issues a warning
7792         and acts like \&, it will disappear in some subsequent release.
7794 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
7796         * m4.c: Complete prototype for forwarded declaration of usage.
7798         * input.c (init_macro_token): Correct own reference in error
7799         message.  Previous name get_macro_func was referred to instead.
7800         (next_char):  Correct own reference in error message.  Previous
7801         name advance_input was referred to instead.
7803         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
7804         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
7805         and_term, not_term, logical_not_term, cmp_term, shift_term,
7806         add_term, mult_term, exp_term, unary_term, simple_term): Add
7807         prototype to forwarded declarations.  Declare parameter v1 as
7808         eval_t * instead of int *.  Same for local variable v2 in dyadic
7809         functions.  Same for result in exp_term.
7810         * builtin.c (m4_eval): Declare value as eval_t instead of int.
7811         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
7812         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
7813         (shipout_int): Cast first argument of ntoa to eval_t.
7814         Reported by Thorsten Ohl.
7816         * macro.c: Complete the prototypes of forwarded expand_macro and
7817         expand_token.
7818         Reported by Thorsten Ohl.
7820         * m4.h: Define voidstar as void * or char * depending on __STDC__.
7821         The Ultrix 3.1 compiler cannot do much with void pointers.
7823         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
7824         * m4.c (xfree):  Replace void * by voidstar.
7825         Reported by Tom McConnell.
7827         * ansi2knr.1: New, from elsewhere.
7828         * Makefile.in (DISTFILES): Distribute ansi2knr.1
7830         * Makefile.in (stamp-h.in): Avoid running ./config.status if
7831         stamp-h does not exist yet.  This avoids running it a second time
7832         just after the initial ./configure.
7833         Reported by David MacKenzie and Tom McConnell.
7835         * m4.h: Replace the enum debug_info declaration with a series of
7836         #define's.  The Ultrix 3.1 compiler would otherwise need casting
7837         (int) to most references, when used in expressions.
7838         Reported by Tom McConnell.
7840 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
7842         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
7843         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
7844         calls the compiler.  Previously, FP_PROTOTYPES was only calling
7845         the preprocessor; by not being subject to CFLAGS, this was
7846         discouraging those flags asking for ANSI compilation.
7847         * acconfig.h: Document HAVE_PROTOTYPES.
7848         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
7849         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
7850         Reported by Eric Backus.
7852         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
7853         from the environment.  Default CFLAGS to -g if not set.
7854         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
7855         * lib/Makefile.in: Have CFLAGS substituted from configure.
7856         Reported by Eric Backus and Tom McConnell.
7858         * configure.in: m4_undefine changeword before using AC_ENABLE.
7860         * m4.h: Declare prototypes for error (for ANSI compilers only),
7861         prefix_all_builtins and reference_error.
7862         Reported by Tom McConnell.
7864         * input.c (set_word_regexp): Do not try to initialize the array
7865         test from a string, this does not work with non-ANSI compilers.
7866         Reported by Eric Backus.
7868         * Makefile.in (dist): Clean examples/ before saving it.
7869         (distclean-local): Also remove stamp-h.
7870         Reported by Eric Backus.
7872         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
7873         non ANSI compilers.
7874         Reported by Tom McConnell.
7876         * checks/Makefile.in (clean): Depends on mostlyclean.
7877         (mostlyclean): New goal.
7879 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
7881         * Makefile.in (DISTFILES): Distribute install.sh.
7882         * install.sh: New file, copied from elsewhere.
7883         Reported by Assar Westerlund and Kaveh R. Ghazi.
7885 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
7887         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
7888         * acconfig.h: Explain ENABLE_CHANGEWORD.
7890         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
7891         from code provided by Pete Chown]
7892         * m4.h: Add original_text field to u_t variant of union u.
7893         Declare TOKEN_DATA_FUNC macro.
7894         * builtin.c: Declare changeword.
7895         (m4_changeword): New function.
7896         * input.c: Include "regex.h", define variables with word regexps.
7897         (input_init): Initialize the word regexp.
7898         (set_word_regexp): New.
7899         (next_token): Declare local variables, use the previous code if
7900         default_word_regexp is true.  Else, match using a new code.  Save
7901         the original text.
7902         * macro.c (expand_token): Ship out original text if not a macro
7903         name.
7904         Reported by Krste Asanovic and Pete Chown.
7906         [These modifs all depend upon ENABLE_CHANGEWORD]
7907         * m4.h: Declare external user_word_regexp.
7908         * m4.c: Declare user_word_regexp, and initialize it from
7909         --word-regexp or -W, or NULL if not specified.
7910         * input.c: Use user_word_regexp if specified, instead of
7911         DEFAULT_WORD_REGEXP.
7913         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
7914         agree with it.
7916         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
7917         * checks/Makefile.in: Empty the suffix list.
7918         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
7920         * m4.c: Declare nesting_limit and initialize it to 250.
7921         Implement -LNUMBER or --nesting-limit=NUMBER to change its
7922         value.
7923         * m4.h: Declare nesting_limit as external.
7924         * macro.c (expand_macro): Stop execution whenever nesting limit
7925         is exceeded.
7926         Reported by Bengt Mertensson.
7928         * eval.c (evaluate): Diagnose excess characters in eval input.
7929         Things like `eval(08)' used to return 0 with no diagnostic.
7931         * m4.h: Capitalize first letter of all macro arguments in
7932         definitions.
7934         * m4.c: Declare warning_status, initialize it to 0.  Add new
7935         option -E, or --fatal-warnings, which sets warning_status to
7936         EXIT_FAILURE instead.
7937         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
7938         EXIT_FAILURE if not otherwise done by header files.
7939         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
7940         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
7941         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
7942         argument of all M4ERROR calls.
7943         Reported by Noah Friedman.
7945         * examples/incl-test.m4: Renamed from incl_test.m4.
7946         * examples/include.m4: Include incl-test.m4 instead of
7947         incl_test.m4.
7948         * examples/multiquotes.m4: Renamed from multi-quotes.m.
7950 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
7952         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
7953         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
7954         also tested it on a Sun Sparc workstation running SunOS 4.x.
7956         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
7957         49.format check, abusing a `union values' argument with sprintf
7958         without selecting the proper field.  Now, save the formatting type
7959         first, delaying the fetch of the corresponding argument.
7960         Reported by Joseph E. Sacco and Tom Quinn.
7962         * format.c (format): Remove const from char *fmt declaration when
7963         not HAVE_EFGCVT, because a NUL may be forced into it.
7965         * m4.h: Declare atof() when not STDC_HEADERS.
7966         Reported by Joseph E. Sacco.
7968         * Regenerate configure using Autoconf 1.11, this corrects a
7969         problem about an incorrect cpp seting on NeXT 3.1.
7970         Reported by Alexander Lehmann.
7972 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
7974         * m4.h (_): Change argument from `x' to `Args'.
7976 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
7978         * m4.h: Rename Args() to _().
7979         * m4.h: Remove extern specifier from all function declarations.
7981 1994-04-22  Jim Avera <jima@netcom.com>
7983         * stackovf.c: New file implementing stack-overflow detection.
7984         * configure.in: Check for getrlimit, sigaction.  If all of
7985         standard headers, getrlimit and sigaction, define USE_STACKOVF and
7986         substitute ${U}stackovf.o for STACKOVF.
7987         * acconfig.h: Declare USE_STACKOVF.
7988         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
7989         * m4.h: Declare setup_stackovf_trap().
7990         * m4.c: Call setup_stackovf_trap().
7991         * tests/stackovf_test.sh: New file.
7993 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
7995         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
7997         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
7999 1994-01-30  François Pinard  <pinard@iro.umontreal.ca>
8001         * m4.h: Remove definition of volatile, not used anymore.
8002         Reported by Jim Meyering and Joseph E. Sacco.
8004         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
8005         of `if ... else /* nothing */' for if macros.
8006         Reported by Jim Meyering.
8008         * builtin.c (m4_regexp): Reorganize the code for avoiding a
8009         warning from gcc about `repl' possibly used before defined.
8010         Reported by Jim Meyering.
8012         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
8013         Reported by Jim Meyering.
8015 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
8017         * m4.h: Move the conditional definition of volatile after the
8018         inclusion of system files, because they may define it first.
8020 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
8022         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
8023         get around a problem with Alpha make seeing a syntax error, there.
8024         Reported by Vern Paxson.
8026 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
8028         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
8029         Reported by Richard Stallman.
8031 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
8033         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
8034         instead of AC_HAVE_FUNCS.
8035         Reported by Noah Friedman.
8037 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
8039         * m4.c: Initialize show_help and show_version to zero.
8041         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
8042         Use them in exit() and usage() calls.
8044 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
8046         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
8047         syserr() macro.  Delete errref, add reference_error and M4ERROR.
8048         * m4.c: Replace errref, which was returning an input reference
8049         string, with reference_error, which prints it on standard error.
8050         * builtin.c, output.c: Use errno as second parameter to error,
8051         instead of using syserr() with %s.
8052         * *.c: Use M4ERROR instead of error: no more errref() with %s.
8053         Doing so, the program name appears after the input reference
8054         instead of before, which eases M-x next-error processing.
8056 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
8058         * checks/get-them: Escape braces with backslashes in patterns,
8059         because HPUX-9.01 awk needs this.
8060         Reported by Jim Meyering.
8062 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
8064         * builtin.c: Declare "FILE *popen ();".
8066         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
8067         macros, replace error_message_prefix() declaration by errref()'s.
8068         Declare xrealloc, for use in errref().
8069         * m4.c: Delete error_message_prefix() function, add errref().
8070         * *.c: Use error() systematically in place of all error macros,
8071         now that error() flushes stdout first.  Make needed adjustments.
8073         * m4.h: Remove const in sys_errlist[] declaration, it creates
8074         conflicts on SGI and Alpha.
8075         Reported by Kaveh R. Ghazi.
8077 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
8079         * m4.c: Include <getopt.h> instead of "getopt.h".
8081         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
8082         * acconfig.h: New, for documenting HAVE_EFGCVT.
8083         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
8084         use them wherever appropriate.  Also use -I. for compilations.
8085         * lib/Makefile.in: Use -I.. for compilations.
8086         * *.c: Include <config.h> or "config.h".
8088         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
8089         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
8091 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
8093         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
8095         * input.c (input_init): Initialize quote and comment strings
8096         explicitely instead of calling set_quotes and set_comment: by
8097         doing so, we ensure we do not free uninitialized variables.
8099         * checks/check-them: Reverse arguments to both diff, so the
8100         expected is on the left and the obtained on the right.
8102         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
8103         macros. Delete declarations for m4error, warning, fatal and
8104         internal_error, add declaration for error_message_prefix.
8105         * m4.c:  Delete m4error, warning, fatal and internal_error
8106         routines, add error_message_prefix routine.
8107         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
8108         warning with WARNING*, fatal with FATAL* and internal_error with
8109         INTERNAL_ERROR*.
8110         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
8111         this is not needed anymore.
8113         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
8114         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
8115         and debug_message, add declaration for debug_message_prefix.
8116         * debug.c: Remove static specifier for FILE *debug declaration.
8117         Delete debug_print and debug_message routines, add
8118         debug_message_prefix routine.
8119         * builtin.c, debug.c: Replace debug_print routine calls with
8120         DEBUG_PRINT* macro calls.
8121         * input.c, path.c: Replace debug_message routine calls with
8122         DEBUG_MESSAGE* macro calls.
8124         * m4.h: Remove inclusion of <varargs.h>.
8125         * debug.c: Include <stdarg.h> or <varargs.h>.
8126         (trace_format): Use stdarg instead of varargs if __STDC__.
8128         * configure.in: Remove checks for vfprintf and _doprnt.  These
8129         implementations use varargs tricks which are not portable enough.
8130         * lib/vfprintf.c: Deleted.
8131         * lib/_doprnt.c: Deleted.
8132         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
8133         Reported by Joel Sherrill.
8135         * path.c (add_include_directory): Use xstrdup.
8137         * builtin.c (find_builtin_by_name): Declare static.
8139         * *.[ch]: Add const to a few "char *" declarations.
8141         * configure.in: Remove commented tests for fileno() and fstat().
8142         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
8144         * debug.c (debug_flush_files): New.
8145         * m4.h: Declares it.
8146         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
8147         Reported by Nicolas Pioch.
8149 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
8151         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
8152         Reported by Joel Sherrill.
8154         * builtin.c (prefix_all_builtins): Instead of the table size, use
8155         the null entry at end for stopping the loop.  It was overwritten.
8156         Reported by Andreas Schwab and Jim Meyering.
8158         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
8159         Reported by Kaveh R. Ghazi.
8161         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
8162         Reported by Karl Vogel.
8164 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
8166         * m4.h: Do not define volatile if already defined.
8167         Reported by René Seindal.
8169         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
8171         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
8172         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
8174 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
8176         * m4.h: Define strchr and strrchr in terms of index and rindex,
8177         instead of the other way around.
8178         * builtin.c, m4.c, path.c: Use strchr instead of index.
8180         * input.c (next_char): Remove a "break;" after a "return ...;".
8181         Reported by Tom McConnell.
8183 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
8185         * Release 1.1
8187         * configure.in: Do not copy check files in the build hierarchy.
8188         * checks/check-them: Identify the m4 version being checked.  For
8189         finding m4, look in $PATH instead of in the parent directory.
8190         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
8191         * checks/Makefile.in (.all-stamp): Always create check files in
8192         the source hierarchy, not anymore in the build hierarchy.
8193         (check): cd to the source hierarchy before performing checks.
8194         Do not copy nor clean COPYING anymore, take it from `..'.
8195         Reported by Tom McConnell.
8197         * Makefile.in (Makefile): Use $(SHELL).
8198         (config.status): Use $(SHELL).  Use "config.status --recheck"
8199         instead of "configure --no-create", which is obsolete.
8200         Reported by Tom McConnell.
8202 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
8204         * m4.c (usage): Use "%s" instead of "m4" in format string.
8205         Reported by Jim Meyering.
8207         * Makefile.in: Distribute mkinstalldirs.
8208         Reported by Pierre Gaumond.
8209         Reported by Jim Meyering.
8210         Reported by Tom McConnell.
8211         Reported by Andreas Gustafsson.
8213         * checks/check-them: Renamed from checks/check_them.
8214         * checks/get-them: Renamed from checks/get_them.
8215         * checks/.all-stamp: Renamed from checks/.all_stamp.
8216         * checks/Makefile.in: Changed accordingly.
8217         Reported by Jim Meyering.
8219 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
8221         * lib/Makefile.in (dist): Correct permissions on files.
8223         * output.c: Declare tmpfile, some systems don't.
8225 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
8227         * checks/Makefile.in (dist): Correct permissions on files.
8229         * Makefile.in (dist): Ensure recursive linking for subdirectory
8230         `examples', also set read/write permissions on all its files.
8232         * mkinstalldirs: New, from elsewhere.
8233         * Makefile.in: Use it.
8235         * debug.c: Synchronize debug messages and regular output when
8236         the debug file and stdout are redirected to the same file.
8237         * configure.in: Add (commented) checks for fileno and fstat.
8238         Reported by Jim Avera.
8240         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
8241         etc., arguments, then ignore the superfluous one.  m4 used to
8242         diagnose missing arguments and return the empty string.
8243         Reported by Nick S. Kanakakorn.
8245 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
8247         * m4.c (main): At end of all input, ensure all undiverted text
8248         goes to the main output stream.
8249         Reported by Andreas Gustafsson.
8251         * m4.c (main): exit (0), instead of return 0.
8253         * m4.c: Implement -P and --prefix-builtins.
8254         * builtin.c: Delete const specifier on builtin_tab.
8255         (prefix_all_builtins): New.
8256         Reported by Noah Friedman.
8257         Reported by Scott Bartram.
8259         * c-boxes.el: New, from elsewhere.
8260         * Makefile.in: Distribute it.
8262         * m4.h: Do not define bcopy if <string.h> defines it.
8263         Reported by Stephen Perkins.
8265         * builtin.c (define_macro): Allow a missing second argument, in
8266         which case it is implied empty.  Affects define and pushdef.
8267         Reported by Eric Allman.
8269 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
8271         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
8272         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
8273         * builtin.c: Initialize all the blindness fields in builtin_tab.
8274         (define_builtin): Copy the blindness of a builtin into its symbol.
8275         * macro.c (expand_token): Avoid processing a blind builtin if the
8276         next character is not an opening parenthesis.
8277         Reported by David MacKenzie.
8278         Reported by Noah Friedman.
8280         * configure.in: Ensure an exit status of 0 on completion.
8281         Reported by Vivek P. Singhal.
8283         * eval.c (eval_lex): Admit both lower and upper case letters for
8284         bases greater than 10.  Only lower case letters were accepted.
8286         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
8287         Reported by Krste Asanovic.
8289         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
8290         * eval.c (logical_not_term): New name for not_term.
8291         * eval.c (xor_term): New, between or_term and and_term.
8292         * eval.c (not_term): New, between and_term and logical_not_term.
8293         * eval.c (shift_term): New, between cmp_term and add_term.
8294         Reported by Krste Asanovic: ~, ^, <<, >>.
8295         Reported by Ben A. Mesander: ** vs ^.
8297         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
8298         * m4.h: Delete xrealloc.c.
8299         * lib/xmalloc.c: New, from elsewhere.
8300         * lib/xstrdup.c: New, from elsewhere.
8301         * lib/Makefile.in: Distribute and compile them.
8303         * m4.c: Change progname to program_name.
8304         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
8305         * lib/error.c: New, from elsewhere.
8306         * lib/Makefile.in: Distribute and compile error.c.
8307         * configure.in: Check AC_VPRINTF and for strerror.
8308         * m4.c: Delete cmd_error.  Use error instead.
8309         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
8311         * m4.h: Delete #define const, let Autoconf takes care of this.
8313         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
8314         Merge parse_args into main.  Declare argv to be `char *const *',
8315         then remove superfluous casts.
8317         * m4.c: Rename --no-gnu-extensions to --traditional.
8318         Reported by Ben A. Mesander.
8320         * m4.c (usage): Add a status parameter.  Supply one in various
8321         calls.  Add --help processing.  Remove -V for --version.
8323         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
8325         * lib/Makefile.in: Have an AR=ar declaration.
8326         Reported by Eric Backus.
8327         Reported by Bjorn R. Bjornsson.
8328         Reported by Tom Tromey.
8329         Reported by Kristine Lund.
8330         Reported by Marion Hakanson.
8332 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
8334         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
8335         Reported by Noah Friedman.
8337 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
8339         * Makefile.in: Remove MDEFINES and cleanup.
8341 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
8343         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
8344         Create a gzip file.
8346 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
8348         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
8349         ensure 777 mode for directories, so older tar's will restore file
8350         modes properly.
8352 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
8354         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
8355         so the installer can override automatically configured choices.
8356         Reported by Karl Berry.
8358 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
8360         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
8361         previous version was not working properly on m68k-hp-bsd4.3.
8362         Reported by Roland McGrath.
8364         * lib/_doprnt.c: Stolen from Oleo distribution.
8365         * configure.in: Check for _doprnt.c if vfprintf.c selected.
8366         * lib/Makefile.in: Distribute _doprnt.c.
8367         Do not distribute regex.[ch].old anymore.
8369 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
8371         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
8372         Richard wants it there.
8374 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
8376         * Makefile.in: Add DEFS to MDEFINES.
8377         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
8378         (libm4.a): Remove the library before creating it.
8379         (distclean): Remove tags and TAGS too.
8381 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
8383         * Makefile.in (dvi, m4.dvi): New goals.
8385         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
8386         macro.c, output.c, path.c, symtab.c: Change Copyright from
8387         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
8389         * examples/divert.m4: Deleted, this bug has been corrected.
8391         * Makefile.in (texclean, mostlyclean): New goals.
8393         * Makefile.in (clean): Remove clutter from ansi2knr.
8394         Reported by Pierre Gaumond.
8396 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
8398         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
8399         might well use CFLAGS is s/he needs it.
8401         * Makefile.in: Allow installation of info files from a separate
8402         build directory.
8403         Reported by Jason Merrill.
8404         Reported by David MacKenzie.
8405         Reported by Skip Montanaro.
8406         Reported by Erez Zadok.
8407         Reported by Assar Westerlund.
8409 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
8411         * Release 1.0.3
8412         This is still a beta release for the future GNU m4 version 1.1.
8414         * lib/alloca.c: New, from elsewhere.
8415         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
8417         * m4.h: Do not define index/rindex if already defined.  If
8418         FALSE/TRUE are already defined, do not redefine them, but merely
8419         define boolean typedef to int.
8421         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
8422         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
8423         because some C compilers do not like connectives with #ifdef.
8424         * m4.h: Define `volatile' only if __GNUC__, instead of once for
8425         __GNUC__ and once for __STDC__.
8426         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
8428         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
8429         Makefile dependencies.  Without it, make keeps destroying and
8430         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
8432         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
8433         to diversion/DIVERSION, this was a spelling error.
8435         * m4.c: Declare version[], remove #include "version.h".
8436         * version.h: Deleted.
8437         * Makefile.in: Remove references to version.h.
8439         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
8440         production, by using a simpler and more robust algorithm.  This
8441         solves the problem of synclines sometimes written in the middle of
8442         an output line.  Delete sync_line() and output_lines variable.
8443         * m4.h: Remove sync_line prototype and output_lines declaration.
8444         * input.c (next_char), output.c (shipout_text): Remove references
8445         to output_lines.
8446         * input.c (push_file, pop_file): Merely put the value -1 in
8447         output_current_line instead of calling sync_line, for delaying a
8448         single `#line NUM FILE' before next output line.  Do not test
8449         for sync_output, because this is unnecessary clutter.
8450         * output.c (make_divertion, insert_divertion): Idem.
8451         * input.c: Rename must_advance_line to start_of_input_line, for
8452         consistency.
8454         * debug.c (trace_header): Select a new debug line format, which
8455         better complies with GNU standards for formatting error messages.
8456         With option `-dfl', M-x next-error might be used on the output.
8457         * m4.c (vmesg): Adjust format of error output to GNU standards.
8458         * m4.texinfo: Adjust examples for `make check' to work.
8460         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
8461         case for enum debug_info constants, which were all lower case.
8463         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
8464         re_search_2.
8465         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
8466         collected patches.  I tried a few times using newer regex.[ch], it
8467         mysteriously stopped aborting with this one.  Insecure feeling...
8468         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
8470 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
8472         * m4.c: Change `--no-warnings' to `--silent'.
8473         Reported by David MacKenzie.
8475         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
8476         leave it off for now.  See comment in m4.c for justification.
8477         Reported by David MacKenzie.
8479         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
8480         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
8482         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
8484         * Makefile.in: Ensure recursive cleaning is done before local
8485         cleaning for all clean goals.
8487         * builtin.c (ntoa): Ensure the value is always interpreted as a
8488         signed quantity, whatever the radix is.
8490 1992-11-18  Jim Meyering  <meyering@idefix>
8492         * builtin.c, format.c, input.c: Split long lines.
8493         * m4.c: Use typedef macro_definition instead of struct
8494         macro_definition.
8495         * symtab.c: Use typedef symbol instead of struct symbol.
8497 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
8499         * *.[ch]: Remove all trailing whitespace, in code and comments.
8501         * configure.in: Find some awk.
8502         * Makefile.in: Add $(AWK) to MDEFINES.
8503         * checks/Makefile.in: Transmit $(AWK) to get_them.
8504         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
8505         awk script when switching files, because without this, mawk runs
8506         out of file descriptors.
8508 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
8510         * Makefile.in (realclean): Delete m4.info*.
8511         Reported by Jim Meyering.
8513         * Makefile.in: Adjust and link with checks/Makefile.
8514         * checks/Makefile.in: New.
8515         * configure.in: Output checks/Makefile.
8517         * checks/get_them: Have the dnl header of each test more
8518         recognizable by next-error, also use a better message.
8520 1992-11-16  Jim Meyering  <meyering@idefix>
8522         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
8523         And use that only if __GNUC__ since we're using it's GCC-specific
8524         semantics that tell the compiler the associated function doesn't
8525         return.
8527         * builtin.c (substitute): Don't use character as an array index.
8528         (dumpdef_cmp): Make formal arguments `const void *' to avoid
8529         warnings with gcc -W -Wall on systems with qsort prototype.
8530         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
8531         from gcc -W -Wall.
8533         * eval.c (most functions): Add parentheses to assignments used
8534         as truth values go avoid warnings from gcc -Wall.
8536         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
8537         any functions that don't need external scope.
8539         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
8540         (many functions and arrays): Declare `const'.
8542 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
8544         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
8545         removing the declaration from m4.h.  Also rename false to FALSE
8546         and true to TRUE.
8548         * lib/Makefile.in (Makefile): New goal.
8550         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
8551         so heavily loaded.  It gets more easily overridable, calling make.
8552         Reported by Jim Meyering.
8554         * Makefile.in (dist): Get .fname from the current directory name,
8555         instead of from version.h.  I need updating many files manually,
8556         when the version changes, version.h is just one of them.
8558 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
8560         * m4.h: Remove the tag `boolean' on the enum introducing typedef
8561         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
8562         Reported by Tom McConnell.
8564 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
8566         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
8567         39.cleardiv, which were describing missing or spurious newlines.
8568         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
8569         do not depend on machine word size, `/bin/false' implementation,
8570         or `wc' output format.  `make check' is more dependable, now.
8572         * checks/check_them: Summarize the failed tests by listing their
8573         name, at end.  If none, issue `All checks successful'.  Output
8574         `Checking' instead of `Input file:'.
8576         * checks/get_them, checks/check_them: Reindented.
8578         * Makefile.in (dist): chmod a+r before making the tar file.
8580 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
8582         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
8584         * input.c (next_token): Reinitialize token_buttom just after using
8585         it as a watermark with obstack_free.  Or else, a future token, big
8586         enough for triggering reallocation of the obstack chunk, could
8587         void the initialized value of token_buttom, later causing panic in
8588         obstack_free.  Rename token_buttom to token_bottom everywhere.
8590         * m4.h: Before declaring errno, first include <errno.h> and
8591         ensure that it does not define errno.
8592         Reported by Richard Stallman.
8594 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
8596         * builtin.c: Define and use DECLARE macro for builtins.
8598         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
8599         argument, this is a common idiom for introducing long comments.
8601         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
8602         arguments.  The last argument was silently ignored.
8604         * m4.c (cmd_error): Add a missing semicolon before va_end().
8606 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
8608         * Makefile.in: Now handle protoized sources.  Define and use U.
8609         Compile and use ansi2knr with old compilers.  Update DISTFILES.
8610         Add `aclocal.m4' to `configure' dependencies.
8611         * ansi2knr.c: New, from Ghostscript distribution.
8612         * configure.in: Define U through FP_PROTOTYPES for old compilers.
8613         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
8614         * aclocal.m4: New, provide FP_PROTOTYPES.
8615         * m4.h: Conditionnaly protoized through Args, save for varags.
8616         * builtin.c: Protoized.  Then:
8617         Include <sys/types.h> if size_t is not defined, before "regex.h".
8618         (m4_ifelse): Fetch built-in name properly for diagnostic.
8619         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
8620         (m4_regexp): Add const to `msg' declaration.
8621         (m4_patsubst): Add const to `msg' declaration.
8622         * debug.c: Protoized, save for varargs.
8623         * eval.c: Protoized.
8624         * format.c: Protoized.
8625         * input.c: Protoized.
8626         * m4.c: Protoized, save for varargs.  Then:
8627         (xfree): Accept void * instead of char *.
8628         (xmalloc): Return void * instead of char *.
8629         (xrealloc): Accept and return void * instead of char *.
8630         * macro.c: Protoized.
8631         * output.c: Protoized.
8632         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
8633         * symtab.c: Protoized.
8635 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
8637         * m4.texinfo: Remove directory from diagnostics in 30.include,
8638         51.eval, 56.errprint and 57.m4exit tests.
8640         * m4.h: Remove declarations for int or void system functions, they
8641         cause more conflicting trouble than they make good.
8643         * configure.in: Avoid configuration header file.  Add some tests.
8644         * m4.h: Remove #include "config.h".
8645         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
8646         Then, rewritten for better compliance with GNU standards.
8648 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
8650         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
8651         because of a misplaced #endif.
8653         * Many *.[hc] files: Correct intra-line spacing here and there,
8654         according to GNU indent 1.6 advice.
8656         * configure.in: New, using Autoconf 1.2.
8657         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
8658         * Delete old configure.in, configure, etc/configure.in,
8659         etc/configure, lib/configure.in, lib/configure and config/*.
8660         Reported by Jason Merrill.
8662         * symtab.c (hash): Change (char) NULL to '\0'.
8663         Reported by Jason Merrill.
8665         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
8666         etc/nextvers.sh.  Release numbers will be edited `by hand'.
8667         * version.h: De-automatize, force value in.
8669         * m4.c: Changes in order to use a newer getopt.h.
8670         Reported by David MacKenzie.
8672         * checks/: New name for examples/.
8673         * checks/get_them: New location for etc/get_examples.
8674         * checks/check_them: New location for etc/check_examples.
8675         * Makefile.in, checks/get_them, checks/check_them: Adjust.
8676         * lib/vfprintf.c: New location for etc/vfprintf.c.
8677         * Delete empty etc/.
8678         * examples/: New name for test/.
8680 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
8682         * Makefile.in (check): Add m4 as dependency.
8684         * m4.c: Accept --no-warnings instead of --no_warnings, and
8685         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
8686         usage message more informative.
8687         Reported by David MacKenzie.
8689 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
8691         * etc/check_examples: New name for check_examples.sh.
8692         * etc/get_examples: New name for get_examples.sh.
8693         * Makefile.in, etc/Makefile.in: Use new names.
8695         * Makefile.in: Transmit $(CC) while making in lib.
8697         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
8698         code disposition by hand.
8700 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
8702         * m4.h: Delete definitions for abort() and exit().
8703         Reported by Richard Stallman.
8705         * config/hmake-unicos, config/s-unicos.h: New files.
8706         Reported by Hal Peterson.
8708         * eval.c (exp_term): Have N^0 return 1.
8709         Reported by Michael Fetterman.
8711         * eval.c, input.c, m4.h: Remove last comma in enums.
8712         Reported by Mike Lijewski.
8714         * Transfer of maintenance duties from René to François.
8716 1991-10-24  René Seindal <seindal@diku.dk>
8718         * Release 1.0.  Many thanks to those, who provided me with bug
8719         reports and feedback.
8721         * Uses GNU configure, taken from the gdb distribution.
8723         * Uses GNU getopt(), with long option names.
8725         * The -Q/+quiet option is added, which suppresses warnings about
8726         missing or superflous arguments to built-in macros.
8728         * Added default options via the M4OPTS environment variable.
8730         * The built-in format can now be configured to use sprintf as
8731         the formatting engine, for systems without [efg]cvt(3).
8733         * GNU library code is moved to the ./lib subdirectory; other
8734         utility files are now in ./etc.
8736         * Several minor bugs have been fixed.
8738 1991-07-26  René Seindal <seindal@diku.dk>
8740         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
8741         François Pinard and Roland H. Pesch for providing me with reports.
8743         * The builtins incr and decr are now implemented without use of
8744         eval.
8746         * The builtin indir is added, to allow for indirect macro calls
8747         (allows use of "illegal" macro names).
8749         * The debugging and tracing facilities has been enhanced
8750         considerably.  See the manual for details.
8752         * The -tMACRO option is added, marks MACRO for tracing as soon
8753         as it is defined.
8755         * Builtins are traced after renaming iff they were before.
8757         * Named files can now be undiverted.
8759         * The -Nnum option can be used to increase the number of
8760         divertions available.
8762         * Calling changecom without arguments now disables all comment
8763         handling.
8765         * The function m4_patsubst() is now consistently declared
8766         static.
8768         * A bug in dnl is fixed.
8770         * A bug in the multi-character quoting code is fixed.
8772         * Several typos in the manual has been corrected.  More probably
8773         persist.
8775         * The m4.info file is now installed along with the program.
8777 1990-11-15  René Seindal <seindal@diku.dk>
8779         * Updated and enhanced version.  Release 0.75, manual 0.07.
8781         * Implemented search path for include files (-I option and
8782         M4PATH envronment variable).
8784         * Implemented builtin "format" for printf-like formatting.
8786         * Implemented builtin "regexp" for searching for regular
8787         expressions.
8789         * Implemented builtin "patsubst" for substitution with regular
8790         expressions.
8792         * Implemented builtin "esyscmd", which expands to a shell
8793         commands output.
8795         * Implemented "__file__" and "__line__" for use in error
8796         messages.
8798         * Implemented character ranges in "translit".
8800         * Implemented control over debugging output.
8802         * Implemented multi-character quotes.
8804         * Implemented multi-character comment delimiters.
8806         * Changed predefined macro "gnu" to "__gnu__".
8808         * Changed predefined macro "unix" to "__unix__", when the -G
8809         option is not used.  With -G, "unix" is still defined.
8811         * Changed "shift", "$@" and "$*" to not insert spaces afters
8812         commas.
8814         * Added program name to error messages.
8816         * Fixed two missing null bytes bugs.
8818 1990-01-22  René Seindal <seindal@diku.dk>
8820         * Initial beta release.  Release 0.50, manual 0.05.
8823         -----
8825         $Revision$ $Date$
8827         Local Variables:
8828         coding: utf-8
8829         End:
8831         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
8832         2005, 2006, 2007 Free Software Foundation, Inc.
8834         Copying and distribution of this file, with or without
8835         modification, are permitted provided the copyright notice
8836         and this notice are preserved.