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