* Makefile.am (dist_pkgdata_DATA): Distribute recently-added
[m4.git] / ChangeLog
blob07c44754d9a41a4ec496b831d795c45f1842518b
1 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3         * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
4         files.
6 2006-10-26  Eric Blake  <ebb9@byu.net>
8         Silence -O2 -Wall -Wwrite-strings warnings.
9         * m4/m4private.h (m4_symbol_value): Const-ify text.
10         * m4/m4module.h (m4_get_symbol_value_text)
11         (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
12         (m4_set_symbol_value_placeholder): Likewise.
13         * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
14         fallout.
15         * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
16         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
17         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
18         Likewise.
19         * modules/format.c (format): Likewise.
20         * src/main.c (main): Likewise.
21         * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
22         * modules/shadow.c (shadow, test): Likewise.
23         * m4/output.c (m4_make_diversion): Don't hold on to empty
24         diversions.
25         (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
26         (m4_freeze_diversions): Likewise.  Don't use uninitialized
27         variable.
29         Convert diversions to list instead of sparse array, part 2.
30         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
31         avltree-list'.
32         * m4/output.c (m4_diversion): Add next pointer and divnum members.
33         (diversion_table): Convert to a list instead of a sparse array.
34         (free_list): Maintain free list of reclaimed diversions.
35         (equal_diversion_CB, cmp_diversion_CB): New functions.
36         (m4_output_init): Set up list.
37         (m4_output_exit): Tear down list.
38         (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
39         list iteration.
40         (m4_make_diversion): Change creation of new diversions.
41         (m4_insert_diversion_helper): New function, to avoid list
42         searches.
43         * tests/builtins.at (divert): The test now passes.
44         * NEWS: Document this improvement.
46         Convert diversions to list instead of sparse array, part 1.
47         * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
48         for length.
49         * m4/output.c (diversion, total_buffer_size, output_unused):
50         Track size in size_t.  All users changed.
51         (struct diversion): Reduce size now, to compensate for part 2.
52         (m4_make_diversion, make_room_for): Avoid malloc overflow.
53         (m4_output_exit): Fix typo in assert.
54         (m4_output_init, make_room_for, m4_make_diversion)
55         (m4_insert_diversion, m4_freeze_diversions): Adjust users of
56         struct m4_diversion to disambiguate the new union.
57         * tests/builtins.at (divert): Detect this failure.
59 2006-10-25  Eric Blake  <ebb9@byu.net>
61         * m4/m4module.h (m4_push_builtin): Add parameter.
62         * modules/m4.c (defn): Update caller.
63         * m4/input.c (file_read_init, string_read_init): No longer
64         needed.
65         (input_funcs): Change signature of read_func, all callers
66         updated.
67         (composite_peek, composite_read, composite_unget),
68         (composite_print, composite_funcs): New input type.  Not yet
69         fully utilized, but one step closer to fixing defn.
70         (m4_input_block): Make every input block track current file and
71         line.  Rename some members.  Remove unused out_line.  Add support
72         for composite input block.
73         (input_change): New flag.
74         (file_peek, file_read, file_clean, file_unget, file_print):
75         Update callers.
76         (m4_push_file, m4_push_builtin, m4_push_string_init)
77         (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
78         (m4_skip_line, pop_input): Track input block changes.
79         (m4_pop_wrapup): Avoid overflow.
80         (init_builtin_token): Handle composite input.
81         (next_char): Handle input block changes.
82         * doc/m4.texinfo (Location): Remerge from branch.
84         * src/m4.h (includes): Need <locale.h> after all; fixes
85         regression from yesterday.
87         * m4/system_.h (obstack_regrow): New macro.  Hopefully glibc will
88         accept it someday.
89         * m4/macro.c (expand_macro): Avoid referencing invalid memory.
90         Handle nesting the argc obstack.
91         (expand_token): Avoid unnecessary malloc.
92         (collect_arguments): Copy name before invalidating it.
93         (argc_stack, argv_stack): New variables.
94         (m4_macro_expand_input): Initialize argc and argv stacks once per
95         file, instead of once per macro.
97 2006-10-24  Eric Blake  <ebb9@byu.net>
99         * src/m4.h (includes): Add gettext.h, for N_.  Assume setlocale.
101 2006-10-23  Eric Blake  <ebb9@byu.net>
103         * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
104         from branch regarding stripped leading whitespace.
106         * modules/m4.c (includes): Use safe headers even when configured
107         with --enable-assert.
108         (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
109         #defined as mkstemp_safer.
111 2006-10-21  Eric Blake  <ebb9@byu.net>
113         * modules/m4.c (m4_make_temp): Change signature.
114         (maketemp, mkstemp): Update callers.
115         * modules/m4.h (m4_make_temp_func): New export.
116         * modules/gnu.c (mkdtemp): New macro.
117         * doc/m4.texinfo (Operation modes): Document interaction with
118         --safer.
119         (Mkdtemp): New node.
120         * tests/builtins.at (mkdtemp): New test.
121         (mkstemp): Check for umask effect.
122         * NEWS: Document new builtin.
124         * tests/generate.awk (normalize): Update recognition of trailing
125         spaces in tests.
126         * doc/m4.texinfo: Minor formatting fixes from branch.
127         (Foreach, Improved foreach): Merge from branch.
128         * examples/foreach.m4: Merge from branch.
129         * examples/foreachq.m4: New file from branch.
130         * examples/foreach2.m4: Likewise.
131         * examples/foreachq2.m4: Likewise.
133         * doc/m4.texinfo (titlepage): Add myself as author.
134         * src/main.c (AUTHORS): Likewise.
136 2006-10-19  Eric Blake  <ebb9@byu.net>
138         * modules/m4.c (m4_make_temp, mkstemp): New functions.
139         (maketemp): Add POSIX behavior and a warning.
140         * tests/others.at (maketemp): Move this test...
141         * tests/builtins.at (mkstemp): ...to here, and beef up.
142         * tests/options.at (--safer): Update to new warning message.
143         * doc/m4.texinfo (Mkstemp): Sync from branch.
144         (Extensions): Update maketemp behavior.
145         * NEWS: Document that maketemp now always warns.
147         * tests/generate.awk: For ease of doc-writing, simplify selection
148         of '-Ipath/to/examples' to '@comment examples'.
149         * examples/forloop.m4: Simplify.
150         * examples/forloop2.m4: New file.
151         * examples/quote.m4: New file.
152         * doc/m4.texinfo (Improved forloop): New node.
153         (Manual): Clarify use of examples directory.
154         (Shift, Forloop): Resync from branch.
155         (Include, Location): Update to new usage of examples directory.
157         * m4/system_.h (includes): Pick up <unistd.h> before checking for
158         _POSIX_VERSION.
159         (gettext_noop): Don't define here, let gettext.h do it instead.
160         * po/POTFILES.in: Update entries to reflect gnulib imports.
162 2006-10-16  Eric Blake  <ebb9@byu.net>
164         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
165         configmake'.
166         * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
167         pkglibexecdir support.
168         * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
169         worry about pathconf.h, now that gnulib does it for us.
170         (pkgmodincludedir): Simplify.
171         (pkglibexecdir): Delete, now that automake does this.
172         * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
173         * src/main.c (usage): Likewise.
174         * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
176         * doc/m4.texinfo: Port some changes from the branch.
177         (Invoking m4): Promote to a chapter, instead of a section of
178         Preliminaries.
179         (Operation modes, Dynamic loading features, Preprocessor features)
180         (Limits control Frozen state, Debugging options)
181         (Command line files): Subdivide into new sections.
182         (Cleardivert): Rename from cleardiv.
184 2006-10-14  Eric Blake  <ebb9@byu.net>
186         * tests/others.at (stdin closed): Update to match previous patch.
188         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
189         is not portable.
190         Reported by Ralf Wildenhues.
192         * modules/m4.c (undivert): Merge from branch.
193         * doc/m4.texinfo (Improved fatal_error): Fix typo.
194         (Improved exch): New node, copied from branch.
195         (Improved cleardivert): Update from branch.
196         * THANKS: Update.
198 2006-10-13  Eric Blake  <ebb9@byu.net>
200         * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
201         not config-h.in.
202         * modules/gnu.c (builtin, indir): Transparently handle builtin
203         tokens from defn.
204         * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
205         * m4/input.c (m4_pop_wrapup): Display debug message when switching
206         to wrapped text.
207         (m4_input_init): No need to use empty file any more.
208         (file_print): Display correct file name.
209         * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
210         dereference a NULL file name.
211         * m4/m4module.h (m4_pop_wrapup): New parameter.
212         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
213         prototypes.
214         * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
215         * m4/symtab.c (m4_symbol_value_groks_macro): New method.
216         * src/main.c (main): Adjust caller.
217         * tests/options.at (--debugmode): Test more output from -dV.
219 2006-10-12  Eric Blake  <ebb9@byu.net>
221         * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
223         * m4/m4private.h (m4__next_token_is_open): New prototype.
224         * m4/m4module.h (m4_push_single): Delete; push_string is an
225         adequate interface, and removing support for this simplifies the
226         input engine.
227         (m4_push_wrapup): New parameter.
228         (m4_is_syntax): Delete; m4_has_syntax is sufficient.
229         (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
230         start-quote and start-comment exclusive from other syntax
231         categories.
232         * m4/syntax.c: Likewise.
233         * m4/input.c (input_funcs): Make polymorphic without requiring
234         clients to know whether they are located at isp.  All users
235         changed.
236         (file_names): New variable.
237         (m4_input_init): Initialize it.
238         (m4_push_file): Use it.
239         (m4_input_exit): Free it after use.
240         (m4__next_token): Simplify slightly.
241         (m4__peek_token): Rename and simplify...
242         (m4__next_token_is_open): ... to this.  In particular, this
243         allows us to avoid a double ungetc, which POSIX doesn't
244         guarantee.
245         (struct m4_input_block, m4_push_single, single_peek, single_read):
246         Remove support for single characters, as the input engine now
247         guarantees we don't need it.
248         (file_unget, string_unget, m4_input_print, unget_input):
249         Strengthen assertions.
250         (file_init_funcs, file_read_init): New for file reading.
251         (string_init_funcs, string_read_init): New for wrapped text.
252         (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
253         Support wrapped text with locations.
254         (m4_skip_line): Support dnl across include file boundary.
255         (peek_char): Don't pop input when peeking.
256         (file_peek): Peek can be called at the end of the file.
257         (string_read): Don't read beyond string bounds.
258         * m4/macro.c (expand_token, collect_arguments): Update callers.
259         (expand_macro): Report errors at location of open parenthesis.
260         (expand_token, expand_argument, process_macro): Avoid negative
261         array dereferences with m4_has_syntax.
262         * m4/utility.c (skip_space): Likewise.
263         * modules/m4.c (m4wrap): Update caller.
264         * tests/builtins.at (__file__, __line__, dnl): New tests.
265         * tests/options.at (--debugmode): Normalize the output.
266         * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
267         Remerge recent changes from branch.
268         (Improved fatal_error): New node from branch.
270 2006-10-11  Eric Blake  <ebb9@byu.net>
272         * src/main.c (usage, long_options): Add --debugmode as an alias
273         for --debug, to match macro name.
274         * tests/options.at (--debugmode): Rename from --debug, and test
275         for new alias.
276         (--discard-comments): Augment test.
277         * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
278         * NEWS: Likewise.
280 2006-10-10  Eric Blake  <ebb9@byu.net>
282         Trace improvements: debugmode(c) was always printing the last two
283         lines paired, combine them; and show non-text expansions.
284         * m4/macro.c (trace_prepre): Update to show what the macro will
285         expand to.
286         (trace_pre): No need to special-case on debugmode(c).
287         (trace_post): Likewise.  Also, show non-text expansions.
288         (expand_macro): Update caller.  Collecting arguments can change
289         debug mode, so cache values beforehand.
290         (trace_format): Remove support for unused %l%S%r, and fix support
291         for %z to match gcc's attribute((printf)).
292         (trace_header): Update caller.
293         * m4/input.c (struct m4_input_block): Rename from input_block.
294         (struct input_funcs): Add print_func member.
295         (file_print, builtin_unget, builtin_print, string_print)
296         (m4_input_print): New functions.
297         (m4_push_string_finish): Change return type.
298         (m4_push_file): Fix missing use of close parameter.
299         * m4/debug.c (m4_debug_decode): Don't clear pending traces.
300         * m4/m4module.h (m4_input_print): New prototype.
301         * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
302         to match behavior change.
303         * tests/options.at (--debug): Likewise.
304         * tests/macros.at (Propagation of traceon)
305         (Propagation of --trace): Likewise.
306         * tests/others.at (stderr closed, stdout closed, stdin closed):
307         Likewise.
308         * doc/m4.texinfo (Forloop): Simplify.
309         (Trace): Update to changed behavior.
310         (Debugmode): Document this change.
311         * src/main.c (usage): Likewise.
312         * NEWS: Likewise.
314 2006-10-09  Eric Blake  <ebb9@byu.net>
316         * m4/path.c (m4_include_env_init): Don't alter result of getenv.
317         Reported by Ralf Wildenhues.
319         * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
321 2006-10-07  Eric Blake  <ebb9@byu.net>
323         * m4/m4module.h (m4_set_exit_failure): New prototype.
324         * m4/utility.c (m4_set_exit_failure): New function.
325         * modules/m4.c (m4exit): Use it to avoid yet another global
326         variable export in libm4.
328 2006-10-06  Eric Blake  <ebb9@byu.net>
330         * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
331         up.
332         * tests/others.at (stdout closed): Fix final check.
334         Replace uses of tmpfile with clean-temp, since tmpfile is
335         incompatible with closeout.
336         * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
337         exit status of m4.
338         * tests/others.at (stderr closed): Likewise.
339         * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
340         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
341         clean-temp.
342         * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
343         (m4_tmpfile, cleanup_tmpfile): New functions.
344         (make_room_for, m4_insert_diversion): Use clean-temp module.
345         * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
346         tmpfile.
347         * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
349         * m4/utility.c (m4_numeric_arg): Merge from branch.
350         * modules/gnu.c (debuglen): New builtin.
351         * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
352         Rename --arglength to --debuglen.
353         * tests/options.at (--arglength): Rename to --debuglen.
354         (deprecated options): Augment test.
355         * doc/m4.texinfo (Invoking m4): Document the name change.
356         (Debugmode): Rename from Debug Levels.
357         (Debugfile): Rename from Debug Output.
358         (Debuglen): New node.
359         * NEWS: Document these changes.
361         * modules/m4.c (m4exit): Fix typo.  Ensure desired exit status in
362         case closing a module exits.
364         * modules/m4.c (m4exit): Merge from branch.
365         * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
367 2006-10-05  Eric Blake  <ebb9@byu.net>
369         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
370         closeout.
371         * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
372         * src/main.c (main): Close stdout on exit.
373         * m4/debug.c (set_debug_file): Check for write failure.
374         * m4/m4.c (m4_delete): Don't mask write failure.
375         * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
376         macros before calling AT_CHECK.
377         (M4_ONE_MEG_DEFN): New helper macro.
378         * tests/others.at (stdout full): New test.
379         (stderr closed, stdin closed, stdout closed): Augment.
380         * tests/builtins.at (syscmd): New test.
381         (esyscmd): Augment.
383 2006-10-04  Eric Blake  <ebb9@byu.net>
385         * tests/builtins.at: Alphabetize tests.
386         * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
387         * tests/generate.awk (new_test): Fix underquoting.
388         * tests/others.at (maketemp): Rename from misc.
389         (stdin closed, stdout closed, stderr closed): New tests.
391 2006-10-03  Eric Blake  <ebb9@byu.net>
393         Avoid all global variables in modules, so that --disable-static
394         can work on cygwin.
395         * examples/incl.m4: New file, from branch.
396         * Makefile.am (dist_pkgdata_DATA): Distribute it.
397         * doc/m4.texinfo (Location): Merge this section from branch.
398         (Include): Update the test.
399         * tests/generate.awk (new_test): Allow for VPATH build
400         pre-processing of expected __program__ output.
401         * m4/m4module.h (m4_current_diversion, m4_output_current_line):
402         Avoid global variables.
403         (m4_context_field_table): Add current_diversion, output_line.
404         (m4_output_init, m4_make_diversion): Add parameter.
405         (m4_get_program_name, m4_set_program_name): New accessors.
406         * m4/m4private.h (m4_get_current_diversion),
407         (m4_set_current_diversion, m4_get_output_line)
408         (m4_set_output_line): New accessors.
409         * m4/utility.c (m4_get_program_name, m4_set_program_name): New
410         methods.
411         * modules/m4.c (divnum, divert): Adjust callers.
412         * modules/gnu.c (__program__): Likewise.
413         * m4/output.c (m4_output_init, m4_make_diversion)
414         (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
415         (m4_insert_diversion): Likewise.
416         * m4/input.c (file_clean, m4_push_file): Likewise.
417         * src/freeze.c (reload_frozen_state): Likewise.
418         * src/main.c (main, usage): Likewise.
420         Partially plug memory leak when unloading gnu module.
421         * tests/modules.at (unload gnu module): New test.
422         * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
423         (m4_regexp_compile): Move static storage to module visibility.
424         * tests/options.at (--debug): Adjust to new output.
426 2006-09-29  Eric Blake  <ebb9@byu.net>
428         Even when not the first option, --help can't have side effects.
429         * tests/options.at (--debugfile): Detect bugs in this area.
430         * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
431         stderr.
432         * src/main.c (main): Fix it by deferring debugfile change.  Also,
433         defer closing streams until after module tracing is done.
434         * modules/gnu.c (debugfile): Make message consistent with command
435         line.
436         * doc/m4.texinfo (Invoking m4): Touch up the documentation.
437         * NEWS: Document this fix.
439         * modules/m4.c (dnl): Include macro name in warning message.
440         * m4/input.c (m4_skip_line): Add parameter.
441         * m4/m4module.h (m4_skip_line): Likewise.
442         * src/main.c (usage): Update wording.
443         * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
444         issue of blind macros vs. POSIX is resolved.
445         (Dnl): Merge another node from branch.
447         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
448         xstrtol.
449         * m4/system_.h (N_): Define.
450         * src/main.c (main): Validate numeric arguments.
451         (size_opt): New function, idea borrowed from coreutils.
452         * m4/macro.c (expand_macro): -L0 implies no limit.
453         * doc/m4.texinfo (Invoking m4): Document this change.
454         * NEWS: Likewise.
455         * tests/options.at: (--arglength, --nesting-limit)
456         (--regexp-syntax): New tests of argument validation.
458 2006-09-28  Eric Blake  <ebb9@byu.net>
460         * tests/options.at: Alphabetize the tests.
462 2006-09-27  Eric Blake  <ebb9@byu.net>
464         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
465         another parameter to print module info.
466         * m4/macro.c (trace_pre): Adjust caller.
467         * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
468         * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
469         * NEWS: Document this.
471         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
472         strnlen.
473         * m4/symtab.c (symbol_value_print): Rename to...
474         (m4_symbol_value_print): ...this, and...
475         (m4_symbol_print): Update to allow -L length truncation.  Now
476         truncation also affects dumpdef output and builtin names.
477         * m4/m4private.h (nesting_limit, max_debug_argument_length):
478         Switch to size_t.
479         * m4/m4module.h (m4_symbol_print): Add parameter.
480         (m4_symbol_value_print): New function.
481         * modules/m4.c (dumpdef): Allow length truncation.
482         * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
483         repeating code.
484         * doc/m4.texinfo (Invoking m4): Document -l better.
485         (Dumpdef, Debug Levels): Document the effect of -l.
486         * NEWS: Document this change.
488         * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
489         (m4_expand_ranges): Ensure we aren't picking up partial object on
490         obstack.
491         * modules/stdlib.c (setenv): Allow extra arguments.
492         * modules/time.c (ctime): Avoid side effect in call to
493         obstack_grow.
494         * modules/gnu.c (m4_regexp_substitute): Likewise.
495         (renamesyms): Avoid extra obstack_init.
496         * src/freeze.c (reload_frozen_state): Remove debug comment.
497         (produce_frozen_state): Simplify fprintf to puts where possible.
498         * modules/modtest.c (modtest_init, modtest_finish): Likewise.
499         * modules/import.c (import, symbol_fail, modules_fail): Likewise.
500         * m4/macro.c (trace_flush): Likewise.
501         * m4/debug.c (m4_debug_message_prefix): Likewise.
502         * m4/path.c (include_dump): Likewise.
503         * m4/module.c (module_remove): Likewise.
504         (install_builtin_table): Simplify malloc and string
505         concatenation.
507 2006-09-26  Eric Blake  <ebb9@byu.net>
509         * m4/m4module.h (m4_symbol_print): New prototype.
510         (M4_DEBUG_TRACE_STACK): New enumerator.
511         (m4_is_debug_bit): Allow use without requiring m4private.h.
512         * m4/symtab.c (symbol_value_print, m4_symbol_print): New
513         functions.
514         * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
515         callback.
516         (dumpdef): Allow printing pushdef'd stacks.
517         * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
518         * src/main.c (usage): Document it.
519         * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
520         * NEWS: Likewise.
522         * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
523         gnulib headers.
524         * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
525         of lines during make.
526         (AM_CPPFLAGS): Remove unneeded include path.
527         (src_m4_CPPFLAGS): Remove redundant include path.
528         * m4/system_.h Make preprocessor indentation consistent.
529         (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
530         macros.
531         (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
532         branch.
533         (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
534         (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
535         (bool, true, false): Don't undefine here; stdbool takes care of
536         that.
537         * src/m4.h (includes): Assume config.h, and several standard
538         headers.
539         (__CYGWIN__, WIN32): Don't define here; let system.h do it.
540         * m4/m4private.h: Assume config.h.
541         * m4/output.c: Likewise.
542         * m4/path.c: Likewise.
543         * m4/resyntax.c: Likewise.
544         * m4/utility.c: Likewise.
545         * modules/gnu.c: Likewise.
546         * modules/import.c: Likewise.
547         * modules/load.c: Likewise.
548         * modules/m4.c: Likewise.
549         * modules/modtest.c: Likewise.
550         * modules/mpeval.c: Likewise.
551         * modules/perl.c: Likewise.
552         * modules/shadow.c: Likewise.
553         * modules/stdlib.c: Likewise.
554         * modules/time.c: Likewise.
555         * modules/traditional.c: Likewise.
557 2006-09-21  Eric Blake  <ebb9@byu.net>
559         * doc/m4.texinfo (Invoking m4): Add clarification on option
560         processing behavior.
561         * tests/options.at (option grouping): Test this.
562         * THANKS: Update.
563         Reported by Mikhail Teterin.
565         * bootstrap: Add --force option, based on idea from coreutils.
566         * README: Document that ./bootstrap and autoreconf are for
567         developers, and not lightly done in tarballs.
569 2006-09-20  Eric Blake  <ebb9@byu.net>
571         * src/main.c (usage, OPTSTRING, main): Rename -e to -i.  Make
572         warnings consistent.
573         (long_options, HASHSIZE_OPTION): Warn on -H.
574         * doc/m4.texinfo (Invoking m4): Document this.
575         * tests/options.at (deprecated options): Update.
577         Change the default of interactive sessions to match sh.
578         * src/main.c (usage): Document this.
579         (enum interactive_choice): New enum.
580         (main): Use it to defer decision of interactive until after
581         argument processing.
582         * doc/m4.texinfo (Invoking m4): Document this.
583         * NEWS: Likewise, plus add missing mention of -b.
584         Reported by Stepan Kasal.
586 2006-09-19  Eric Blake  <ebb9@byu.net>
588         * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
589         well as --error-output; the goal is to add -o/--output in some
590         future version with semantics like gcc or autom4te.
591         * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
592         (Extensions): Reflect this update.
593         (Renamesyms): Add another test.
594         (Defn): Xfail for now, so that `make check' is happy.
595         * NEWS: Document this change.
596         * tests/generate.awk: Mark dynamic loading tests as such.  Allow
597         xfailing tests.
598         * tests/macros.at (Renamesyms collisions): New test, exposing
599         renamesyms' coredump.
600         * tests/options.at (--debugfile, --safer): Update to match
601         change.
603         * m4/debug.c (set_debug_file): Fix regression in -o when stdout
604         and stderr are same file, introduced 2003-07-23.
605         * tests/options.at (--debugfile): New test, to catch the bug.
606         (deprecated options): Test --error-output.
607         * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
608         Deprecate --error-output, and replace it with --debugfile.
609         * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
610         Document this change.
611         * NEWS: Likewise.
613 2006-09-18  Eric Blake  <ebb9@byu.net>
615         * modules/load.c (modules): Rename to...
616         (m4modules): ...this, since it is an English word with 0
617         arguments.
618         * modules/gnu.c (symbols, m4symbols): Likewise.
619         * doc/m4.texinfo (Listing Modules): Rename to...
620         (M4modules): ...this.
621         (Symbols): Rename to...
622         (M4symbols): ...this.
623         (Load, Foreach, Trace, Answers): Update to new spellings.
624         * NEWS: Document this.
626         * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
627         such that without arguments, the global trace flag is changed
628         rather than walking the table of all currently-defined macros.
629         (set_trace_CB): No longer needed.
630         * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
631         (m4_set_symbol_traced): Delete.
632         (m4_symtab_create): Nuke the nuke parameter.
633         * m4/m4private.h (m4_get_symbol_value): Delete.
634         * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
635         (m4_set_symbol_name_traced): Free undefined entries that are no
636         longer traced.
637         (symbol_destroy_CB): Update caller.
638         * m4/m4.c (m4_create): Update caller.
639         * src/main.c (main): Likewise.
640         (usage): Fix typo in last commit.
641         * doc/m4.texinfo: Minor cleanups throughout.
642         (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
643         more nodes from branch.
644         (Trace): Document new semantics, and how to simulate the old.
645         * tests/builtins.at (multiquotes): Adjust to new semantics.
646         * NEWS: Update somewhat.
648 2006-09-14  Eric Blake  <ebb9@byu.net>
650         Add --safer option, per debian bug 5898.
651         * src/main.c (usage): Document new option.
652         (SAFER_OPTION): New enumerator.
653         (main): Set the option bit.
654         * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
655         accessors.
656         * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
657         (m4_get_safer_opt): New accessor.
658         * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
659         * modules/m4.c (syscmd, maketemp): Likewise.
660         * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
661         (Sysval, Maketemp): Add tests of this.
662         * tests/options.at (--safer): Likewise.
664 2006-09-13  Eric Blake  <ebb9@byu.net>
666         * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
667         stderr filtering.
668         Reported by Ralf Wildenhues.
670         Fix installcheck.
671         * Makefile.am (check_LTLIBRARIES): Build test libraries in the
672         tests directory, so we can be sure an installed build is not
673         picking up uninstalled non-test libraries.
674         (check-local, installcheck-local): Depend on test libraries.
675         * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
676         after file name.  Fix quoting.  Remove skipping the test, now
677         that makefile guarantees test modules will exist.
678         (Freezing modules, modules: shadow, modules: unload)
679         (modules: trace): Always put test modules in module path.
680         (modules: importing): Likewise, and rely on AT_CHECK_M4 for
681         stderr munging.
682         * src/main.c (usage): Document default module search path.
683         (import_environment, frozen_file_to_read, frozen_file_to_write):
684         Move...
685         (main): ...here.
686         * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
687         * tests/m4.in: ...not here.
688         Reported by Ralf Wildenhues.
690 2006-09-08  Eric Blake  <ebb9@byu.net>
692         * bootstrap: Kill unrelated copy-n-paste code from argument
693         parsing.  Let Makefile generate testsuite.
694         * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
696 2006-09-07  Eric Blake  <ebb9@byu.net>
698         * m4/m4module.h (m4_peek_input): No longer export.
699         (m4_error_at_line, m4_warn_at_line): New prototypes.
700         (m4_is_symbol_void): New macro.
701         (m4_push_file): Update prototype.
702         * m4/m4private.h (m4__peek_token): New prototype.
703         (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
704         * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
705         * src/main.c (main): Allow reading from stdin twice.
706         * modules/m4.c (include): Adjust to new prototype.
707         * m4/input.c: General comment cleanup.
708         (file_peek, file_read, file_unget, push_file): Set end flag on
709         EOF, so that we don't call getc twice.
710         (push_file, file_clean): Port fix from branch to avoid closing
711         stdin prematurely.
712         (pop_input): Port fix from branch to avoid reading free'd memory
713         when input ends mid-string.
714         (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
715         (string_peek, string_read): Always use unsigned char.
716         (m4_skip_line): Warn when dnl cut short by EOF.
717         (peek_input): Rename from m4_peek_input.
718         (match_input): Update signature, to distinguish between `(' token
719         and multi-char quote or comment beginning with `('.
720         (m4_input_exit): Cleanup now done in m4_pop_wrapup.
721         (m4__peek_token): New function, ported from branch.
722         (m4__next_token): Update to new token types.
723         * m4/macro.c (expand_token, expand_argument): Use peek_token.
724         * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
725         (Invoking m4): Remerge from branch.
727         * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
728         (check-local): and put dependency here.
729         Reported by Ralf Wildenhues.
731 2006-09-05  Eric Blake  <ebb9@byu.net>
733         * m4/m4module.h (m4_debug_message): New prototype.
734         (M4_DEBUG_TRACE_MODULE): New debug bit.
735         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
736         (M4_DEBUG_MESSAGE2): Delete these macros.
737         * m4/debug.c (m4_debug_message): New method.
738         (m4_debug_decode): Add module tracing as flag `m'.
739         * m4/input.c (m4_push_file, file_clean): Use new method.
740         * m4/path.c (m4_path_search): Likewise.
741         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
742         * m4/module.c (install_builtin_table, install_macro_table)
743         (m4__module_open, module_close, module_remove): Promote several
744         module debug messages outside of DEBUG_MODULES.
745         (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
746         DEBUG_MODULES with normal trace output.
747         * src/main.c (usage): Document new flag.
748         * doc/m4.texinfo (Debug Levels): Likewise.
749         * Makefile.am ($(TESTSUITE)): Add missing dependency.
750         * tests/m4.in: Neutralize platform-dependent module filenames.
751         * tests/options.at (--debug): Update expected output.
753 2006-09-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
755         * doc/m4.texinfo: Fix some typos.
756         * tests/others.at: Likewise.
758 2006-09-05  Eric Blake  <ebb9@byu.net>
760         * m4/input.c (lex_debug): Remove dead code that broke compilation
761         with --enable-debug.
762         * m4/module.c (install_builtin_table, install_macro_table)
763         (m4__module_init, m4__module_open, module_close)
764         (module_remove): Fix compilation when --enable-debug.
765         * m4/output.c (m4_shipout_text): Likewise.
766         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
767         libraries when --enable-debug.
768         * configure.ac (DYNAMIC_MODULES): New variable, to pass
769         information to testsuite.
770         (modules to preload): Determine modules after we know whether
771         shared libraries are supported.
772         * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
773         testsuite.
774         * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
775         * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
776         (modules: shadow, modules: unload, modules: importing)
777         (modules: trace): Use new macro.
778         * tests/builtins.at (gmp): Likewise.
780         * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
781         All users updated.
782         (expand_token): Avoid assertion just added to docs.
783         (expand_macro): Track pending expansions, for when a symbol's
784         definition changes during argument collection.
785         (m4_macro_call, process_macro): Operate on symbol value, not
786         symbol, since symbol may have changed during argument collection.
787         * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
788         (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
789         (m4_get_symbol_value): Add fast macro version.
790         * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
791         (m4_macro_call): Adjust prototype.
792         * m4/module.c (install_builtin_table): Check that flags are valid
793         when creating builtin.
794         * m4/symtab.c (m4__symtab_remove_module_references): Use
795         m4_symbol_value_delete, rather than inlining it.
796         (m4_symbol_value_copy): Copy placeholder text.
797         (symbol_popval): Use m4_symbol_value_delete.
798         (m4_symbol_value_delete): Implementation was missing when NDEBUG.
799         Handle pending expansions.
800         * modules/gnu.c (indir): Update to new prototype.
801         * doc/m4.texinfo: Fix menus to be consistent with section names.
802         (Defn): Add test that macro tokens flatten to empty string;
803         triggered an assert before this patch.
804         (Ifelse): Merge another node.
805         (Loops): Split into...
806         (Forloop, Foreach): New nodes; work is still underway on them.
807         (Answers): Add more info on foreach macro; work is still underway.
808         (Indir): Add test that indir collects arguments before looking up
809         macro.
810         * TODO: Update based on this patch.
812 2006-09-01  Eric Blake  <ebb9@byu.net>
814         * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
815         * m4/hash.h (m4_free_hash_iterator): New prototype.
816         * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
817         ensure we don't do unsafe things while iterating.
818         (HASH_ITER, ITER_CHAIN): New accessor macros.
819         (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
820         (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
821         (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
822         (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
823         to catch unsafe actions.
824         (m4_free_hash_iterator): New function, to avoid memory leaks, and
825         when debugging, to track safe actions.
826         (m4_hash_apply): Avoid memory leak.
827         * m4/symtab.c (m4_symtab_apply): Likewise.
828         * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
829         in manually to src/ for now.
830         * tests/builtins.at (gmp): Add keyword module.
831         * tests/modules.at (Freezing modules, modules: shadow)
832         (modules: unload, modules: importing, modules: trace): Likewise.
834 2006-08-30  Eric Blake  <ebb9@byu.net>
836         * m4/utility.c (m4_warn): Factor "Warning" out of messages into
837         here.
838         (m4_bad_argc, m4_numeric_arg): Update all callers.
839         * m4/macro.c (m4_macro_call): Likewise.
840         * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
841         (Indir, Builtin, Ifdef): More doc merges.
842         (Loops): Mention that documenting foreach would be nice.
843         (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
844         (Include, Eval, Location, M4exit): s/input.m4/stdin/.
845         * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
846         (substitute, syncoutput): Update all m4_warn callers.
847         * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
848         (traceon, traceoff): Make warning message consistent.
849         (define, pushdef): Update all m4_warn callers.
850         * tests/generate.awk: Choose file name so that documentation can
851         show command-line behavior.
852         * tests/builtins.at (define): Update to new wording.
853         * tests/macros.at (pushdef/popdef): Likewise.
854         * tests/freeze.at (loading format 1): Likewise.
855         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
857         * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
858         the branch.
859         (Defn): Add failing test case for mixing text and builtin.
860         (Renamesyms): Improve wording, and identify core dump that needs
861         fixing.
863 2006-08-29  Eric Blake  <ebb9@byu.net>
865         * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
866         (Arguments, Pseudo Arguments): More doc merges from the branch.
867         (Macro expansion): Turn example into test.
868         (Pseudo Arguments): Add example of avoiding argument.
869         * modules/m4.c (undefine, popdef): Accept multiple arguments.
870         (define, pushdef): Warn on non-text macro name.
871         (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
872         warning/error messages.
873         (ifdef): Ignore extra arguments.
874         * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
875         (m4__symtab_remove_module_references): Check that there is no leak.
876         * tests/macros.at (pushdef/popdef): Update to new message.
877         * tests/builtins.at (define): Likewise.
878         * tests/freeze.at (loading format 1): Likewise.
879         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
881         * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
882         (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
883         as accessor function, to avoid compiler warning.
884         * m4/module.c (m4__module_open): Move declaration of variable to
885         avoid compiler warning.
886         * src/main.c (main): Avoid shadowing a global variable.
887         * src/freeze.c (produce_symbol_dump): Avoid unused variable
888         warning when NDEBUG.
889         * tests/options.at (--discard-comments, --import-environment)
890         (--debug, --prepend-include, --help and --version): Rename tests
891         to name option tested.
893 2006-08-28  Eric Blake  <ebb9@byu.net>
895         * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
896         * m4/module.c (install_builtin_table): ...to here, and add
897         assertion that blind macros require arguments.
898         * m4/m4module.h (struct m4_builtin): Document restrictions that
899         must be met during module loading.
900         * modules/gnu.c (changeresyntax, changesyntax): These are blind,
901         so require an argument to avoid triggering assertion.
902         (debugfile): Tweak error message.
904 2006-08-25  Eric Blake  <ebb9@byu.net>
906         * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
907         (M4_BUILTIN_SIDE_EFFECT): New enumerators.
908         (struct m4_builtin): New member flags replaces groks_macro_args,
909         blind_if_no_args.  min_args and max_args are now 0-based.
910         Rearrange members to reduce size on platforms where function
911         pointers are 64 bits but regular pointers are 32.
912         (m4_bad_argc): Add argument.
913         * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
914         * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
915         effect into account.
916         * m4/module.c (install_builtin_table): Adjust all users affected
917         by this API change.
918         * m4/macro.c (m4_macro_call): Likewise.
919         * src/freeze.c (reload_frozen_state): Likewise.
920         * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
921         * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
922         * modules/import.c (builtin_functions): Likewise.
923         * modules/load.c (builtin_functions): Likewise.
924         * modules/modtest.c (builtin_functions): Likewise.
925         * modules/mpeval.c (builtin_functions): Likewise.
926         * modules/perl.c (builtin_functions): Likewise.
927         * modules/shadow.c (builtin_functions): Likewise.
928         * modules/stdlib.c (builtin_functions): Likewise.
929         * modules/time.c (builtin_functions, mktime_functions)
930         (strftime_functions): Likewise.
931         * doc/m4.texinfo (Loops): Update test now that shift is blind.
932         (Macro Arguments): Fix typo in test.
933         (Patsubst): Fix typo in test.
934         * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
935         end of string.  Fix return value when ignore_duplicates.
936         * tests/builtins.at (patsubst): Fix typo in test.
938         * tests/options.at (debug-flags): Update to reflect new message.
939         (deprecated options, prepend-include, help and version): New
940         tests.
941         * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
942         test omits an input file name.
943         * src/main.c (long_options, main): Add -B/--prepend-include.
944         (usage): Document it.
945         (main): `m4 --help --version' now displays help, not version.
946         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
947         dirname filenamecat.
948         * m4/m4module.h (m4_add_include_directory): Add parameter.
949         * m4/m4private.h (m4__include_init): New prototype.
950         * m4/m4.c (m4_create): Put `.' on path before options are
951         collected.
952         * m4/path.c (includes): Assume C89.  Use gnulib for file name
953         management.
954         (m4__include_init): New function.
955         (search_path_add): Allow prepending.
956         (m4_add_include_directory, search_path_env_init): Adjust callers.
957         (m4_path_search): Relative names now invoke path search, since
958         `.' might not be first.
959         * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
961 2006-08-25  Bruno Haible  <bruno@clisp.org>  (tiny change)
962         and Eric Blake  <ebb9@byu.net>
964         * bootstrap: Run autopoint before gnulib-tool, since autopoint
965         0.15 installs macros obsoleted by current gnulib.
967 2006-08-25  Eric Blake  <ebb9@byu.net>
969         * doc/m4.texinfo (Macro Arguments): Another section merged;
970         testsuite failures now exposed.
972 2006-08-23  Eric Blake  <ebb9@byu.net>
974         * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
975         (Input processing): More doc merges from the branch.
976         (Regular expression syntax): Add introductory text.
977         (Inhibiting Invocation): More doc merges from the branch.
978         (Other tokens): Reorder after comments.
979         * tests/generate.awk: Allow passing options to doc examples.
981 2006-08-22  Eric Blake  <ebb9@byu.net>
983         * tests/options.at (debug-flags): New test.
984         * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
985         not negative, to distinguish failure in m4_debug_decode.
986         (m4_debug_decode): Add new parameter.
987         * modules/gnu.c (regexp): Slight cleanup.
988         (renamesyms): Ignore excess arguments.
989         (syncoutput): Make case-insensitive, warn on bad argument.
990         (debugmode): Factor -+ handling out to...
991         * m4/debug.c (m4_debug_decode): ...here.
992         (m4_debug_message_prefix): Fix spacing.
993         * src/main.c (main): Let -d option adjust flags.
994         * m4/input.c (file_clean): Avoid printing empty file name.
995         * doc/m4.texinfo (Syncoutput): Document new range of input.
996         (Invoking m4): Document use of multiple -d flags.
998         Start porting various fixes from the branch that use gnulib.
999         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1000         binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
1001         regexprops-generic stdlib-safer unlocked-io.
1002         * m4/debug.c (m4_debug_set_output): Close debug file on exec.
1003         * m4/path.c (m4_path_search): Close input file on exec, reject
1004         empty file name, fix parameter naming.
1005         * m4/output.c (make_room_for): Close diversion file on exec.
1006         (includes): Assume C89 headers.
1007         (tmpfile): For now, we don't want tmpfile-safer, because we want
1008         clean-temp later.
1009         * m4/m4private.h (includes): Use various gnulib headers.
1010         * doc/regexprops-generic.texi: Use gnulib's copy.
1012         * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
1013         * AUTHORS: Add copyright.
1014         * ChangeLog: Likewise.
1015         * README: Likewise.  Require automake 1.9b or later.
1016         * HACKING: New file.
1017         * README-alpha: Add copyright.
1018         * THANKS: Likewise.  Update.
1019         * doc/STYLE: Add copyright, and tweak for changed directories.
1020         * modules/README: Add copyright, and tweak for libtool version.
1021         * examples/COPYING: New file.
1022         * examples/WWW/COPYING: Likewise.
1023         * examples/WWW/m4lib/COPYING: Likewise.
1024         * modules/shadow.m4: Add copyright.
1025         * modules/perl.m4: Likewise.
1026         * modules/modtest.m4: Likewise.
1027         * modules/stdlib.m4: Likewise.
1028         * modules/time.m4: Likewise.
1029         * modules/time2.m4: Likewise.
1030         * po/Makevars: Likewise.
1031         * tests/iso8859.m4: Likewise.
1032         * tests/m4.in: Likewise.
1033         * NEWS: Add (C) to copyright.
1034         * TODO: Likewise.
1035         * m4/system_.h: Likewise.
1036         * tests/atlocal.in: Likewise.
1037         * tests/builtins.at: Likewise.
1038         * tests/freeze.at: Likewise.
1039         * tests/generate.awk: Likewise.
1040         * tests/macros.at: Likewise.
1041         * tests/modules.at: Likewise.
1042         * tests/options.at: Likewise.
1043         * tests/others.at: Likewise.
1044         * tests/testsuite.at: Likewise.
1045         * m4/utility.c: Spell out copyright years.
1046         * src/main.c: Likewise.
1048         * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
1050 2006-08-21  Eric Blake  <ebb9@byu.net>
1052         * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
1053         * modules/gnu.c (esyscmd): Use -1 for failure.  Set sysval to 0
1054         when no arguments are given, but without losing warning about 0
1055         arguments.
1056         * modules/m4.c (syscmd): Likewise.
1057         (includes): Assume C89.
1058         (m4_sysval): Make static.
1059         (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
1060         (sysval): Port calculation from branch.
1062 2006-08-20  Eric Blake  <ebb9@byu.net>
1064         * m4/macro.c (expand_macro): Move argument check...
1065         (m4_macro_call): ...to here, so indir will warn.
1066         * modules/gnu.c (__program__): New macro, ported from branch.
1067         (builtin): Perform argument check.
1068         (changesyntax): Avoid out-of-bounds read.
1070         * modules/gnu.c (includes): Assume stdlib.h, errno.
1071         (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
1072         (substitute): Add caller parameter, avoid out-of-bounds memory
1073         references.
1074         (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
1075         callers.
1077 2006-08-16  Eric Blake  <ebb9@byu.net>
1079         * po/POTFILES.in: Add more files that contain translatable
1080         strings.
1081         * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
1082         information to translators.
1083         (USE_MSGCTXT): New var for gettext 0.15.
1084         * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
1085         debug/trace messages in lower case.
1086         * m4/macro.c (expand_argument): Likewise.
1087         * m4/path.c (m4_path_search): Likewise.
1088         * src/main.c (main): Likewise.
1090 2006-08-14  Eric Blake  <ebb9@byu.net>
1092         * src/main.c (usage): Document --import-environment.
1093         * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
1095 2006-08-11  Eric Blake  <ebb9@byu.net>
1097         * bootstrap (func_get_translations): Only remove files when doing
1098         full update.
1099         (func_update_po): Avoid CDPATH problems.
1101 2006-08-10  Eric Blake  <ebb9@byu.net>
1103         * bootstrap (func_get_translations): New function.
1104         (func_update_po): Borrow ideas from tar to correctly pull in
1105         translations from newer location.
1107 2006-08-09  Eric Blake  <ebb9@byu.net>
1109         * bootstrap: Recent gnulib no longer has jm_* macros to worry
1110         about.
1111         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
1112         verror.
1113         * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
1114         (m4_error, m4_warn): ... these new prototypes.
1115         (m4_current_file, m4_current_line): Move into context, rather
1116         than leaving as globals.
1117         (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
1118         (m4_undivert_all, m4_input_init): Now takes context.
1119         * m4/utility.c (m4_error, m4_warn): New functions.
1120         * m4/m4private.h: Assume errno exists.
1121         (struct m4): Move warning_status to a bit flag,
1122         and add exit_status.  Adjust accessors accordingly.
1123         * src/main.c (print_program_name_CB): No longer needed.
1124         (main): Use new m4_get_fatal_warnings_opt.
1125         * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
1126         instead of issuing "INTERNAL ERROR".  Pass context when needed,
1127         and use new accessors.
1128         * m4/input.c: Likewise.
1129         * m4/macro.c: Likewise.
1130         * m4/output.c: Likewise.
1131         * m4/utility.c: Likewise.
1132         * modules/evalparse.c: Likewise.
1133         * modules/gnu.c: Likewise.
1134         * modules/load.c: Likewise.
1135         * modules/m4.c: Likewise.
1136         * modules/mpeval.c: Likewise.
1137         * src/freeze.c: Likewise.
1138         * src/main.c: Likewise.
1139         * tests/macros.at: Adjust to new message format.
1140         * tests/builtins.at: Likewise.
1141         * tests/freeze.at: Likewise.
1142         * tests/modules.at: Likewise.
1143         * doc/m4.texinfo: Likewise.
1145         * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
1146         newer gettext 0.15.
1148 2006-08-03  Eric Blake  <ebb9@byu.net>
1150         * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
1151         gracefully handle ENOSYS.
1152         * TODO: Update.
1153         * THANKS: Update.
1155 2006-07-28  Eric Blake  <ebb9@byu.net>
1157         * src/freeze.c (reload_frozen_state): Copy string when creating
1158         placeholder, to avoid memory corruption.
1159         * m4/symtab.c (symbol_popval): Avoid memory leak.
1160         (m4_symbol_rename): Avoid shadowing rename function.
1161         (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
1162         * tests/freeze.at (reloading unknown builtin): Add test.
1163         * tests/generate.awk: Capture m4.texinfo line number in
1164         testsuite.log, not just generated.at.
1166         Port idea from branch that a frozen file can request an unknown
1167         builtin without producing a warning unless the builtin is
1168         actually used.
1169         * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
1170         (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
1171         (m4_set_symbol_value_placeholder): New accessors.
1172         * m4/m4module.h (m4_is_symbol_placeholder),
1173         (m4_get_symbol_value_placeholder),
1174         (m4_set_symbol_value_placeholder),
1175         (m4_get_symbol_placeholder): Likewise.
1176         * m4/symtab.c (m4_is_symbol_value_placeholder),
1177         (m4_get_symbol_value_placeholder),
1178         (m4_set_symbol_value_placeholder): Likewise.
1179         (dump_symbol_CB): Handle new symbol type.
1180         * m4/macro.c (trace_pre): Likewise.
1181         (m4_macro_call): Warn when invoking a placeholder.
1182         * modules/m4.c (dumpdef): Handle dumping a placeholder.
1183         (defn): Warn when referencing a placeholder.
1184         * src/freeze.c (dump_symbol_CB): Ignore placeholder when
1185         freezing.
1186         (reload_frozen_state): When reloading unknown builtin, install a
1187         placeholder instead of warning.
1188         * tests/freeze.at (loading format 1): Allow warning when
1189         popdef'ing undefined function.
1191 2006-07-27  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
1193         * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
1194         function. Shift by 7, not 3, for consistency with
1195         gnulib/lib/hash.c. Don't assume hash word is 32 bits.
1197 2006-07-27  Eric Blake  <ebb9@byu.net>
1199         * src/main.c (usage): Update to match branch.
1200         (main): Update --version info to distinguish between program name
1201         `m4' and package name `GNU M4'.
1202         (AUTHORS): Translate René Seindal's name.
1203         * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
1204         * Makefile.am (doc/m4.1): Update to match branch.
1205         * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
1206         branch.
1208         * m4/system_.h (EXIT_MISMATCH): Define.
1209         * src/main.c (main): Don't clear syntax table for version 1.
1210         (usage): Document exit status.
1211         * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
1212         branch, and require V directive to appear first in file.  Fix
1213         broken logic for detecting F and T in version 1 files.
1215 2006-07-22  Eric Blake  <ebb9@byu.net>
1217         * src/main.c (stackovf_handler): Document the problems in our
1218         overflow handler.
1219         * src/stackovf.c: Forward port changes in branch to use POSIX
1220         sa_sigaction when available.
1221         (process_sigsegv): Avoid buffer overrun when error string is
1222         translated, although the fact that we translate in a signal
1223         handler is still a bug.
1224         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
1225         from branch to modernize checks.
1227         * modules/format.c (format): Avoid compiler warning that str may
1228         be used uninitialized.
1230         * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
1231         spelling.
1232         (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
1233         (DEBUG_MACRO): Remove unused macro.
1234         * src/stackovf.c: Avoid compiler warnings.
1235         * m4/input.c: Likewise.
1236         * m4/module.c: Likewise.
1237         * m4/output.c: Likewise.
1238         * m4/path.c: Likewise.
1239         * m4/symtab.c: Likewise.
1240         * m4/syntax.c: Likewise.
1242 2006-07-20  Eric Blake  <ebb9@byu.net>
1244         * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
1245         Regenerate to explicitly ask for --assume-autoconf=2.60.
1247 2006-07-19  Eric Blake  <ebb9@byu.net>
1249         * po/ChangeLog: Merge into main ChangeLog, then delete file.
1250         * THANKS: Update.
1252         * doc/m4.texinfo (copying): Relax restriction on front-cover and
1253         back-cover texts.
1255 2006-07-17  Eric Blake  <ebb9@byu.net>
1257         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
1258         0.14.5.
1260         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
1261         xvasprintf'.
1262         * modules/format.c (includes): Use xvasprintf.h.
1263         (format): Make static.  Avoid buffer overflow, that can lead to
1264         arbitrary code execution exploit.  Only pass unsigned char to
1265         is*().  Support F, g, and G specifiers.
1266         * doc/m4.texinfo (Format): Expose buffer overrun bug.  Document
1267         new specifiers.
1269 2006-07-17  Gary V. Vaughan  <gary@gnu.org>
1271         Ensure M4 compiles correctly with -DDEBUG, and use a single
1272         consistent definition of various /DEBUG_[A-Z]+/ symbols:
1274         * m4/input.c: Have commented out out DEBUG_INPUT only by default.
1275         (m4_print_token): Use m4_get_symbol_value_text and
1276         m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
1277         and VALUE_FUNC respectively.
1278         (m4__next_token): Use m4_print_token call instead of obsolescent
1279         print_token symbol.
1280         * m4/module.c: Have commented out out DEBUG_MODULE only by default.
1281         * m4/output.c: Similarly for DEBUG_OUTPUT.
1282         * m4/path.c: Similarly for DEBUG_INCL.
1283         * m4/symtax.c: Similarly for DEBUG_SYM.
1284         * m4/syntax.c: Similarly for DEBUG_SYNTAX.
1285         * src/stackovf.c: Similarly for DEBUG_STACKOVF.
1286         * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
1287         preprocessor macros defined with -DDEBUG compiles.
1289 2006-07-17  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
1291         * bootstrap: Correct typo in --download-po argument parsing.
1293 2006-07-15  Eric Blake  <ebb9@byu.net>
1295         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
1296         gendocs fdl'.
1297         * tests/generate.awk (normalize): Recognize @tabchar.
1298         * doc/m4.texinfo (Top): Start merging from branch.  Remove tabs.
1299         Fix menus.  Upgrade FDL license from 1.1 to 1.2.  Fix overfull
1300         hboxes.
1301         (Index macro, Shell commands, Incompatiblities): Rename nodes
1302         from Index, UNIX commands, Other incompat.
1303         (Platform macros, Using frozen files, Frozen file format 1)
1304         (Frozen file format 2, Copying This Manual, Indices): New nodes.
1305         * Makefile.am (EXTRA_DIST): Distribute gendocs.
1306         (MAINTAINERCLEANFILES): Clean up files from gnulib.
1307         (doc_m4_TEXINFOS): Depend on fdl.texi.
1308         (web-manual): New maintainer target.
1310 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
1312         * doc/m4.texinfo (Modules):  RMS asked me for an explanation of
1313         the modular architecture of M4.  The result is paraphrased here
1314         for the benefit of future readers of the manual.
1316 2006-07-14  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
1318         * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
1320 2006-07-14  Eric Blake  <ebb9@byu.net>
1322         * src/main.c (main): Avoid compiler warning.
1323         * modules/gnu.c (renamesyms): Remove unused variable.
1325 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
1327         * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
1328         (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
1329         new functions for managing regexp syntax options.
1330         * m4/m4private.h (m4): Add regexp_syntax field.
1331         * m4/resyntax.c: New file implements the above.
1332         * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
1333         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
1334         (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
1335         (m4_patsubst_do, m4_renamesyms_do): Removed.
1336         (builtin_changeresyntax): New builtin to change regular expression
1337         syntax.
1338         (m4_resyntax_encode_safe): Factor out diagnostics code.
1339         * src/freeze.c (produce_resyntax_dump): New function to dump
1340         default regexp syntax specifier to frozen file.
1341         (reload_frozen_state): Updated to action 'R' directive.
1342         * src/main.c (usage): Describe new -r option.
1343         (long_options, OPTSTRING): Declare it.
1344         (main): Encode and store cli regexp syntax option argument.
1345         * tests/freeze.at (regexp syntax): New test that regexp syntax
1346         survives freezing.
1347         * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
1348         * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
1349         (Epatsubst and Patsubst): Renamed to...
1350         (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
1351         documentation and added new examples.
1352         (Changeresyntax): New section describing changeresyntax builtin,
1353         and regexp syntax names.
1354         (Regular expression syntax): New section describing differences
1355         between various regular expression syntaxes.
1356         (Frozen files): Document 'R' directive.
1357         * NEWS: Updated.
1359 2006-07-13  Gary V. Vaughan  <gary@gnu.org>
1361         * bootstrap: Enhanced to work more like our other scripts:
1362         Add a copyright statement; support --version and --help; accept a
1363         --download-po option with argument as a substitute for DOWNLOAD_PO
1364         in the environment.
1366 2006-07-11  Eric Blake  <ebb9@byu.net>
1368         * Makefile.am (doc/m4.1): Port patch from branch that avoids
1369         intermediate file.
1370         * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
1371         changed.
1373 2006-07-10  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
1375         * tests/builtin.at (patsubst, regexp):  Adjust these tests, now
1376         that `\0' is no longer accepted.
1378         * src/main.c (usage): Alphabetize options within their sections.
1380         * modules/gnu.c (m4_regexp_search, regsub, substitute)
1381         (esyscmd):  Improve comments.
1383         * modules/gnu.c (substitute): Remove old warning for \0.
1384         (substitute_warned): No longer required.  Removed.
1386         * modules/gnu.c: Put macro definitions into alphabetical order.
1388 2006-07-07  Eric Blake  <ebb9@byu.net>
1390         * tests/freeze.at (loading format 1): New file, with new test.
1391         * tests/testsuite.at: Include it.
1392         * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
1393         * tests/modules.at (Freezing modules): Likewise.
1395         * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
1396         (AC_CHECK_HEADERS): Assume signal.h.
1397         (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
1398         (AC_CHECK_FUNCS_ONCE): Likewise.
1399         * src/m4.h (includes): Assume signal.h.
1401 2006-07-05  Eric Blake  <ebb9@byu.net>
1403         Fix all testsuite failures on cygwin.
1404         * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
1405         branch-1_4.  Solves testsuite failure when uninstalled m4 is
1406         shadowed by redefinition of PATH in libtool wrapper.
1407         * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
1408         contains the -no-undefined required by cygwin.
1409         (TESTS_ENVIRONMENT): Export abs_top_builddir.
1410         * tests/others.at (misc): Port to platforms where /etc/passwd
1411         does not exist or does not contain user named root.
1412         * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
1413         directory.
1414         * tests/builtins.at (define, divert): Avoid overquoting.
1415         * tests/generate.awk (new_group): Likewise.
1417 2006-07-05  Gary V. Vaughan  <gary@gnu.org>
1419         The regs_allocated field in a struct re_pattern_buffer refers
1420         to the state of a particular re_registers struct when used in
1421         successive matches using the same compiled pattern.  Avoid a
1422         SEGV in `renamesyms' resulting from using a new re_registers
1423         with an existing re_pattern_buffer:
1425         * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
1426         pattern buffer and registers.
1427         (m4_regexp_search): New function to call re_regexp_search with
1428         correctly matched pattern buffer and register instantiations.
1429         (m4_regexp_compile): Return an m4_pattern_buffer.  Adust all
1430         callers.
1432 2006-07-04  Gary V. Vaughan  <gary@gnu.org>
1434         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
1435         changes to gnulib getopt.m4 since last build.
1436         * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
1437         if the system getopt fails M4_GETOPT tests.
1439 2006-06-22  Eric Blake  <ebb9@byu.net>
1441         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
1442         Reported by Bruno Haible.
1444 2006-06-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1446         * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
1448 2006-06-19  Eric Blake  <ebb9@byu.net>
1450         * THANKS: Update.
1452 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1454         * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
1455         (clean-local): Split into and depend upon...
1456         (clean-local-tests, clean-local-src): ...these two.  The latter
1457         removes the libtool object directory below `src', to work around
1458         a buglet in Automake, failing to list it.
1459         (EXTRA_DIST): Distribute modules/perl.c.
1461 2006-06-19  Eric Blake  <ebb9@byu.net>
1463         * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
1464         right side of dependency; VPATH does that.
1465         (stamp-vcl): Update to use libtool's algorithm.
1466         (EXTRA_DIST): Distribute stamp-vcl.
1467         Reported by Ralf Wildenhues.
1468         (TESTSUITE): Revert earlier change that used absolute path, as
1469         that broke 'make dist' in VPATH.  Stick with $(srcdir) instead.
1470         (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
1471         (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
1472         atlocal takes care of it instead.
1473         (check-local, installcheck-local, clean-local): Inline absolute
1474         path to testsuite here, rather than relative path to testsuite
1475         elsewhere.
1477 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1479         * m4/m4private.h (DELETE): Cast away const here...
1480         * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
1481         * src/freeze.c (reload_frozen_state): Avoid uninitialized
1482         variable warning.
1484 2006-06-19  Eric Blake  <ebb9@byu.net>
1486         * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
1487         .info pages are built.
1488         Reported by Ralf Wildenhues.
1489         (EXTRA_DIST): Inline definition of testsuite, so that make dist
1490         works again.
1492 2006-06-16  Eric Blake  <ebb9@byu.net>
1494         Follow recommendations from autoconf manual for autotest.
1495         * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
1496         turn it into an absolute path until autotest provides an option
1497         that allows us to avoid changing directories.  Properly quote
1498         throughout.
1499         (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
1500         (check-recursive): Delete unused target.
1501         ($(TESTSUITE)): Atomically update testsuite.
1502         (CD_TESTDIR): Simplify.
1503         (m4__cd): Delete unused macro.
1504         (check-local): Let TESTSUITEFLAGS influence the run.
1505         (installcheck-local): Let TESTSUITEFLAGS override
1506         AUTOTEST_PATH.  Add dependencies.
1507         (clean-local): Clean up.
1508         (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
1509         * README: Document how to use the testsuite.
1511 2006-06-15  Eric Blake  <ebb9@byu.net>
1513         * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
1515         * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
1516         clashes with m4sugar.
1517         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
1518         * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
1519         * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
1520         * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
1521         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
1522         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
1523         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
1524         * configure.ac: Likewise.
1525         (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
1526         * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
1527         conditional.
1528         * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
1530         Reduce compiler warnings.  Inside GMP, mpq_t is an array type, so
1531         const mpq_t is not assignable from plain mpq_t.  Avoid
1532         type-punning warnings caused trying to mix these types.
1533         * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
1534         (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
1535         * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
1536         (mult_term, exp_term): Remove type-punning casts.
1537         (numb_pow): Remove const qualifier.
1538         * src/freeze.c (reload_frozen_state): Fix typo in messages.
1539         Fix variables that can be used uninitialized, which fixes
1540         security hole where malicious frozen file can execute arbitrary
1541         code.
1543 2006-06-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1545         * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
1547 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1548             Eric Blake  <ebb9@byu.net>
1550         Allow `make dist' to work again.
1551         * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
1552         (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
1553         (cvs-dist): Fix typo.
1554         * NEWS: Match current version number.
1556 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1558         * Makefile.am (AM_CPPFLAGS):  Add $(LTDLINCL), so the right
1559         ltdl.h is used.
1561         * bootstrap: Do not run libtoolize manually, this is done
1562         correctly by autoreconf.  Invoke autoreconf with --no-recursive
1563         to avoid unnecessary rerunning of autotools for libltdl.
1565 2006-06-13  Eric Blake  <ebb9@byu.net>
1567         * THANKS: Update.
1569 2006-06-12  Eric Blake  <ebb9@byu.net>
1571         * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
1572         bother with mktemp.
1573         * src/m4.h: Don't declare mktemp.
1574         * m4/input.c (m4__next_token): Avoid bzero.
1575         * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
1576         * Makefile.am (doc/m4.1): Depend on installed help2man, rather
1577         than distributing outdated helptoman.pl.
1578         * doc/helptoman.pl: Delete.
1580 2006-06-10  Eric Blake  <ebb9@byu.net>
1582         * README (Patches): Document the current dependence on CVS
1583         builds of autotools.
1584         * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
1585         * configure.ac: Use consistent quoting throughout.
1586         (AC_PREREQ): Bump to 2.59d.
1587         (AC_INIT): Package name begins with uppercase.
1588         (AC_ARG_WITH): Use AS_HELP_STRING.
1589         (AM_INIT_AUTOMAKE): Enable gnits mode.
1590         (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
1591         (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
1592         (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
1593         done by gnulib or automake, or which autoconf has declared
1594         obsolete.
1595         * m4/m4private.h (Includes): Assume C89 or better, and use errno
1596         unconditionally.
1597         * m4/output.c (Includes): Likewise.
1598         * modules/gnu.c (Includes): Likewise.
1599         * modules/m4.c (Includes): Likewise.
1600         * src/m4.h (Includes): Likewise.
1602         * README-alpha: Update web address.
1603         * README: Likewise. Change encoding to ASCII.  Remove old advice
1604         about cygwin.  Document bootstrapping dependency.
1605         * AUTHORS: Update from branch-1_4.
1606         * THANKS: Likewise.  Change encoding to UTF-8.
1607         * BACKLOG: Delete.  This file is too old and unmaintained to be
1608         worthwhile.
1609         * ChangeLog: Change encoding to UTF-8.
1611         Avoid compiler warnings.
1612         * m4/macro.c (trace_format): Don't mark this as a printf format,
1613         since we don't accept the same set of modifiers as printf.  It
1614         would be nice if gcc let us specify a custom format archetype.
1615         * src/main.c (main): Cast away const.
1617 2006-06-10  Andreas Schwab  <schwab@suse.de>  (tiny change)
1618             Eric Blake  <ebb9@byu.net>
1620         * modules/time.c (ctime): Pass correctly typed variable to
1621         m4_numeric_arg.
1622         (gmtime): Likewise.
1623         (localtime): Likewise.
1624         (strftime): Likewise.
1625         * m4/utility.c (m4_numeric_arg): For now, document arbitrary
1626         limit inherent in this interface.
1628 2006-05-08  Bruno Haible  <bruno@clisp.org>  (tiny change)
1630         * modules/m4.c (WEXITSTATUS): Provide fallback definition.
1631         (sysval): Use WEXITSTATUS.
1632         * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
1633         big-endian and little-endian wait status definitions.
1635 2006-05-06  Eric Blake  <ebb9@byu.net>
1637         * po/Makevars (MSGID_BUGS_ADDRESS): Add.
1638         * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
1639         in src, not gnu.
1641 2006-05-06  Eric Blake  <ebb9@byu.net>
1643         * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
1644         subdirectory to use.
1645         (support for -pipe): Move after LT_INIT, since it relies on
1646         libtool internals.
1648 2006-05-05  Eric Blake  <ebb9@byu.net>
1650         * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
1652         * THANKS: Update.
1654 2006-05-05  Bruno Haible  <bruno@clisp.org>
1655             Eric Blake  <ebb9@byu.net>
1657         * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
1658         * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
1659         usage pattern.
1660         * bootstrap: Update usage of gnulib-tool.
1662 2006-05-04  Eric Blake  <ebb9@byu.net>
1664         * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
1665         Cleanup whitespace.
1667 2005-12-05  Gary V. Vaughan  <gary@gnu.org>
1669         * bootstrap (func_update_po): Synch with CVS GNU tar.  wget 1.9.x
1670         and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
1671         Reported by Eric Blake <ebb9@byu.net>
1673 2005-12-04  Gary V. Vaughan  <gary@gnu.org>
1675         * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
1676         http caching as -C is no longer supported by wget 1.10.x.
1677         Reported by Eric Blake <ebb9@byu.net>
1679 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
1681         * m4/module.c (caller_id): To match libtool-2.0 interface, changed
1682         to ...
1683         (iface_id): ...an lt_dlinterface_id type.
1684         (m4__module_find): New abstraction for lt_dlhandle_fetch.  Use
1685         throughout, instead of calling obsolete lt_dlhandle_find directly.
1686         (m4__module_next): Use multiloader-safe lt_dlhandle_iterate.  Use
1687         throughout, instead of calling obsolete lt_dlhandle_next.
1688         * m4/m4private.h (m4__module_find): Declare it.
1689         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
1690         Use m4__module_next instead of obsolete lt_dlhandle_next.
1692 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
1694         * bootstrap (func_update_po): Update pofiles directly from the
1695         translation project.
1696         * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
1697         po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
1698         these files under source control anymore.
1699         Suggested by Eric Blake <ebb9@byu.net>
1701 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
1703         * ltdl/m4/m4-gnulib.m4: Update FSF contact address.  Somehow this
1704         file escaped the address updates on 2005-05-01.
1706 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
1708         * bootstrap: Allow user overriding of gnulib-tool location, and
1709         correctly determine module source directories whether gnulib-tool
1710         is given as a relative or absolute path, or is found by searching
1711         PATH.
1712         Reported by Eric Blake <ebb9@byu.net>
1714 2005-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1716         * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
1717         and $RM are defined for various versions of
1718         AC_LIBTOOL_COMPILER_OPTION.
1720         * bootstrap (AUTORECONF): New variable to allow user overriding of
1721         autoreconf path.
1723 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
1725         * doc/m4.texinfo (History): Add better notes on the ancestory of
1726         GNU m4, and other historical interest.
1728 2005-05-08  Gary V. Vaughan  <gary@gnu.org>
1730         * m4/symtab.c (m4_symbol_rename): New function that performs a low
1731         level symbol rename.
1732         * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
1733         * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
1734         (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
1735         regsub...
1736         (erenamesyms, renamesyms): ...builtins that use these to implement
1737         macro renaming by regular expression.
1738         * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
1739         * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
1740         to stop the new generated tests from choking.
1742 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
1744         Since most of the build is handled from a single Makefile.am now,
1745         we can teach make about the dependencies between the m4 binary and
1746         the preopened modules it is built against:
1748         * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
1749         preopened modules.
1750         * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
1751         of the preopened modules have changed.
1753 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
1755         * configure.ac (gl_MODULES): Add mkstemp for machines that don't
1756         have a native implementation.
1758 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
1760         * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed.  These are
1761         handled already by gnu/exit.h.
1763         * configure.ac (gl_MODULES): Add assert to support a
1764         --disable-assert configure time option for NDEBUG setting.
1766         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
1767         * bootstrap (src_modules): Add version-etc-fsf.
1768         * src/main.c (version_etc_copyright): Removed.
1770         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
1772 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
1774         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
1775         recognition macros.
1776         * src/freeze.c (produce_frozen_state): Use \n line-endings even
1777         on Windows, so that the frozen file reader will work.
1778         Reported by Josef T. Burger <bolo@bolo.com>
1780 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
1782         Forward port of a patch that allowed m4-1.4.2 to compile on
1783         QNX 6.3:
1785         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
1786         sys/signal.h.
1787         * src/m4.h: And include them as appropriate.
1788         * src/main.c, src/stackovf.h: Don't include signal.h literally;
1789         m4.h will include the correct file.
1791 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
1793         * m4/m4private.h: Make errno visible for the sources patched
1794         below.
1796 2005-05-04  Paul Eggert  <eggert@twinsun.com>
1798         * src/main.c (print_program_name_CB): Preserve errno, since
1799         M4ERROR relies on this.
1800         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
1801         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
1802         * m4/path.c (m4_path_search): Don't let "free" trash errno when
1803         returning NULL.
1805         * m4/output.c (m4_insert_file): Don't assume errno has a valid
1806         value simply because fread returns zero.  This fixes a
1807         portability bug reported by Marion Hakanson in
1808         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
1810 2005-05-04  Santiago Vila  <sanvila@debian.org>
1812         * tests/stackovf.test: Use tempfile if available.
1814 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
1816         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
1817         * m4/output.c (m4_insert_file): Do not mix buffered and
1818         unbuffered I/O, as this breaks on the Hurd.
1820 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
1822         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
1823         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
1824         and libtoolize does a better job of ltdl importing now too, so
1825         take advantage of that while updating the tree:
1827         * acm4, config: Moved from here...
1828         * ltdl/m4, ltdl/config: ...to here.
1829         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
1830         src/Makefile.am, tests/Makefile.am: Removed...
1831         * Makefile.am: ...and migrated to here, with adjustments to
1832         compensate for relative path differences.
1833         * commit: Adjust relative paths.
1834         * configure.ac: Adjust relative paths.
1835         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
1836         patch.
1837         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
1838         the meanwhile, CVS HEAD libtool is needed.
1839         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
1840         stricly new enough, we also need a patch.
1841         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
1842         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
1843         (gl_MODULES): Don't list getopt and version-etc, as they don't
1844         belong in libm4.
1845         * bootstrap: After running gnulib-tool to import the listed
1846         modules, fetch getopt and version-etc into src manually.
1847         (ltdldir): Change to ltdl.
1848         * src/main.c: Adjust for changes in version-etc API.
1849         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
1850         but works when the getopt module isn't to be included in the lib.
1851         * README: Add note about patching autoconf and automake to
1852         bootstrap CVS m4.
1854 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
1856         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
1857         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
1858         empty file rather than to a nonexistent file.  This closes a
1859         common security hole.
1860         * modules/m4.c (m4_maketemp): Implement the above, by using
1861         mkstemp rather than mktemp.
1863 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
1865         The FSF are moving offices today.  Changed their contact address
1866         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
1867         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
1869 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
1871         * tests/Makefile (clean-local): Ignore testsuite cleanup
1872         failures.
1874 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
1876         * tests/Makefile (clean-local): Only run the testsuite cleanup
1877         if the testsuite has been generated.
1879 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
1881         * TODO: slight clarification of the example of qindir usage.
1883 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
1885         * TODO: Add qindir requirement, and defn bug.
1886         From Stepan Kasal  <kasal@ucw.cz>
1888 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
1890         * TODO: Add ``execution stack'', fix a typo.
1891         * doc/m4.texinfo: Typos.
1893 2004-12-24  Eric Blake  <ebb9@byu.net>
1895         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
1896         to the gnu subdirectory.
1897         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
1898         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
1899         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
1900         * m4/system_.h: Likewise, in non-configured includes.
1902 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
1903             Gary V. Vaughan  <gary@gnu.org>
1905         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
1906         Protect definitions from macro expansion under -DNDEBUG by
1907         parenthesising the expanded function names.
1908         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
1909         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1910         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
1911         (m4_is_syntax_macro_escaped): Similarly protect function
1912         definitions from macro expansion under -DNDEBUG by #undefing the
1913         matching macro names before each definition.  Also, move all the
1914         function definitions to the end of the file so that any
1915         invocations in the rest of the file pick up the fast macro
1916         versions.
1917         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
1918         (m4_set_debug_file, m4_set_trace_messages)
1919         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
1920         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
1921         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
1922         option setter functions.
1924 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
1926         * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
1927         to gnu.
1929 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
1931         * src/main.c: Include gnulib files from the correct directory.
1933         * gnulib/*: Don't store any of the gnulib files in arch, as they
1934         generate spurious changes.
1935         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
1936         gnulib macros now share our macro directory.
1937         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
1938         * bootstrap: Call gnulib-tool to import from the gnulib tree.
1939         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
1940         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
1941         the gettext macros from autopoint that overwrite the gnulib-tool
1942         imported versions.  Import sources and Makefile.am into the `gnu'
1943         directory.  Changed all callers.
1944         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
1945         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
1946         for imported modules.
1947         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
1948         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
1949         hardcoding the gnulib macros they wrap.
1951 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
1953         Latest CVS libtool can preload modules in libraries, including
1954         its own module loaders!  Tweak m4 so that it doesn't try to treat
1955         libltdl's module loaders as m4 modules when freezing and on exit:
1957         * gnulib/acm4/*.m4: Don't store these files in arch since they
1958         generate spurious changes.
1959         * bootstrap: Simplify initial libtoolize call, since CVS
1960         libtoolize is smarter these days.
1961         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
1962         build.
1963         * m4/module.h (m4__module_exit): Missing declaration.
1964         * m4/m4private.h (m4__module_next): New function declaration.
1965         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
1966         encapsulation.  Changed all callers.
1967         (m4__module_interface): New function to verify m4 loadable module
1968         interfaces.
1969         (m4__module_init): Register the interface validator.
1970         (m4__module_exit): Only close my own modules.
1971         * modules/m4.c (unistd.h): Provide missing declaration.
1972         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
1973         (m4_expand_ranges): More missing declarations.
1974         * modules/modtest.c (export_test): Ditto.
1975         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
1976         * src/main.c (main): Bump copyright year.
1977         * tests/modules.at: Fix sed syntax error.
1980 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
1982         Tweaking to enable compilation with latest CVS libtool and
1983         libltdl.  We can't just dump the library files directly into the
1984         m4 directory anymore now that libltdl is built from pieces itself:
1986         * bootstrap: Rewritten to use latest libtoolize sanely, and to
1987         set up libltdl subdirectory.
1988         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
1989         gnulib subdirectory's config.
1990         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
1991         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
1992         macros from gnulib.
1993         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
1994         configure.ac, so use AC_WITH_LTDL instead.
1995         * Makefile.am (SUBDIRS): Add libltdl.
1996         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
1997         gl_INCLUDED_REGEX.
1998         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
1999         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
2000         (libm4_la_LIBADD): Add LIBLTDL.
2001         * m4/ltdl.c, m4/ltdl.h: Removed.
2002         * m4/m4module.h: Include canonical ltdl.h.
2003         * po/*.po: Updated.
2005 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
2007         * gnulib/import: Now updates makefile fragments, and configure.ac.
2008         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
2009         * gnulib/m4/Makefile.am: include it.
2010         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
2011         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
2012         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
2013         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
2014         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
2015         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
2016         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
2017         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
2018         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
2019         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
2020         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
2021         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
2022         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
2023         import.
2024         * gnulib/m4/getopt_int.h: New source file from latest gnulib
2025         import.
2026         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
2027         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
2028         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
2029         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
2030         Updated source files from latest gnulib.
2032 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
2034         * config/mailnotify: New file for mailing commit notifications,
2035         imported from cvs-utils.
2036         * commit: Updated from cvs-utils and tweaked for m4.
2038 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
2040         * config/mkstamp: Updated from CVS libtool.
2041         * configure.ac: Generate a gnu coding standards compliant version
2042         number, and use it for the banner.
2043         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
2044         mhen the TIMESTAMP changes in ChangeLog, but the file modification
2045         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
2046         contain the previous version number.
2047         * src/main.c: Make --version output conform to the GNU standard.
2049         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
2050         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
2051         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
2052         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
2053         time_la_SOURCES): ...so that these are defaulted correctly, and
2054         can be removed from this file.
2055         (AM_LDFLAGS): Add -module...
2056         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
2057         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
2058         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
2059         the individual settings can be removed.
2060         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
2061         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
2062         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
2063         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
2064         time_la_LIBADD): ...so that these are picked up as a deplib of
2065         libm4 and don't need to be set explicitly.
2067 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
2069         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
2070         from the standard build.  It is too fragile.
2072         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
2073         CVS libtool after merging m4 changes across to libtool.
2075         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
2076         * m4/path.c (search_path_add): Ditto.
2078 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
2080         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
2081         libtool tags we don't use in configure.  This reduces the size
2082         of the script from over 1Mb to under 700Kb.
2084 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
2086         The import script was not written properly, and the last gnulib
2087         import was incomplete.  Fixed that problem, and reimport our
2088         gnulib dependencies, which picks up the address calculation
2089         overflow checks described by Paul below.  Also tweak the clients
2090         of the gnulib xalloc module not to use deprecated macros:
2092         * gnulib/import: Recurse through module dependencies rather than
2093         naively descending only one level.
2094         * configure.ac: Add calls to gnulib's strnlen and extension module
2095         macros.
2096         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
2097         extension modules.
2098         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
2099         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
2100         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
2101         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
2102         gnulib.
2103         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
2104         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
2105         place of `xcalloc (1, S)'.
2106         * m4/m4.c (m4_create): Likewise.
2107         * m4/m4private.h (m4_symbol_value_create): Likewise.
2108         * m4/symtab.c (symtab_fetch): Likewise.
2109         * m4/syntax.c (m4_syntax_create): Likewise.
2110         * src/freeze.c (reload_frozen_state): Likewise.
2111         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
2112         macro.
2113         * m4/symtab.c (m4_symtab_create): Likewise.
2115 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
2117         * tests/module.at: Comment typo.
2119 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
2121         * tests/modules.at (modules: importing): Apply some lateral
2122         thinking, and use AT_CHECK to compare the output of a sed pass
2123         over stderr against the canonical strerror string.
2125         * tests/modules.at (modules: importing): Edit the generated stderr
2126         output to canonicalize strerror output, before a comparison.
2128 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
2130         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
2131         careful not to trip over the mess:
2133         * modules/perl.c: Some builds of perl install headers that contain
2134         `#define try __builtin_try'.  Be sure to undefine that macro
2135         before `m4/hash.h' gets included, which uses the `try' symbol.
2136         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
2137         `false' before including `stdbool.h'.
2138         (DELETE):  This symbol is not in m4's namespace, and is in any
2139         case only used internally...
2140         * m4/m4private.h (DELETE): ...so move it to here.
2141         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
2143 2003-10-08  Paul Eggert  <eggert@twinsun.com>
2145         Don't use XMALLOC and XCALLOC.  Once we install the
2146         corresponding patch into gnulib, this will fix some
2147         address-calculation overflow bugs on hosts where calloc (A, B)
2148         returns garbage when A*B overflows.
2150         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
2151         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
2152         xmalloc, XCALLOC with xcalloc.
2153         * m4/m4.c (m4_create): Likewise.
2154         * m4/m4private.h (m4_symbol_value_create): Likewise.
2155         * m4/output.c (m4_output_init): Likewise.
2156         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
2157         * m4/syntax.c (remove_syntax_attribute): Likewise.
2158         * src/freeze.c (reload_frozen_state): Likewise.
2159         * src/main.c (main): Likewise.
2161 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
2163         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
2164         gnulib/acm4 directories for aclocal m4 macros.
2165         * gnulib/Makefile.am (EXTRA_DIST): Removed.
2166         (MAINTAINERCLEANFILES): Add Makefile.in.
2167         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
2168         modules we use.
2169         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
2170         * gnulib/import: New file.  Temporary script for updating gnulib
2171         imported files, until gnulib-tool is working.
2172         * gnulib/config/codeset.m4, gnulib/config/error.m4,
2173         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
2174         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
2175         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
2176         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
2177         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
2178         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
2179         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
2180         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
2181         gnulib/config/nls.m4, gnulib/config/obstack.m4,
2182         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
2183         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
2184         gnulib/config/regex.m4, gnulib/config/restrict.m4.
2185         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
2186         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
2187         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
2188         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
2189         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
2190         gnulib/config/xstrndup.m4: Removed.
2191         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
2192         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
2193         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
2194         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
2195         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
2196         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
2197         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
2198         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
2199         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
2200         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
2201         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
2202         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
2203         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
2204         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
2205         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
2206         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
2207         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
2208         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
2209         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
2210         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
2211         gnulib/import script.
2212         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
2213         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
2214         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
2215         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
2216         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
2217         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
2218         gnulib with gnulib/import script.
2219         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
2220         guards ready for gnulib-tool to autoupdate on import.
2221         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
2222         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
2223         config/stackovf.m4: Moved from here...
2224         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
2225         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
2226         acm4/stackovf.m4: ...to here, to separate aclocal macros from
2227         configure time helper scripts.
2228         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
2229         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
2230         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
2231         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
2232         gnulib xalloc.h.
2233         * src/main.c (version_etc_copyright): Only output the current
2234         year.
2235         (version_etc): Call with new variadic API.
2237 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
2239         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
2240         version-etc module from CVS gnulib.
2241         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
2242         * src/Makefile.am: Build it.
2243         * src/main.c: Use it.
2245         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
2246         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
2247         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
2248         exit.h instead.
2250 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
2251             Gary V. Vaughan  <gary@gnu.org>
2253         * bootstrap: Separate options.
2254         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
2255         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
2256         not set.
2257         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
2258         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
2259         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
2260         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
2261         $(LTLIBINTL) for gettext support on cygwin.
2262         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
2263         have $(LTLIBINTL) from the preloaded module la files.
2264         * README: Remove the warning about using --disable-nls on Windows
2265         machines.
2267 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
2269         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
2270         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
2271         is required.
2273 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
2275         * doc/STYLE: Document the gnulib header naming conventions, and
2276         #include policy.
2277         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
2278         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
2279         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
2280         respectively.
2281         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
2283         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
2284         module from CVS gnulib.
2285         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
2286         (gl_FUNC_STRTOL): In favour of the module macro.
2288 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
2290         Replace the getopt code with CVS gnulib getopt.  The source files
2291         detect whether they are in a glibc environment and preprocess away
2292         all of the code if there is a system getopt, so we can compile
2293         them into the m4 executable unconditionally:
2295         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
2296         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
2297         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
2298         macros.
2299         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
2300         version.
2301         * src/Makefile.am: Adjust.
2302         * src/main.c: Always include our shipped getopt.h.
2303         * po/POTFILES.in: Use new location of getopt.c.
2305 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
2307         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
2308         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
2309         in this directory automatically.
2310         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
2312         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
2313         isn't set yet.
2314         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
2315         inline.
2316         * modules/Makefile.am (pkglibexecdir): Set it here.
2317         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
2319         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
2320         Import regex module from CVS gnulib.
2321         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
2322         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
2323         do extra substitutions for Makefile.
2324         * configure.ac: Use it.
2325         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
2326         from regex_.h if necessary.
2327         * m4/system_.h: Include the correct version of regex.h.
2328         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
2329         version.
2330         * po/POTFILES.in: Use new location of regex.c.
2332         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
2333         realloc.c: automake distributes these files already.
2335 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
2337         Replace the xstrzdup code by importing the xstrndup module from
2338         CVS gnulib, along with its dependencies: strndup and strnlen:
2340         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
2341         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
2342         gnulib.
2343         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
2344         gnulib/config/strndup.m4: Ditto wrt strndup.
2345         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
2346         strnlen.
2347         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
2348         However, contrary to gnulib, we install xstrndup.h.
2349         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
2350         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
2351         is an artifact of the old m4 portability layer.
2352         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
2353         * m4/system_.h: Include xstrndup.h.
2354         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
2356 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
2358         Reimport the latest xalloc module from CVS gnulib, and adjust the
2359         m4 sources to take advantage of xalloc xfree.  Also create a new
2360         macro DELETE with the same semantics as the old m4 XFREE macro,
2361         and carefully tweak callers:
2363         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
2364         gnulib.
2365         * m4/utility.c (xfree): Removed.  This function is now supplied by
2366         gnulib xalloc.
2367         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
2368         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
2369         * m4/symtab.c (m4_symtab_create): Ditto.
2370         * m4/system_.h: Removed XFREE redefine.
2371         (DELETE): New macro with same functionality as the original m4
2372         XFREE macro, but based on xalloc.h now.  Changed all callers.
2373         * src/main.c (main): Use XMALLOC macro.
2374         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
2375         instead of XFREE.
2376         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
2378 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
2380         Import the xalloc module from CVS gnulib, along with its
2381         dependencies: exitfail, malloc and realloc. We had different
2382         semantics for our XFREE and a function xfree() not supplied by
2383         gnulib, so also a bit of work to keep everything running
2384         smoothly:
2386         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
2387         (gl_XALLOC): Use gnulib equivalents.
2388         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
2389         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
2390         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
2391         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
2392         realloc.
2393         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
2394         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
2395         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
2396         imported modules.
2397         (pkgincdir): Removed.  Use pkgincludedir instead.
2398         * m4/m4private.h (XFREE): xfree already checks for NULL.
2399         * m4/system_.h: Use xalloc module, and remove macros already
2400         supplied by xalloc.h.
2401         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
2402         moved the old definition from m4/xmalloc.c to here for now.
2404 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
2406         Import the error and progname modules from CVS gnulib.  Our old
2407         error.c subsumed the functionality of both, so a little adjustment
2408         was required to accomodate the split in sources.  Also added more
2409         wrapper macros to choose between a system installed error.h or our
2410         shipped gnulib error module:
2412         * m4/error.c, m4/error.h: Removed.
2413         * m4/Makefile.am: Adjust.
2414         (pkgincdir): Removed.  Use pkgincludedir instead.
2415         * m4/module.h, src/main.c: Don't include `m4/error.h'.
2416         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
2417         error.h.
2418         * gnulib/m4/progname.c: Imported from CVS gnulib.
2419         * gnulib/m4/progname.h: Ditto.
2420         * src/main.c: Adjust to use progname module.
2421         * gnulib/m4/error.c: Imported from CVS gnulib.
2422         * gnulib/m4/error_.h: Ditto.
2423         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
2424         if appropriate, and link a local error.h if the system version is
2425         missing.
2426         (libgnu_la_SOURCES) Add progname module sources.
2427         * gnulib/config/error.m4: Imported from CVS gnulib.
2428         * gnulib/config/strerror_r.m4: Ditto.
2429         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
2430         to have ERROR_H for Makefile substitutions and tell system.h
2431         whether the system error.h should be used, or a locally installed
2432         version.
2433         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
2435 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
2437         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
2438         s/gettext_.h/gettext.h/.
2440         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
2441         automake have been fixed.
2443         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
2444         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
2445         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
2446         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
2448 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
2450         The gnulib obstack module requires the gnulib gettext module for
2451         systems that do not have GNU gettext installed.  Because we use
2452         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
2453         that directory incase it clashes with the system gettext.h.  This
2454         delta uses gettext_.h and extra rules in the Makefile to make a
2455         link to gettext.h when needed:
2457         * Makefile.am (auxdir): Removed.  No longer used.
2458         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
2459         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
2460         moved.
2461         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
2462         Makefile based build.
2463         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
2464         of the macros are kept.
2465         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
2466         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
2467         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
2468         distributes these automatically.
2469         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
2470         warning from automake-1.7a.
2471         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
2472         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
2473         all callers.
2474         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
2475         wrt. m4_FUNC_OBSTACK.
2476         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
2477         wrt. m4_sys_STACKOVF.
2478         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
2479         wrt. _m4_LIB_GMP, m4_LIB_GMP.
2480         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
2481         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
2482         respectively.
2483         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
2484         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
2485         gettext.h link on deficient systems.
2486         (pkginc_HEADERS): Mention $(GETTEXT_H).
2487         (EXTRA_HEADERS): Mention gettext.h.
2488         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
2489         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
2490         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
2491         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
2492         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
2493         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
2494         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
2495         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
2496         gnulib/config/po.m4, gnulib/config/progtest.m4,
2497         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
2498         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
2500 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
2502         We can't mirror the gnulib directory structure here, since we need
2503         to be able to eg. `#include <m4/obstack.h>' from our source files,
2504         which is much easier if the local obstack.h is created in a
2505         directory named m4.  Rather than trying to symlink everything into
2506         the m4 directory, now we build a libtool convenience library from
2507         the sources we get from gnulib and link that with libm4.la:
2509         * gnulib/config/extensions.m4: Imported from CVS gnulib.
2510         * gnulib/config/unlocked-io.m4: Ditto.
2511         * gnulib/m4/unlocked-io.h: Ditto.
2512         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
2513         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
2514         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
2515         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
2516         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
2517         * m4/Makefile.am: Adjust.
2518         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
2519         macros we redistribute.
2520         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
2521         library among others.
2522         (GNULIB_SRCS, GNULIB_MACROS): Removed.
2523         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
2524         * config/m4-obstack.m4: Adjust.
2525         * po/POTFILES.in: Adjust.
2526         * configure.ac: Reformatting.  Call newly imported gnulib macros.
2527         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
2528         bogus calls of `#include "m4.h"'.
2529         * Makefile.am: INCLUDES has been deprecated in favour of
2530         AM_CPPFLAGS.
2531         * m4/Makefile.am: Ditto.
2532         * modules/Makefile.am: Ditto.
2533         * src/Makefile.am: Ditto.
2535 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
2537         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
2539 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
2541         Migrate the obstack support into the gnulib directories for easy
2542         synchronisation with upstream files in gnulib:
2544         * config/gnu-obstack.m4: Moved from here...
2545         * config/m4-obstack.m4: ...to here.
2546         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
2547         * m4/obstack.c, m4/obstack_.h: Moved from here...
2548         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
2549         * po/POTFILES.in: Adjust.
2550         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
2551         * m4/Makefile.am: Add a whole new section to link the obstack
2552         sources from the gnulib tree if necessary.
2553         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
2554         from gnulib.
2555         * config/m4-obstack.m4: Rewrite as a wrapper for
2556         gnulib/m4/obstack.m4.
2558 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
2560         GNU M4 currently builds with a number of files adapted from
2561         upstream sources.  Recently the gnulib project on savannah.gnu.org
2562         has pulled together a great many of these externally maintained
2563         files.  This delta is the beginnings of isolating those files
2564         maintained in gnulib to make it easy to synchronise M4 with the
2565         upstream files prior to releases.
2567         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
2568         directory.
2569         (SUBDIRS): Added new gnulib subdirectory.
2570         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
2571         * config/stdbool.m4: Moved from here...
2572         * gnulib/m4/stdbool.m4: ...to here.
2573         * m4/stdbool_.h: Moved from here...
2574         * gnulib/lib/stdbool_.h: ...to here.
2575         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
2576         distributed.
2577         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
2578         code to work with new stdbool_.h location.
2579         (gnulib_srcdir): New.
2581 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
2583         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
2584         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
2585         builds to work.
2586         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
2587         (EXTRA_DIST): Use it.
2589         * bootstrap: CVS autoreconf leaves file droppings.  Remove
2590         aclocal.m4t incase autoreconf doesn't.
2592 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
2594         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
2595         the other gnulib imports, renamed to m4/obstack_.h.
2596         * m4/obstack.c: Updated from CVS gnulib.
2597         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
2598         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
2599         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
2600         about vpath already, and $top_srcdir upsets CVS Automake, so the
2601         $top_srcdir reference was removed.
2603         * m4/system-h.in: For consistency with the gnulib imports, renamed
2604         to m4/system_.h.
2605         * m4/Makefile (EXTRA_HEADERS): Adjust.
2606         * configure.ac (AC_CONFIG_FILES): Adjust.
2608         * m4/stdbool_.h: New file from gnulib for systems without their
2609         own.
2610         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
2611         * config/stdbool.m4: New file.  Macros from gnulib for same.
2612         * configure.ac: Use it.
2614 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
2616         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
2617         * config/gmp.m4: Ditto.
2618         * config/gnu-obstack.m4: Ditto.
2619         * config/stackovf.m4: Ditto.
2620         * m4/builtin.c: Ditto.
2621         * m4/debug.c: Ditto.
2622         * m4/error.c: Ditto.
2623         * m4/error.h: Ditto.
2624         * m4/gnu-obstack.h: Ditto.
2625         * m4/hash.c: Ditto.
2626         * m4/hash.h: Ditto.
2627         * m4/input.c: Ditto.
2628         * m4/m4.c: Ditto.
2629         * m4/m4module.h: Ditto.
2630         * m4/m4private.h: Ditto.
2631         * m4/macro.c: Ditto.
2632         * m4/module.c: Ditto.
2633         * m4/obstack.c: Ditto.
2634         * m4/output.c: Ditto.
2635         * m4/path.c: Ditto.
2636         * m4/regex.c: Ditto.
2637         * m4/regex.h: Ditto.
2638         * m4/strtol.c: Ditto.
2639         * m4/symtab.c: Ditto.
2640         * m4/syntax.c: Ditto.
2641         * m4/utility.c: Ditto.
2642         * m4/xmalloc.c: Ditto.
2643         * m4/xstrdup.c: Ditto.
2644         * m4/xstrzdup.c: Ditto.
2645         * modules/evalparse.c: Ditto.
2646         * modules/format.c: Ditto.
2647         * modules/gnu.c: Ditto.
2648         * modules/import.c: Ditto.
2649         * modules/load.c: Ditto.
2650         * modules/m4.c: Ditto.
2651         * modules/m4.h: Ditto.
2652         * modules/modtest.c: Ditto.
2653         * modules/mpeval.c: Ditto.
2654         * modules/perl.c: Ditto.
2655         * modules/shadow.c: Ditto.
2656         * modules/stdlib.c: Ditto.
2657         * modules/time.c: Ditto.
2658         * modules/traditional.c: Ditto.
2659         * src/freeze.c: Ditto.
2660         * src/getopt.c: Ditto.
2661         * src/getopt1.c: Ditto.
2662         * src/m4.h: Ditto.
2663         * src/main.c: Ditto.
2664         * src/stackovf.c: Ditto.
2666         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
2667         ac_default_headers is an autoconf internal variable.
2668         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
2669         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
2671         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
2672         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
2673         delta.
2675 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
2677         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
2678         C99 bool.
2679         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
2680         possible or faking one with a typedef.  Changed all callers.
2682 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
2684         Still cleaning up the users' module API, by taking out the stuff
2685         that isn't used by any existing modules, and moving specialised
2686         functions out of libm4 and into the module they are used by.
2688         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
2689         * m4/utility.c (m4_skip_space): ...to here the home of its only
2690         use, made static and renamed to `skip_space'.  Changed all
2691         callers.
2692         * m4/m4module.h (m4_expand_ranges): Removed prototype.
2693         * m4/utility.c (m4_expand_ranges): Moved definition from here...
2694         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
2695         ltdl.
2696         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
2697         casting .
2698         * modules/gnu.c (builtin_syntax): Import and use in this
2699         builtin implementation.
2700         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
2701         Not used.  Deleted.
2702         * m4/macro.c (trace_flush): Except here where the macro is now
2703         manually inlined.
2704         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
2705         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
2706         moved...
2707         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
2708         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
2710 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
2712         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
2713         compiler based AC_CHECK_HEADER that was introduced in
2714         autoconf-2.56.
2715         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
2716         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
2717         * configure.ac: Use renamed M4_AC_LIB_GMP.
2719         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
2720         macro that requires arguments! This stops the shell's bad
2721         substitution error at configure time.
2723         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
2724         variables to the testsuite shell.  Set the value of USE_GMP so
2725         that the gmp test will run!
2726         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
2728 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
2730         Libltdl already has an excellent mechanism for accessing C symbols
2731         in modules.  Lets use that!  Remove all the exporting cruft and
2732         just use lt_dlsym in conjunction with a few conventions to
2733         simplify module writers' jobs.  Also removed the table address
2734         caching code and otherwise simplified the module loader quite a
2735         bit.  To access exported symbols in other modules, first the
2736         exporting module must name the symbols <modname>_LTX_<symname>,
2737         and the importing module must define a function type called
2738         <symname>_func.  The importer then adds
2739         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
2740         that wishes to call out to the exported functions.  Care must be
2741         taken that <symname> is non-NULL in the importing module incase
2742         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
2743         definition was in the importers source.  Study
2744         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
2745         m4_module_import will attempt to automatically load a module
2746         required for symbol access if it is not loaded already.
2748         * TODO: Removed the items fixed in this delta.
2749         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
2750         module name.
2751         * m4/ltdl.h (lt_dlhandle_find): Declare it.
2752         * m4/module.c (m4_module_unload): Use it.
2753         * src/freeze.c (reload_frozen_state): Ditto.
2754         * m4/m4module.h (m4_export): Deleted.  Removed all references.
2755         (M4_MODULE_IMPORT): New user convenience macro for importing
2756         arbitrary symbols from other modules.
2757         * m4/module.c (m4_module_import): New function to service
2758         M4_MODULE_IMPORT macro.
2759         (module_data): Removed.  Looking up the tables on demand with
2760         lt_dlsym, rather than caching their addresses here simplifies the
2761         code substantially.
2762         (m4_get_module_builtin_table, m4_get_module_macro_table):
2763         Removed.  Changed all callers.
2764         (set_module_macro_table, set_module_builtin_table): Renamed to
2765         install_macro_table and install_builtin_table respectively, and
2766         simplified now that the cache is no more.
2767         * modules/gnu.c (builtin_symbols): Use this new mechanism to
2768         import m4_dump_symbols from the m4 module.
2769         (builtin_esyscmd): Likewise for m4_set_sysval and
2770         m4_sysval_flush.
2771         * modules/m4.c (m4_export_table): Removed.  Functions are
2772         addressed with the new mechanism which doesn't need this.
2773         (m4_set_sysval): New exported accessor function to prevent
2774         problems with variable access on inferior architectures.
2775         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
2776         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
2777         that we can have some type safety.
2778         * modules/modtest.c (export_test): C level exported function for
2779         testing the new import mechanism.
2780         * modules/import.c: New file for the import end of the test.
2781         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
2782         * tests/modules.at: New test cases for intermodule symbol
2783         importing.
2785 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
2787         * m4/m4module.c (m4_string): Moved from here...
2788         * m4/m4private.c (m4_string): ...to here.
2790         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
2792 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
2794         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
2795         already available to module writers through
2796         m4_{get,set}_nesting_limit_opt(), so moved from here...
2797         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
2798         (m4_create): Use it.
2800 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
2802         Aside from auditing path.c for m4module.h api obfuscation, this
2803         delta introduces the concept of private struct members in opaque
2804         data types to GNU m4: See the STYLE file for details.
2806         * TODO: Remind ourselves that a rewrite of path.c is needed.
2807         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
2808         Moved from here...
2809         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
2810         here and renamed.  These type definitions are for internal api use
2811         only.  Changed all callers.
2812         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
2813         Moved from here...
2814         * m4/path.c (search_path_env_init, search_path_add): ...to here
2815         and renamed.  These calls were never used outside this file.
2816         Changed all callers.
2817         (dirpath): Moved functionality of this static declaration...
2818         * m4/m4private.h (struct m4): ...to this new internal only
2819         search_path field.  Changed all callers.
2820         (m4__get_search_path): Added new internal api accessor.
2821         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
2822         (m4_include_init): Removed...
2823         * m4/m4.c (m4_create): ...because the new m4 field is now
2824         initialised here.
2825         (m4_delete): Recycle search_path memory.
2826         * src/main.c (main): Don't call m4_include_init now that it's
2827         gone!
2828         * doc/STYLE: Document convention for private fields in opaque
2829         ADTs.
2831 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
2833         Sometimes exporting the address of a symbol from a module isn't
2834         enough for other modules to call that symbol correctly.  If
2835         custom data types are used for function parameters, they need to
2836         be known to the caller.  This change introduces the concept of
2837         $(prefix)/include/modules/$(modulename).h to declare those
2838         structures.  Also we move m4_dump_symbols from libm4 to the m4
2839         module to show this concept in action.
2841         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
2842         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
2843         exporting data structures from modules/m4.c.
2844         * modules/m4.c, modules/gnu.c: Include it.
2845         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
2846         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
2847         prototypes.
2848         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
2849         Moved from here...
2850         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
2851         ...to here, with slight renaming.
2852         (m4_export_table): Prototype and add m4_dump_symbols.
2853         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
2854         definition of m4_dump_symbols.
2855         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
2856         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
2858 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
2860         Create an export table in modules/m4.c in readiness for beefing up
2861         the module loader to track module exports and imports.
2863         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
2864         * m4/debug.c (m4_debug_flush_files): Moved...
2865         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
2866         * modules/gnu.c (builtin_esysval): Use it.
2867         * m4/m4module.h (m4_export): New type for declaring module symbols
2868         for export.
2869         * modules/m4.c (m4_export_table): List symbols exported from this
2870         module for use by other modules.
2872 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
2874         An experiment: There is loads of code in libm4 which should be in
2875         the m4 module, but is also used by another module. Just because
2876         some linkers won't cope with calls across dynamic runtime loaded
2877         objects I initially left the code in libm4.  It will tidy the
2878         module api immensely if this code moves to the right place, I just
2879         need to remember to invent a suitable calling mechanism at some
2880         point.  For now, only modules that are statically linked and
2881         preloaded will get this treatment, so the only platforms that will
2882         break are those that require all symbols to be resolved at link
2883         time.
2885         * TODO: Reminder that what I am doing could reduce portability
2886         unless I do something more robust later.
2887         * m4/m4module.h (m4_sysval): No longer exported from libm4.
2888         * m4/utility.c (m4_sysval): No longer declared in libm4.
2889         * modules/Makefile.am: Reformatting.
2890         * modules/m4.c (m4_sysval): Declare it at place of use.
2891         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
2893 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
2895         * m4/m4module.h: Reformatting and rearranging lines a bit.
2896         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
2897         all users.
2898         (m4_call_macro, m4_expand_input): Renamed...
2899         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
2900         callers.
2901         (m4_expansion_level, m4_process_macro): Moved...
2902         * m4/macro.c (expansion_level, process_macro): ...to here, and
2903         made static.
2905         * m4/m4module.h (program_name): Not used by modules at all, so
2906         moved...
2907         * src/main.c (program_name): ...to here.
2908         (print_program_name): Renamed...
2909         (print_program_name_CB): ...to conform to the STYLE guide.
2911 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
2913         More refactoring of the m4module.h API.  Replace #defines with an
2914         enum, and move non-public functions out of the public API.
2916         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
2917         inclusion.
2918         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
2919         * m4/debug.c (m4_debug, trace): Moved...
2920         * m4/m4private.h (struct m4): ...to fields of this struct.
2921         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
2922         for the new fields.
2923         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
2924         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
2925         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
2926         * m4/m4module.h (m4_context_field_table): Add entries for new
2927         debug_file and trace_messages fields.
2928         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
2929         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
2930         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
2931         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
2932         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
2933         (m4_is_debug_bit): New macro to simplfy checks against the debug
2934         bits above.
2935         (m4_trace_format, m4_trace_header, m4_trace_flush)
2936         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
2937         prototypes.
2938         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
2939         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
2940         * m4/macro.c (trace_format, trace_header, trace_flush)
2941         (trace_prepre, trace_pre, trace_post): ...to these newly static
2942         functions, since they are only ever used from this file.  Changed
2943         all callers.
2945 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
2947         Change the macros for checking syntax so that matching against
2948         multiple possible syntax classes can be done with a single
2949         comparison some of the time.  The various classes are now bits of
2950         an int that can be checked with bitwise logic operators.
2952         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
2953         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
2954         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
2955         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
2956         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
2957         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
2958         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
2959         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
2960         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
2961         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
2962         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
2963         Replace all calls with invocations of these...
2964         (m4_is_syntax, m4_has_syntax): ...New macros.
2965         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
2966         is no longer required with new macros.  Changed all callers.
2968 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
2970         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
2971         values are returned as part of the internal interface, so they
2972         need to be moved...
2973         * m4/private.h: ...to here.
2974         * m4/macro.c (expand_token): Check for out of range
2975         m4_peek_input() results before looking up in the syntax table.
2976         (collect_arguments): Ditto.
2978         * NEWS: Note `$' syntax class.
2980 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
2981             Gary V. Vaughan  <gary@gnu.org>
2983         Conform to POSIX if the POSIXLY_CORRECT environment is set.
2984         --traditional `define' now smashes all the definitions.
2986         * NEWS: Explain this.
2987         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
2988         (Extensions): Explain that extensions that are incompatible with
2989         POSIX are disabled if POSIXLY_CORRECT is set.
2990         (Incompatibilities): Remove.
2991         (Define, Other Incompat): Explain difference
2992         between GNU and POSIX behavior of define, pushdef, popdef.
2993         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
2994         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
2995         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
2996         (m4_get_posixly_correct_opt): New macro.
2997         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
2998         POSIXLY_CORRECT.
2999         * modules/m4.c (builtin_functions): defn now takes any number of args.
3000         (builtin_define): Smash all the definitions if
3001         POSIXLY_CORRECT.
3002         (builtin_defn)): Allow any number of arguments.
3003         (builtin_undivert): Do not allow nonnumeric arguments
3004         if POSIXLY_CORRECT.
3005         * src/main.c (main): Set posixly-correct behavior if either
3006         POSIXLY_CORRECT is set, or if -G is given.
3007         * tests/builtins.at: New test for smashed definitions.
3009 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
3011         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
3012         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
3013         not to slow the parser down.
3014         (M4__IS_STRING): New macro to test string syntax class membership.
3015         * m4/syntax.c: Adjust docucomment.
3016         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
3017         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
3018         * m4/input.c (init_builtin_token): Comment typo.
3019         (m4__next_token): Comment typo.
3020         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
3021         by using the new M4__IS_STRING macro.
3022         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
3023         variable references in macro expansions.
3025         * doc/m4.texinfo (Eregexp and Regexp): Typo.
3026         (Epatsubst and Patsubst): Typo.
3027         (Eval): Typo.
3029 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
3031         Move the global variables that pertain to syntax to a new `struct
3032         m4_syntax_table', and then add one of these to `struct m4'.  The
3033         ripple effect through the code to both change formerly global
3034         references, and make sure a suitable context is available in
3035         lexical scope is disproportionately large compared to the size of
3036         the change proper.  This change is a large part of decoupling
3037         syntax.c from the rest of the code that uses it.
3039         * m4/m4private.h (struct m4): Add a syntax field.
3040         * m4/m4.c (m4_create): Initialise it,
3041         (m4_delete): Recycle it.
3042         (m4_get_symtab): Remove hand coded version...
3043         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
3044         callers.
3045         * m4/m4module.h (m4_context_field_table): Add an extra field so we
3046         can generate m4_get_symbol_table.  Add a new row for
3047         m4_get_syntax_table.
3048         (M4SYNTAX): Syntactic sugar for module writers.
3049         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
3050         (m4_syntax_table): New home for syntax related formerly global
3051         variables.
3052         * m4/m4private.h (struct m4_syntax_table): Define it.
3053         * m4/input.c (m4_input_init): Initialisation of these formerly
3054         global variables moved...
3055         * m4/syntax.c (m4_syntax_create): ...to here.
3056         * m4/input.c (m4_input_exit): And similarly, recycling of the
3057         memory used by those values moved...
3058         * m4/syntax.c (m4_syntax_delete): ...to here.
3059         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
3060         Moved to m4/m4private.h.
3061         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
3062         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
3063         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
3064         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
3065         objects.  Changed all callers that used to directly access the
3066         global equivalents.
3067         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
3068         Removed and incorporated into m4_syntax_table structure.
3069         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
3070         * m4/syntax.c (m4_set_syntax): Now returns an error status,
3071         instead of requiring a `struct m4' to generate its own errors.
3072         Changed all callers.
3073         * src/main.c (main): Now that the syntax table is initialised as
3074         part of m4_create, we have to manually wipe the syntax entries if
3075         we are about to read a frozen file.
3077 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
3079         * doc/STYLE: Added notes on callback naming schemes.
3081         * m4/module.c (m4_set_module_macro_table)
3082         (m4_set_module_builtin_table): Declarations weren't changed when
3083         definitions were renamed on 2003-06-19.
3085         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
3086         neither used nor particularly appropriate since it exposes the
3087         internal workings of the hash module.  I haven't yet decided
3088         whether to remove it entirely.
3090 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
3092         Two related changes, and a huge knockon effect throughout the
3093         source: Moved the option variables out of global space and into
3094         `struct m4'; made `m4_symtab' a real datatype, so that its api
3095         is not marred passing `struct m4' around just so it can decide
3096         whether to keep traced symbol names or not.  Added setters and
3097         getters for the formerly global option variables, and obviously
3098         changed a vast number of functions to take a `struct m4' and use
3099         the getter funcs to find option values.
3101         * m4/utility.c (interactive, sync_output, debug_level)
3102         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
3103         (max_debug_argument_length, warning_status, nesting_limit)
3104         (discard_comments): Removed.
3105         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
3106         (debug_level, max_debug_argument_length, prefix_all_builtins)
3107         (suppress_warnings, discard_comments, interactive, sync_output):
3108         Removed from here...
3109         * m4/m4private.h (struct m4): ...and equivalent fields added to
3110         this structure.
3111         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
3112         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
3113         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
3114         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
3115         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
3116         macros for the new fields.
3117         * m4/m4module.h (m4_context_field_table)
3118         (m4_context_opt_bit_table): Helper macros used to generate
3119         prototypes, setters and getters for new option fields
3120         consistently.
3121         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
3122         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
3123         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
3124         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
3125         (m4_get_interactive_opt, m4_get_sync_output_opt)
3126         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
3127         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
3128         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
3129         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
3130         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
3131         setter and getter functions generated by cpp from
3132         m4_context_field_table and m4_context_opt_bit_table, exported as
3133         part of the module api.  Changed all callers.
3134         * m4/symtab (struct m4_symtab): Used as the concrete type for
3135         m4_symtab now.
3136         (m4_symtab_create): Allocate and initialise a new struct.
3137         (m4_symtab_apply): New function that works like m4_hash_apply, but
3138         with different callbacks specific to symbol tables.  Changed all
3139         callers.
3140         (symbol_destroy, arg_destroy, arg_copy): Renamed
3141         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
3142         they have unused parameters for a reason!
3143         (dump_symbol_CB): New callback to dump the contents of a single
3144         symbol.
3145         (symtob_dump): Rewritten in terms of dump_symbol_CB.
3146         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
3147         Changed all callers.
3148         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
3149         of the contained `m4_symtab' at the `no_gnu_extensions' field.
3150         Although I'm not convinced these semantics are correct, they are
3151         at least consistent with how things were before this delta.  Also
3152         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
3154 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
3156         Tie down the interface to libm4 some more.  Make more structures
3157         opaque to modules by moving them to m4private.h, and writing
3158         setters and getters.  To win back the speed penalty for doing this
3159         also wrote macroized versions that do know about structure layout
3160         in m4private.h and #include that file into modules when NDEBUG is
3161         defined at compile time.  There are still some accessor macros in
3162         m4private.h that need to go, but that is not necessary to clean
3163         the module api up.
3165         * m4/m4module.h (m4_symbol_type): Moved...
3166         * m4/m4private.h (m4__symbol_type): ...to here.
3167         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
3168         (m4_set_symbol_traced, m4_set_symbol_name_traced)
3169         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
3170         (m4_get_symbol_func, m4_symbol_value_create)
3171         (m4_symbol_value_delete, m4_set_symbol_value_text)
3172         (m4_set_symbol_value_func): New exported api to symbols.
3173         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
3174         and m4_is_symbol_value_func.
3175         * m4/m4module.h: Prototype these guys.
3176         * m4/module.c (m4_set_module_macro_table)
3177         (m4_set_module_builtin_table): Make these static, there is no
3178         reason to pollute the api with them.
3179         * m4/m4private.h: Reformatting.
3180         (m4_get_symtab): Only define when NDEBUG is defined.
3181         (m4_get_symbol_value, m4_get_symbol_traced)
3182         (m4_set_symbol_traced, m4_set_symbol_name_traced)
3183         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
3184         (m4_get_symbol_func, m4_symbol_value_create)
3185         (m4_symbol_value_delete, m4_set_symbol_value_text)
3186         (m4_set_symbol_value_func): Macro implementations of the new
3187         functions when NDEBUG is defined.
3188         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
3189         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
3190         Superceded by the above.  All callers changed.
3191         (M4ARG): Removed.  This is no longer different to the
3192         m4/m4module.h definition.
3193         * modules/gnu.c, modules/m4.c: Only include m4private.h when
3194         NDEBUG is defined.  That way we exercise the same (albeit slower)
3195         api that external modules must use.
3197 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
3199         Renamed some of the types and their accessors to make more sense.
3200         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
3201         has a stack of SYMBOL_VALUEs.
3203         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
3204         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
3205         m4_get_symbol_value_type,  m4_get_symbol_value_text,
3206         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
3207         Changed all callers.
3208         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
3209         (m4_get_token_type): Renamed
3210         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
3211         to the internal api.
3212         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
3213         s/TOKEN_/VALUE_/
3214         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
3215         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
3216         (m4__token_type): Moved here from m4module.h.
3217         (m4__next_token): Renamed from m4_next_token.
3218         * m4/symtab.c: Removed some of the parameterised macro support
3219         functions for modularisation later.
3220         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
3221         m4_hash_dup to perform a true deep copy of the SRC.
3222         (arg_copy): Callback for m4_symbol_value_copy.
3223         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
3224         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
3225         m4_get_symbol_value_func.  Changed all callers.
3227 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
3229         Tidy up style of hash.[ch] in accordance with doc/STYLE.
3231         * m4/hash.c: Internal symbol renaming and formatting.
3232         (m4_hash_dup): New function to facilitate deep copies of hash
3233         tables.
3234         (m4_hash_apply_func): Returns a void* now, which is a richer type
3235         for returning exceptions (NULL means keep going).
3236         (m4_hash_apply): Ditto.
3237         * m4/hash.h: Declare exported symbols with an explicit extern.
3238         Reformated.
3240 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
3242         Still refactoring furiously.  This delta represents a change in
3243         semantics to symtab.c.  Instead of building temporary m4_tokens
3244         in the caller, and copying fields in the methods, we now create
3245         the actual m4_token for hashing in the caller so the methods just
3246         slot them in directly.  Also, this means that we don't lookup a
3247         symbol and get back an allocated but VOID token to copy fields
3248         into, we create the token we want to push and pass that to
3249         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
3250         a few other small changes to stop knowledge of the implementation
3251         of symtab.c leaking out into other files.
3253         * m4/macro.c (expand_argument): Comment typo corrected.
3254         * m4/symtab.c (symtab_fetch): New function to fetch the address of
3255         an interned symbol.
3256         (m4_symbol_pushdef): Take an extra value parameter and use this
3257         directly as the new top of the value stack.  All callers changed
3258         to build a token and pass responsibility for memory in, rather
3259         than copying as we used to.
3260         (m4_symbol_define): Also use the new value parameter directly as a
3261         replacement for the top of the value stack.  All callers changed
3262         to build a token as above.
3263         (m4_set_symbol_traced): New function to set the traced bit on the
3264         named symbol, creating it if necessary.
3265         (symbol_popval): The guts of the old m4_symbol_popdef.
3266         (m4_symbol_popdef): Use it.
3267         * m4/builtin.c (m4_symbol_set_token): Removed,
3268         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
3269         replaced...
3270         * m4/module.c (m4_set_module_builtin_table)
3271         (m4_set_module_macro_table): ...with these more orthogonal
3272         functions.
3273         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
3274         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
3275         required.
3276         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
3277         (m4_arg_signature_parse): Moved...
3278         * m4/symtab.c: ...to here.
3279         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
3280         screw something up. Moved...
3281         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
3282         actually does a proper deep copy of source to dest.
3284 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
3286         Further refactoring to stabilise the module API.  Renaming some
3287         functions for orthogonality, and judicious definition migration to
3288         move things out of the set of exported symbols.
3290         * doc/STYLE: New file.  Notes on coding style.
3291         * m4/m4module.c: Updated bitrotted docucomment at the top of the
3292         file.
3293         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
3294         m4_get_module_name, m4_get_module_builtin_table,
3295         m4_get_module_macro_table which are verb phrases.  Changed all
3296         callers.
3297         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
3298         Moved to...
3299         * m4/module.c (m4_set_module_builtin_table)
3300         (m4_set_module_macro_table): ...here, and renamed. Changed all
3301         callers.
3302         * m4/m4module.c (m4_module_data): This...
3303         * m4/m4private.c (struct m4_module_data): ...and this...
3304         * m4/module.c (module_data) ...consolidated here and no longer
3305         exported.  Changed all callers.
3307 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
3309         Begin work on lifting the curse of the global variables.  To start
3310         with create a `struct m4' context container, and replace
3311         `m4__symtab' with `context->symtab' throughout.  This means
3312         initialising a context container in main, and adjusting many
3313         functions between main and the module entry points so that the
3314         container gets passed through.  It would have been nice to
3315         defer this until after 1.5, but it has a major effect on the
3316         user's module writing ABI, so it needs to be addressed now - at
3317         least in the areas that impact the ABI.  An interrelated change
3318         in the symtab API removes the dependency on a global symbol table,
3319         and instead focuses on a passed table (from the context
3320         container).
3322         * TODO: Reminders for finishing context functionality.
3323         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
3324         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
3325         global variables and eventually allow m4 to be reentrant.
3326         * m4/m4private.h (m4): Define the new structure here...
3327         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
3328         don't carry the overhead of a function call.
3329         * m4/m4module.h: Prototype extern functions from m4/m4.c.
3330         (m4): Declare type for new struct m4 objects.
3331         (M4SYMTAB): User macro to ease finding the symbol table for the
3332         current context for module developers.
3333         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
3334         verb.
3335         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
3336         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
3337         (m4_call_macro, m4_dump_symbols, m4_expand_input)
3338         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
3339         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
3340         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
3341         m4* context parameter. Changed definitions and all callers.
3342         (m4_symtab): Alias for m4_hash to decouple the
3343         m4_symtab api from m4_hash.
3344         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
3345         m4_hash.
3346         (m4_symtab_create): New function to return an initialised
3347         m4_symtab.
3348         (m4_symtab_delete): New function to delete an m4_symtab's memory.
3349         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
3350         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
3351         instead of simply using the global m4__symtab.  Changed
3352         definitions and all callers.
3353         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
3354         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
3355         * src/main.c (main): Create a context and use that instead of the
3356         former global m4__symtab.
3358 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
3360         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
3361         to the callback.  Callbacks should not need to hardcode the
3362         hashtable they are working from, nor should we have to waste the
3363         userdata parameter to pass the table in.
3364         * m4/hash.h (m4_hash_apply_func): Require the initial table
3365         parameter.
3366         * m4/symtab.c (symtab_destroy): Use the passed table instead
3367         of hardcoding m4__symtab.
3368         (m4_symbol_popdef): Don't use the userdata parameter to pass the
3369         table to arg_destroy.
3370         (arg_destroy): Use the hash parameter, ignore userdata.
3371         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
3372         prototype.
3373         (traceon, traceoff): Call set_trace with the extra initial
3374         parameter.
3376 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
3378         More refactoring to stabilise the module api, this time for
3379         symtab.c.  Additionally, start to pay attention to function names
3380         that don't contain a verb like they should.
3382         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
3383         wrapper for m4_hash_apply to decouple the symtab module from the
3384         hash module.
3385         (m4_symbol_builtin, m4_symbol_macro): Renamed to
3386         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
3387         callers.
3388         (m4_symbol_delete): Create a macro version to save a function
3389         call.
3390         (m4_token_t, m4_data_t): These violate the POSIX reserved
3391         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
3392         all callers.
3393         (m4_token_type): Renamed to m4_token_get_type.
3394         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
3395         (m4_symtab_exit): Removed from the exported module
3396         api...
3397         * m4/m4private.h (m4__symtab, m4__symtab_init)
3398         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
3399         renamed and added to the internal api. Changed all callers.
3400         (m4_symtab_apply): A faster macro version of the function for
3401         users of the internal api.
3402         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
3403         symbol_destroy and arg_destroy.
3404         (symtab_debug): Added a prototype.
3405         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
3406         so that callers in this file get the faster macro versions from
3407         m4/m4private.h.
3409 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
3411         Refactoring modules to rationalise the API into an external
3412         documented (eventually!) API for use by modules in the `m4_'
3413         namespace declared in m4/m4module.h, an internal API between the
3414         source files we ship (including our shipped modules) in the `m4__'
3415         namespace declared in m4/m4private.h and making the rest as
3416         cohesive as possible with liberal use of the `static' keyword.
3417         This change represents an audit to m4/module.c along these
3418         guidelines.
3420         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
3421         Removed.  No longer used.
3422         (m4_module_close): Removed prototypes.
3423         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
3424         from the exported module api...
3425         * m4/m4private.h (m4__module_init, m4__module_open)
3426         (m4__module_exit): ...and renamed and added to the internal api.
3427         Changed all callers.
3428         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
3429         Centralised definitions after renaming...
3430         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
3431         (M4_FINISH_SYMBOL): ...and removing from here.
3432         (m4_module_dlerror, m4_module_remove, m4_module_close)
3433         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
3434         module_remove, module_close and caller_id.
3435         (MODULE_SELF_NAME): New macro to make reporting self errors
3436         easier.
3437         (m4_module_load, module_close, module_remove): Use it.
3438         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
3439         name.
3440         * src/main.c (main): Use it.
3442 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
3444         * README: Remove references to --enable-changeword, which has been
3445         removed from the code.
3447 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
3449         Getting rid of the annoying bug with configure --enable-debug,
3450         which spewed -e: command not found errors.  This was an interaction
3451         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
3452         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
3453         branch-1-5) to get the full fix.
3455         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
3456         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
3457         and then use the probed value of $SED.
3458         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
3459         this, it messes up the AC_REQUIRE stack.
3461 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
3463         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
3464         the destroy callback.
3465         (m4_arg_destroy): Use the hash address to free the hash node key
3466         field.
3468 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
3470         First cut at formal parameters in macros.
3472         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
3473         * m4/xstrzdup.c: New file.
3474         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
3475         associative array of parameter names to details.
3476         (m4_symbol_token): Capture macro names with parameter lists.
3477         (m4_arg_signature_parse): And build an associative array to hang
3478         from the symbol structure to map names to details.
3479         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
3480         m4_hash_resize idiom.  Now that we potentially add a little hash
3481         table to many of the entries in the symbol table, added an extra
3482         arg to set the initial size.  Changed all callers.
3483         (m4_hash_apply): New function that is basically a generalised
3484         version of...
3485         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
3486         all callers to call m4_hash_apply instead.
3487         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
3488         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
3489         m4_arg_signature association that might be attached to the symbol,
3490         * m4/hash.h (m4_hash_apply_func): Replacement type for...
3491         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
3492         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
3493         parameter lists.
3494         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
3495         (M4_IS_IDENT): Detect characters that can be safely used in
3496         parameter names.
3497         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
3498         * m4/macro.c: Corrected grammar in some comments.  Use `token'
3499         rather than `td' for m4_token variables.
3500         (m4_process_macro): If we find a dollar followed by some
3501         M4_IS_IDENT characters, replace that with the contents of the argv
3502         entry with offset stored in the m4_token_arg associated with the
3503         collected identifier.
3505 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
3507         Begin preparations for supporting formal parameters in m4 macros.
3509         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
3510         the details of a formal parameter.
3511         (m4_token): Add an arg_signature member to hold a hash table for
3512         looking up formal parameters.
3513         * m4/input.c: Update more bitrotted comments.
3514         (m4_push_builtin): Initialise arg_signature member.
3515         (init_builtin_token): Copy arg_signature member.
3516         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
3517         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
3518         replace...
3519         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
3520         (m4_macro_pushdef, m4_macro_define): ...these, And...
3521         (m4_symbol_token): ...wrapped around this new function, which
3522         vastly simplifies the arguments required by the functions it
3523         replaces.
3524         Changed all callers.
3526 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
3528         * m4/macro.c: Format changes.
3530 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
3532         * m4/input.c: Updated various bitrotted comments.
3533         (m4_push_builtin): Just pass the whole m4_token, rather than
3534         extracting all the fields in the caller.  This also allows us to
3535         check the token type for consistency.
3536         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
3537         Renamed to builtin_funcs, builtin_peek, builtin_read,
3538         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
3539         the code.  Changed all callers.
3540         (struct input_block): Similarly renamed u_m member to u_b, and
3541         changed all callers.
3542         (m4_next_token): Use bzero to initialise the data fields.
3543         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
3545 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
3547         These changes were necessary to get m4 to build on my iBook
3548         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
3549         (GCC) 3.1 20020420 (prerelease)":
3551         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
3552         inclusion of module loader headers.
3553         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
3554         * m4/Makefile.am: Ditto.
3555         (libm4_la_LIBADD): Added $(LTLIBINTL).
3556         * m4/utility.c (program_name): Removed declaration in favour of
3557         the one already in error.c!
3558         * m4/m4module.h (program_name): Define to program_invocation_name
3559         when using GNU C library. Use an explicit extern declaration.
3560         (interactive, sync_output, debug_level, hash_table_size)
3561         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
3562         (suppress_warnings, warning_status, nesting_limit, discard_comments)
3563         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
3564         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
3565         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
3566         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
3567         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
3568         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
3569         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
3570         (m4_current_line, m4_current_diversion, m4_output_current_line):
3571         Don't rely on default, use an explicit extern.
3572         * m4/error.h (error, error_at_line, error_print_progname)
3573         (error_message_count, error_one_per_line): Ditto.
3574         * m4/ltdl.c: Update from CVS libtool.
3575         * m4/ltdl.h: Ditto.
3576         * commit: Update from CVS cvs-utils.
3578 2002-11-04  gettextize  <bug-gnu-gettext@gnu.org>
3580         * po/Makefile.in.in: Upgrade to gettext-0.11.5.
3581         * po/boldquot.sed: New file, from gettext-0.11.5.
3582         * po/en@boldquot.header: New file, from gettext-0.11.5.
3583         * po/en@quot.header: New file, from gettext-0.11.5.
3584         * po/insert-header.sin: New file, from gettext-0.11.5.
3585         * po/quot.sed: New file, from gettext-0.11.5.
3586         * po/remove-potcdate.sin: New file, from gettext-0.11.5.
3587         * po/Rules-quot: New file, from gettext-0.11.5.
3589 2002-11-04  Akim Demaille  <akim@epita.fr>
3591         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
3592         running m4 itself.
3593         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
3595 2002-11-04  Akim Demaille  <akim@epita.fr>
3597         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
3599 2002-11-04  Akim Demaille  <akim@epita.fr>
3601         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
3602         used as `external', and Libtool 1.4.3.
3603         (LINGUAS): Remove.
3604         (LTLIBOBJS): Don't play with it.
3605         * intl/: Remove.
3606         * Makefile.am (SUBDIRS): Remove intl.
3607         (ACLOCAL_AMFLAGS): Add -I config.
3608         (EXTRA_DIST): Add config/config.rpath.
3609         * po/LINGUAS: New.
3610         * po/Makevars: New.
3611         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
3613 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
3615         Preparations for refactoring syntax tables to allow reverse
3616         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
3617         speed of normal lookups in an array of unsigned short.
3619         * m4/input.c (single_quotes, single_comments, use_macro_escape):
3620         Moved from here...
3621         * m4/m4private.h (m4__single_quotes, m4__single_comments,
3622         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
3623         is for internal symbols which unavoidably pollute the global
3624         namespace, but are not published APIs.
3625         Adjusted all callers.
3626         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
3627         m4_set_comment, m4_set_syntax, set_syntax_internal,
3628         unset_syntax_attribute): Moved from this file...
3629         * m4/syntax.c: New. ...to this file.
3630         Also added an m4_syntax_exit stub for orthogonality.
3631         * src/main.c (main): Use it.
3632         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
3633         * m4/m4module.h: Reformatting.  New prototypes.
3635 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
3637         * bootstrap (aclocal_apiversion): The aclocal apiversion is
3638         distinct from the automake release number (in that the apiversion
3639         apparently has no micro-version-component).
3640         (aclocal_apilibdir): Use it.
3642 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
3644         * m4/hash.c (m4_hash_resize): New function.
3645         * m4/hash.h: Add prototype.
3646         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
3647         benchmarking to find a good value for, say, autoconf.  This is
3648         already a little quicker than before for me.
3650         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
3651         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
3652         and reenamed.
3653         * m4/hash.h: Adjust prototypes.
3655 2002-01-22  Akim Demaille  <akim@epita.fr>
3657         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
3658         APIVERSION scheme.
3659         * tests/Makefile.am (package.m4): New.
3660         * tests/atlocal.in: Adjust to CVS Autotest.
3661         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
3662         * configure.ac: LIBOBJ is a forbidden string.
3663         Simplify AM_INIT_AUTOMAKE invocation.
3664         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
3665         options.m4.
3667 2002-01-21  gettextize  <bug-gnu-utils@gnu.org>
3669         * po/Makefile.in.in: Upgrade to gettext-0.10.40.
3671 2001-10-19  Akim Demaille  <akim@epita.fr>
3673         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
3675 2001-10-19  Akim Demaille  <akim@epita.fr>
3677         * m4/input.c (m4_next_token): Display where was opened what is
3678         not closed.
3680 2001-10-19  Akim Demaille  <akim@epita.fr>
3682         * m4/macro.c (expand_argument): Display where was opened what is
3683         not closed.
3685 2001-10-18  Akim Demaille  <akim@epita.fr>
3687         * m4/input.c, modules/m4.c: Formatting changes.
3689 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
3691         * bootstrap: s/configure.in/configure.ac/
3693 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
3695         * m4/symtab.c (m4_symbol_destroy): This function calls
3696         m4_symbol_popdef, which recycles a symbols memory when the last
3697         definition is popped.  Since we were passing the address of the
3698         symbol name found in the symbol table, and it was being removed
3699         partway through m4_symbol_destroy() we were referencing freed
3700         memory for the balance of the function.  Now we take a copy of the
3701         symbol name tring and use that as a key into the symbol
3702         table... that way if the original symbol name is freed, the copy
3703         is still valid.
3705 2001-10-13  Akim Demaille  <akim@epita.fr>
3707         * m4/ltdl.c: Update.
3709 2001-10-13  Akim Demaille  <akim@epita.fr>
3711         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
3712         Don't gettextize internal error messages.
3714 2001-10-13  Akim Demaille  <akim@epita.fr>
3716         * tests/macros.at (Arity and defn): New failing test.
3717         (Arity, defn, and freeze): New.
3719         Fix `Arity and defn'.
3721         * m4/input.c (m4_push_macro): Don't forget the arity.
3722         * modules/m4.c (defn): Likewise.
3724 2001-10-13  Akim Demaille  <akim@epita.fr>
3726         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
3727         to...
3728         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
3729         (Propagation of traceon, Propagation of --trace): this new file.
3731 2001-10-13  Akim Demaille  <akim@epita.fr>
3733         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
3734         interface instead of (name, argc...).
3735         Upon failure, specify which argument was guilty.
3736         Adjust callers.
3738 2001-10-13  Akim Demaille  <akim@epita.fr>
3740         * modules/evalparse.c: Save translators' time: don't translate
3741         internal error messages.
3742         (m4_evaluate): Simplify/normalize error messages.
3743         * doc/m4.texinfo (Eval): Adjust.
3745 2001-10-13  Akim Demaille  <akim@epita.fr>
3747         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
3748         where no checking is needed.
3749         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
3750         interface instead of (name, argc...).
3751         Adjust callers.
3752         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
3753         elsewhere.
3755 2001-10-13  Akim Demaille  <akim@epita.fr>
3757         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
3758         exclude the builtin name from the count.
3759         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
3760         calling ifelse with a single argument is valid.
3761         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
3762         with 1 and 2 args, mostly to strengthen the test suite.
3764 2001-10-13  Akim Demaille  <akim@epita.fr>
3766         * m4/output.c (m4_make_diversion, m4_insert_file)
3767         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
3769 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
3771         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
3772         since we call these things builtins in the rest of the code!
3774         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
3776 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
3778         Rather than forcing each builtin definition to manage its own
3779         argument range checking, tabulate the maxima and minima for all
3780         builtins in each module.  This forces us to consider what the
3781         valid ranges for each builtin should be, and moves the checking
3782         code out of each builtin implementation and into the builtin
3783         caller infrastructure.
3785         * m4/m4module.h (struct m4_builtin): Add argument minima and
3786         maxima.
3787         * m4/m4private.h (struct m4_token): Reflect them here too.
3788         * m4/input.c (struct input_block): ...and here.
3789         (m4_token_copy): New function for token copying.
3790         (init_macro_token): Copy them from a token to the input stack.
3791         (m4_next_token): Don't forget to initialise them for text
3792         macros.
3793         * m4/macro.c (expand_argument): Use m4_token_copy, and also
3794         check argument counts before calling the builtin handler.
3795         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
3796         (m4_symbol_macro): Likewise.
3797         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
3798         parameters.  Updated all callers.
3799         (m4_builtin_define): Ditto.
3800         (m4_macro_pushdef, m4_macro_define): Ditto.
3801         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
3802         * modules/evalparse.c:  Declare argument counts for defined
3803         builtins and remove explicit calls to m4_bad_argc().
3804         * modules/gnu.c: Ditto.
3805         * modules/load.c: Ditto.
3806         * modules/m4.c: Ditto.
3807         * modules/modtest.c: Ditto.
3808         * modules/mpeval.c: Ditto.
3809         * modules/perl.c: Ditto.
3810         * modules/shadow.c: Ditto.
3811         * modules/stdlib.c: Ditto.
3812         * modules/time.c: Ditto.
3813         * TODO: Updated.
3815 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
3817         The trace semantics now attach the trace bit to a symbol name.
3818         For as long as a traceon(`foo') is active, calls to foo will be
3819         traced regardless of intervening undefines or module unloads.
3820         Fixed the flag propogation issues differently to the fixes
3821         reverted with the last attempt at nailing down trace:
3823         * m4/m4private.h:  This file is not visible outside of the m4
3824         source tree, so I removed all the `M4_' and `m4_' prefixes to save
3825         on typing.  Updated all clients.
3826         (m4_token): New typedef contains the fields that need to be passed
3827         around with the low level tokeniser.
3828         (m4_token_data):  Removed.
3829         (m4_symbol): Now contains the traced flag again.
3830         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
3831         the trace bit set.  This change is contained entirely within this
3832         module and doesn't leak out into the callers.  Updated all
3833         clients.
3834         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
3835         new fields in m4_token.  Updated all clients.
3836         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
3837         that `groks_macro_args' and `blind_if_no_args' flags are retained
3838         when defn() results are passed around in m4 code.  Updated all
3839         callers.
3840         (m4_builtin_define): Ditto.
3841         (m4_macro_pushdef, m4_macro_define): Ditto.
3842         * m4/input.c (struct input_block): Add a flags field to facilitate
3843         the above.
3844         (m4_push_macro):  ...use it.
3845         (init_macro_token):  Retrieve it.
3846         (m4_next_token): Initialise it.
3847         * m4/macro.c (expand_argument):  Copy it.
3848         * m4/m4module.h: Adjust.
3849         * tests/builtins.at:  Adjust the expected output of the trace
3850         tests to reflect the change in semantics.
3851         * tests/modules.at (modules: trace):  Check that unloading a
3852         module which supplies a traced symbol definition doesn't lose te
3853         trace bit.
3855 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
3857         * modules/gnu.c (m4_macro_table): Display the timetamp when
3858         expanding __m4_version__.
3860         * configure.ac (--with-modules): Forgot a comma in the
3861         AC_HELP_STRING parameter list.
3863 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
3865         * bootstrap: Remove aclocal.m4t when it is no longer required.
3867 2001-10-05  Akim Demaille  <akim@epita.fr>
3869         * tests/Makefile.am: Adjust for gnuprog2.
3870         * tests/m4.in: There can be a leading path.
3871         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
3872         * tests/testsuite.at: Adjust to the most recent Autotest.
3873         (AT_CHECK_M4_FILTER): Fix and rename as...
3874         (AT_TEST_M4): this.
3875         * tests/others.at: Use it.
3877         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
3878         variable in shell scripts, one uses `$'...
3880 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
3882         * configure.ac: `rm -f $m4_getopt_h' was lost.
3884 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
3886         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
3887         time.  Define it for config.h in order to...
3888         * src/main.c (main): ...display the timestamp for --version.
3890 2001-10-04  Akim Demaille  <akim@epita.fr>
3892         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
3893         previous builtins `regexp' and `patsubst'.
3894         (regexp, patsubst): Use them.
3895         (eregexp, epatsubst): New builtins.
3896         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
3897         (Epatsubst and Patsubst, Eregexp and Regexp): these.
3898         (Extensions): More info on REs.
3900 2001-10-04  Akim Demaille  <akim@epita.fr>
3902         * modules/modtest.c (init_handler): Consistently output to stderr.
3903         (finish_handler): New.
3904         (test): The `if' is an `assert'.
3905         * tests/modules.at: Adjust.
3907 2001-10-04  Akim Demaille  <akim@epita.fr>
3909         * m4/utility.c (m4_bad_argc): Detail the mismatches.
3911 2001-10-01  Akim Demaille  <akim@epita.fr>
3913         * tests/generate.awk: Tag the tests with `documentation'.
3914         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
3915         Use the make the existing modtest tests more uniform, and complete
3916         the set of possibilities.
3918 2001-10-01  Akim Demaille  <akim@epita.fr>
3920         * config/gmp.m4: Consult the user before using GMP: use
3921         --without-gmp.
3922         * configure.ac: Adjust.
3923         * modules/gmp.c: No protection needed as the module is not built
3924         if GMP is not used.
3926 2001-10-01  Akim Demaille  <akim@epita.fr>
3928         * tests/generate.awk: Remove debugging code.
3929         (fatal): Specify the current location.
3931         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
3932         * modules/gnu.c, modules/m4.c: Use M4ARG.
3934 2001-10-01  Akim Demaille  <akim@epita.fr>
3936         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
3937         (m4_regexp_compile): New.
3938         (regexp, patsubst): Use it.
3940 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
3942         Reinstate the memory handling improvements from the patch I just
3943         reverted.  Relevant ChangeLog entries repeated here:
3945         * m4/module.c (m4_module_remove): New function that holds the core
3946         of the old m4_module_unload.
3947         (m4_module_unload): Use it.
3948         (m4_module_unload_all): When we know the modules will never be
3949         used again (i.e. on exit), free up as much module memory as
3950         possible.  There are still some artifacts from resident modules
3951         living inside ltdl.c, but everything else is freed.
3952         * m4/debug.c (m4_debug_exit): Free memory allocated in
3953         m4_debug_init().
3954         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
3955         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
3956         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
3957         * m4/m4module.h: Updated prototypes.
3958         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
3959         * m4/hash.h: Updated prototypes.
3960         * src/main.c (main): Use all these new functions to clean up as
3961         much memory as possible before exit.
3963 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
3965         Reverted my large patch for removing the old m4_symbol
3966         structure on 2001-09-20.  We are still not happy about the way
3967         trace works in conjunction with defn and undefine, and leaving
3968         the reverted patch active prevents us from moving the traced
3969         bit from the definition back to the symbol.
3971 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
3973         * configure.in: Moved to...
3974         * configure.ac: ...here.  Added a libtool like timestamped
3975         banner, and tidied up the libltdl cruft.
3976         * config/mkstamp: Script to extract a timestamp from ChangeLog.
3977         * modules/Makefile.am (INCLTDL):  Removed.  This is required
3978         only when libltdl is configured in a subdirectory.
3979         * src/Makefile.am: Ditto.
3980         (LIBADD_DL):  No need to add this again, libtool already knows
3981         that libm4.la depends on it.
3982         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
3983         them.
3985         * TODO: stackovf.c is basically broken.
3986         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
3988 2001-09-28  Akim Demaille  <akim@epita.fr>
3990         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
3992 2001-09-27  Akim Demaille  <akim@epita.fr>
3994         * tests/m4.in: Don't use short options.
3995         Simplify the stderr signature normalization.
3997 2001-09-27  Akim Demaille  <akim@epita.fr>
3999         tests/m4 shall be position independent.
4001         * tests/m4.in: New.
4002         * tests/m4: Remove.
4003         * tests/testsuite.at: No args to AT_INIT.
4004         * configure.in, tests/Makefile.am: Adjust.
4006 2001-09-22  Akim Demaille  <akim@epita.fr>
4008         Autotest has changed again.
4010         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
4011         (package.m4): Remove.
4012         * configure.in: Adjust to LIBADD_GMP.
4014 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
4016         * config/gmp.m4 (AC_ARG_WITH): Removed.
4017         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
4018         (AC_LIB_GMP): When performing a test compile against libgmp,
4019         include the header gmp.h if possible, and link against -lgmp.  If
4020         they both work define USE_GMP.
4021         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
4022         (mpeval_LTX_init_func): Complain on load that there was no libgmp
4023         at compile time.
4025 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
4027         * m4/evalparse.c: Moved to...
4028         * modules/evalparse.c:  ...here.  This code is shared between
4029         modules/mpeval.c and modules/m4.c, so there is no need to pollute
4030         the libm4 API with its details.  Moderately rewritten to interface
4031         into its clients more simply.
4032         * m4/eval.c: Deleted.  Migrated functionality to...
4033         * modules/m4.c: ...here.
4034         (builtin_eval):  Implemented in terms of the new interface style.
4035         * modules/mpeval.c (builtin_mpeval): Ditto.
4036         * m4/m4module.h: Removed references to the former m4/eval.c.
4037         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
4038         (EXTRA_libm4_la_SOURCES): Deleted.
4039         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
4040         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
4042 2001-09-20  Akim Demaille  <akim@epita.fr>
4044         * config/gmp.m4 (AM_WITH_GMP): Rename as...
4045         (AC_LIB_GMP): this.
4046         By default, use gmp.
4047         Massive revamping.
4048         * configure.in: Adjust.
4049         Use Automake conditionals for USE_GMP.
4050         Always compute sizeof (long long int).
4051         This was a bug BTW, as `eval' (not `mpeval') depends on it:
4052         before, it was used _only_ if mpeval was not activated.
4053         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
4054         (mpeval_la_LIBADD): New macros.
4055         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
4056         Indent.
4057         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
4058         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
4059         WITH_GMP.
4061 2001-09-20  Akim Demaille  <akim@epita.fr>
4063         * tests/Makefile.am (package.m4): New.
4064         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
4066 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
4068         More cleanup.  After the last patch, m4_symbol holds nothing but
4069         the head of a chain of m4_token_data.  So I have removed the old
4070         m4_symbol, so that m4_token_data chains are stored directly in the
4071         value cell of a hash table node.  But there's more... m4_symbol
4072         was a more natural name for the symbol value cell, and now that it
4073         is gone I have renamed the former m4_token_data structure to
4074         m4_symbol.  This change turned out to be a pig to get right, since
4075         the original code didn't need to modify the value cell itself,
4076         since changing the chain happened inside the m4_symbol that used
4077         to be returned -- I had to pass the address of the value cell
4078         across various function calls, incase the head value changed.  I
4079         also tightened up the memory management to help me find a nasty
4080         memory corruption bug that took me all night to track down...
4082         * m4/m4private.h (struct m4_symbol): Removed.
4083         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
4084         all references.
4085         * m4/hash.c (m4_hash_iterator_value): Return the address of the
4086         value cell.  Updated all callers.
4087         * m4/symtab.c: Took advantage of the simplification in the data
4088         structures to rewrite a lot of this file more simply.  There is
4089         still some room for optimisation here, but we should tackle that
4090         systematically closer to the release.
4092         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
4093         revealed.  This version is ahead of CVS libtool until I get chance
4094         to flush my changes.
4095         * m4/module.c (m4_module_remove): New function that holds the core
4096         of the old m4_module_unload.
4097         (m4_module_unload): Use it.
4098         (m4_module_unload_all): When we know the modules will never be
4099         used again (i.e. on exit), free up as much module memory as
4100         possible.  There are still some artifacts from resident modules
4101         living inside ltdl.c, but everything else is freed.
4102         * m4/debug.c (m4_debug_exit): Free memory allocated in
4103         m4_debug_init().
4104         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
4105         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
4106         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
4107         * m4/m4module.h: Updated prototypes.
4108         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
4109         * m4/hash.h: Updated prototypes.
4110         * src/main.c (main): Use all these new functions to clean up as
4111         much memory as possible before exit.
4113 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
4115         The `traced' flag needs to be attached to the definition of a
4116         symbol rather than the current symbol containing the definition.
4117         Implementing this showed up some long standing post 1.4 bugs in
4118         flag propogation which I also fixed.
4120         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
4121         (struct m4_token_data): And add it back in here.
4122         * m4/input.c (init_macro_token): Propogate the traced flag
4123         correctly.
4124         * m4/macro.c (expand_argument): Ditto.
4125         * tests/builtins.at (trace2, trace3): New tests based on Akim's
4126         sadistic email ;-)
4128 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
4130         * m4/m4private.h (struct m4_token_data): Simplified by removing
4131         the redundant `traced' flag, and one level of structure nesting.
4132         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
4133         * m4/input.c (init_macro_token): No need to initialise removed
4134         `traced' field.
4135         * m4/macro.c (expand_argument): No need to copy it either.
4136         * m4/utility.c (m4_token_data_func_traced): Or provide an access
4137         function.
4139         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
4140         dependant on multiple symbols with the same key, so preserving
4141         relative symbol order in each bucket during resizing is no longer
4142         required.  The resize function is considerably faster as a result.
4144         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
4145         s/m4_symbol_insert/m4_symbol_define/g;
4146         s/m4_builtin_insert/m4_builtin_define/g;
4147         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
4149 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
4151         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
4152         commits, the m4_lookup_symbol dispatch function is split into
4153         specialised functions that must be called directly.
4155         * m4/m4module.h (m4_symbol_lookup_t): Removed.
4156         * m4/symtab.c (m4_lookup_symbol): Removed.
4157         (m4_symbol_builtin, m4_symbol_macro): New functions.
4158         * m4/builtin.c (m4_builtin_define): Split into...
4159         (m4_builtin_pushdef, m4_builtin_insert): ...these.
4160         (m4_macro_define): Split into...
4161         (m4_macro_pushdef, m4_macro_insert): ...these.
4162         * src/main.c (main): Set command line macros from `-D' parameters
4163         using `m4_macro_define'.
4165 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
4167         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
4168         this from m4_remove_table_reference_symbols().
4169         * m4/m4module.h, m4/module.c: Updated all references.
4171 2001-09-07  Akim Demaille  <akim@epita.fr>
4173         * modules/stdlib.c, modules/times.c: Misc cleanups.
4175 2001-09-07  Akim Demaille  <akim@epita.fr>
4177         * configure.in: We now need Autoconf 2.52e.
4178         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
4179         and `M4_SYMBOL_DELETE'.
4180         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
4181         * src/main.c (main): Adjust.
4183 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
4185         Fix the obstack.h problem once and for all!  At configure time we
4186         can test for a system supplied obstack.h:  depending on the
4187         result, we now generate system.h with an #include of the correct
4188         header.  As a bonus, I've also added a --with-included-obstack,
4189         incase the user doesn't like the system obstack for some
4190         reason... and also we can test the shipped obstack on a system
4191         that has oe of its own.  We also now need to be careful to add
4192         build directories to the include search path, since the generated
4193         system.h will be in the build tree.
4195         * configure.in (AC_CONFIG_FILES): Generate system.h from
4196         system-h.in.
4197         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
4198         include the system obstack header or the copy shipped with M4.
4199         Allow the user to override configure and force the build to use
4200         the shipped version.
4201         * m4/system-h.in: New file, template for...
4202         * m4/system.h: ...this.  Now deleted.
4203         * m4/m4module.h: Include system.h before everything else.
4204         * src/freeze.c: Ditto.
4205         * m4/Makefile.am (dist-hook): Remove generated system.h.
4206         (INCLUDES): Check builddir for generated headers before checking
4207         srcdir.
4208         * modules/Makefile.am (INCLUDES): Ditto.
4209         * src/Makefile.am (INCLUDES): Ditto.
4211 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
4213         * TODO: Remove the items that have been addressed already.
4215 2001-09-05  Akim Demaille  <akim@epita.fr>
4217         * src/main.c (main): Standardize --version.
4219 2001-09-05  Akim Demaille  <akim@epita.fr>
4221         * modules/format.c (format): Have a bigger `str'.
4223 2001-09-05  Akim Demaille  <akim@epita.fr>
4225         Rationalize warnings, reporting the macro name as if it were a
4226         program name, and assertions.
4228         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
4229         (M4WARN): New.
4230         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
4231         (m4_symbol_delete):
4232         Use assert for internal errors.
4233         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
4234         M4WARN.
4235         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
4236         M4WARN and assert.
4237         * tests/builtins.at (pushpop): Adjust.
4239 2001-09-05  Akim Demaille  <akim@epita.fr>
4241         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
4242         with pointers.
4244 2001-09-05  Akim Demaille  <akim@epita.fr>
4246         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
4247         * m4/macro.c, m4/symtab.c: Adjust.
4249 2001-09-05  Akim Demaille  <akim@epita.fr>
4251         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
4252         (m4_symbol_pop, m4_symbol_del): this.
4253         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
4254         (m4_symbol_popdef, m4_symbol_delete): New.
4255         (m4_lookup_symbol): Adjust.
4256         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
4258 2001-09-05  Akim Demaille  <akim@epita.fr>
4260         * m4/m4module.h (m4_symbol_lookup): Rename as...
4261         (m4_symbol_lookup_t): this.
4263 2001-09-05  Akim Demaille  <akim@epita.fr>
4265         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
4266         unused.
4267         * m4/symtab.c (m4_lookup_symbol): Adjust.
4269 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
4271         Bootstrap will now work with Libtool 1.4.1 or higher:
4272         * bootstrap: Remove stale autom4te.cache files when
4273         rebootstrapping.
4274         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
4275         libtool.m4.
4276         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
4277         libtool.m4 directly.
4278         Run libtoolize to refresh ltmain.sh.
4279         * config/ltmain.sh:  Deleted.
4280         * acinclude.m4: Deleted.
4281         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
4283         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
4284         implementation for the cvs impaired libtool user.
4286 2001-09-03  Akim Demaille  <akim@epita.fr>
4288         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
4289         internal errors.
4290         Avoid using `default' in switch, as it hides useful compiler
4291         warnings when a case is forgotten.
4293 2001-09-03  Akim Demaille  <akim@epita.fr>
4295         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
4296         is no such thing as `WITH_MODULES'.
4298 2001-09-03  Akim Demaille  <akim@epita.fr>
4300         Improve the test suite's selfcontainedness.
4302         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
4303         (Include, Undivert): Tag the other input files.
4304         * tests/generate.awk: Catch `@comment file:'.
4305         `-I $src' is no longer needed.
4306         `next' is really like `return': the rest is skipped.
4307         Adjust to `input.m4'.
4308         (fatal): New function.
4309         * tests/foo, tests/incl.m4: Remove.
4311 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
4313         The shadowing mechanism and, infact, the whole symbol table
4314         implementation was creaking under the weight of the features piled
4315         on top of it.  We now have a separate hash table module which will
4316         dynamically resize to keep symbol density withing good performace
4317         limits, and a new symtab module layered above it.  Symbol lookups
4318         are now marginally more efficient (since the shadowed flag is no
4319         longer required) and symbol removal, such as on module unload, is
4320         considerably faster due to a reorganisation of the data structures
4321         used in symtab.c.
4323         * src/main.c (main):  Don't mention `-H'.
4324         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
4325         effect.
4326         * NEWS: Updated.
4327         * m4/hash.c: New generalised dynamic hash table data structure
4328         management module.
4329         * m4/hash.h: Public interface.
4330         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
4331         (libm4_la_SOURCES): Add hash.c.
4332         * m4/symtab.c: More or less rewritten from scratch, within the
4333         bounds of the previous API.
4334         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
4335         call.  Updated all callers.
4336         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
4337         declarations to reflect API changes.
4338         (M4INIT): Generate a declaration too, to avoid the warning with
4339         --enable-debug builds.
4340         (M4FINISH): Ditto.
4341         (HASHMAX): Removed.
4342         * m4/utility.c (hash_table_size):  Removed.
4343         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
4344         names, which are then looked up by builtin_dumpdef() as necessary.
4345         This implies a small speedup in builtin_symbols(), which discarded
4346         all of the symbol info under the old call.
4347         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
4348         shadowing is implicit in respect to the new data structures.
4349         symbol names are no longer duplicated here, they are stored in the
4350         key field of the hash table.
4351         Moved macro_args and blind_no_args...
4352         (m4_token_data): ...to here.
4353         m4/macro.c (expand_macro):  Added a name argument since the symbol
4354         name is no longer copied into each struct m4_symbol.  Modified all
4355         callers.
4356         (collect_arguments):  Ditto.
4357         * modules/m4.c (set_trace): Ditto.
4358         * modules/gnu.c (builtin_symbols): Updated.
4359         * src/freeze.c (produce_symbol_dump): Much improved in light of
4360         the improved symbol table layout.
4362 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
4364         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
4365         to M4_SYMBOL_NEXT.
4366         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
4367         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
4368         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
4369         SYMBOL_HANDLE): Ditto.
4370         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
4371         modules/gnu.c, modules/m4.c, src/freeze.c,
4372         src/main.c:  Updated all references.
4374         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
4375         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
4376         already listed in m4_LDADD... how did that ever used to work?
4377         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
4378         link.
4379         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
4380         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
4382         * tests/m4: Don't call the m4 wrapper script with libtool, it
4383         works fine all by itself.
4385 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
4387         The experimental `changeword' feature never took off, and has
4388         no obvious advantages over `changesyntax' to compensate the
4389         enormous speed penalty it carries:
4390         * configure.in (ENABLE_CHANGEWORD): Removed.
4391         * m4/m4module.h (m4_set_word_regexp): Removed.
4392         * m4/m4private.h (m4_token_data): Removed original_text field.
4393         * m4/utility.c (m4_token_data_orig_text): Removed.
4394         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
4395         * m4/macro.c: Ditto.
4396         * src/main.c: Ditto.
4397         * modules/Makefile.am (changeword.la): Removed.
4398         * modules/changeword.c: File removed.
4399         * doc/m4.texinfo: References to changeword and --word-regexp
4400         removed.
4401         * po/POTFILES.in: modules/changeword.c removed.
4402         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
4403         * tests/builtins.at (changeword): Test removed.
4405 2001-08-30  Akim Demaille  <akim@epita.fr>
4407         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
4408         This also help having a single list of m4 files: in
4409         config/Makefile.am.
4410         * config/Makefile.am (STANDARD_MACROS): Rename as...
4411         (ACLOCAL_MACROS): this.
4412         (list-standard-macros): Remove.
4413         (spy): New.
4415 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
4417         In an attempt to moderate my egomania...
4418         * tests/modules.at: Remove attributions.
4420         * tests/generate.awk: When making substitutions to "@&t@", either
4421         "&" or "\&" in the substitution string argument to gsub refer back
4422         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
4423         67 now pass for me.
4425 2001-08-29  Akim Demaille  <akim@epita.fr>
4427         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
4428         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
4429         (sync-lines, trace, translit, undivert, wrap): Move to...
4430         * tests/builtins.at: this new file.
4431         * tests/others.at (Discard comments, import-environment): Move to...
4432         * tests/options.at: this new file.
4434 2001-08-29  Akim Demaille  <akim@epita.fr>
4436         * tests/others.at (Freezing modules)
4437         (--module-directory: absolute path, modpath2, modpath3)
4438         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
4439         * tests/modules.at: here, new file.
4440         * tests/others.at, tests/generate.awk: Add a banner.
4441         * tests/testsuite.at: Adjust.
4442         (AT_CHECK_M4_FILTER): New, but unused.
4444 2001-08-29  Akim Demaille  <akim@epita.fr>
4446         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
4447         handle that.
4448         * tests/others.at (wrap): Inline wrap.m4.
4449         (shadow): Inline shadow.m4.
4450         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
4451         * tests/m4: Simplify.
4453 2001-08-29  Akim Demaille  <akim@epita.fr>
4455         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
4456         --language.
4458 2001-08-29  Akim Demaille  <akim@epita.fr>
4460         * tests/generate.awk (normalize): s/@__@/@&t@/.
4462 2001-08-28  Akim Demaille  <akim@epita.fr>
4464         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
4466 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
4468         * bootstrap (generate.awk): Generate test cases with new script.
4470 2001-08-27  Akim Demaille  <akim@epita.fr>
4472         * tests/Makefile.am (installcheck-local): Don't use
4473         `dc_install_base' which is not visible here, but `exec_prefix'
4474         which is clearly the RT anyway.
4475         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
4476         related to testing a now installed m4.
4477         * tests/m4: Do it here.
4479 2001-08-27  Akim Demaille  <akim@epita.fr>
4481         * tests/others.at (indir): Formatting change.
4483 2001-08-27  Akim Demaille  <akim@epita.fr>
4485         * tests/Makefile.am (installcheck-local): New.
4486         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
4487         the test suite.
4488         Prefer options over envvars.
4489         * src/main.c (main): First bug caught by the test suite (yeah!):
4490         --batch lacked a `break' which resulted in an accidental
4491         invocation of --discard-comments.
4493 2001-08-27  Akim Demaille  <akim@epita.fr>
4495         * tests/others.at (capitalize, changeword, comments, ddivert)
4496         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
4497         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
4498         (sysv-args, trace, translit, undivert): Don't rely on files in
4499         examples/: AT_DATA them.
4501 2001-08-27  Akim Demaille  <akim@epita.fr>
4503         Let the test suite use a wrapper around the not installed m4 to
4504         pretend it is (installed).
4506         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
4507         such a way that m4 does not process them.
4508         * configure.in: The package name seems to be `m4', not `M4'.
4509         * tests/m4: New.
4510         * tests/atlocal.in (at_package, M4): Remove.
4511         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
4513 2001-08-27  Akim Demaille  <akim@epita.fr>
4515         * tests/Makefile.am (CLEANFILES): Remove.
4516         (DISTCLEANFILES, clean-local): New.
4517         * examples/mktests.sh: Remove.
4519 2001-08-27  Akim Demaille  <akim@epita.fr>
4521         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
4522         Don't use aclocal: it's written by hand.
4523         * aclocal.m4: m4_include all the files instead of being built by
4524         aclocal.
4525         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
4526         until it reads the traces by itself.
4527         * configure.in: Require Autoconf 2.42c as we are now using
4528         AC_CONFIG_TESTDIR instead of AT_CONFIG.
4529         Catch unexpanded `jm_' macros.
4530         * config/atconfig.m4: Remove.
4531         * config/error.m4: new.
4532         * config/Makefile.am: Ship the files included by aclocal.m4.
4533         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
4534         (TESTSUITE_AT): this, to please Automake.
4535         (TESTSUITE): This target uses autotest/autotest.m4, not
4536         autotest/general.m4.
4537         * tests/testsuite.at: Prereq Autotest 2.52c.
4538         * examples/Makefile.am (pkgdata_DATA): Rename as...
4539         (dist_pkgdata_DATA): this.
4540         * doc/Makefile.am (man_MANS): Rename as...
4541         (dist_man_mans): this.
4543 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
4545         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
4546         Robert Collins, building on Cygwin no longer requires Windows
4547         import and export symbol decorations.
4548         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
4549         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
4550         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
4551         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
4552         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
4553         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
4554         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
4555         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
4556         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
4557         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
4558         anymore.
4559         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
4560         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
4562 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
4564         Ansify the source.  Previously we had a mix, where my code was
4565         in a K&R compatible style, and the preexisting code was in ANSI
4566         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
4567         and now the code base is much cleaner.
4569         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
4570         VOID macro and all users.
4571         * m4/m4module.h:  Ansify function prototypes and headers.
4572         * m4/builtin.c:  Ditto.
4573         * m4/evalparse.c:  Ditto.
4574         * m4/input.c:  Ditto.
4575         * m4/macro.c:  Ditto.
4576         * m4/module.c:  Ditto.
4577         * m4/output.c:  Ditto.
4578         * m4/path.c:  Ditto.
4579         * m4/symtab.c:  Ditto.
4580         * m4/utility.c:  Ditto.
4581         * modules/format.c:  Ditto.
4582         * modules/gnu.c:  Ditto.
4583         * modules/m4.c:  Ditto.
4584         * modules/mpeval.c:  Ditto.
4585         * src/freeze.c:  Ditto.
4586         * src/m4.h:  Ditto.
4587         * src/main.c:  Ditto.
4589 2001-08-20  Akim Demaille  <akim@epita.fr>
4591         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
4592         generated with stock 2.52.
4594 2001-08-20  Akim Demaille  <akim@epita.fr>
4596         * config/atconfig.m4: New, until part of Autoconf per se.
4597         * configure.in (AT_CONFIG): Use it.
4598         Adjust.
4599         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
4600         * tests/atlocal.in: New.
4601         * tests/generate.awk: For the time being, the empty quadrigraph is
4602         `@__@'.
4603         * tests/others.at (changeword, gmp): Check the configuration
4604         variable against `yes'.
4605         * tests/testsuite.at (dnl): Allow it, as it's used all over the
4606         place.
4608 2001-08-20  Akim Demaille  <akim@epita.fr>
4610         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
4611         * modules/m4.c (undivert): Disable the possibility of undiverting
4612         several files at once: it is not documented, it is inconsistent
4613         with the other macros, it can be straightforwardly mocked by
4614         several invocations, and most importantly, it prevents the
4615         possibility of other kinds of extension.
4616         Use `m4_numeric_arg'.
4618 2001-08-20  Akim Demaille  <akim@epita.fr>
4620         * examples/include.m4: Typo.
4621         * tests/generate.awk: Really add it.
4622         * tests/Makefile.am: Adjust.
4623         * tests/others.at (Discard comments): It sure fails without `-c'.
4624         (include, undivert): Add -I examples/.
4626 2001-08-20  Akim Demaille  <akim@epita.fr>
4628         Use sprintf, not ecft and friends since it is standard, portable,
4629         simplifies the code, and since the latter is even deprecated
4630         according to the GNU libc documentation.
4632         * modules/format.c: Drop evct support.
4634 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
4636         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
4637         for `-pipe' here...
4638         * configure.in: ...do it here instead.
4640         * c-boxes.el: Deleted.
4641         * m4/builtin.c: Reformat box comments to be closer to GNU
4642         standards.
4643         * m4/debug.c:  Ditto.
4644         * m4/eval.c:  Ditto.
4645         * m4/evalparse.c:  Ditto.
4646         * m4/input.c:  Ditto.
4647         * m4/m4module.h:  Ditto.
4648         * m4/macro.c:  Ditto.
4649         * m4/output.c:  Ditto.
4650         * m4/symtab.c:  Ditto.
4651         * m4/utility.c:  Ditto.
4652         * modules/changeword.c:  Ditto.
4653         * modules/format.c:  Ditto.
4654         * modules/gnu.c:  Ditto.
4655         * modules/load.c:  Ditto.
4656         * modules/m4.c:  Ditto.
4657         * modules/modtest.c:  Ditto.
4658         * modules/mpeval.c:  Ditto.
4659         * modules/perl.c:  Ditto.
4660         * modules/shadow.c:  Ditto.
4661         * modules/stdlib.c:  Ditto.
4662         * modules/time.c:  Ditto.
4663         * src/freeze.c:  Ditto.
4664         * src/main.c:  Ditto.
4666 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
4668         * m4/module.c: Fixup some errors in the description comment.
4670 2001-08-17  Akim Demaille  <akim@epita.fr>
4672         * tests/others.at (iso8859): Specify the path to the M4 test file.
4673         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
4674         files in error messages.
4676 2001-08-17  Akim Demaille  <akim@epita.fr>
4678         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
4679         * tests/others.at: Adjust input files paths.
4680         * tests/atconfig.in: Set top_builddir.
4681         * tests/Makefile.am: Adjust.
4682         `testsuite' is in src, not build.
4684 2001-08-17  Akim Demaille  <akim@epita.fr>
4686         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
4687         (generate.at): Install a temporary hack until the actual
4688         generate.awk is added to the repository.
4689         * tests/atconfig.in: New.
4691 2001-08-17  Akim Demaille  <akim@epita.fr>
4693         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
4695 2001-08-17  Akim Demaille  <akim@epita.fr>
4697         * doc/m4.texinfo: Promote proper quotation.
4699 2001-08-17  Akim Demaille  <akim@epita.fr>
4701         Remove the non Autotest tests.
4703         * tests/other-tests/capitalize.test,
4704         * tests/other-tests/changeword.test,
4705         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
4706         * tests/other-tests/debug.test,
4707         * tests/other-tests/discard-comments.m4,
4708         * tests/other-tests/discard-comments.test,
4709         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
4710         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
4711         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
4712         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
4713         * tests/other-tests/hanoi.test,
4714         * tests/other-tests/import-environment.m4,
4715         * tests/other-tests/import-environment.test,
4716         * tests/other-tests/include.test, tests/other-tests/indir.test,
4717         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
4718         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
4719         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
4720         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
4721         * tests/other-tests/modtest.test,
4722         * tests/other-tests/multiquotes.test,
4723         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
4724         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
4725         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
4726         * tests/other-tests/sync-lines.m4,
4727         * tests/other-tests/sync-lines.test,
4728         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
4729         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
4730         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
4731         * tests/other-tests/wrap.test: Remove.
4733         * tests/run-test, tests/get-them: Remove.
4734         * tests/Makefile.am: Adjust.
4736 2001-08-17  Akim Demaille  <akim@epita.fr>
4738         others.at no longer depends on other-tests/.
4740         * tests/others.at (stackovf): You're actually...
4741         (sync-lines): this.
4742         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
4743         (unload.test): Keep their authorship.
4744         (discard-comments, gmp, import-environment, modfreeze)
4745         (sync-lines): Embed the input files.
4746         * tests/stackovf.test: Copy from other-tests/stackovf.test.
4747         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
4749 2001-08-17  Akim Demaille  <akim@epita.fr>
4751         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
4752         (M4exit): Tag the exit status of the example.
4753         * tests/get-them: Adjust.
4754         * tests/generate.awk: New, based on get-them.
4755         * tests/Makefile.am: Adjust to generate `generated.at'.
4756         * tests/testsuite.at: Adjust.
4757         (AT_CHECK_M4): Don't overquote.  Blush...
4759 2001-08-17  Akim Demaille  <akim@epita.fr>
4761         Start using Autotest.  atconfig creation is still lacking.
4763         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
4764         * examples/reverse.m4, tests/other-tests/import-environment.m4,
4765         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
4766         * tests/other-tests/import-environment.test: Don't check LANGUAGE
4767         as it might be `unset', or set to `C'.
4768         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
4769         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
4770         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
4771         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
4772         * tests/other-tests/shadow.test: Adjust.
4773         * tests/testsuite.at, tests/others.at: New.
4774         * tests/Makefile.am: Adjust.
4776 2001-08-17  Akim Demaille  <akim@epita.fr>
4778         Drop Autoconf 2.13 compatibility.
4780         * configure.in (changeword): No need to undefine it, as anyway if
4781         it's defined, M4sugar moved it as m4_changeword.
4782         And anyway, proper quotation is enough.
4783         (m4_pattern_allow): As it exists in 2.50, just use it.
4784         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
4785         Don't handle Gettext's duties, let it handle them.
4786         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
4788 2001-08-17  Akim Demaille  <akim@epita.fr>
4790         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
4791         (m4_errprint): Use fputs.
4792         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
4793         dumpdef are not concerned.
4794         (Dumpdef, Errprint): Emphasize their insensitivity to
4795         --error-output.
4796         * doc/Makefile.am: Add `TAGS' support.
4797         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
4798         in `config/' now.
4799         * config/Makefile.am (MAINTAINERCLEANFILES): New.
4801 2001-08-17  Akim Demaille  <akim@epita.fr>
4803         * modules/Makefile.am (ETAGS_ARGS): New.
4805 2001-08-17  Akim Demaille  <akim@epita.fr>
4807         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
4808         changes.
4810 2001-08-17  Akim Demaille  <akim@epita.fr>
4812         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
4814 2001-08-17  Akim Demaille  <akim@epita.fr>
4816         * m4/m4module.h (m4/list.h): Don't include it.
4818 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
4820         m4_modules are no more, we use lt_dlhandles directly and let
4821         latest libltdl features manage the list of loaded modules.
4822         * acinclude.m4: Regenerated.
4823         * m4/ltdl.c: Updated from master copy.
4824         * m4/module.c: Reimplemented to take advantage of advances in
4825         libltdl.
4826         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
4827         list with lt_dlhandle_next.
4828         (m4_builtin_find_by_func): Ditto.
4829         (m4_builtin_table_install): Use lt_dlhandle.
4830         (m4_macro_define): Ditto.
4831         (m4_macro_table_install): Ditto.
4832         m4/module.h: Prototype new module management API.
4833         (m4_modules): No longer required.
4834         (m4_module_init_t, m4_module_finish_t): POSIX namespace
4835         violations, renamed to...
4836         (m4_module_init_func, m4_module_finish_func): ...these,
4837         respectively.
4838         (M4INIT_HANDLER): Clean way to declare init functions in modules.
4839         (M4FINISH_HANDLER):  And similarly for finish functions.
4840         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
4841         -- Add indirection to the CONC macro so that arguments are
4842         correctly expanded.
4843         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
4844         * modules/shadow.c (m4_init_module):  Ditto.
4845         Due to new init function semantics, be careful to perform the
4846         initialisation only on first load.
4847         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
4848         (m4_finish_module): Replaced with M4FINISH_HANDLER.
4849         Due to new finish function semantics, be careful to perform the
4850         finalisation only on first load.
4851         * m4/m4private.h (m4_module): Removed in favour of...
4852         (m4_module_data): ...structure without all the wrapper fields.
4853         Instances of this new structure are stored associated lt_dlhandles
4854         with lt_dlcaller_data_set().
4855         * m4/builtin.c (m4_builtin_define): Takes a handle argument
4856         instead of the old module argument.
4857         (m4_builtin_table_install): Ditto.
4858         * modules/load.c (m4_resident_module):  Removed.  This is no
4859         longer implemented as a magic symbol...
4860         * modules/m4.c (m4_resident_module): Ditto.
4861         * modules/load.c (M4INIT_HANDLER): ...the module init function now
4862         uses the ltdl api to make the module resident.
4863         * modules/m4.c (M4INIT_HANDLER): Ditto.
4864         * modules/load.c (builtin_modules): Traverse the loaded module
4865         list with lt_dlhandle_next.
4866         (builtin_load): Much simplified in light of the reimplemented
4867         module loader.
4868         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
4869         light of the m4/module.c rewrite.
4870         (produce_symbol_dump): Ditto.
4871         (reload_frozen_state): Ditto.
4872         * m4/list.c, m4/list.h: Files deleted.  No longer required.
4873         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
4874         (libm4_la_SOURCES): Delete list.c reference.
4875         * m4/m4private.h (m4_token_data):  Add a handle field.  This
4876         eliminates many of the searches to find the handle associated with
4877         various tokens that are passed between functions.
4878         (struct m4_symbol):  Removed the module field.  The
4879         module association does not belong with the symbol...
4880         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
4881         that the module implementation code is from.  Added a handle
4882         field.
4883         (m4_push_macro): Add a `handle' argument.  Changed all callers.
4884         (init_macro_token):  Set the `handle' field for the
4885         m4_token_data.
4886         * m4/macro.c (expand_argument): Copy the new handle field during
4887         reassignment.
4888         * modules/m4.c (macro_install): Use the new handle field to
4889         optimise the search for the correct builtin structure, and pass
4890         the handle details to m4_builtin_define.
4892 2001-08-15  Akim Demaille  <akim@epita.fr>
4894         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
4895         when creating `m4/obstack.h'.
4896         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
4897         top_builddir.
4898         * tests/defs: Make them absolute.
4899         (CDPATH) Neutralize.
4900         * tests/gethem: Use them.
4902 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
4904         * config/ltmain.sh: Doh!  Import again for a quoting fix that
4905         prevented any regression test from passing.
4907         * m4/m4module.h (obstack.h): Choose between installed version
4908         and shipped version based on configure tests.
4909         * src/freeze.c (obstack.h): Ditto.
4911         * acconfig.h: Removed.  No longer required.
4913         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
4914         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
4915         them to AC_INIT and AM_INIT_AUTOMAKE.
4916         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
4917         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
4918         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
4919         shell variable m4_cv_func_obstack_h.
4920         * tests/defs (M4): Be more careful about relative path to libtool
4921         script and m4 binary by using $srcdir.
4923         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
4924         optargs to the existing libltdl search path.
4925         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
4926         * m4/ltdl.c: Updated.
4927         * m4/ltdl.h: Ditto.
4928         * config/ltmain.sh: Ditto.
4930 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
4932         * src/main.c (main): Add `-b' (for `batch') mode switch to force
4933         interactive mode off.
4935 2001-08-10  Akim Demaille  <akim@epita.fr>
4937         * configure.in: Require Autoconf 2.52.
4938         (AC_ARG_PROGRAM): Remove, handled by Automake.
4939         (m4_getopt): Rename as...
4940         (m4_getopt_h): this.
4941         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
4942         Undefine `changeword' only if defined.
4943         * config/gnu-obstack.m4: Require Autoconf 2.52.
4944         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
4945         Allow this token.
4947 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
4949         * doc/m4.texinfo: Fix some typos, and apply some small
4950         clarifications.
4952 2001-08-09  Andreas Schwab  <schwab@suse.de>
4954         * src/main.c (main): Fix improper uses of error (missing format
4955         string).
4957 2001-08-07  Akim Demaille  <akim@epita.fr>
4959         Improve `make distcheck'.
4961         * configure.in: Be sure to be able to run `mkconfig.sh' when src
4962         != build.
4963         * Makefile.am (dist-hook): Remove, as it is no longer needed.
4964         * doc/m4.texinfo (Include): Add missing blank.
4965         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
4966         obstack.c.
4968 2001-08-07  Akim Demaille  <akim@epita.fr>
4970         * m4/evalparse.c: A better introductory comment.
4971         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
4972         * m4/macro.c: Adjust old comments.
4973         * modules/README: Typo.
4975 2001-08-07  Akim Demaille  <akim@epita.fr>
4977         * config/gnu-obstack.m4: New.
4979 2001-08-07  Akim Demaille  <akim@epita.fr>
4981         * config/Makefile.am, config/stackovf.m4: New.
4982         * configure.in, Makefile.am: Adjust.
4984 2001-08-05  gettextize  <bug-gnu-utils@gnu.org>
4986         * po/Makefile.in.in: Upgrade to gettext-0.10.39.
4987         * po/cat-id-tbl.c: Remove file.
4988         * po/stamp-cat-id: Remove file.
4990 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
4992         * modules/format.c (format):  Formatting for %f was not
4993         interpreting the position of the decimal point correctly for
4994         whole numbers.
4996 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
4998         * TODO:  Removed m4exit bug.
4999         * modules/load.c (m4_resident_module): Make this module resident.
5000         * module/m4.c (m4_resident_module): Ditto.
5001         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
5002         feature to mark modules as resident if they export
5003         `m4_resident_module' as TRUE.
5004         (m4_module_unload): Do not remove resident modules, and take care
5005         with symbol insertion and deletion with resident modules.
5006         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
5007         use resident modules feature.
5009 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
5011         * TODO: Updated.  Removed some cruft that has since been fixed
5012         or implemented.  Added some more entries.
5013         * NEWS: Updated.
5014         * README: Updated.
5015         * modules/README: Updated.
5016         * doc/m4.texinfo: Updated.
5018         * modules/gnu.c (builtin_functions): Make indir orthogonal to
5019         builtin, in that each is recognised as a macro only with parameters
5020         (builtin_indir): Passing 0 arguments is now an error, as with
5021         builtin.
5023         * src/main.c (usage): Added missing description of `-c' option.
5025 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
5027         Consolidate the myriad of dispersed test scripts into the
5028         tests subdirectory.  I think I now have all the file where I
5029         want them, so there shouldn't be anymore upheaval =)O|
5030         Honest!
5031         * tests/Makefile.am: Updated to run the new tests added below.
5032         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
5033         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
5034         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
5035         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
5036         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
5037         tests/other-tests/hanoi.test, tests/other-tests/include.test,
5038         tests/other-tests/indir.test, tests/other-tests/misc.test,
5039         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
5040         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
5041         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
5042         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
5043         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
5044         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
5045         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
5046         tests/other-tests/translit.test, tests/other-tests/undivert.test,
5047         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
5048         tests/other-tests/wrap.test:  New tests based on the contents
5049         of the tests removed below.
5050         * examples/Makefile.am, modules/Makefile.am:  Updated to
5051         reflect removed tests.
5052         * examples/defs,modules/defs: Removed.
5053         * examples/capitalize.test, examples/comments.test,
5054         examples/ddivert.test, examples/debug.test,
5055         examples/esyscmd.test, examples/exp.test,
5056         examples/foreach.test, examples/forloop.test,
5057         examples/fstab.test, examples/hanoi.test,
5058         examples/include.test, examples/indir.test,
5059         examples/misc.test, examples/multiquotes.test,
5060         examples/patsubst.test, examples/pushpop.test,
5061         examples/regexp.test, examples/reverse.test,
5062         examples/sysv-args.test, examples/trace.test,
5063         examples/translit.test, examples/undivert.test,
5064         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
5065         modules/modpath1.test, modules/modpath2.test,
5066         modules/modpath3.test, modules/modpath4.test,
5067         modules/modtest.test, modules/shadow.test,
5068         modules/unfrozen.m4, modules/unload.test: Removed.
5070         Move the implementation of GMP support for the mpeval() builtin
5071         into a loadable module that depends on libgmp.  mpeval() and
5072         eval() share a common parser, now in m4/evalparser.c; the code
5073         in m4/numb.c and m4/numb.h is now physically split between
5074         m4/eval.c (the eval() backend) and modules/mpeval.c (the
5075         mpeval() backend), rather than being differentiated by cpp
5076         macros and multiple inclusion.  The mpeval module is always
5077         built but will generate an diagnostic if it is used from an
5078         installation that didn't link in the gmp library.
5079         * modules/Makefile.am: build and install the new mpeval module.
5080         * modules/mpeval.c: Now contains the former parts of m4/numb.c
5081         and m4/numb.h that are required for gmp support in mpeval().
5082         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
5083         * m4/evalmp.c:  Removed.
5084         * m4/m4module.h: Removed conditional prototype for
5085         m4_mp_evaluate().
5086         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
5087         and m4/numb.h that do not rely on gmp.
5088         * m4/evalparse.c:  New file, contains the shared parts of the
5089         eval() and evalmp() parser implementations, and is no longer
5090         unencumbered by cpp magic to uncover the right parts.
5091         * m4/numb.h:  Removed.  It's former contents are split between
5092         m4/eval.c and modules/mpeval.c.
5093         * m4/numb.c: ditto.
5095         * tests/other-tests/changeword.test: New test.  Rudimentary
5096         testing of changeword builtin runs only if --wnable-changeword
5097         was used at configure time.
5098         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
5099         alternation correctly.  Split into two expressions to compensate.
5100         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
5101         * modules/Makefile.am: Build changeword module.
5102         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
5103         only when --enable-changeword was passed to configure.
5104         (builtin_changeword): If --enable-changeword was not used, then
5105         report that changeword() builtin has no support in m4 binary.
5107 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
5109         * src/main.c (main): Fixed a particularly nasty bug is
5110         user_search_path setting -- the -M flag processing must be
5111         extremely careful with search path ordering, or else the default
5112         installed module directory (possibly containing modules from a
5113         previous release) is placed earlier in the search path than any -M
5114         arguments (which are relied upon to load uninstalled modules with
5115         most of the tests in the regresion suite).
5117         * modules/load.c (builtin_load):  Nasty hack to prevent adding
5118         symbols to symtab again if a module is loaded more than once.
5119         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
5121         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
5122         possible NULL pointer dereference.
5124         * m4/module.c (m4_module_find_by_modname): Renamed from
5125         m4_module_modname_find.   Fixed all references.
5126         (m4_module_find_by_builtin):  New function.
5128         * modules/modfreeze.test: load the `load' module with each
5129         invocation.
5130         * src/freeze.c (produce_frozen_state): Simplified in light of
5131         module field in m4_symbol.  Allow a third argument for text macros
5132         to name the originating module.
5133         (reload_frozen_state): ditto.
5134         * m4/m4module.h:  Fixup prototypes.
5135         * m4/builtin.h (m4_builtin_define): Add a module argument so
5136         that symbols can be registered against the defining module.
5137         (m4_macro_define): ditto.
5138         * m4/m4private.h (m4_symbol): Make the module field const to save
5139         on casting in the rest of the code.
5140         (SYMBOL_MODULE): New macro.
5142         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
5143         symbol reference maintenance bugs when removing a symbol from the
5144         symtab.
5146         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
5148 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
5150         * configure.in (m4_cv_func_obstack): A better check for whether
5151         libc has an obstack implementation.
5152         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
5154         * configure.in (--with-modules): Changed semantics.  This
5155         option is now used to list modules to be preopened.
5156         * src/m4.h: #include "ltdl.h" unconditionally.
5157         * src/main.c: Removed all dependencies on WITH_MODULES.
5158         * src/freeze.c: ditto.
5159         * modules/Makefile.am: ditto.
5160         * m4/m4.c (builtin_m4exit): ditto.
5161         * modules/modpath1.test: ditto.
5162         * modules/modpath2.test: ditto.
5163         * modules/modpath3.test: ditto.
5164         * modules/modpath4.test: ditto.
5165         * modules/modtest.test: ditto.
5166         * modules/shadow.test: ditto.
5167         * modules/unload.test: ditto.
5169         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
5170         comes up on demand in LTLIBOBJS now.
5171         * configure.in (getopt_long):  Creating and relying on a link for
5172         getopt.h on hosts with no getopt_long() of thier own works
5173         correctly now.  This is necessary so that callers of getopt_long()
5174         can simply `#include <getopt.h>': the naive way of doing this
5175         would end up using our own getopt.h and the installed
5176         getopt_long(), which is asking for trouble!
5177         (obstack_init): A similar argument applies to obstack.h and
5178         obstack_init().
5180         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
5181         On Solaris-2.5 (at least) the native dlopen implementation
5182         gets confused about m4.o when looking for module "m4".  This
5183         version always looks for .la an .$lib_ext suffixed names first
5184         to work around the problem.  Sigh.
5186         * po/POTFILES.in: Take account of these file movements.
5187         * src/Makefile.am (m4_SOURCES): removed eval.c.
5188         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
5189         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
5190         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
5191         * modules/m4.c (builtin_eval): Use m4_evaluate().
5192         * m4/eval.c: Moved here from src/eval.c to facilitate
5193         implementation of eval() builtin as part of the `m4' loadable
5194         module.
5195         (m4_evaluate): renamed from evaluate for namespace cleanliness.
5196         * m4/numb.c: Moved here from src/numb.c, since it is #included
5197         into eval.c at compile time.
5198         * m4/m4module.h (m4_evaluate): Added prototype.
5199         * src/m4.h (evaluate): Removed prototype.
5201 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
5203         * modules/perl.c (builtin_perleval):  Use PL_na for
5204         compatibility with perl-5.6.
5206         * src/main.c (main):  It is now safe to
5207         ``m4_module_install("m4")'', without tripping over the m4
5208         binary itself!
5209         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
5210         versions having fixed the insidious module search order bug.
5212         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
5213         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
5215         * configure.in: Figure out whether to use the installed
5216         getopt.h or the supplied one.
5217         * src/Makefile.am: ditto.
5219         * po/POTFILES.in: List files in their new positions.
5221         * config/ltmain.sh:  This needs to be checked in to match the
5222         libtool macros copied to acinclude.m4 (until a released
5223         libtool copes with m4's needs).
5224         * bootstrap:  Run gettextize.
5226 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
5228         * AUTHORS:  Added my details.
5229         * TODO: updated.
5230         * NEWS: updated.
5231         * bootstrap: temporary update until released libtool catches up.
5233         * All files:  Use new GNU GPL copyright blurb with current contact
5234         address.
5236         * configure.in (LTLIBOBJS): Use canonical code for calculation of
5237         this variable.
5239         * config: renamed acm4 directory to config to be more like
5240         other autoconfiscated packages.
5242         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
5243         * config/debug.m4:  New file implementing configure macros to add
5244         suitable debug flags to the compiler invocation.
5246         * modules/load.c:  New file implementing the ``load'' and
5247         ``unload'' builtins.
5248         * tests/get-them:  Set the module search directory to the modules
5249         build directory in generated tests.
5250         * modules/shadow.test: ditto.
5251         * modules/modtest.test: ditto.
5252         * modules/modpath1.test: ditto.
5253         * modules/modpath2.test: ditto.
5254         * modules/modpath3.test: ditto.
5255         * modules/modpath4.test: ditto.
5256         * modules/modtest.test: ditto.
5257         * modules/modfreeze.test: ditto.
5258         * modules/unload.test: ditto.
5260         * modules/changeword.c:  New file implementing the ``changeword''
5261         builtin as a loadable module.
5262         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
5263         as a loadable module.
5265         * src/main.c (main):  Load the gnu module if m4 was started
5266         normally -- i.e. without the -G option.
5267         * modules/gnu.c:  New file implementing a new loadable module wuth
5268         definitions for all the gnu extension builtins.
5269         * modules/format.c:  Moved here from src/format.c.  Now included
5270         directly by gnu.c.
5272         * src/main.c (main):  Load the traditional module if m4 was
5273         started in `no_gnu_extensions' mode.
5274         * modules/traditional.c:  New file implementing the ``unix'' macro,
5275         required when m4 is executed in traditional mode, as a loadable
5276         module.
5278         * src/main.c:  Renamed from m4.c to avoid confusion with
5279         modules/m4.c.
5280         (main):  Always load the m4 module.
5281         * modules/m4.c:  New file implementing a new loadable module with
5282         definitions for all m4 builtins that are not gnu extensions.
5284         * m4/Makefile.am:  Adjusted to take new files below into account.
5285         * m4/m4module.h: Prototypes for exported functions and types moved
5286         to this directory from the src directory.
5287         * m4/m4private.h: Moved here from src/m4private.h to facilitate
5288         the migration of all builtin implementations to loadable modules.
5289         * m4/macro.c: Moved this file here from the src directory,
5290         renaming all exported symbols to use the prefix ``m4_''.
5291         * m4/builtin.c: ditto.
5292         * m4/module.c: ditto.
5293         * m4/symtab.c: ditto.
5294         * m4/debug.c: ditto.
5295         * m4/input.c: ditto.
5296         * m4/output.c: ditto.
5297         * m4/path.c: ditto.
5298         * m4/ltdl.h, m4/ltdl.c: ditto.
5299         * m4/utility.c: Odd functions moved here from files in the src
5300         directory to facilitate builtin migration.
5302 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
5304         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
5305         error message, to make translators' jobs a little easier.
5306         (builtin_builtin): ditto.
5307         (builtin_traceon): ditto.
5308         (builtin_traceoff): ditto.
5309         Reported by Akim Demaille <akim@epita.fr>
5311         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
5312         pkgincludedir instead.
5314         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
5315         it is exported globally.  Fixed all references.
5316         (lquote): ditto.
5317         (bcomm): ditto.
5318         (ecomm): ditto.
5319         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
5320         globally.  Fixed all references.
5321         (DEF_LQUOTE): ditto.
5322         (DEF_BCOMM): ditto.
5323         (DEF_ECOMM): ditto.
5325 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
5327         * NEWS: updated.
5328         * TODO: updated.
5330         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
5331         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
5333         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
5334         Removed `Prev', `Next' and `Up' fields of all @nodes now that
5335         makeinfo calculates them for us, and to make any future
5336         reorganisation easier.
5337         (Frozen files): Document format version 2.
5338         `V' now takes argument `2'.
5339         `F' can take a single argument if symbol and builtin names
5340         are the same, or 3 arguments if the builtin is from a module.
5341         New `S' specification for saving syntax table contents.
5342         New `M' specification for saving loaded module names.
5343         * src/freeze.c: Implement them.
5344         * src/input.c (syntax_code): For interpreting frozen syntax
5345         state.
5347         * examples/Makefile.am:  Add the contents of the WWW directory to
5348         the distribution.
5349         * examples/WWW/Makefile:  ditto,
5350         (%.htm): Compares file contents (not just sizes) to determine
5351         whether a change has occured.
5352         * examples/WWW/_header.htm: Bumped version number.
5353         * examples/WWW: Regenerated content.
5355         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
5356         compilers comes much easier without ansi2knr.
5357         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
5359         * m4/list.c: New generic list container type.
5360         * m4/list.h: Interface to new container type.
5361         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
5362         (libm4_la_SOURCES): compile and link list.c.
5363         * src/builtin.c (builtin_tables): Use list container.
5364         * src/module.c (symtab): ditto.
5365         * src/symtab.c (symtab): ditto.
5367         * m4/system.h: New file for common preprocessor definitions.
5368         * m4/Makefile.am (pkginc_HEADERS): install system.h.
5369         * m4/error.c: Use system.h in place of inline preprocessor.
5370         * m4/error.h: ditto.
5371         * m4/module.c: ditto.
5372         * m4/module.h: ditto.
5373         * m4/xmalloc.c: ditto.
5375         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
5376         compatibility.
5377         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
5379         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
5380         it is exported globally.  Fixed all references.
5381         (builtin): ditto.
5382         (module_init_t): ditto.
5383         (module_finish_t): ditto.
5384         (token_data): ditto.
5385         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
5386         it is exported globally.  Fixed all references.
5387         (SYNTAX_IGNORE): ditto.
5388         (SYNTAX_SPACE): ditto.
5389         (SYNTAX_OPEN): ditto.
5390         (SYNTAX_CLOSE): ditto.
5391         (SYNTAX_COMMA): ditto.
5392         (SYNTAX_DOLLAR): ditto.
5393         (SYNTAX_ACTIVE): ditto.
5394         (SYNTAX_ESCAPE): ditto.
5395         (SYNTAX_ALPHA): ditto.
5396         (SYNTAX_NUM): ditto.
5397         (SYNTAX_ALNUM): ditto.
5398         (SYNTAX_LQUOTE): ditto.
5399         (SYNTAX_RQUOTE): ditto.
5400         (SYNTAX_BCOMM): ditto.
5401         (SYNTAX_ECOMM): ditto.
5402         (SYNTAX_VALUE): ditto.
5403         (SYNTAX_MASKS): ditto.
5404         (IS_OTHER): ditto.
5405         (IS_IGNORE): ditto.
5406         (IS_SPACE): ditto.
5407         (IS_OPEN): ditto.
5408         (IS_CLOSE): ditto.
5409         (IS_COMMA): ditto.
5410         (IS_DOLLAR): ditto.
5411         (IS_ACTIVE): ditto.
5412         (IS_ESCAPE): ditto.
5413         (IS_ALPHA): ditto.
5414         (IS_NUM): ditto.
5415         (IS_ALNUM): ditto.
5416         (IS_LQUOTE): ditto.
5417         (IS_RQUOTE): ditto.
5418         (IS_BCOMM): ditto.
5419         (IS_ECOMM): ditto.
5420         (TOKEN_EOF): ditto.
5421         (TOKEN_NONE): ditto.
5422         (TOKEN_STRING): ditto.
5423         (TOKEN_SPACE): ditto.
5424         (TOKEN_WORD): ditto.
5425         (TOKEN_SIMPLE): ditto.
5426         (TOKEN_MACDEF): ditto.
5428         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
5429         consistency.  Fixed all references.
5430         (STRING): Renamed to `m4_string' for consistency, and because if
5431         is exported globally.  Fixed all references.
5432         (token_type): Renamed to `m4_token_t' for the same reasons.
5433         (token_data_type): Renamed to `m4_token_data_t' for the same
5434         reasons.
5436         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
5437         sizes.
5438         (XMALLOC): ditto.
5439         (XREALLOC): ditto.
5440         (XFREE): Wrapper macro which avoids freeing NULL pointers.
5442         * m4/m4module.h (m4_macro):  New type for module defined user
5443         macros.
5444         * modules/modtest.c (m4_macro_table):  Define module user macros.
5445         * modules/shadow.c (m4_macro_table):  ditto.
5447         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
5448         declared with M4BUILTIN.
5450         * m4/xmalloc.c: Use memset if bzero is not available when
5451         emulating calloc with malloc.
5452         (xcalloc): Fallback to malloc/bzero if calloc is not available.
5453         (xfree): Added for consistency.  Will not try to free NULL
5454         pointers.
5455         * src/m4.c (xfree):  Deleted in favour of the above.
5456         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
5457         linking with libdmalloc.
5458         * m4/xstrdup.c (WITH_DMALLOC): ditto.
5460         * modules/frozen.m4:  New test case.
5461         * modules/unfrozen.m4:  ditto.
5462         * modules/modfreeze.test:  New test.
5463         * modules/unload.test:  ditto.
5464         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
5465         (TESTS): Use them.
5466         * modules/modpath1.test:  Don't try this test if module support is
5467         not compiled in.
5468         * modules/modpath2.test: ditto.
5469         * modules/modpath3.test: ditto.
5470         * modules/modpath4.test: ditto.
5471         * modules/modtest.test: ditto.
5472         * modules/shadow.test: ditto.
5474         * modules/perl.c: New module.
5475         * modules/perl.m4: Example of using it.
5476         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
5478         * src/m4.c (main): Assume interactive mode if STDIN is connected
5479         to a tty.
5480         Changed startup sequence slightly so that syntax is not
5481         initialised from here when loading a frozen file.
5483         * src/builtin.c:  Much improved macro definition style.
5484         * src/m4private.h:  Internal structures for m4_builtin and
5485         m4_macro instances.  These are not exposed to module writers.
5486         * src/module.c (module_modname_find):  Find a module structure
5487         from the its name.
5488         (make_macro_table):  Build an internal macro table from a external
5489         definition.
5490         (make_builtin_table):  Build an internal builtin table from an
5491         external definition.
5493         * src/module.c (module_unload): Be extremely careful to remove
5494         builtins and macros that match the module being unloaded -- no
5495         longer assume that the top element can be removed incase another
5496         odule defines an identical name.
5497         * src/symtab.c (remove_table_reference_symbols): remove all symbol
5498         table entries which refer to a given builtin table.
5499         * src/builtin.c (remove_tables): Use it!
5501 2000-07-13  Thomas Tanner  <tanner@ffii.org>
5503         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
5504         * acm4/modules.m4: deleted
5505         * bootstrap: don't libtoolize libltdl!
5506         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
5507         if set, enable WITH_MODULES and add modules to DLPREOPEN
5508         * examples/misc.test: redirect standard output
5509         * lib/Makefile.am: don't use DLLDFLAGS
5510         * lib/m4module.c: include necessary headers to silence GCC -Wall
5511         * lib/m4regex.c: fixes to silence GCC -Wall
5512         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
5513           build modules conditionally
5514         * modules/shadow.c: define symbol aliases before using them
5515         * modules/test.c: define symbol aliases before using them
5516         * po/de.po: update translation
5517         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
5518         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
5519         LIBLTDL to LIBS.
5520         * src/m4.c: initialize libltdl's preloaded symbols via
5521         LTDL_SET_PRELOADED_SYMBOLS
5522         * src/module.c: libltdl's memory management must be initialized
5523         before calling lt_dlinit!, fix warnings
5525 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
5527         * README:  Caveat about nls not supported by dll architecture on
5528         Windows.
5530         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
5532         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
5533         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
5534         * modules/Makefile.am (LIBS): ditto.
5535         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
5536         $(top_srcdir)/m4 (for only <m4module.h>).
5537         * modules/shadow.test: fixed for VPATH.
5538         * modules/modtest.test: ditto.
5539         * modules/modpath4.test: ditto.
5540         * modules/modpath3.test: ditto.
5541         * modules/modpath2.test: ditto.
5542         * modules/modpath1.test: ditto.
5544         * modules/time.test: Removed due to timezone dependence,
5545         * modules/Makefile.am (TESTS): Removed time.test.
5547         * configure.in: Use $3 of AC_DEFINE so that we can,,,
5548         * acconfig.h: Remove everything except the gettext parameters.
5549         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
5550         AC_DEFINE.
5551         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
5552         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
5553         increment serial number.
5555         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
5556         src dir and immediately after libm4 is built for confidence that
5557         it doesn't rely on the src directory.
5558         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
5559         makeinfo stop the build on cygwin (because they don't work).
5561         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
5563         * m4/m4private.h: ...is not a public header, so moved to src.
5564         Add `#include <config.h>', `#define _COMPILING_M4' and
5565         `#include "m4.h".
5566         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
5567         * src/Makefile.am (noinst_HEADERS): add m4private.h.
5568         * src/builtin.c: `#include "m4private.h"' now takes care of the
5569         above.  Duplicates removed.
5570         * src/debug.c: ditto.
5571         * src/eval.c: ditto.
5572         * src/evalmp.c: ditto.
5573         * src/format.c: ditto.
5574         * src/freeze.c: ditto.
5575         * src/input.c: ditto.
5576         * src/m4.c: ditto.
5577         * src/macro.c: ditto.
5578         * src/module.c: ditto.
5579         * src/numb.h: ditto.
5580         * src/output.c: ditto.
5581         * src/path.c: ditto.
5582         * stackovf.c: ditto.
5583         * symtab.c: ditto.
5585         * po/POTFILES.in: compensate for renaming of lib/*.
5586         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
5587         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
5588         and then in $(top_srcdir)/lib (for eg. "m4private.h").
5589         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
5590         m4/libm4.la.
5591         * m4/m4error.h:  Renamed error.h, for installation to
5592         $prefix/include/m4..
5593         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
5594         * m4/m4regex.h: Renamed regex.h, for same reason.
5595         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
5596         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
5597         * m4/m4regex.c: Renamed regex.c, and fix #includes.
5599         * lib: moved to m4 to easily support header installation to
5600         $prefix/include/m4.
5601         * Makefile.am (SUBDIRS): renamed lib dir to m4.
5602         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
5603         * acm4/regex.m4: Point to m4/regex.c.
5605         * examples/foreach.m4:  Sanitise quoting.
5606         * examples/foreach.test:  New torture test.
5607         From Akim Demaille <akim@epita.fr>
5609 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
5611         * src/ltdl.c: Use access() to abort doomed module load attempts
5612         if module file does not exist.
5614         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
5615         getopt1.o will already be used if appropriate, so I moved getopt.c
5616         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
5618         * modules/modpath1.test: Use correct filename in header line.
5619         * modules/modpath2.test: ditto.
5620         * modules/modpath3.test: ditto.
5621         * modules/modpath4.test: ditto.
5623         Without these changes lt_dlopen("test") attempts to
5624         LoadLibrary("/bin/test") on Windows, which although harmless
5625         generates a spurious error message which spoils most of the tests:
5626         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
5627         (TESTS): s/test.test /modtest.test /
5628         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
5629         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
5630         * modules/modpath1.test: s/test.m4 /modtest.m4 /
5631         * modules/modpath2.test: ditto.
5632         * modules/modpath4.test: ditto.
5633         * modules/modpath3.test: s/-m test /-m modtest /
5634         * modules/shadow.m4: use {un,}loadmodule(`modtest').
5636 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
5638         * src/ltdl.c (find_file): Updated to new version with fixed memory
5639         allocation bug in `next'.
5640         * src/ltdl.h: updated to match.
5642         * modules/Makefile.am:  Cleaned up and reordered.
5644 2000-01-16  René Seindal  <rene@seindal.dk>
5646         * modules/Makefile.am (TESTS): New tests for the module system.
5648         * modules/*.test: New files.
5650         * src/m4.c (main): Added call to module_init().
5651         Treats -M and -m as the arguments -D -U and -t, ie deferred.
5653         * src/m4.h: Added declaration of module_init().
5655         * src/module.c (module_init): No longer static
5657         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
5658         Added to shut up automake about non standard libtool library
5659         names.
5661         * src/module.c: Disabled DEBUG by default.
5663         * modules/README: Changed example from unload.m4 to shadow.m4
5665         * modules/shadow.m4: Renamed from unload.m4
5667         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
5669         * src/m4.c (main): Functionality for -m and -M were reversed.
5670         Fixed.
5672 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
5674         * doc/help2man.pl: updated to version 1.020.
5676         * lib/COPYING.LIB:  updated to version 2.1.
5678         * lib/m4module.h: restructure the M4_SCOPE code to work when
5679         creating a dll which links with libm4.la and both DLL_EXPORT
5680         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
5681         both defined.
5683 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
5685         Merged the following changes from my tree:
5687         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
5689         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
5690         ported to compile shared libs.
5692         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
5693         use `__declspec(dllimport)' when linking libm4.la on win32.
5694         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
5696         * configure.in (M4OBJS): Discover whether we need the shipped
5697         implementation of getopt_long.
5698         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
5699         main binary here, as opposed to the module library in lib/libm4.la.
5701         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
5703         * modules/README: Updated to describe the improved libltdl based
5704         module scheme.
5705         * README (cygwin): Added some compilation notes for building m4
5706         correctly under cygwin.
5707         * TODO: Cleaned out the entries for the module system since they
5708         are now implemented.
5710         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
5711         all instances of __P with M4_PARAMS.
5713         * lib/getdate.h: removed unreferenced file.
5715         * lib/m4private.h: New file to define the private interface to the
5716         token_data struct, which must be shared between m4module.c, and
5717         builtin.c but not exported to modules built from the installed
5718         m4module.h since it's size changes depending on compile time
5719         options.
5721         * src/m4.h: Lots of stuff moved to lib/m4module.h.
5723         * lib/m4module.h: New file to define the interface available when
5724         compiling m4 modules.
5725         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
5726         necessary for module compilation into this new file.
5728         * lib/Makefile.am (include_HEADERS): install headers (renamed to
5729         avoid nameclash with other system headers) necessary for compiling
5730         modules.
5731         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
5732         so that modules can include the (renamed) installed headers and
5733         be guaranteed a matching implementation.
5734         * lib/m4error.h: renamed from error.h.
5735         * lib/m4obstack.h: renamed from obstack.h.
5736         * lib/m4regex.h: renamed from regex.h.
5737         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
5738         implementation, simply include the shipped version
5739         unconditionally, otherwise it is hard for a module to know
5740         whether the m4obstack.h header it is using matches the
5741         implementation it ends up linking against.
5742         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
5743         the same reason.
5745         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
5747         * examples/misc.test: Don't run this test on machines which don't
5748         have a root user in /etc/passwd (e.g. cygwin).
5750         * tests/get-them (/^@example$/): Error messages might have a
5751         ``.exe'' suffix to the program name, or else use the libtool
5752         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
5753         of these cases are now catered for when comparing error messages
5754         in generated tests.
5755         * tests/other-tests/*.test: ditto.
5756         * examples/*.test: ditto.
5758         * tests/defs (M4): use libtool execute mode.
5759         * examples/defs (M4): ditto.
5761         * tests/get-them (END): explicitly close any open file.
5762         (printthem): In a regular expression, '{' is the start of a repeat
5763         count!  Use `[{]' for a literal open brace.
5764         (/^@node /): Don't use substr on a string shorter than the trim
5765         length.
5767         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
5769         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
5770         substituted.
5771         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
5773 2000-01-10  Andreas Schwab  <schwab@suse.de>
5775         * tests/other-tests/gmp.test: Find config.sh in build directory.
5777         * configure.in: Find tests/mkconfig.sh in $srcdir.
5779         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
5780         <signal.h> (for SUS2 compliant systems).
5782         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
5783         HAVE_SIGINFO_H.
5785 2000-01-10  René Seindal  <rene@seindal.dk>
5787         * Prerelease 1.4o.
5789         * TODO, NEWS: Cleaned up and updated.
5791         * src/m4.c (main): New variable exit_status for exit status in
5792         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
5793         file cannot be read instead of EXIT_SUCCESS.
5795         * src/builtin.c (m4_indir): Changed error message to help
5796         translators (from Akim Demaille <demaille@inf.enst.fr>).
5798         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
5799         Cygnus.
5801         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
5802         from glic 2.1.2.
5804         * src/input.c (match_input): Reordering of code, to avoid multiple
5805         calls to push_string_init() from obstack_grow(), which can happen
5806         with some compilers (found and fixed by James Bonfield
5807         <jkb@mrc-lmb.cam.ac.uk>).
5809         * src/stackovf.c: Added prototypes for ultrix.
5810         (setup_stackovf_trap): Added __P to cast.
5811         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
5813 2000-01-09  René Seindal  <rene@seindal.dk>
5815         * doc/m4.texinfo (Changequote): Added comment about changing
5816         quotes when the old quote is a part of the new.
5818         * src/builtin.c (expand_ranges): Added break after trailing dash.
5819         This caused misbehavious on some systems (found and fixed by Akim
5820         Demaille <demaille@inf.enst.fr>).
5822         * AUTHORS: Thomas Tanner included
5824         * acconfig.h: Added entry for ss_sp (see below).
5826         * configure.in (use_stackovf): Added check for stack_t with member
5827         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
5828         <eggert@twinsun.com>).
5830         * doc/m4.texinfo (Frozen files): Added a simpler example for
5831         generating frozen files from several input files.
5833 1999-11-14  Paul Eggert  <eggert@twinsun.com>
5835         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
5836         lib/regex.c, lib/xmalloc.c.
5838 1999-11-10  René Seindal  <rene@seindal.dk>
5840         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
5842         * src/module.c: reindented.
5843         (module_load): return if this is a repeated load of same module.
5844         (module_init): slight change of logic to avoid repeated
5845         initialisation debug messages.
5847         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
5848         in the distribution.
5850         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
5851         automake warnings about missing lib prefix.
5852         (time_la_LDFLAGS): ditto
5853         (stdlib_la_LDFLAGS): ditto
5855 1999-11-10  Paul Eggert  <eggert@twinsun.com>
5857         * src/m4.h: Include error.h, since our macros use error.
5858         * src/m4.c: Don't need to include error.h.
5860 1999-11-09  Paul Eggert  <eggert@twinsun.com>
5862         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
5863         and zero, as Solaris 7 cc does.
5864         (bcopy): Remove macro; no longer needed with new obstack.h.
5866         * src/output.c (freeze_diversions): Don't assume that a
5867         diversion size can fit in `int'.  Check for diversion file
5868         size too large to be printed with `unsigned long'.
5870         * src/Makefile.am (CFLAGS): Omit -Wall.
5872         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
5874         * src/debug.c (trace_format):
5875         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
5877         * src/freeze.c (produce_frozen_state):
5878         Don't assume string lengths fit in int.
5880 1999-10-13  René Seindal  <rene@seindal.dk>
5882         * po/cs.po: Czech translation added.
5884         * po/sv.po: Updated Swedish translation.
5886         * po/ru.po: Updated Russian translation.
5888         * po/pl.po: Updated Polish translation.
5890         * po/el.po: Greek translation added.
5892 1999-10-13  René Seindal  <rene@seindal.dk>
5894         * configure.in (ALL_LINGUAS): Added Greek translation (el).
5895         (ALL_LINGUAS): Added Czech translation (cs).
5897 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
5899         * src/builtin.c: moved module loading functions into...
5900         * src/module.c: entirely new implementation using libltdl.
5901         * po/POTFILES.in: added src/module.c.
5902         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
5903         are modules, not linktime libraries.
5904         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
5905         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
5906         avoidance on exported symbols.
5907         * modules/test.c (m4_macro_table, m4_init_module,
5908         m4_finish_module): ditto.
5909         * modules/time.c (m4_macro_table): ditto.
5911         * modules/time2.m4: new file which requires command line loading
5912         of modules.
5913         * src/m4.c (--load-module): dynamically load named runtime module
5914         into running executable before reading the source.
5915         (--module-directory): prepend a directory to the module search
5916         path.
5917         (module_init()): Do this the first time we load a module instead;
5918         if the module subsystem is broken normal m4 scripts can still run.
5919         * src/m4.h (install_builtin_table): is now exported.
5921 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
5923         * src/module.c: removed.  No longer required.
5924         * po/POTFILES.in: removed src/module.c.
5926         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
5927         the bootstrap script can recreate.
5928         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
5929         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
5930         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
5931         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
5932         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
5933         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
5934         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
5935         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
5937         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
5938         better.
5939         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
5940         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
5941         the installed gettext.m4 file when running aclocal.
5943 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
5945         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
5946         distinguish this from the last prerelease.
5947         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
5948         in its own subdirectory.
5950         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
5951         lib prefix on a module" feature.
5952         (LDFLAGS): Added `-module -avoid-version' flags to build
5953         versionless module libraries.
5954         * src/builtin.c (m4_load_module): use libltdl.
5955         (module_unload_all): use libltdl.
5956         * src/m4.c (module_init): initialise module loading on demand for
5957         better diagnostics, and so that m4 will still work even if
5958         the module code is broken.
5959         * src/m4.h (module_init): removed.  No longer relevant.
5960         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
5961         exported symbols for compatibility with dlpreopening.
5962         * modules/test.c (m4_macro_table, m4_init_module,
5963         m4_finish_module): ditto.
5964         * modules/time.c (m4_macro_table): ditto.
5966         * bootstrap: New file.  Runs all the autoutils in the right order
5967         after a fresh checkout, or a make maintainer-clean.
5969 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
5971         * src/builtin.c (dump_symbols): New function, factoring common
5972         content of m4_dumpdef and m4_symbols.
5973         (m4_dumpdef): Use it.
5974         (m4_symbols): New function, implementing `symbols'.  Use it.
5975         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
5976         file compile with modern makeinfo.
5977         (Symbols): New node, documenting symbols.
5978         (direntry): Modernize.
5980 1998-12-11  René Seindal  <rene@seindal.dk>
5982         * src/builtin.c (predefined_tab): New predefined macros
5983         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
5984         configure time options.
5986 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
5988         * src/module.c (module_try_load): Don't try to be clever and
5989         overwrite argument string.  Instead allocate all constructed
5990         strings locally, since they can have arbitrary lengths.  Make
5991         arguments pointers to const.
5992         (module_search): Simplify due to above change.
5994 1998-11-29  René Seindal  <rene@seindal.dk>
5996         * Prerelease 1.4n.
5998         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
6000         * tests/other-tests/import-environment.{m4,test}: New test.
6002         * tests/other-tests/discard-comments.{m4,test}: New test.
6004         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
6006         * src/m4.c (main): New option -c --discard-comments.
6007         New global variable discard_comments.
6009         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
6010         discarded, ie never returned from next_token().
6011         Added declaration of discard_comments.
6013         * src/input.c (next_token): Now loops until token type is not
6014         TOKEN_NONE.  Comments are now given this type when comments should
6015         be discarded.
6017         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
6018         and mpeval.
6020 1998-11-28  René Seindal  <rene@seindal.dk>
6022         * src/m4.c (main): New option --import-environment (no single
6023         letter option).
6025         * When configured with --with-gmp both the normal (fast) eval()
6026         and the gmp aware mpeval() are defined.  To restore previous
6027         bahaviour use "define(`eval', defn(`mpeval'))".
6029         * tests/other-tests/gmp.m4: Changed to use mpeval().
6031         * src/evalmp.c: New file for compiling eval.c as gmp aware.
6032         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
6034         * src/eval.c: Now includes "numb.c" directly.  Everything in this
6035         file must by static, except evaluate(), which is changed to
6036         mp_evaluate() if USE_GMP in force.
6038         * src/numb.c: Changed to be included by eval.c instead of being
6039         compiled separately.  Everything is declared static.
6041         * src/numb.h: Removed declarations of functions, as numb.c is now
6042         included by eval.c.
6044         * src/builtin.c: Declaration of m4_mpeval() added.
6045         Inserted `mpeval' in builtin table.
6046         (do_eval): New function with common code for m4_eval and m4_mpeval.
6047         (m4_mpeval): New function for gmp version of eval.
6049         * src/m4.h: Declaration of mp_evaluate().
6051         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
6052         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
6054         * src/m4.c (main): m4 --version also shows which options were used
6055         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
6057 1998-11-27  René Seindal  <rene@seindal.dk>
6059         * Error messages now always print program name before input file
6060         name as specified by GNU coding standards.  Reported by Akim
6061         Demaille <demaille@inf.enst.fr>.
6063         * doc/m4.texinfo (Include): Change due to changed error message
6064         format.
6065         (Eval): Do.
6067         * tests/get-them: Minor change to sed script due to changed error
6068         message format.
6070         * src/m4.c (print_program_name): New func used to print program
6071         name, input file and line number in error ().  Used as an
6072         error_print_progname handler.
6073         (reference_error): Removed.
6074         (main): Assigns error_print_progname.
6076         * src/m4.h (M4ERROR): Removed reference_error ().
6078 1998-11-25  René Seindal  <rene@seindal.dk>
6080         * Updated to libtool 1.2b.
6082         * src/builtin.c (install_builtin_table): Added braces to avoid
6083         warning of ambiguous 'else'.
6085         * src/module.c: Inserted search path code from path.c modified to
6086         use new interface.
6087         (module_init): Configured default path used only if M4MODPATH is
6088         not set.
6089         (module_try_load): Now reads libMODULE.la as generated by libtool
6090         for actual module name.
6091         (module_load): Gives better error messages on failure.
6093         * src/m4.h: Added declarations of structures and functions for
6094         generic search path handling.
6096         * src/path.c: Removed all module specific code and introduced new
6097         functions of more generic search path handling.
6099 1998-11-24  René Seindal  <rene@seindal.dk>
6101         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
6102         included gettext, as <libintl.h> might not be found
6103         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
6105 1998-11-22  René Seindal  <rene@seindal.dk>
6107         * src/output.c (insert_diversion): Fixed bug that might cause m4
6108         to read from standard output!  Triggered by input
6109         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
6110         so now 'undivert(0)' does nothing.
6112 1998-11-18  René Seindal  <rene@seindal.dk>
6114         * Prerelease 1.4m.
6116         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
6117         could be changed when compiling a illegal regexp, causing later
6118         use of the regexp to dump core.
6120         * src/module.c (module_load): Changed error message to conform to
6121         standards.
6123         * src/m4.c (usage): Added message about reporting bugs.
6125         * doc/m4.texinfo (Changeword): Corrected a wrong example.
6126         (Changeword): Added note about the type of regexps used.
6128         * ltconfig, ltmain.sh: New files from Libtool 1.2.
6130         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
6131         and AM_PROG_LIBTOOL.
6133         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
6134         with libtool.
6136         * modules/Makefile.am: Changed completely to compile modules using
6137         libtool.  The modules are compiled as shared libraries, and are
6138         renamed when installed.
6140         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
6141         USE_SHL_LOAD to HAVE_SHL_LOAD
6143         * src/builtin.c (shipout_string): Now tests for a NULL string.
6145         * src/module.c: New level of indirection around non-portable
6146         functions to load shared objects.  Intended to encapsulate the non
6147         portable parts better and to reduce the number of #ifdefs in the
6148         code.
6150         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
6151         directory modules/ to the distribution.
6153 1998-11-15  René Seindal  <rene@seindal.dk>
6155         * Prerelease 1.4l.
6157         * modules/stdlib.c: New module `stdlib' defining some standard
6158         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
6159         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
6161         * src/builtin.c (shipout_string): New convenience function for
6162         builtins and modules.
6164         * src/module.c (module_load): Tentative support for
6165         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
6167         * Makefile.am (SUBDIRS): Directory modules added if configured.
6169         * modules/Makefile.am: Now correctly compiles and installs
6170         modules in pkglibexecdir.
6172         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
6173         These two are now initialised by autoconf macros.
6175         * src/path.c (module_env_init): MODULE_PATH is always on the
6176         search path.
6178         * src/Makefile.am: Now generated pathconf.h which defined the
6179         default MODULE_PATH.
6181         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
6182         where modules are installed.
6184         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
6185         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
6186         build and install automatically, and it is prepared for other
6187         interfacec than dlopen().
6189         * src/builtin.c (predefined_tab): Added __m4_version__ for the
6190         current version of GNU m4.  It is a GNU extension.
6192 1998-11-14  René Seindal  <rene@seindal.dk>
6194         * tests/Makefile.am (GENERATED_TESTS): Added new
6195         generated-tests/changesy.8.test
6197         * doc/m4.texinfo (Changesyntax): Documentation for escape
6198         syntax class.
6200         * src/macro.c (expand_token): Check for escaped macro call before
6201         symbol table lookup.
6203         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
6204         characters
6206         * src/input.c: New static variable use_macro_escape, which is TRUE
6207         iff some character has code SYNTAX_ESCAPE
6208         (input_init): Added initialisation of use_macro_escape.
6209         (check_use_macro_escape): New function to synchronise
6210         use_macro_escape with the syntax table.
6211         (set_quotes): Added call to check_use_macro_escape()
6212         (set_comment): Do.
6213         (set_syntax): Do.
6214         (next_token): Added new case for IS_ESCAPE.
6216         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
6218 1998-10-13  René Seindal  <rene@seindal.dk>
6220         * Prerelease 1.4k.
6222         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
6223         generated-tests.
6225         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
6226         maintained tests in tests/other-tests.  These currently tests for
6227         8-bit transparency, multiple precision arithmetic and sync-line
6228         output.  Test for stackoverflow detection does not work.
6230         * examples/Makefile.am (TESTS): Added tests for all example files.
6232         * examples/mktests.sh: New file.  Help program for creating test
6233         files.
6235         * tests/mkconfig.sh: New file to generate tests/config.m4 and
6236         tests/config.sh.  This is for tests of configure selectable
6237         features.  Picks up all set WITH_ and ENABLE_ veriables from
6238         config.h
6240         * src/path.c (path_search): Added argument 'char **expanded_name'
6241         to return the expanded name.
6243         * src/m4.h: Added 2nd argument to declaration of path_search().
6245         * src/m4.c (main): Added 2nd argument to path_search().
6247         * src/freeze.c (reload_frozen_state): Do.
6249         * src/builtin.c (m4_undivert): Do.
6250         (include): Do.
6252 1998-10-11  René Seindal  <rene@seindal.dk>
6254         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
6256         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
6258         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
6260         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
6262         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
6264         * intl/: Updated to GNU gettext 0.10.35.
6266         * doc/m4.texinfo (Format): Documented that format is blind.
6268         * src/builtin.c (builtin_tab): Builtin format marked as blind.
6270 1998-10-07  René Seindal  <rene@seindal.dk>
6272         * Prerelease 1.4j.
6274         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
6275         .test, as the files are no longer just m4 input.
6277         * tests/get-them (FILE): Changed .m4 extension to .test.
6279         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
6280         Otherwise quoted strings with leading whitespace first in a macro
6281         argument would be eliminated.
6283         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
6284         (expand_argument): Do.
6286         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
6287         grouped together iff both quote and comment strings are single
6288         character.  Otherwise they might include a comment/quote leader.
6289         (next_token): Returns new token type TOKEN_SPACE.
6291         * src/builtin.c (push_builtin_table): New function to push a
6292         builtin_table on the stack without installing its contents.
6293         (find_builtin_by_name): Added call to push_builtin_table() if
6294         reading frozen files.  Otherwise the builtins named in the frozen
6295         files could not be found.
6296         (install_builtin_table): Changed to use push_builtin_table()
6298 1998-10-04  René Seindal  <rene@seindal.dk>
6300         * po/pl.po: Polish translation added.
6302         * po/POTFILES.in: src/module.c added.
6304 1998-10-04  René Seindal  <rene@seindal.dk>
6306         * Prerelease 1.4i.
6308         * configure.in (ALL_LINGUAS): Added Polish pl.po
6310 1998-10-03  René Seindal  <rene@seindal.dk>
6312         * Many files: Incorporated changes to implement dynamic modules.
6313         Detailed comments in src/modules.c and modules/README
6315         * src/module.c: New file, implements the OS dependant parts of
6316         dynamic module loading.
6318         * src/Makefile.am (m4_SOURCES): Added module.c
6320         * src/builtin.h: New file, declares some functions from builtin.c
6321         that are of use for other modules (shipout_int, numeric_arg,
6322         skip_space, bad_argc), and the macros ARG() and DECLARE().
6324         * src/builtin.c (install_builtin_table): New function.  Each
6325         module brings in a builtin_table, which is pushed on a stack.
6326         (struct builtin_table): New struct for list of builtin_tables.
6327         (m4_loadmodule): New function to implement builtin "loadmodule".
6328         (shipout_int): No longer static, to be used by modules.
6329         (numeric_arg): do.
6330         (skip_space): do.
6331         (bad_argc): do.
6332         (builtin_init): changed to call install_builtin_table()
6333         (find_builtin_by_name): Now searches all builtin_tables
6334         (find_builtin_by_addr): do.
6336         * src/path.c: Reorganised to allow for two search paths, one for
6337         include files and one for modules.
6339         * src/m4.h: Added declarations for new functions in module.c and
6340         in path.c.
6342         * src/m4.c (main): Added call to module_init().
6344         * modules: New directory with a few demo modules.
6346         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
6347         in SUBDIRS.
6349         * configure.in: Added modules/Makefile to AC_OUTPUT.
6351         * configure.in: Added code to implement --with-modules.  Tests for
6352         <dlfcn.h> and -ldl.
6354         * acconfig.h: Added WITH_MODULES
6356 1998-10-02  René Seindal  <rene@seindal.dk>
6358         * examples/Makefile.am (pkgdata_DATA): Removed special target for
6359         check and variables TESTS.  These tests are now run from the
6360         tests/ directory.
6362         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
6363         directory.  The files stay there but the tests are run from the
6364         tests/ directory.
6366         * tests/Makefile.am (EXTRA_DIST): Added run-test.
6368         * tests/run-test: New file.  Run a test manually
6370         * tests/Makefile.am, tests/get_them: Moved automatically generated
6371         tests (from the manual) to sub directory tests/gentest/.  The
6372         tests/ directory had gotten a bit messy.
6374 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
6376         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
6377         wrap}.test: Added a few testcases.
6379 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
6381         * Prerelease 1.4h.
6383         * lib/Makefile.am (noinst_HEADERS): regex.h added
6385         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
6386         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
6388         * acm4/Makefile.am: created providing rules to create
6389         $(top_srcdir)/acinclude.m4 to be used by aclocal.
6391         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
6392         `C'. Reported by Ulrich Drepper.
6394         * Makefile.am (SUBDIRS): Removed checks directory
6395         * configure.in (AC_OUTPUT): Removed checks/Makefile
6397         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
6398         the space when m4.texinfo is edited and whitespace.el is active.
6399         (Defn,example): idem.
6401 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
6403         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
6404         ../COPYING. ../Makefile is a file which is certainly present when
6405         test is executed in testSubDir. One can't be sure that the COPYING
6406         file is in .. or ../.. in all situations, the ../Makefile is
6407         always there.
6409         * doc/m4.texinfo (Include): adjusted expected test output
6410         according to new tests, i.e. the input will always come from the
6411         file `in' created by the test.
6413         * tests/Makefile.am: Added three lines at the top to get
6414         esyscmd.1.test working.
6416         * tests/get-them: modified to generate clearer tests who will need
6417         less maintenance when new test examples are created in
6418         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
6419         need the generic file `defs') shell scripts creating `in', `ok',
6420         `out' and when apropriate `okerr' and `err' in the directory
6421         `testSubDir' when executed. The compare of `ok' and `out'
6422         (and of `okerr' and `err') will be the exit status of the test.
6423         `out' must match `ok' (and `okerr' must match `err') for the test
6424         to be succesful.
6426         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
6427         the tests generated by tests/get-them getting it input normally
6428         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
6429         (dot) before the numeric part) is reserved for all other (hand
6430         written) tests. The `+' means one or more times.
6432 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
6434         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
6435         supported short man page to refer to info documentation
6436         * helptoman.pl: added
6437         * configure.in: AC_PATH_PROG(PERL,perl)
6438         * Makefile.am (SUBDIRS): doc after src
6440         * libitized with libit 0.5 from
6441         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
6443         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
6444         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
6445          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
6446         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
6447           lib/rx.{c,h}: added
6448         * configure.in (AC_CHECK_FUNC): getopt_long
6450         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
6452         * TODO: added entry about dependencies
6454 1998-08-10  René Seindal  <rene@seindal.dk>
6456         * Prerelease 1.4f
6458         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
6459         "changesyntax".
6461         * src/builtin.c (m4_changesyntax): Added builtin macro
6462         "changesyntax" to modify the syntax table.
6464         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
6465         table.  All categories are assigned a syntax code and tokens are
6466         read according to this table.
6468 1998-08-09  René Seindal  <rene@seindal.dk>
6470         * src/numb.{c,h}: New files, implements multiple precision eval
6471         using GNU gmp.  Originally submitted by John Gerard Makecki
6472         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
6474         * doc/m4.texinfo (Eval): Added documentation for multiple
6475         precision arithmetic library support.
6477         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
6478         to accommodate multiple precision eval.
6480 1998-08-07  René Seindal  <rene@seindal.dk>
6482         * src/input.c (MATCH, match_input), src/m4.h: changed definition
6483         of comment and quote strings to `unsigned int' to allow eight bit
6484         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
6486         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
6487         patch from Mike Howard <mike@clove.com>
6489 1998-08-06  René Seindal  <rene@seindal.dk>
6491         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
6492         -lintl.
6494 1998-08-03  René Seindal  <rene@seindal.dk>
6496         * Prerelease 1.4e
6498         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
6499         and _ macro.  M4 now builds with --disable-nls.
6501         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
6502         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
6504         * configure.in (ALL_LINGUAS): Added complete list of translations:
6505         de fr it ja nl ru sv.
6507 1998-05-23  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
6509         * po/nl.po: Dutch translation by Erick Branderhorst.
6511         * po/fr.po: French translation by Erick Branderhorst, based on the
6512         translations by François Pinard in fr.msg and m4.cod.
6514 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
6516         * Prerelease 1.4d.
6518         * src/m4.c: #include <signal.h> not <sys/signal.h>.
6520         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
6522         * checks/Makefile.am: explicit list tests in CHECKS.
6524         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
6525         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
6526         mkinstalldirs, install-sh: Added automake (1.3) support.
6528         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
6529         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
6530         Used libitize (0.4) to update.
6532         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
6533         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
6534         README accordingly.
6536         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
6537         stack overflow functionality.
6539 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
6541         * Prerelease 1.4.1.
6543         * Makefile.in (realclean-local): Delete stamp-h.in.
6545         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
6546         Localize, adapting from how it is done in sharutils.
6548         * fr.tt: New file, for French.
6550         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
6551         src/freeze.c: Rename PRODUCT to PACKAGE.
6553 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
6555         * configure.in: Check for <libintl.h> and <locale.h>.
6556         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
6557         src/stackovf.c: Rename _ to __P.
6558         * src/m4.h: Declare _ as a macro returning its argument, or else,
6559         include <libintl.h> and declare _ as gettext.
6560         * src/m4.c: Possibly include <locale.h> and call setlocale.
6561         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
6562         src/input.c, src/macro.c, src/output.c, src/path.c,
6563         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
6564         strings.
6566 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
6568         * doc/Makefile.in (stamp-vti): Use new -r option to date.
6570         * configure.in: Put --with-gmp in place, in prevision for John
6571         Gerard's work.
6572         * acconfig.h: Document WITH_GMP.
6574 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
6576         * Release 1.4.
6578         * doc/Makefile.in (realclean): Also remove stamp-vti.
6579         Reported by Eric Backus.
6581 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
6583         * src/freeze.c (produce_frozen_state): If the frozen file cannot
6584         be opened, return immediately after producing the error message.
6585         Reported by Andreas Schwab.
6587         * configure.in: Check for const only after having found possible
6588         ANSIfying compiler flags, this is of no use to check it before.
6589         Reported by Alexander Lehmann.
6591 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
6593         * src/macro.c (collect_arguments): Cast obstack arguments to
6594         (voidstar), so avoiding compiler warnings.
6595         Reported by Joseph E. Sacco.
6597         * src/freeze.c (produce_frozen_state): Cast printed lengths to
6598         (int) so they correspond to %d format items.
6599         Reported by Joseph E. Sacco.
6601         * src/m4.c (main): Cast the argument to xfree to (voidstar).
6602         * src/symtab.c (free_symbol): Idem.
6603         Reported by Karl Vogel.
6605 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
6607         * Makefile.in (DISTFILES): Distribute BACKLOG.
6609         * configure.in: Define PRODUCT and VERSION.
6610         * acconfig.h: Document PRODUCT and VERSION.
6611         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
6612         constant string m4 and variable or parameter named version.
6614 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
6616         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
6617         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
6618         defines __STDC__ to 0, for indicating it is *not* ANSI!
6619         Reported by Kaveh R. Ghazi.
6621         * configure.in: Added obsolescent tests for AIX and Minix.
6623         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
6624         which texclean does not exist anymore.
6625         Reported by Eric Backus, Jim Meyering, John David Anglin and
6626         Joseph E. Sacco.
6628 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
6630         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
6631         Reported by John David Anglin.
6633         * src/ansi2knr.c: New version, sent by Peter Deutsch.
6634         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
6635         ANSI2KNR, depending on the fact the compiler is ANSI or not.
6636         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
6637         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
6638         of $U, put underline in extensions rather than in basenames.  Use
6639         implicit rules, now that regularity makes this possible.
6640         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
6641         of ansi2knr whenever it is needed.
6642         * configure.in: Adjusted for correct STACKOVF substitution.
6643         * src/debug.c (trace_format): When not __STDC__, use (...) as a
6644         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
6645         Reported by David MacKenzie.
6647         * Makefile.in: Remove binprefix.  Use transform_name instead.
6648         Reported by David MacKenzie.
6650         * doc/Makefile.in: Create version.texi, use it, clean it.
6651         Reported by Jim Meyering.
6653 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
6655         * Makefile.in (all, install, uninstall): Depend on Makefile.
6657         * Makefile.in: For actions invoking $(MAKE) from within compound
6658         sh statements, exit non-zero if the sub-make fails.  Otherwise,
6659         the top-level make may exit successfully when it should fail.
6660         Reported by Jim Kingdon.
6662         * {,/*}Makefile.in: Use && after all cd, in case they fail.
6664         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
6665         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
6666         * configure.in: Substitute PRODUCT and VERSION.
6668         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
6670 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
6672         * Makefile.in (mostlyclean-local): Do not remove *~.
6673         * */Makefile.in (mostlyclean): Idem.
6674         Reported by Robert E. Brown and Richard Stallman.
6676 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
6678         * src/m4.h: Get rid of CONFIG_BROKETS.
6680 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
6682         * configure.in: Use AC_ARG_PROGRAM.
6683         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
6684         Reported by David MacKenzie.
6686 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
6688         * configure.in: Do not add -O to CFLAGS for GNU C, now that
6689         configure does it automatically.
6690         Reported by Jim Meyering.
6692 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
6694         * src/stackovf.c: Declare the handler_t typedef earlier in the
6695         code, use it for stackovf_handler.
6696         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
6697         casting sigsegv_handler.
6698         Reported by Robert Bernstein.
6700         * src/m4.c (main): Initialize program_name to argv[0] without
6701         basename'ing it.
6702         Reported by Karl Berry.
6704 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
6706         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
6707         Reported by Karl Berry.
6709 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
6711         * lib/Makefile.in (mostlyclean): Added.
6712         (TAGS): Make in $(srcdir).
6714         * configure.in: Use `choke me' in test, like everywhere!
6716         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
6717         unreacheable and useless.
6719         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
6721         * lib/Makefile.in (DISTFILES): Distribute TAGS.
6722         (distclean): Do not remove TAGS.
6723         (realclean): Remove it.
6724         * Makefile.in: Make TAGS in lib also, not just in src.
6725         Reported by Karl Berry.
6727         * Makefile.in (distclean, realclean): Instead of recursively
6728         calling $(MAKE) for the -local part, allow parallel execution of
6729         -recursive and -local, only delay the removal of config.status,
6730         which is repeated in both goals.
6732 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
6734         * Release 1.3.
6736         * Makefile.in: Group all *clean-recursive goals in one, using sed
6737         to remove `-recursive' while calling make recursively.  Also, use
6738         a subshell for each recursive $(MAKE).
6739         Reported by Jim Meyering.
6741         * src/m4.h (memcpy): Define with bcopy for BSD systems.
6742         Reported by Kaveh R. Ghazi.
6744         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
6745         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
6746         specify it.
6748         * configure.in: Use date instead of touch for stamp-h.
6749         * Makefile.in (stamp-h.in): Idem.
6751         * Makefile.in (distclean, realclean): Force serial execution of
6752         both goals, in case parallel makes are being used.
6753         Reported by Jim Meyering.
6755         * src/Makefile.in (DISTFILES): Distribute TAGS.
6756         (distclean): Do not remove TAGS.
6757         (realclean): Remove it.
6758         Reported by Karl Berry.
6760 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
6762         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
6763         to old names, for following Autoconf.
6765 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
6767         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
6768         ./install.sh will not be correctly referred to in sub-Makefiles.
6769         Reported by John David Anglin.
6771         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
6772         Reported by Eric Backus.
6774         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
6775         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
6776         config.status into remaking this directory's Makefile only.
6777         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
6778         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
6779         Reported by Jim Meyering.
6781 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
6783         * configure.in: Correct stack overflow detection logic, taking
6784         care of systems having only incomplete implementations (like for
6785         Pyramid 9820 OSx 5.0d).
6786         Reported by Kaveh R. Ghazi.
6788         * src/Makefile.in (TAGS): Remote -t from etags call.
6790 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
6792         * lib/Makefile.in (install): Depend on all.
6794 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
6796         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
6797         Reported by Jim Meyering and John David Anglin.
6799         * Makefile.in (distclean-local): Delete config.log.
6800         Reported by Jim Meyering.
6802         Solidify frozen files with respect to -P:
6803         * src/m4.c: Have -P set prefix_all_buitins variable instead of
6804         calling a function by that name.  Declare the variable.
6805         * src/m4.h: Adjust declaration for prefix_all_buitins.
6806         * src/builtin.c (builtin_init): Merge in functionality from
6807         previous prefix_all_buitins function, while making entries in the
6808         symbol table, but not modifying the builtin description itself.
6810         * src/freeze.c (reload_frozen_state): Add a useless `break;',
6811         because *many* compilers do not accept an empty `default:'.
6812         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
6813         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
6815         * configure.in: Use AC_TYPE_SIGNAL.
6816         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
6817         Reported by Robert Bernstein.
6819         * checks/Makefile.in (check): Modify PATH so check-them will find
6820         m4 in the src directory.
6821         * Makefile.in (check): Don't.
6822         Reported by Akiko Matsushita and Jim Meyering.
6824         * src/output.c (make_room_for, output_character_helper): New
6825         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
6826         a per buffer MAXIMUM_BUFFER_SIZE.
6828         * src/output.c (output_text): New function, for optimizing the
6829         output of strings of characters.  Use it.
6831 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
6833         * doc, src: New directories reorganizing the distribution.
6834         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
6835         files.
6836         * Makefile.in: Adjusted.
6837         * configure.in: Configure new Makefiles.
6839         * m4.h: Declare STRING typedef.  Use it for comment and quote
6840         strings, adjusting all references.  (This is the rudiments of a
6841         beginning for the eventual withdrawal of NUL terminated strings.)
6842         * output.c (shipout_text): Accept a length parameter, and use it.
6843         All callers adjusted.
6845 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
6847         * m4.h: Include <unistd.h> if it exists.
6848         * stackovf.c: Don't.
6850         Clean up for current_diversion variable:
6851         * output.c: Move current_diversion from builtin.c.
6852         * m4.h: Declare current_diversion so builtin.c can access it.
6853         * output.c (output_init, make_diversion): Initialize or update
6854         current_diversion.
6855         * builtin.c (builtin_init, m4_divert): Leave current_diversion
6856         alone.
6858         Remove limit on number of diversions:
6859         * output.c: Replace ndiversion by diversions, declare it.
6860         (output_init): Allocate only diversion 0.
6861         (make_diversion): Allocate new diversions as needed.
6862         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
6863         * m4.c: Still accept -N, but do nothing with it.
6864         Reported by David MacKenzie.
6866         Freeze diversions:
6867         * output.c (freeze_diversions): New function.
6868         * m4.h: Declare freeze_diversions.
6869         * freeze.c: Document frozen file format, revise it, call
6870         freeze_diversions to add diversions to frozen format, and code to
6871         reload them properly.
6872         * m4.c: Do not undivert automatically at end when status being
6873         frozen.  Do not call builtin_init when reloading frozen state.
6875         Speed up diversion processing:
6876         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
6877         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
6878         structure and variables, cached variables out of output_diversion,
6879         reallocate_diversion_for and OUTPUT_CHARACTER.
6880         (shipout_text, make_diversion, insert_diversion): Adapted to new
6881         structures.
6882         (insert_file): Use better buffering.
6883         Reported by David MacKenzie.
6885 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
6887         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
6888         dist works from another build directory.
6890 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
6892         * symtab.c (hack_all_symbols): Use hash_table_size instead of
6893         constant HASHMAX, for -H option to work better.
6895         * builtin.c (DECLARE): Simplify by using _ ().
6897         * freeze.c: New file.
6898         * Makefile.in: Compile it, distribute it.
6899         * m4.c: Recognize, document and process --freeze-state (-F) and
6900         --reload-state (-R) options.  Pass a true flag to builtin_init
6901         only if no reloading some state.
6902         * builtin.c (define_builtin): Remove static specifier.
6903         (find_builtin_by_name): Remove static specifier.
6904         (builtin_init): Accept and obey a flag argument.
6905         * m4.h: Add declarations for freeze.c, changes for builtin.c.
6907 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
6909         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
6910         specifier.
6912         * configure.in: Implement --with-dmalloc.
6913         * acconfig.h: Document WITH_DMALLOC.
6914         * m4.h: Add code for when WITH_DMALLOC.
6916 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
6918         * m4.c (long_options): Use "error-output", the dash was missing.
6919         Reported by Akiko Matsushita.
6921 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
6923         * m4.h: Include <sys/types.h>.
6924         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
6925         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
6926         int.
6927         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
6928         as size_t, not int.
6929         * builtin.c (dump_args): Declare len as size_t, not int.
6931         * debug.c: Prototype the forward declaration of debug_set_file.
6933         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
6934         shadowing of this variable.
6935         * output.c (insert_diversion): Idem.
6937         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
6938         (input_init): Duplicate default quote and comment strings.
6939         (set_quotes): Free previous quote strings in all cases.  Duplicate
6940         even default quote strings.
6941         (set_comment): Free previous comment strings in all cases.
6942         Duplicate even default comment strings.
6944         * configure.in: Updated for Autoconf 2.0.
6945         * Makefile.in (distclean-local): Also delete config.cache.
6947         * m4.c (usage): Reorganize the --help output by topic.  Include a
6948         description for debugging flags.
6950 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
6952         * configure.in: If sigaction is available and SA_ONSTACK defined,
6953         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
6954         defined, use sigvec.  Else don't compile stackovf.c.
6955         * stackovf.c (setup_stackovf_trap): Idem.
6956         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
6957         and Simon Leinen.
6959 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
6961         * m4.c (usage): Replace printf par fputs.
6963 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
6965         * Release 1.2
6967 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
6969         * configure.in: Check for sigaction and sigvec.  Add a new delayed
6970         check for RLIMIT_STACK, combine in the checking for getrlimit.
6971         All those things are not universally available.
6972         * stackovf.c: Split setting up the trap handler and catching
6973         signals, for better taking care of various configure outcomes.
6974         * examples/stackovf.sh: Correct a typo.
6975         Reported by Eric Backus, Jim Avera and Jim Meyering.
6977 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
6979         * ansi2knr.c: New version sent by its author, Peter Deutsch.
6981 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
6983         * Makefile.in: Modify so parallel make will not try making
6984         lib/libm4.a twice simultaneously.
6985         Reported by Jim Meyering.
6987 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
6989         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
6990         error message, for when no code possibility exists.  Even if this
6991         line is completely #ifdef'ed out, it brings a syntax error.
6992         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
6994         * Makefile.in (install): Have install depend on all too, for lib
6995         to be remade as needed.
6997         * examples/stackovf.sh: Try ksh, bsh and bash for shells
6998         providing ulimit, instead of using only ksh.
6999         Reported by Jim Avera and Joseph E. Sacco.
7001 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
7003         * Makefile.in (check): Have it depend on all instead of m4.  In
7004         this way, a change in lib will be detected and processed.
7006         * builtin.c (numeric_arg): Use strtol and verify the conversion,
7007         instead of using sscanf which stops as soon as there is a
7008         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
7009         and divert(1xyzzy) were all accepted without any warning or error
7010         messages.
7011         * m4.h: Declare strtol as long if not including stdlib.h.
7012         * configure.in: Check for limits.h, and replace strtol if missing.
7013         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
7014         * lib/strtol.c: New file, from elsewhere.
7015         Reported by Andreas Schwab.
7017 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
7019         * macro.c (expand_macro): Cast value to (boolean) prior to
7020         assigning it to traced.
7021         Reported by Tom McConnell.
7023         * Makefile.in (m4): Always make all in lib first.
7024         Reported by Jim Meyering.
7026 1994-07-06  Jim Avera <jima@netcom.com>
7028         * stackovf.c: Isolated OS-dependent sections; Improved portability,
7029         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
7030         handlers), and a default error message if the fault address is not
7031         available (when neither siginfo.h nor BSD sigcontext are supported).
7032         * configure.in: Changes for stackovf.h: Check for sigcontext,
7033         sigaction, sigstack, and define rlim_t as int if necessary.
7034         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
7035         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
7036         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
7038 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
7040         * configure.in: Use AC_SET_MAKE.
7041         * Makefile.in: Use @SET_MAKE@.
7042         Reported by Jim Meyering.
7044         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
7045         Reported by Ian Taylor.
7047 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
7049         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
7050         because siginfo.h is unrelated to standard headers, and siginfo.h
7051         is already checked for.
7052         Reported by Joseph E. Sacco.
7054         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
7055         PROTOTYPES.
7056         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
7057         AC_PROTOTYPES.
7059 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
7061         * builtin.c (substitute): Use \& to represent this part of the
7062         string which was matched by the whole regexp, instead of
7063         representing the whole string.  Any usage of \0 issues a warning
7064         and acts like \&, it will disappear in some subsequent release.
7066 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
7068         * m4.c: Complete prototype for forwarded declaration of usage.
7070         * input.c (init_macro_token): Correct own reference in error
7071         message.  Previous name get_macro_func was referred to instead.
7072         (next_char):  Correct own reference in error message.  Previous
7073         name advance_input was referred to instead.
7075         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
7076         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
7077         and_term, not_term, logical_not_term, cmp_term, shift_term,
7078         add_term, mult_term, exp_term, unary_term, simple_term): Add
7079         prototype to forwarded declarations.  Declare parameter v1 as
7080         eval_t * instead of int *.  Same for local variable v2 in dyadic
7081         functions.  Same for result in exp_term.
7082         * builtin.c (m4_eval): Declare value as eval_t instead of int.
7083         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
7084         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
7085         (shipout_int): Cast first argument of ntoa to eval_t.
7086         Reported by Thorsten Ohl.
7088         * macro.c: Complete the prototypes of forwarded expand_macro and
7089         expand_token.
7090         Reported by Thorsten Ohl.
7092         * m4.h: Define voidstar as void * or char * depending on __STDC__.
7093         The Ultrix 3.1 compiler cannot do much with void pointers.
7095         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
7096         * m4.c (xfree):  Replace void * by voidstar.
7097         Reported by Tom McConnell.
7099         * ansi2knr.1: New, from elsewhere.
7100         * Makefile.in (DISTFILES): Distribute ansi2knr.1
7102         * Makefile.in (stamp-h.in): Avoid running ./config.status if
7103         stamp-h does not exist yet.  This avoids running it a second time
7104         just after the initial ./configure.
7105         Reported by David MacKenzie and Tom McConnell.
7107         * m4.h: Replace the enum debug_info declaration with a series of
7108         #define's.  The Ultrix 3.1 compiler would otherwise need casting
7109         (int) to most references, when used in expressions.
7110         Reported by Tom McConnell.
7112 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
7114         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
7115         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
7116         calls the compiler.  Previously, FP_PROTOTYPES was only calling
7117         the preprocessor; by not being subject to CFLAGS, this was
7118         discouraging those flags asking for ANSI compilation.
7119         * acconfig.h: Document HAVE_PROTOTYPES.
7120         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
7121         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
7122         Reported by Eric Backus.
7124         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
7125         from the environment.  Default CFLAGS to -g if not set.
7126         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
7127         * lib/Makefile.in: Have CFLAGS substituted from configure.
7128         Reported by Eric Backus and Tom McConnell.
7130         * configure.in: m4_undefine changeword before using AC_ENABLE.
7132         * m4.h: Declare prototypes for error (for ANSI compilers only),
7133         prefix_all_builtins and reference_error.
7134         Reported by Tom McConnell.
7136         * input.c (set_word_regexp): Do not try to initialize the array
7137         test from a string, this does not work with non-ANSI compilers.
7138         Reported by Eric Backus.
7140         * Makefile.in (dist): Clean examples/ before saving it.
7141         (distclean-local): Also remove stamp-h.
7142         Reported by Eric Backus.
7144         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
7145         non ANSI compilers.
7146         Reported by Tom McConnell.
7148         * checks/Makefile.in (clean): Depends on mostlyclean.
7149         (mostlyclean): New goal.
7151 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
7153         * Makefile.in (DISTFILES): Distribute install.sh.
7154         * install.sh: New file, copied from elsewhere.
7155         Reported by Assar Westerlund and Kaveh R. Ghazi.
7157 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
7159         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
7160         * acconfig.h: Explain ENABLE_CHANGEWORD.
7162         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
7163         from code provided by Pete Chown]
7164         * m4.h: Add original_text field to u_t variant of union u.
7165         Declare TOKEN_DATA_FUNC macro.
7166         * builtin.c: Declare changeword.
7167         (m4_changeword): New function.
7168         * input.c: Include "regex.h", define variables with word regexps.
7169         (input_init): Initialize the word regexp.
7170         (set_word_regexp): New.
7171         (next_token): Declare local variables, use the previous code if
7172         default_word_regexp is true.  Else, match using a new code.  Save
7173         the original text.
7174         * macro.c (expand_token): Ship out original text if not a macro
7175         name.
7176         Reported by Krste Asanovic and Pete Chown.
7178         [These modifs all depend upon ENABLE_CHANGEWORD]
7179         * m4.h: Declare external user_word_regexp.
7180         * m4.c: Declare user_word_regexp, and initialize it from
7181         --word-regexp or -W, or NULL if not specified.
7182         * input.c: Use user_word_regexp if specified, instead of
7183         DEFAULT_WORD_REGEXP.
7185         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
7186         agree with it.
7188         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
7189         * checks/Makefile.in: Empty the suffix list.
7190         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
7192         * m4.c: Declare nesting_limit and initialize it to 250.
7193         Implement -LNUMBER or --nesting-limit=NUMBER to change its
7194         value.
7195         * m4.h: Declare nesting_limit as external.
7196         * macro.c (expand_macro): Stop execution whenever nesting limit
7197         is exceeded.
7198         Reported by Bengt Mertensson.
7200         * eval.c (evaluate): Diagnose excess characters in eval input.
7201         Things like `eval(08)' used to return 0 with no diagnostic.
7203         * m4.h: Capitalize first letter of all macro arguments in
7204         definitions.
7206         * m4.c: Declare warning_status, initialize it to 0.  Add new
7207         option -E, or --fatal-warnings, which sets warning_status to
7208         EXIT_FAILURE instead.
7209         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
7210         EXIT_FAILURE if not otherwise done by header files.
7211         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
7212         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
7213         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
7214         argument of all M4ERROR calls.
7215         Reported by Noah Friedman.
7217         * examples/incl-test.m4: Renamed from incl_test.m4.
7218         * examples/include.m4: Include incl-test.m4 instead of
7219         incl_test.m4.
7220         * examples/multiquotes.m4: Renamed from multi-quotes.m.
7222 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
7224         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
7225         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
7226         also tested it on a Sun Sparc workstation running SunOS 4.x.
7228         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
7229         49.format check, abusing a `union values' argument with sprintf
7230         without selecting the proper field.  Now, save the formatting type
7231         first, delaying the fetch of the corresponding argument.
7232         Reported by Joseph E. Sacco and Tom Quinn.
7234         * format.c (format): Remove const from char *fmt declaration when
7235         not HAVE_EFGCVT, because a NUL may be forced into it.
7237         * m4.h: Declare atof() when not STDC_HEADERS.
7238         Reported by Joseph E. Sacco.
7240         * Regenerate configure using Autoconf 1.11, this corrects a
7241         problem about an incorrect cpp seting on NeXT 3.1.
7242         Reported by Alexander Lehmann.
7244 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
7246         * m4.h (_): Change argument from `x' to `Args'.
7248 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
7250         * m4.h: Rename Args() to _().
7251         * m4.h: Remove extern specifier from all function declarations.
7253 1994-04-22  Jim Avera <jima@netcom.com>
7255         * stackovf.c: New file implementing stack-overflow detection.
7256         * configure.in: Check for getrlimit, sigaction.  If all of
7257         standard headers, getrlimit and sigaction, define USE_STACKOVF and
7258         substitute ${U}stackovf.o for STACKOVF.
7259         * acconfig.h: Declare USE_STACKOVF.
7260         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
7261         * m4.h: Declare setup_stackovf_trap().
7262         * m4.c: Call setup_stackovf_trap().
7263         * tests/stackovf_test.sh: New file.
7265 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
7267         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
7269         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
7271 1994-01-30  François Pinard  <pinard@iro.umontreal.ca>
7273         * m4.h: Remove definition of volatile, not used anymore.
7274         Reported by Jim Meyering and Joseph E. Sacco.
7276         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
7277         of `if ... else /* nothing */' for if macros.
7278         Reported by Jim Meyering.
7280         * builtin.c (m4_regexp): Reorganize the code for avoiding a
7281         warning from gcc about `repl' possibly used before defined.
7282         Reported by Jim Meyering.
7284         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
7285         Reported by Jim Meyering.
7287 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
7289         * m4.h: Move the conditional definition of volatile after the
7290         inclusion of system files, because they may define it first.
7292 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
7294         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
7295         get around a problem with Alpha make seeing a syntax error, there.
7296         Reported by Vern Paxson.
7298 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
7300         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
7301         Reported by Richard Stallman.
7303 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
7305         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
7306         instead of AC_HAVE_FUNCS.
7307         Reported by Noah Friedman.
7309 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
7311         * m4.c: Initialize show_help and show_version to zero.
7313         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
7314         Use them in exit() and usage() calls.
7316 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
7318         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
7319         syserr() macro.  Delete errref, add reference_error and M4ERROR.
7320         * m4.c: Replace errref, which was returning an input reference
7321         string, with reference_error, which prints it on standard error.
7322         * builtin.c, output.c: Use errno as second parameter to error,
7323         instead of using syserr() with %s.
7324         * *.c: Use M4ERROR instead of error: no more errref() with %s.
7325         Doing so, the program name appears after the input reference
7326         instead of before, which eases M-x next-error processing.
7328 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
7330         * checks/get-them: Escape braces with backslashes in patterns,
7331         because HPUX-9.01 awk needs this.
7332         Reported by Jim Meyering.
7334 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
7336         * builtin.c: Declare "FILE *popen ();".
7338         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
7339         macros, replace error_message_prefix() declaration by errref()'s.
7340         Declare xrealloc, for use in errref().
7341         * m4.c: Delete error_message_prefix() function, add errref().
7342         * *.c: Use error() systematically in place of all error macros,
7343         now that error() flushes stdout first.  Make needed adjustments.
7345         * m4.h: Remove const in sys_errlist[] declaration, it creates
7346         conflicts on SGI and Alpha.
7347         Reported by Kaveh R. Ghazi.
7349 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
7351         * m4.c: Include <getopt.h> instead of "getopt.h".
7353         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
7354         * acconfig.h: New, for documenting HAVE_EFGCVT.
7355         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
7356         use them wherever appropriate.  Also use -I. for compilations.
7357         * lib/Makefile.in: Use -I.. for compilations.
7358         * *.c: Include <config.h> or "config.h".
7360         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
7361         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
7363 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
7365         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
7367         * input.c (input_init): Initialize quote and comment strings
7368         explicitely instead of calling set_quotes and set_comment: by
7369         doing so, we ensure we do not free uninitialized variables.
7371         * checks/check-them: Reverse arguments to both diff, so the
7372         expected is on the left and the obtained on the right.
7374         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
7375         macros. Delete declarations for m4error, warning, fatal and
7376         internal_error, add declaration for error_message_prefix.
7377         * m4.c:  Delete m4error, warning, fatal and internal_error
7378         routines, add error_message_prefix routine.
7379         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
7380         warning with WARNING*, fatal with FATAL* and internal_error with
7381         INTERNAL_ERROR*.
7382         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
7383         this is not needed anymore.
7385         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
7386         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
7387         and debug_message, add declaration for debug_message_prefix.
7388         * debug.c: Remove static specifier for FILE *debug declaration.
7389         Delete debug_print and debug_message routines, add
7390         debug_message_prefix routine.
7391         * builtin.c, debug.c: Replace debug_print routine calls with
7392         DEBUG_PRINT* macro calls.
7393         * input.c, path.c: Replace debug_message routine calls with
7394         DEBUG_MESSAGE* macro calls.
7396         * m4.h: Remove inclusion of <varargs.h>.
7397         * debug.c: Include <stdarg.h> or <varargs.h>.
7398         (trace_format): Use stdarg instead of varargs if __STDC__.
7400         * configure.in: Remove checks for vfprintf and _doprnt.  These
7401         implementations use varargs tricks which are not portable enough.
7402         * lib/vfprintf.c: Deleted.
7403         * lib/_doprnt.c: Deleted.
7404         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
7405         Reported by Joel Sherrill.
7407         * path.c (add_include_directory): Use xstrdup.
7409         * builtin.c (find_builtin_by_name): Declare static.
7411         * *.[ch]: Add const to a few "char *" declarations.
7413         * configure.in: Remove commented tests for fileno() and fstat().
7414         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
7416         * debug.c (debug_flush_files): New.
7417         * m4.h: Declares it.
7418         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
7419         Reported by Nicolas Pioch.
7421 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
7423         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
7424         Reported by Joel Sherrill.
7426         * builtin.c (prefix_all_builtins): Instead of the table size, use
7427         the null entry at end for stopping the loop.  It was overwritten.
7428         Reported by Andreas Schwab and Jim Meyering.
7430         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
7431         Reported by Kaveh R. Ghazi.
7433         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
7434         Reported by Karl Vogel.
7436 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
7438         * m4.h: Do not define volatile if already defined.
7439         Reported by René Seindal.
7441         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
7443         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
7444         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
7446 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
7448         * m4.h: Define strchr and strrchr in terms of index and rindex,
7449         instead of the other way around.
7450         * builtin.c, m4.c, path.c: Use strchr instead of index.
7452         * input.c (next_char): Remove a "break;" after a "return ...;".
7453         Reported by Tom McConnell.
7455 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
7457         * Release 1.1
7459         * configure.in: Do not copy check files in the build hierarchy.
7460         * checks/check-them: Identify the m4 version being checked.  For
7461         finding m4, look in $PATH instead of in the parent directory.
7462         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
7463         * checks/Makefile.in (.all-stamp): Always create check files in
7464         the source hierarchy, not anymore in the build hierarchy.
7465         (check): cd to the source hierarchy before performing checks.
7466         Do not copy nor clean COPYING anymore, take it from `..'.
7467         Reported by Tom McConnell.
7469         * Makefile.in (Makefile): Use $(SHELL).
7470         (config.status): Use $(SHELL).  Use "config.status --recheck"
7471         instead of "configure --no-create", which is obsolete.
7472         Reported by Tom McConnell.
7474 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
7476         * m4.c (usage): Use "%s" instead of "m4" in format string.
7477         Reported by Jim Meyering.
7479         * Makefile.in: Distribute mkinstalldirs.
7480         Reported by Pierre Gaumond.
7481         Reported by Jim Meyering.
7482         Reported by Tom McConnell.
7483         Reported by Andreas Gustafsson.
7485         * checks/check-them: Renamed from checks/check_them.
7486         * checks/get-them: Renamed from checks/get_them.
7487         * checks/.all-stamp: Renamed from checks/.all_stamp.
7488         * checks/Makefile.in: Changed accordingly.
7489         Reported by Jim Meyering.
7491 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
7493         * lib/Makefile.in (dist): Correct permissions on files.
7495         * output.c: Declare tmpfile, some systems don't.
7497 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
7499         * checks/Makefile.in (dist): Correct permissions on files.
7501         * Makefile.in (dist): Ensure recursive linking for subdirectory
7502         `examples', also set read/write permissions on all its files.
7504         * mkinstalldirs: New, from elsewhere.
7505         * Makefile.in: Use it.
7507         * debug.c: Synchronize debug messages and regular output when
7508         the debug file and stdout are redirected to the same file.
7509         * configure.in: Add (commented) checks for fileno and fstat.
7510         Reported by Jim Avera.
7512         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
7513         etc., arguments, then ignore the superfluous one.  m4 used to
7514         diagnose missing arguments and return the empty string.
7515         Reported by Nick S. Kanakakorn.
7517 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
7519         * m4.c (main): At end of all input, ensure all undiverted text
7520         goes to the main output stream.
7521         Reported by Andreas Gustafsson.
7523         * m4.c (main): exit (0), instead of return 0.
7525         * m4.c: Implement -P and --prefix-builtins.
7526         * builtin.c: Delete const specifier on builtin_tab.
7527         (prefix_all_builtins): New.
7528         Reported by Noah Friedman.
7529         Reported by Scott Bartram.
7531         * c-boxes.el: New, from elsewhere.
7532         * Makefile.in: Distribute it.
7534         * m4.h: Do not define bcopy if <string.h> defines it.
7535         Reported by Stephen Perkins.
7537         * builtin.c (define_macro): Allow a missing second argument, in
7538         which case it is implied empty.  Affects define and pushdef.
7539         Reported by Eric Allman.
7541 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
7543         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
7544         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
7545         * builtin.c: Initialize all the blindness fields in builtin_tab.
7546         (define_builtin): Copy the blindness of a builtin into its symbol.
7547         * macro.c (expand_token): Avoid processing a blind builtin if the
7548         next character is not an opening parenthesis.
7549         Reported by David MacKenzie.
7550         Reported by Noah Friedman.
7552         * configure.in: Ensure an exit status of 0 on completion.
7553         Reported by Vivek P. Singhal.
7555         * eval.c (eval_lex): Admit both lower and upper case letters for
7556         bases greater than 10.  Only lower case letters were accepted.
7558         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
7559         Reported by Krste Asanovic.
7561         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
7562         * eval.c (logical_not_term): New name for not_term.
7563         * eval.c (xor_term): New, between or_term and and_term.
7564         * eval.c (not_term): New, between and_term and logical_not_term.
7565         * eval.c (shift_term): New, between cmp_term and add_term.
7566         Reported by Krste Asanovic: ~, ^, <<, >>.
7567         Reported by Ben A. Mesander: ** vs ^.
7569         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
7570         * m4.h: Delete xrealloc.c.
7571         * lib/xmalloc.c: New, from elsewhere.
7572         * lib/xstrdup.c: New, from elsewhere.
7573         * lib/Makefile.in: Distribute and compile them.
7575         * m4.c: Change progname to program_name.
7576         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
7577         * lib/error.c: New, from elsewhere.
7578         * lib/Makefile.in: Distribute and compile error.c.
7579         * configure.in: Check AC_VPRINTF and for strerror.
7580         * m4.c: Delete cmd_error.  Use error instead.
7581         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
7583         * m4.h: Delete #define const, let Autoconf takes care of this.
7585         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
7586         Merge parse_args into main.  Declare argv to be `char *const *',
7587         then remove superfluous casts.
7589         * m4.c: Rename --no-gnu-extensions to --traditional.
7590         Reported by Ben A. Mesander.
7592         * m4.c (usage): Add a status parameter.  Supply one in various
7593         calls.  Add --help processing.  Remove -V for --version.
7595         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
7597         * lib/Makefile.in: Have an AR=ar declaration.
7598         Reported by Eric Backus.
7599         Reported by Bjorn R. Bjornsson.
7600         Reported by Tom Tromey.
7601         Reported by Kristine Lund.
7602         Reported by Marion Hakanson.
7604 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
7606         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
7607         Reported by Noah Friedman.
7609 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
7611         * Makefile.in: Remove MDEFINES and cleanup.
7613 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
7615         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
7616         Create a gzip file.
7618 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
7620         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
7621         ensure 777 mode for directories, so older tar's will restore file
7622         modes properly.
7624 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
7626         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
7627         so the installer can override automatically configured choices.
7628         Reported by Karl Berry.
7630 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
7632         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
7633         previous version was not working properly on m68k-hp-bsd4.3.
7634         Reported by Roland McGrath.
7636         * lib/_doprnt.c: Stolen from Oleo distribution.
7637         * configure.in: Check for _doprnt.c if vfprintf.c selected.
7638         * lib/Makefile.in: Distribute _doprnt.c.
7639         Do not distribute regex.[ch].old anymore.
7641 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
7643         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
7644         Richard wants it there.
7646 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
7648         * Makefile.in: Add DEFS to MDEFINES.
7649         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
7650         (libm4.a): Remove the library before creating it.
7651         (distclean): Remove tags and TAGS too.
7653 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
7655         * Makefile.in (dvi, m4.dvi): New goals.
7657         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
7658         macro.c, output.c, path.c, symtab.c: Change Copyright from
7659         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
7661         * examples/divert.m4: Deleted, this bug has been corrected.
7663         * Makefile.in (texclean, mostlyclean): New goals.
7665         * Makefile.in (clean): Remove clutter from ansi2knr.
7666         Reported by Pierre Gaumond.
7668 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
7670         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
7671         might well use CFLAGS is s/he needs it.
7673         * Makefile.in: Allow installation of info files from a separate
7674         build directory.
7675         Reported by Jason Merrill.
7676         Reported by David MacKenzie.
7677         Reported by Skip Montanaro.
7678         Reported by Erez Zadok.
7679         Reported by Assar Westerlund.
7681 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
7683         * Release 1.0.3
7684         This is still a beta release for the future GNU m4 version 1.1.
7686         * lib/alloca.c: New, from elsewhere.
7687         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
7689         * m4.h: Do not define index/rindex if already defined.  If
7690         FALSE/TRUE are already defined, do not redefine them, but merely
7691         define boolean typedef to int.
7693         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
7694         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
7695         because some C compilers do not like connectives with #ifdef.
7696         * m4.h: Define `volatile' only if __GNUC__, instead of once for
7697         __GNUC__ and once for __STDC__.
7698         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
7700         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
7701         Makefile dependencies.  Without it, make keeps destroying and
7702         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
7704         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
7705         to diversion/DIVERSION, this was a spelling error.
7707         * m4.c: Declare version[], remove #include "version.h".
7708         * version.h: Deleted.
7709         * Makefile.in: Remove references to version.h.
7711         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
7712         production, by using a simpler and more robust algorithm.  This
7713         solves the problem of synclines sometimes written in the middle of
7714         an output line.  Delete sync_line() and output_lines variable.
7715         * m4.h: Remove sync_line prototype and output_lines declaration.
7716         * input.c (next_char), output.c (shipout_text): Remove references
7717         to output_lines.
7718         * input.c (push_file, pop_file): Merely put the value -1 in
7719         output_current_line instead of calling sync_line, for delaying a
7720         single `#line NUM FILE' before next output line.  Do not test
7721         for sync_output, because this is unnecessary clutter.
7722         * output.c (make_divertion, insert_divertion): Idem.
7723         * input.c: Rename must_advance_line to start_of_input_line, for
7724         consistency.
7726         * debug.c (trace_header): Select a new debug line format, which
7727         better complies with GNU standards for formatting error messages.
7728         With option `-dfl', M-x next-error might be used on the output.
7729         * m4.c (vmesg): Adjust format of error output to GNU standards.
7730         * m4.texinfo: Adjust examples for `make check' to work.
7732         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
7733         case for enum debug_info constants, which were all lower case.
7735         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
7736         re_search_2.
7737         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
7738         collected patches.  I tried a few times using newer regex.[ch], it
7739         mysteriously stopped aborting with this one.  Insecure feeling...
7740         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
7742 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
7744         * m4.c: Change `--no-warnings' to `--silent'.
7745         Reported by David MacKenzie.
7747         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
7748         leave it off for now.  See comment in m4.c for justification.
7749         Reported by David MacKenzie.
7751         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
7752         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
7754         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
7756         * Makefile.in: Ensure recursive cleaning is done before local
7757         cleaning for all clean goals.
7759         * builtin.c (ntoa): Ensure the value is always interpreted as a
7760         signed quantity, whatever the radix is.
7762 1992-11-18  Jim Meyering  <meyering@idefix>
7764         * builtin.c, format.c, input.c: Split long lines.
7765         * m4.c: Use typedef macro_definition instead of struct
7766         macro_definition.
7767         * symtab.c: Use typedef symbol instead of struct symbol.
7769 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
7771         * *.[ch]: Remove all trailing whitespace, in code and comments.
7773         * configure.in: Find some awk.
7774         * Makefile.in: Add $(AWK) to MDEFINES.
7775         * checks/Makefile.in: Transmit $(AWK) to get_them.
7776         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
7777         awk script when switching files, because without this, mawk runs
7778         out of file descriptors.
7780 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
7782         * Makefile.in (realclean): Delete m4.info*.
7783         Reported by Jim Meyering.
7785         * Makefile.in: Adjust and link with checks/Makefile.
7786         * checks/Makefile.in: New.
7787         * configure.in: Output checks/Makefile.
7789         * checks/get_them: Have the dnl header of each test more
7790         recognizable by next-error, also use a better message.
7792 1992-11-16  Jim Meyering  <meyering@idefix>
7794         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
7795         And use that only if __GNUC__ since we're using it's GCC-specific
7796         semantics that tell the compiler the associated function doesn't
7797         return.
7799         * builtin.c (substitute): Don't use character as an array index.
7800         (dumpdef_cmp): Make formal arguments `const void *' to avoid
7801         warnings with gcc -W -Wall on systems with qsort prototype.
7802         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
7803         from gcc -W -Wall.
7805         * eval.c (most functions): Add parentheses to assignments used
7806         as truth values go avoid warnings from gcc -Wall.
7808         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
7809         any functions that don't need external scope.
7811         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
7812         (many functions and arrays): Declare `const'.
7814 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
7816         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
7817         removing the declaration from m4.h.  Also rename false to FALSE
7818         and true to TRUE.
7820         * lib/Makefile.in (Makefile): New goal.
7822         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
7823         so heavily loaded.  It gets more easily overridable, calling make.
7824         Reported by Jim Meyering.
7826         * Makefile.in (dist): Get .fname from the current directory name,
7827         instead of from version.h.  I need updating many files manually,
7828         when the version changes, version.h is just one of them.
7830 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
7832         * m4.h: Remove the tag `boolean' on the enum introducing typedef
7833         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
7834         Reported by Tom McConnell.
7836 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
7838         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
7839         39.cleardiv, which were describing missing or spurious newlines.
7840         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
7841         do not depend on machine word size, `/bin/false' implementation,
7842         or `wc' output format.  `make check' is more dependable, now.
7844         * checks/check_them: Summarize the failed tests by listing their
7845         name, at end.  If none, issue `All checks successful'.  Output
7846         `Checking' instead of `Input file:'.
7848         * checks/get_them, checks/check_them: Reindented.
7850         * Makefile.in (dist): chmod a+r before making the tar file.
7852 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
7854         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
7856         * input.c (next_token): Reinitialize token_buttom just after using
7857         it as a watermark with obstack_free.  Or else, a future token, big
7858         enough for triggering reallocation of the obstack chunk, could
7859         void the initialized value of token_buttom, later causing panic in
7860         obstack_free.  Rename token_buttom to token_bottom everywhere.
7862         * m4.h: Before declaring errno, first include <errno.h> and
7863         ensure that it does not define errno.
7864         Reported by Richard Stallman.
7866 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
7868         * builtin.c: Define and use DECLARE macro for builtins.
7870         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
7871         argument, this is a common idiom for introducing long comments.
7873         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
7874         arguments.  The last argument was silently ignored.
7876         * m4.c (cmd_error): Add a missing semicolon before va_end().
7878 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
7880         * Makefile.in: Now handle protoized sources.  Define and use U.
7881         Compile and use ansi2knr with old compilers.  Update DISTFILES.
7882         Add `aclocal.m4' to `configure' dependencies.
7883         * ansi2knr.c: New, from Ghostscript distribution.
7884         * configure.in: Define U through FP_PROTOTYPES for old compilers.
7885         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
7886         * aclocal.m4: New, provide FP_PROTOTYPES.
7887         * m4.h: Conditionnaly protoized through Args, save for varags.
7888         * builtin.c: Protoized.  Then:
7889         Include <sys/types.h> if size_t is not defined, before "regex.h".
7890         (m4_ifelse): Fetch built-in name properly for diagnostic.
7891         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
7892         (m4_regexp): Add const to `msg' declaration.
7893         (m4_patsubst): Add const to `msg' declaration.
7894         * debug.c: Protoized, save for varargs.
7895         * eval.c: Protoized.
7896         * format.c: Protoized.
7897         * input.c: Protoized.
7898         * m4.c: Protoized, save for varargs.  Then:
7899         (xfree): Accept void * instead of char *.
7900         (xmalloc): Return void * instead of char *.
7901         (xrealloc): Accept and return void * instead of char *.
7902         * macro.c: Protoized.
7903         * output.c: Protoized.
7904         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
7905         * symtab.c: Protoized.
7907 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
7909         * m4.texinfo: Remove directory from diagnostics in 30.include,
7910         51.eval, 56.errprint and 57.m4exit tests.
7912         * m4.h: Remove declarations for int or void system functions, they
7913         cause more conflicting trouble than they make good.
7915         * configure.in: Avoid configuration header file.  Add some tests.
7916         * m4.h: Remove #include "config.h".
7917         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
7918         Then, rewritten for better compliance with GNU standards.
7920 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
7922         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
7923         because of a misplaced #endif.
7925         * Many *.[hc] files: Correct intra-line spacing here and there,
7926         according to GNU indent 1.6 advice.
7928         * configure.in: New, using Autoconf 1.2.
7929         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
7930         * Delete old configure.in, configure, etc/configure.in,
7931         etc/configure, lib/configure.in, lib/configure and config/*.
7932         Reported by Jason Merrill.
7934         * symtab.c (hash): Change (char) NULL to '\0'.
7935         Reported by Jason Merrill.
7937         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
7938         etc/nextvers.sh.  Release numbers will be edited `by hand'.
7939         * version.h: De-automatize, force value in.
7941         * m4.c: Changes in order to use a newer getopt.h.
7942         Reported by David MacKenzie.
7944         * checks/: New name for examples/.
7945         * checks/get_them: New location for etc/get_examples.
7946         * checks/check_them: New location for etc/check_examples.
7947         * Makefile.in, checks/get_them, checks/check_them: Adjust.
7948         * lib/vfprintf.c: New location for etc/vfprintf.c.
7949         * Delete empty etc/.
7950         * examples/: New name for test/.
7952 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
7954         * Makefile.in (check): Add m4 as dependency.
7956         * m4.c: Accept --no-warnings instead of --no_warnings, and
7957         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
7958         usage message more informative.
7959         Reported by David MacKenzie.
7961 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
7963         * etc/check_examples: New name for check_examples.sh.
7964         * etc/get_examples: New name for get_examples.sh.
7965         * Makefile.in, etc/Makefile.in: Use new names.
7967         * Makefile.in: Transmit $(CC) while making in lib.
7969         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
7970         code disposition by hand.
7972 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
7974         * m4.h: Delete definitions for abort() and exit().
7975         Reported by Richard Stallman.
7977         * config/hmake-unicos, config/s-unicos.h: New files.
7978         Reported by Hal Peterson.
7980         * eval.c (exp_term): Have N^0 return 1.
7981         Reported by Michael Fetterman.
7983         * eval.c, input.c, m4.h: Remove last comma in enums.
7984         Reported by Mike Lijewski.
7986         * Transfer of maintenance duties from René to François.
7988 1991-10-24  René Seindal <seindal@diku.dk>
7990         * Release 1.0.  Many thanks to those, who provided me with bug
7991         reports and feedback.
7993         * Uses GNU configure, taken from the gdb distribution.
7995         * Uses GNU getopt(), with long option names.
7997         * The -Q/+quiet option is added, which suppresses warnings about
7998         missing or superflous arguments to built-in macros.
8000         * Added default options via the M4OPTS environment variable.
8002         * The built-in format can now be configured to use sprintf as
8003         the formatting engine, for systems without [efg]cvt(3).
8005         * GNU library code is moved to the ./lib subdirectory; other
8006         utility files are now in ./etc.
8008         * Several minor bugs have been fixed.
8010 1991-07-26  René Seindal <seindal@diku.dk>
8012         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
8013         François Pinard and Roland H. Pesch for providing me with reports.
8015         * The builtins incr and decr are now implemented without use of
8016         eval.
8018         * The builtin indir is added, to allow for indirect macro calls
8019         (allows use of "illegal" macro names).
8021         * The debugging and tracing facilities has been enhanced
8022         considerably.  See the manual for details.
8024         * The -tMACRO option is added, marks MACRO for tracing as soon
8025         as it is defined.
8027         * Builtins are traced after renaming iff they were before.
8029         * Named files can now be undiverted.
8031         * The -Nnum option can be used to increase the number of
8032         divertions available.
8034         * Calling changecom without arguments now disables all comment
8035         handling.
8037         * The function m4_patsubst() is now consistently declared
8038         static.
8040         * A bug in dnl is fixed.
8042         * A bug in the multi-character quoting code is fixed.
8044         * Several typos in the manual has been corrected.  More probably
8045         persist.
8047         * The m4.info file is now installed along with the program.
8049 1990-11-15  René Seindal <seindal@diku.dk>
8051         * Updated and enhanced version.  Release 0.75, manual 0.07.
8053         * Implemented search path for include files (-I option and
8054         M4PATH envronment variable).
8056         * Implemented builtin "format" for printf-like formatting.
8058         * Implemented builtin "regexp" for searching for regular
8059         expressions.
8061         * Implemented builtin "patsubst" for substitution with regular
8062         expressions.
8064         * Implemented builtin "esyscmd", which expands to a shell
8065         commands output.
8067         * Implemented "__file__" and "__line__" for use in error
8068         messages.
8070         * Implemented character ranges in "translit".
8072         * Implemented control over debugging output.
8074         * Implemented multi-character quotes.
8076         * Implemented multi-character comment delimiters.
8078         * Changed predefined macro "gnu" to "__gnu__".
8080         * Changed predefined macro "unix" to "__unix__", when the -G
8081         option is not used.  With -G, "unix" is still defined.
8083         * Changed "shift", "$@" and "$*" to not insert spaces afters
8084         commas.
8086         * Added program name to error messages.
8088         * Fixed two missing null bytes bugs.
8090 1990-01-22  René Seindal <seindal@diku.dk>
8092         * Initial beta release.  Release 0.50, manual 0.05.
8095         -----
8097         $Revision$ $Date$
8099         Local Variables:
8100         coding: utf-8
8101         End:
8103         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
8104         2005, 2006 Free Software Foundation, Inc.
8106         Copying and distribution of this file, with or without
8107         modification, are permitted provided the copyright notice
8108         and this notice are preserved.