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