Clean up example on filtering defined symbols.
[m4.git] / ChangeLog
blob1832be174726958d8428e7be8d622ce280e9bc7f
1 2008-02-19  Eric Blake  <ebb9@byu.net>
3         Clean up example on filtering defined symbols.
4         * doc/m4.texinfo (Foreach, Improved foreach): Document another
5         shortcoming in foreach.m4, and improve filter example by using
6         foreach2.m4.
8         * src/main.c (usage): Fix typo.
10 2008-02-18  Eric Blake  <ebb9@byu.net>
12         Avoid some magic numbers.
13         * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
14         (CHAR_RETRY): Define in terms of UCHAR_MAX.
15         * m4/syntax.c (m4_syntax_create, set_syntax_set)
16         (reset_syntax_set, check_is_single_quotes)
17         (check_is_single_comments, check_is_macro_escaped)
18         (m4_set_quotes, m4_set_comment): Likewise.
19         * modules/gnu.c (regexp_compile): Likewise.
20         * modules/m4.c (translit): Likewise.
21         * src/freeze.c (produce_syntax_dump): Likewise.
22         Reported by Ralf Wildenhues.
24 2008-02-16  Eric Blake  <ebb9@byu.net>
26         Add regression test for multi-character quote recursion.
27         * examples/foreach2.m4: Use $0 rather than spelling out name.
28         * examples/foreachq2.m4: Likewise.
29         * examples/forloop2.m4: Likewise.
30         * examples/hanoi.m4: Likewise.
31         * examples/trace.m4: Likewise.
32         * doc/m4.texinfo (Improved forloop): Document advantage of $0.
33         (Improved foreach): Adjust dump from file.
35         Stage 15: return argv refs back to collect_arguments.
36         Collect an entire $@ reference at once rather than one argument at
37         a time, outside of quotes (but inside quotes, $@ is still
38         flattened for now).  The skip_last field allows concatenation of
39         $@ with other text when collecting arguments.
40         Memory impact: noticeable improvement, due to better reuse of $@.
41         Speed impact: noticeable improvement, due to less parsing.
42         * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
43         (enum m4__token_type): Add M4_TOKEN_ARGV.
44         (struct m4__symbol_chain): Add skip_last member to argv link.
45         (m4__next_token): Add parameter.
46         * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
47         (composite_peek, m4__next_token): Add new parameter.
48         (composite_read, append_quote_token): Support argv in quotes.
49         (init_argv_symbol): New function.
50         (m4__push_symbol, match_input, consume_syntax)
51         (m4__next_token_is_open, m4_print_token): Adjust callers.
52         * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
53         (arg_mark, m4_arg_text, make_argv_ref): Likewise.
54         (expand_argument, collect_arguments): Handle new token.
55         (arg_symbol): Drill through $@ reference.
56         * m4/syntax.c (set_quote_age): Detect disabled comments.
57         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
59 2008-02-15  Eric Blake  <ebb9@byu.net>
61         * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
63 2008-02-13  Eric Blake  <ebb9@byu.net>
65         Fix texinfo grammar.
66         * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
67         (History): Use @: after abbreviations.
68         (M4exit): Use correct Latin abbreviation.
69         (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
70         between sentences.
72 2008-02-11  Eric Blake  <ebb9@byu.net>
74         Allow builtin text macros to specify number of arguments.
75         * m4/m4module.h (struct m4_macro): Add argument limits to builtin
76         text macros.
77         * m4/module.c (install_macro_table): Allow text macros to warn on
78         extra arguments.
79         * modules/gnu.c (m4_macro_table): Update all clients.
80         * modules/load.c (m4_macro_table): Likewise.
81         * modules/mpeval.c (m4_macro_table): Likewise.
82         * modules/perl.c (m4_macro_table): Likewise.
83         * modules/shadow.c (m4_macro_table): Likewise.
84         * modules/traditional.c (m4_macro_table): Likewise.
85         * modules/modtest.c (m4_macro_table): Likewise.  Also add text
86         macros, for testing this.
87         * doc/m4.texinfo (Standard Modules): Update text, and enhance
88         test.
89         * tests/modules.at (modules: text): New test.
91         Fix regression in command line -D option, from 2006-08-25.
92         * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
93         * m4/m4module.h: Fix typo.
94         * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
95         of arguments.
96         * tests/macros.at (Command line define): Enhance test.
97         * tests/others.at (nul character): Enhance test.
98         * tests/null.m4: Likewise.
99         * tests/null.out: Likewise.
101         Use gnulib's git-merge-changelog driver when available.
102         * .gitattributes: Add merge attributes for ChangeLog.
103         * bootstrap: Install driver, if not already present.
105 2008-02-06  Eric Blake  <ebb9@byu.net>
107         Fix security hole introduced 2007-11-23.
108         * m4/utility.c (m4_verror_at_line): Properly escape macro names.
109         * src/main.c (main): Manage quoteargs defaults.
110         * doc/m4.texinfo (Indir): Document and test this.
112         Using raw strtod is not portable.
113         * ltdl/m4/gnulib-cache.m4: Import the strtod module.
115 2008-02-02  Eric Blake  <ebb9@byu.net>
117         Consistently use size_t for number of arguments.
118         * m4/m4module.h (m4_builtin_func): Alter prototype.
119         (struct m4_builtin): Adjust type of min_args, max_args.
120         (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
121         (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
122         (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
123         (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
124         (m4_arg_print, m4_push_arg): Adjust all clients.
125         * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
126         (m4_macro_args): Adjust type of various fields.
127         (m4__push_arg_quote): Adjust all clients.
128         * m4/input.c (m4_pop_wrapup): Likewise.
129         * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
130         (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
131         (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
132         (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
133         (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
134         * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
135         * modules/evalparse.c (m4_evaluate): Likewise.
136         * modules/gnu.c (changesyntax): Likewise.
137         * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
138         (undivert, traceon, traceoff): Likewise.
139         * modules/m4.h (m4_dump_symbols_func): Likewise.
140         * modules/perl.c (perleval): Likewise.
142         Stage 14b: allow pushing argv references.
143         Push a $@ reference to the input engine in one go, rather than
144         pushing each element.  For now, argument collection still gets one
145         argument of a $@ at a time; but the penalties of this patch make
146         it easier to manage $@ efficiently in future patches.
147         Memory impact: noticeable penalty, due to larger struct and O(n)
148         to O(n^2) on unboxed recursion.
149         Speed impact: noticeable penalty, due to more bookkeeping.
150         * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
151         fields.
152         (struct m4_macro_args): Add level field.
153         (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
154         * m4/input.c (m4__push_symbol, composite_peek, composite_read)
155         (composite_unget, composite_clean, composite_print): Support $@
156         refs.
157         * m4/macro.c (collect_arguments): Populate new field.
158         (expand_macro): Move argv cleanup...
159         (m4__arg_adjust_refcount): ...to this new function.
160         (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
161         (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
162         helper functions, to add parameters.
163         (m4_push_args): Adjust caller.
164         * m4/symtab.c (m4_symbol_value_print): Likewise.
166         Stage 14a: allow printing argv references.
167         Refactor symbol-value printing code for better sharing, and to
168         allow printing a contiguous text representation of a $@ ref.
169         Memory impact: none.
170         Speed impact: none.
171         * m4/m4module.h (m4_arg_print): New prototype.
172         (m4_symbol_value_print): Alter prototype.
173         * m4/input.c (struct input_funcs): Add parameter to peek_func.
174         (file_peek, builtin_peek, string_peek): Ignore new parameter.
175         (composite_peek): Ignore new parameter, for now.
176         (composite_clean, pop_input): Rework to minimize indirection, and
177         to avoid infinite recursion in next patch.
178         * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
179         (m4_arg_print): New function.
180         * m4/symtab.c (m4_symbol_value_print): Update signature.
181         (m4_symbol_print): Update caller.
182         * m4/output.c (m4_shipout_string_trunc): Update comments.
183         * m4/syntax.c (set_quote_age): Require comma as argument separator
184         when dealing with $@ as a unit.
185         * tests/builtins.at (ifelse): Augment test.
186         * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
188 2008-01-31  Eric Blake  <ebb9@byu.net>
190         Kill hack for M4 1.4.4.
191         * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
192         we require new enough autoconf which in turn requires M4 1.4.5.
194 2008-01-31  Gary V. Vaughan  <gary@gnu.org>
195         and Eric Blake  <ebb9@byu.net>
197         Depend on new libtool to use non-recursive build.
198         * configure.ac (LT_PREREQ): Bump to alpha release version.
199         (LTDL_INIT): Choose nonrecursive mode.  Perform sanity check that
200         installed libtool has correct symbols.
201         * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
202         top level.
203         (AM_CPPFLAGS): Drop directories covered by libtool.
204         (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
205         (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
206         macros, used by libtool.
207         (lib_LTLIBRARIES): Also used by libtool.
208         (ltdl/libltdlc.la): Delete, now that libtool does this.
209         * bootstrap: Mention new requirements.
210         (LIBTOOLIZE): Provide default program, and run libtoolize prior to
211         autoreconf.
212         (autoreconf): Also neutralize libtoolize, since it is run early.
213         * HACKING: Mention updated prerequisites.
215 2008-01-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
217         Fix build failure if installed libltdl is used.
218         * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
220 2008-01-28  Eric Blake  <ebb9@byu.net>
222         Depend on newer autoconf, for testsuite -C dir.
223         * Makefile.am (CD_TESTDIR): Delete, no longer required.
224         (check-local, installcheck-local, clean-local-tests): Use new -C
225         option from autotest.
226         * configure.ac (AC_PREREQ): Bump to 2.61a.347.
227         * bootstrap: Mention new dependency.
228         * HACKING: Likewise.
230 2008-01-27  Eric Blake  <ebb9@byu.net>
232         Stage 13: push composite text tokens.
233         Support pushing composite tokens, allowing back-references to be
234         reused through multiple macro expansions.  Add hueristic that
235         avoids creating new reference when pushing existing references.
236         Memory impact: noticeable improvement due to better reference
237         reuse, except for O(n) to O(n^2) copying in boxed recursion.
238         Speed impact: slight penalty, due to more bookkeeping.
239         * m4/m4private.h (m4__push_symbol): Adjust prototype.
240         * m4/input.c (m4__push_symbol): Add parameter, and support
241         composite tokens.
242         (append_quote_token): Add parameter, and support inlining of short
243         text.
244         (m4__next_token): Adjust caller.
245         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
247 2008-01-26  Eric Blake  <ebb9@byu.net>
249         Stage 12c: add macro for m4_arg_len.
250         Make a common action easier to type.
251         Memory impact: none.
252         Speed impact: none.
253         * m4/m4module.h (M4ARGLEN): New macro.
254         * m4/macro.c (process_macro): Adjust all callers.
255         * m4/utility.c (m4_dump_args): Likewise.
256         * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
257         (substr): Likewise.
258         * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
259         (renamesyms): Likewise.
260         * modules/stdlib.c (setenv): Likewise.
262         Stage 12b: add m4_string_pair.
263         Make passing quote delimiters around more efficient.
264         Memory impact: none.
265         Speed impact: slight penalty, due to more bookkeeping.
266         * m4/m4module.h (m4_string_pair): New type.
267         (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
268         (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
269         Alter signature.
270         * m4/m4private.h (struct m4_string): Delete.
271         (struct m4_syntax_table): Combine quote and comment members.
272         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
273         (m4_get_syntax_ecomm): Adjust accessors.
274         (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
275         accessors.
276         * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
277         Alter signatures.
278         * m4/input.c (string_print, composite_print, m4_input_print):
279         All callers updated.
280         * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
281         (check_is_single_quotes, m4_set_quotes, set_quote_age)
282         (m4_get_syntax_lquote, m4_get_syntax_rquote)
283         (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
284         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
285         (m4_get_syntax_comments): Likewise.
286         * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
287         * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
288         Likewise.
289         * modules/m4.c (dumpdef, m4_make_temp): Likewise.
290         * src/freeze.c (produce_frozen_state): Likewise.
291         * tests/freeze.at (reloading unknown builtin): Update test.
293         Stage 12a: make m4_symbol_chain a union.
294         Shrink size of symbol chains by using a union.
295         Memory impact: slight improvement, due to smaller struct.
296         Speed impact: slight improvement, due to less bookkeeping.
297         * m4/m4private.h (enum m4__symbol_chain_type): New enum.
298         (struct m4_symbol_chain): Rename...
299         (struct m4__symbol_chain): ...to this, since it is internal.
300         * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
301         callers updated.
302         * m4/input.c (struct m4_input_block, m4__push_symbol)
303         (composite_peek, composite_read, composite_unget)
304         (composite_clean, composite_print, m4__make_text_link)
305         (append_quote_token): Likewise.
306         * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
307         (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
308         (m4_push_args): Likewise.
310 2008-01-23  Eric Blake  <ebb9@byu.net>
312         Adjust to recent libtool interface change.
313         * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
314         (LT_WITH_LTDL): Delete, now that it is obsolete.
315         (LTDL_INIT): Use new libtool macro.
317 2008-01-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
318         and Eric Blake  <ebb9@byu.net>
320         Rely on newer automake.
321         * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
322         distribution.
323         * bootstrap: Update automake requirement.
324         (func_version): Fix --version output, broken since 2007-08-06.
325         * HACKING: Likewise.  Add lzma requirement.
326         * Makefile.am (clean-local-src): Not needed any more with newest
327         Automake.
328         (clean-local): Adjust.
329         * TODO: Remove completed item.
331 2008-01-22  Eric Blake  <ebb9@byu.net>
333         Doc tweak.
334         * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
335         example.
337 2008-01-21  Eric Blake  <ebb9@byu.net>
339         Stage 11: full circle for single argument references.
340         Pass quoted strings through to argument collection in a single
341         action, so that an argument can be reused throughout macro
342         recursion if it remains unchanged.
343         Memory impact: noticeable improvement, due to more reuse in
344         argument collection stacks; O(n^2) to O(n) on boxed recursion.
345         Speed impact: noticeable improvement, due to less copying.
346         * m4/m4module.h (m4_arg_text): Add parameter.
347         (M4ARG): Adjust.
348         * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
349         (m4__make_text_link): New prototype.
350         (struct m4_symbol_chain): Add quote_age member.
351         (struct m4_symbol_value): Add end member to chained symbol.
352         (struct m4_macro_args): Add wrapper member.
353         * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
354         (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
355         composite tokens.
356         * m4/input.c (make_text_link): Rename...
357         (m4__make_text_link): ...to this, and export.
358         (m4_push_string_finish): Adjust caller.
359         (make_text_link, m4__push_symbol): Update new field.
360         (file_read, builtin_read, string_read, composite_read, next_char):
361         Add parameter.
362         (m4_skip_line, match_input, consume_syntax): Adjust callers.
363         (append_quote_token): New function.
364         (m4__next_token): Pass quoted strings onto argument collection.
365         (m4_print_token) [DEBUG_INPUT]: Update.
366         * m4/macro.c (expand_argument): Collect composite arguments.
367         (collect_arguments): Update new field.
368         (expand_macro): Reduce ref-count of back-references after use.
369         (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
370         names.
371         (m4_is_arg_text): Also recognize composite symbols as text.
372         (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
373         (m4_arg_equal): Compare composite symbols.
374         (m4_push_arg, m4_push_args): Handle composite symbols.
375         (m4_arg_symbol): Relax assertion.
376         (process_macro): Use single-argument references.
377         * m4/output.c (m4_shipout_string_trunc): Update comment.
378         * tests/macros.at (Rescanning macros): Augment test.
380 2008-01-16  Eric Blake  <ebb9@byu.net>
382         Stage 10: avoid extra copying of strings and comments.
383         When collecting tokens that are immune to further expansion, avoid
384         copying data from one obstack to another by outputting it into the
385         destination obstack to begin with.  Also reduce copying done in
386         format builtin.
387         Memory impact: slight improvement, due to better obstack usage.
388         Speed impact: noticeable improvement, due less data copying.
389         * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
390         modules.
391         * m4/m4private.h (m4__token_type): Adjust prototype.
392         * m4/input.c (m4__next_token): Support new parameter.
393         * m4/macro.c (m4_macro_expand_input, expand_token)
394         (expand_argument, collect_arguments): Adjust callers.
395         * modules/m4.c (ntoa): Tighten buffer size.
396         * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
397         * modules/format.c (arg_int, arg_long, arg_double): New helper
398         functions, to detect overflow or unparsed characters.
399         (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
400         missing or excess arguments.
401         (format): Likewise, and also output directly into obstack if there
402         is room.
403         * doc/m4.texinfo (History): Update for new year.
404         (Format): Test for new warnings.
406 2008-01-15  Eric Blake  <ebb9@byu.net>
408         * TODO: Update with some newer URLs.
410         Verify linear `index'.
411         * tests/builtins.at (index): New test.
412         (translit): Make test take longer, to make quadratic algorithms
413         more apparent.
415 2007-12-20  Eric Blake  <ebb9@byu.net>
417         Stage 9: share rather than copy single-arg refs.
418         Use hooks of previous patch to create back-references to arguments
419         in the input engine, and inline short text rather than always
420         creating a FIFO link.  Also start testing embedded NUL behavior.
421         Until the argument collection engine also shares references, the
422         memory usage increases.
423         Memory impact: noticeable penalty, due to longer life of argv
424         changing O(n) to O(n^2) on boxed recursion.
425         Speed impact: slight improvement, due less data copying.
426         * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
427         * m4/m4module.h (m4_arg_scratch): New prototype.
428         * m4/m4private.h (m4__push_symbol): Add parameter.
429         (m4_arg_scratch): Add fast accessor.
430         (struct m4): Add expansion_level member, taken...
431         * m4/macro.c (expansion_level): ...from here.  Adjust all users.
432         (expand_argument): Minor cleanup.
433         (expand_macro): Track scratch space per macro call.
434         (m4_arg_scratch): New function.
435         (m4_make_argv_ref): Call new function.
436         (m4_push_arg): Push reference to $0.
437         (m4_push_args): Rework separator usage, since separators will
438         usually be inlined.
439         (process_macro): Allow embedded NUL.
440         * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
441         (m4__push_symbol): Add parameter.  Inline short strings, and save
442         references through rescanning.
443         * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
444         * modules/m4.c (errprint, index): Handle NUL transparently.
445         (dumpdef, translit): Use scratch space, rather than expansion
446         stack.
447         * modules/gnu.c (renamesyms, m4symbols): Likewise.
448         * tests/others.at (nul character): New test.
449         (iso8859): Quote absolute file name, remove XFAIL.
450         * tests/iso8859.m4: Avoid raw NUL in output.
451         * tests/null.m4: New file.
452         * tests/null.out: Likewise.
453         * tests/null.err: Likewise.
454         * Makefile.am (OTHER_FILES): Distribute new files.
455         * .gitattributes: Treat new files as text.
457 2007-12-17  Eric Blake  <ebb9@byu.net>
459         Stage 8: extend life of references into argv.
460         Add hooks to lengthen the lifetime of arguments reused in a macro
461         expansion, rather than always discarding arguments at the end of
462         expand_macro.  Rework the expand_macro obstacks to handle longer
463         lifetimes.  For now, the hooks remain unused.
464         Memory impact: slight penalty, due to larger structs.
465         Speed impact: slight penalty, due to more bookkeeping.
466         * m4/system_.h (obstack_regrow): Delete.
467         * m4/m4private.h (struct m4_symbol_chain): Add level field.
468         (m4__push_symbol): Adjust prototype.
469         (m4__adjust_refcount): New prototype.
470         (DEBUG_MACRO) [DEBUG]: New debug control.
471         (struct m4__macro_arg_stacks): New structure.
472         (struct m4): Add arg_stacks, stacks_count fields.
473         * m4/m4module.h (m4_make_argv_ref): Add parameter.
474         * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
475         context->arg_stacks.
476         (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
477         conditional on M4_DEBUG_MACRO envvar.
478         (collect_arguments): Adjust signature.
479         (expand_macro): Rework obstack handling.
480         (m4__adjust_refcount, arg_mark): New functions.
481         (m4_make_argv_ref): Populate new field.
482         (m4_push_arg, m4_push_args): Track inuse.
483         (process_macro): One less cast.
484         * m4/m4.c (m4_delete): Clean up arg_stacks.
485         * m4/input.c (make_text_link): Use new field.
486         (m4__push_symbol, file_clean): Update signature.
487         (composite_read): Bump refcount when done with reference.
488         (composite_clean): New function.
489         (pop_input): Adjust caller.
490         * m4/debug.c (m4_debug_message): Make assertion match comment.
491         * modules/gnu.c (builtin, indir): Adjust callers.
492         * tests/builtins.at (ifelse): New test.
493         (exp): Move and rename...
494         * tests/others.at (countdown): ...to this.
495         * doc/m4.texinfo (Improved foreach): Fix tracing usage in
496         example.
498 2007-12-13  Eric Blake  <ebb9@byu.net>
500         Yet more rewording.
501         * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
502         the previous patch.
504         * THANKS: Update.
506 2007-12-13  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
508         * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
509         example.
510         Reported by Giovanni Toffetti.
512 2007-12-11  Eric Blake  <ebb9@byu.net>
514         Stage 7: use chained input support in input parser.
515         Allow the LIFO input engine to rescan a macro expansion composed
516         of smaller chunks of FIFO data, rather than the old approach of a
517         monolithic string.  For now, all chunks are still copied.
518         Memory impact: slight penalty, due to FIFO chain overhead.
519         Speed impact: slight penalty, due to extra bookkeeping.
520         * m4/m4private.h (m4__push_symbol): New prototype.
521         (struct m4_symbol_chain): Add const-safety.
522         * m4/symtab.c (m4_symbol_value_print): Simplify.
523         (dump_symbol_CB): Update caller.
524         * m4/input.c (struct m4_input_block): Alter u_c member, first
525         introduced 2006-10-25, but unused until now.
526         (composite_peek, composite_read, composite_unget)
527         (composite_print, init_builtin_token): Rewrite accordingly.
528         (m4_push_wrapup): No longer need trailing NUL.
529         (m4__push_symbol, make_text_link): New functions.
530         (m4_push_string_finish): Use them.
531         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
532         (expand_macro): Simplify logic of nesting_limit.
533         * src/main.c (main): Likewise.
534         * doc/m4.texinfo (Dumpdef): Augment test.
536 2007-12-08  Eric Blake  <ebb9@byu.net>
538         Stage 6: convert builtins to push arg at a time.
539         Add new methods to factor all builtins whose expansion includes an
540         argument, making back-reference creation easier in future patches.
541         Factor out length-limited printing to obstacks, and use -1 rather
542         than 0 for unlimited length.
543         Memory impact: none.
544         Speed impact: slight improvement, due to better code sharing.
545         * m4/m4module.h (m4_shipout_text): Rename...
546         (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
547         that does not worry about sync lines.
548         (m4_shipout_string_trunc): New prototype.
549         * m4/output.c (m4_shipout_text): Rename...
550         (m4_divert_text): ...to this.
551         (m4_shipout_string): Move guts...
552         (m4_shipout_string_trunc): ...to this new function.
553         * m4/macro.c (m4_push_arg, m4_push_args): New functions.
554         (expand_token, process_macro): Update callers.
555         * m4/input.c (string_print): Likewise.
556         * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
557         Likewise.
558         * modules/gnu.c (patsubst): Likewise.
559         (debuglen): Use SIZE_MAX for unlimited debug length.
560         * src/main.c (main): Likewise.
561         * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
562         zero.
564 2007-12-07  Eric Blake  <ebb9@byu.net>
566         Minor security fix: Quote output of mkstemp.
567         * modules/m4.c (m4_make_temp): Produce quoted output.
568         * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
569         tests.
571         Stage 5: add notion of quote age.
572         Cache the quoting rules that were in effect when a string was
573         parsed, to avoid reparsing that string if no changequote or other
574         quote age change took place in the meantime.  A quote_age of 0 is
575         always safe, but does not benefit from caching.
576         Memory impact: slight improvement, due to smaller struct in input
577         engine.
578         Speed impact: slight penalty, due to more bookkeeping.
579         * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
580         (m4_set_symbol_value_text): Adjust prototype.
581         (m4_has_syntax): Factor out the unsigned char cast.
582         * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
583         quote_age members.
584         (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
585         functions at this point.
586         (struct m4_symbol_value, struct m4_macro_args): Add quote_age
587         member.
588         (m4_set_symbol_value_text): Adjust fast accessor.
589         (m4_get_symbol_value_quote_age): New fast accessor.
590         * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
591         (m4_get_symbol_value_quote_age): New function.
592         (m4_symbol_value_copy): Adjust callers.
593         * m4/macro.c (expand_token): Add parameter, and track quote age.
594         (expand_argument, collect_arguments): Track quote age.
595         (m4_macro_expand_input, process_macro, m4_make_argv_ref)
596         (m4_macro_expand_input): Update callers.
597         (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
598         * m4/input.c: Comment cleanups.
599         (struct m4_input_block): Reduce size.
600         (m4__next_token): Report quote age.
601         (m4_push_builtin, init_builtin_token): Update callers.
602         * m4/utility.c (skip_space): Adjust callers.
603         * m4/module.c (install_macro_table): Likewise.
604         * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
605         (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
606         quote age.
607         (set_quote_age): New helper function.
608         (check_is_single_quotes, check_is_single_comments): Adjust
609         callers.
610         * src/freeze.c (reload_frozen_state): Likewise.
611         * src/main.c (main): Likewise.
612         * modules/m4.c (define, pushdef): No need to set macro text.
613         * tests/builtins.at (changequote, defn): New tests.
614         * examples/wrapfifo.m4: New file.
615         * examples/wraplifo.m4: New file.
616         * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
618 2007-12-04  Eric Blake  <ebb9@byu.net>
620         Fix builds with OpenBSD make.
621         * Makefile.am (HELP2MAN): New macro.
622         (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
623         srcdir.
624         * README: Update copyright.
625         * HACKING: Mention help2man and makeinfo dependencies.
627 2007-11-29  Eric Blake  <ebb9@byu.net>
629         Stage 4: route indir, builtin through ref; make argv opaque.
630         Finish making struct opaque to all but the input engine, by
631         reworking obstack usage in expand_macro to better support creation
632         of a $@ reference.  Canonicalize the empty argument, to allow
633         pointer comparison optimizations.
634         Memory impact: slight penalty, due to larger struct.
635         Speed impact: slight improvement, due to fewer function calls.
636         * m4/system_.h (obstack_regrow): Fix precedence.
637         * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
638         New prototypes.
639         (struct m4_macro_args): Move...
640         * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
641         to modules.  Add has_ref member.
642         (bool_bitfield): New helper typedef.
643         (struct m4_symbol_chain): Add flatten and len members.
644         * m4/macro.c (empty_symbol): New placeholder, for optimizing
645         comparison with empty string.
646         (m4_macro_expand_input): Initialize it.
647         (collect_arguments): Alter signature, and populate new fields.
648         (trace_pre, trace_post): Remove redundant parameter.
649         (expand_macro): Alter handling of obstacks.
650         (m4_arg_symbol): Account for wrapped argv.
651         (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
652         (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
653         * modules/m4.c (ifelse, syscmd): Likewise.
654         * modules/evalparse.c (m4_evaluate): Likewise.
655         (undefine, popdef, m4_dump_symbols): Optimize.
656         * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
657         methods.
658         (changesyntax, regexp): Optimize.
659         * m4/output.c (diversion_storage): Use typedef.
661         Stage 3b: cache length, rather than computing it, in modules.
662         Use cached token length in builtins and output engine.
663         Memory impact: none.
664         Speed impact: noticeable improvement, due to fewer function calls.
665         * m4/hash.c (m4_hash_remove): Avoid double free on remove
666         failure.
667         * m4/output.c (m4_shipout_string): Change semantics of len param.
668         (m4_shipout_int): Use cached length.
669         * m4/input.c (m4_push_string_finish): Likewise.
670         * modules/m4.h (m4_make_temp_func): Add parameter.
671         * m4/macro.c (expand_token, m4_arg_len): Use cached length.
672         (collect_arguments, expand_macro): Alter signature.
673         (trace_format): Don't use out-of-scope buffer.
674         (process_macro): All callers changed.
675         * m4/utility.c (m4_dump_args): Likewise.
676         * m4/symtab.c (m4_symbol_value_print): Likewise.
677         * modules/gnu.c (__file__, __program__, builtin, indir)
678         (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
679         renamesyms, patsubst, regexp, regexp_compile): Likewise.
680         * modules/load.c (m4modules): Likewise.
681         * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
682         (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
683         * modules/perl.c (perleval): Likewise.
684         * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
685         (hostname, uname, setenv): Likewise.
686         * modules/mpeval.c (numb_obstack): Likewise.
687         * src/freeze.c (dump_symbol_CB): Likewise.
688         * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
689         * tests/builtins.at (mkstemp): Likewise.
690         * tests/others.at (iso8859): XFAIL this test, now that
691         length-based handling allows NUL through part but not all of M4.
693 2007-11-28  Eric Blake  <ebb9@byu.net>
695         Stage 3a: cache length, rather than computing it, in libm4.
696         Cache the length of a token in the input engine and symbol table,
697         to avoid repeating lots of strlen calls.  Additionally, by using
698         obstack length rather than strlen, the input engine can now
699         support embedded NUL.
700         Memory impact: slight penalty, due to larger struct.
701         Speed impact: slight improvement, due to fewer function calls.
702         * m4/m4module.h (struct m4_macro_args): Cache length.
703         (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
704         (m4_set_symbol_value_text): Change signature.
705         * m4/m4private.h (struct m4_symbol_value): Store string length.
706         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
707         (m4_set_symbol_value_placeholder): Update accordingly.
708         (m4_set_symbol_value_text): Change signature.
709         (m4_get_symbol_value_len): New accessor.
710         * m4/input.c (struct m4_input_block, string_peek, string_read)
711         (string_unget, string_print, m4_push_string_finish)
712         (m4_push_wrapup): Track length of string input.
713         (m4__next_token): Adjust all users of symbol text to track length,
714         too.
715         * m4/macro.c (expand_argument, collect_arguments): Likewise.
716         * m4/module.c (install_macro_table): Likewise.
717         * modules/gnu.c (builtin, indir): Likewise.
718         * modules/m4.c (define, pushdef): Likewise.
719         * src/main.c (main): Likewise.
720         * src/freeze.c (reload_frozen_state): Likewise.
721         * m4/symtab.c (m4_symbol_value_copy): Likewise.
722         (m4_get_symbol_value_len): New function.
723         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
724         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
725         Adjust implementation.
727 2007-11-27  Eric Blake  <ebb9@byu.net>
729         Stage 2: use accessors, not direct reference, into argv.
730         Outside of macro.c, use accessor methods rather than direct access
731         into the argv struct.
732         Memory impact: none.
733         Speed impact: slight penalty, due to increased function calls.
734         * m4/m4private.h (m4_arg_argc): New fast accessor.
735         * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
736         (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
737         prototypes.
738         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
739         (m4_macro_call): Make argc unsigned.
740         (M4ARG): Use new accessors.
741         * modules/m4.c (define, pushdef): Likewise.
742         (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
743         (traceon, traceoff): Make argc unsigned.
744         * modules/m4.h (m4_dump_symbols_func): Likewise.
745         * modules/evalparse.c (m4_evaluate): Likewise.
746         * modules/gnu.c (builtin, indir): Use new accessors.
747         (changesyntax): Make argc unsigned.
748         * modules/perl.c (perleval): Likewise.
749         * m4/utility.c (m4_dump_args): Use new accessors.
750         * m4/macro.c (trace_pre): Likewise.
751         (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
752         (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
753         (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
754         usage.
756 2007-11-24  Eric Blake  <ebb9@byu.net>
758         Stage 1: convert m4_symbol_value** into new object.
759         Pass a variable-size wrapper structure instead of an array to
760         builtins, so that subsequent optimizations in the structure need
761         not impact every builtin client.
762         Memory impact: slight penalty, since struct is larger than array.
763         Speed impact: slight penalty, due to increased bookkeeping.
764         * ltdl/m4/gnulib-cache.m4: Import flexmember module.
765         * m4/m4module.h (m4_macro_args): New type, will be opaque to
766         modules later.
767         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
768         (m4_macro_call): Alter signature to use m4_macro_args object.
769         (M4ARG): Redefine to access new struct.
770         * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
771         (struct m4_symbol_chain): New type.
772         (struct m4_symbol_value): Add chain alternative.
773         * m4/macro.c (collect_arguments): Build new struct.
774         (expand_macro, m4_macro_call, process_macro, trace_pre)
775         (trace_post): Adjust implementation to use it.
776         * m4/utility.c (m4_dump_args): Likewise.
777         * modules/gnu.c (builtin, indir): Likewise.
778         * modules/format.c (format): Likewise.
779         * modules/m4.h (m4_dump_symbols_func): Likewise.
780         * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
781         (shift, include, errprint, m4wrap): Likewise.
782         * modules/evalparse.c (m4_evaluate): Likewise.
784         Pass only macro name to utility functions.
785         * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
786         * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
787         implementation.
788         * m4/macro.c (m4_macro_call): Adjust callers.
789         * modules/gnu.c (builtin, debuglen): Likewise.
790         * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
791         (substr): Likewise.
792         * modules/evalparse.c (m4_evaluate): Likewise.
793         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
794         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
795         Likewise.
797 2007-11-23  Eric Blake  <ebb9@byu.net>
799         Add macro name to debugfile messages.
800         * m4/m4module.h (m4_debug_set_output): Add parameter.
801         * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
802         name through.
803         * modules/gnu.c (debugfile): Adjust caller.
804         * modules/m4.c (m4exit): Likewise.
805         * src/main.c (main): Likewise.
807         Factor out handling of macro name in error messages.
808         * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
809         (m4_warn_at_line): Add new parameter.
810         * m4/utility.c (m4_verror_at_line): New helper method.
811         (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
812         parameter.
813         (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
814         changed.
815         * m4/debug.c: Likewise.
816         * m4/input.c: Likewise.
817         * m4/macro.c: Likewise.
818         * m4/module.c: Likewise.
819         * m4/output.c: Likewise.
820         * m4/path.c: Likewise.
821         * modules/evalparse.c: Likewise.
822         * modules/format.c: Likewise.
823         * modules/gnu.c: Likewise.
824         * modules/load.c: Likewise.
825         * modules/m4.c: Likewise.
826         * modules/mpeval.c: Likewise.
827         * src/freeze.c: Likewise.
828         * src/main.c: Likewise.
830 2007-11-14  Eric Blake  <ebb9@byu.net>
832         Handle some defn corner cases differently.
833         * doc/m4.texinfo (Defn): Update documentation; although this still
834         doesn't match the branch, since it may be changed before 2.0.
835         * m4/macro.c (expand_argument): Consistently ignore builtins in
836         concatenation contexts.
837         * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
839 2007-11-13  Eric Blake  <ebb9@byu.net>
841         Note: Patches titled Stage 0 through N form a series of patches
842         which decreases the algorithmic complexity of tail recursion in
843         macro expansions from O(n^2) to O(n) in both time and memory, then
844         performs cleanups, such as handling of embedded NUL, made easier
845         by the code refactoring.
847         Stage 0: Fix memory leak in tail recursion.
848         Free expansion text in the input engine as soon as it is parsed,
849         rather than when the recursive expansion completes.
850         Memory impact: noticeable improvement, due to reduction from
851         O(n^2) to O(n) on recursion.
852         Speed impact: minor improvement, due to better memory usage.
853         * m4/input.c (pop_input): Add flag parameter and return type.
854         (next_char): Adjust caller.
855         (m4_push_string_init): Let go of memory earlier.
857 2007-11-07  Eric Blake  <ebb9@byu.net>
859         * tests/macros.at (Rescanning macros): Test more corner cases.
861 2007-11-06  Eric Blake  <ebb9@byu.net>
863         * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
865         * Makefile.am (tests/package.m4): Work around bash bug.
866         Reported by Ralf Wildenhues.
868 2007-11-05  Eric Blake  <ebb9@byu.net>
870         For consistency with other GNU projects, use build-aux directory.
871         * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
872         build-aux.
873         * bootstrap (config_aux_dir): Likewise.
874         * Makefile.am (config_aux_dir): Likewise.
875         * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
877 2007-11-02  Eric Blake  <ebb9@byu.net>
879         Update some documentation about version control.
880         * NEWS: M4 is now stored in git.
881         * HACKING: Likewise.
882         * README: Likewise.
883         * bootstrap: Likewise.
884         * commit: Delete, now that CVS commits are no longer necessary.
885         * ltdl/config/mailnotify: No longer necessary; git's patch
886         generation and mail capability is more powerful.
888         Update to recent gnulib changes.
889         * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
890         xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
892 2007-11-01  Eric Blake  <ebb9@byu.net>
894         Improve error message when early end of file occurs.
895         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
896         (M4wrap): Adjust to new messages.
897         (Improved capitalize): Enhance test.
898         * m4/m4private.h (m4__next_token): Adjust prototype.
899         * m4/input.c (m4__next_token): Add new parameter, and improve
900         error message.
901         * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
902         callers.
903         (expand_argument): Likewise, and add parameter.
905 2007-10-31  Eric Blake  <ebb9@byu.net>
907         Test more corner cases.
908         * tests/macros.at (Rescanning macros): Beef up test.
909         * doc/m4.texinfo (Changecom): Beef up test.
910         (Improved foreach): Document alternate foreachq style.
911         * examples/foreachq3.m4: New file.
912         * examples/loop.m4: New file.
913         * Makefile.am (dist_pkgdata_DATA): Distribute them.
915 2007-10-28  Eric Blake  <ebb9@byu.net>
917         More test coverage for autoconf usage patterns.
918         * doc/m4.texinfo (Shift): Document cond macro, and add new test.
919         * tests/macros.at (Rescanning macros): New test.
920         * tests/builtins.at (include): Augment test.
922 2007-10-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
924         * Makefile.am: Adjust getopt handling to latest gnulib layout.
926 2007-10-27  Eric Blake  <ebb9@byu.net>
928         Document one use of changequote(`(',`)').
929         * doc/m4.texinfo (Changequote): Add new test, based on recent
930         autoconf addition of m4_expand.
932 2007-10-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
934         * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
936 2007-10-22  Eric Blake  <ebb9@byu.net>
938         Never let printf failures go undetected.
939         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
940         xprintf'.
941         * m4/system_.h: Include xprintf.h.
942         * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
943         use of printf, xprintf.
944         * m4/input.c [DEBUG_INPUT]: Likewise.
945         * m4/module.c [DEBUG_MODULES]: Likewise.
946         * m4/output.c (m4_shipout_text, m4_shipout_int)
947         (m4_freeze_diversions): Likewise.
948         * m4/path.c [DEBUG_INCL]: Likewise.
949         * m4/symtab.c [DEBUG_SYM]: Likewise.
950         * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
951         * modules/modtest.c (export_test): Likewise.
952         * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
953         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
954         Likewise.
955         * src/main.c (usage): Likewise.
956         * po/POTFILES.in: Adjust to new file.
957         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
959 2007-10-18  Eric Blake  <ebb9@byu.net>
961         Fix 'm4 -F file -t undefined'.
962         * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
963         * src/freeze.c (dump_symbol_CB): Also skip void symbols.
964         * tests/freeze.at (reloading unknown builtin): Test for this bug.
965         * m4/m4module.h (m4_symtab_apply): Add parameter.
966         * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
967         requested.
968         (m4_symtab_delete, symtab_dump): Adjust callers.
969         * modules/m4.c (m4_dump_symbols): Likewise.
971 2007-10-09  Eric Blake  <ebb9@byu.net>
973         Fix regexp regression of 2007-09-29.
974         * modules/gnu.c (substitute): Allow NULL buf when no
975         subexpressions were present.
976         (regexp): Handle \ escapes even with empty regex.
977         * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
979         Cache regex compilation for another autoconf speedup.
980         * modules/gnu.c (gnu_buf): Replace...
981         (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
982         (m4_pattern_buffer): Add fields.
983         (m4_regexp_compile): Rename...
984         (regexp_compile): ...to this, and drop no_sub parameter.
985         Implement caching.
986         (M4FINISH_HANDLER): Clean up entire cache.
987         (m4_regexp_search): Rename...
988         (regex_search): ...to this, adjust to new struct contents, and add
989         no_sub parameter.
990         (m4_regexp_substitute): Rename...
991         (regexp_substitute): ...to this.
992         (substitute, patsubst, regexp, renamesyms): Adjust callers.
994 2007-10-02  Eric Blake  <ebb9@byu.net>
996         Document quoting pitfalls in capitalize.
997         * doc/m4.texinfo (Patsubst): Use the examples directory.  Also
998         document shortfall.
999         (Improved capitalize): New node.
1000         * examples/capitalize.m4: Update to match manual.
1001         * examples/capitalize2.m4: New file.
1003 2007-10-01  Eric Blake  <ebb9@byu.net>
1005         Another Autoconf usage pattern optimization.
1006         * modules/m4.c (m4_index): Optimize search for one byte.
1007         * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
1008         code paths.
1010 2007-09-29  Eric Blake  <ebb9@byu.net>
1012         Optimize for Autoconf usage pattern.
1013         * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
1015         * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
1017 2007-09-24  Eric Blake  <ebb9@byu.net>
1019         Create .gitignore alongside .cvsignore.
1020         * bootstrap (version control): Update to reflect git usage.
1022 2007-09-13  Eric Blake  <ebb9@byu.net>
1024         * AUTHORS: Fix typo.
1026 2007-09-12  Gary V. Vaughan  <gary@gnu.org>
1028         Be consistent about using 'module' for m4_module types and
1029         'handle' for lt_dlhandle types:
1031         * m4/m4private.h (m4_symbol_value): Rename handle element to
1032         method.  Changed all references.
1033         (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
1034         SYMBOL_HANDLE respectively.  Changed all references.
1035         * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
1036         * m4/builtin.c (m4_builtin_find_by_name)
1037         (m4_builtin_find_by_func): Use module as the parameter name for
1038         pointers of type 'm4_module'.
1039         * m4/module.c (module_remove, m4_get_module_name)
1040         (install_builtin_table, install_macro_table)
1041         (m4_module_make_resident, m4__module_next, m4_module_refcount):
1042         Ditto.
1043         * src/freeze.c (produce_module_dump): Ditto.
1044         * m4/input.c (m4_input_block): Rename handle element to method.
1045         Changed all references.
1046         * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
1047         * modules/load.c: Use module as the variable name for pointers
1048         of type 'm4_module'.
1049         * modules/m4.c: Ditto.
1050         * modules/perl.c: Ditto.
1051         * modules/shadow.c: Ditto.
1053 2007-09-07  Eric Blake  <ebb9@byu.net>
1055         Add refcount builtin.
1056         * modules/load.c (refcount): New builtin.
1057         (m4modules): Use correct type.
1058         * doc/m4.texinfo (Refcount): New section.
1059         * m4/m4private.h (struct m4_module): Add refcount member.
1060         (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
1061         * m4/module.c (m4_module_load): Add symbols to table on first
1062         load by m4, regardless of other libltdl loads of same module.
1063         (m4_module_refcount): Use new struct member, rather than relying
1064         on libltdl count which might be inflated by unrelated loads.
1065         (m4__module_interface): Optimize.
1066         (m4__module_next, m4__module_find): Avoid assertions that could
1067         trigger with unrelated libltdl loads.
1068         (m4__module_open): Track m4 load count.
1069         (m4__module_exit): Only unload what m4 loaded.
1070         (module_remove): Track m4 unloads.
1071         * NEWS: Document new builtin.
1073         More conversion to m4_module*.
1074         * src/freeze.c (produce_module_dump, dump_symbol_CB)
1075         (reload_frozen_state): Use correct type.
1076         * m4/input.c (struct m4_input_block): Likewise.
1077         * m4/symtab.c (dump_symbol_CB): Likewise.
1079         * AUTHORS: Simplify, to match libtool and autoconf layout.
1080         * THANKS: Sync with branch.
1082 2007-09-06  Eric Blake  <ebb9@byu.net>
1084         Wrap lt_dlhandle in struct m4_module.
1085         * m4/m4module.h (includes): No longer require clients to know
1086         about lt_dlhandle.
1087         (m4_module): New opaque declaration.
1088         (m4_export): Delete unused type.
1089         (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
1090         (m4_module_finish_func, m4_module_load, m4_get_module_name)
1091         (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
1092         wrapper.
1093         (m4_module_makeresident, m4_module_refcount): New declarations.
1094         * m4/m4private.h (includes): Move <ltdl.h> here.
1095         (m4_module): New declaration.  Simple for now, but intended for
1096         growth.
1097         (m4__module_open, m4__module_next, m4__module_find)
1098         (m4__symtab_remove_module_references): Use new wrapper.
1099         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
1100         Likewise.
1101         * m4/module.c (m4_get_module_name, m4_module_import)
1102         (m4_module_load): Likewise.
1103         (install_builtin_table, install_macro_table): Likewise.  Also,
1104         change return type since these always returned NULL and no one
1105         used the result.
1106         (m4_module_makeresident, m4_module_refcount): New functions.
1107         (m4_module_unload, m4__module_next, m4__module_find): Use new
1108         wrapper.
1109         (m4__module_open): Populate new wrapper, and associate it with the
1110         lt_dlhandle.
1111         (m4__module_exit): Use new wrapper.
1112         (module_remove): Likewise.  Reclaim storage on last use.
1113         (module_close): Delete, and inline into module_remove.
1114         * m4/symtab.c (m4__symtab_remove_module_references): Use new
1115         wrapper.
1116         * modules/load.c (load_init): Use new API.
1117         * modules/m4.c (m4_export_table): Kill unused declaration.
1118         (m4_init): Use new API.
1119         * modules/shadow.c (shadow_init): Use new API.
1120         * src/main.c (main): Adjust callers.
1121         * src/freeze.c (reload_frozen_state): Likewise.
1122         * tests/modules.at (unload load module): New test.
1124 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
1126         * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
1127         * src/m4/.cvsignore: Add xstrtol module sources.
1129 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
1131         Work around a bug in darwin's awk:
1133         * bootstrap (func_get_translations): Use $AWK instead of raw
1134         `awk' so that the user can use an alternative implementation
1135         if the first awk in PATH doesn't behave as expected.
1136         (func_get_translations): The first awk script mangles the last
1137         entry passed to it for at least the awk implementation shipped
1138         with Darwin 8.10.1.  Capture $3 into a variable too to work-
1139         around that problem.
1141 2007-08-29  Gary V. Vaughan  <gary@gnu.org>
1143         As gnulib xstrtol is only used by main, and unconditionally pulls
1144         in a copy of getopt, undo bootstrap change from 2007-08-11 below,
1145         and copy the xstrtol code into src/ so that main() can use it
1146         without pushing the extra code into libm4:
1148         * bootstrap (src_modules): Add getopt and xstrtol modules.
1149         * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
1150         * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
1152 2007-08-11  Eric Blake  <ebb9@byu.net>
1154         Another upstream xstrtol change.
1155         * po/POTFILES.in: Track changes in files containing messages.
1156         * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
1157         need to grab it separately.
1158         * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
1159         No longer needed.
1160         (size_opt): Adjust to latest xstrtol interface.
1162 2007-08-10  Eric Blake  <ebb9@byu.net>
1164         Documentation improvements.
1165         * doc/m4.texinfo (Defn): Resync with branch.
1166         (Compatibility, Extensions): Sync with branch.
1168 2007-08-07  Eric Blake  <ebb9@byu.net>
1170         Adjust to gnulib xstrtol changes.
1171         * src/main.c (size_opt): Adjust signature, so that error strings
1172         are easier to translate.
1173         (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
1174         for tracking long options.
1175         (main): Track which long option was used.
1176         * tests/options.at (--debuglen, --nesting-limit): Adjust to change
1177         in error message.
1178         (deprecated options): Test that --arglength spelling shows up in
1179         error message.
1181 2007-08-06  Eric Blake  <ebb9@byu.net>
1183         Normalize all GPL license notices.
1184         * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
1185         at this time.
1186         * Makefile.am: Update license wording.
1187         * bootstrap: Likewise.
1188         * commit: Likewise.
1189         * configure.ac: Likewise.
1190         * ltdl/config/mailnotify: Likewise.
1191         * ltdl/config/mkstamp: Likewise.
1192         * ltdl/m4/debug.m4: Likewise.
1193         * ltdl/m4/gmp.m4: Likewise.
1194         * ltdl/m4/m4-error.m4: Likewise.
1195         * ltdl/m4/m4-getopt.m4: Likewise.
1196         * ltdl/m4/m4-gettext.m4: Likewise.
1197         * ltdl/m4/m4-obstack.m4: Likewise.
1198         * ltdl/m4/m4-regex.m4: Likewise.
1199         * ltdl/m4/stackovf.m4: Likewise.
1200         * m4/builtin.c: Likewise.
1201         * m4/debug.c: Likewise.
1202         * m4/hash.c: Likewise.
1203         * m4/hash.h: Likewise.
1204         * m4/input.c: Likewise.
1205         * m4/m4.c: Likewise.
1206         * m4/m4module.h: Likewise.
1207         * m4/m4private.h: Likewise.
1208         * m4/macro.c: Likewise.
1209         * m4/module.c: Likewise.
1210         * m4/output.c: Likewise.
1211         * m4/path.c: Likewise.
1212         * m4/resyntax.c: Likewise.
1213         * m4/symtab.c: Likewise.
1214         * m4/syntax.c: Likewise.
1215         * m4/system_.h: Likewise.
1216         * m4/utility.c: Likewise.
1217         * modules/evalparse.c: Likewise.
1218         * modules/format.c: Likewise.
1219         * modules/gnu.c: Likewise.
1220         * modules/import.c: Likewise.
1221         * modules/load.c: Likewise.
1222         * modules/m4.c: Likewise.
1223         * modules/m4.h: Likewise.
1224         * modules/modtest.c: Likewise.
1225         * modules/mpeval.c: Likewise.
1226         * modules/perl.c: Likewise.
1227         * modules/shadow.c: Likewise.
1228         * modules/stdlib.c: Likewise.
1229         * modules/time.c: Likewise.
1230         * modules/traditional.c: Likewise.
1231         * po/Makevars: Likewise.
1232         * src/freeze.c: Likewise.
1233         * src/m4.h: Likewise.
1234         * src/main.c: Likewise.
1235         * src/stackovf.c: Likewise.
1236         * tests/builtins.at: Likewise.
1237         * tests/freeze.at: Likewise.
1238         * tests/generate.awk: Likewise.
1239         * tests/m4.in: Likewise.
1240         * tests/macros.at: Likewise.
1241         * tests/modules.at: Likewise.
1242         * tests/options.at: Likewise.
1243         * tests/others.at: Likewise.
1244         * tests/stackovf.test: Likewise.
1245         * tests/testsuite.at: Likewise.
1247 2007-07-22  Eric Blake  <ebb9@byu.net>
1249         Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
1250         * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
1251         * tests/builtins.at (divert): Enhance test to cover this.
1252         * THANKS: Update.
1253         Reported by Thomas Klausner.
1255 2007-07-20  Eric Blake  <ebb9@byu.net>
1257         Fix 'make distcheck' issues.
1258         * bootstrap: Add more files that might be more up-to-date in
1259         gnulib.
1260         * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
1261         * config/m4/gnulib-cache.m4: Update to latest gnulib.
1263 2007-07-16  Eric Blake  <ebb9@byu.net>
1265         * po/POTFILES.in: Track recent translation additions from gnulib
1266         updates.
1268 2007-07-14  Eric Blake  <ebb9@byu.net>
1270         Reflect upstream license .texi changes.
1271         * doc/m4.texinfo (Copying): Rename node...
1272         (GNU General Public License): ...to this.
1273         (GNU Free Documentation License): Adjust node location.
1274         * local/doc/gpl-3.0.texi.diff: Remove file.
1276 2007-07-10  Eric Blake  <ebb9@byu.net>
1278         Upgrade to GPLv3, and document 1.4.10.
1279         * bootstrap: Adjust to GPLv3.
1280         (func_update): Port from branch.
1281         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
1282         --local-dir=local --import gpl-3.0'.
1283         * doc/m4.texinfo (History): Mention 1.4.11.
1284         (Copying This Package): New appendix.
1285         * NEWS: Document 1.4.10.
1286         * local/doc/gpl-3.0.texi.diff: New file.
1287         * Makefile.am: Update license.
1288         (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
1289         * commit: Update license.
1290         * configure.ac: Likewise.
1291         * ltdl/config/mailnotify: Likewise.
1292         * ltdl/config/mkstamp: Likewise.
1293         * ltdl/m4/debug.m4: Likewise.
1294         * ltdl/m4/gmp.m4: Likewise.
1295         * ltdl/m4/m4-error.m4: Likewise.
1296         * ltdl/m4/m4-getopt.m4: Likewise.
1297         * ltdl/m4/m4-gettext.m4: Likewise.
1298         * ltdl/m4/m4-obstack.m4: Likewise.
1299         * ltdl/m4/m4-regex.m4: Likewise.
1300         * ltdl/m4/stackovf.m4: Likewise.
1301         * m4/builtin.c: Likewise.
1302         * m4/debug.c: Likewise.
1303         * m4/hash.c: Likewise.
1304         * m4/hash.h: Likewise.
1305         * m4/input.c: Likewise.
1306         * m4/m4.c: Likewise.
1307         * m4/m4module.h: Likewise.
1308         * m4/m4private.h: Likewise.
1309         * m4/macro.c: Likewise.
1310         * m4/module.c: Likewise.
1311         * m4/output.c: Likewise.
1312         * m4/path.c: Likewise.
1313         * m4/resyntax.c: Likewise.
1314         * m4/symtab.c: Likewise.
1315         * m4/syntax.c: Likewise.
1316         * m4/system_.h: Likewise.
1317         * m4/utility.c: Likewise.
1318         * modules/evalparse.c: Likewise.
1319         * modules/format.c: Likewise.
1320         * modules/gnu.c: Likewise.
1321         * modules/import.c: Likewise.
1322         * modules/load.c: Likewise.
1323         * modules/m4.c: Likewise.
1324         * modules/m4.h: Likewise.
1325         * modules/modtest.c: Likewise.
1326         * modules/mpeval.c: Likewise.
1327         * modules/perl.c: Likewise.
1328         * modules/shadow.c: Likewise.
1329         * modules/stdlib.c: Likewise.
1330         * modules/time.c: Likewise.
1331         * modules/traditional.c: Likewise.
1332         * po/Makevars: Likewise.
1333         * src/freeze.c: Likewise.
1334         * src/m4.h: Likewise.
1335         * src/main.c: Likewise.
1336         * src/stackovf.c: Likewise.
1337         * tests/builtins.at: Likewise.
1338         * tests/freeze.at: Likewise.
1339         * tests/generate.awk: Likewise.
1340         * tests/m4.in: Likewise.
1341         * tests/macros.at: Likewise.
1342         * tests/modules.at: Likewise.
1343         * tests/options.at: Likewise.
1344         * tests/others.at: Likewise.
1345         * tests/stackovf.test: Likewise.
1346         * tests/testsuite.at: Likewise.
1348 2007-07-09  Eric Blake  <ebb9@byu.net>
1350         * modules/format.c (format): Avoid undefined behavior with %c.
1352 2007-07-01  Gary V. Vaughan  <gary@gnu.org>
1354         The translation project has moved.
1355         * bootstrap (func_get_translations): Use the new translation
1356         project url.
1357         (TP_URL): Removed.
1359 2007-06-26  Karl Berry  <karl@freefriends.org>  (tiny change)
1361         Match Free Software Directory categories.
1362         * doc/m4.texinfo (dircategory): Update.
1364 2007-05-31  Eric Blake  <ebb9@byu.net>
1366         Add extension to divert builtin.
1367         * modules/m4.c (builtin_divert): Immediately divert second
1368         argument.
1369         * m4/output.c (m4_output_text): Allow 0 length.  Fixes regression
1370         from two days ago.
1371         (m4_shipout_text): Short-circuit on zero length.
1372         * tests/freeze.at (loading format 2): Expand test to catch
1373         regression.  Also check out-of-range version.
1374         * tests/builtins.at (divert): Expand test to check corner cases
1375         of extension.
1376         * NEWS: Document the extension.
1377         Reported by Daniel Richard G.
1379 2007-05-30  Eric Blake  <ebb9@byu.net>
1381         Port format improvements from branch.
1382         * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
1383         (Format): Enhance section.
1384         * modules/format.c (format): Accept %'hhd, and issue warnings on
1385         unrecognized specifiers.
1386         * modules/gnu.c (builtin_format): Adjust how format is called.
1388 2007-05-28  Eric Blake  <ebb9@byu.net>
1390         * tests/options.at (--syncoutput): Add xfailed test.
1392         Fix sync line interaction with multiline comments.
1393         * doc/m4.texinfo (Preprocessor features): Improve documentation.
1394         (Syncoutput): Improve testsuite.
1395         (Incompatibilities): Add testcase, and document bug.
1396         * src/freeze.c (reload_frozen_state): Don't interfere with
1397         synclines when reloading state.
1398         * m4/input.c (m4__next_token): Report line where multiline tokens
1399         start.
1400         * m4/m4private.h (m4__token_type): Add parameter.
1401         * m4/m4module.h (m4_output_text): Export.
1402         (m4_shipout_text): Add parameter.
1403         * src/macro.c (m4_macro_expand_input, expand_token)
1404         (expand_argument): Adjust callers so that line is passed from
1405         input to output.
1406         * m4/output.c (output_text): Rename...
1407         (m4_output_text): ...to this, and export.
1408         (m4_insert_file, insert_diversion_helper): Update callers.
1409         (m4_shipout_text): Take new parameter for start line of token.
1410         Output at most one syncline per token.
1411         Reported by Sergey Poznyakoff.
1413         Fix large diversion corner cases.
1414         * tests/freeze.at (large diversion): New test.
1415         * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
1416         (make_room_for): Use NULL, not 0, for pointers.
1417         (m4_freeze_diversions): Allow freezing large diversions.
1418         (insert_diversion_helper): Avoid using rewind.
1420         Also run gnulib unit tests during make check.
1421         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
1422         --tests-base=tests/gnu --with-tests'.
1423         * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
1424         * Makefile.am (SUBDIRS): Run gnulib tests before ours.
1426 2007-05-25  Eric Blake  <ebb9@byu.net>
1428         * m4/system_.h: Include <stdint.h>, for intmax_t.
1429         * THANKS: Update.
1430         Reported by Daniel Richard G.
1432 2007-05-24  Eric Blake  <ebb9@byu.net>
1434         Provide consistent shift semantics regardless of hardware.
1435         * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
1436         before shifting.
1437         (number, unumber): Always use [u]intmax_t.
1438         Reported by Gary V. Vaughan.
1440         Support POSIX flush semantics on all platforms.
1441         * modules/m4.c (m4_sysval_flush): Rely on gnulib.
1442         * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
1444         Work around cygwin and mingw fseeko bugs.
1445         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1446         fseeko'.
1447         * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
1449 2007-04-25  Eric Blake  <ebb9@byu.net>
1451         Test that regression in 1.4.9's eval doesn't recur.
1452         * doc/m4.texinfo (Eval): Check negative division.
1453         * THANKS: Update.
1455 2007-04-12  Eric Blake  <ebb9@byu.net>
1457         Allow for running test in sticky or setgid directory.
1458         * tests/builtins.at (mkdtemp): Adjust test.
1460         Don't test for broken sed too soon.
1461         * tests/others.at (stdin seekable): Rearrange subtests.
1463         Work around 'stdin seekable' shortcoming on glibc.
1464         * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
1465         * tests/others.at (stdin closed): Adjust to new output.
1466         * src/main.c (process_file): No need to return anything.
1467         (main): Use close_stdin instead of close_stdout.
1468         Reported by Ralf Wildenhues.
1470         Enable autobuild usage.
1471         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1472         autobuild'.
1473         * configure.ac (AB_INIT): Output autobuild information.
1475 2007-04-11  Eric Blake  <ebb9@byu.net>
1477         Address testsuite shortcoming in 'stdout full' on glibc.
1478         * tests/others.at (stdout full): Adjust expected output when more
1479         than 1k text is printed to /dev/full.
1480         Reported by Ralf Wildenhues.
1482 2007-04-10  Eric Blake  <ebb9@byu.net>
1484         * tests/macros.at (Arity and defn): Fix quoting.
1486 2007-04-09  Eric Blake  <ebb9@byu.net>
1488         Address failure of 'seekable stdin' on Mac OS X.
1489         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1490         fflush'.
1492 2007-04-07  Eric Blake  <ebb9@byu.net>
1494         Include <config.h> first in all C files, and not in headers.
1495         Fixes regression for --disable-assert builds from 2007-04-02.
1496         * src/m4.h (includes): Don't include config.h here.
1497         * m4/m4private.h (includes): Likewise.
1498         * m4/builtin.c: Include config.h before anything else.
1499         * m4/debug.c: Likewise.
1500         * m4/hash.c: Likewise.
1501         * m4/input.c: Likewise.
1502         * m4/m4.c: Likewise.
1503         * m4/macro.c: Likewise.
1504         * m4/module.c: Likewise.
1505         * m4/symtab.c: Likewise.
1506         * m4/syntax.c: Likewise.
1507         * m4/utility.c: Likewise.
1508         * src/freeze.c: Likewise.
1509         * src/stackovf.c: Likewise.
1511 2007-04-03  Eric Blake  <ebb9@byu.net>
1513         * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
1514         SIGFPE on x86 architectures.
1515         Reported by Ralf Wildenhues.
1517 2007-04-02  Eric Blake  <ebb9@byu.net>
1519         Fix warnings from last commit.
1520         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1521         fprintf-posix sprintf-posix'.
1522         * m4/macro.c (expand_macro, trace_format): Use correct specifier
1523         for size_t.
1524         (process_macro): Avoid negative array index.
1525         * src/freeze.c (produce_resyntax_dump, produce_module_dump)
1526         (dump_symbol_CB, produce_frozen_state): Use correct specifier for
1527         size_t.
1529 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
1531         Get rid of the last 'differs in signedness' compiler warnings:
1533         * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
1534         a regular 'char *', so variables to store the return address,
1535         and iterate through it should be regular 'char *' too.
1536         * m4/input.c (m4_input_block): The start and current members of
1537         the string part of this union store regular 'char *' types, so
1538         they should be regular 'char *' types too.
1540 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
1542         M4 was designed to have a small number of header files defining
1543         the interfaces to several source files each.  Keeping this in
1544         mind allows us to tidy things up considerably.  Having done this,
1545         it becomes clear that some of the installed headers reference
1546         other headers which are not installed (but that's another patch):
1548         * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
1549         here...
1550         * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
1551         ...to here, so client modules can benefit too.
1552         (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
1553         lowest level to save doing it multiple times elsewhere.
1554         * m4/debug.c (stdio.h): Removed.  The portable <gnu/stdio--.h>
1555         is already included via m4private.h.
1556         * modules/time.c (stdio.h): Ditto.
1557         * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
1558         * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
1559         and <gnu/unistd--.h>,
1560         * m4/m4private.h (m4module.h): Use angle brackets for an installed
1561         file.
1562         * m4/hash.h (system.h): Ditto.
1563         * modules/gnu.c (progname.h): Removed.
1564         * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
1565         * m4/m4private.h (assert.h, errno.h): Already included via
1566         m4/m4module.h.
1567         * m4/input.c (ctype.h): Ditto.
1568         * m4/module.c (ltdl.h): Ditto.
1569         * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
1570         (unistd.h): Ditto.
1571         * m4/path.c (config.h, stdlib.h): Ditto.
1572         * m4/utility.c (config.h): Ditto.
1573         * modules/evalparse.c (assert.h, ctype.h): Ditto.
1574         * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
1575         * modules/import.c (assert.h): Ditto.
1576         * modules/m4.c (assert.h, errno.h): Ditto.
1577         * modules/modtest.c (assert.h): Ditto.
1578         * modules/stdlib.c (sys/types.h): DittAo.
1579         * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
1580         Ditto.
1581         * src/stackovf.c (assert.h): Ditto.
1582         * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
1583         private interfaces when NDEBUG is defined.
1584         * modules/import.c (m4/m4module.h, m4private.h): Ditto.
1585         * modules/load.c (m4/m4module.h, m4private.h): Ditto.
1586         * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
1587         * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
1588         * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
1589         * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
1590         * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
1591         * modules/time.c (m4/m4module.h, m4private.h): Ditto.
1592         * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
1593         * src/m4.h (locale.h): Moved from here...
1594         * src/main.h: ...to here.
1595         (m4private.h): Already included via m4.h.
1596         * src/stackovf.c (m4private.h): Ditto.
1598 2007-03-28  Gary V. Vaughan  <gary@gnu.org>
1600         * Makefile.am (stamp-vcl): Removed.
1601         (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
1603 2007-03-28  Eric Blake  <ebb9@byu.net>
1605         * src/main.c (usage): Improve note to TRANSLATORS.
1606         * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
1608         * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
1609         empty.
1611 2007-03-24  Eric Blake  <ebb9@byu.net>
1613         * m4/output.c (m4_output_init): Update to latest gnulib.
1614         * bootstrap (ltdl/m4/.cvsignore): No longer track generated
1615         .cvsignore in CVS.
1616         * NEWS: Reflect release of 1.4.9.
1617         * THANKS: Update.
1619 2007-03-07  Eric Blake  <ebb9@byu.net>
1621         * AUTHORS: Update
1623         Exercise gnulib's new POSIX *printf modules.
1624         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1625         vasprintf-posix'.
1626         * modules/format.c (format): Support %a and %A.
1627         * doc/m4.texinfo (Format): Test this addition.
1628         * NEWS: Document this addition.
1630 2007-03-03  Eric Blake  <ebb9@byu.net>
1632         * m4/input.c (m4__next_token): Fix synclines when in batch mode.
1633         * doc/m4.texinfo (M4exit): Synch another section.
1634         (Syncoutput): Make similar to other sections.
1636 2007-03-01  Eric Blake  <ebb9@byu.net>
1638         * doc/m4.texinfo: Improve the indices.
1639         (Concept index): Rearrange to be last.
1640         (Sysval): Merge from branch.
1642         * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
1644 2007-02-28  Eric Blake  <ebb9@byu.net>
1646         POSIX XCU ERN 137 was approved.
1647         * modules/mpeval.c (numb_extension): Delete.
1648         * modules/m4.c (numb_extension): Likewise.
1649         * modules/evalparse.c (comma_term, condition_term): Always
1650         implement ?: and , operators.
1651         * m4/symtab.c: Update comment to match reality.
1652         * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
1653         dereferencing context directly when accessor exists.
1654         * src/main.c (usage): Prefer GNU_M4 over EMACS.
1655         (struct macro_definition): Rename...
1656         (struct deferred): ...to match usage.  All uses changed.
1657         * doc/m4.texinfo (Eval): Document this change.
1658         (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
1659         over emacs.
1660         (Preprocessor features, Changesyntax): Fix inaccuracies.
1661         * NEWS: Import branch NEWS items for 1.4.x series.  Document
1662         change in eval.
1664         POSIX XCU ERN 118 was approved.
1665         * modules/m4.c (define): Kill posixly_correct distinction in
1666         define behavior, since POSIX says GNU behavior complies.
1667         * tests/builtins.at (define): Restore original semantics.
1668         * doc/m4.texinfo (Pushdef): Document portability issues with
1669         define.
1670         (Incompatibilities): Clean up wording of what POSIX requires.
1671         * NEWS: Document this.
1673 2007-02-26  Eric Blake  <ebb9@byu.net>
1675         Re-enable clean bootstrap on cygwin.
1676         * Makefile.am (AM_LDFLAGS): For now, export all symbols from
1677         modules, since otherwise we run afoul of current libtool
1678         limitations on cygwin and mingw.
1680 2007-02-25  M. Levinson  <levinsm@users.sourceforge.net>  (tiny change)
1682         * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
1683         memory.  Fixes regression introduced 2007-01-20.
1685 2007-02-25  Eric Blake  <ebb9@byu.net>
1687         * tests/freeze.at (loading format 2): Augment test to catch
1688         regression introduced on 2007-01-20.
1689         * THANKS: Update.
1690         Reported by M. Levinson.
1692         * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
1693         latest gnulib.
1695 2007-02-05  Eric Blake  <ebb9@byu.net>
1697         * tests/options.at (--fatal-warnings): New test.
1698         * tests/others.at (stdin seekable): Exit on error.
1699         * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
1700         (m4_get_warnings_exit_opt): Access it.
1701         * m4/m4module.h (m4_context_opt_bit_table): Access it.
1702         * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
1703         on -EE.
1704         (m4_warn, m4_warn_at_line): Change exit status on -E, and force
1705         exit on -EE.
1706         * src/m4.c (usage): Document new -E behavior.
1707         (main): Make -E an additive option.
1708         * doc/m4.texinfo (Operation modes): Document the change.
1709         Reported by Ralf Wildenhues.
1711         * tests/others.at (stdin seekable): Fix bug in test.
1712         * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
1714         * m4/input.c (struct m4_input_block): Remove unused field traced.
1716 2007-02-03  Eric Blake  <ebb9@byu.net>
1717         and Bruno Haible  <bruno@clisp.org>  (tiny change)
1719         * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
1720         the examples.
1721         Reported by Bruno Haible.
1723 2007-01-31  Eric Blake  <ebb9@byu.net>
1725         * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
1726         failure.
1728 2007-01-26  Eric Blake  <ebb9@byu.net>
1730         * m4/symtab.c (includes): Adjust to latest gnulib.
1731         * modules/m4.c (includes): Likewise.
1733 2007-01-23  Eric Blake  <ebb9@byu.net>
1735         * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
1736         extension to make enough room.
1737         (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
1738         code in input.c special cases this category.
1739         (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
1740         for define(eleventh,${11}) extension.
1741         * m4/syntax.c: Update comments accordingly.
1742         (m4_syntax_create, m4_syntax_code): Handle { and }.
1743         * m4/input.c (m4__next_token): Likewise.
1744         * src/freeze.c (produce_frozen_state): Support new categories.
1745         (reload_frozen_state): When loading version 1, disable syntax
1746         features not present in 1.4.x.
1747         * tests/freeze.at: Sort and rename existing tests.
1748         (loading format 1): Ensure we don't break v1 frozen files that
1749         used raw ${.
1750         (loading format 2, reloading changecom, reloading changesyntax):
1751         New tests.
1752         * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
1753         the new syntax categories.
1754         (Arguments): Update the FIXME comment.
1755         (M4wrap): Merge examples from branch, before worrying about fixing
1756         m4wrap to obey POSIX.
1757         (Using frozen files): Start merging from branch.
1758         * NEWS: Update.
1760 2007-01-20  Eric Blake  <ebb9@byu.net>
1762         * src/freeze.c (produce_char_dump): Delete.  Replace with...
1763         (produce_mem_dump): ...this new function, to encode more strings.
1764         Also make the coding easier to read and slightly more compact.
1765         (produce_syntax_dump): Only dump non-default syntax codes.
1766         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
1767         Encode non-ASCII characters in user-supplied strings.
1768         (GET_STRING): Accept escape sequences in version 2.
1769         * NEWS: Document this change.
1770         * TODO: Update.
1772 2007-01-16  Eric Blake  <ebb9@byu.net>
1774         Port patch from branch for stack overflow detection on BSD/OS.
1775         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
1776         * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
1777         ! HAVE_STACK_T_SS_SP]: Use this check.
1778         Reported by Chris McGuire.
1780 2007-01-15  Eric Blake  <ebb9@byu.net>
1782         * tests/builtins.at (__m4_version__): New test.
1783         * modules/traditional.c (m4_macro_table): Provide windows and os2
1784         macros, as appropriate.  Add __traditional__ macro.
1785         * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
1786         not __gmp__, to match module name.
1787         * modules/load.c (m4_macro_table): Name the macro __load__, not
1788         __modules__, to match module name.
1789         * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
1790         from the branch.
1791         (Standard Modules): Improve wording.
1792         (Incompatibilities): Move platform macros into their own node.
1793         (Load, Unload): Use actual examples.
1794         * NEWS: Document this change.
1795         * THANKS: Update.
1797 2007-01-13  Eric Blake  <ebb9@byu.net>
1799         * doc/m4.texinfo (Mpeval): Add tests.
1800         * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
1801         * tests/builtins.at (gmp): ...here.  Rename test to...
1802         (mpeval): ...this.
1803         * tests/generate.awk (new_test): Filter out mpeval tests when gmp
1804         is not available.
1805         * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
1806         no_gnu_extensions with posixly_correct_opt, since they were set in
1807         sync.
1808         * m4/m4private.h (struct m4): Remove no_gnu_extensions.
1809         * src/main.c (main): Update caller.
1810         * src/freeze.c (reload_frozen_state): Likewise.
1811         * modules/m4.c (m4wrap): Likewise.
1813 2007-01-12  Eric Blake  <ebb9@byu.net>
1815         * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
1816         POSIX, so update the comment.
1817         * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
1818         approved by POSIX, so we can always have blind macros, even when
1819         POSIXLY_CORRECT.
1820         (Ifelse): Mention the term `blind builtin'.
1822 2007-01-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1824         * doc/m4.texinfo: Fix a couple of typos.
1826 2007-01-08  Eric Blake  <ebb9@byu.net>
1828         * ltdl/m4/gnulib-cache.m4: Update for new year.
1829         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
1830         Reported by Ralf Wildenhues.
1832 2007-01-06  Eric Blake  <ebb9@byu.net>
1834         * m4/m4private.h (to_uchar): Move...
1835         * m4/m4module.h: here, so modules can use it.
1836         * src/main.c (usage, long_options): Support --posix as a synonym
1837         for --traditional.
1838         * modules/m4.c (numb_invert): Detect unsupported x**-y.
1839         (numb_incr, numb_urshift, numb_extension): New macros.
1840         (numb_obstack): Port patch from branch to support radix 1 output.
1841         * modules/mpeval.c (numb_obstack): Use \ for ratios.
1842         (numb_incr, numb_urshift, numb_extension): New macros.
1843         (mpq2mpz): Warn rather than error.
1844         * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
1845         enumerators.
1846         (eval_error): Rearrange, so that all ignorable errors are less
1847         than SYNTAX_ERROR.
1848         (eval_text, last_text): Obey C++ type safety rules.
1849         (numb_pow): Change return type.
1850         (exp_term): Adjust caller.
1851         (m4_evaluate): Fail on bad exponent.
1852         (logical_or_term, logical_and_term): Ignore failed ** in short
1853         circuit.
1854         (eval_lex): Fix typos when detecting <<= and >>=.  Use \ instead
1855         of : for ratio.  Support >>>, ,, and ?:.  Port patch from branch
1856         to parse radix 1 numbers.
1857         (condition_term, comma_term): New parse functions.
1858         (shift_term): Support >>>.
1859         (m4_evaluate): Port patch from branch to output radix 1 numbers.
1860         Warn instead of error for most parse problems.
1861         * doc/m4.texinfo (Limits control, Eval): Document these changes.
1862         * NEWS: Document new operators and new command line option.
1864 2007-01-04  Eric Blake  <ebb9@byu.net>
1866         * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
1868 2007-01-03  Eric Blake  <ebb9@byu.net>
1870         * doc/m4.texinfo (Format, Incr): More merges.
1871         (Eval): Ensure C precedence rules are met.
1872         * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
1873         (not_term, logical_not_term): Delete; these are same precedence
1874         as other unary operators.
1875         (equality_term): New; these are lower precedence than relational
1876         operators.
1877         (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
1878         operators for better error messages.
1879         (logical_or_term, logical_and_term): Short-circuit out the error
1880         of division by zero.
1881         (unary_term): Allow consecutive unary operators.
1882         * modules/m4.c (int2numb, numb2int): Delete; these potentially
1883         truncate bits.
1884         (numb_not, numb_eor, numb_ior, numb_and): Update callers.
1885         * modules/mpeval.c (reduce1, reduce2): Protect macros better.
1886         * NEWS: Document this change.
1888 2006-12-27  Eric Blake  <ebb9@byu.net>
1890         * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
1891         branch.
1892         * modules/m4.c (substr): Merge from branch.
1894 2006-12-26  Eric Blake  <ebb9@byu.net>
1896         * doc/m4.texinfo (Changesyntax): Check for regressions with
1897         changesyntax(W=...).
1899 2006-12-22  Eric Blake  <ebb9@byu.net>
1901         * m4/m4module.h (m4_set_syntax): Change signature.
1902         * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
1903         warning.
1904         (changesyntax): Likewise, and update caller.
1905         * m4/m4private.h (m4_syntax_table): Add orig member.
1906         * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
1907         Don't set is_single_quotes and is_single_comments when the begin
1908         character is shadowed by another syntax type.
1909         (m4_syntax_create): Populate default syntax table.
1910         (add_syntax_attribute): Don't lose quote assignment.
1911         (remove_syntax_attribute): Only allow removing rquote or ecomm.
1912         (add_syntax_set, subtract_syntax_set, set_syntax_set)
1913         (reset_syntax_set): New helper routines.
1914         (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
1915         to default, and empty chars reverts that key to default.
1916         (check_is_single_quotes, check_is_single_comments): New helper
1917         routines.
1918         * modules/m4.c (changecom): Merge from branch.
1919         * m4/input.c (m4__next_token): Rearrange token recognition order
1920         to macro, quote, comment, in order to match traditional
1921         implementations.
1922         * src/freeze.c (reload_frozen_state): Update caller.
1923         * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
1924         modifications.
1925         (Changeresyntax): Revise to match style of surrounding sections
1926         and add more examples.
1927         (Changesyntax): Likewise, and update to new semantics.
1928         * NEWS: Document this change.
1930         * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
1931         (M4wrap, Eval, Errprint): Fix typos.
1932         (Divnum): Not necessary to redivert in example.
1934 2006-12-21  Eric Blake  <ebb9@byu.net>
1936         * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
1937         from branch.
1939 2006-12-19  Eric Blake  <ebb9@byu.net>
1941         * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
1942         * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
1943         can track write errors without all other callers warning multiple
1944         times.
1945         (sysval_flush_helper): New function.
1946         (dumpdef, syscmd, errprint, m4exit): Adjust callers.
1947         * modules/gnu.c (esyscmd): Likewise.
1948         * tests/others.at (stdout closed, stdout full): Error message
1949         update.
1951 2006-12-16  Eric Blake  <ebb9@byu.net>
1953         * src/main.c: Fix missing include.
1955         * src/main.c (main): Check for errors when closing stdin.
1956         * modules/m4.c (m4exit): Missed part of previous patch: flush
1957         stdin before a successful exit.
1958         Reported by Ralf Wildenhues.
1960 2006-12-14  Eric Blake  <ebb9@byu.net>
1962         * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
1963         required by POSIX.
1964         * tests/others.at (stdin seekable): New test.
1966 2006-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1968         * doc/m4.texinfo: Fix some typos.
1970 2006-12-04  Eric Blake  <ebb9@byu.net>
1972         * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
1973         sections.
1974         (Modules): Make style consistent.
1976 2006-11-16  Eric Blake  <ebb9@byu.net>
1978         * bootstrap: Relax m4 requirement, thanks to...
1979         * configure.ac (Gettext support): ...this workaround to the 1.4.4
1980         bug.  Undoes restriction added on 2006-11-09.
1982         * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
1983         diversions are now closed when not active.
1984         (divert): Remove check now in the manual.
1985         * tests/others.at (stderr closed): Likewise.
1986         (stdout closed): Add a check.
1987         * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
1988         more docs with branch.
1990 2006-11-14  Eric Blake  <ebb9@byu.net>
1992         Remerge sparse diversion handling from branch.
1993         * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
1994         avltree-oset.
1995         * m4/output.c (diversion_table): Change type to gl_oset_t.
1996         (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
1997         (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
1998         (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
1999         (div0, diversion_storage): New variables.
2000         (diversions, equal_diversion_CB): Deleted.
2001         (threshold_diversion_CB): New callback.
2002         (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
2003         functions.
2004         (m4_tmpfile): Move cloexec action here.
2006         * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
2007         char.
2009 2006-11-13  Eric Blake  <ebb9@byu.net>
2011         Add several new command line options.
2012         * src/main.c (usage): Update.
2013         (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
2014         --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
2015         Make --regexp-syntax argument optional.
2016         (main): Support new options.  Fix regression in interactive
2017         behavior from Nov 8.
2018         * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
2019         M4_OPT_SYNC_OUTPUT_BIT.
2020         * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
2021         syncoutput, to match option.
2022         (m4_parse_truth_arg): New prototype.
2023         * m4/utility.c (m4_parse_truth_arg): Implement it.
2024         * m4/output.c (m4_shipout_text): Adjust sync_output caller.
2025         * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
2026         m4_parse_truth_arg.
2027         * doc/m4.texinfo (Operation modes, Dynamic loading features)
2028         (Preprocessor features, Limits control, Debugging options)
2029         (Command line files): Update documentation.
2030         * tests/builtins.at (mkstemp): Simplify.
2031         * tests/macros.at (Command line pushdef): New test.
2032         (Command line define): Improve.
2033         * tests/options.at (--traceon and --traceoff, --syncoutput): New
2034         tests.
2035         (POSIXLY_CORRECT): Likewise.
2036         (deprecated options): Augment.
2037         (--regexp-syntax): Update, now that -r takes optional arg.
2038         * NEWS: Reformat.  Document new options.
2040 2006-11-11  Eric Blake  <ebb9@byu.net>
2042         One step closer to allowing C++ compilation - don't blindly
2043         convert between char* and unsigned char*.
2044         * m4/m4module.h (m4_set_syntax): Change signature.
2045         * m4/m4private.h (m4_string): Use signed char.
2046         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
2047         (m4_get_syntax_ecomm): No longer a need to cast.
2048         * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
2049         Reflect this change.
2050         * m4/macro.c (expand_argument): Simplify.
2051         (expand_token): Use proper type.
2052         * src/freeze.c (reload_frozen_state): Likewise.
2053         * m4/input.c (MATCH, match_input): Likewise.
2054         * modules/m4.c (translit): Likewise.
2055         * modules/gnu.c (substitute): Simplify.
2057         * m4/macro.c (trace_format): Use canonical type name.
2058         * m4/output.c (m4_freeze_diversions): Likewise.
2059         * src/freeze.c (produce_module_dump, dump_symbol_CB)
2060         (produce_frozen_state): Likewise.
2061         * m4/m4private.h (to_uchar): Grab from branch.
2062         * m4/input.c (string_peek, string_read): Use it.
2063         * m4/utility.c (skip_space): Likewise.
2064         * src/main.c (main): Likewise.
2065         * doc/m4.texinfo (Translit): Remerge from branch.
2066         * tests/builtins.at (translit): Test 8-bit range.
2067         * modules/m4.c (m4_expand_ranges): Merge from branch.
2069 2006-11-09  Eric Blake  <ebb9@byu.net>
2071         * bootstrap: Validate that installed M4 is powerful enough.
2072         Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
2074 2006-11-08  Eric Blake  <ebb9@byu.net>
2076         Merge deferred handling of -D option from branch.
2077         * doc/m4.texinfo (Debugging options, Preprocessor features)
2078         (Dynamic loading features, Operation modes, Invoking m4):
2079         Document this change.
2080         * src/main.c (OPTSTRING): Specify in-order processing.
2081         (process_file): New function.
2082         (main): Use it to interleave files and deferred options.
2083         * tests/macros.at (Command line define): New test.
2084         * tests/generate.awk: Allow '@comment file' as first example
2085         within a node.
2086         * tests/options.at (option grouping): Update to reflect actual
2087         POSIX semantics.
2088         (file names): New test.
2090 2006-11-07  Eric Blake  <ebb9@byu.net>
2092         * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
2093         for failure.
2095         * tests/builtins.at (m4exit): New test; failed on cygwin before
2096         this patch.
2097         * m4/output.c (cleanup_tmpfile): Close files before removing
2098         directory.
2099         (make_room_for, m4_output_exit): Ensure that atexit handler
2100         invoked from m4_error sees consistent state.
2102         * doc/m4.texinfo (Errprint): Merge another doc node.
2103         * tests/builtins.at (dumpdef, errprint): New tests.
2104         * modules/m4.c (errprint): Merge from branch: flush before
2105         printing to stderr.
2107 2006-11-02  Eric Blake  <ebb9@byu.net>
2109         * bootstrap: Update bootstrap requirement wording.
2110         Reported by Bruno Haible.
2112 2006-10-31  Eric Blake  <ebb9@byu.net>
2114         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2115         strstr'.
2116         * doc/m4.texinfo (Translit): Merge from branch.
2117         * modules/m4.c (divert, substr): Ignore excess arguments.
2118         (index, translit): Merge from branch.
2119         * tests/builtins.at (translit): Add a test.
2121 2006-10-30  Eric Blake  <ebb9@byu.net>
2123         * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
2124         checkin.
2125         * m4/symtab.c (m4_get_symbol_value_module): Likewise.
2127         * modules/m4.c (m4_make_temp): Make safe across libtool.
2128         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
2129         * configure.ac (--with-modules): Accomodate changed module
2130         location when doing './configure --enable-debug'.
2132 2006-10-28  Eric Blake  <ebb9@byu.net>
2134         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2135         config-h.'
2137 2006-10-27  Eric Blake  <ebb9@byu.net>
2139         * bootstrap (gnulib): No longer a need to patch after gnulib-tool
2140         --update.
2141         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
2142         0.16, since 0.15 is incompatible with our automake requirement.
2144         * m4/macro.c (expand_argument): Fix missing initialization.
2145         * m4/m4private.h (struct m4_symbol_value): Store entire
2146         m4_builtin, not just the func.
2147         (m4_get_symbol_value_func): Update.
2148         (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
2149         fast accessors.
2150         * m4/m4module.h (m4_get_symbol_value_builtin)
2151         (m4_get_symbol_builtin): New prototypes.
2152         (m4_set_symbol_value_func): Delete, replace with...
2153         (m4_set_symbol_value_builtin): New function.
2154         (m4_builtin_find_by_name): Change signature.
2155         * m4/symtab.c (m4_symbol_value_print): Simplify.
2156         (m4_get_symbol_value_func): Update.
2157         (m4_get_symbol_value_builtin): New function.
2158         (m4_set_symbol_value_func): Delete, replace with...
2159         (m4_set_symbol_value_builtin): New function.
2160         (dump_symbol_CB) [DEBUG_SYM]: Simplify.
2161         * m4/builtin.c (m4_builtin_find_by_name): Change signature.
2162         * m4/input.c (struct m4_input_block): Remove unused trace member.
2163         (m4_push_builtin, builtin_print, init_builtin_token): Update
2164         callers.
2165         * m4/module.c (install_builtin_table): Likewise.
2166         * src/freeze.c (reload_frozen_state): Likewise.
2167         * modules/gnu.c (builtin): Make it possible to retrieve a builtin
2168         token, even after the builtin has been undefined.
2169         * doc/m4.texinfo (Builtin): Document new capability.
2170         * NEWS: Likewise.
2172         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2173         tempname'.
2174         * modules/m4.c (m4_make_temp): Use it.
2175         * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
2177 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2179         * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
2180         files.
2182 2006-10-26  Eric Blake  <ebb9@byu.net>
2184         Silence -O2 -Wall -Wwrite-strings warnings.
2185         * m4/m4private.h (m4_symbol_value): Const-ify text.
2186         * m4/m4module.h (m4_get_symbol_value_text)
2187         (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
2188         (m4_set_symbol_value_placeholder): Likewise.
2189         * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
2190         fallout.
2191         * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
2192         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2193         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2194         Likewise.
2195         * modules/format.c (format): Likewise.
2196         * src/main.c (main): Likewise.
2197         * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
2198         * modules/shadow.c (shadow, test): Likewise.
2199         * m4/output.c (m4_make_diversion): Don't hold on to empty
2200         diversions.
2201         (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
2202         (m4_freeze_diversions): Likewise.  Don't use uninitialized
2203         variable.
2205         Convert diversions to list instead of sparse array, part 2.
2206         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2207         avltree-list'.
2208         * m4/output.c (m4_diversion): Add next pointer and divnum members.
2209         (diversion_table): Convert to a list instead of a sparse array.
2210         (free_list): Maintain free list of reclaimed diversions.
2211         (equal_diversion_CB, cmp_diversion_CB): New functions.
2212         (m4_output_init): Set up list.
2213         (m4_output_exit): Tear down list.
2214         (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
2215         list iteration.
2216         (m4_make_diversion): Change creation of new diversions.
2217         (m4_insert_diversion_helper): New function, to avoid list
2218         searches.
2219         * tests/builtins.at (divert): The test now passes.
2220         * NEWS: Document this improvement.
2222         Convert diversions to list instead of sparse array, part 1.
2223         * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
2224         for length.
2225         * m4/output.c (diversion, total_buffer_size, output_unused):
2226         Track size in size_t.  All users changed.
2227         (struct diversion): Reduce size now, to compensate for part 2.
2228         (m4_make_diversion, make_room_for): Avoid malloc overflow.
2229         (m4_output_exit): Fix typo in assert.
2230         (m4_output_init, make_room_for, m4_make_diversion)
2231         (m4_insert_diversion, m4_freeze_diversions): Adjust users of
2232         struct m4_diversion to disambiguate the new union.
2233         * tests/builtins.at (divert): Detect this failure.
2235 2006-10-25  Eric Blake  <ebb9@byu.net>
2237         * m4/m4module.h (m4_push_builtin): Add parameter.
2238         * modules/m4.c (defn): Update caller.
2239         * m4/input.c (file_read_init, string_read_init): No longer
2240         needed.
2241         (input_funcs): Change signature of read_func, all callers
2242         updated.
2243         (composite_peek, composite_read, composite_unget),
2244         (composite_print, composite_funcs): New input type.  Not yet
2245         fully utilized, but one step closer to fixing defn.
2246         (m4_input_block): Make every input block track current file and
2247         line.  Rename some members.  Remove unused out_line.  Add support
2248         for composite input block.
2249         (input_change): New flag.
2250         (file_peek, file_read, file_clean, file_unget, file_print):
2251         Update callers.
2252         (m4_push_file, m4_push_builtin, m4_push_string_init)
2253         (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
2254         (m4_skip_line, pop_input): Track input block changes.
2255         (m4_pop_wrapup): Avoid overflow.
2256         (init_builtin_token): Handle composite input.
2257         (next_char): Handle input block changes.
2258         * doc/m4.texinfo (Location): Remerge from branch.
2260         * src/m4.h (includes): Need <locale.h> after all; fixes
2261         regression from yesterday.
2263         * m4/system_.h (obstack_regrow): New macro.  Hopefully glibc will
2264         accept it someday.
2265         * m4/macro.c (expand_macro): Avoid referencing invalid memory.
2266         Handle nesting the argc obstack.
2267         (expand_token): Avoid unnecessary malloc.
2268         (collect_arguments): Copy name before invalidating it.
2269         (argc_stack, argv_stack): New variables.
2270         (m4_macro_expand_input): Initialize argc and argv stacks once per
2271         file, instead of once per macro.
2273 2006-10-24  Eric Blake  <ebb9@byu.net>
2275         * src/m4.h (includes): Add gettext.h, for N_.  Assume setlocale.
2277 2006-10-23  Eric Blake  <ebb9@byu.net>
2279         * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
2280         from branch regarding stripped leading whitespace.
2282         * modules/m4.c (includes): Use safe headers even when configured
2283         with --enable-assert.
2284         (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
2285         #defined as mkstemp_safer.
2287 2006-10-21  Eric Blake  <ebb9@byu.net>
2289         * modules/m4.c (m4_make_temp): Change signature.
2290         (maketemp, mkstemp): Update callers.
2291         * modules/m4.h (m4_make_temp_func): New export.
2292         * modules/gnu.c (mkdtemp): New macro.
2293         * doc/m4.texinfo (Operation modes): Document interaction with
2294         --safer.
2295         (Mkdtemp): New node.
2296         * tests/builtins.at (mkdtemp): New test.
2297         (mkstemp): Check for umask effect.
2298         * NEWS: Document new builtin.
2300         * tests/generate.awk (normalize): Update recognition of trailing
2301         spaces in tests.
2302         * doc/m4.texinfo: Minor formatting fixes from branch.
2303         (Foreach, Improved foreach): Merge from branch.
2304         * examples/foreach.m4: Merge from branch.
2305         * examples/foreachq.m4: New file from branch.
2306         * examples/foreach2.m4: Likewise.
2307         * examples/foreachq2.m4: Likewise.
2309         * doc/m4.texinfo (titlepage): Add myself as author.
2310         * src/main.c (AUTHORS): Likewise.
2312 2006-10-19  Eric Blake  <ebb9@byu.net>
2314         * modules/m4.c (m4_make_temp, mkstemp): New functions.
2315         (maketemp): Add POSIX behavior and a warning.
2316         * tests/others.at (maketemp): Move this test...
2317         * tests/builtins.at (mkstemp): ...to here, and beef up.
2318         * tests/options.at (--safer): Update to new warning message.
2319         * doc/m4.texinfo (Mkstemp): Sync from branch.
2320         (Extensions): Update maketemp behavior.
2321         * NEWS: Document that maketemp now always warns.
2323         * tests/generate.awk: For ease of doc-writing, simplify selection
2324         of '-Ipath/to/examples' to '@comment examples'.
2325         * examples/forloop.m4: Simplify.
2326         * examples/forloop2.m4: New file.
2327         * examples/quote.m4: New file.
2328         * doc/m4.texinfo (Improved forloop): New node.
2329         (Manual): Clarify use of examples directory.
2330         (Shift, Forloop): Resync from branch.
2331         (Include, Location): Update to new usage of examples directory.
2333         * m4/system_.h (includes): Pick up <unistd.h> before checking for
2334         _POSIX_VERSION.
2335         (gettext_noop): Don't define here, let gettext.h do it instead.
2336         * po/POTFILES.in: Update entries to reflect gnulib imports.
2338 2006-10-16  Eric Blake  <ebb9@byu.net>
2340         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2341         configmake'.
2342         * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
2343         pkglibexecdir support.
2344         * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
2345         worry about pathconf.h, now that gnulib does it for us.
2346         (pkgmodincludedir): Simplify.
2347         (pkglibexecdir): Delete, now that automake does this.
2348         * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
2349         * src/main.c (usage): Likewise.
2350         * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
2352         * doc/m4.texinfo: Port some changes from the branch.
2353         (Invoking m4): Promote to a chapter, instead of a section of
2354         Preliminaries.
2355         (Operation modes, Dynamic loading features, Preprocessor features)
2356         (Limits control Frozen state, Debugging options)
2357         (Command line files): Subdivide into new sections.
2358         (Cleardivert): Rename from cleardiv.
2360 2006-10-14  Eric Blake  <ebb9@byu.net>
2362         * tests/others.at (stdin closed): Update to match previous patch.
2364         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
2365         is not portable.
2366         Reported by Ralf Wildenhues.
2368         * modules/m4.c (undivert): Merge from branch.
2369         * doc/m4.texinfo (Improved fatal_error): Fix typo.
2370         (Improved exch): New node, copied from branch.
2371         (Improved cleardivert): Update from branch.
2372         * THANKS: Update.
2374 2006-10-13  Eric Blake  <ebb9@byu.net>
2376         * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
2377         not config-h.in.
2378         * modules/gnu.c (builtin, indir): Transparently handle builtin
2379         tokens from defn.
2380         * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
2381         * m4/input.c (m4_pop_wrapup): Display debug message when switching
2382         to wrapped text.
2383         (m4_input_init): No need to use empty file any more.
2384         (file_print): Display correct file name.
2385         * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
2386         dereference a NULL file name.
2387         * m4/m4module.h (m4_pop_wrapup): New parameter.
2388         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
2389         prototypes.
2390         * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
2391         * m4/symtab.c (m4_symbol_value_groks_macro): New method.
2392         * src/main.c (main): Adjust caller.
2393         * tests/options.at (--debugmode): Test more output from -dV.
2395 2006-10-12  Eric Blake  <ebb9@byu.net>
2397         * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
2399         * m4/m4private.h (m4__next_token_is_open): New prototype.
2400         * m4/m4module.h (m4_push_single): Delete; push_string is an
2401         adequate interface, and removing support for this simplifies the
2402         input engine.
2403         (m4_push_wrapup): New parameter.
2404         (m4_is_syntax): Delete; m4_has_syntax is sufficient.
2405         (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
2406         start-quote and start-comment exclusive from other syntax
2407         categories.
2408         * m4/syntax.c: Likewise.
2409         * m4/input.c (input_funcs): Make polymorphic without requiring
2410         clients to know whether they are located at isp.  All users
2411         changed.
2412         (file_names): New variable.
2413         (m4_input_init): Initialize it.
2414         (m4_push_file): Use it.
2415         (m4_input_exit): Free it after use.
2416         (m4__next_token): Simplify slightly.
2417         (m4__peek_token): Rename and simplify...
2418         (m4__next_token_is_open): ... to this.  In particular, this
2419         allows us to avoid a double ungetc, which POSIX doesn't
2420         guarantee.
2421         (struct m4_input_block, m4_push_single, single_peek, single_read):
2422         Remove support for single characters, as the input engine now
2423         guarantees we don't need it.
2424         (file_unget, string_unget, m4_input_print, unget_input):
2425         Strengthen assertions.
2426         (file_init_funcs, file_read_init): New for file reading.
2427         (string_init_funcs, string_read_init): New for wrapped text.
2428         (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
2429         Support wrapped text with locations.
2430         (m4_skip_line): Support dnl across include file boundary.
2431         (peek_char): Don't pop input when peeking.
2432         (file_peek): Peek can be called at the end of the file.
2433         (string_read): Don't read beyond string bounds.
2434         * m4/macro.c (expand_token, collect_arguments): Update callers.
2435         (expand_macro): Report errors at location of open parenthesis.
2436         (expand_token, expand_argument, process_macro): Avoid negative
2437         array dereferences with m4_has_syntax.
2438         * m4/utility.c (skip_space): Likewise.
2439         * modules/m4.c (m4wrap): Update caller.
2440         * tests/builtins.at (__file__, __line__, dnl): New tests.
2441         * tests/options.at (--debugmode): Normalize the output.
2442         * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
2443         Remerge recent changes from branch.
2444         (Improved fatal_error): New node from branch.
2446 2006-10-11  Eric Blake  <ebb9@byu.net>
2448         * src/main.c (usage, long_options): Add --debugmode as an alias
2449         for --debug, to match macro name.
2450         * tests/options.at (--debugmode): Rename from --debug, and test
2451         for new alias.
2452         (--discard-comments): Augment test.
2453         * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
2454         * NEWS: Likewise.
2456 2006-10-10  Eric Blake  <ebb9@byu.net>
2458         Trace improvements: debugmode(c) was always printing the last two
2459         lines paired, combine them; and show non-text expansions.
2460         * m4/macro.c (trace_prepre): Update to show what the macro will
2461         expand to.
2462         (trace_pre): No need to special-case on debugmode(c).
2463         (trace_post): Likewise.  Also, show non-text expansions.
2464         (expand_macro): Update caller.  Collecting arguments can change
2465         debug mode, so cache values beforehand.
2466         (trace_format): Remove support for unused %l%S%r, and fix support
2467         for %z to match gcc's attribute((printf)).
2468         (trace_header): Update caller.
2469         * m4/input.c (struct m4_input_block): Rename from input_block.
2470         (struct input_funcs): Add print_func member.
2471         (file_print, builtin_unget, builtin_print, string_print)
2472         (m4_input_print): New functions.
2473         (m4_push_string_finish): Change return type.
2474         (m4_push_file): Fix missing use of close parameter.
2475         * m4/debug.c (m4_debug_decode): Don't clear pending traces.
2476         * m4/m4module.h (m4_input_print): New prototype.
2477         * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
2478         to match behavior change.
2479         * tests/options.at (--debug): Likewise.
2480         * tests/macros.at (Propagation of traceon)
2481         (Propagation of --trace): Likewise.
2482         * tests/others.at (stderr closed, stdout closed, stdin closed):
2483         Likewise.
2484         * doc/m4.texinfo (Forloop): Simplify.
2485         (Trace): Update to changed behavior.
2486         (Debugmode): Document this change.
2487         * src/main.c (usage): Likewise.
2488         * NEWS: Likewise.
2490 2006-10-09  Eric Blake  <ebb9@byu.net>
2492         * m4/path.c (m4_include_env_init): Don't alter result of getenv.
2493         Reported by Ralf Wildenhues.
2495         * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
2497 2006-10-07  Eric Blake  <ebb9@byu.net>
2499         * m4/m4module.h (m4_set_exit_failure): New prototype.
2500         * m4/utility.c (m4_set_exit_failure): New function.
2501         * modules/m4.c (m4exit): Use it to avoid yet another global
2502         variable export in libm4.
2504 2006-10-06  Eric Blake  <ebb9@byu.net>
2506         * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
2507         up.
2508         * tests/others.at (stdout closed): Fix final check.
2510         Replace uses of tmpfile with clean-temp, since tmpfile is
2511         incompatible with closeout.
2512         * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
2513         exit status of m4.
2514         * tests/others.at (stderr closed): Likewise.
2515         * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
2516         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
2517         clean-temp.
2518         * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
2519         (m4_tmpfile, cleanup_tmpfile): New functions.
2520         (make_room_for, m4_insert_diversion): Use clean-temp module.
2521         * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
2522         tmpfile.
2523         * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
2525         * m4/utility.c (m4_numeric_arg): Merge from branch.
2526         * modules/gnu.c (debuglen): New builtin.
2527         * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
2528         Rename --arglength to --debuglen.
2529         * tests/options.at (--arglength): Rename to --debuglen.
2530         (deprecated options): Augment test.
2531         * doc/m4.texinfo (Invoking m4): Document the name change.
2532         (Debugmode): Rename from Debug Levels.
2533         (Debugfile): Rename from Debug Output.
2534         (Debuglen): New node.
2535         * NEWS: Document these changes.
2537         * modules/m4.c (m4exit): Fix typo.  Ensure desired exit status in
2538         case closing a module exits.
2540         * modules/m4.c (m4exit): Merge from branch.
2541         * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
2543 2006-10-05  Eric Blake  <ebb9@byu.net>
2545         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
2546         closeout.
2547         * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
2548         * src/main.c (main): Close stdout on exit.
2549         * m4/debug.c (set_debug_file): Check for write failure.
2550         * m4/m4.c (m4_delete): Don't mask write failure.
2551         * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
2552         macros before calling AT_CHECK.
2553         (M4_ONE_MEG_DEFN): New helper macro.
2554         * tests/others.at (stdout full): New test.
2555         (stderr closed, stdin closed, stdout closed): Augment.
2556         * tests/builtins.at (syscmd): New test.
2557         (esyscmd): Augment.
2559 2006-10-04  Eric Blake  <ebb9@byu.net>
2561         * tests/builtins.at: Alphabetize tests.
2562         * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
2563         * tests/generate.awk (new_test): Fix underquoting.
2564         * tests/others.at (maketemp): Rename from misc.
2565         (stdin closed, stdout closed, stderr closed): New tests.
2567 2006-10-03  Eric Blake  <ebb9@byu.net>
2569         Avoid all global variables in modules, so that --disable-static
2570         can work on cygwin.
2571         * examples/incl.m4: New file, from branch.
2572         * Makefile.am (dist_pkgdata_DATA): Distribute it.
2573         * doc/m4.texinfo (Location): Merge this section from branch.
2574         (Include): Update the test.
2575         * tests/generate.awk (new_test): Allow for VPATH build
2576         pre-processing of expected __program__ output.
2577         * m4/m4module.h (m4_current_diversion, m4_output_current_line):
2578         Avoid global variables.
2579         (m4_context_field_table): Add current_diversion, output_line.
2580         (m4_output_init, m4_make_diversion): Add parameter.
2581         (m4_get_program_name, m4_set_program_name): New accessors.
2582         * m4/m4private.h (m4_get_current_diversion),
2583         (m4_set_current_diversion, m4_get_output_line)
2584         (m4_set_output_line): New accessors.
2585         * m4/utility.c (m4_get_program_name, m4_set_program_name): New
2586         methods.
2587         * modules/m4.c (divnum, divert): Adjust callers.
2588         * modules/gnu.c (__program__): Likewise.
2589         * m4/output.c (m4_output_init, m4_make_diversion)
2590         (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
2591         (m4_insert_diversion): Likewise.
2592         * m4/input.c (file_clean, m4_push_file): Likewise.
2593         * src/freeze.c (reload_frozen_state): Likewise.
2594         * src/main.c (main, usage): Likewise.
2596         Partially plug memory leak when unloading gnu module.
2597         * tests/modules.at (unload gnu module): New test.
2598         * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
2599         (m4_regexp_compile): Move static storage to module visibility.
2600         * tests/options.at (--debug): Adjust to new output.
2602 2006-09-29  Eric Blake  <ebb9@byu.net>
2604         Even when not the first option, --help can't have side effects.
2605         * tests/options.at (--debugfile): Detect bugs in this area.
2606         * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
2607         stderr.
2608         * src/main.c (main): Fix it by deferring debugfile change.  Also,
2609         defer closing streams until after module tracing is done.
2610         * modules/gnu.c (debugfile): Make message consistent with command
2611         line.
2612         * doc/m4.texinfo (Invoking m4): Touch up the documentation.
2613         * NEWS: Document this fix.
2615         * modules/m4.c (dnl): Include macro name in warning message.
2616         * m4/input.c (m4_skip_line): Add parameter.
2617         * m4/m4module.h (m4_skip_line): Likewise.
2618         * src/main.c (usage): Update wording.
2619         * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
2620         issue of blind macros vs. POSIX is resolved.
2621         (Dnl): Merge another node from branch.
2623         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
2624         xstrtol.
2625         * m4/system_.h (N_): Define.
2626         * src/main.c (main): Validate numeric arguments.
2627         (size_opt): New function, idea borrowed from coreutils.
2628         * m4/macro.c (expand_macro): -L0 implies no limit.
2629         * doc/m4.texinfo (Invoking m4): Document this change.
2630         * NEWS: Likewise.
2631         * tests/options.at: (--arglength, --nesting-limit)
2632         (--regexp-syntax): New tests of argument validation.
2634 2006-09-28  Eric Blake  <ebb9@byu.net>
2636         * tests/options.at: Alphabetize the tests.
2638 2006-09-27  Eric Blake  <ebb9@byu.net>
2640         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
2641         another parameter to print module info.
2642         * m4/macro.c (trace_pre): Adjust caller.
2643         * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
2644         * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
2645         * NEWS: Document this.
2647         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
2648         strnlen.
2649         * m4/symtab.c (symbol_value_print): Rename to...
2650         (m4_symbol_value_print): ...this, and...
2651         (m4_symbol_print): Update to allow -L length truncation.  Now
2652         truncation also affects dumpdef output and builtin names.
2653         * m4/m4private.h (nesting_limit, max_debug_argument_length):
2654         Switch to size_t.
2655         * m4/m4module.h (m4_symbol_print): Add parameter.
2656         (m4_symbol_value_print): New function.
2657         * modules/m4.c (dumpdef): Allow length truncation.
2658         * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
2659         repeating code.
2660         * doc/m4.texinfo (Invoking m4): Document -l better.
2661         (Dumpdef, Debug Levels): Document the effect of -l.
2662         * NEWS: Document this change.
2664         * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
2665         (m4_expand_ranges): Ensure we aren't picking up partial object on
2666         obstack.
2667         * modules/stdlib.c (setenv): Allow extra arguments.
2668         * modules/time.c (ctime): Avoid side effect in call to
2669         obstack_grow.
2670         * modules/gnu.c (m4_regexp_substitute): Likewise.
2671         (renamesyms): Avoid extra obstack_init.
2672         * src/freeze.c (reload_frozen_state): Remove debug comment.
2673         (produce_frozen_state): Simplify fprintf to puts where possible.
2674         * modules/modtest.c (modtest_init, modtest_finish): Likewise.
2675         * modules/import.c (import, symbol_fail, modules_fail): Likewise.
2676         * m4/macro.c (trace_flush): Likewise.
2677         * m4/debug.c (m4_debug_message_prefix): Likewise.
2678         * m4/path.c (include_dump): Likewise.
2679         * m4/module.c (module_remove): Likewise.
2680         (install_builtin_table): Simplify malloc and string
2681         concatenation.
2683 2006-09-26  Eric Blake  <ebb9@byu.net>
2685         * m4/m4module.h (m4_symbol_print): New prototype.
2686         (M4_DEBUG_TRACE_STACK): New enumerator.
2687         (m4_is_debug_bit): Allow use without requiring m4private.h.
2688         * m4/symtab.c (symbol_value_print, m4_symbol_print): New
2689         functions.
2690         * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
2691         callback.
2692         (dumpdef): Allow printing pushdef'd stacks.
2693         * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
2694         * src/main.c (usage): Document it.
2695         * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
2696         * NEWS: Likewise.
2698         * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
2699         gnulib headers.
2700         * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
2701         of lines during make.
2702         (AM_CPPFLAGS): Remove unneeded include path.
2703         (src_m4_CPPFLAGS): Remove redundant include path.
2704         * m4/system_.h Make preprocessor indentation consistent.
2705         (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
2706         macros.
2707         (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
2708         branch.
2709         (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
2710         (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
2711         (bool, true, false): Don't undefine here; stdbool takes care of
2712         that.
2713         * src/m4.h (includes): Assume config.h, and several standard
2714         headers.
2715         (__CYGWIN__, WIN32): Don't define here; let system.h do it.
2716         * m4/m4private.h: Assume config.h.
2717         * m4/output.c: Likewise.
2718         * m4/path.c: Likewise.
2719         * m4/resyntax.c: Likewise.
2720         * m4/utility.c: Likewise.
2721         * modules/gnu.c: Likewise.
2722         * modules/import.c: Likewise.
2723         * modules/load.c: Likewise.
2724         * modules/m4.c: Likewise.
2725         * modules/modtest.c: Likewise.
2726         * modules/mpeval.c: Likewise.
2727         * modules/perl.c: Likewise.
2728         * modules/shadow.c: Likewise.
2729         * modules/stdlib.c: Likewise.
2730         * modules/time.c: Likewise.
2731         * modules/traditional.c: Likewise.
2733 2006-09-21  Eric Blake  <ebb9@byu.net>
2735         * doc/m4.texinfo (Invoking m4): Add clarification on option
2736         processing behavior.
2737         * tests/options.at (option grouping): Test this.
2738         * THANKS: Update.
2739         Reported by Mikhail Teterin.
2741         * bootstrap: Add --force option, based on idea from coreutils.
2742         * README: Document that ./bootstrap and autoreconf are for
2743         developers, and not lightly done in tarballs.
2745 2006-09-20  Eric Blake  <ebb9@byu.net>
2747         * src/main.c (usage, OPTSTRING, main): Rename -e to -i.  Make
2748         warnings consistent.
2749         (long_options, HASHSIZE_OPTION): Warn on -H.
2750         * doc/m4.texinfo (Invoking m4): Document this.
2751         * tests/options.at (deprecated options): Update.
2753         Change the default of interactive sessions to match sh.
2754         * src/main.c (usage): Document this.
2755         (enum interactive_choice): New enum.
2756         (main): Use it to defer decision of interactive until after
2757         argument processing.
2758         * doc/m4.texinfo (Invoking m4): Document this.
2759         * NEWS: Likewise, plus add missing mention of -b.
2760         Reported by Stepan Kasal.
2762 2006-09-19  Eric Blake  <ebb9@byu.net>
2764         * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
2765         well as --error-output; the goal is to add -o/--output in some
2766         future version with semantics like gcc or autom4te.
2767         * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
2768         (Extensions): Reflect this update.
2769         (Renamesyms): Add another test.
2770         (Defn): Xfail for now, so that `make check' is happy.
2771         * NEWS: Document this change.
2772         * tests/generate.awk: Mark dynamic loading tests as such.  Allow
2773         xfailing tests.
2774         * tests/macros.at (Renamesyms collisions): New test, exposing
2775         renamesyms' coredump.
2776         * tests/options.at (--debugfile, --safer): Update to match
2777         change.
2779         * m4/debug.c (set_debug_file): Fix regression in -o when stdout
2780         and stderr are same file, introduced 2003-07-23.
2781         * tests/options.at (--debugfile): New test, to catch the bug.
2782         (deprecated options): Test --error-output.
2783         * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
2784         Deprecate --error-output, and replace it with --debugfile.
2785         * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
2786         Document this change.
2787         * NEWS: Likewise.
2789 2006-09-18  Eric Blake  <ebb9@byu.net>
2791         * modules/load.c (modules): Rename to...
2792         (m4modules): ...this, since it is an English word with 0
2793         arguments.
2794         * modules/gnu.c (symbols, m4symbols): Likewise.
2795         * doc/m4.texinfo (Listing Modules): Rename to...
2796         (M4modules): ...this.
2797         (Symbols): Rename to...
2798         (M4symbols): ...this.
2799         (Load, Foreach, Trace, Answers): Update to new spellings.
2800         * NEWS: Document this.
2802         * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
2803         such that without arguments, the global trace flag is changed
2804         rather than walking the table of all currently-defined macros.
2805         (set_trace_CB): No longer needed.
2806         * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
2807         (m4_set_symbol_traced): Delete.
2808         (m4_symtab_create): Nuke the nuke parameter.
2809         * m4/m4private.h (m4_get_symbol_value): Delete.
2810         * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
2811         (m4_set_symbol_name_traced): Free undefined entries that are no
2812         longer traced.
2813         (symbol_destroy_CB): Update caller.
2814         * m4/m4.c (m4_create): Update caller.
2815         * src/main.c (main): Likewise.
2816         (usage): Fix typo in last commit.
2817         * doc/m4.texinfo: Minor cleanups throughout.
2818         (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
2819         more nodes from branch.
2820         (Trace): Document new semantics, and how to simulate the old.
2821         * tests/builtins.at (multiquotes): Adjust to new semantics.
2822         * NEWS: Update somewhat.
2824 2006-09-14  Eric Blake  <ebb9@byu.net>
2826         Add --safer option, per debian bug 5898.
2827         * src/main.c (usage): Document new option.
2828         (SAFER_OPTION): New enumerator.
2829         (main): Set the option bit.
2830         * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
2831         accessors.
2832         * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
2833         (m4_get_safer_opt): New accessor.
2834         * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
2835         * modules/m4.c (syscmd, maketemp): Likewise.
2836         * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
2837         (Sysval, Maketemp): Add tests of this.
2838         * tests/options.at (--safer): Likewise.
2840 2006-09-13  Eric Blake  <ebb9@byu.net>
2842         * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
2843         stderr filtering.
2844         Reported by Ralf Wildenhues.
2846         Fix installcheck.
2847         * Makefile.am (check_LTLIBRARIES): Build test libraries in the
2848         tests directory, so we can be sure an installed build is not
2849         picking up uninstalled non-test libraries.
2850         (check-local, installcheck-local): Depend on test libraries.
2851         * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
2852         after file name.  Fix quoting.  Remove skipping the test, now
2853         that makefile guarantees test modules will exist.
2854         (Freezing modules, modules: shadow, modules: unload)
2855         (modules: trace): Always put test modules in module path.
2856         (modules: importing): Likewise, and rely on AT_CHECK_M4 for
2857         stderr munging.
2858         * src/main.c (usage): Document default module search path.
2859         (import_environment, frozen_file_to_read, frozen_file_to_write):
2860         Move...
2861         (main): ...here.
2862         * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
2863         * tests/m4.in: ...not here.
2864         Reported by Ralf Wildenhues.
2866 2006-09-08  Eric Blake  <ebb9@byu.net>
2868         * bootstrap: Kill unrelated copy-n-paste code from argument
2869         parsing.  Let Makefile generate testsuite.
2870         * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
2872 2006-09-07  Eric Blake  <ebb9@byu.net>
2874         * m4/m4module.h (m4_peek_input): No longer export.
2875         (m4_error_at_line, m4_warn_at_line): New prototypes.
2876         (m4_is_symbol_void): New macro.
2877         (m4_push_file): Update prototype.
2878         * m4/m4private.h (m4__peek_token): New prototype.
2879         (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
2880         * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
2881         * src/main.c (main): Allow reading from stdin twice.
2882         * modules/m4.c (include): Adjust to new prototype.
2883         * m4/input.c: General comment cleanup.
2884         (file_peek, file_read, file_unget, push_file): Set end flag on
2885         EOF, so that we don't call getc twice.
2886         (push_file, file_clean): Port fix from branch to avoid closing
2887         stdin prematurely.
2888         (pop_input): Port fix from branch to avoid reading free'd memory
2889         when input ends mid-string.
2890         (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
2891         (string_peek, string_read): Always use unsigned char.
2892         (m4_skip_line): Warn when dnl cut short by EOF.
2893         (peek_input): Rename from m4_peek_input.
2894         (match_input): Update signature, to distinguish between `(' token
2895         and multi-char quote or comment beginning with `('.
2896         (m4_input_exit): Cleanup now done in m4_pop_wrapup.
2897         (m4__peek_token): New function, ported from branch.
2898         (m4__next_token): Update to new token types.
2899         * m4/macro.c (expand_token, expand_argument): Use peek_token.
2900         * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
2901         (Invoking m4): Remerge from branch.
2903         * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
2904         (check-local): and put dependency here.
2905         Reported by Ralf Wildenhues.
2907 2006-09-05  Eric Blake  <ebb9@byu.net>
2909         * m4/m4module.h (m4_debug_message): New prototype.
2910         (M4_DEBUG_TRACE_MODULE): New debug bit.
2911         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
2912         (M4_DEBUG_MESSAGE2): Delete these macros.
2913         * m4/debug.c (m4_debug_message): New method.
2914         (m4_debug_decode): Add module tracing as flag `m'.
2915         * m4/input.c (m4_push_file, file_clean): Use new method.
2916         * m4/path.c (m4_path_search): Likewise.
2917         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2918         * m4/module.c (install_builtin_table, install_macro_table)
2919         (m4__module_open, module_close, module_remove): Promote several
2920         module debug messages outside of DEBUG_MODULES.
2921         (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
2922         DEBUG_MODULES with normal trace output.
2923         * src/main.c (usage): Document new flag.
2924         * doc/m4.texinfo (Debug Levels): Likewise.
2925         * Makefile.am ($(TESTSUITE)): Add missing dependency.
2926         * tests/m4.in: Neutralize platform-dependent module filenames.
2927         * tests/options.at (--debug): Update expected output.
2929 2006-09-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2931         * doc/m4.texinfo: Fix some typos.
2932         * tests/others.at: Likewise.
2934 2006-09-05  Eric Blake  <ebb9@byu.net>
2936         * m4/input.c (lex_debug): Remove dead code that broke compilation
2937         with --enable-debug.
2938         * m4/module.c (install_builtin_table, install_macro_table)
2939         (m4__module_init, m4__module_open, module_close)
2940         (module_remove): Fix compilation when --enable-debug.
2941         * m4/output.c (m4_shipout_text): Likewise.
2942         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
2943         libraries when --enable-debug.
2944         * configure.ac (DYNAMIC_MODULES): New variable, to pass
2945         information to testsuite.
2946         (modules to preload): Determine modules after we know whether
2947         shared libraries are supported.
2948         * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
2949         testsuite.
2950         * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
2951         * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
2952         (modules: shadow, modules: unload, modules: importing)
2953         (modules: trace): Use new macro.
2954         * tests/builtins.at (gmp): Likewise.
2956         * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
2957         All users updated.
2958         (expand_token): Avoid assertion just added to docs.
2959         (expand_macro): Track pending expansions, for when a symbol's
2960         definition changes during argument collection.
2961         (m4_macro_call, process_macro): Operate on symbol value, not
2962         symbol, since symbol may have changed during argument collection.
2963         * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
2964         (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
2965         (m4_get_symbol_value): Add fast macro version.
2966         * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
2967         (m4_macro_call): Adjust prototype.
2968         * m4/module.c (install_builtin_table): Check that flags are valid
2969         when creating builtin.
2970         * m4/symtab.c (m4__symtab_remove_module_references): Use
2971         m4_symbol_value_delete, rather than inlining it.
2972         (m4_symbol_value_copy): Copy placeholder text.
2973         (symbol_popval): Use m4_symbol_value_delete.
2974         (m4_symbol_value_delete): Implementation was missing when NDEBUG.
2975         Handle pending expansions.
2976         * modules/gnu.c (indir): Update to new prototype.
2977         * doc/m4.texinfo: Fix menus to be consistent with section names.
2978         (Defn): Add test that macro tokens flatten to empty string;
2979         triggered an assert before this patch.
2980         (Ifelse): Merge another node.
2981         (Loops): Split into...
2982         (Forloop, Foreach): New nodes; work is still underway on them.
2983         (Answers): Add more info on foreach macro; work is still underway.
2984         (Indir): Add test that indir collects arguments before looking up
2985         macro.
2986         * TODO: Update based on this patch.
2988 2006-09-01  Eric Blake  <ebb9@byu.net>
2990         * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
2991         * m4/hash.h (m4_free_hash_iterator): New prototype.
2992         * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
2993         ensure we don't do unsafe things while iterating.
2994         (HASH_ITER, ITER_CHAIN): New accessor macros.
2995         (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
2996         (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
2997         (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
2998         (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
2999         to catch unsafe actions.
3000         (m4_free_hash_iterator): New function, to avoid memory leaks, and
3001         when debugging, to track safe actions.
3002         (m4_hash_apply): Avoid memory leak.
3003         * m4/symtab.c (m4_symtab_apply): Likewise.
3004         * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
3005         in manually to src/ for now.
3006         * tests/builtins.at (gmp): Add keyword module.
3007         * tests/modules.at (Freezing modules, modules: shadow)
3008         (modules: unload, modules: importing, modules: trace): Likewise.
3010 2006-08-30  Eric Blake  <ebb9@byu.net>
3012         * m4/utility.c (m4_warn): Factor "Warning" out of messages into
3013         here.
3014         (m4_bad_argc, m4_numeric_arg): Update all callers.
3015         * m4/macro.c (m4_macro_call): Likewise.
3016         * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
3017         (Indir, Builtin, Ifdef): More doc merges.
3018         (Loops): Mention that documenting foreach would be nice.
3019         (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
3020         (Include, Eval, Location, M4exit): s/input.m4/stdin/.
3021         * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
3022         (substitute, syncoutput): Update all m4_warn callers.
3023         * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
3024         (traceon, traceoff): Make warning message consistent.
3025         (define, pushdef): Update all m4_warn callers.
3026         * tests/generate.awk: Choose file name so that documentation can
3027         show command-line behavior.
3028         * tests/builtins.at (define): Update to new wording.
3029         * tests/macros.at (pushdef/popdef): Likewise.
3030         * tests/freeze.at (loading format 1): Likewise.
3031         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
3033         * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
3034         the branch.
3035         (Defn): Add failing test case for mixing text and builtin.
3036         (Renamesyms): Improve wording, and identify core dump that needs
3037         fixing.
3039 2006-08-29  Eric Blake  <ebb9@byu.net>
3041         * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
3042         (Arguments, Pseudo Arguments): More doc merges from the branch.
3043         (Macro expansion): Turn example into test.
3044         (Pseudo Arguments): Add example of avoiding argument.
3045         * modules/m4.c (undefine, popdef): Accept multiple arguments.
3046         (define, pushdef): Warn on non-text macro name.
3047         (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
3048         warning/error messages.
3049         (ifdef): Ignore extra arguments.
3050         * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
3051         (m4__symtab_remove_module_references): Check that there is no leak.
3052         * tests/macros.at (pushdef/popdef): Update to new message.
3053         * tests/builtins.at (define): Likewise.
3054         * tests/freeze.at (loading format 1): Likewise.
3055         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
3057         * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
3058         (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
3059         as accessor function, to avoid compiler warning.
3060         * m4/module.c (m4__module_open): Move declaration of variable to
3061         avoid compiler warning.
3062         * src/main.c (main): Avoid shadowing a global variable.
3063         * src/freeze.c (produce_symbol_dump): Avoid unused variable
3064         warning when NDEBUG.
3065         * tests/options.at (--discard-comments, --import-environment)
3066         (--debug, --prepend-include, --help and --version): Rename tests
3067         to name option tested.
3069 2006-08-28  Eric Blake  <ebb9@byu.net>
3071         * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
3072         * m4/module.c (install_builtin_table): ...to here, and add
3073         assertion that blind macros require arguments.
3074         * m4/m4module.h (struct m4_builtin): Document restrictions that
3075         must be met during module loading.
3076         * modules/gnu.c (changeresyntax, changesyntax): These are blind,
3077         so require an argument to avoid triggering assertion.
3078         (debugfile): Tweak error message.
3080 2006-08-25  Eric Blake  <ebb9@byu.net>
3082         * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
3083         (M4_BUILTIN_SIDE_EFFECT): New enumerators.
3084         (struct m4_builtin): New member flags replaces groks_macro_args,
3085         blind_if_no_args.  min_args and max_args are now 0-based.
3086         Rearrange members to reduce size on platforms where function
3087         pointers are 64 bits but regular pointers are 32.
3088         (m4_bad_argc): Add argument.
3089         * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
3090         * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
3091         effect into account.
3092         * m4/module.c (install_builtin_table): Adjust all users affected
3093         by this API change.
3094         * m4/macro.c (m4_macro_call): Likewise.
3095         * src/freeze.c (reload_frozen_state): Likewise.
3096         * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
3097         * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
3098         * modules/import.c (builtin_functions): Likewise.
3099         * modules/load.c (builtin_functions): Likewise.
3100         * modules/modtest.c (builtin_functions): Likewise.
3101         * modules/mpeval.c (builtin_functions): Likewise.
3102         * modules/perl.c (builtin_functions): Likewise.
3103         * modules/shadow.c (builtin_functions): Likewise.
3104         * modules/stdlib.c (builtin_functions): Likewise.
3105         * modules/time.c (builtin_functions, mktime_functions)
3106         (strftime_functions): Likewise.
3107         * doc/m4.texinfo (Loops): Update test now that shift is blind.
3108         (Macro Arguments): Fix typo in test.
3109         (Patsubst): Fix typo in test.
3110         * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
3111         end of string.  Fix return value when ignore_duplicates.
3112         * tests/builtins.at (patsubst): Fix typo in test.
3114         * tests/options.at (debug-flags): Update to reflect new message.
3115         (deprecated options, prepend-include, help and version): New
3116         tests.
3117         * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
3118         test omits an input file name.
3119         * src/main.c (long_options, main): Add -B/--prepend-include.
3120         (usage): Document it.
3121         (main): `m4 --help --version' now displays help, not version.
3122         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3123         dirname filenamecat.
3124         * m4/m4module.h (m4_add_include_directory): Add parameter.
3125         * m4/m4private.h (m4__include_init): New prototype.
3126         * m4/m4.c (m4_create): Put `.' on path before options are
3127         collected.
3128         * m4/path.c (includes): Assume C89.  Use gnulib for file name
3129         management.
3130         (m4__include_init): New function.
3131         (search_path_add): Allow prepending.
3132         (m4_add_include_directory, search_path_env_init): Adjust callers.
3133         (m4_path_search): Relative names now invoke path search, since
3134         `.' might not be first.
3135         * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
3137 2006-08-25  Bruno Haible  <bruno@clisp.org>  (tiny change)
3138         and Eric Blake  <ebb9@byu.net>
3140         * bootstrap: Run autopoint before gnulib-tool, since autopoint
3141         0.15 installs macros obsoleted by current gnulib.
3143 2006-08-25  Eric Blake  <ebb9@byu.net>
3145         * doc/m4.texinfo (Macro Arguments): Another section merged;
3146         testsuite failures now exposed.
3148 2006-08-23  Eric Blake  <ebb9@byu.net>
3150         * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
3151         (Input processing): More doc merges from the branch.
3152         (Regular expression syntax): Add introductory text.
3153         (Inhibiting Invocation): More doc merges from the branch.
3154         (Other tokens): Reorder after comments.
3155         * tests/generate.awk: Allow passing options to doc examples.
3157 2006-08-22  Eric Blake  <ebb9@byu.net>
3159         * tests/options.at (debug-flags): New test.
3160         * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
3161         not negative, to distinguish failure in m4_debug_decode.
3162         (m4_debug_decode): Add new parameter.
3163         * modules/gnu.c (regexp): Slight cleanup.
3164         (renamesyms): Ignore excess arguments.
3165         (syncoutput): Make case-insensitive, warn on bad argument.
3166         (debugmode): Factor -+ handling out to...
3167         * m4/debug.c (m4_debug_decode): ...here.
3168         (m4_debug_message_prefix): Fix spacing.
3169         * src/main.c (main): Let -d option adjust flags.
3170         * m4/input.c (file_clean): Avoid printing empty file name.
3171         * doc/m4.texinfo (Syncoutput): Document new range of input.
3172         (Invoking m4): Document use of multiple -d flags.
3174         Start porting various fixes from the branch that use gnulib.
3175         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3176         binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
3177         regexprops-generic stdlib-safer unlocked-io.
3178         * m4/debug.c (m4_debug_set_output): Close debug file on exec.
3179         * m4/path.c (m4_path_search): Close input file on exec, reject
3180         empty file name, fix parameter naming.
3181         * m4/output.c (make_room_for): Close diversion file on exec.
3182         (includes): Assume C89 headers.
3183         (tmpfile): For now, we don't want tmpfile-safer, because we want
3184         clean-temp later.
3185         * m4/m4private.h (includes): Use various gnulib headers.
3186         * doc/regexprops-generic.texi: Use gnulib's copy.
3188         * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
3189         * AUTHORS: Add copyright.
3190         * ChangeLog: Likewise.
3191         * README: Likewise.  Require automake 1.9b or later.
3192         * HACKING: New file.
3193         * README-alpha: Add copyright.
3194         * THANKS: Likewise.  Update.
3195         * doc/STYLE: Add copyright, and tweak for changed directories.
3196         * modules/README: Add copyright, and tweak for libtool version.
3197         * examples/COPYING: New file.
3198         * examples/WWW/COPYING: Likewise.
3199         * examples/WWW/m4lib/COPYING: Likewise.
3200         * modules/shadow.m4: Add copyright.
3201         * modules/perl.m4: Likewise.
3202         * modules/modtest.m4: Likewise.
3203         * modules/stdlib.m4: Likewise.
3204         * modules/time.m4: Likewise.
3205         * modules/time2.m4: Likewise.
3206         * po/Makevars: Likewise.
3207         * tests/iso8859.m4: Likewise.
3208         * tests/m4.in: Likewise.
3209         * NEWS: Add (C) to copyright.
3210         * TODO: Likewise.
3211         * m4/system_.h: Likewise.
3212         * tests/atlocal.in: Likewise.
3213         * tests/builtins.at: Likewise.
3214         * tests/freeze.at: Likewise.
3215         * tests/generate.awk: Likewise.
3216         * tests/macros.at: Likewise.
3217         * tests/modules.at: Likewise.
3218         * tests/options.at: Likewise.
3219         * tests/others.at: Likewise.
3220         * tests/testsuite.at: Likewise.
3221         * m4/utility.c: Spell out copyright years.
3222         * src/main.c: Likewise.
3224         * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
3226 2006-08-21  Eric Blake  <ebb9@byu.net>
3228         * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
3229         * modules/gnu.c (esyscmd): Use -1 for failure.  Set sysval to 0
3230         when no arguments are given, but without losing warning about 0
3231         arguments.
3232         * modules/m4.c (syscmd): Likewise.
3233         (includes): Assume C89.
3234         (m4_sysval): Make static.
3235         (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
3236         (sysval): Port calculation from branch.
3238 2006-08-20  Eric Blake  <ebb9@byu.net>
3240         * m4/macro.c (expand_macro): Move argument check...
3241         (m4_macro_call): ...to here, so indir will warn.
3242         * modules/gnu.c (__program__): New macro, ported from branch.
3243         (builtin): Perform argument check.
3244         (changesyntax): Avoid out-of-bounds read.
3246         * modules/gnu.c (includes): Assume stdlib.h, errno.
3247         (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
3248         (substitute): Add caller parameter, avoid out-of-bounds memory
3249         references.
3250         (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
3251         callers.
3253 2006-08-16  Eric Blake  <ebb9@byu.net>
3255         * po/POTFILES.in: Add more files that contain translatable
3256         strings.
3257         * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
3258         information to translators.
3259         (USE_MSGCTXT): New var for gettext 0.15.
3260         * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
3261         debug/trace messages in lower case.
3262         * m4/macro.c (expand_argument): Likewise.
3263         * m4/path.c (m4_path_search): Likewise.
3264         * src/main.c (main): Likewise.
3266 2006-08-14  Eric Blake  <ebb9@byu.net>
3268         * src/main.c (usage): Document --import-environment.
3269         * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
3271 2006-08-11  Eric Blake  <ebb9@byu.net>
3273         * bootstrap (func_get_translations): Only remove files when doing
3274         full update.
3275         (func_update_po): Avoid CDPATH problems.
3277 2006-08-10  Eric Blake  <ebb9@byu.net>
3279         * bootstrap (func_get_translations): New function.
3280         (func_update_po): Borrow ideas from tar to correctly pull in
3281         translations from newer location.
3283 2006-08-09  Eric Blake  <ebb9@byu.net>
3285         * bootstrap: Recent gnulib no longer has jm_* macros to worry
3286         about.
3287         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3288         verror.
3289         * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
3290         (m4_error, m4_warn): ... these new prototypes.
3291         (m4_current_file, m4_current_line): Move into context, rather
3292         than leaving as globals.
3293         (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
3294         (m4_undivert_all, m4_input_init): Now takes context.
3295         * m4/utility.c (m4_error, m4_warn): New functions.
3296         * m4/m4private.h: Assume errno exists.
3297         (struct m4): Move warning_status to a bit flag,
3298         and add exit_status.  Adjust accessors accordingly.
3299         * src/main.c (print_program_name_CB): No longer needed.
3300         (main): Use new m4_get_fatal_warnings_opt.
3301         * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
3302         instead of issuing "INTERNAL ERROR".  Pass context when needed,
3303         and use new accessors.
3304         * m4/input.c: Likewise.
3305         * m4/macro.c: Likewise.
3306         * m4/output.c: Likewise.
3307         * m4/utility.c: Likewise.
3308         * modules/evalparse.c: Likewise.
3309         * modules/gnu.c: Likewise.
3310         * modules/load.c: Likewise.
3311         * modules/m4.c: Likewise.
3312         * modules/mpeval.c: Likewise.
3313         * src/freeze.c: Likewise.
3314         * src/main.c: Likewise.
3315         * tests/macros.at: Adjust to new message format.
3316         * tests/builtins.at: Likewise.
3317         * tests/freeze.at: Likewise.
3318         * tests/modules.at: Likewise.
3319         * doc/m4.texinfo: Likewise.
3321         * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
3322         newer gettext 0.15.
3324 2006-08-03  Eric Blake  <ebb9@byu.net>
3326         * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
3327         gracefully handle ENOSYS.
3328         * TODO: Update.
3329         * THANKS: Update.
3331 2006-07-28  Eric Blake  <ebb9@byu.net>
3333         * src/freeze.c (reload_frozen_state): Copy string when creating
3334         placeholder, to avoid memory corruption.
3335         * m4/symtab.c (symbol_popval): Avoid memory leak.
3336         (m4_symbol_rename): Avoid shadowing rename function.
3337         (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
3338         * tests/freeze.at (reloading unknown builtin): Add test.
3339         * tests/generate.awk: Capture m4.texinfo line number in
3340         testsuite.log, not just generated.at.
3342         Port idea from branch that a frozen file can request an unknown
3343         builtin without producing a warning unless the builtin is
3344         actually used.
3345         * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
3346         (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
3347         (m4_set_symbol_value_placeholder): New accessors.
3348         * m4/m4module.h (m4_is_symbol_placeholder),
3349         (m4_get_symbol_value_placeholder),
3350         (m4_set_symbol_value_placeholder),
3351         (m4_get_symbol_placeholder): Likewise.
3352         * m4/symtab.c (m4_is_symbol_value_placeholder),
3353         (m4_get_symbol_value_placeholder),
3354         (m4_set_symbol_value_placeholder): Likewise.
3355         (dump_symbol_CB): Handle new symbol type.
3356         * m4/macro.c (trace_pre): Likewise.
3357         (m4_macro_call): Warn when invoking a placeholder.
3358         * modules/m4.c (dumpdef): Handle dumping a placeholder.
3359         (defn): Warn when referencing a placeholder.
3360         * src/freeze.c (dump_symbol_CB): Ignore placeholder when
3361         freezing.
3362         (reload_frozen_state): When reloading unknown builtin, install a
3363         placeholder instead of warning.
3364         * tests/freeze.at (loading format 1): Allow warning when
3365         popdef'ing undefined function.
3367 2006-07-27  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
3369         * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
3370         function. Shift by 7, not 3, for consistency with
3371         gnulib/lib/hash.c. Don't assume hash word is 32 bits.
3373 2006-07-27  Eric Blake  <ebb9@byu.net>
3375         * src/main.c (usage): Update to match branch.
3376         (main): Update --version info to distinguish between program name
3377         `m4' and package name `GNU M4'.
3378         (AUTHORS): Translate René Seindal's name.
3379         * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
3380         * Makefile.am (doc/m4.1): Update to match branch.
3381         * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
3382         branch.
3384         * m4/system_.h (EXIT_MISMATCH): Define.
3385         * src/main.c (main): Don't clear syntax table for version 1.
3386         (usage): Document exit status.
3387         * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
3388         branch, and require V directive to appear first in file.  Fix
3389         broken logic for detecting F and T in version 1 files.
3391 2006-07-22  Eric Blake  <ebb9@byu.net>
3393         * src/main.c (stackovf_handler): Document the problems in our
3394         overflow handler.
3395         * src/stackovf.c: Forward port changes in branch to use POSIX
3396         sa_sigaction when available.
3397         (process_sigsegv): Avoid buffer overrun when error string is
3398         translated, although the fact that we translate in a signal
3399         handler is still a bug.
3400         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
3401         from branch to modernize checks.
3403         * modules/format.c (format): Avoid compiler warning that str may
3404         be used uninitialized.
3406         * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
3407         spelling.
3408         (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
3409         (DEBUG_MACRO): Remove unused macro.
3410         * src/stackovf.c: Avoid compiler warnings.
3411         * m4/input.c: Likewise.
3412         * m4/module.c: Likewise.
3413         * m4/output.c: Likewise.
3414         * m4/path.c: Likewise.
3415         * m4/symtab.c: Likewise.
3416         * m4/syntax.c: Likewise.
3418 2006-07-20  Eric Blake  <ebb9@byu.net>
3420         * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
3421         Regenerate to explicitly ask for --assume-autoconf=2.60.
3423 2006-07-19  Eric Blake  <ebb9@byu.net>
3425         * po/ChangeLog: Merge into main ChangeLog, then delete file.
3426         * THANKS: Update.
3428         * doc/m4.texinfo (copying): Relax restriction on front-cover and
3429         back-cover texts.
3431 2006-07-17  Eric Blake  <ebb9@byu.net>
3433         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3434         0.14.5.
3436         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
3437         xvasprintf'.
3438         * modules/format.c (includes): Use xvasprintf.h.
3439         (format): Make static.  Avoid buffer overflow, that can lead to
3440         arbitrary code execution exploit.  Only pass unsigned char to
3441         is*().  Support F, g, and G specifiers.
3442         * doc/m4.texinfo (Format): Expose buffer overrun bug.  Document
3443         new specifiers.
3445 2006-07-17  Gary V. Vaughan  <gary@gnu.org>
3447         Ensure M4 compiles correctly with -DDEBUG, and use a single
3448         consistent definition of various /DEBUG_[A-Z]+/ symbols:
3450         * m4/input.c: Have commented out out DEBUG_INPUT only by default.
3451         (m4_print_token): Use m4_get_symbol_value_text and
3452         m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
3453         and VALUE_FUNC respectively.
3454         (m4__next_token): Use m4_print_token call instead of obsolescent
3455         print_token symbol.
3456         * m4/module.c: Have commented out out DEBUG_MODULE only by default.
3457         * m4/output.c: Similarly for DEBUG_OUTPUT.
3458         * m4/path.c: Similarly for DEBUG_INCL.
3459         * m4/symtax.c: Similarly for DEBUG_SYM.
3460         * m4/syntax.c: Similarly for DEBUG_SYNTAX.
3461         * src/stackovf.c: Similarly for DEBUG_STACKOVF.
3462         * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
3463         preprocessor macros defined with -DDEBUG compiles.
3465 2006-07-17  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3467         * bootstrap: Correct typo in --download-po argument parsing.
3469 2006-07-15  Eric Blake  <ebb9@byu.net>
3471         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
3472         gendocs fdl'.
3473         * tests/generate.awk (normalize): Recognize @tabchar.
3474         * doc/m4.texinfo (Top): Start merging from branch.  Remove tabs.
3475         Fix menus.  Upgrade FDL license from 1.1 to 1.2.  Fix overfull
3476         hboxes.
3477         (Index macro, Shell commands, Incompatiblities): Rename nodes
3478         from Index, UNIX commands, Other incompat.
3479         (Platform macros, Using frozen files, Frozen file format 1)
3480         (Frozen file format 2, Copying This Manual, Indices): New nodes.
3481         * Makefile.am (EXTRA_DIST): Distribute gendocs.
3482         (MAINTAINERCLEANFILES): Clean up files from gnulib.
3483         (doc_m4_TEXINFOS): Depend on fdl.texi.
3484         (web-manual): New maintainer target.
3486 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
3488         * doc/m4.texinfo (Modules):  RMS asked me for an explanation of
3489         the modular architecture of M4.  The result is paraphrased here
3490         for the benefit of future readers of the manual.
3492 2006-07-14  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3494         * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
3496 2006-07-14  Eric Blake  <ebb9@byu.net>
3498         * src/main.c (main): Avoid compiler warning.
3499         * modules/gnu.c (renamesyms): Remove unused variable.
3501 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
3503         * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
3504         (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
3505         new functions for managing regexp syntax options.
3506         * m4/m4private.h (m4): Add regexp_syntax field.
3507         * m4/resyntax.c: New file implements the above.
3508         * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
3509         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
3510         (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
3511         (m4_patsubst_do, m4_renamesyms_do): Removed.
3512         (builtin_changeresyntax): New builtin to change regular expression
3513         syntax.
3514         (m4_resyntax_encode_safe): Factor out diagnostics code.
3515         * src/freeze.c (produce_resyntax_dump): New function to dump
3516         default regexp syntax specifier to frozen file.
3517         (reload_frozen_state): Updated to action 'R' directive.
3518         * src/main.c (usage): Describe new -r option.
3519         (long_options, OPTSTRING): Declare it.
3520         (main): Encode and store cli regexp syntax option argument.
3521         * tests/freeze.at (regexp syntax): New test that regexp syntax
3522         survives freezing.
3523         * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
3524         * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
3525         (Epatsubst and Patsubst): Renamed to...
3526         (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
3527         documentation and added new examples.
3528         (Changeresyntax): New section describing changeresyntax builtin,
3529         and regexp syntax names.
3530         (Regular expression syntax): New section describing differences
3531         between various regular expression syntaxes.
3532         (Frozen files): Document 'R' directive.
3533         * NEWS: Updated.
3535 2006-07-13  Gary V. Vaughan  <gary@gnu.org>
3537         * bootstrap: Enhanced to work more like our other scripts:
3538         Add a copyright statement; support --version and --help; accept a
3539         --download-po option with argument as a substitute for DOWNLOAD_PO
3540         in the environment.
3542 2006-07-11  Eric Blake  <ebb9@byu.net>
3544         * Makefile.am (doc/m4.1): Port patch from branch that avoids
3545         intermediate file.
3546         * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
3547         changed.
3549 2006-07-10  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3551         * tests/builtin.at (patsubst, regexp):  Adjust these tests, now
3552         that `\0' is no longer accepted.
3554         * src/main.c (usage): Alphabetize options within their sections.
3556         * modules/gnu.c (m4_regexp_search, regsub, substitute)
3557         (esyscmd):  Improve comments.
3559         * modules/gnu.c (substitute): Remove old warning for \0.
3560         (substitute_warned): No longer required.  Removed.
3562         * modules/gnu.c: Put macro definitions into alphabetical order.
3564 2006-07-07  Eric Blake  <ebb9@byu.net>
3566         * tests/freeze.at (loading format 1): New file, with new test.
3567         * tests/testsuite.at: Include it.
3568         * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
3569         * tests/modules.at (Freezing modules): Likewise.
3571         * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
3572         (AC_CHECK_HEADERS): Assume signal.h.
3573         (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
3574         (AC_CHECK_FUNCS_ONCE): Likewise.
3575         * src/m4.h (includes): Assume signal.h.
3577 2006-07-05  Eric Blake  <ebb9@byu.net>
3579         Fix all testsuite failures on cygwin.
3580         * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
3581         branch-1_4.  Solves testsuite failure when uninstalled m4 is
3582         shadowed by redefinition of PATH in libtool wrapper.
3583         * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
3584         contains the -no-undefined required by cygwin.
3585         (TESTS_ENVIRONMENT): Export abs_top_builddir.
3586         * tests/others.at (misc): Port to platforms where /etc/passwd
3587         does not exist or does not contain user named root.
3588         * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
3589         directory.
3590         * tests/builtins.at (define, divert): Avoid overquoting.
3591         * tests/generate.awk (new_group): Likewise.
3593 2006-07-05  Gary V. Vaughan  <gary@gnu.org>
3595         The regs_allocated field in a struct re_pattern_buffer refers
3596         to the state of a particular re_registers struct when used in
3597         successive matches using the same compiled pattern.  Avoid a
3598         SEGV in `renamesyms' resulting from using a new re_registers
3599         with an existing re_pattern_buffer:
3601         * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
3602         pattern buffer and registers.
3603         (m4_regexp_search): New function to call re_regexp_search with
3604         correctly matched pattern buffer and register instantiations.
3605         (m4_regexp_compile): Return an m4_pattern_buffer.  Adust all
3606         callers.
3608 2006-07-04  Gary V. Vaughan  <gary@gnu.org>
3610         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
3611         changes to gnulib getopt.m4 since last build.
3612         * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
3613         if the system getopt fails M4_GETOPT tests.
3615 2006-06-22  Eric Blake  <ebb9@byu.net>
3617         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
3618         Reported by Bruno Haible.
3620 2006-06-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3622         * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
3624 2006-06-19  Eric Blake  <ebb9@byu.net>
3626         * THANKS: Update.
3628 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3630         * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
3631         (clean-local): Split into and depend upon...
3632         (clean-local-tests, clean-local-src): ...these two.  The latter
3633         removes the libtool object directory below `src', to work around
3634         a buglet in Automake, failing to list it.
3635         (EXTRA_DIST): Distribute modules/perl.c.
3637 2006-06-19  Eric Blake  <ebb9@byu.net>
3639         * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
3640         right side of dependency; VPATH does that.
3641         (stamp-vcl): Update to use libtool's algorithm.
3642         (EXTRA_DIST): Distribute stamp-vcl.
3643         Reported by Ralf Wildenhues.
3644         (TESTSUITE): Revert earlier change that used absolute path, as
3645         that broke 'make dist' in VPATH.  Stick with $(srcdir) instead.
3646         (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
3647         (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
3648         atlocal takes care of it instead.
3649         (check-local, installcheck-local, clean-local): Inline absolute
3650         path to testsuite here, rather than relative path to testsuite
3651         elsewhere.
3653 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3655         * m4/m4private.h (DELETE): Cast away const here...
3656         * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
3657         * src/freeze.c (reload_frozen_state): Avoid uninitialized
3658         variable warning.
3660 2006-06-19  Eric Blake  <ebb9@byu.net>
3662         * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
3663         .info pages are built.
3664         Reported by Ralf Wildenhues.
3665         (EXTRA_DIST): Inline definition of testsuite, so that make dist
3666         works again.
3668 2006-06-16  Eric Blake  <ebb9@byu.net>
3670         Follow recommendations from autoconf manual for autotest.
3671         * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
3672         turn it into an absolute path until autotest provides an option
3673         that allows us to avoid changing directories.  Properly quote
3674         throughout.
3675         (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
3676         (check-recursive): Delete unused target.
3677         ($(TESTSUITE)): Atomically update testsuite.
3678         (CD_TESTDIR): Simplify.
3679         (m4__cd): Delete unused macro.
3680         (check-local): Let TESTSUITEFLAGS influence the run.
3681         (installcheck-local): Let TESTSUITEFLAGS override
3682         AUTOTEST_PATH.  Add dependencies.
3683         (clean-local): Clean up.
3684         (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
3685         * README: Document how to use the testsuite.
3687 2006-06-15  Eric Blake  <ebb9@byu.net>
3689         * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
3691         * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
3692         clashes with m4sugar.
3693         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
3694         * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
3695         * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
3696         * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
3697         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
3698         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
3699         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
3700         * configure.ac: Likewise.
3701         (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
3702         * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
3703         conditional.
3704         * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
3706         Reduce compiler warnings.  Inside GMP, mpq_t is an array type, so
3707         const mpq_t is not assignable from plain mpq_t.  Avoid
3708         type-punning warnings caused trying to mix these types.
3709         * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
3710         (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
3711         * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
3712         (mult_term, exp_term): Remove type-punning casts.
3713         (numb_pow): Remove const qualifier.
3714         * src/freeze.c (reload_frozen_state): Fix typo in messages.
3715         Fix variables that can be used uninitialized, which fixes
3716         security hole where malicious frozen file can execute arbitrary
3717         code.
3719 2006-06-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3721         * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
3723 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3724         and Eric Blake  <ebb9@byu.net>
3726         Allow `make dist' to work again.
3727         * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
3728         (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
3729         (cvs-dist): Fix typo.
3730         * NEWS: Match current version number.
3732 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3734         * Makefile.am (AM_CPPFLAGS):  Add $(LTDLINCL), so the right
3735         ltdl.h is used.
3737         * bootstrap: Do not run libtoolize manually, this is done
3738         correctly by autoreconf.  Invoke autoreconf with --no-recursive
3739         to avoid unnecessary rerunning of autotools for libltdl.
3741 2006-06-13  Eric Blake  <ebb9@byu.net>
3743         * THANKS: Update.
3745 2006-06-12  Eric Blake  <ebb9@byu.net>
3747         * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
3748         bother with mktemp.
3749         * src/m4.h: Don't declare mktemp.
3750         * m4/input.c (m4__next_token): Avoid bzero.
3751         * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
3752         * Makefile.am (doc/m4.1): Depend on installed help2man, rather
3753         than distributing outdated helptoman.pl.
3754         * doc/helptoman.pl: Delete.
3756 2006-06-10  Eric Blake  <ebb9@byu.net>
3758         * README (Patches): Document the current dependence on CVS
3759         builds of autotools.
3760         * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
3761         * configure.ac: Use consistent quoting throughout.
3762         (AC_PREREQ): Bump to 2.59d.
3763         (AC_INIT): Package name begins with uppercase.
3764         (AC_ARG_WITH): Use AS_HELP_STRING.
3765         (AM_INIT_AUTOMAKE): Enable gnits mode.
3766         (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
3767         (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
3768         (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
3769         done by gnulib or automake, or which autoconf has declared
3770         obsolete.
3771         * m4/m4private.h (Includes): Assume C89 or better, and use errno
3772         unconditionally.
3773         * m4/output.c (Includes): Likewise.
3774         * modules/gnu.c (Includes): Likewise.
3775         * modules/m4.c (Includes): Likewise.
3776         * src/m4.h (Includes): Likewise.
3778         * README-alpha: Update web address.
3779         * README: Likewise. Change encoding to ASCII.  Remove old advice
3780         about cygwin.  Document bootstrapping dependency.
3781         * AUTHORS: Update from branch-1_4.
3782         * THANKS: Likewise.  Change encoding to UTF-8.
3783         * BACKLOG: Delete.  This file is too old and unmaintained to be
3784         worthwhile.
3785         * ChangeLog: Change encoding to UTF-8.
3787         Avoid compiler warnings.
3788         * m4/macro.c (trace_format): Don't mark this as a printf format,
3789         since we don't accept the same set of modifiers as printf.  It
3790         would be nice if gcc let us specify a custom format archetype.
3791         * src/main.c (main): Cast away const.
3793 2006-06-10  Andreas Schwab  <schwab@suse.de>  (tiny change)
3794             Eric Blake  <ebb9@byu.net>
3796         * modules/time.c (ctime): Pass correctly typed variable to
3797         m4_numeric_arg.
3798         (gmtime): Likewise.
3799         (localtime): Likewise.
3800         (strftime): Likewise.
3801         * m4/utility.c (m4_numeric_arg): For now, document arbitrary
3802         limit inherent in this interface.
3804 2006-05-08  Bruno Haible  <bruno@clisp.org>  (tiny change)
3806         * modules/m4.c (WEXITSTATUS): Provide fallback definition.
3807         (sysval): Use WEXITSTATUS.
3808         * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
3809         big-endian and little-endian wait status definitions.
3811 2006-05-06  Eric Blake  <ebb9@byu.net>
3813         * po/Makevars (MSGID_BUGS_ADDRESS): Add.
3814         * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
3815         in src, not gnu.
3817 2006-05-06  Eric Blake  <ebb9@byu.net>
3819         * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
3820         subdirectory to use.
3821         (support for -pipe): Move after LT_INIT, since it relies on
3822         libtool internals.
3824 2006-05-05  Eric Blake  <ebb9@byu.net>
3826         * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
3828         * THANKS: Update.
3830 2006-05-05  Bruno Haible  <bruno@clisp.org>
3831         and Eric Blake  <ebb9@byu.net>
3833         * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
3834         * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
3835         usage pattern.
3836         * bootstrap: Update usage of gnulib-tool.
3838 2006-05-04  Eric Blake  <ebb9@byu.net>
3840         * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
3841         Cleanup whitespace.
3843 2005-12-05  Gary V. Vaughan  <gary@gnu.org>
3845         * bootstrap (func_update_po): Synch with CVS GNU tar.  wget 1.9.x
3846         and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
3847         Reported by Eric Blake <ebb9@byu.net>
3849 2005-12-04  Gary V. Vaughan  <gary@gnu.org>
3851         * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
3852         http caching as -C is no longer supported by wget 1.10.x.
3853         Reported by Eric Blake <ebb9@byu.net>
3855 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
3857         * m4/module.c (caller_id): To match libtool-2.0 interface, changed
3858         to ...
3859         (iface_id): ...an lt_dlinterface_id type.
3860         (m4__module_find): New abstraction for lt_dlhandle_fetch.  Use
3861         throughout, instead of calling obsolete lt_dlhandle_find directly.
3862         (m4__module_next): Use multiloader-safe lt_dlhandle_iterate.  Use
3863         throughout, instead of calling obsolete lt_dlhandle_next.
3864         * m4/m4private.h (m4__module_find): Declare it.
3865         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
3866         Use m4__module_next instead of obsolete lt_dlhandle_next.
3868 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
3870         * bootstrap (func_update_po): Update pofiles directly from the
3871         translation project.
3872         * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
3873         po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
3874         these files under source control anymore.
3875         Suggested by Eric Blake <ebb9@byu.net>
3877 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3879         * ltdl/m4/m4-gnulib.m4: Update FSF contact address.  Somehow this
3880         file escaped the address updates on 2005-05-01.
3882 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
3884         * bootstrap: Allow user overriding of gnulib-tool location, and
3885         correctly determine module source directories whether gnulib-tool
3886         is given as a relative or absolute path, or is found by searching
3887         PATH.
3888         Reported by Eric Blake <ebb9@byu.net>
3890 2005-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3892         * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
3893         and $RM are defined for various versions of
3894         AC_LIBTOOL_COMPILER_OPTION.
3896         * bootstrap (AUTORECONF): New variable to allow user overriding of
3897         autoreconf path.
3899 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
3901         * doc/m4.texinfo (History): Add better notes on the ancestory of
3902         GNU m4, and other historical interest.
3904 2005-05-08  Gary V. Vaughan  <gary@gnu.org>
3906         * m4/symtab.c (m4_symbol_rename): New function that performs a low
3907         level symbol rename.
3908         * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
3909         * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
3910         (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
3911         regsub...
3912         (erenamesyms, renamesyms): ...builtins that use these to implement
3913         macro renaming by regular expression.
3914         * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
3915         * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
3916         to stop the new generated tests from choking.
3918 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
3920         Since most of the build is handled from a single Makefile.am now,
3921         we can teach make about the dependencies between the m4 binary and
3922         the preopened modules it is built against:
3924         * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
3925         preopened modules.
3926         * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
3927         of the preopened modules have changed.
3929 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
3931         * configure.ac (gl_MODULES): Add mkstemp for machines that don't
3932         have a native implementation.
3934 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
3936         * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed.  These are
3937         handled already by gnu/exit.h.
3939         * configure.ac (gl_MODULES): Add assert to support a
3940         --disable-assert configure time option for NDEBUG setting.
3942         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
3943         * bootstrap (src_modules): Add version-etc-fsf.
3944         * src/main.c (version_etc_copyright): Removed.
3946         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
3948 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
3950         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
3951         recognition macros.
3952         * src/freeze.c (produce_frozen_state): Use \n line-endings even
3953         on Windows, so that the frozen file reader will work.
3954         Reported by Josef T. Burger <bolo@bolo.com>
3956 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
3958         Forward port of a patch that allowed m4-1.4.2 to compile on
3959         QNX 6.3:
3961         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
3962         sys/signal.h.
3963         * src/m4.h: And include them as appropriate.
3964         * src/main.c, src/stackovf.h: Don't include signal.h literally;
3965         m4.h will include the correct file.
3967 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
3969         * m4/m4private.h: Make errno visible for the sources patched
3970         below.
3972 2005-05-04  Paul Eggert  <eggert@twinsun.com>
3974         * src/main.c (print_program_name_CB): Preserve errno, since
3975         M4ERROR relies on this.
3976         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
3977         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
3978         * m4/path.c (m4_path_search): Don't let "free" trash errno when
3979         returning NULL.
3981         * m4/output.c (m4_insert_file): Don't assume errno has a valid
3982         value simply because fread returns zero.  This fixes a
3983         portability bug reported by Marion Hakanson in
3984         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
3986 2005-05-04  Santiago Vila  <sanvila@debian.org>
3988         * tests/stackovf.test: Use tempfile if available.
3990 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
3992         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
3993         * m4/output.c (m4_insert_file): Do not mix buffered and
3994         unbuffered I/O, as this breaks on the Hurd.
3996 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
3998         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
3999         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
4000         and libtoolize does a better job of ltdl importing now too, so
4001         take advantage of that while updating the tree:
4003         * acm4, config: Moved from here...
4004         * ltdl/m4, ltdl/config: ...to here.
4005         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
4006         src/Makefile.am, tests/Makefile.am: Removed...
4007         * Makefile.am: ...and migrated to here, with adjustments to
4008         compensate for relative path differences.
4009         * commit: Adjust relative paths.
4010         * configure.ac: Adjust relative paths.
4011         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
4012         patch.
4013         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
4014         the meanwhile, CVS HEAD libtool is needed.
4015         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
4016         stricly new enough, we also need a patch.
4017         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
4018         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
4019         (gl_MODULES): Don't list getopt and version-etc, as they don't
4020         belong in libm4.
4021         * bootstrap: After running gnulib-tool to import the listed
4022         modules, fetch getopt and version-etc into src manually.
4023         (ltdldir): Change to ltdl.
4024         * src/main.c: Adjust for changes in version-etc API.
4025         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
4026         but works when the getopt module isn't to be included in the lib.
4027         * README: Add note about patching autoconf and automake to
4028         bootstrap CVS m4.
4030 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
4032         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
4033         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
4034         empty file rather than to a nonexistent file.  This closes a
4035         common security hole.
4036         * modules/m4.c (m4_maketemp): Implement the above, by using
4037         mkstemp rather than mktemp.
4039 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
4041         The FSF are moving offices today.  Changed their contact address
4042         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
4043         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
4045 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
4047         * tests/Makefile (clean-local): Ignore testsuite cleanup
4048         failures.
4050 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
4052         * tests/Makefile (clean-local): Only run the testsuite cleanup
4053         if the testsuite has been generated.
4055 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
4057         * TODO: slight clarification of the example of qindir usage.
4059 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
4061         * TODO: Add qindir requirement, and defn bug.
4062         From Stepan Kasal  <kasal@ucw.cz>
4064 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
4066         * TODO: Add ``execution stack'', fix a typo.
4067         * doc/m4.texinfo: Typos.
4069 2004-12-24  Eric Blake  <ebb9@byu.net>
4071         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
4072         to the gnu subdirectory.
4073         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
4074         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
4075         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
4076         * m4/system_.h: Likewise, in non-configured includes.
4078 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
4079             Gary V. Vaughan  <gary@gnu.org>
4081         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
4082         Protect definitions from macro expansion under -DNDEBUG by
4083         parenthesising the expanded function names.
4084         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
4085         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
4086         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
4087         (m4_is_syntax_macro_escaped): Similarly protect function
4088         definitions from macro expansion under -DNDEBUG by #undefing the
4089         matching macro names before each definition.  Also, move all the
4090         function definitions to the end of the file so that any
4091         invocations in the rest of the file pick up the fast macro
4092         versions.
4093         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
4094         (m4_set_debug_file, m4_set_trace_messages)
4095         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
4096         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
4097         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
4098         option setter functions.
4100 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
4102         * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
4103         to gnu.
4105 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
4107         * src/main.c: Include gnulib files from the correct directory.
4109         * gnulib/*: Don't store any of the gnulib files in arch, as they
4110         generate spurious changes.
4111         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
4112         gnulib macros now share our macro directory.
4113         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
4114         * bootstrap: Call gnulib-tool to import from the gnulib tree.
4115         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
4116         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
4117         the gettext macros from autopoint that overwrite the gnulib-tool
4118         imported versions.  Import sources and Makefile.am into the `gnu'
4119         directory.  Changed all callers.
4120         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
4121         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
4122         for imported modules.
4123         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
4124         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
4125         hardcoding the gnulib macros they wrap.
4127 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
4129         Latest CVS libtool can preload modules in libraries, including
4130         its own module loaders!  Tweak m4 so that it doesn't try to treat
4131         libltdl's module loaders as m4 modules when freezing and on exit:
4133         * gnulib/acm4/*.m4: Don't store these files in arch since they
4134         generate spurious changes.
4135         * bootstrap: Simplify initial libtoolize call, since CVS
4136         libtoolize is smarter these days.
4137         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
4138         build.
4139         * m4/module.h (m4__module_exit): Missing declaration.
4140         * m4/m4private.h (m4__module_next): New function declaration.
4141         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
4142         encapsulation.  Changed all callers.
4143         (m4__module_interface): New function to verify m4 loadable module
4144         interfaces.
4145         (m4__module_init): Register the interface validator.
4146         (m4__module_exit): Only close my own modules.
4147         * modules/m4.c (unistd.h): Provide missing declaration.
4148         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
4149         (m4_expand_ranges): More missing declarations.
4150         * modules/modtest.c (export_test): Ditto.
4151         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
4152         * src/main.c (main): Bump copyright year.
4153         * tests/modules.at: Fix sed syntax error.
4156 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
4158         Tweaking to enable compilation with latest CVS libtool and
4159         libltdl.  We can't just dump the library files directly into the
4160         m4 directory anymore now that libltdl is built from pieces itself:
4162         * bootstrap: Rewritten to use latest libtoolize sanely, and to
4163         set up libltdl subdirectory.
4164         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
4165         gnulib subdirectory's config.
4166         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
4167         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
4168         macros from gnulib.
4169         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
4170         configure.ac, so use AC_WITH_LTDL instead.
4171         * Makefile.am (SUBDIRS): Add libltdl.
4172         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
4173         gl_INCLUDED_REGEX.
4174         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
4175         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
4176         (libm4_la_LIBADD): Add LIBLTDL.
4177         * m4/ltdl.c, m4/ltdl.h: Removed.
4178         * m4/m4module.h: Include canonical ltdl.h.
4179         * po/*.po: Updated.
4181 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
4183         * gnulib/import: Now updates makefile fragments, and configure.ac.
4184         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
4185         * gnulib/m4/Makefile.am: include it.
4186         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
4187         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
4188         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
4189         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
4190         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
4191         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
4192         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
4193         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
4194         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
4195         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
4196         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
4197         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
4198         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
4199         import.
4200         * gnulib/m4/getopt_int.h: New source file from latest gnulib
4201         import.
4202         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
4203         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
4204         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
4205         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
4206         Updated source files from latest gnulib.
4208 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
4210         * config/mailnotify: New file for mailing commit notifications,
4211         imported from cvs-utils.
4212         * commit: Updated from cvs-utils and tweaked for m4.
4214 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
4216         * config/mkstamp: Updated from CVS libtool.
4217         * configure.ac: Generate a gnu coding standards compliant version
4218         number, and use it for the banner.
4219         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
4220         mhen the TIMESTAMP changes in ChangeLog, but the file modification
4221         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
4222         contain the previous version number.
4223         * src/main.c: Make --version output conform to the GNU standard.
4225         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
4226         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
4227         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
4228         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
4229         time_la_SOURCES): ...so that these are defaulted correctly, and
4230         can be removed from this file.
4231         (AM_LDFLAGS): Add -module...
4232         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
4233         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
4234         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
4235         the individual settings can be removed.
4236         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
4237         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
4238         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
4239         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
4240         time_la_LIBADD): ...so that these are picked up as a deplib of
4241         libm4 and don't need to be set explicitly.
4243 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
4245         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
4246         from the standard build.  It is too fragile.
4248         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
4249         CVS libtool after merging m4 changes across to libtool.
4251         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
4252         * m4/path.c (search_path_add): Ditto.
4254 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
4256         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
4257         libtool tags we don't use in configure.  This reduces the size
4258         of the script from over 1Mb to under 700Kb.
4260 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
4262         The import script was not written properly, and the last gnulib
4263         import was incomplete.  Fixed that problem, and reimport our
4264         gnulib dependencies, which picks up the address calculation
4265         overflow checks described by Paul below.  Also tweak the clients
4266         of the gnulib xalloc module not to use deprecated macros:
4268         * gnulib/import: Recurse through module dependencies rather than
4269         naively descending only one level.
4270         * configure.ac: Add calls to gnulib's strnlen and extension module
4271         macros.
4272         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
4273         extension modules.
4274         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
4275         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
4276         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
4277         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
4278         gnulib.
4279         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
4280         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
4281         place of `xcalloc (1, S)'.
4282         * m4/m4.c (m4_create): Likewise.
4283         * m4/m4private.h (m4_symbol_value_create): Likewise.
4284         * m4/symtab.c (symtab_fetch): Likewise.
4285         * m4/syntax.c (m4_syntax_create): Likewise.
4286         * src/freeze.c (reload_frozen_state): Likewise.
4287         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
4288         macro.
4289         * m4/symtab.c (m4_symtab_create): Likewise.
4291 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
4293         * tests/module.at: Comment typo.
4295 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
4297         * tests/modules.at (modules: importing): Apply some lateral
4298         thinking, and use AT_CHECK to compare the output of a sed pass
4299         over stderr against the canonical strerror string.
4301         * tests/modules.at (modules: importing): Edit the generated stderr
4302         output to canonicalize strerror output, before a comparison.
4304 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
4306         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
4307         careful not to trip over the mess:
4309         * modules/perl.c: Some builds of perl install headers that contain
4310         `#define try __builtin_try'.  Be sure to undefine that macro
4311         before `m4/hash.h' gets included, which uses the `try' symbol.
4312         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
4313         `false' before including `stdbool.h'.
4314         (DELETE):  This symbol is not in m4's namespace, and is in any
4315         case only used internally...
4316         * m4/m4private.h (DELETE): ...so move it to here.
4317         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
4319 2003-10-08  Paul Eggert  <eggert@twinsun.com>
4321         Don't use XMALLOC and XCALLOC.  Once we install the
4322         corresponding patch into gnulib, this will fix some
4323         address-calculation overflow bugs on hosts where calloc (A, B)
4324         returns garbage when A*B overflows.
4326         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
4327         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
4328         xmalloc, XCALLOC with xcalloc.
4329         * m4/m4.c (m4_create): Likewise.
4330         * m4/m4private.h (m4_symbol_value_create): Likewise.
4331         * m4/output.c (m4_output_init): Likewise.
4332         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
4333         * m4/syntax.c (remove_syntax_attribute): Likewise.
4334         * src/freeze.c (reload_frozen_state): Likewise.
4335         * src/main.c (main): Likewise.
4337 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
4339         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
4340         gnulib/acm4 directories for aclocal m4 macros.
4341         * gnulib/Makefile.am (EXTRA_DIST): Removed.
4342         (MAINTAINERCLEANFILES): Add Makefile.in.
4343         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
4344         modules we use.
4345         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
4346         * gnulib/import: New file.  Temporary script for updating gnulib
4347         imported files, until gnulib-tool is working.
4348         * gnulib/config/codeset.m4, gnulib/config/error.m4,
4349         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
4350         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
4351         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
4352         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
4353         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
4354         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
4355         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
4356         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
4357         gnulib/config/nls.m4, gnulib/config/obstack.m4,
4358         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
4359         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
4360         gnulib/config/regex.m4, gnulib/config/restrict.m4.
4361         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
4362         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
4363         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
4364         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
4365         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
4366         gnulib/config/xstrndup.m4: Removed.
4367         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
4368         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
4369         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
4370         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
4371         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
4372         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
4373         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
4374         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
4375         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
4376         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
4377         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
4378         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
4379         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
4380         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
4381         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
4382         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
4383         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
4384         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
4385         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
4386         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
4387         gnulib/import script.
4388         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
4389         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
4390         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
4391         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
4392         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
4393         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
4394         gnulib with gnulib/import script.
4395         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
4396         guards ready for gnulib-tool to autoupdate on import.
4397         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
4398         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
4399         config/stackovf.m4: Moved from here...
4400         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
4401         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
4402         acm4/stackovf.m4: ...to here, to separate aclocal macros from
4403         configure time helper scripts.
4404         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
4405         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
4406         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
4407         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
4408         gnulib xalloc.h.
4409         * src/main.c (version_etc_copyright): Only output the current
4410         year.
4411         (version_etc): Call with new variadic API.
4413 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
4415         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
4416         version-etc module from CVS gnulib.
4417         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
4418         * src/Makefile.am: Build it.
4419         * src/main.c: Use it.
4421         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
4422         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
4423         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
4424         exit.h instead.
4426 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
4427             Gary V. Vaughan  <gary@gnu.org>
4429         * bootstrap: Separate options.
4430         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
4431         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
4432         not set.
4433         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
4434         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
4435         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
4436         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
4437         $(LTLIBINTL) for gettext support on cygwin.
4438         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
4439         have $(LTLIBINTL) from the preloaded module la files.
4440         * README: Remove the warning about using --disable-nls on Windows
4441         machines.
4443 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
4445         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
4446         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
4447         is required.
4449 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
4451         * doc/STYLE: Document the gnulib header naming conventions, and
4452         #include policy.
4453         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
4454         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
4455         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
4456         respectively.
4457         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
4459         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
4460         module from CVS gnulib.
4461         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
4462         (gl_FUNC_STRTOL): In favour of the module macro.
4464 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
4466         Replace the getopt code with CVS gnulib getopt.  The source files
4467         detect whether they are in a glibc environment and preprocess away
4468         all of the code if there is a system getopt, so we can compile
4469         them into the m4 executable unconditionally:
4471         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
4472         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
4473         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
4474         macros.
4475         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
4476         version.
4477         * src/Makefile.am: Adjust.
4478         * src/main.c: Always include our shipped getopt.h.
4479         * po/POTFILES.in: Use new location of getopt.c.
4481 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
4483         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
4484         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
4485         in this directory automatically.
4486         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
4488         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
4489         isn't set yet.
4490         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
4491         inline.
4492         * modules/Makefile.am (pkglibexecdir): Set it here.
4493         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
4495         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
4496         Import regex module from CVS gnulib.
4497         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
4498         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
4499         do extra substitutions for Makefile.
4500         * configure.ac: Use it.
4501         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
4502         from regex_.h if necessary.
4503         * m4/system_.h: Include the correct version of regex.h.
4504         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
4505         version.
4506         * po/POTFILES.in: Use new location of regex.c.
4508         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
4509         realloc.c: automake distributes these files already.
4511 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
4513         Replace the xstrzdup code by importing the xstrndup module from
4514         CVS gnulib, along with its dependencies: strndup and strnlen:
4516         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
4517         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
4518         gnulib.
4519         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
4520         gnulib/config/strndup.m4: Ditto wrt strndup.
4521         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
4522         strnlen.
4523         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
4524         However, contrary to gnulib, we install xstrndup.h.
4525         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
4526         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
4527         is an artifact of the old m4 portability layer.
4528         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
4529         * m4/system_.h: Include xstrndup.h.
4530         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
4532 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
4534         Reimport the latest xalloc module from CVS gnulib, and adjust the
4535         m4 sources to take advantage of xalloc xfree.  Also create a new
4536         macro DELETE with the same semantics as the old m4 XFREE macro,
4537         and carefully tweak callers:
4539         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
4540         gnulib.
4541         * m4/utility.c (xfree): Removed.  This function is now supplied by
4542         gnulib xalloc.
4543         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
4544         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
4545         * m4/symtab.c (m4_symtab_create): Ditto.
4546         * m4/system_.h: Removed XFREE redefine.
4547         (DELETE): New macro with same functionality as the original m4
4548         XFREE macro, but based on xalloc.h now.  Changed all callers.
4549         * src/main.c (main): Use XMALLOC macro.
4550         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
4551         instead of XFREE.
4552         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
4554 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
4556         Import the xalloc module from CVS gnulib, along with its
4557         dependencies: exitfail, malloc and realloc. We had different
4558         semantics for our XFREE and a function xfree() not supplied by
4559         gnulib, so also a bit of work to keep everything running
4560         smoothly:
4562         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
4563         (gl_XALLOC): Use gnulib equivalents.
4564         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
4565         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
4566         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
4567         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
4568         realloc.
4569         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
4570         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
4571         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
4572         imported modules.
4573         (pkgincdir): Removed.  Use pkgincludedir instead.
4574         * m4/m4private.h (XFREE): xfree already checks for NULL.
4575         * m4/system_.h: Use xalloc module, and remove macros already
4576         supplied by xalloc.h.
4577         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
4578         moved the old definition from m4/xmalloc.c to here for now.
4580 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
4582         Import the error and progname modules from CVS gnulib.  Our old
4583         error.c subsumed the functionality of both, so a little adjustment
4584         was required to accomodate the split in sources.  Also added more
4585         wrapper macros to choose between a system installed error.h or our
4586         shipped gnulib error module:
4588         * m4/error.c, m4/error.h: Removed.
4589         * m4/Makefile.am: Adjust.
4590         (pkgincdir): Removed.  Use pkgincludedir instead.
4591         * m4/module.h, src/main.c: Don't include `m4/error.h'.
4592         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
4593         error.h.
4594         * gnulib/m4/progname.c: Imported from CVS gnulib.
4595         * gnulib/m4/progname.h: Ditto.
4596         * src/main.c: Adjust to use progname module.
4597         * gnulib/m4/error.c: Imported from CVS gnulib.
4598         * gnulib/m4/error_.h: Ditto.
4599         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
4600         if appropriate, and link a local error.h if the system version is
4601         missing.
4602         (libgnu_la_SOURCES) Add progname module sources.
4603         * gnulib/config/error.m4: Imported from CVS gnulib.
4604         * gnulib/config/strerror_r.m4: Ditto.
4605         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
4606         to have ERROR_H for Makefile substitutions and tell system.h
4607         whether the system error.h should be used, or a locally installed
4608         version.
4609         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
4611 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
4613         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
4614         s/gettext_.h/gettext.h/.
4616         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
4617         automake have been fixed.
4619         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
4620         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
4621         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
4622         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
4624 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
4626         The gnulib obstack module requires the gnulib gettext module for
4627         systems that do not have GNU gettext installed.  Because we use
4628         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
4629         that directory incase it clashes with the system gettext.h.  This
4630         delta uses gettext_.h and extra rules in the Makefile to make a
4631         link to gettext.h when needed:
4633         * Makefile.am (auxdir): Removed.  No longer used.
4634         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
4635         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
4636         moved.
4637         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
4638         Makefile based build.
4639         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
4640         of the macros are kept.
4641         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
4642         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
4643         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
4644         distributes these automatically.
4645         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
4646         warning from automake-1.7a.
4647         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
4648         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
4649         all callers.
4650         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
4651         wrt. m4_FUNC_OBSTACK.
4652         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
4653         wrt. m4_sys_STACKOVF.
4654         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
4655         wrt. _m4_LIB_GMP, m4_LIB_GMP.
4656         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
4657         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
4658         respectively.
4659         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
4660         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
4661         gettext.h link on deficient systems.
4662         (pkginc_HEADERS): Mention $(GETTEXT_H).
4663         (EXTRA_HEADERS): Mention gettext.h.
4664         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
4665         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
4666         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
4667         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
4668         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
4669         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
4670         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
4671         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
4672         gnulib/config/po.m4, gnulib/config/progtest.m4,
4673         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
4674         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
4676 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
4678         We can't mirror the gnulib directory structure here, since we need
4679         to be able to eg. `#include <m4/obstack.h>' from our source files,
4680         which is much easier if the local obstack.h is created in a
4681         directory named m4.  Rather than trying to symlink everything into
4682         the m4 directory, now we build a libtool convenience library from
4683         the sources we get from gnulib and link that with libm4.la:
4685         * gnulib/config/extensions.m4: Imported from CVS gnulib.
4686         * gnulib/config/unlocked-io.m4: Ditto.
4687         * gnulib/m4/unlocked-io.h: Ditto.
4688         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
4689         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
4690         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
4691         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
4692         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
4693         * m4/Makefile.am: Adjust.
4694         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
4695         macros we redistribute.
4696         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
4697         library among others.
4698         (GNULIB_SRCS, GNULIB_MACROS): Removed.
4699         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
4700         * config/m4-obstack.m4: Adjust.
4701         * po/POTFILES.in: Adjust.
4702         * configure.ac: Reformatting.  Call newly imported gnulib macros.
4703         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
4704         bogus calls of `#include "m4.h"'.
4705         * Makefile.am: INCLUDES has been deprecated in favour of
4706         AM_CPPFLAGS.
4707         * m4/Makefile.am: Ditto.
4708         * modules/Makefile.am: Ditto.
4709         * src/Makefile.am: Ditto.
4711 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
4713         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
4715 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
4717         Migrate the obstack support into the gnulib directories for easy
4718         synchronisation with upstream files in gnulib:
4720         * config/gnu-obstack.m4: Moved from here...
4721         * config/m4-obstack.m4: ...to here.
4722         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
4723         * m4/obstack.c, m4/obstack_.h: Moved from here...
4724         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
4725         * po/POTFILES.in: Adjust.
4726         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
4727         * m4/Makefile.am: Add a whole new section to link the obstack
4728         sources from the gnulib tree if necessary.
4729         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
4730         from gnulib.
4731         * config/m4-obstack.m4: Rewrite as a wrapper for
4732         gnulib/m4/obstack.m4.
4734 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
4736         GNU M4 currently builds with a number of files adapted from
4737         upstream sources.  Recently the gnulib project on savannah.gnu.org
4738         has pulled together a great many of these externally maintained
4739         files.  This delta is the beginnings of isolating those files
4740         maintained in gnulib to make it easy to synchronise M4 with the
4741         upstream files prior to releases.
4743         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
4744         directory.
4745         (SUBDIRS): Added new gnulib subdirectory.
4746         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
4747         * config/stdbool.m4: Moved from here...
4748         * gnulib/m4/stdbool.m4: ...to here.
4749         * m4/stdbool_.h: Moved from here...
4750         * gnulib/lib/stdbool_.h: ...to here.
4751         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
4752         distributed.
4753         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
4754         code to work with new stdbool_.h location.
4755         (gnulib_srcdir): New.
4757 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
4759         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
4760         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
4761         builds to work.
4762         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
4763         (EXTRA_DIST): Use it.
4765         * bootstrap: CVS autoreconf leaves file droppings.  Remove
4766         aclocal.m4t incase autoreconf doesn't.
4768 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
4770         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
4771         the other gnulib imports, renamed to m4/obstack_.h.
4772         * m4/obstack.c: Updated from CVS gnulib.
4773         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
4774         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
4775         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
4776         about vpath already, and $top_srcdir upsets CVS Automake, so the
4777         $top_srcdir reference was removed.
4779         * m4/system-h.in: For consistency with the gnulib imports, renamed
4780         to m4/system_.h.
4781         * m4/Makefile (EXTRA_HEADERS): Adjust.
4782         * configure.ac (AC_CONFIG_FILES): Adjust.
4784         * m4/stdbool_.h: New file from gnulib for systems without their
4785         own.
4786         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
4787         * config/stdbool.m4: New file.  Macros from gnulib for same.
4788         * configure.ac: Use it.
4790 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
4792         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
4793         * config/gmp.m4: Ditto.
4794         * config/gnu-obstack.m4: Ditto.
4795         * config/stackovf.m4: Ditto.
4796         * m4/builtin.c: Ditto.
4797         * m4/debug.c: Ditto.
4798         * m4/error.c: Ditto.
4799         * m4/error.h: Ditto.
4800         * m4/gnu-obstack.h: Ditto.
4801         * m4/hash.c: Ditto.
4802         * m4/hash.h: Ditto.
4803         * m4/input.c: Ditto.
4804         * m4/m4.c: Ditto.
4805         * m4/m4module.h: Ditto.
4806         * m4/m4private.h: Ditto.
4807         * m4/macro.c: Ditto.
4808         * m4/module.c: Ditto.
4809         * m4/obstack.c: Ditto.
4810         * m4/output.c: Ditto.
4811         * m4/path.c: Ditto.
4812         * m4/regex.c: Ditto.
4813         * m4/regex.h: Ditto.
4814         * m4/strtol.c: Ditto.
4815         * m4/symtab.c: Ditto.
4816         * m4/syntax.c: Ditto.
4817         * m4/utility.c: Ditto.
4818         * m4/xmalloc.c: Ditto.
4819         * m4/xstrdup.c: Ditto.
4820         * m4/xstrzdup.c: Ditto.
4821         * modules/evalparse.c: Ditto.
4822         * modules/format.c: Ditto.
4823         * modules/gnu.c: Ditto.
4824         * modules/import.c: Ditto.
4825         * modules/load.c: Ditto.
4826         * modules/m4.c: Ditto.
4827         * modules/m4.h: Ditto.
4828         * modules/modtest.c: Ditto.
4829         * modules/mpeval.c: Ditto.
4830         * modules/perl.c: Ditto.
4831         * modules/shadow.c: Ditto.
4832         * modules/stdlib.c: Ditto.
4833         * modules/time.c: Ditto.
4834         * modules/traditional.c: Ditto.
4835         * src/freeze.c: Ditto.
4836         * src/getopt.c: Ditto.
4837         * src/getopt1.c: Ditto.
4838         * src/m4.h: Ditto.
4839         * src/main.c: Ditto.
4840         * src/stackovf.c: Ditto.
4842         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
4843         ac_default_headers is an autoconf internal variable.
4844         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
4845         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
4847         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
4848         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
4849         delta.
4851 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
4853         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
4854         C99 bool.
4855         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
4856         possible or faking one with a typedef.  Changed all callers.
4858 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
4860         Still cleaning up the users' module API, by taking out the stuff
4861         that isn't used by any existing modules, and moving specialised
4862         functions out of libm4 and into the module they are used by.
4864         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
4865         * m4/utility.c (m4_skip_space): ...to here the home of its only
4866         use, made static and renamed to `skip_space'.  Changed all
4867         callers.
4868         * m4/m4module.h (m4_expand_ranges): Removed prototype.
4869         * m4/utility.c (m4_expand_ranges): Moved definition from here...
4870         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
4871         ltdl.
4872         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
4873         casting .
4874         * modules/gnu.c (builtin_syntax): Import and use in this
4875         builtin implementation.
4876         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
4877         Not used.  Deleted.
4878         * m4/macro.c (trace_flush): Except here where the macro is now
4879         manually inlined.
4880         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4881         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
4882         moved...
4883         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4884         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
4886 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
4888         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
4889         compiler based AC_CHECK_HEADER that was introduced in
4890         autoconf-2.56.
4891         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
4892         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
4893         * configure.ac: Use renamed M4_AC_LIB_GMP.
4895         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
4896         macro that requires arguments! This stops the shell's bad
4897         substitution error at configure time.
4899         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
4900         variables to the testsuite shell.  Set the value of USE_GMP so
4901         that the gmp test will run!
4902         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
4904 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
4906         Libltdl already has an excellent mechanism for accessing C symbols
4907         in modules.  Lets use that!  Remove all the exporting cruft and
4908         just use lt_dlsym in conjunction with a few conventions to
4909         simplify module writers' jobs.  Also removed the table address
4910         caching code and otherwise simplified the module loader quite a
4911         bit.  To access exported symbols in other modules, first the
4912         exporting module must name the symbols <modname>_LTX_<symname>,
4913         and the importing module must define a function type called
4914         <symname>_func.  The importer then adds
4915         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
4916         that wishes to call out to the exported functions.  Care must be
4917         taken that <symname> is non-NULL in the importing module incase
4918         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
4919         definition was in the importers source.  Study
4920         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
4921         m4_module_import will attempt to automatically load a module
4922         required for symbol access if it is not loaded already.
4924         * TODO: Removed the items fixed in this delta.
4925         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
4926         module name.
4927         * m4/ltdl.h (lt_dlhandle_find): Declare it.
4928         * m4/module.c (m4_module_unload): Use it.
4929         * src/freeze.c (reload_frozen_state): Ditto.
4930         * m4/m4module.h (m4_export): Deleted.  Removed all references.
4931         (M4_MODULE_IMPORT): New user convenience macro for importing
4932         arbitrary symbols from other modules.
4933         * m4/module.c (m4_module_import): New function to service
4934         M4_MODULE_IMPORT macro.
4935         (module_data): Removed.  Looking up the tables on demand with
4936         lt_dlsym, rather than caching their addresses here simplifies the
4937         code substantially.
4938         (m4_get_module_builtin_table, m4_get_module_macro_table):
4939         Removed.  Changed all callers.
4940         (set_module_macro_table, set_module_builtin_table): Renamed to
4941         install_macro_table and install_builtin_table respectively, and
4942         simplified now that the cache is no more.
4943         * modules/gnu.c (builtin_symbols): Use this new mechanism to
4944         import m4_dump_symbols from the m4 module.
4945         (builtin_esyscmd): Likewise for m4_set_sysval and
4946         m4_sysval_flush.
4947         * modules/m4.c (m4_export_table): Removed.  Functions are
4948         addressed with the new mechanism which doesn't need this.
4949         (m4_set_sysval): New exported accessor function to prevent
4950         problems with variable access on inferior architectures.
4951         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
4952         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
4953         that we can have some type safety.
4954         * modules/modtest.c (export_test): C level exported function for
4955         testing the new import mechanism.
4956         * modules/import.c: New file for the import end of the test.
4957         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
4958         * tests/modules.at: New test cases for intermodule symbol
4959         importing.
4961 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
4963         * m4/m4module.c (m4_string): Moved from here...
4964         * m4/m4private.c (m4_string): ...to here.
4966         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
4968 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
4970         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
4971         already available to module writers through
4972         m4_{get,set}_nesting_limit_opt(), so moved from here...
4973         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
4974         (m4_create): Use it.
4976 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
4978         Aside from auditing path.c for m4module.h api obfuscation, this
4979         delta introduces the concept of private struct members in opaque
4980         data types to GNU m4: See the STYLE file for details.
4982         * TODO: Remind ourselves that a rewrite of path.c is needed.
4983         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
4984         Moved from here...
4985         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
4986         here and renamed.  These type definitions are for internal api use
4987         only.  Changed all callers.
4988         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
4989         Moved from here...
4990         * m4/path.c (search_path_env_init, search_path_add): ...to here
4991         and renamed.  These calls were never used outside this file.
4992         Changed all callers.
4993         (dirpath): Moved functionality of this static declaration...
4994         * m4/m4private.h (struct m4): ...to this new internal only
4995         search_path field.  Changed all callers.
4996         (m4__get_search_path): Added new internal api accessor.
4997         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
4998         (m4_include_init): Removed...
4999         * m4/m4.c (m4_create): ...because the new m4 field is now
5000         initialised here.
5001         (m4_delete): Recycle search_path memory.
5002         * src/main.c (main): Don't call m4_include_init now that it's
5003         gone!
5004         * doc/STYLE: Document convention for private fields in opaque
5005         ADTs.
5007 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
5009         Sometimes exporting the address of a symbol from a module isn't
5010         enough for other modules to call that symbol correctly.  If
5011         custom data types are used for function parameters, they need to
5012         be known to the caller.  This change introduces the concept of
5013         $(prefix)/include/modules/$(modulename).h to declare those
5014         structures.  Also we move m4_dump_symbols from libm4 to the m4
5015         module to show this concept in action.
5017         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
5018         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
5019         exporting data structures from modules/m4.c.
5020         * modules/m4.c, modules/gnu.c: Include it.
5021         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
5022         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
5023         prototypes.
5024         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
5025         Moved from here...
5026         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
5027         ...to here, with slight renaming.
5028         (m4_export_table): Prototype and add m4_dump_symbols.
5029         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
5030         definition of m4_dump_symbols.
5031         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
5032         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
5034 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
5036         Create an export table in modules/m4.c in readiness for beefing up
5037         the module loader to track module exports and imports.
5039         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
5040         * m4/debug.c (m4_debug_flush_files): Moved...
5041         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
5042         * modules/gnu.c (builtin_esysval): Use it.
5043         * m4/m4module.h (m4_export): New type for declaring module symbols
5044         for export.
5045         * modules/m4.c (m4_export_table): List symbols exported from this
5046         module for use by other modules.
5048 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
5050         An experiment: There is loads of code in libm4 which should be in
5051         the m4 module, but is also used by another module. Just because
5052         some linkers won't cope with calls across dynamic runtime loaded
5053         objects I initially left the code in libm4.  It will tidy the
5054         module api immensely if this code moves to the right place, I just
5055         need to remember to invent a suitable calling mechanism at some
5056         point.  For now, only modules that are statically linked and
5057         preloaded will get this treatment, so the only platforms that will
5058         break are those that require all symbols to be resolved at link
5059         time.
5061         * TODO: Reminder that what I am doing could reduce portability
5062         unless I do something more robust later.
5063         * m4/m4module.h (m4_sysval): No longer exported from libm4.
5064         * m4/utility.c (m4_sysval): No longer declared in libm4.
5065         * modules/Makefile.am: Reformatting.
5066         * modules/m4.c (m4_sysval): Declare it at place of use.
5067         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
5069 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
5071         * m4/m4module.h: Reformatting and rearranging lines a bit.
5072         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
5073         all users.
5074         (m4_call_macro, m4_expand_input): Renamed...
5075         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
5076         callers.
5077         (m4_expansion_level, m4_process_macro): Moved...
5078         * m4/macro.c (expansion_level, process_macro): ...to here, and
5079         made static.
5081         * m4/m4module.h (program_name): Not used by modules at all, so
5082         moved...
5083         * src/main.c (program_name): ...to here.
5084         (print_program_name): Renamed...
5085         (print_program_name_CB): ...to conform to the STYLE guide.
5087 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
5089         More refactoring of the m4module.h API.  Replace #defines with an
5090         enum, and move non-public functions out of the public API.
5092         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
5093         inclusion.
5094         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
5095         * m4/debug.c (m4_debug, trace): Moved...
5096         * m4/m4private.h (struct m4): ...to fields of this struct.
5097         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
5098         for the new fields.
5099         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
5100         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
5101         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
5102         * m4/m4module.h (m4_context_field_table): Add entries for new
5103         debug_file and trace_messages fields.
5104         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
5105         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
5106         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
5107         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
5108         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
5109         (m4_is_debug_bit): New macro to simplfy checks against the debug
5110         bits above.
5111         (m4_trace_format, m4_trace_header, m4_trace_flush)
5112         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
5113         prototypes.
5114         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
5115         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
5116         * m4/macro.c (trace_format, trace_header, trace_flush)
5117         (trace_prepre, trace_pre, trace_post): ...to these newly static
5118         functions, since they are only ever used from this file.  Changed
5119         all callers.
5121 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
5123         Change the macros for checking syntax so that matching against
5124         multiple possible syntax classes can be done with a single
5125         comparison some of the time.  The various classes are now bits of
5126         an int that can be checked with bitwise logic operators.
5128         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
5129         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
5130         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
5131         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
5132         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
5133         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
5134         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
5135         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
5136         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
5137         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
5138         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
5139         Replace all calls with invocations of these...
5140         (m4_is_syntax, m4_has_syntax): ...New macros.
5141         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
5142         is no longer required with new macros.  Changed all callers.
5144 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
5146         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
5147         values are returned as part of the internal interface, so they
5148         need to be moved...
5149         * m4/private.h: ...to here.
5150         * m4/macro.c (expand_token): Check for out of range
5151         m4_peek_input() results before looking up in the syntax table.
5152         (collect_arguments): Ditto.
5154         * NEWS: Note `$' syntax class.
5156 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
5157             Gary V. Vaughan  <gary@gnu.org>
5159         Conform to POSIX if the POSIXLY_CORRECT environment is set.
5160         --traditional `define' now smashes all the definitions.
5162         * NEWS: Explain this.
5163         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
5164         (Extensions): Explain that extensions that are incompatible with
5165         POSIX are disabled if POSIXLY_CORRECT is set.
5166         (Incompatibilities): Remove.
5167         (Define, Other Incompat): Explain difference
5168         between GNU and POSIX behavior of define, pushdef, popdef.
5169         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
5170         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
5171         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
5172         (m4_get_posixly_correct_opt): New macro.
5173         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
5174         POSIXLY_CORRECT.
5175         * modules/m4.c (builtin_functions): defn now takes any number of args.
5176         (builtin_define): Smash all the definitions if
5177         POSIXLY_CORRECT.
5178         (builtin_defn)): Allow any number of arguments.
5179         (builtin_undivert): Do not allow nonnumeric arguments
5180         if POSIXLY_CORRECT.
5181         * src/main.c (main): Set posixly-correct behavior if either
5182         POSIXLY_CORRECT is set, or if -G is given.
5183         * tests/builtins.at: New test for smashed definitions.
5185 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
5187         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
5188         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
5189         not to slow the parser down.
5190         (M4__IS_STRING): New macro to test string syntax class membership.
5191         * m4/syntax.c: Adjust docucomment.
5192         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
5193         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
5194         * m4/input.c (init_builtin_token): Comment typo.
5195         (m4__next_token): Comment typo.
5196         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
5197         by using the new M4__IS_STRING macro.
5198         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
5199         variable references in macro expansions.
5201         * doc/m4.texinfo (Eregexp and Regexp): Typo.
5202         (Epatsubst and Patsubst): Typo.
5203         (Eval): Typo.
5205 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
5207         Move the global variables that pertain to syntax to a new `struct
5208         m4_syntax_table', and then add one of these to `struct m4'.  The
5209         ripple effect through the code to both change formerly global
5210         references, and make sure a suitable context is available in
5211         lexical scope is disproportionately large compared to the size of
5212         the change proper.  This change is a large part of decoupling
5213         syntax.c from the rest of the code that uses it.
5215         * m4/m4private.h (struct m4): Add a syntax field.
5216         * m4/m4.c (m4_create): Initialise it,
5217         (m4_delete): Recycle it.
5218         (m4_get_symtab): Remove hand coded version...
5219         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
5220         callers.
5221         * m4/m4module.h (m4_context_field_table): Add an extra field so we
5222         can generate m4_get_symbol_table.  Add a new row for
5223         m4_get_syntax_table.
5224         (M4SYNTAX): Syntactic sugar for module writers.
5225         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
5226         (m4_syntax_table): New home for syntax related formerly global
5227         variables.
5228         * m4/m4private.h (struct m4_syntax_table): Define it.
5229         * m4/input.c (m4_input_init): Initialisation of these formerly
5230         global variables moved...
5231         * m4/syntax.c (m4_syntax_create): ...to here.
5232         * m4/input.c (m4_input_exit): And similarly, recycling of the
5233         memory used by those values moved...
5234         * m4/syntax.c (m4_syntax_delete): ...to here.
5235         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
5236         Moved to m4/m4private.h.
5237         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5238         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5239         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5240         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
5241         objects.  Changed all callers that used to directly access the
5242         global equivalents.
5243         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
5244         Removed and incorporated into m4_syntax_table structure.
5245         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
5246         * m4/syntax.c (m4_set_syntax): Now returns an error status,
5247         instead of requiring a `struct m4' to generate its own errors.
5248         Changed all callers.
5249         * src/main.c (main): Now that the syntax table is initialised as
5250         part of m4_create, we have to manually wipe the syntax entries if
5251         we are about to read a frozen file.
5253 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
5255         * doc/STYLE: Added notes on callback naming schemes.
5257         * m4/module.c (m4_set_module_macro_table)
5258         (m4_set_module_builtin_table): Declarations weren't changed when
5259         definitions were renamed on 2003-06-19.
5261         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
5262         neither used nor particularly appropriate since it exposes the
5263         internal workings of the hash module.  I haven't yet decided
5264         whether to remove it entirely.
5266 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
5268         Two related changes, and a huge knockon effect throughout the
5269         source: Moved the option variables out of global space and into
5270         `struct m4'; made `m4_symtab' a real datatype, so that its api
5271         is not marred passing `struct m4' around just so it can decide
5272         whether to keep traced symbol names or not.  Added setters and
5273         getters for the formerly global option variables, and obviously
5274         changed a vast number of functions to take a `struct m4' and use
5275         the getter funcs to find option values.
5277         * m4/utility.c (interactive, sync_output, debug_level)
5278         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
5279         (max_debug_argument_length, warning_status, nesting_limit)
5280         (discard_comments): Removed.
5281         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
5282         (debug_level, max_debug_argument_length, prefix_all_builtins)
5283         (suppress_warnings, discard_comments, interactive, sync_output):
5284         Removed from here...
5285         * m4/m4private.h (struct m4): ...and equivalent fields added to
5286         this structure.
5287         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
5288         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
5289         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
5290         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
5291         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
5292         macros for the new fields.
5293         * m4/m4module.h (m4_context_field_table)
5294         (m4_context_opt_bit_table): Helper macros used to generate
5295         prototypes, setters and getters for new option fields
5296         consistently.
5297         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
5298         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
5299         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
5300         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
5301         (m4_get_interactive_opt, m4_get_sync_output_opt)
5302         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5303         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5304         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
5305         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
5306         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
5307         setter and getter functions generated by cpp from
5308         m4_context_field_table and m4_context_opt_bit_table, exported as
5309         part of the module api.  Changed all callers.
5310         * m4/symtab (struct m4_symtab): Used as the concrete type for
5311         m4_symtab now.
5312         (m4_symtab_create): Allocate and initialise a new struct.
5313         (m4_symtab_apply): New function that works like m4_hash_apply, but
5314         with different callbacks specific to symbol tables.  Changed all
5315         callers.
5316         (symbol_destroy, arg_destroy, arg_copy): Renamed
5317         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
5318         they have unused parameters for a reason!
5319         (dump_symbol_CB): New callback to dump the contents of a single
5320         symbol.
5321         (symtob_dump): Rewritten in terms of dump_symbol_CB.
5322         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
5323         Changed all callers.
5324         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
5325         of the contained `m4_symtab' at the `no_gnu_extensions' field.
5326         Although I'm not convinced these semantics are correct, they are
5327         at least consistent with how things were before this delta.  Also
5328         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
5330 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
5332         Tie down the interface to libm4 some more.  Make more structures
5333         opaque to modules by moving them to m4private.h, and writing
5334         setters and getters.  To win back the speed penalty for doing this
5335         also wrote macroized versions that do know about structure layout
5336         in m4private.h and #include that file into modules when NDEBUG is
5337         defined at compile time.  There are still some accessor macros in
5338         m4private.h that need to go, but that is not necessary to clean
5339         the module api up.
5341         * m4/m4module.h (m4_symbol_type): Moved...
5342         * m4/m4private.h (m4__symbol_type): ...to here.
5343         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
5344         (m4_set_symbol_traced, m4_set_symbol_name_traced)
5345         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
5346         (m4_get_symbol_func, m4_symbol_value_create)
5347         (m4_symbol_value_delete, m4_set_symbol_value_text)
5348         (m4_set_symbol_value_func): New exported api to symbols.
5349         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
5350         and m4_is_symbol_value_func.
5351         * m4/m4module.h: Prototype these guys.
5352         * m4/module.c (m4_set_module_macro_table)
5353         (m4_set_module_builtin_table): Make these static, there is no
5354         reason to pollute the api with them.
5355         * m4/m4private.h: Reformatting.
5356         (m4_get_symtab): Only define when NDEBUG is defined.
5357         (m4_get_symbol_value, m4_get_symbol_traced)
5358         (m4_set_symbol_traced, m4_set_symbol_name_traced)
5359         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
5360         (m4_get_symbol_func, m4_symbol_value_create)
5361         (m4_symbol_value_delete, m4_set_symbol_value_text)
5362         (m4_set_symbol_value_func): Macro implementations of the new
5363         functions when NDEBUG is defined.
5364         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
5365         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
5366         Superceded by the above.  All callers changed.
5367         (M4ARG): Removed.  This is no longer different to the
5368         m4/m4module.h definition.
5369         * modules/gnu.c, modules/m4.c: Only include m4private.h when
5370         NDEBUG is defined.  That way we exercise the same (albeit slower)
5371         api that external modules must use.
5373 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
5375         Renamed some of the types and their accessors to make more sense.
5376         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
5377         has a stack of SYMBOL_VALUEs.
5379         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
5380         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
5381         m4_get_symbol_value_type,  m4_get_symbol_value_text,
5382         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
5383         Changed all callers.
5384         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
5385         (m4_get_token_type): Renamed
5386         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
5387         to the internal api.
5388         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
5389         s/TOKEN_/VALUE_/
5390         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
5391         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
5392         (m4__token_type): Moved here from m4module.h.
5393         (m4__next_token): Renamed from m4_next_token.
5394         * m4/symtab.c: Removed some of the parameterised macro support
5395         functions for modularisation later.
5396         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
5397         m4_hash_dup to perform a true deep copy of the SRC.
5398         (arg_copy): Callback for m4_symbol_value_copy.
5399         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
5400         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
5401         m4_get_symbol_value_func.  Changed all callers.
5403 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
5405         Tidy up style of hash.[ch] in accordance with doc/STYLE.
5407         * m4/hash.c: Internal symbol renaming and formatting.
5408         (m4_hash_dup): New function to facilitate deep copies of hash
5409         tables.
5410         (m4_hash_apply_func): Returns a void* now, which is a richer type
5411         for returning exceptions (NULL means keep going).
5412         (m4_hash_apply): Ditto.
5413         * m4/hash.h: Declare exported symbols with an explicit extern.
5414         Reformated.
5416 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
5418         Still refactoring furiously.  This delta represents a change in
5419         semantics to symtab.c.  Instead of building temporary m4_tokens
5420         in the caller, and copying fields in the methods, we now create
5421         the actual m4_token for hashing in the caller so the methods just
5422         slot them in directly.  Also, this means that we don't lookup a
5423         symbol and get back an allocated but VOID token to copy fields
5424         into, we create the token we want to push and pass that to
5425         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
5426         a few other small changes to stop knowledge of the implementation
5427         of symtab.c leaking out into other files.
5429         * m4/macro.c (expand_argument): Comment typo corrected.
5430         * m4/symtab.c (symtab_fetch): New function to fetch the address of
5431         an interned symbol.
5432         (m4_symbol_pushdef): Take an extra value parameter and use this
5433         directly as the new top of the value stack.  All callers changed
5434         to build a token and pass responsibility for memory in, rather
5435         than copying as we used to.
5436         (m4_symbol_define): Also use the new value parameter directly as a
5437         replacement for the top of the value stack.  All callers changed
5438         to build a token as above.
5439         (m4_set_symbol_traced): New function to set the traced bit on the
5440         named symbol, creating it if necessary.
5441         (symbol_popval): The guts of the old m4_symbol_popdef.
5442         (m4_symbol_popdef): Use it.
5443         * m4/builtin.c (m4_symbol_set_token): Removed,
5444         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
5445         replaced...
5446         * m4/module.c (m4_set_module_builtin_table)
5447         (m4_set_module_macro_table): ...with these more orthogonal
5448         functions.
5449         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
5450         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
5451         required.
5452         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
5453         (m4_arg_signature_parse): Moved...
5454         * m4/symtab.c: ...to here.
5455         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
5456         screw something up. Moved...
5457         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
5458         actually does a proper deep copy of source to dest.
5460 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
5462         Further refactoring to stabilise the module API.  Renaming some
5463         functions for orthogonality, and judicious definition migration to
5464         move things out of the set of exported symbols.
5466         * doc/STYLE: New file.  Notes on coding style.
5467         * m4/m4module.c: Updated bitrotted docucomment at the top of the
5468         file.
5469         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
5470         m4_get_module_name, m4_get_module_builtin_table,
5471         m4_get_module_macro_table which are verb phrases.  Changed all
5472         callers.
5473         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
5474         Moved to...
5475         * m4/module.c (m4_set_module_builtin_table)
5476         (m4_set_module_macro_table): ...here, and renamed. Changed all
5477         callers.
5478         * m4/m4module.c (m4_module_data): This...
5479         * m4/m4private.c (struct m4_module_data): ...and this...
5480         * m4/module.c (module_data) ...consolidated here and no longer
5481         exported.  Changed all callers.
5483 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
5485         Begin work on lifting the curse of the global variables.  To start
5486         with create a `struct m4' context container, and replace
5487         `m4__symtab' with `context->symtab' throughout.  This means
5488         initialising a context container in main, and adjusting many
5489         functions between main and the module entry points so that the
5490         container gets passed through.  It would have been nice to
5491         defer this until after 1.5, but it has a major effect on the
5492         user's module writing ABI, so it needs to be addressed now - at
5493         least in the areas that impact the ABI.  An interrelated change
5494         in the symtab API removes the dependency on a global symbol table,
5495         and instead focuses on a passed table (from the context
5496         container).
5498         * TODO: Reminders for finishing context functionality.
5499         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
5500         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
5501         global variables and eventually allow m4 to be reentrant.
5502         * m4/m4private.h (m4): Define the new structure here...
5503         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
5504         don't carry the overhead of a function call.
5505         * m4/m4module.h: Prototype extern functions from m4/m4.c.
5506         (m4): Declare type for new struct m4 objects.
5507         (M4SYMTAB): User macro to ease finding the symbol table for the
5508         current context for module developers.
5509         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
5510         verb.
5511         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
5512         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
5513         (m4_call_macro, m4_dump_symbols, m4_expand_input)
5514         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
5515         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
5516         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
5517         m4* context parameter. Changed definitions and all callers.
5518         (m4_symtab): Alias for m4_hash to decouple the
5519         m4_symtab api from m4_hash.
5520         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
5521         m4_hash.
5522         (m4_symtab_create): New function to return an initialised
5523         m4_symtab.
5524         (m4_symtab_delete): New function to delete an m4_symtab's memory.
5525         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
5526         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
5527         instead of simply using the global m4__symtab.  Changed
5528         definitions and all callers.
5529         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
5530         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
5531         * src/main.c (main): Create a context and use that instead of the
5532         former global m4__symtab.
5534 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
5536         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
5537         to the callback.  Callbacks should not need to hardcode the
5538         hashtable they are working from, nor should we have to waste the
5539         userdata parameter to pass the table in.
5540         * m4/hash.h (m4_hash_apply_func): Require the initial table
5541         parameter.
5542         * m4/symtab.c (symtab_destroy): Use the passed table instead
5543         of hardcoding m4__symtab.
5544         (m4_symbol_popdef): Don't use the userdata parameter to pass the
5545         table to arg_destroy.
5546         (arg_destroy): Use the hash parameter, ignore userdata.
5547         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
5548         prototype.
5549         (traceon, traceoff): Call set_trace with the extra initial
5550         parameter.
5552 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
5554         More refactoring to stabilise the module api, this time for
5555         symtab.c.  Additionally, start to pay attention to function names
5556         that don't contain a verb like they should.
5558         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
5559         wrapper for m4_hash_apply to decouple the symtab module from the
5560         hash module.
5561         (m4_symbol_builtin, m4_symbol_macro): Renamed to
5562         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
5563         callers.
5564         (m4_symbol_delete): Create a macro version to save a function
5565         call.
5566         (m4_token_t, m4_data_t): These violate the POSIX reserved
5567         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
5568         all callers.
5569         (m4_token_type): Renamed to m4_token_get_type.
5570         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
5571         (m4_symtab_exit): Removed from the exported module
5572         api...
5573         * m4/m4private.h (m4__symtab, m4__symtab_init)
5574         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
5575         renamed and added to the internal api. Changed all callers.
5576         (m4_symtab_apply): A faster macro version of the function for
5577         users of the internal api.
5578         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
5579         symbol_destroy and arg_destroy.
5580         (symtab_debug): Added a prototype.
5581         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
5582         so that callers in this file get the faster macro versions from
5583         m4/m4private.h.
5585 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
5587         Refactoring modules to rationalise the API into an external
5588         documented (eventually!) API for use by modules in the `m4_'
5589         namespace declared in m4/m4module.h, an internal API between the
5590         source files we ship (including our shipped modules) in the `m4__'
5591         namespace declared in m4/m4private.h and making the rest as
5592         cohesive as possible with liberal use of the `static' keyword.
5593         This change represents an audit to m4/module.c along these
5594         guidelines.
5596         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
5597         Removed.  No longer used.
5598         (m4_module_close): Removed prototypes.
5599         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
5600         from the exported module api...
5601         * m4/m4private.h (m4__module_init, m4__module_open)
5602         (m4__module_exit): ...and renamed and added to the internal api.
5603         Changed all callers.
5604         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
5605         Centralised definitions after renaming...
5606         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
5607         (M4_FINISH_SYMBOL): ...and removing from here.
5608         (m4_module_dlerror, m4_module_remove, m4_module_close)
5609         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
5610         module_remove, module_close and caller_id.
5611         (MODULE_SELF_NAME): New macro to make reporting self errors
5612         easier.
5613         (m4_module_load, module_close, module_remove): Use it.
5614         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
5615         name.
5616         * src/main.c (main): Use it.
5618 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
5620         * README: Remove references to --enable-changeword, which has been
5621         removed from the code.
5623 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
5625         Getting rid of the annoying bug with configure --enable-debug,
5626         which spewed -e: command not found errors.  This was an interaction
5627         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
5628         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
5629         branch-1-5) to get the full fix.
5631         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
5632         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
5633         and then use the probed value of $SED.
5634         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
5635         this, it messes up the AC_REQUIRE stack.
5637 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
5639         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
5640         the destroy callback.
5641         (m4_arg_destroy): Use the hash address to free the hash node key
5642         field.
5644 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
5646         First cut at formal parameters in macros.
5648         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
5649         * m4/xstrzdup.c: New file.
5650         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
5651         associative array of parameter names to details.
5652         (m4_symbol_token): Capture macro names with parameter lists.
5653         (m4_arg_signature_parse): And build an associative array to hang
5654         from the symbol structure to map names to details.
5655         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
5656         m4_hash_resize idiom.  Now that we potentially add a little hash
5657         table to many of the entries in the symbol table, added an extra
5658         arg to set the initial size.  Changed all callers.
5659         (m4_hash_apply): New function that is basically a generalised
5660         version of...
5661         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
5662         all callers to call m4_hash_apply instead.
5663         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
5664         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
5665         m4_arg_signature association that might be attached to the symbol,
5666         * m4/hash.h (m4_hash_apply_func): Replacement type for...
5667         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
5668         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
5669         parameter lists.
5670         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
5671         (M4_IS_IDENT): Detect characters that can be safely used in
5672         parameter names.
5673         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
5674         * m4/macro.c: Corrected grammar in some comments.  Use `token'
5675         rather than `td' for m4_token variables.
5676         (m4_process_macro): If we find a dollar followed by some
5677         M4_IS_IDENT characters, replace that with the contents of the argv
5678         entry with offset stored in the m4_token_arg associated with the
5679         collected identifier.
5681 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
5683         Begin preparations for supporting formal parameters in m4 macros.
5685         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
5686         the details of a formal parameter.
5687         (m4_token): Add an arg_signature member to hold a hash table for
5688         looking up formal parameters.
5689         * m4/input.c: Update more bitrotted comments.
5690         (m4_push_builtin): Initialise arg_signature member.
5691         (init_builtin_token): Copy arg_signature member.
5692         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
5693         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
5694         replace...
5695         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
5696         (m4_macro_pushdef, m4_macro_define): ...these, And...
5697         (m4_symbol_token): ...wrapped around this new function, which
5698         vastly simplifies the arguments required by the functions it
5699         replaces.
5700         Changed all callers.
5702 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
5704         * m4/macro.c: Format changes.
5706 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
5708         * m4/input.c: Updated various bitrotted comments.
5709         (m4_push_builtin): Just pass the whole m4_token, rather than
5710         extracting all the fields in the caller.  This also allows us to
5711         check the token type for consistency.
5712         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
5713         Renamed to builtin_funcs, builtin_peek, builtin_read,
5714         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
5715         the code.  Changed all callers.
5716         (struct input_block): Similarly renamed u_m member to u_b, and
5717         changed all callers.
5718         (m4_next_token): Use bzero to initialise the data fields.
5719         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
5721 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
5723         These changes were necessary to get m4 to build on my iBook
5724         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
5725         (GCC) 3.1 20020420 (prerelease)":
5727         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
5728         inclusion of module loader headers.
5729         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
5730         * m4/Makefile.am: Ditto.
5731         (libm4_la_LIBADD): Added $(LTLIBINTL).
5732         * m4/utility.c (program_name): Removed declaration in favour of
5733         the one already in error.c!
5734         * m4/m4module.h (program_name): Define to program_invocation_name
5735         when using GNU C library. Use an explicit extern declaration.
5736         (interactive, sync_output, debug_level, hash_table_size)
5737         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
5738         (suppress_warnings, warning_status, nesting_limit, discard_comments)
5739         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
5740         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
5741         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
5742         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
5743         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
5744         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
5745         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
5746         (m4_current_line, m4_current_diversion, m4_output_current_line):
5747         Don't rely on default, use an explicit extern.
5748         * m4/error.h (error, error_at_line, error_print_progname)
5749         (error_message_count, error_one_per_line): Ditto.
5750         * m4/ltdl.c: Update from CVS libtool.
5751         * m4/ltdl.h: Ditto.
5752         * commit: Update from CVS cvs-utils.
5754 2002-11-04  gettextize  <bug-gnu-gettext@gnu.org>
5756         * po/Makefile.in.in: Upgrade to gettext-0.11.5.
5757         * po/boldquot.sed: New file, from gettext-0.11.5.
5758         * po/en@boldquot.header: New file, from gettext-0.11.5.
5759         * po/en@quot.header: New file, from gettext-0.11.5.
5760         * po/insert-header.sin: New file, from gettext-0.11.5.
5761         * po/quot.sed: New file, from gettext-0.11.5.
5762         * po/remove-potcdate.sin: New file, from gettext-0.11.5.
5763         * po/Rules-quot: New file, from gettext-0.11.5.
5765 2002-11-04  Akim Demaille  <akim@epita.fr>
5767         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
5768         running m4 itself.
5769         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
5771 2002-11-04  Akim Demaille  <akim@epita.fr>
5773         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
5775 2002-11-04  Akim Demaille  <akim@epita.fr>
5777         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
5778         used as `external', and Libtool 1.4.3.
5779         (LINGUAS): Remove.
5780         (LTLIBOBJS): Don't play with it.
5781         * intl/: Remove.
5782         * Makefile.am (SUBDIRS): Remove intl.
5783         (ACLOCAL_AMFLAGS): Add -I config.
5784         (EXTRA_DIST): Add config/config.rpath.
5785         * po/LINGUAS: New.
5786         * po/Makevars: New.
5787         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
5789 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
5791         Preparations for refactoring syntax tables to allow reverse
5792         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
5793         speed of normal lookups in an array of unsigned short.
5795         * m4/input.c (single_quotes, single_comments, use_macro_escape):
5796         Moved from here...
5797         * m4/m4private.h (m4__single_quotes, m4__single_comments,
5798         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
5799         is for internal symbols which unavoidably pollute the global
5800         namespace, but are not published APIs.
5801         Adjusted all callers.
5802         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
5803         m4_set_comment, m4_set_syntax, set_syntax_internal,
5804         unset_syntax_attribute): Moved from this file...
5805         * m4/syntax.c: New. ...to this file.
5806         Also added an m4_syntax_exit stub for orthogonality.
5807         * src/main.c (main): Use it.
5808         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
5809         * m4/m4module.h: Reformatting.  New prototypes.
5811 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
5813         * bootstrap (aclocal_apiversion): The aclocal apiversion is
5814         distinct from the automake release number (in that the apiversion
5815         apparently has no micro-version-component).
5816         (aclocal_apilibdir): Use it.
5818 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
5820         * m4/hash.c (m4_hash_resize): New function.
5821         * m4/hash.h: Add prototype.
5822         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
5823         benchmarking to find a good value for, say, autoconf.  This is
5824         already a little quicker than before for me.
5826         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
5827         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
5828         and reenamed.
5829         * m4/hash.h: Adjust prototypes.
5831 2002-01-22  Akim Demaille  <akim@epita.fr>
5833         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
5834         APIVERSION scheme.
5835         * tests/Makefile.am (package.m4): New.
5836         * tests/atlocal.in: Adjust to CVS Autotest.
5837         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
5838         * configure.ac: LIBOBJ is a forbidden string.
5839         Simplify AM_INIT_AUTOMAKE invocation.
5840         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
5841         options.m4.
5843 2002-01-21  gettextize  <bug-gnu-utils@gnu.org>
5845         * po/Makefile.in.in: Upgrade to gettext-0.10.40.
5847 2001-10-19  Akim Demaille  <akim@epita.fr>
5849         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
5851 2001-10-19  Akim Demaille  <akim@epita.fr>
5853         * m4/input.c (m4_next_token): Display where was opened what is
5854         not closed.
5856 2001-10-19  Akim Demaille  <akim@epita.fr>
5858         * m4/macro.c (expand_argument): Display where was opened what is
5859         not closed.
5861 2001-10-18  Akim Demaille  <akim@epita.fr>
5863         * m4/input.c, modules/m4.c: Formatting changes.
5865 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
5867         * bootstrap: s/configure.in/configure.ac/
5869 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
5871         * m4/symtab.c (m4_symbol_destroy): This function calls
5872         m4_symbol_popdef, which recycles a symbols memory when the last
5873         definition is popped.  Since we were passing the address of the
5874         symbol name found in the symbol table, and it was being removed
5875         partway through m4_symbol_destroy() we were referencing freed
5876         memory for the balance of the function.  Now we take a copy of the
5877         symbol name tring and use that as a key into the symbol
5878         table... that way if the original symbol name is freed, the copy
5879         is still valid.
5881 2001-10-13  Akim Demaille  <akim@epita.fr>
5883         * m4/ltdl.c: Update.
5885 2001-10-13  Akim Demaille  <akim@epita.fr>
5887         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
5888         Don't gettextize internal error messages.
5890 2001-10-13  Akim Demaille  <akim@epita.fr>
5892         * tests/macros.at (Arity and defn): New failing test.
5893         (Arity, defn, and freeze): New.
5895         Fix `Arity and defn'.
5897         * m4/input.c (m4_push_macro): Don't forget the arity.
5898         * modules/m4.c (defn): Likewise.
5900 2001-10-13  Akim Demaille  <akim@epita.fr>
5902         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
5903         to...
5904         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
5905         (Propagation of traceon, Propagation of --trace): this new file.
5907 2001-10-13  Akim Demaille  <akim@epita.fr>
5909         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
5910         interface instead of (name, argc...).
5911         Upon failure, specify which argument was guilty.
5912         Adjust callers.
5914 2001-10-13  Akim Demaille  <akim@epita.fr>
5916         * modules/evalparse.c: Save translators' time: don't translate
5917         internal error messages.
5918         (m4_evaluate): Simplify/normalize error messages.
5919         * doc/m4.texinfo (Eval): Adjust.
5921 2001-10-13  Akim Demaille  <akim@epita.fr>
5923         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
5924         where no checking is needed.
5925         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
5926         interface instead of (name, argc...).
5927         Adjust callers.
5928         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
5929         elsewhere.
5931 2001-10-13  Akim Demaille  <akim@epita.fr>
5933         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
5934         exclude the builtin name from the count.
5935         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
5936         calling ifelse with a single argument is valid.
5937         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
5938         with 1 and 2 args, mostly to strengthen the test suite.
5940 2001-10-13  Akim Demaille  <akim@epita.fr>
5942         * m4/output.c (m4_make_diversion, m4_insert_file)
5943         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
5945 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
5947         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
5948         since we call these things builtins in the rest of the code!
5950         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
5952 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
5954         Rather than forcing each builtin definition to manage its own
5955         argument range checking, tabulate the maxima and minima for all
5956         builtins in each module.  This forces us to consider what the
5957         valid ranges for each builtin should be, and moves the checking
5958         code out of each builtin implementation and into the builtin
5959         caller infrastructure.
5961         * m4/m4module.h (struct m4_builtin): Add argument minima and
5962         maxima.
5963         * m4/m4private.h (struct m4_token): Reflect them here too.
5964         * m4/input.c (struct input_block): ...and here.
5965         (m4_token_copy): New function for token copying.
5966         (init_macro_token): Copy them from a token to the input stack.
5967         (m4_next_token): Don't forget to initialise them for text
5968         macros.
5969         * m4/macro.c (expand_argument): Use m4_token_copy, and also
5970         check argument counts before calling the builtin handler.
5971         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
5972         (m4_symbol_macro): Likewise.
5973         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
5974         parameters.  Updated all callers.
5975         (m4_builtin_define): Ditto.
5976         (m4_macro_pushdef, m4_macro_define): Ditto.
5977         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
5978         * modules/evalparse.c:  Declare argument counts for defined
5979         builtins and remove explicit calls to m4_bad_argc().
5980         * modules/gnu.c: Ditto.
5981         * modules/load.c: Ditto.
5982         * modules/m4.c: Ditto.
5983         * modules/modtest.c: Ditto.
5984         * modules/mpeval.c: Ditto.
5985         * modules/perl.c: Ditto.
5986         * modules/shadow.c: Ditto.
5987         * modules/stdlib.c: Ditto.
5988         * modules/time.c: Ditto.
5989         * TODO: Updated.
5991 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
5993         The trace semantics now attach the trace bit to a symbol name.
5994         For as long as a traceon(`foo') is active, calls to foo will be
5995         traced regardless of intervening undefines or module unloads.
5996         Fixed the flag propogation issues differently to the fixes
5997         reverted with the last attempt at nailing down trace:
5999         * m4/m4private.h:  This file is not visible outside of the m4
6000         source tree, so I removed all the `M4_' and `m4_' prefixes to save
6001         on typing.  Updated all clients.
6002         (m4_token): New typedef contains the fields that need to be passed
6003         around with the low level tokeniser.
6004         (m4_token_data):  Removed.
6005         (m4_symbol): Now contains the traced flag again.
6006         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
6007         the trace bit set.  This change is contained entirely within this
6008         module and doesn't leak out into the callers.  Updated all
6009         clients.
6010         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
6011         new fields in m4_token.  Updated all clients.
6012         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
6013         that `groks_macro_args' and `blind_if_no_args' flags are retained
6014         when defn() results are passed around in m4 code.  Updated all
6015         callers.
6016         (m4_builtin_define): Ditto.
6017         (m4_macro_pushdef, m4_macro_define): Ditto.
6018         * m4/input.c (struct input_block): Add a flags field to facilitate
6019         the above.
6020         (m4_push_macro):  ...use it.
6021         (init_macro_token):  Retrieve it.
6022         (m4_next_token): Initialise it.
6023         * m4/macro.c (expand_argument):  Copy it.
6024         * m4/m4module.h: Adjust.
6025         * tests/builtins.at:  Adjust the expected output of the trace
6026         tests to reflect the change in semantics.
6027         * tests/modules.at (modules: trace):  Check that unloading a
6028         module which supplies a traced symbol definition doesn't lose te
6029         trace bit.
6031 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
6033         * modules/gnu.c (m4_macro_table): Display the timetamp when
6034         expanding __m4_version__.
6036         * configure.ac (--with-modules): Forgot a comma in the
6037         AC_HELP_STRING parameter list.
6039 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
6041         * bootstrap: Remove aclocal.m4t when it is no longer required.
6043 2001-10-05  Akim Demaille  <akim@epita.fr>
6045         * tests/Makefile.am: Adjust for gnuprog2.
6046         * tests/m4.in: There can be a leading path.
6047         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
6048         * tests/testsuite.at: Adjust to the most recent Autotest.
6049         (AT_CHECK_M4_FILTER): Fix and rename as...
6050         (AT_TEST_M4): this.
6051         * tests/others.at: Use it.
6053         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
6054         variable in shell scripts, one uses `$'...
6056 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
6058         * configure.ac: `rm -f $m4_getopt_h' was lost.
6060 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
6062         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
6063         time.  Define it for config.h in order to...
6064         * src/main.c (main): ...display the timestamp for --version.
6066 2001-10-04  Akim Demaille  <akim@epita.fr>
6068         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
6069         previous builtins `regexp' and `patsubst'.
6070         (regexp, patsubst): Use them.
6071         (eregexp, epatsubst): New builtins.
6072         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
6073         (Epatsubst and Patsubst, Eregexp and Regexp): these.
6074         (Extensions): More info on REs.
6076 2001-10-04  Akim Demaille  <akim@epita.fr>
6078         * modules/modtest.c (init_handler): Consistently output to stderr.
6079         (finish_handler): New.
6080         (test): The `if' is an `assert'.
6081         * tests/modules.at: Adjust.
6083 2001-10-04  Akim Demaille  <akim@epita.fr>
6085         * m4/utility.c (m4_bad_argc): Detail the mismatches.
6087 2001-10-01  Akim Demaille  <akim@epita.fr>
6089         * tests/generate.awk: Tag the tests with `documentation'.
6090         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
6091         Use the make the existing modtest tests more uniform, and complete
6092         the set of possibilities.
6094 2001-10-01  Akim Demaille  <akim@epita.fr>
6096         * config/gmp.m4: Consult the user before using GMP: use
6097         --without-gmp.
6098         * configure.ac: Adjust.
6099         * modules/gmp.c: No protection needed as the module is not built
6100         if GMP is not used.
6102 2001-10-01  Akim Demaille  <akim@epita.fr>
6104         * tests/generate.awk: Remove debugging code.
6105         (fatal): Specify the current location.
6107         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
6108         * modules/gnu.c, modules/m4.c: Use M4ARG.
6110 2001-10-01  Akim Demaille  <akim@epita.fr>
6112         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
6113         (m4_regexp_compile): New.
6114         (regexp, patsubst): Use it.
6116 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
6118         Reinstate the memory handling improvements from the patch I just
6119         reverted.  Relevant ChangeLog entries repeated here:
6121         * m4/module.c (m4_module_remove): New function that holds the core
6122         of the old m4_module_unload.
6123         (m4_module_unload): Use it.
6124         (m4_module_unload_all): When we know the modules will never be
6125         used again (i.e. on exit), free up as much module memory as
6126         possible.  There are still some artifacts from resident modules
6127         living inside ltdl.c, but everything else is freed.
6128         * m4/debug.c (m4_debug_exit): Free memory allocated in
6129         m4_debug_init().
6130         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
6131         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
6132         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
6133         * m4/m4module.h: Updated prototypes.
6134         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
6135         * m4/hash.h: Updated prototypes.
6136         * src/main.c (main): Use all these new functions to clean up as
6137         much memory as possible before exit.
6139 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
6141         Reverted my large patch for removing the old m4_symbol
6142         structure on 2001-09-20.  We are still not happy about the way
6143         trace works in conjunction with defn and undefine, and leaving
6144         the reverted patch active prevents us from moving the traced
6145         bit from the definition back to the symbol.
6147 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
6149         * configure.in: Moved to...
6150         * configure.ac: ...here.  Added a libtool like timestamped
6151         banner, and tidied up the libltdl cruft.
6152         * config/mkstamp: Script to extract a timestamp from ChangeLog.
6153         * modules/Makefile.am (INCLTDL):  Removed.  This is required
6154         only when libltdl is configured in a subdirectory.
6155         * src/Makefile.am: Ditto.
6156         (LIBADD_DL):  No need to add this again, libtool already knows
6157         that libm4.la depends on it.
6158         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
6159         them.
6161         * TODO: stackovf.c is basically broken.
6162         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
6164 2001-09-28  Akim Demaille  <akim@epita.fr>
6166         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
6168 2001-09-27  Akim Demaille  <akim@epita.fr>
6170         * tests/m4.in: Don't use short options.
6171         Simplify the stderr signature normalization.
6173 2001-09-27  Akim Demaille  <akim@epita.fr>
6175         tests/m4 shall be position independent.
6177         * tests/m4.in: New.
6178         * tests/m4: Remove.
6179         * tests/testsuite.at: No args to AT_INIT.
6180         * configure.in, tests/Makefile.am: Adjust.
6182 2001-09-22  Akim Demaille  <akim@epita.fr>
6184         Autotest has changed again.
6186         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
6187         (package.m4): Remove.
6188         * configure.in: Adjust to LIBADD_GMP.
6190 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
6192         * config/gmp.m4 (AC_ARG_WITH): Removed.
6193         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
6194         (AC_LIB_GMP): When performing a test compile against libgmp,
6195         include the header gmp.h if possible, and link against -lgmp.  If
6196         they both work define USE_GMP.
6197         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
6198         (mpeval_LTX_init_func): Complain on load that there was no libgmp
6199         at compile time.
6201 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
6203         * m4/evalparse.c: Moved to...
6204         * modules/evalparse.c:  ...here.  This code is shared between
6205         modules/mpeval.c and modules/m4.c, so there is no need to pollute
6206         the libm4 API with its details.  Moderately rewritten to interface
6207         into its clients more simply.
6208         * m4/eval.c: Deleted.  Migrated functionality to...
6209         * modules/m4.c: ...here.
6210         (builtin_eval):  Implemented in terms of the new interface style.
6211         * modules/mpeval.c (builtin_mpeval): Ditto.
6212         * m4/m4module.h: Removed references to the former m4/eval.c.
6213         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
6214         (EXTRA_libm4_la_SOURCES): Deleted.
6215         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
6216         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
6218 2001-09-20  Akim Demaille  <akim@epita.fr>
6220         * config/gmp.m4 (AM_WITH_GMP): Rename as...
6221         (AC_LIB_GMP): this.
6222         By default, use gmp.
6223         Massive revamping.
6224         * configure.in: Adjust.
6225         Use Automake conditionals for USE_GMP.
6226         Always compute sizeof (long long int).
6227         This was a bug BTW, as `eval' (not `mpeval') depends on it:
6228         before, it was used _only_ if mpeval was not activated.
6229         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
6230         (mpeval_la_LIBADD): New macros.
6231         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
6232         Indent.
6233         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
6234         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
6235         WITH_GMP.
6237 2001-09-20  Akim Demaille  <akim@epita.fr>
6239         * tests/Makefile.am (package.m4): New.
6240         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
6242 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
6244         More cleanup.  After the last patch, m4_symbol holds nothing but
6245         the head of a chain of m4_token_data.  So I have removed the old
6246         m4_symbol, so that m4_token_data chains are stored directly in the
6247         value cell of a hash table node.  But there's more... m4_symbol
6248         was a more natural name for the symbol value cell, and now that it
6249         is gone I have renamed the former m4_token_data structure to
6250         m4_symbol.  This change turned out to be a pig to get right, since
6251         the original code didn't need to modify the value cell itself,
6252         since changing the chain happened inside the m4_symbol that used
6253         to be returned -- I had to pass the address of the value cell
6254         across various function calls, incase the head value changed.  I
6255         also tightened up the memory management to help me find a nasty
6256         memory corruption bug that took me all night to track down...
6258         * m4/m4private.h (struct m4_symbol): Removed.
6259         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
6260         all references.
6261         * m4/hash.c (m4_hash_iterator_value): Return the address of the
6262         value cell.  Updated all callers.
6263         * m4/symtab.c: Took advantage of the simplification in the data
6264         structures to rewrite a lot of this file more simply.  There is
6265         still some room for optimisation here, but we should tackle that
6266         systematically closer to the release.
6268         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
6269         revealed.  This version is ahead of CVS libtool until I get chance
6270         to flush my changes.
6271         * m4/module.c (m4_module_remove): New function that holds the core
6272         of the old m4_module_unload.
6273         (m4_module_unload): Use it.
6274         (m4_module_unload_all): When we know the modules will never be
6275         used again (i.e. on exit), free up as much module memory as
6276         possible.  There are still some artifacts from resident modules
6277         living inside ltdl.c, but everything else is freed.
6278         * m4/debug.c (m4_debug_exit): Free memory allocated in
6279         m4_debug_init().
6280         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
6281         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
6282         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
6283         * m4/m4module.h: Updated prototypes.
6284         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
6285         * m4/hash.h: Updated prototypes.
6286         * src/main.c (main): Use all these new functions to clean up as
6287         much memory as possible before exit.
6289 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
6291         The `traced' flag needs to be attached to the definition of a
6292         symbol rather than the current symbol containing the definition.
6293         Implementing this showed up some long standing post 1.4 bugs in
6294         flag propogation which I also fixed.
6296         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
6297         (struct m4_token_data): And add it back in here.
6298         * m4/input.c (init_macro_token): Propogate the traced flag
6299         correctly.
6300         * m4/macro.c (expand_argument): Ditto.
6301         * tests/builtins.at (trace2, trace3): New tests based on Akim's
6302         sadistic email ;-)
6304 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
6306         * m4/m4private.h (struct m4_token_data): Simplified by removing
6307         the redundant `traced' flag, and one level of structure nesting.
6308         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
6309         * m4/input.c (init_macro_token): No need to initialise removed
6310         `traced' field.
6311         * m4/macro.c (expand_argument): No need to copy it either.
6312         * m4/utility.c (m4_token_data_func_traced): Or provide an access
6313         function.
6315         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
6316         dependant on multiple symbols with the same key, so preserving
6317         relative symbol order in each bucket during resizing is no longer
6318         required.  The resize function is considerably faster as a result.
6320         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
6321         s/m4_symbol_insert/m4_symbol_define/g;
6322         s/m4_builtin_insert/m4_builtin_define/g;
6323         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
6325 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
6327         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
6328         commits, the m4_lookup_symbol dispatch function is split into
6329         specialised functions that must be called directly.
6331         * m4/m4module.h (m4_symbol_lookup_t): Removed.
6332         * m4/symtab.c (m4_lookup_symbol): Removed.
6333         (m4_symbol_builtin, m4_symbol_macro): New functions.
6334         * m4/builtin.c (m4_builtin_define): Split into...
6335         (m4_builtin_pushdef, m4_builtin_insert): ...these.
6336         (m4_macro_define): Split into...
6337         (m4_macro_pushdef, m4_macro_insert): ...these.
6338         * src/main.c (main): Set command line macros from `-D' parameters
6339         using `m4_macro_define'.
6341 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
6343         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
6344         this from m4_remove_table_reference_symbols().
6345         * m4/m4module.h, m4/module.c: Updated all references.
6347 2001-09-07  Akim Demaille  <akim@epita.fr>
6349         * modules/stdlib.c, modules/times.c: Misc cleanups.
6351 2001-09-07  Akim Demaille  <akim@epita.fr>
6353         * configure.in: We now need Autoconf 2.52e.
6354         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
6355         and `M4_SYMBOL_DELETE'.
6356         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
6357         * src/main.c (main): Adjust.
6359 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
6361         Fix the obstack.h problem once and for all!  At configure time we
6362         can test for a system supplied obstack.h:  depending on the
6363         result, we now generate system.h with an #include of the correct
6364         header.  As a bonus, I've also added a --with-included-obstack,
6365         incase the user doesn't like the system obstack for some
6366         reason... and also we can test the shipped obstack on a system
6367         that has oe of its own.  We also now need to be careful to add
6368         build directories to the include search path, since the generated
6369         system.h will be in the build tree.
6371         * configure.in (AC_CONFIG_FILES): Generate system.h from
6372         system-h.in.
6373         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
6374         include the system obstack header or the copy shipped with M4.
6375         Allow the user to override configure and force the build to use
6376         the shipped version.
6377         * m4/system-h.in: New file, template for...
6378         * m4/system.h: ...this.  Now deleted.
6379         * m4/m4module.h: Include system.h before everything else.
6380         * src/freeze.c: Ditto.
6381         * m4/Makefile.am (dist-hook): Remove generated system.h.
6382         (INCLUDES): Check builddir for generated headers before checking
6383         srcdir.
6384         * modules/Makefile.am (INCLUDES): Ditto.
6385         * src/Makefile.am (INCLUDES): Ditto.
6387 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
6389         * TODO: Remove the items that have been addressed already.
6391 2001-09-05  Akim Demaille  <akim@epita.fr>
6393         * src/main.c (main): Standardize --version.
6395 2001-09-05  Akim Demaille  <akim@epita.fr>
6397         * modules/format.c (format): Have a bigger `str'.
6399 2001-09-05  Akim Demaille  <akim@epita.fr>
6401         Rationalize warnings, reporting the macro name as if it were a
6402         program name, and assertions.
6404         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
6405         (M4WARN): New.
6406         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
6407         (m4_symbol_delete):
6408         Use assert for internal errors.
6409         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
6410         M4WARN.
6411         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
6412         M4WARN and assert.
6413         * tests/builtins.at (pushpop): Adjust.
6415 2001-09-05  Akim Demaille  <akim@epita.fr>
6417         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
6418         with pointers.
6420 2001-09-05  Akim Demaille  <akim@epita.fr>
6422         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
6423         * m4/macro.c, m4/symtab.c: Adjust.
6425 2001-09-05  Akim Demaille  <akim@epita.fr>
6427         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
6428         (m4_symbol_pop, m4_symbol_del): this.
6429         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
6430         (m4_symbol_popdef, m4_symbol_delete): New.
6431         (m4_lookup_symbol): Adjust.
6432         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
6434 2001-09-05  Akim Demaille  <akim@epita.fr>
6436         * m4/m4module.h (m4_symbol_lookup): Rename as...
6437         (m4_symbol_lookup_t): this.
6439 2001-09-05  Akim Demaille  <akim@epita.fr>
6441         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
6442         unused.
6443         * m4/symtab.c (m4_lookup_symbol): Adjust.
6445 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
6447         Bootstrap will now work with Libtool 1.4.1 or higher:
6448         * bootstrap: Remove stale autom4te.cache files when
6449         rebootstrapping.
6450         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
6451         libtool.m4.
6452         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
6453         libtool.m4 directly.
6454         Run libtoolize to refresh ltmain.sh.
6455         * config/ltmain.sh:  Deleted.
6456         * acinclude.m4: Deleted.
6457         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
6459         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
6460         implementation for the cvs impaired libtool user.
6462 2001-09-03  Akim Demaille  <akim@epita.fr>
6464         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
6465         internal errors.
6466         Avoid using `default' in switch, as it hides useful compiler
6467         warnings when a case is forgotten.
6469 2001-09-03  Akim Demaille  <akim@epita.fr>
6471         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
6472         is no such thing as `WITH_MODULES'.
6474 2001-09-03  Akim Demaille  <akim@epita.fr>
6476         Improve the test suite's selfcontainedness.
6478         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
6479         (Include, Undivert): Tag the other input files.
6480         * tests/generate.awk: Catch `@comment file:'.
6481         `-I $src' is no longer needed.
6482         `next' is really like `return': the rest is skipped.
6483         Adjust to `input.m4'.
6484         (fatal): New function.
6485         * tests/foo, tests/incl.m4: Remove.
6487 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
6489         The shadowing mechanism and, infact, the whole symbol table
6490         implementation was creaking under the weight of the features piled
6491         on top of it.  We now have a separate hash table module which will
6492         dynamically resize to keep symbol density withing good performace
6493         limits, and a new symtab module layered above it.  Symbol lookups
6494         are now marginally more efficient (since the shadowed flag is no
6495         longer required) and symbol removal, such as on module unload, is
6496         considerably faster due to a reorganisation of the data structures
6497         used in symtab.c.
6499         * src/main.c (main):  Don't mention `-H'.
6500         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
6501         effect.
6502         * NEWS: Updated.
6503         * m4/hash.c: New generalised dynamic hash table data structure
6504         management module.
6505         * m4/hash.h: Public interface.
6506         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
6507         (libm4_la_SOURCES): Add hash.c.
6508         * m4/symtab.c: More or less rewritten from scratch, within the
6509         bounds of the previous API.
6510         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
6511         call.  Updated all callers.
6512         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
6513         declarations to reflect API changes.
6514         (M4INIT): Generate a declaration too, to avoid the warning with
6515         --enable-debug builds.
6516         (M4FINISH): Ditto.
6517         (HASHMAX): Removed.
6518         * m4/utility.c (hash_table_size):  Removed.
6519         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
6520         names, which are then looked up by builtin_dumpdef() as necessary.
6521         This implies a small speedup in builtin_symbols(), which discarded
6522         all of the symbol info under the old call.
6523         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
6524         shadowing is implicit in respect to the new data structures.
6525         symbol names are no longer duplicated here, they are stored in the
6526         key field of the hash table.
6527         Moved macro_args and blind_no_args...
6528         (m4_token_data): ...to here.
6529         m4/macro.c (expand_macro):  Added a name argument since the symbol
6530         name is no longer copied into each struct m4_symbol.  Modified all
6531         callers.
6532         (collect_arguments):  Ditto.
6533         * modules/m4.c (set_trace): Ditto.
6534         * modules/gnu.c (builtin_symbols): Updated.
6535         * src/freeze.c (produce_symbol_dump): Much improved in light of
6536         the improved symbol table layout.
6538 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
6540         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
6541         to M4_SYMBOL_NEXT.
6542         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
6543         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
6544         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
6545         SYMBOL_HANDLE): Ditto.
6546         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
6547         modules/gnu.c, modules/m4.c, src/freeze.c,
6548         src/main.c:  Updated all references.
6550         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
6551         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
6552         already listed in m4_LDADD... how did that ever used to work?
6553         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
6554         link.
6555         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6556         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
6558         * tests/m4: Don't call the m4 wrapper script with libtool, it
6559         works fine all by itself.
6561 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
6563         The experimental `changeword' feature never took off, and has
6564         no obvious advantages over `changesyntax' to compensate the
6565         enormous speed penalty it carries:
6566         * configure.in (ENABLE_CHANGEWORD): Removed.
6567         * m4/m4module.h (m4_set_word_regexp): Removed.
6568         * m4/m4private.h (m4_token_data): Removed original_text field.
6569         * m4/utility.c (m4_token_data_orig_text): Removed.
6570         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
6571         * m4/macro.c: Ditto.
6572         * src/main.c: Ditto.
6573         * modules/Makefile.am (changeword.la): Removed.
6574         * modules/changeword.c: File removed.
6575         * doc/m4.texinfo: References to changeword and --word-regexp
6576         removed.
6577         * po/POTFILES.in: modules/changeword.c removed.
6578         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
6579         * tests/builtins.at (changeword): Test removed.
6581 2001-08-30  Akim Demaille  <akim@epita.fr>
6583         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
6584         This also help having a single list of m4 files: in
6585         config/Makefile.am.
6586         * config/Makefile.am (STANDARD_MACROS): Rename as...
6587         (ACLOCAL_MACROS): this.
6588         (list-standard-macros): Remove.
6589         (spy): New.
6591 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
6593         In an attempt to moderate my egomania...
6594         * tests/modules.at: Remove attributions.
6596         * tests/generate.awk: When making substitutions to "@&t@", either
6597         "&" or "\&" in the substitution string argument to gsub refer back
6598         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
6599         67 now pass for me.
6601 2001-08-29  Akim Demaille  <akim@epita.fr>
6603         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
6604         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
6605         (sync-lines, trace, translit, undivert, wrap): Move to...
6606         * tests/builtins.at: this new file.
6607         * tests/others.at (Discard comments, import-environment): Move to...
6608         * tests/options.at: this new file.
6610 2001-08-29  Akim Demaille  <akim@epita.fr>
6612         * tests/others.at (Freezing modules)
6613         (--module-directory: absolute path, modpath2, modpath3)
6614         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
6615         * tests/modules.at: here, new file.
6616         * tests/others.at, tests/generate.awk: Add a banner.
6617         * tests/testsuite.at: Adjust.
6618         (AT_CHECK_M4_FILTER): New, but unused.
6620 2001-08-29  Akim Demaille  <akim@epita.fr>
6622         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
6623         handle that.
6624         * tests/others.at (wrap): Inline wrap.m4.
6625         (shadow): Inline shadow.m4.
6626         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
6627         * tests/m4: Simplify.
6629 2001-08-29  Akim Demaille  <akim@epita.fr>
6631         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
6632         --language.
6634 2001-08-29  Akim Demaille  <akim@epita.fr>
6636         * tests/generate.awk (normalize): s/@__@/@&t@/.
6638 2001-08-28  Akim Demaille  <akim@epita.fr>
6640         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
6642 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
6644         * bootstrap (generate.awk): Generate test cases with new script.
6646 2001-08-27  Akim Demaille  <akim@epita.fr>
6648         * tests/Makefile.am (installcheck-local): Don't use
6649         `dc_install_base' which is not visible here, but `exec_prefix'
6650         which is clearly the RT anyway.
6651         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
6652         related to testing a now installed m4.
6653         * tests/m4: Do it here.
6655 2001-08-27  Akim Demaille  <akim@epita.fr>
6657         * tests/others.at (indir): Formatting change.
6659 2001-08-27  Akim Demaille  <akim@epita.fr>
6661         * tests/Makefile.am (installcheck-local): New.
6662         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
6663         the test suite.
6664         Prefer options over envvars.
6665         * src/main.c (main): First bug caught by the test suite (yeah!):
6666         --batch lacked a `break' which resulted in an accidental
6667         invocation of --discard-comments.
6669 2001-08-27  Akim Demaille  <akim@epita.fr>
6671         * tests/others.at (capitalize, changeword, comments, ddivert)
6672         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
6673         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
6674         (sysv-args, trace, translit, undivert): Don't rely on files in
6675         examples/: AT_DATA them.
6677 2001-08-27  Akim Demaille  <akim@epita.fr>
6679         Let the test suite use a wrapper around the not installed m4 to
6680         pretend it is (installed).
6682         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
6683         such a way that m4 does not process them.
6684         * configure.in: The package name seems to be `m4', not `M4'.
6685         * tests/m4: New.
6686         * tests/atlocal.in (at_package, M4): Remove.
6687         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
6689 2001-08-27  Akim Demaille  <akim@epita.fr>
6691         * tests/Makefile.am (CLEANFILES): Remove.
6692         (DISTCLEANFILES, clean-local): New.
6693         * examples/mktests.sh: Remove.
6695 2001-08-27  Akim Demaille  <akim@epita.fr>
6697         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
6698         Don't use aclocal: it's written by hand.
6699         * aclocal.m4: m4_include all the files instead of being built by
6700         aclocal.
6701         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
6702         until it reads the traces by itself.
6703         * configure.in: Require Autoconf 2.42c as we are now using
6704         AC_CONFIG_TESTDIR instead of AT_CONFIG.
6705         Catch unexpanded `jm_' macros.
6706         * config/atconfig.m4: Remove.
6707         * config/error.m4: new.
6708         * config/Makefile.am: Ship the files included by aclocal.m4.
6709         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
6710         (TESTSUITE_AT): this, to please Automake.
6711         (TESTSUITE): This target uses autotest/autotest.m4, not
6712         autotest/general.m4.
6713         * tests/testsuite.at: Prereq Autotest 2.52c.
6714         * examples/Makefile.am (pkgdata_DATA): Rename as...
6715         (dist_pkgdata_DATA): this.
6716         * doc/Makefile.am (man_MANS): Rename as...
6717         (dist_man_mans): this.
6719 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
6721         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
6722         Robert Collins, building on Cygwin no longer requires Windows
6723         import and export symbol decorations.
6724         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
6725         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
6726         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6727         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6728         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6729         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6730         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6731         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6732         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6733         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
6734         anymore.
6735         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
6736         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
6738 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
6740         Ansify the source.  Previously we had a mix, where my code was
6741         in a K&R compatible style, and the preexisting code was in ANSI
6742         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
6743         and now the code base is much cleaner.
6745         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
6746         VOID macro and all users.
6747         * m4/m4module.h:  Ansify function prototypes and headers.
6748         * m4/builtin.c:  Ditto.
6749         * m4/evalparse.c:  Ditto.
6750         * m4/input.c:  Ditto.
6751         * m4/macro.c:  Ditto.
6752         * m4/module.c:  Ditto.
6753         * m4/output.c:  Ditto.
6754         * m4/path.c:  Ditto.
6755         * m4/symtab.c:  Ditto.
6756         * m4/utility.c:  Ditto.
6757         * modules/format.c:  Ditto.
6758         * modules/gnu.c:  Ditto.
6759         * modules/m4.c:  Ditto.
6760         * modules/mpeval.c:  Ditto.
6761         * src/freeze.c:  Ditto.
6762         * src/m4.h:  Ditto.
6763         * src/main.c:  Ditto.
6765 2001-08-20  Akim Demaille  <akim@epita.fr>
6767         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
6768         generated with stock 2.52.
6770 2001-08-20  Akim Demaille  <akim@epita.fr>
6772         * config/atconfig.m4: New, until part of Autoconf per se.
6773         * configure.in (AT_CONFIG): Use it.
6774         Adjust.
6775         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
6776         * tests/atlocal.in: New.
6777         * tests/generate.awk: For the time being, the empty quadrigraph is
6778         `@__@'.
6779         * tests/others.at (changeword, gmp): Check the configuration
6780         variable against `yes'.
6781         * tests/testsuite.at (dnl): Allow it, as it's used all over the
6782         place.
6784 2001-08-20  Akim Demaille  <akim@epita.fr>
6786         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
6787         * modules/m4.c (undivert): Disable the possibility of undiverting
6788         several files at once: it is not documented, it is inconsistent
6789         with the other macros, it can be straightforwardly mocked by
6790         several invocations, and most importantly, it prevents the
6791         possibility of other kinds of extension.
6792         Use `m4_numeric_arg'.
6794 2001-08-20  Akim Demaille  <akim@epita.fr>
6796         * examples/include.m4: Typo.
6797         * tests/generate.awk: Really add it.
6798         * tests/Makefile.am: Adjust.
6799         * tests/others.at (Discard comments): It sure fails without `-c'.
6800         (include, undivert): Add -I examples/.
6802 2001-08-20  Akim Demaille  <akim@epita.fr>
6804         Use sprintf, not ecft and friends since it is standard, portable,
6805         simplifies the code, and since the latter is even deprecated
6806         according to the GNU libc documentation.
6808         * modules/format.c: Drop evct support.
6810 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
6812         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
6813         for `-pipe' here...
6814         * configure.in: ...do it here instead.
6816         * c-boxes.el: Deleted.
6817         * m4/builtin.c: Reformat box comments to be closer to GNU
6818         standards.
6819         * m4/debug.c:  Ditto.
6820         * m4/eval.c:  Ditto.
6821         * m4/evalparse.c:  Ditto.
6822         * m4/input.c:  Ditto.
6823         * m4/m4module.h:  Ditto.
6824         * m4/macro.c:  Ditto.
6825         * m4/output.c:  Ditto.
6826         * m4/symtab.c:  Ditto.
6827         * m4/utility.c:  Ditto.
6828         * modules/changeword.c:  Ditto.
6829         * modules/format.c:  Ditto.
6830         * modules/gnu.c:  Ditto.
6831         * modules/load.c:  Ditto.
6832         * modules/m4.c:  Ditto.
6833         * modules/modtest.c:  Ditto.
6834         * modules/mpeval.c:  Ditto.
6835         * modules/perl.c:  Ditto.
6836         * modules/shadow.c:  Ditto.
6837         * modules/stdlib.c:  Ditto.
6838         * modules/time.c:  Ditto.
6839         * src/freeze.c:  Ditto.
6840         * src/main.c:  Ditto.
6842 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
6844         * m4/module.c: Fixup some errors in the description comment.
6846 2001-08-17  Akim Demaille  <akim@epita.fr>
6848         * tests/others.at (iso8859): Specify the path to the M4 test file.
6849         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
6850         files in error messages.
6852 2001-08-17  Akim Demaille  <akim@epita.fr>
6854         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
6855         * tests/others.at: Adjust input files paths.
6856         * tests/atconfig.in: Set top_builddir.
6857         * tests/Makefile.am: Adjust.
6858         `testsuite' is in src, not build.
6860 2001-08-17  Akim Demaille  <akim@epita.fr>
6862         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
6863         (generate.at): Install a temporary hack until the actual
6864         generate.awk is added to the repository.
6865         * tests/atconfig.in: New.
6867 2001-08-17  Akim Demaille  <akim@epita.fr>
6869         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
6871 2001-08-17  Akim Demaille  <akim@epita.fr>
6873         * doc/m4.texinfo: Promote proper quotation.
6875 2001-08-17  Akim Demaille  <akim@epita.fr>
6877         Remove the non Autotest tests.
6879         * tests/other-tests/capitalize.test,
6880         * tests/other-tests/changeword.test,
6881         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
6882         * tests/other-tests/debug.test,
6883         * tests/other-tests/discard-comments.m4,
6884         * tests/other-tests/discard-comments.test,
6885         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
6886         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
6887         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
6888         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
6889         * tests/other-tests/hanoi.test,
6890         * tests/other-tests/import-environment.m4,
6891         * tests/other-tests/import-environment.test,
6892         * tests/other-tests/include.test, tests/other-tests/indir.test,
6893         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
6894         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
6895         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
6896         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
6897         * tests/other-tests/modtest.test,
6898         * tests/other-tests/multiquotes.test,
6899         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
6900         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
6901         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
6902         * tests/other-tests/sync-lines.m4,
6903         * tests/other-tests/sync-lines.test,
6904         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
6905         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
6906         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
6907         * tests/other-tests/wrap.test: Remove.
6909         * tests/run-test, tests/get-them: Remove.
6910         * tests/Makefile.am: Adjust.
6912 2001-08-17  Akim Demaille  <akim@epita.fr>
6914         others.at no longer depends on other-tests/.
6916         * tests/others.at (stackovf): You're actually...
6917         (sync-lines): this.
6918         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
6919         (unload.test): Keep their authorship.
6920         (discard-comments, gmp, import-environment, modfreeze)
6921         (sync-lines): Embed the input files.
6922         * tests/stackovf.test: Copy from other-tests/stackovf.test.
6923         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
6925 2001-08-17  Akim Demaille  <akim@epita.fr>
6927         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
6928         (M4exit): Tag the exit status of the example.
6929         * tests/get-them: Adjust.
6930         * tests/generate.awk: New, based on get-them.
6931         * tests/Makefile.am: Adjust to generate `generated.at'.
6932         * tests/testsuite.at: Adjust.
6933         (AT_CHECK_M4): Don't overquote.  Blush...
6935 2001-08-17  Akim Demaille  <akim@epita.fr>
6937         Start using Autotest.  atconfig creation is still lacking.
6939         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
6940         * examples/reverse.m4, tests/other-tests/import-environment.m4,
6941         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
6942         * tests/other-tests/import-environment.test: Don't check LANGUAGE
6943         as it might be `unset', or set to `C'.
6944         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
6945         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
6946         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
6947         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
6948         * tests/other-tests/shadow.test: Adjust.
6949         * tests/testsuite.at, tests/others.at: New.
6950         * tests/Makefile.am: Adjust.
6952 2001-08-17  Akim Demaille  <akim@epita.fr>
6954         Drop Autoconf 2.13 compatibility.
6956         * configure.in (changeword): No need to undefine it, as anyway if
6957         it's defined, M4sugar moved it as m4_changeword.
6958         And anyway, proper quotation is enough.
6959         (m4_pattern_allow): As it exists in 2.50, just use it.
6960         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
6961         Don't handle Gettext's duties, let it handle them.
6962         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
6964 2001-08-17  Akim Demaille  <akim@epita.fr>
6966         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
6967         (m4_errprint): Use fputs.
6968         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
6969         dumpdef are not concerned.
6970         (Dumpdef, Errprint): Emphasize their insensitivity to
6971         --error-output.
6972         * doc/Makefile.am: Add `TAGS' support.
6973         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
6974         in `config/' now.
6975         * config/Makefile.am (MAINTAINERCLEANFILES): New.
6977 2001-08-17  Akim Demaille  <akim@epita.fr>
6979         * modules/Makefile.am (ETAGS_ARGS): New.
6981 2001-08-17  Akim Demaille  <akim@epita.fr>
6983         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
6984         changes.
6986 2001-08-17  Akim Demaille  <akim@epita.fr>
6988         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
6990 2001-08-17  Akim Demaille  <akim@epita.fr>
6992         * m4/m4module.h (m4/list.h): Don't include it.
6994 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
6996         m4_modules are no more, we use lt_dlhandles directly and let
6997         latest libltdl features manage the list of loaded modules.
6998         * acinclude.m4: Regenerated.
6999         * m4/ltdl.c: Updated from master copy.
7000         * m4/module.c: Reimplemented to take advantage of advances in
7001         libltdl.
7002         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
7003         list with lt_dlhandle_next.
7004         (m4_builtin_find_by_func): Ditto.
7005         (m4_builtin_table_install): Use lt_dlhandle.
7006         (m4_macro_define): Ditto.
7007         (m4_macro_table_install): Ditto.
7008         m4/module.h: Prototype new module management API.
7009         (m4_modules): No longer required.
7010         (m4_module_init_t, m4_module_finish_t): POSIX namespace
7011         violations, renamed to...
7012         (m4_module_init_func, m4_module_finish_func): ...these,
7013         respectively.
7014         (M4INIT_HANDLER): Clean way to declare init functions in modules.
7015         (M4FINISH_HANDLER):  And similarly for finish functions.
7016         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
7017         -- Add indirection to the CONC macro so that arguments are
7018         correctly expanded.
7019         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
7020         * modules/shadow.c (m4_init_module):  Ditto.
7021         Due to new init function semantics, be careful to perform the
7022         initialisation only on first load.
7023         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
7024         (m4_finish_module): Replaced with M4FINISH_HANDLER.
7025         Due to new finish function semantics, be careful to perform the
7026         finalisation only on first load.
7027         * m4/m4private.h (m4_module): Removed in favour of...
7028         (m4_module_data): ...structure without all the wrapper fields.
7029         Instances of this new structure are stored associated lt_dlhandles
7030         with lt_dlcaller_data_set().
7031         * m4/builtin.c (m4_builtin_define): Takes a handle argument
7032         instead of the old module argument.
7033         (m4_builtin_table_install): Ditto.
7034         * modules/load.c (m4_resident_module):  Removed.  This is no
7035         longer implemented as a magic symbol...
7036         * modules/m4.c (m4_resident_module): Ditto.
7037         * modules/load.c (M4INIT_HANDLER): ...the module init function now
7038         uses the ltdl api to make the module resident.
7039         * modules/m4.c (M4INIT_HANDLER): Ditto.
7040         * modules/load.c (builtin_modules): Traverse the loaded module
7041         list with lt_dlhandle_next.
7042         (builtin_load): Much simplified in light of the reimplemented
7043         module loader.
7044         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
7045         light of the m4/module.c rewrite.
7046         (produce_symbol_dump): Ditto.
7047         (reload_frozen_state): Ditto.
7048         * m4/list.c, m4/list.h: Files deleted.  No longer required.
7049         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
7050         (libm4_la_SOURCES): Delete list.c reference.
7051         * m4/m4private.h (m4_token_data):  Add a handle field.  This
7052         eliminates many of the searches to find the handle associated with
7053         various tokens that are passed between functions.
7054         (struct m4_symbol):  Removed the module field.  The
7055         module association does not belong with the symbol...
7056         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
7057         that the module implementation code is from.  Added a handle
7058         field.
7059         (m4_push_macro): Add a `handle' argument.  Changed all callers.
7060         (init_macro_token):  Set the `handle' field for the
7061         m4_token_data.
7062         * m4/macro.c (expand_argument): Copy the new handle field during
7063         reassignment.
7064         * modules/m4.c (macro_install): Use the new handle field to
7065         optimise the search for the correct builtin structure, and pass
7066         the handle details to m4_builtin_define.
7068 2001-08-15  Akim Demaille  <akim@epita.fr>
7070         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
7071         when creating `m4/obstack.h'.
7072         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
7073         top_builddir.
7074         * tests/defs: Make them absolute.
7075         (CDPATH) Neutralize.
7076         * tests/gethem: Use them.
7078 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
7080         * config/ltmain.sh: Doh!  Import again for a quoting fix that
7081         prevented any regression test from passing.
7083         * m4/m4module.h (obstack.h): Choose between installed version
7084         and shipped version based on configure tests.
7085         * src/freeze.c (obstack.h): Ditto.
7087         * acconfig.h: Removed.  No longer required.
7089         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
7090         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
7091         them to AC_INIT and AM_INIT_AUTOMAKE.
7092         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
7093         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
7094         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
7095         shell variable m4_cv_func_obstack_h.
7096         * tests/defs (M4): Be more careful about relative path to libtool
7097         script and m4 binary by using $srcdir.
7099         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
7100         optargs to the existing libltdl search path.
7101         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
7102         * m4/ltdl.c: Updated.
7103         * m4/ltdl.h: Ditto.
7104         * config/ltmain.sh: Ditto.
7106 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
7108         * src/main.c (main): Add `-b' (for `batch') mode switch to force
7109         interactive mode off.
7111 2001-08-10  Akim Demaille  <akim@epita.fr>
7113         * configure.in: Require Autoconf 2.52.
7114         (AC_ARG_PROGRAM): Remove, handled by Automake.
7115         (m4_getopt): Rename as...
7116         (m4_getopt_h): this.
7117         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
7118         Undefine `changeword' only if defined.
7119         * config/gnu-obstack.m4: Require Autoconf 2.52.
7120         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
7121         Allow this token.
7123 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
7125         * doc/m4.texinfo: Fix some typos, and apply some small
7126         clarifications.
7128 2001-08-09  Andreas Schwab  <schwab@suse.de>
7130         * src/main.c (main): Fix improper uses of error (missing format
7131         string).
7133 2001-08-07  Akim Demaille  <akim@epita.fr>
7135         Improve `make distcheck'.
7137         * configure.in: Be sure to be able to run `mkconfig.sh' when src
7138         != build.
7139         * Makefile.am (dist-hook): Remove, as it is no longer needed.
7140         * doc/m4.texinfo (Include): Add missing blank.
7141         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
7142         obstack.c.
7144 2001-08-07  Akim Demaille  <akim@epita.fr>
7146         * m4/evalparse.c: A better introductory comment.
7147         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
7148         * m4/macro.c: Adjust old comments.
7149         * modules/README: Typo.
7151 2001-08-07  Akim Demaille  <akim@epita.fr>
7153         * config/gnu-obstack.m4: New.
7155 2001-08-07  Akim Demaille  <akim@epita.fr>
7157         * config/Makefile.am, config/stackovf.m4: New.
7158         * configure.in, Makefile.am: Adjust.
7160 2001-08-05  gettextize  <bug-gnu-utils@gnu.org>
7162         * po/Makefile.in.in: Upgrade to gettext-0.10.39.
7163         * po/cat-id-tbl.c: Remove file.
7164         * po/stamp-cat-id: Remove file.
7166 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
7168         * modules/format.c (format):  Formatting for %f was not
7169         interpreting the position of the decimal point correctly for
7170         whole numbers.
7172 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
7174         * TODO:  Removed m4exit bug.
7175         * modules/load.c (m4_resident_module): Make this module resident.
7176         * module/m4.c (m4_resident_module): Ditto.
7177         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
7178         feature to mark modules as resident if they export
7179         `m4_resident_module' as TRUE.
7180         (m4_module_unload): Do not remove resident modules, and take care
7181         with symbol insertion and deletion with resident modules.
7182         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
7183         use resident modules feature.
7185 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
7187         * TODO: Updated.  Removed some cruft that has since been fixed
7188         or implemented.  Added some more entries.
7189         * NEWS: Updated.
7190         * README: Updated.
7191         * modules/README: Updated.
7192         * doc/m4.texinfo: Updated.
7194         * modules/gnu.c (builtin_functions): Make indir orthogonal to
7195         builtin, in that each is recognised as a macro only with parameters
7196         (builtin_indir): Passing 0 arguments is now an error, as with
7197         builtin.
7199         * src/main.c (usage): Added missing description of `-c' option.
7201 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
7203         Consolidate the myriad of dispersed test scripts into the
7204         tests subdirectory.  I think I now have all the file where I
7205         want them, so there shouldn't be anymore upheaval =)O|
7206         Honest!
7207         * tests/Makefile.am: Updated to run the new tests added below.
7208         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
7209         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
7210         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
7211         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
7212         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
7213         tests/other-tests/hanoi.test, tests/other-tests/include.test,
7214         tests/other-tests/indir.test, tests/other-tests/misc.test,
7215         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
7216         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
7217         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
7218         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
7219         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
7220         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
7221         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
7222         tests/other-tests/translit.test, tests/other-tests/undivert.test,
7223         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
7224         tests/other-tests/wrap.test:  New tests based on the contents
7225         of the tests removed below.
7226         * examples/Makefile.am, modules/Makefile.am:  Updated to
7227         reflect removed tests.
7228         * examples/defs,modules/defs: Removed.
7229         * examples/capitalize.test, examples/comments.test,
7230         examples/ddivert.test, examples/debug.test,
7231         examples/esyscmd.test, examples/exp.test,
7232         examples/foreach.test, examples/forloop.test,
7233         examples/fstab.test, examples/hanoi.test,
7234         examples/include.test, examples/indir.test,
7235         examples/misc.test, examples/multiquotes.test,
7236         examples/patsubst.test, examples/pushpop.test,
7237         examples/regexp.test, examples/reverse.test,
7238         examples/sysv-args.test, examples/trace.test,
7239         examples/translit.test, examples/undivert.test,
7240         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
7241         modules/modpath1.test, modules/modpath2.test,
7242         modules/modpath3.test, modules/modpath4.test,
7243         modules/modtest.test, modules/shadow.test,
7244         modules/unfrozen.m4, modules/unload.test: Removed.
7246         Move the implementation of GMP support for the mpeval() builtin
7247         into a loadable module that depends on libgmp.  mpeval() and
7248         eval() share a common parser, now in m4/evalparser.c; the code
7249         in m4/numb.c and m4/numb.h is now physically split between
7250         m4/eval.c (the eval() backend) and modules/mpeval.c (the
7251         mpeval() backend), rather than being differentiated by cpp
7252         macros and multiple inclusion.  The mpeval module is always
7253         built but will generate an diagnostic if it is used from an
7254         installation that didn't link in the gmp library.
7255         * modules/Makefile.am: build and install the new mpeval module.
7256         * modules/mpeval.c: Now contains the former parts of m4/numb.c
7257         and m4/numb.h that are required for gmp support in mpeval().
7258         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
7259         * m4/evalmp.c:  Removed.
7260         * m4/m4module.h: Removed conditional prototype for
7261         m4_mp_evaluate().
7262         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
7263         and m4/numb.h that do not rely on gmp.
7264         * m4/evalparse.c:  New file, contains the shared parts of the
7265         eval() and evalmp() parser implementations, and is no longer
7266         unencumbered by cpp magic to uncover the right parts.
7267         * m4/numb.h:  Removed.  It's former contents are split between
7268         m4/eval.c and modules/mpeval.c.
7269         * m4/numb.c: ditto.
7271         * tests/other-tests/changeword.test: New test.  Rudimentary
7272         testing of changeword builtin runs only if --wnable-changeword
7273         was used at configure time.
7274         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
7275         alternation correctly.  Split into two expressions to compensate.
7276         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
7277         * modules/Makefile.am: Build changeword module.
7278         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
7279         only when --enable-changeword was passed to configure.
7280         (builtin_changeword): If --enable-changeword was not used, then
7281         report that changeword() builtin has no support in m4 binary.
7283 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
7285         * src/main.c (main): Fixed a particularly nasty bug is
7286         user_search_path setting -- the -M flag processing must be
7287         extremely careful with search path ordering, or else the default
7288         installed module directory (possibly containing modules from a
7289         previous release) is placed earlier in the search path than any -M
7290         arguments (which are relied upon to load uninstalled modules with
7291         most of the tests in the regresion suite).
7293         * modules/load.c (builtin_load):  Nasty hack to prevent adding
7294         symbols to symtab again if a module is loaded more than once.
7295         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
7297         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
7298         possible NULL pointer dereference.
7300         * m4/module.c (m4_module_find_by_modname): Renamed from
7301         m4_module_modname_find.   Fixed all references.
7302         (m4_module_find_by_builtin):  New function.
7304         * modules/modfreeze.test: load the `load' module with each
7305         invocation.
7306         * src/freeze.c (produce_frozen_state): Simplified in light of
7307         module field in m4_symbol.  Allow a third argument for text macros
7308         to name the originating module.
7309         (reload_frozen_state): ditto.
7310         * m4/m4module.h:  Fixup prototypes.
7311         * m4/builtin.h (m4_builtin_define): Add a module argument so
7312         that symbols can be registered against the defining module.
7313         (m4_macro_define): ditto.
7314         * m4/m4private.h (m4_symbol): Make the module field const to save
7315         on casting in the rest of the code.
7316         (SYMBOL_MODULE): New macro.
7318         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
7319         symbol reference maintenance bugs when removing a symbol from the
7320         symtab.
7322         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
7324 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
7326         * configure.in (m4_cv_func_obstack): A better check for whether
7327         libc has an obstack implementation.
7328         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
7330         * configure.in (--with-modules): Changed semantics.  This
7331         option is now used to list modules to be preopened.
7332         * src/m4.h: #include "ltdl.h" unconditionally.
7333         * src/main.c: Removed all dependencies on WITH_MODULES.
7334         * src/freeze.c: ditto.
7335         * modules/Makefile.am: ditto.
7336         * m4/m4.c (builtin_m4exit): ditto.
7337         * modules/modpath1.test: ditto.
7338         * modules/modpath2.test: ditto.
7339         * modules/modpath3.test: ditto.
7340         * modules/modpath4.test: ditto.
7341         * modules/modtest.test: ditto.
7342         * modules/shadow.test: ditto.
7343         * modules/unload.test: ditto.
7345         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
7346         comes up on demand in LTLIBOBJS now.
7347         * configure.in (getopt_long):  Creating and relying on a link for
7348         getopt.h on hosts with no getopt_long() of thier own works
7349         correctly now.  This is necessary so that callers of getopt_long()
7350         can simply `#include <getopt.h>': the naive way of doing this
7351         would end up using our own getopt.h and the installed
7352         getopt_long(), which is asking for trouble!
7353         (obstack_init): A similar argument applies to obstack.h and
7354         obstack_init().
7356         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
7357         On Solaris-2.5 (at least) the native dlopen implementation
7358         gets confused about m4.o when looking for module "m4".  This
7359         version always looks for .la an .$lib_ext suffixed names first
7360         to work around the problem.  Sigh.
7362         * po/POTFILES.in: Take account of these file movements.
7363         * src/Makefile.am (m4_SOURCES): removed eval.c.
7364         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
7365         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
7366         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
7367         * modules/m4.c (builtin_eval): Use m4_evaluate().
7368         * m4/eval.c: Moved here from src/eval.c to facilitate
7369         implementation of eval() builtin as part of the `m4' loadable
7370         module.
7371         (m4_evaluate): renamed from evaluate for namespace cleanliness.
7372         * m4/numb.c: Moved here from src/numb.c, since it is #included
7373         into eval.c at compile time.
7374         * m4/m4module.h (m4_evaluate): Added prototype.
7375         * src/m4.h (evaluate): Removed prototype.
7377 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
7379         * modules/perl.c (builtin_perleval):  Use PL_na for
7380         compatibility with perl-5.6.
7382         * src/main.c (main):  It is now safe to
7383         ``m4_module_install("m4")'', without tripping over the m4
7384         binary itself!
7385         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
7386         versions having fixed the insidious module search order bug.
7388         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
7389         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
7391         * configure.in: Figure out whether to use the installed
7392         getopt.h or the supplied one.
7393         * src/Makefile.am: ditto.
7395         * po/POTFILES.in: List files in their new positions.
7397         * config/ltmain.sh:  This needs to be checked in to match the
7398         libtool macros copied to acinclude.m4 (until a released
7399         libtool copes with m4's needs).
7400         * bootstrap:  Run gettextize.
7402 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
7404         * AUTHORS:  Added my details.
7405         * TODO: updated.
7406         * NEWS: updated.
7407         * bootstrap: temporary update until released libtool catches up.
7409         * All files:  Use new GNU GPL copyright blurb with current contact
7410         address.
7412         * configure.in (LTLIBOBJS): Use canonical code for calculation of
7413         this variable.
7415         * config: renamed acm4 directory to config to be more like
7416         other autoconfiscated packages.
7418         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
7419         * config/debug.m4:  New file implementing configure macros to add
7420         suitable debug flags to the compiler invocation.
7422         * modules/load.c:  New file implementing the ``load'' and
7423         ``unload'' builtins.
7424         * tests/get-them:  Set the module search directory to the modules
7425         build directory in generated tests.
7426         * modules/shadow.test: ditto.
7427         * modules/modtest.test: ditto.
7428         * modules/modpath1.test: ditto.
7429         * modules/modpath2.test: ditto.
7430         * modules/modpath3.test: ditto.
7431         * modules/modpath4.test: ditto.
7432         * modules/modtest.test: ditto.
7433         * modules/modfreeze.test: ditto.
7434         * modules/unload.test: ditto.
7436         * modules/changeword.c:  New file implementing the ``changeword''
7437         builtin as a loadable module.
7438         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
7439         as a loadable module.
7441         * src/main.c (main):  Load the gnu module if m4 was started
7442         normally -- i.e. without the -G option.
7443         * modules/gnu.c:  New file implementing a new loadable module wuth
7444         definitions for all the gnu extension builtins.
7445         * modules/format.c:  Moved here from src/format.c.  Now included
7446         directly by gnu.c.
7448         * src/main.c (main):  Load the traditional module if m4 was
7449         started in `no_gnu_extensions' mode.
7450         * modules/traditional.c:  New file implementing the ``unix'' macro,
7451         required when m4 is executed in traditional mode, as a loadable
7452         module.
7454         * src/main.c:  Renamed from m4.c to avoid confusion with
7455         modules/m4.c.
7456         (main):  Always load the m4 module.
7457         * modules/m4.c:  New file implementing a new loadable module with
7458         definitions for all m4 builtins that are not gnu extensions.
7460         * m4/Makefile.am:  Adjusted to take new files below into account.
7461         * m4/m4module.h: Prototypes for exported functions and types moved
7462         to this directory from the src directory.
7463         * m4/m4private.h: Moved here from src/m4private.h to facilitate
7464         the migration of all builtin implementations to loadable modules.
7465         * m4/macro.c: Moved this file here from the src directory,
7466         renaming all exported symbols to use the prefix ``m4_''.
7467         * m4/builtin.c: ditto.
7468         * m4/module.c: ditto.
7469         * m4/symtab.c: ditto.
7470         * m4/debug.c: ditto.
7471         * m4/input.c: ditto.
7472         * m4/output.c: ditto.
7473         * m4/path.c: ditto.
7474         * m4/ltdl.h, m4/ltdl.c: ditto.
7475         * m4/utility.c: Odd functions moved here from files in the src
7476         directory to facilitate builtin migration.
7478 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
7480         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
7481         error message, to make translators' jobs a little easier.
7482         (builtin_builtin): ditto.
7483         (builtin_traceon): ditto.
7484         (builtin_traceoff): ditto.
7485         Reported by Akim Demaille <akim@epita.fr>
7487         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
7488         pkgincludedir instead.
7490         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
7491         it is exported globally.  Fixed all references.
7492         (lquote): ditto.
7493         (bcomm): ditto.
7494         (ecomm): ditto.
7495         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
7496         globally.  Fixed all references.
7497         (DEF_LQUOTE): ditto.
7498         (DEF_BCOMM): ditto.
7499         (DEF_ECOMM): ditto.
7501 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
7503         * NEWS: updated.
7504         * TODO: updated.
7506         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
7507         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
7509         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
7510         Removed `Prev', `Next' and `Up' fields of all @nodes now that
7511         makeinfo calculates them for us, and to make any future
7512         reorganisation easier.
7513         (Frozen files): Document format version 2.
7514         `V' now takes argument `2'.
7515         `F' can take a single argument if symbol and builtin names
7516         are the same, or 3 arguments if the builtin is from a module.
7517         New `S' specification for saving syntax table contents.
7518         New `M' specification for saving loaded module names.
7519         * src/freeze.c: Implement them.
7520         * src/input.c (syntax_code): For interpreting frozen syntax
7521         state.
7523         * examples/Makefile.am:  Add the contents of the WWW directory to
7524         the distribution.
7525         * examples/WWW/Makefile:  ditto,
7526         (%.htm): Compares file contents (not just sizes) to determine
7527         whether a change has occured.
7528         * examples/WWW/_header.htm: Bumped version number.
7529         * examples/WWW: Regenerated content.
7531         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
7532         compilers comes much easier without ansi2knr.
7533         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
7535         * m4/list.c: New generic list container type.
7536         * m4/list.h: Interface to new container type.
7537         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
7538         (libm4_la_SOURCES): compile and link list.c.
7539         * src/builtin.c (builtin_tables): Use list container.
7540         * src/module.c (symtab): ditto.
7541         * src/symtab.c (symtab): ditto.
7543         * m4/system.h: New file for common preprocessor definitions.
7544         * m4/Makefile.am (pkginc_HEADERS): install system.h.
7545         * m4/error.c: Use system.h in place of inline preprocessor.
7546         * m4/error.h: ditto.
7547         * m4/module.c: ditto.
7548         * m4/module.h: ditto.
7549         * m4/xmalloc.c: ditto.
7551         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
7552         compatibility.
7553         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
7555         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
7556         it is exported globally.  Fixed all references.
7557         (builtin): ditto.
7558         (module_init_t): ditto.
7559         (module_finish_t): ditto.
7560         (token_data): ditto.
7561         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
7562         it is exported globally.  Fixed all references.
7563         (SYNTAX_IGNORE): ditto.
7564         (SYNTAX_SPACE): ditto.
7565         (SYNTAX_OPEN): ditto.
7566         (SYNTAX_CLOSE): ditto.
7567         (SYNTAX_COMMA): ditto.
7568         (SYNTAX_DOLLAR): ditto.
7569         (SYNTAX_ACTIVE): ditto.
7570         (SYNTAX_ESCAPE): ditto.
7571         (SYNTAX_ALPHA): ditto.
7572         (SYNTAX_NUM): ditto.
7573         (SYNTAX_ALNUM): ditto.
7574         (SYNTAX_LQUOTE): ditto.
7575         (SYNTAX_RQUOTE): ditto.
7576         (SYNTAX_BCOMM): ditto.
7577         (SYNTAX_ECOMM): ditto.
7578         (SYNTAX_VALUE): ditto.
7579         (SYNTAX_MASKS): ditto.
7580         (IS_OTHER): ditto.
7581         (IS_IGNORE): ditto.
7582         (IS_SPACE): ditto.
7583         (IS_OPEN): ditto.
7584         (IS_CLOSE): ditto.
7585         (IS_COMMA): ditto.
7586         (IS_DOLLAR): ditto.
7587         (IS_ACTIVE): ditto.
7588         (IS_ESCAPE): ditto.
7589         (IS_ALPHA): ditto.
7590         (IS_NUM): ditto.
7591         (IS_ALNUM): ditto.
7592         (IS_LQUOTE): ditto.
7593         (IS_RQUOTE): ditto.
7594         (IS_BCOMM): ditto.
7595         (IS_ECOMM): ditto.
7596         (TOKEN_EOF): ditto.
7597         (TOKEN_NONE): ditto.
7598         (TOKEN_STRING): ditto.
7599         (TOKEN_SPACE): ditto.
7600         (TOKEN_WORD): ditto.
7601         (TOKEN_SIMPLE): ditto.
7602         (TOKEN_MACDEF): ditto.
7604         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
7605         consistency.  Fixed all references.
7606         (STRING): Renamed to `m4_string' for consistency, and because if
7607         is exported globally.  Fixed all references.
7608         (token_type): Renamed to `m4_token_t' for the same reasons.
7609         (token_data_type): Renamed to `m4_token_data_t' for the same
7610         reasons.
7612         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
7613         sizes.
7614         (XMALLOC): ditto.
7615         (XREALLOC): ditto.
7616         (XFREE): Wrapper macro which avoids freeing NULL pointers.
7618         * m4/m4module.h (m4_macro):  New type for module defined user
7619         macros.
7620         * modules/modtest.c (m4_macro_table):  Define module user macros.
7621         * modules/shadow.c (m4_macro_table):  ditto.
7623         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
7624         declared with M4BUILTIN.
7626         * m4/xmalloc.c: Use memset if bzero is not available when
7627         emulating calloc with malloc.
7628         (xcalloc): Fallback to malloc/bzero if calloc is not available.
7629         (xfree): Added for consistency.  Will not try to free NULL
7630         pointers.
7631         * src/m4.c (xfree):  Deleted in favour of the above.
7632         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
7633         linking with libdmalloc.
7634         * m4/xstrdup.c (WITH_DMALLOC): ditto.
7636         * modules/frozen.m4:  New test case.
7637         * modules/unfrozen.m4:  ditto.
7638         * modules/modfreeze.test:  New test.
7639         * modules/unload.test:  ditto.
7640         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
7641         (TESTS): Use them.
7642         * modules/modpath1.test:  Don't try this test if module support is
7643         not compiled in.
7644         * modules/modpath2.test: ditto.
7645         * modules/modpath3.test: ditto.
7646         * modules/modpath4.test: ditto.
7647         * modules/modtest.test: ditto.
7648         * modules/shadow.test: ditto.
7650         * modules/perl.c: New module.
7651         * modules/perl.m4: Example of using it.
7652         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
7654         * src/m4.c (main): Assume interactive mode if STDIN is connected
7655         to a tty.
7656         Changed startup sequence slightly so that syntax is not
7657         initialised from here when loading a frozen file.
7659         * src/builtin.c:  Much improved macro definition style.
7660         * src/m4private.h:  Internal structures for m4_builtin and
7661         m4_macro instances.  These are not exposed to module writers.
7662         * src/module.c (module_modname_find):  Find a module structure
7663         from the its name.
7664         (make_macro_table):  Build an internal macro table from a external
7665         definition.
7666         (make_builtin_table):  Build an internal builtin table from an
7667         external definition.
7669         * src/module.c (module_unload): Be extremely careful to remove
7670         builtins and macros that match the module being unloaded -- no
7671         longer assume that the top element can be removed incase another
7672         odule defines an identical name.
7673         * src/symtab.c (remove_table_reference_symbols): remove all symbol
7674         table entries which refer to a given builtin table.
7675         * src/builtin.c (remove_tables): Use it!
7677 2000-07-13  Thomas Tanner  <tanner@ffii.org>
7679         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
7680         * acm4/modules.m4: deleted
7681         * bootstrap: don't libtoolize libltdl!
7682         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
7683         if set, enable WITH_MODULES and add modules to DLPREOPEN
7684         * examples/misc.test: redirect standard output
7685         * lib/Makefile.am: don't use DLLDFLAGS
7686         * lib/m4module.c: include necessary headers to silence GCC -Wall
7687         * lib/m4regex.c: fixes to silence GCC -Wall
7688         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
7689           build modules conditionally
7690         * modules/shadow.c: define symbol aliases before using them
7691         * modules/test.c: define symbol aliases before using them
7692         * po/de.po: update translation
7693         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
7694         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
7695         LIBLTDL to LIBS.
7696         * src/m4.c: initialize libltdl's preloaded symbols via
7697         LTDL_SET_PRELOADED_SYMBOLS
7698         * src/module.c: libltdl's memory management must be initialized
7699         before calling lt_dlinit!, fix warnings
7701 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
7703         * README:  Caveat about nls not supported by dll architecture on
7704         Windows.
7706         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
7708         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
7709         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
7710         * modules/Makefile.am (LIBS): ditto.
7711         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
7712         $(top_srcdir)/m4 (for only <m4module.h>).
7713         * modules/shadow.test: fixed for VPATH.
7714         * modules/modtest.test: ditto.
7715         * modules/modpath4.test: ditto.
7716         * modules/modpath3.test: ditto.
7717         * modules/modpath2.test: ditto.
7718         * modules/modpath1.test: ditto.
7720         * modules/time.test: Removed due to timezone dependence,
7721         * modules/Makefile.am (TESTS): Removed time.test.
7723         * configure.in: Use $3 of AC_DEFINE so that we can,,,
7724         * acconfig.h: Remove everything except the gettext parameters.
7725         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
7726         AC_DEFINE.
7727         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
7728         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
7729         increment serial number.
7731         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
7732         src dir and immediately after libm4 is built for confidence that
7733         it doesn't rely on the src directory.
7734         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
7735         makeinfo stop the build on cygwin (because they don't work).
7737         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
7739         * m4/m4private.h: ...is not a public header, so moved to src.
7740         Add `#include <config.h>', `#define _COMPILING_M4' and
7741         `#include "m4.h".
7742         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
7743         * src/Makefile.am (noinst_HEADERS): add m4private.h.
7744         * src/builtin.c: `#include "m4private.h"' now takes care of the
7745         above.  Duplicates removed.
7746         * src/debug.c: ditto.
7747         * src/eval.c: ditto.
7748         * src/evalmp.c: ditto.
7749         * src/format.c: ditto.
7750         * src/freeze.c: ditto.
7751         * src/input.c: ditto.
7752         * src/m4.c: ditto.
7753         * src/macro.c: ditto.
7754         * src/module.c: ditto.
7755         * src/numb.h: ditto.
7756         * src/output.c: ditto.
7757         * src/path.c: ditto.
7758         * stackovf.c: ditto.
7759         * symtab.c: ditto.
7761         * po/POTFILES.in: compensate for renaming of lib/*.
7762         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
7763         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
7764         and then in $(top_srcdir)/lib (for eg. "m4private.h").
7765         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
7766         m4/libm4.la.
7767         * m4/m4error.h:  Renamed error.h, for installation to
7768         $prefix/include/m4..
7769         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
7770         * m4/m4regex.h: Renamed regex.h, for same reason.
7771         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
7772         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
7773         * m4/m4regex.c: Renamed regex.c, and fix #includes.
7775         * lib: moved to m4 to easily support header installation to
7776         $prefix/include/m4.
7777         * Makefile.am (SUBDIRS): renamed lib dir to m4.
7778         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
7779         * acm4/regex.m4: Point to m4/regex.c.
7781         * examples/foreach.m4:  Sanitise quoting.
7782         * examples/foreach.test:  New torture test.
7783         From Akim Demaille <akim@epita.fr>
7785 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
7787         * src/ltdl.c: Use access() to abort doomed module load attempts
7788         if module file does not exist.
7790         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
7791         getopt1.o will already be used if appropriate, so I moved getopt.c
7792         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
7794         * modules/modpath1.test: Use correct filename in header line.
7795         * modules/modpath2.test: ditto.
7796         * modules/modpath3.test: ditto.
7797         * modules/modpath4.test: ditto.
7799         Without these changes lt_dlopen("test") attempts to
7800         LoadLibrary("/bin/test") on Windows, which although harmless
7801         generates a spurious error message which spoils most of the tests:
7802         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
7803         (TESTS): s/test.test /modtest.test /
7804         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
7805         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
7806         * modules/modpath1.test: s/test.m4 /modtest.m4 /
7807         * modules/modpath2.test: ditto.
7808         * modules/modpath4.test: ditto.
7809         * modules/modpath3.test: s/-m test /-m modtest /
7810         * modules/shadow.m4: use {un,}loadmodule(`modtest').
7812 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
7814         * src/ltdl.c (find_file): Updated to new version with fixed memory
7815         allocation bug in `next'.
7816         * src/ltdl.h: updated to match.
7818         * modules/Makefile.am:  Cleaned up and reordered.
7820 2000-01-16  René Seindal  <rene@seindal.dk>
7822         * modules/Makefile.am (TESTS): New tests for the module system.
7824         * modules/*.test: New files.
7826         * src/m4.c (main): Added call to module_init().
7827         Treats -M and -m as the arguments -D -U and -t, ie deferred.
7829         * src/m4.h: Added declaration of module_init().
7831         * src/module.c (module_init): No longer static
7833         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
7834         Added to shut up automake about non standard libtool library
7835         names.
7837         * src/module.c: Disabled DEBUG by default.
7839         * modules/README: Changed example from unload.m4 to shadow.m4
7841         * modules/shadow.m4: Renamed from unload.m4
7843         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
7845         * src/m4.c (main): Functionality for -m and -M were reversed.
7846         Fixed.
7848 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
7850         * doc/help2man.pl: updated to version 1.020.
7852         * lib/COPYING.LIB:  updated to version 2.1.
7854         * lib/m4module.h: restructure the M4_SCOPE code to work when
7855         creating a dll which links with libm4.la and both DLL_EXPORT
7856         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
7857         both defined.
7859 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
7861         Merged the following changes from my tree:
7863         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
7865         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
7866         ported to compile shared libs.
7868         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
7869         use `__declspec(dllimport)' when linking libm4.la on win32.
7870         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
7872         * configure.in (M4OBJS): Discover whether we need the shipped
7873         implementation of getopt_long.
7874         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
7875         main binary here, as opposed to the module library in lib/libm4.la.
7877         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
7879         * modules/README: Updated to describe the improved libltdl based
7880         module scheme.
7881         * README (cygwin): Added some compilation notes for building m4
7882         correctly under cygwin.
7883         * TODO: Cleaned out the entries for the module system since they
7884         are now implemented.
7886         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
7887         all instances of __P with M4_PARAMS.
7889         * lib/getdate.h: removed unreferenced file.
7891         * lib/m4private.h: New file to define the private interface to the
7892         token_data struct, which must be shared between m4module.c, and
7893         builtin.c but not exported to modules built from the installed
7894         m4module.h since it's size changes depending on compile time
7895         options.
7897         * src/m4.h: Lots of stuff moved to lib/m4module.h.
7899         * lib/m4module.h: New file to define the interface available when
7900         compiling m4 modules.
7901         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
7902         necessary for module compilation into this new file.
7904         * lib/Makefile.am (include_HEADERS): install headers (renamed to
7905         avoid nameclash with other system headers) necessary for compiling
7906         modules.
7907         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
7908         so that modules can include the (renamed) installed headers and
7909         be guaranteed a matching implementation.
7910         * lib/m4error.h: renamed from error.h.
7911         * lib/m4obstack.h: renamed from obstack.h.
7912         * lib/m4regex.h: renamed from regex.h.
7913         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
7914         implementation, simply include the shipped version
7915         unconditionally, otherwise it is hard for a module to know
7916         whether the m4obstack.h header it is using matches the
7917         implementation it ends up linking against.
7918         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
7919         the same reason.
7921         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
7923         * examples/misc.test: Don't run this test on machines which don't
7924         have a root user in /etc/passwd (e.g. cygwin).
7926         * tests/get-them (/^@example$/): Error messages might have a
7927         ``.exe'' suffix to the program name, or else use the libtool
7928         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
7929         of these cases are now catered for when comparing error messages
7930         in generated tests.
7931         * tests/other-tests/*.test: ditto.
7932         * examples/*.test: ditto.
7934         * tests/defs (M4): use libtool execute mode.
7935         * examples/defs (M4): ditto.
7937         * tests/get-them (END): explicitly close any open file.
7938         (printthem): In a regular expression, '{' is the start of a repeat
7939         count!  Use `[{]' for a literal open brace.
7940         (/^@node /): Don't use substr on a string shorter than the trim
7941         length.
7943         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
7945         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
7946         substituted.
7947         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
7949 2000-01-10  Andreas Schwab  <schwab@suse.de>
7951         * tests/other-tests/gmp.test: Find config.sh in build directory.
7953         * configure.in: Find tests/mkconfig.sh in $srcdir.
7955         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
7956         <signal.h> (for SUS2 compliant systems).
7958         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
7959         HAVE_SIGINFO_H.
7961 2000-01-10  René Seindal  <rene@seindal.dk>
7963         * Prerelease 1.4o.
7965         * TODO, NEWS: Cleaned up and updated.
7967         * src/m4.c (main): New variable exit_status for exit status in
7968         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
7969         file cannot be read instead of EXIT_SUCCESS.
7971         * src/builtin.c (m4_indir): Changed error message to help
7972         translators (from Akim Demaille <demaille@inf.enst.fr>).
7974         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
7975         Cygnus.
7977         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
7978         from glic 2.1.2.
7980         * src/input.c (match_input): Reordering of code, to avoid multiple
7981         calls to push_string_init() from obstack_grow(), which can happen
7982         with some compilers (found and fixed by James Bonfield
7983         <jkb@mrc-lmb.cam.ac.uk>).
7985         * src/stackovf.c: Added prototypes for ultrix.
7986         (setup_stackovf_trap): Added __P to cast.
7987         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
7989 2000-01-09  René Seindal  <rene@seindal.dk>
7991         * doc/m4.texinfo (Changequote): Added comment about changing
7992         quotes when the old quote is a part of the new.
7994         * src/builtin.c (expand_ranges): Added break after trailing dash.
7995         This caused misbehavious on some systems (found and fixed by Akim
7996         Demaille <demaille@inf.enst.fr>).
7998         * AUTHORS: Thomas Tanner included
8000         * acconfig.h: Added entry for ss_sp (see below).
8002         * configure.in (use_stackovf): Added check for stack_t with member
8003         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
8004         <eggert@twinsun.com>).
8006         * doc/m4.texinfo (Frozen files): Added a simpler example for
8007         generating frozen files from several input files.
8009 1999-11-14  Paul Eggert  <eggert@twinsun.com>
8011         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
8012         lib/regex.c, lib/xmalloc.c.
8014 1999-11-10  René Seindal  <rene@seindal.dk>
8016         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
8018         * src/module.c: reindented.
8019         (module_load): return if this is a repeated load of same module.
8020         (module_init): slight change of logic to avoid repeated
8021         initialisation debug messages.
8023         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
8024         in the distribution.
8026         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
8027         automake warnings about missing lib prefix.
8028         (time_la_LDFLAGS): ditto
8029         (stdlib_la_LDFLAGS): ditto
8031 1999-11-10  Paul Eggert  <eggert@twinsun.com>
8033         * src/m4.h: Include error.h, since our macros use error.
8034         * src/m4.c: Don't need to include error.h.
8036 1999-11-09  Paul Eggert  <eggert@twinsun.com>
8038         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
8039         and zero, as Solaris 7 cc does.
8040         (bcopy): Remove macro; no longer needed with new obstack.h.
8042         * src/output.c (freeze_diversions): Don't assume that a
8043         diversion size can fit in `int'.  Check for diversion file
8044         size too large to be printed with `unsigned long'.
8046         * src/Makefile.am (CFLAGS): Omit -Wall.
8048         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
8050         * src/debug.c (trace_format):
8051         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
8053         * src/freeze.c (produce_frozen_state):
8054         Don't assume string lengths fit in int.
8056 1999-10-13  René Seindal  <rene@seindal.dk>
8058         * po/cs.po: Czech translation added.
8060         * po/sv.po: Updated Swedish translation.
8062         * po/ru.po: Updated Russian translation.
8064         * po/pl.po: Updated Polish translation.
8066         * po/el.po: Greek translation added.
8068 1999-10-13  René Seindal  <rene@seindal.dk>
8070         * configure.in (ALL_LINGUAS): Added Greek translation (el).
8071         (ALL_LINGUAS): Added Czech translation (cs).
8073 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
8075         * src/builtin.c: moved module loading functions into...
8076         * src/module.c: entirely new implementation using libltdl.
8077         * po/POTFILES.in: added src/module.c.
8078         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
8079         are modules, not linktime libraries.
8080         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
8081         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
8082         avoidance on exported symbols.
8083         * modules/test.c (m4_macro_table, m4_init_module,
8084         m4_finish_module): ditto.
8085         * modules/time.c (m4_macro_table): ditto.
8087         * modules/time2.m4: new file which requires command line loading
8088         of modules.
8089         * src/m4.c (--load-module): dynamically load named runtime module
8090         into running executable before reading the source.
8091         (--module-directory): prepend a directory to the module search
8092         path.
8093         (module_init()): Do this the first time we load a module instead;
8094         if the module subsystem is broken normal m4 scripts can still run.
8095         * src/m4.h (install_builtin_table): is now exported.
8097 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
8099         * src/module.c: removed.  No longer required.
8100         * po/POTFILES.in: removed src/module.c.
8102         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
8103         the bootstrap script can recreate.
8104         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
8105         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
8106         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
8107         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
8108         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
8109         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
8110         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
8111         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
8113         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
8114         better.
8115         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
8116         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
8117         the installed gettext.m4 file when running aclocal.
8119 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
8121         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
8122         distinguish this from the last prerelease.
8123         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
8124         in its own subdirectory.
8126         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
8127         lib prefix on a module" feature.
8128         (LDFLAGS): Added `-module -avoid-version' flags to build
8129         versionless module libraries.
8130         * src/builtin.c (m4_load_module): use libltdl.
8131         (module_unload_all): use libltdl.
8132         * src/m4.c (module_init): initialise module loading on demand for
8133         better diagnostics, and so that m4 will still work even if
8134         the module code is broken.
8135         * src/m4.h (module_init): removed.  No longer relevant.
8136         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
8137         exported symbols for compatibility with dlpreopening.
8138         * modules/test.c (m4_macro_table, m4_init_module,
8139         m4_finish_module): ditto.
8140         * modules/time.c (m4_macro_table): ditto.
8142         * bootstrap: New file.  Runs all the autoutils in the right order
8143         after a fresh checkout, or a make maintainer-clean.
8145 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
8147         * src/builtin.c (dump_symbols): New function, factoring common
8148         content of m4_dumpdef and m4_symbols.
8149         (m4_dumpdef): Use it.
8150         (m4_symbols): New function, implementing `symbols'.  Use it.
8151         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
8152         file compile with modern makeinfo.
8153         (Symbols): New node, documenting symbols.
8154         (direntry): Modernize.
8156 1998-12-11  René Seindal  <rene@seindal.dk>
8158         * src/builtin.c (predefined_tab): New predefined macros
8159         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
8160         configure time options.
8162 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
8164         * src/module.c (module_try_load): Don't try to be clever and
8165         overwrite argument string.  Instead allocate all constructed
8166         strings locally, since they can have arbitrary lengths.  Make
8167         arguments pointers to const.
8168         (module_search): Simplify due to above change.
8170 1998-11-29  René Seindal  <rene@seindal.dk>
8172         * Prerelease 1.4n.
8174         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
8176         * tests/other-tests/import-environment.{m4,test}: New test.
8178         * tests/other-tests/discard-comments.{m4,test}: New test.
8180         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
8182         * src/m4.c (main): New option -c --discard-comments.
8183         New global variable discard_comments.
8185         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
8186         discarded, ie never returned from next_token().
8187         Added declaration of discard_comments.
8189         * src/input.c (next_token): Now loops until token type is not
8190         TOKEN_NONE.  Comments are now given this type when comments should
8191         be discarded.
8193         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
8194         and mpeval.
8196 1998-11-28  René Seindal  <rene@seindal.dk>
8198         * src/m4.c (main): New option --import-environment (no single
8199         letter option).
8201         * When configured with --with-gmp both the normal (fast) eval()
8202         and the gmp aware mpeval() are defined.  To restore previous
8203         bahaviour use "define(`eval', defn(`mpeval'))".
8205         * tests/other-tests/gmp.m4: Changed to use mpeval().
8207         * src/evalmp.c: New file for compiling eval.c as gmp aware.
8208         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
8210         * src/eval.c: Now includes "numb.c" directly.  Everything in this
8211         file must by static, except evaluate(), which is changed to
8212         mp_evaluate() if USE_GMP in force.
8214         * src/numb.c: Changed to be included by eval.c instead of being
8215         compiled separately.  Everything is declared static.
8217         * src/numb.h: Removed declarations of functions, as numb.c is now
8218         included by eval.c.
8220         * src/builtin.c: Declaration of m4_mpeval() added.
8221         Inserted `mpeval' in builtin table.
8222         (do_eval): New function with common code for m4_eval and m4_mpeval.
8223         (m4_mpeval): New function for gmp version of eval.
8225         * src/m4.h: Declaration of mp_evaluate().
8227         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
8228         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
8230         * src/m4.c (main): m4 --version also shows which options were used
8231         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
8233 1998-11-27  René Seindal  <rene@seindal.dk>
8235         * Error messages now always print program name before input file
8236         name as specified by GNU coding standards.  Reported by Akim
8237         Demaille <demaille@inf.enst.fr>.
8239         * doc/m4.texinfo (Include): Change due to changed error message
8240         format.
8241         (Eval): Do.
8243         * tests/get-them: Minor change to sed script due to changed error
8244         message format.
8246         * src/m4.c (print_program_name): New func used to print program
8247         name, input file and line number in error ().  Used as an
8248         error_print_progname handler.
8249         (reference_error): Removed.
8250         (main): Assigns error_print_progname.
8252         * src/m4.h (M4ERROR): Removed reference_error ().
8254 1998-11-25  René Seindal  <rene@seindal.dk>
8256         * Updated to libtool 1.2b.
8258         * src/builtin.c (install_builtin_table): Added braces to avoid
8259         warning of ambiguous 'else'.
8261         * src/module.c: Inserted search path code from path.c modified to
8262         use new interface.
8263         (module_init): Configured default path used only if M4MODPATH is
8264         not set.
8265         (module_try_load): Now reads libMODULE.la as generated by libtool
8266         for actual module name.
8267         (module_load): Gives better error messages on failure.
8269         * src/m4.h: Added declarations of structures and functions for
8270         generic search path handling.
8272         * src/path.c: Removed all module specific code and introduced new
8273         functions of more generic search path handling.
8275 1998-11-24  René Seindal  <rene@seindal.dk>
8277         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
8278         included gettext, as <libintl.h> might not be found
8279         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
8281 1998-11-22  René Seindal  <rene@seindal.dk>
8283         * src/output.c (insert_diversion): Fixed bug that might cause m4
8284         to read from standard output!  Triggered by input
8285         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
8286         so now 'undivert(0)' does nothing.
8288 1998-11-18  René Seindal  <rene@seindal.dk>
8290         * Prerelease 1.4m.
8292         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
8293         could be changed when compiling a illegal regexp, causing later
8294         use of the regexp to dump core.
8296         * src/module.c (module_load): Changed error message to conform to
8297         standards.
8299         * src/m4.c (usage): Added message about reporting bugs.
8301         * doc/m4.texinfo (Changeword): Corrected a wrong example.
8302         (Changeword): Added note about the type of regexps used.
8304         * ltconfig, ltmain.sh: New files from Libtool 1.2.
8306         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
8307         and AM_PROG_LIBTOOL.
8309         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
8310         with libtool.
8312         * modules/Makefile.am: Changed completely to compile modules using
8313         libtool.  The modules are compiled as shared libraries, and are
8314         renamed when installed.
8316         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
8317         USE_SHL_LOAD to HAVE_SHL_LOAD
8319         * src/builtin.c (shipout_string): Now tests for a NULL string.
8321         * src/module.c: New level of indirection around non-portable
8322         functions to load shared objects.  Intended to encapsulate the non
8323         portable parts better and to reduce the number of #ifdefs in the
8324         code.
8326         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
8327         directory modules/ to the distribution.
8329 1998-11-15  René Seindal  <rene@seindal.dk>
8331         * Prerelease 1.4l.
8333         * modules/stdlib.c: New module `stdlib' defining some standard
8334         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
8335         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
8337         * src/builtin.c (shipout_string): New convenience function for
8338         builtins and modules.
8340         * src/module.c (module_load): Tentative support for
8341         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
8343         * Makefile.am (SUBDIRS): Directory modules added if configured.
8345         * modules/Makefile.am: Now correctly compiles and installs
8346         modules in pkglibexecdir.
8348         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
8349         These two are now initialised by autoconf macros.
8351         * src/path.c (module_env_init): MODULE_PATH is always on the
8352         search path.
8354         * src/Makefile.am: Now generated pathconf.h which defined the
8355         default MODULE_PATH.
8357         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
8358         where modules are installed.
8360         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
8361         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
8362         build and install automatically, and it is prepared for other
8363         interfacec than dlopen().
8365         * src/builtin.c (predefined_tab): Added __m4_version__ for the
8366         current version of GNU m4.  It is a GNU extension.
8368 1998-11-14  René Seindal  <rene@seindal.dk>
8370         * tests/Makefile.am (GENERATED_TESTS): Added new
8371         generated-tests/changesy.8.test
8373         * doc/m4.texinfo (Changesyntax): Documentation for escape
8374         syntax class.
8376         * src/macro.c (expand_token): Check for escaped macro call before
8377         symbol table lookup.
8379         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
8380         characters
8382         * src/input.c: New static variable use_macro_escape, which is TRUE
8383         iff some character has code SYNTAX_ESCAPE
8384         (input_init): Added initialisation of use_macro_escape.
8385         (check_use_macro_escape): New function to synchronise
8386         use_macro_escape with the syntax table.
8387         (set_quotes): Added call to check_use_macro_escape()
8388         (set_comment): Do.
8389         (set_syntax): Do.
8390         (next_token): Added new case for IS_ESCAPE.
8392         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
8394 1998-10-13  René Seindal  <rene@seindal.dk>
8396         * Prerelease 1.4k.
8398         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
8399         generated-tests.
8401         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
8402         maintained tests in tests/other-tests.  These currently tests for
8403         8-bit transparency, multiple precision arithmetic and sync-line
8404         output.  Test for stackoverflow detection does not work.
8406         * examples/Makefile.am (TESTS): Added tests for all example files.
8408         * examples/mktests.sh: New file.  Help program for creating test
8409         files.
8411         * tests/mkconfig.sh: New file to generate tests/config.m4 and
8412         tests/config.sh.  This is for tests of configure selectable
8413         features.  Picks up all set WITH_ and ENABLE_ veriables from
8414         config.h
8416         * src/path.c (path_search): Added argument 'char **expanded_name'
8417         to return the expanded name.
8419         * src/m4.h: Added 2nd argument to declaration of path_search().
8421         * src/m4.c (main): Added 2nd argument to path_search().
8423         * src/freeze.c (reload_frozen_state): Do.
8425         * src/builtin.c (m4_undivert): Do.
8426         (include): Do.
8428 1998-10-11  René Seindal  <rene@seindal.dk>
8430         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
8432         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
8434         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
8436         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
8438         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
8440         * intl/: Updated to GNU gettext 0.10.35.
8442         * doc/m4.texinfo (Format): Documented that format is blind.
8444         * src/builtin.c (builtin_tab): Builtin format marked as blind.
8446 1998-10-07  René Seindal  <rene@seindal.dk>
8448         * Prerelease 1.4j.
8450         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
8451         .test, as the files are no longer just m4 input.
8453         * tests/get-them (FILE): Changed .m4 extension to .test.
8455         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
8456         Otherwise quoted strings with leading whitespace first in a macro
8457         argument would be eliminated.
8459         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
8460         (expand_argument): Do.
8462         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
8463         grouped together iff both quote and comment strings are single
8464         character.  Otherwise they might include a comment/quote leader.
8465         (next_token): Returns new token type TOKEN_SPACE.
8467         * src/builtin.c (push_builtin_table): New function to push a
8468         builtin_table on the stack without installing its contents.
8469         (find_builtin_by_name): Added call to push_builtin_table() if
8470         reading frozen files.  Otherwise the builtins named in the frozen
8471         files could not be found.
8472         (install_builtin_table): Changed to use push_builtin_table()
8474 1998-10-04  René Seindal  <rene@seindal.dk>
8476         * po/pl.po: Polish translation added.
8478         * po/POTFILES.in: src/module.c added.
8480 1998-10-04  René Seindal  <rene@seindal.dk>
8482         * Prerelease 1.4i.
8484         * configure.in (ALL_LINGUAS): Added Polish pl.po
8486 1998-10-03  René Seindal  <rene@seindal.dk>
8488         * Many files: Incorporated changes to implement dynamic modules.
8489         Detailed comments in src/modules.c and modules/README
8491         * src/module.c: New file, implements the OS dependant parts of
8492         dynamic module loading.
8494         * src/Makefile.am (m4_SOURCES): Added module.c
8496         * src/builtin.h: New file, declares some functions from builtin.c
8497         that are of use for other modules (shipout_int, numeric_arg,
8498         skip_space, bad_argc), and the macros ARG() and DECLARE().
8500         * src/builtin.c (install_builtin_table): New function.  Each
8501         module brings in a builtin_table, which is pushed on a stack.
8502         (struct builtin_table): New struct for list of builtin_tables.
8503         (m4_loadmodule): New function to implement builtin "loadmodule".
8504         (shipout_int): No longer static, to be used by modules.
8505         (numeric_arg): do.
8506         (skip_space): do.
8507         (bad_argc): do.
8508         (builtin_init): changed to call install_builtin_table()
8509         (find_builtin_by_name): Now searches all builtin_tables
8510         (find_builtin_by_addr): do.
8512         * src/path.c: Reorganised to allow for two search paths, one for
8513         include files and one for modules.
8515         * src/m4.h: Added declarations for new functions in module.c and
8516         in path.c.
8518         * src/m4.c (main): Added call to module_init().
8520         * modules: New directory with a few demo modules.
8522         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
8523         in SUBDIRS.
8525         * configure.in: Added modules/Makefile to AC_OUTPUT.
8527         * configure.in: Added code to implement --with-modules.  Tests for
8528         <dlfcn.h> and -ldl.
8530         * acconfig.h: Added WITH_MODULES
8532 1998-10-02  René Seindal  <rene@seindal.dk>
8534         * examples/Makefile.am (pkgdata_DATA): Removed special target for
8535         check and variables TESTS.  These tests are now run from the
8536         tests/ directory.
8538         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
8539         directory.  The files stay there but the tests are run from the
8540         tests/ directory.
8542         * tests/Makefile.am (EXTRA_DIST): Added run-test.
8544         * tests/run-test: New file.  Run a test manually
8546         * tests/Makefile.am, tests/get_them: Moved automatically generated
8547         tests (from the manual) to sub directory tests/gentest/.  The
8548         tests/ directory had gotten a bit messy.
8550 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8552         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
8553         wrap}.test: Added a few testcases.
8555 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8557         * Prerelease 1.4h.
8559         * lib/Makefile.am (noinst_HEADERS): regex.h added
8561         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
8562         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
8564         * acm4/Makefile.am: created providing rules to create
8565         $(top_srcdir)/acinclude.m4 to be used by aclocal.
8567         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
8568         `C'. Reported by Ulrich Drepper.
8570         * Makefile.am (SUBDIRS): Removed checks directory
8571         * configure.in (AC_OUTPUT): Removed checks/Makefile
8573         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
8574         the space when m4.texinfo is edited and whitespace.el is active.
8575         (Defn,example): idem.
8577 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8579         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
8580         ../COPYING. ../Makefile is a file which is certainly present when
8581         test is executed in testSubDir. One can't be sure that the COPYING
8582         file is in .. or ../.. in all situations, the ../Makefile is
8583         always there.
8585         * doc/m4.texinfo (Include): adjusted expected test output
8586         according to new tests, i.e. the input will always come from the
8587         file `in' created by the test.
8589         * tests/Makefile.am: Added three lines at the top to get
8590         esyscmd.1.test working.
8592         * tests/get-them: modified to generate clearer tests who will need
8593         less maintenance when new test examples are created in
8594         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
8595         need the generic file `defs') shell scripts creating `in', `ok',
8596         `out' and when apropriate `okerr' and `err' in the directory
8597         `testSubDir' when executed. The compare of `ok' and `out'
8598         (and of `okerr' and `err') will be the exit status of the test.
8599         `out' must match `ok' (and `okerr' must match `err') for the test
8600         to be succesful.
8602         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
8603         the tests generated by tests/get-them getting it input normally
8604         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
8605         (dot) before the numeric part) is reserved for all other (hand
8606         written) tests. The `+' means one or more times.
8608 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8610         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
8611         supported short man page to refer to info documentation
8612         * helptoman.pl: added
8613         * configure.in: AC_PATH_PROG(PERL,perl)
8614         * Makefile.am (SUBDIRS): doc after src
8616         * libitized with libit 0.5 from
8617         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
8619         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
8620         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
8621          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
8622         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
8623           lib/rx.{c,h}: added
8624         * configure.in (AC_CHECK_FUNC): getopt_long
8626         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
8628         * TODO: added entry about dependencies
8630 1998-08-10  René Seindal  <rene@seindal.dk>
8632         * Prerelease 1.4f
8634         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
8635         "changesyntax".
8637         * src/builtin.c (m4_changesyntax): Added builtin macro
8638         "changesyntax" to modify the syntax table.
8640         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
8641         table.  All categories are assigned a syntax code and tokens are
8642         read according to this table.
8644 1998-08-09  René Seindal  <rene@seindal.dk>
8646         * src/numb.{c,h}: New files, implements multiple precision eval
8647         using GNU gmp.  Originally submitted by John Gerard Makecki
8648         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
8650         * doc/m4.texinfo (Eval): Added documentation for multiple
8651         precision arithmetic library support.
8653         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
8654         to accommodate multiple precision eval.
8656 1998-08-07  René Seindal  <rene@seindal.dk>
8658         * src/input.c (MATCH, match_input), src/m4.h: changed definition
8659         of comment and quote strings to `unsigned int' to allow eight bit
8660         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
8662         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
8663         patch from Mike Howard <mike@clove.com>
8665 1998-08-06  René Seindal  <rene@seindal.dk>
8667         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
8668         -lintl.
8670 1998-08-03  René Seindal  <rene@seindal.dk>
8672         * Prerelease 1.4e
8674         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
8675         and _ macro.  M4 now builds with --disable-nls.
8677         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
8678         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
8680         * configure.in (ALL_LINGUAS): Added complete list of translations:
8681         de fr it ja nl ru sv.
8683 1998-05-23  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8685         * po/nl.po: Dutch translation by Erick Branderhorst.
8687         * po/fr.po: French translation by Erick Branderhorst, based on the
8688         translations by François Pinard in fr.msg and m4.cod.
8690 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8692         * Prerelease 1.4d.
8694         * src/m4.c: #include <signal.h> not <sys/signal.h>.
8696         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
8698         * checks/Makefile.am: explicit list tests in CHECKS.
8700         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
8701         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
8702         mkinstalldirs, install-sh: Added automake (1.3) support.
8704         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
8705         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
8706         Used libitize (0.4) to update.
8708         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
8709         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
8710         README accordingly.
8712         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
8713         stack overflow functionality.
8715 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
8717         * Prerelease 1.4.1.
8719         * Makefile.in (realclean-local): Delete stamp-h.in.
8721         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
8722         Localize, adapting from how it is done in sharutils.
8724         * fr.tt: New file, for French.
8726         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
8727         src/freeze.c: Rename PRODUCT to PACKAGE.
8729 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
8731         * configure.in: Check for <libintl.h> and <locale.h>.
8732         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
8733         src/stackovf.c: Rename _ to __P.
8734         * src/m4.h: Declare _ as a macro returning its argument, or else,
8735         include <libintl.h> and declare _ as gettext.
8736         * src/m4.c: Possibly include <locale.h> and call setlocale.
8737         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
8738         src/input.c, src/macro.c, src/output.c, src/path.c,
8739         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
8740         strings.
8742 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
8744         * doc/Makefile.in (stamp-vti): Use new -r option to date.
8746         * configure.in: Put --with-gmp in place, in prevision for John
8747         Gerard's work.
8748         * acconfig.h: Document WITH_GMP.
8750 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
8752         * Release 1.4.
8754         * doc/Makefile.in (realclean): Also remove stamp-vti.
8755         Reported by Eric Backus.
8757 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
8759         * src/freeze.c (produce_frozen_state): If the frozen file cannot
8760         be opened, return immediately after producing the error message.
8761         Reported by Andreas Schwab.
8763         * configure.in: Check for const only after having found possible
8764         ANSIfying compiler flags, this is of no use to check it before.
8765         Reported by Alexander Lehmann.
8767 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
8769         * src/macro.c (collect_arguments): Cast obstack arguments to
8770         (voidstar), so avoiding compiler warnings.
8771         Reported by Joseph E. Sacco.
8773         * src/freeze.c (produce_frozen_state): Cast printed lengths to
8774         (int) so they correspond to %d format items.
8775         Reported by Joseph E. Sacco.
8777         * src/m4.c (main): Cast the argument to xfree to (voidstar).
8778         * src/symtab.c (free_symbol): Idem.
8779         Reported by Karl Vogel.
8781 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
8783         * Makefile.in (DISTFILES): Distribute BACKLOG.
8785         * configure.in: Define PRODUCT and VERSION.
8786         * acconfig.h: Document PRODUCT and VERSION.
8787         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
8788         constant string m4 and variable or parameter named version.
8790 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
8792         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
8793         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
8794         defines __STDC__ to 0, for indicating it is *not* ANSI!
8795         Reported by Kaveh R. Ghazi.
8797         * configure.in: Added obsolescent tests for AIX and Minix.
8799         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
8800         which texclean does not exist anymore.
8801         Reported by Eric Backus, Jim Meyering, John David Anglin and
8802         Joseph E. Sacco.
8804 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
8806         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
8807         Reported by John David Anglin.
8809         * src/ansi2knr.c: New version, sent by Peter Deutsch.
8810         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
8811         ANSI2KNR, depending on the fact the compiler is ANSI or not.
8812         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
8813         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
8814         of $U, put underline in extensions rather than in basenames.  Use
8815         implicit rules, now that regularity makes this possible.
8816         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
8817         of ansi2knr whenever it is needed.
8818         * configure.in: Adjusted for correct STACKOVF substitution.
8819         * src/debug.c (trace_format): When not __STDC__, use (...) as a
8820         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
8821         Reported by David MacKenzie.
8823         * Makefile.in: Remove binprefix.  Use transform_name instead.
8824         Reported by David MacKenzie.
8826         * doc/Makefile.in: Create version.texi, use it, clean it.
8827         Reported by Jim Meyering.
8829 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
8831         * Makefile.in (all, install, uninstall): Depend on Makefile.
8833         * Makefile.in: For actions invoking $(MAKE) from within compound
8834         sh statements, exit non-zero if the sub-make fails.  Otherwise,
8835         the top-level make may exit successfully when it should fail.
8836         Reported by Jim Kingdon.
8838         * {,/*}Makefile.in: Use && after all cd, in case they fail.
8840         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
8841         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
8842         * configure.in: Substitute PRODUCT and VERSION.
8844         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
8846 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
8848         * Makefile.in (mostlyclean-local): Do not remove *~.
8849         * */Makefile.in (mostlyclean): Idem.
8850         Reported by Robert E. Brown and Richard Stallman.
8852 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
8854         * src/m4.h: Get rid of CONFIG_BROKETS.
8856 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
8858         * configure.in: Use AC_ARG_PROGRAM.
8859         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
8860         Reported by David MacKenzie.
8862 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
8864         * configure.in: Do not add -O to CFLAGS for GNU C, now that
8865         configure does it automatically.
8866         Reported by Jim Meyering.
8868 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
8870         * src/stackovf.c: Declare the handler_t typedef earlier in the
8871         code, use it for stackovf_handler.
8872         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
8873         casting sigsegv_handler.
8874         Reported by Robert Bernstein.
8876         * src/m4.c (main): Initialize program_name to argv[0] without
8877         basename'ing it.
8878         Reported by Karl Berry.
8880 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
8882         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
8883         Reported by Karl Berry.
8885 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
8887         * lib/Makefile.in (mostlyclean): Added.
8888         (TAGS): Make in $(srcdir).
8890         * configure.in: Use `choke me' in test, like everywhere!
8892         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
8893         unreacheable and useless.
8895         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
8897         * lib/Makefile.in (DISTFILES): Distribute TAGS.
8898         (distclean): Do not remove TAGS.
8899         (realclean): Remove it.
8900         * Makefile.in: Make TAGS in lib also, not just in src.
8901         Reported by Karl Berry.
8903         * Makefile.in (distclean, realclean): Instead of recursively
8904         calling $(MAKE) for the -local part, allow parallel execution of
8905         -recursive and -local, only delay the removal of config.status,
8906         which is repeated in both goals.
8908 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
8910         * Release 1.3.
8912         * Makefile.in: Group all *clean-recursive goals in one, using sed
8913         to remove `-recursive' while calling make recursively.  Also, use
8914         a subshell for each recursive $(MAKE).
8915         Reported by Jim Meyering.
8917         * src/m4.h (memcpy): Define with bcopy for BSD systems.
8918         Reported by Kaveh R. Ghazi.
8920         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
8921         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
8922         specify it.
8924         * configure.in: Use date instead of touch for stamp-h.
8925         * Makefile.in (stamp-h.in): Idem.
8927         * Makefile.in (distclean, realclean): Force serial execution of
8928         both goals, in case parallel makes are being used.
8929         Reported by Jim Meyering.
8931         * src/Makefile.in (DISTFILES): Distribute TAGS.
8932         (distclean): Do not remove TAGS.
8933         (realclean): Remove it.
8934         Reported by Karl Berry.
8936 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
8938         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
8939         to old names, for following Autoconf.
8941 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
8943         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
8944         ./install.sh will not be correctly referred to in sub-Makefiles.
8945         Reported by John David Anglin.
8947         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
8948         Reported by Eric Backus.
8950         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
8951         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
8952         config.status into remaking this directory's Makefile only.
8953         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
8954         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
8955         Reported by Jim Meyering.
8957 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
8959         * configure.in: Correct stack overflow detection logic, taking
8960         care of systems having only incomplete implementations (like for
8961         Pyramid 9820 OSx 5.0d).
8962         Reported by Kaveh R. Ghazi.
8964         * src/Makefile.in (TAGS): Remote -t from etags call.
8966 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
8968         * lib/Makefile.in (install): Depend on all.
8970 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
8972         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
8973         Reported by Jim Meyering and John David Anglin.
8975         * Makefile.in (distclean-local): Delete config.log.
8976         Reported by Jim Meyering.
8978         Solidify frozen files with respect to -P:
8979         * src/m4.c: Have -P set prefix_all_buitins variable instead of
8980         calling a function by that name.  Declare the variable.
8981         * src/m4.h: Adjust declaration for prefix_all_buitins.
8982         * src/builtin.c (builtin_init): Merge in functionality from
8983         previous prefix_all_buitins function, while making entries in the
8984         symbol table, but not modifying the builtin description itself.
8986         * src/freeze.c (reload_frozen_state): Add a useless `break;',
8987         because *many* compilers do not accept an empty `default:'.
8988         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
8989         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
8991         * configure.in: Use AC_TYPE_SIGNAL.
8992         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
8993         Reported by Robert Bernstein.
8995         * checks/Makefile.in (check): Modify PATH so check-them will find
8996         m4 in the src directory.
8997         * Makefile.in (check): Don't.
8998         Reported by Akiko Matsushita and Jim Meyering.
9000         * src/output.c (make_room_for, output_character_helper): New
9001         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
9002         a per buffer MAXIMUM_BUFFER_SIZE.
9004         * src/output.c (output_text): New function, for optimizing the
9005         output of strings of characters.  Use it.
9007 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
9009         * doc, src: New directories reorganizing the distribution.
9010         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
9011         files.
9012         * Makefile.in: Adjusted.
9013         * configure.in: Configure new Makefiles.
9015         * m4.h: Declare STRING typedef.  Use it for comment and quote
9016         strings, adjusting all references.  (This is the rudiments of a
9017         beginning for the eventual withdrawal of NUL terminated strings.)
9018         * output.c (shipout_text): Accept a length parameter, and use it.
9019         All callers adjusted.
9021 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
9023         * m4.h: Include <unistd.h> if it exists.
9024         * stackovf.c: Don't.
9026         Clean up for current_diversion variable:
9027         * output.c: Move current_diversion from builtin.c.
9028         * m4.h: Declare current_diversion so builtin.c can access it.
9029         * output.c (output_init, make_diversion): Initialize or update
9030         current_diversion.
9031         * builtin.c (builtin_init, m4_divert): Leave current_diversion
9032         alone.
9034         Remove limit on number of diversions:
9035         * output.c: Replace ndiversion by diversions, declare it.
9036         (output_init): Allocate only diversion 0.
9037         (make_diversion): Allocate new diversions as needed.
9038         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
9039         * m4.c: Still accept -N, but do nothing with it.
9040         Reported by David MacKenzie.
9042         Freeze diversions:
9043         * output.c (freeze_diversions): New function.
9044         * m4.h: Declare freeze_diversions.
9045         * freeze.c: Document frozen file format, revise it, call
9046         freeze_diversions to add diversions to frozen format, and code to
9047         reload them properly.
9048         * m4.c: Do not undivert automatically at end when status being
9049         frozen.  Do not call builtin_init when reloading frozen state.
9051         Speed up diversion processing:
9052         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
9053         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
9054         structure and variables, cached variables out of output_diversion,
9055         reallocate_diversion_for and OUTPUT_CHARACTER.
9056         (shipout_text, make_diversion, insert_diversion): Adapted to new
9057         structures.
9058         (insert_file): Use better buffering.
9059         Reported by David MacKenzie.
9061 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
9063         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
9064         dist works from another build directory.
9066 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
9068         * symtab.c (hack_all_symbols): Use hash_table_size instead of
9069         constant HASHMAX, for -H option to work better.
9071         * builtin.c (DECLARE): Simplify by using _ ().
9073         * freeze.c: New file.
9074         * Makefile.in: Compile it, distribute it.
9075         * m4.c: Recognize, document and process --freeze-state (-F) and
9076         --reload-state (-R) options.  Pass a true flag to builtin_init
9077         only if no reloading some state.
9078         * builtin.c (define_builtin): Remove static specifier.
9079         (find_builtin_by_name): Remove static specifier.
9080         (builtin_init): Accept and obey a flag argument.
9081         * m4.h: Add declarations for freeze.c, changes for builtin.c.
9083 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
9085         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
9086         specifier.
9088         * configure.in: Implement --with-dmalloc.
9089         * acconfig.h: Document WITH_DMALLOC.
9090         * m4.h: Add code for when WITH_DMALLOC.
9092 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
9094         * m4.c (long_options): Use "error-output", the dash was missing.
9095         Reported by Akiko Matsushita.
9097 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
9099         * m4.h: Include <sys/types.h>.
9100         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
9101         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
9102         int.
9103         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
9104         as size_t, not int.
9105         * builtin.c (dump_args): Declare len as size_t, not int.
9107         * debug.c: Prototype the forward declaration of debug_set_file.
9109         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
9110         shadowing of this variable.
9111         * output.c (insert_diversion): Idem.
9113         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
9114         (input_init): Duplicate default quote and comment strings.
9115         (set_quotes): Free previous quote strings in all cases.  Duplicate
9116         even default quote strings.
9117         (set_comment): Free previous comment strings in all cases.
9118         Duplicate even default comment strings.
9120         * configure.in: Updated for Autoconf 2.0.
9121         * Makefile.in (distclean-local): Also delete config.cache.
9123         * m4.c (usage): Reorganize the --help output by topic.  Include a
9124         description for debugging flags.
9126 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
9128         * configure.in: If sigaction is available and SA_ONSTACK defined,
9129         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
9130         defined, use sigvec.  Else don't compile stackovf.c.
9131         * stackovf.c (setup_stackovf_trap): Idem.
9132         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
9133         and Simon Leinen.
9135 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
9137         * m4.c (usage): Replace printf par fputs.
9139 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
9141         * Release 1.2
9143 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
9145         * configure.in: Check for sigaction and sigvec.  Add a new delayed
9146         check for RLIMIT_STACK, combine in the checking for getrlimit.
9147         All those things are not universally available.
9148         * stackovf.c: Split setting up the trap handler and catching
9149         signals, for better taking care of various configure outcomes.
9150         * examples/stackovf.sh: Correct a typo.
9151         Reported by Eric Backus, Jim Avera and Jim Meyering.
9153 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
9155         * ansi2knr.c: New version sent by its author, Peter Deutsch.
9157 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
9159         * Makefile.in: Modify so parallel make will not try making
9160         lib/libm4.a twice simultaneously.
9161         Reported by Jim Meyering.
9163 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
9165         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
9166         error message, for when no code possibility exists.  Even if this
9167         line is completely #ifdef'ed out, it brings a syntax error.
9168         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
9170         * Makefile.in (install): Have install depend on all too, for lib
9171         to be remade as needed.
9173         * examples/stackovf.sh: Try ksh, bsh and bash for shells
9174         providing ulimit, instead of using only ksh.
9175         Reported by Jim Avera and Joseph E. Sacco.
9177 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
9179         * Makefile.in (check): Have it depend on all instead of m4.  In
9180         this way, a change in lib will be detected and processed.
9182         * builtin.c (numeric_arg): Use strtol and verify the conversion,
9183         instead of using sscanf which stops as soon as there is a
9184         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
9185         and divert(1xyzzy) were all accepted without any warning or error
9186         messages.
9187         * m4.h: Declare strtol as long if not including stdlib.h.
9188         * configure.in: Check for limits.h, and replace strtol if missing.
9189         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
9190         * lib/strtol.c: New file, from elsewhere.
9191         Reported by Andreas Schwab.
9193 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
9195         * macro.c (expand_macro): Cast value to (boolean) prior to
9196         assigning it to traced.
9197         Reported by Tom McConnell.
9199         * Makefile.in (m4): Always make all in lib first.
9200         Reported by Jim Meyering.
9202 1994-07-06  Jim Avera <jima@netcom.com>
9204         * stackovf.c: Isolated OS-dependent sections; Improved portability,
9205         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
9206         handlers), and a default error message if the fault address is not
9207         available (when neither siginfo.h nor BSD sigcontext are supported).
9208         * configure.in: Changes for stackovf.h: Check for sigcontext,
9209         sigaction, sigstack, and define rlim_t as int if necessary.
9210         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
9211         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
9212         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
9214 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
9216         * configure.in: Use AC_SET_MAKE.
9217         * Makefile.in: Use @SET_MAKE@.
9218         Reported by Jim Meyering.
9220         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
9221         Reported by Ian Taylor.
9223 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
9225         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
9226         because siginfo.h is unrelated to standard headers, and siginfo.h
9227         is already checked for.
9228         Reported by Joseph E. Sacco.
9230         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
9231         PROTOTYPES.
9232         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
9233         AC_PROTOTYPES.
9235 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
9237         * builtin.c (substitute): Use \& to represent this part of the
9238         string which was matched by the whole regexp, instead of
9239         representing the whole string.  Any usage of \0 issues a warning
9240         and acts like \&, it will disappear in some subsequent release.
9242 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
9244         * m4.c: Complete prototype for forwarded declaration of usage.
9246         * input.c (init_macro_token): Correct own reference in error
9247         message.  Previous name get_macro_func was referred to instead.
9248         (next_char):  Correct own reference in error message.  Previous
9249         name advance_input was referred to instead.
9251         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
9252         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
9253         and_term, not_term, logical_not_term, cmp_term, shift_term,
9254         add_term, mult_term, exp_term, unary_term, simple_term): Add
9255         prototype to forwarded declarations.  Declare parameter v1 as
9256         eval_t * instead of int *.  Same for local variable v2 in dyadic
9257         functions.  Same for result in exp_term.
9258         * builtin.c (m4_eval): Declare value as eval_t instead of int.
9259         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
9260         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
9261         (shipout_int): Cast first argument of ntoa to eval_t.
9262         Reported by Thorsten Ohl.
9264         * macro.c: Complete the prototypes of forwarded expand_macro and
9265         expand_token.
9266         Reported by Thorsten Ohl.
9268         * m4.h: Define voidstar as void * or char * depending on __STDC__.
9269         The Ultrix 3.1 compiler cannot do much with void pointers.
9271         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
9272         * m4.c (xfree):  Replace void * by voidstar.
9273         Reported by Tom McConnell.
9275         * ansi2knr.1: New, from elsewhere.
9276         * Makefile.in (DISTFILES): Distribute ansi2knr.1
9278         * Makefile.in (stamp-h.in): Avoid running ./config.status if
9279         stamp-h does not exist yet.  This avoids running it a second time
9280         just after the initial ./configure.
9281         Reported by David MacKenzie and Tom McConnell.
9283         * m4.h: Replace the enum debug_info declaration with a series of
9284         #define's.  The Ultrix 3.1 compiler would otherwise need casting
9285         (int) to most references, when used in expressions.
9286         Reported by Tom McConnell.
9288 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
9290         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
9291         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
9292         calls the compiler.  Previously, FP_PROTOTYPES was only calling
9293         the preprocessor; by not being subject to CFLAGS, this was
9294         discouraging those flags asking for ANSI compilation.
9295         * acconfig.h: Document HAVE_PROTOTYPES.
9296         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
9297         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
9298         Reported by Eric Backus.
9300         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
9301         from the environment.  Default CFLAGS to -g if not set.
9302         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
9303         * lib/Makefile.in: Have CFLAGS substituted from configure.
9304         Reported by Eric Backus and Tom McConnell.
9306         * configure.in: m4_undefine changeword before using AC_ENABLE.
9308         * m4.h: Declare prototypes for error (for ANSI compilers only),
9309         prefix_all_builtins and reference_error.
9310         Reported by Tom McConnell.
9312         * input.c (set_word_regexp): Do not try to initialize the array
9313         test from a string, this does not work with non-ANSI compilers.
9314         Reported by Eric Backus.
9316         * Makefile.in (dist): Clean examples/ before saving it.
9317         (distclean-local): Also remove stamp-h.
9318         Reported by Eric Backus.
9320         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
9321         non ANSI compilers.
9322         Reported by Tom McConnell.
9324         * checks/Makefile.in (clean): Depends on mostlyclean.
9325         (mostlyclean): New goal.
9327 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
9329         * Makefile.in (DISTFILES): Distribute install.sh.
9330         * install.sh: New file, copied from elsewhere.
9331         Reported by Assar Westerlund and Kaveh R. Ghazi.
9333 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
9335         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
9336         * acconfig.h: Explain ENABLE_CHANGEWORD.
9338         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
9339         from code provided by Pete Chown]
9340         * m4.h: Add original_text field to u_t variant of union u.
9341         Declare TOKEN_DATA_FUNC macro.
9342         * builtin.c: Declare changeword.
9343         (m4_changeword): New function.
9344         * input.c: Include "regex.h", define variables with word regexps.
9345         (input_init): Initialize the word regexp.
9346         (set_word_regexp): New.
9347         (next_token): Declare local variables, use the previous code if
9348         default_word_regexp is true.  Else, match using a new code.  Save
9349         the original text.
9350         * macro.c (expand_token): Ship out original text if not a macro
9351         name.
9352         Reported by Krste Asanovic and Pete Chown.
9354         [These modifs all depend upon ENABLE_CHANGEWORD]
9355         * m4.h: Declare external user_word_regexp.
9356         * m4.c: Declare user_word_regexp, and initialize it from
9357         --word-regexp or -W, or NULL if not specified.
9358         * input.c: Use user_word_regexp if specified, instead of
9359         DEFAULT_WORD_REGEXP.
9361         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
9362         agree with it.
9364         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
9365         * checks/Makefile.in: Empty the suffix list.
9366         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
9368         * m4.c: Declare nesting_limit and initialize it to 250.
9369         Implement -LNUMBER or --nesting-limit=NUMBER to change its
9370         value.
9371         * m4.h: Declare nesting_limit as external.
9372         * macro.c (expand_macro): Stop execution whenever nesting limit
9373         is exceeded.
9374         Reported by Bengt Mertensson.
9376         * eval.c (evaluate): Diagnose excess characters in eval input.
9377         Things like `eval(08)' used to return 0 with no diagnostic.
9379         * m4.h: Capitalize first letter of all macro arguments in
9380         definitions.
9382         * m4.c: Declare warning_status, initialize it to 0.  Add new
9383         option -E, or --fatal-warnings, which sets warning_status to
9384         EXIT_FAILURE instead.
9385         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
9386         EXIT_FAILURE if not otherwise done by header files.
9387         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
9388         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
9389         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
9390         argument of all M4ERROR calls.
9391         Reported by Noah Friedman.
9393         * examples/incl-test.m4: Renamed from incl_test.m4.
9394         * examples/include.m4: Include incl-test.m4 instead of
9395         incl_test.m4.
9396         * examples/multiquotes.m4: Renamed from multi-quotes.m.
9398 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
9400         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
9401         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
9402         also tested it on a Sun Sparc workstation running SunOS 4.x.
9404         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
9405         49.format check, abusing a `union values' argument with sprintf
9406         without selecting the proper field.  Now, save the formatting type
9407         first, delaying the fetch of the corresponding argument.
9408         Reported by Joseph E. Sacco and Tom Quinn.
9410         * format.c (format): Remove const from char *fmt declaration when
9411         not HAVE_EFGCVT, because a NUL may be forced into it.
9413         * m4.h: Declare atof() when not STDC_HEADERS.
9414         Reported by Joseph E. Sacco.
9416         * Regenerate configure using Autoconf 1.11, this corrects a
9417         problem about an incorrect cpp seting on NeXT 3.1.
9418         Reported by Alexander Lehmann.
9420 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
9422         * m4.h (_): Change argument from `x' to `Args'.
9424 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
9426         * m4.h: Rename Args() to _().
9427         * m4.h: Remove extern specifier from all function declarations.
9429 1994-04-22  Jim Avera <jima@netcom.com>
9431         * stackovf.c: New file implementing stack-overflow detection.
9432         * configure.in: Check for getrlimit, sigaction.  If all of
9433         standard headers, getrlimit and sigaction, define USE_STACKOVF and
9434         substitute ${U}stackovf.o for STACKOVF.
9435         * acconfig.h: Declare USE_STACKOVF.
9436         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
9437         * m4.h: Declare setup_stackovf_trap().
9438         * m4.c: Call setup_stackovf_trap().
9439         * tests/stackovf_test.sh: New file.
9441 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
9443         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
9445         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
9447 1994-01-30  François Pinard  <pinard@iro.umontreal.ca>
9449         * m4.h: Remove definition of volatile, not used anymore.
9450         Reported by Jim Meyering and Joseph E. Sacco.
9452         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
9453         of `if ... else /* nothing */' for if macros.
9454         Reported by Jim Meyering.
9456         * builtin.c (m4_regexp): Reorganize the code for avoiding a
9457         warning from gcc about `repl' possibly used before defined.
9458         Reported by Jim Meyering.
9460         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
9461         Reported by Jim Meyering.
9463 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
9465         * m4.h: Move the conditional definition of volatile after the
9466         inclusion of system files, because they may define it first.
9468 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
9470         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
9471         get around a problem with Alpha make seeing a syntax error, there.
9472         Reported by Vern Paxson.
9474 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
9476         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
9477         Reported by Richard Stallman.
9479 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
9481         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
9482         instead of AC_HAVE_FUNCS.
9483         Reported by Noah Friedman.
9485 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
9487         * m4.c: Initialize show_help and show_version to zero.
9489         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
9490         Use them in exit() and usage() calls.
9492 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
9494         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
9495         syserr() macro.  Delete errref, add reference_error and M4ERROR.
9496         * m4.c: Replace errref, which was returning an input reference
9497         string, with reference_error, which prints it on standard error.
9498         * builtin.c, output.c: Use errno as second parameter to error,
9499         instead of using syserr() with %s.
9500         * *.c: Use M4ERROR instead of error: no more errref() with %s.
9501         Doing so, the program name appears after the input reference
9502         instead of before, which eases M-x next-error processing.
9504 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
9506         * checks/get-them: Escape braces with backslashes in patterns,
9507         because HPUX-9.01 awk needs this.
9508         Reported by Jim Meyering.
9510 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
9512         * builtin.c: Declare "FILE *popen ();".
9514         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
9515         macros, replace error_message_prefix() declaration by errref()'s.
9516         Declare xrealloc, for use in errref().
9517         * m4.c: Delete error_message_prefix() function, add errref().
9518         * *.c: Use error() systematically in place of all error macros,
9519         now that error() flushes stdout first.  Make needed adjustments.
9521         * m4.h: Remove const in sys_errlist[] declaration, it creates
9522         conflicts on SGI and Alpha.
9523         Reported by Kaveh R. Ghazi.
9525 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
9527         * m4.c: Include <getopt.h> instead of "getopt.h".
9529         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
9530         * acconfig.h: New, for documenting HAVE_EFGCVT.
9531         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
9532         use them wherever appropriate.  Also use -I. for compilations.
9533         * lib/Makefile.in: Use -I.. for compilations.
9534         * *.c: Include <config.h> or "config.h".
9536         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
9537         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
9539 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
9541         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
9543         * input.c (input_init): Initialize quote and comment strings
9544         explicitely instead of calling set_quotes and set_comment: by
9545         doing so, we ensure we do not free uninitialized variables.
9547         * checks/check-them: Reverse arguments to both diff, so the
9548         expected is on the left and the obtained on the right.
9550         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
9551         macros. Delete declarations for m4error, warning, fatal and
9552         internal_error, add declaration for error_message_prefix.
9553         * m4.c:  Delete m4error, warning, fatal and internal_error
9554         routines, add error_message_prefix routine.
9555         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
9556         warning with WARNING*, fatal with FATAL* and internal_error with
9557         INTERNAL_ERROR*.
9558         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
9559         this is not needed anymore.
9561         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
9562         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
9563         and debug_message, add declaration for debug_message_prefix.
9564         * debug.c: Remove static specifier for FILE *debug declaration.
9565         Delete debug_print and debug_message routines, add
9566         debug_message_prefix routine.
9567         * builtin.c, debug.c: Replace debug_print routine calls with
9568         DEBUG_PRINT* macro calls.
9569         * input.c, path.c: Replace debug_message routine calls with
9570         DEBUG_MESSAGE* macro calls.
9572         * m4.h: Remove inclusion of <varargs.h>.
9573         * debug.c: Include <stdarg.h> or <varargs.h>.
9574         (trace_format): Use stdarg instead of varargs if __STDC__.
9576         * configure.in: Remove checks for vfprintf and _doprnt.  These
9577         implementations use varargs tricks which are not portable enough.
9578         * lib/vfprintf.c: Deleted.
9579         * lib/_doprnt.c: Deleted.
9580         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
9581         Reported by Joel Sherrill.
9583         * path.c (add_include_directory): Use xstrdup.
9585         * builtin.c (find_builtin_by_name): Declare static.
9587         * *.[ch]: Add const to a few "char *" declarations.
9589         * configure.in: Remove commented tests for fileno() and fstat().
9590         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
9592         * debug.c (debug_flush_files): New.
9593         * m4.h: Declares it.
9594         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
9595         Reported by Nicolas Pioch.
9597 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
9599         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
9600         Reported by Joel Sherrill.
9602         * builtin.c (prefix_all_builtins): Instead of the table size, use
9603         the null entry at end for stopping the loop.  It was overwritten.
9604         Reported by Andreas Schwab and Jim Meyering.
9606         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
9607         Reported by Kaveh R. Ghazi.
9609         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
9610         Reported by Karl Vogel.
9612 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
9614         * m4.h: Do not define volatile if already defined.
9615         Reported by René Seindal.
9617         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
9619         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
9620         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
9622 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
9624         * m4.h: Define strchr and strrchr in terms of index and rindex,
9625         instead of the other way around.
9626         * builtin.c, m4.c, path.c: Use strchr instead of index.
9628         * input.c (next_char): Remove a "break;" after a "return ...;".
9629         Reported by Tom McConnell.
9631 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
9633         * Release 1.1
9635         * configure.in: Do not copy check files in the build hierarchy.
9636         * checks/check-them: Identify the m4 version being checked.  For
9637         finding m4, look in $PATH instead of in the parent directory.
9638         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
9639         * checks/Makefile.in (.all-stamp): Always create check files in
9640         the source hierarchy, not anymore in the build hierarchy.
9641         (check): cd to the source hierarchy before performing checks.
9642         Do not copy nor clean COPYING anymore, take it from `..'.
9643         Reported by Tom McConnell.
9645         * Makefile.in (Makefile): Use $(SHELL).
9646         (config.status): Use $(SHELL).  Use "config.status --recheck"
9647         instead of "configure --no-create", which is obsolete.
9648         Reported by Tom McConnell.
9650 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
9652         * m4.c (usage): Use "%s" instead of "m4" in format string.
9653         Reported by Jim Meyering.
9655         * Makefile.in: Distribute mkinstalldirs.
9656         Reported by Pierre Gaumond.
9657         Reported by Jim Meyering.
9658         Reported by Tom McConnell.
9659         Reported by Andreas Gustafsson.
9661         * checks/check-them: Renamed from checks/check_them.
9662         * checks/get-them: Renamed from checks/get_them.
9663         * checks/.all-stamp: Renamed from checks/.all_stamp.
9664         * checks/Makefile.in: Changed accordingly.
9665         Reported by Jim Meyering.
9667 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
9669         * lib/Makefile.in (dist): Correct permissions on files.
9671         * output.c: Declare tmpfile, some systems don't.
9673 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
9675         * checks/Makefile.in (dist): Correct permissions on files.
9677         * Makefile.in (dist): Ensure recursive linking for subdirectory
9678         `examples', also set read/write permissions on all its files.
9680         * mkinstalldirs: New, from elsewhere.
9681         * Makefile.in: Use it.
9683         * debug.c: Synchronize debug messages and regular output when
9684         the debug file and stdout are redirected to the same file.
9685         * configure.in: Add (commented) checks for fileno and fstat.
9686         Reported by Jim Avera.
9688         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
9689         etc., arguments, then ignore the superfluous one.  m4 used to
9690         diagnose missing arguments and return the empty string.
9691         Reported by Nick S. Kanakakorn.
9693 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
9695         * m4.c (main): At end of all input, ensure all undiverted text
9696         goes to the main output stream.
9697         Reported by Andreas Gustafsson.
9699         * m4.c (main): exit (0), instead of return 0.
9701         * m4.c: Implement -P and --prefix-builtins.
9702         * builtin.c: Delete const specifier on builtin_tab.
9703         (prefix_all_builtins): New.
9704         Reported by Noah Friedman.
9705         Reported by Scott Bartram.
9707         * c-boxes.el: New, from elsewhere.
9708         * Makefile.in: Distribute it.
9710         * m4.h: Do not define bcopy if <string.h> defines it.
9711         Reported by Stephen Perkins.
9713         * builtin.c (define_macro): Allow a missing second argument, in
9714         which case it is implied empty.  Affects define and pushdef.
9715         Reported by Eric Allman.
9717 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
9719         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
9720         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
9721         * builtin.c: Initialize all the blindness fields in builtin_tab.
9722         (define_builtin): Copy the blindness of a builtin into its symbol.
9723         * macro.c (expand_token): Avoid processing a blind builtin if the
9724         next character is not an opening parenthesis.
9725         Reported by David MacKenzie.
9726         Reported by Noah Friedman.
9728         * configure.in: Ensure an exit status of 0 on completion.
9729         Reported by Vivek P. Singhal.
9731         * eval.c (eval_lex): Admit both lower and upper case letters for
9732         bases greater than 10.  Only lower case letters were accepted.
9734         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
9735         Reported by Krste Asanovic.
9737         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
9738         * eval.c (logical_not_term): New name for not_term.
9739         * eval.c (xor_term): New, between or_term and and_term.
9740         * eval.c (not_term): New, between and_term and logical_not_term.
9741         * eval.c (shift_term): New, between cmp_term and add_term.
9742         Reported by Krste Asanovic: ~, ^, <<, >>.
9743         Reported by Ben A. Mesander: ** vs ^.
9745         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
9746         * m4.h: Delete xrealloc.c.
9747         * lib/xmalloc.c: New, from elsewhere.
9748         * lib/xstrdup.c: New, from elsewhere.
9749         * lib/Makefile.in: Distribute and compile them.
9751         * m4.c: Change progname to program_name.
9752         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
9753         * lib/error.c: New, from elsewhere.
9754         * lib/Makefile.in: Distribute and compile error.c.
9755         * configure.in: Check AC_VPRINTF and for strerror.
9756         * m4.c: Delete cmd_error.  Use error instead.
9757         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
9759         * m4.h: Delete #define const, let Autoconf takes care of this.
9761         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
9762         Merge parse_args into main.  Declare argv to be `char *const *',
9763         then remove superfluous casts.
9765         * m4.c: Rename --no-gnu-extensions to --traditional.
9766         Reported by Ben A. Mesander.
9768         * m4.c (usage): Add a status parameter.  Supply one in various
9769         calls.  Add --help processing.  Remove -V for --version.
9771         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
9773         * lib/Makefile.in: Have an AR=ar declaration.
9774         Reported by Eric Backus.
9775         Reported by Bjorn R. Bjornsson.
9776         Reported by Tom Tromey.
9777         Reported by Kristine Lund.
9778         Reported by Marion Hakanson.
9780 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
9782         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
9783         Reported by Noah Friedman.
9785 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
9787         * Makefile.in: Remove MDEFINES and cleanup.
9789 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
9791         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
9792         Create a gzip file.
9794 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
9796         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
9797         ensure 777 mode for directories, so older tar's will restore file
9798         modes properly.
9800 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
9802         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
9803         so the installer can override automatically configured choices.
9804         Reported by Karl Berry.
9806 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
9808         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
9809         previous version was not working properly on m68k-hp-bsd4.3.
9810         Reported by Roland McGrath.
9812         * lib/_doprnt.c: Stolen from Oleo distribution.
9813         * configure.in: Check for _doprnt.c if vfprintf.c selected.
9814         * lib/Makefile.in: Distribute _doprnt.c.
9815         Do not distribute regex.[ch].old anymore.
9817 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
9819         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
9820         Richard wants it there.
9822 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
9824         * Makefile.in: Add DEFS to MDEFINES.
9825         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
9826         (libm4.a): Remove the library before creating it.
9827         (distclean): Remove tags and TAGS too.
9829 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
9831         * Makefile.in (dvi, m4.dvi): New goals.
9833         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
9834         macro.c, output.c, path.c, symtab.c: Change Copyright from
9835         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
9837         * examples/divert.m4: Deleted, this bug has been corrected.
9839         * Makefile.in (texclean, mostlyclean): New goals.
9841         * Makefile.in (clean): Remove clutter from ansi2knr.
9842         Reported by Pierre Gaumond.
9844 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
9846         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
9847         might well use CFLAGS is s/he needs it.
9849         * Makefile.in: Allow installation of info files from a separate
9850         build directory.
9851         Reported by Jason Merrill.
9852         Reported by David MacKenzie.
9853         Reported by Skip Montanaro.
9854         Reported by Erez Zadok.
9855         Reported by Assar Westerlund.
9857 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
9859         * Release 1.0.3
9860         This is still a beta release for the future GNU m4 version 1.1.
9862         * lib/alloca.c: New, from elsewhere.
9863         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
9865         * m4.h: Do not define index/rindex if already defined.  If
9866         FALSE/TRUE are already defined, do not redefine them, but merely
9867         define boolean typedef to int.
9869         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
9870         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
9871         because some C compilers do not like connectives with #ifdef.
9872         * m4.h: Define `volatile' only if __GNUC__, instead of once for
9873         __GNUC__ and once for __STDC__.
9874         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
9876         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
9877         Makefile dependencies.  Without it, make keeps destroying and
9878         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
9880         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
9881         to diversion/DIVERSION, this was a spelling error.
9883         * m4.c: Declare version[], remove #include "version.h".
9884         * version.h: Deleted.
9885         * Makefile.in: Remove references to version.h.
9887         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
9888         production, by using a simpler and more robust algorithm.  This
9889         solves the problem of synclines sometimes written in the middle of
9890         an output line.  Delete sync_line() and output_lines variable.
9891         * m4.h: Remove sync_line prototype and output_lines declaration.
9892         * input.c (next_char), output.c (shipout_text): Remove references
9893         to output_lines.
9894         * input.c (push_file, pop_file): Merely put the value -1 in
9895         output_current_line instead of calling sync_line, for delaying a
9896         single `#line NUM FILE' before next output line.  Do not test
9897         for sync_output, because this is unnecessary clutter.
9898         * output.c (make_divertion, insert_divertion): Idem.
9899         * input.c: Rename must_advance_line to start_of_input_line, for
9900         consistency.
9902         * debug.c (trace_header): Select a new debug line format, which
9903         better complies with GNU standards for formatting error messages.
9904         With option `-dfl', M-x next-error might be used on the output.
9905         * m4.c (vmesg): Adjust format of error output to GNU standards.
9906         * m4.texinfo: Adjust examples for `make check' to work.
9908         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
9909         case for enum debug_info constants, which were all lower case.
9911         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
9912         re_search_2.
9913         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
9914         collected patches.  I tried a few times using newer regex.[ch], it
9915         mysteriously stopped aborting with this one.  Insecure feeling...
9916         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
9918 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
9920         * m4.c: Change `--no-warnings' to `--silent'.
9921         Reported by David MacKenzie.
9923         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
9924         leave it off for now.  See comment in m4.c for justification.
9925         Reported by David MacKenzie.
9927         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
9928         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
9930         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
9932         * Makefile.in: Ensure recursive cleaning is done before local
9933         cleaning for all clean goals.
9935         * builtin.c (ntoa): Ensure the value is always interpreted as a
9936         signed quantity, whatever the radix is.
9938 1992-11-18  Jim Meyering  <meyering@idefix>
9940         * builtin.c, format.c, input.c: Split long lines.
9941         * m4.c: Use typedef macro_definition instead of struct
9942         macro_definition.
9943         * symtab.c: Use typedef symbol instead of struct symbol.
9945 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
9947         * *.[ch]: Remove all trailing whitespace, in code and comments.
9949         * configure.in: Find some awk.
9950         * Makefile.in: Add $(AWK) to MDEFINES.
9951         * checks/Makefile.in: Transmit $(AWK) to get_them.
9952         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
9953         awk script when switching files, because without this, mawk runs
9954         out of file descriptors.
9956 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
9958         * Makefile.in (realclean): Delete m4.info*.
9959         Reported by Jim Meyering.
9961         * Makefile.in: Adjust and link with checks/Makefile.
9962         * checks/Makefile.in: New.
9963         * configure.in: Output checks/Makefile.
9965         * checks/get_them: Have the dnl header of each test more
9966         recognizable by next-error, also use a better message.
9968 1992-11-16  Jim Meyering  <meyering@idefix>
9970         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
9971         And use that only if __GNUC__ since we're using it's GCC-specific
9972         semantics that tell the compiler the associated function doesn't
9973         return.
9975         * builtin.c (substitute): Don't use character as an array index.
9976         (dumpdef_cmp): Make formal arguments `const void *' to avoid
9977         warnings with gcc -W -Wall on systems with qsort prototype.
9978         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
9979         from gcc -W -Wall.
9981         * eval.c (most functions): Add parentheses to assignments used
9982         as truth values go avoid warnings from gcc -Wall.
9984         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
9985         any functions that don't need external scope.
9987         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
9988         (many functions and arrays): Declare `const'.
9990 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
9992         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
9993         removing the declaration from m4.h.  Also rename false to FALSE
9994         and true to TRUE.
9996         * lib/Makefile.in (Makefile): New goal.
9998         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
9999         so heavily loaded.  It gets more easily overridable, calling make.
10000         Reported by Jim Meyering.
10002         * Makefile.in (dist): Get .fname from the current directory name,
10003         instead of from version.h.  I need updating many files manually,
10004         when the version changes, version.h is just one of them.
10006 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
10008         * m4.h: Remove the tag `boolean' on the enum introducing typedef
10009         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
10010         Reported by Tom McConnell.
10012 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
10014         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
10015         39.cleardiv, which were describing missing or spurious newlines.
10016         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
10017         do not depend on machine word size, `/bin/false' implementation,
10018         or `wc' output format.  `make check' is more dependable, now.
10020         * checks/check_them: Summarize the failed tests by listing their
10021         name, at end.  If none, issue `All checks successful'.  Output
10022         `Checking' instead of `Input file:'.
10024         * checks/get_them, checks/check_them: Reindented.
10026         * Makefile.in (dist): chmod a+r before making the tar file.
10028 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
10030         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
10032         * input.c (next_token): Reinitialize token_buttom just after using
10033         it as a watermark with obstack_free.  Or else, a future token, big
10034         enough for triggering reallocation of the obstack chunk, could
10035         void the initialized value of token_buttom, later causing panic in
10036         obstack_free.  Rename token_buttom to token_bottom everywhere.
10038         * m4.h: Before declaring errno, first include <errno.h> and
10039         ensure that it does not define errno.
10040         Reported by Richard Stallman.
10042 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
10044         * builtin.c: Define and use DECLARE macro for builtins.
10046         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
10047         argument, this is a common idiom for introducing long comments.
10049         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
10050         arguments.  The last argument was silently ignored.
10052         * m4.c (cmd_error): Add a missing semicolon before va_end().
10054 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
10056         * Makefile.in: Now handle protoized sources.  Define and use U.
10057         Compile and use ansi2knr with old compilers.  Update DISTFILES.
10058         Add `aclocal.m4' to `configure' dependencies.
10059         * ansi2knr.c: New, from Ghostscript distribution.
10060         * configure.in: Define U through FP_PROTOTYPES for old compilers.
10061         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
10062         * aclocal.m4: New, provide FP_PROTOTYPES.
10063         * m4.h: Conditionnaly protoized through Args, save for varags.
10064         * builtin.c: Protoized.  Then:
10065         Include <sys/types.h> if size_t is not defined, before "regex.h".
10066         (m4_ifelse): Fetch built-in name properly for diagnostic.
10067         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
10068         (m4_regexp): Add const to `msg' declaration.
10069         (m4_patsubst): Add const to `msg' declaration.
10070         * debug.c: Protoized, save for varargs.
10071         * eval.c: Protoized.
10072         * format.c: Protoized.
10073         * input.c: Protoized.
10074         * m4.c: Protoized, save for varargs.  Then:
10075         (xfree): Accept void * instead of char *.
10076         (xmalloc): Return void * instead of char *.
10077         (xrealloc): Accept and return void * instead of char *.
10078         * macro.c: Protoized.
10079         * output.c: Protoized.
10080         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
10081         * symtab.c: Protoized.
10083 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
10085         * m4.texinfo: Remove directory from diagnostics in 30.include,
10086         51.eval, 56.errprint and 57.m4exit tests.
10088         * m4.h: Remove declarations for int or void system functions, they
10089         cause more conflicting trouble than they make good.
10091         * configure.in: Avoid configuration header file.  Add some tests.
10092         * m4.h: Remove #include "config.h".
10093         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
10094         Then, rewritten for better compliance with GNU standards.
10096 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
10098         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
10099         because of a misplaced #endif.
10101         * Many *.[hc] files: Correct intra-line spacing here and there,
10102         according to GNU indent 1.6 advice.
10104         * configure.in: New, using Autoconf 1.2.
10105         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
10106         * Delete old configure.in, configure, etc/configure.in,
10107         etc/configure, lib/configure.in, lib/configure and config/*.
10108         Reported by Jason Merrill.
10110         * symtab.c (hash): Change (char) NULL to '\0'.
10111         Reported by Jason Merrill.
10113         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
10114         etc/nextvers.sh.  Release numbers will be edited `by hand'.
10115         * version.h: De-automatize, force value in.
10117         * m4.c: Changes in order to use a newer getopt.h.
10118         Reported by David MacKenzie.
10120         * checks/: New name for examples/.
10121         * checks/get_them: New location for etc/get_examples.
10122         * checks/check_them: New location for etc/check_examples.
10123         * Makefile.in, checks/get_them, checks/check_them: Adjust.
10124         * lib/vfprintf.c: New location for etc/vfprintf.c.
10125         * Delete empty etc/.
10126         * examples/: New name for test/.
10128 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
10130         * Makefile.in (check): Add m4 as dependency.
10132         * m4.c: Accept --no-warnings instead of --no_warnings, and
10133         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
10134         usage message more informative.
10135         Reported by David MacKenzie.
10137 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
10139         * etc/check_examples: New name for check_examples.sh.
10140         * etc/get_examples: New name for get_examples.sh.
10141         * Makefile.in, etc/Makefile.in: Use new names.
10143         * Makefile.in: Transmit $(CC) while making in lib.
10145         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
10146         code disposition by hand.
10148 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
10150         * m4.h: Delete definitions for abort() and exit().
10151         Reported by Richard Stallman.
10153         * config/hmake-unicos, config/s-unicos.h: New files.
10154         Reported by Hal Peterson.
10156         * eval.c (exp_term): Have N^0 return 1.
10157         Reported by Michael Fetterman.
10159         * eval.c, input.c, m4.h: Remove last comma in enums.
10160         Reported by Mike Lijewski.
10162         * Transfer of maintenance duties from René to François.
10164 1991-10-24  René Seindal <seindal@diku.dk>
10166         * Release 1.0.  Many thanks to those, who provided me with bug
10167         reports and feedback.
10169         * Uses GNU configure, taken from the gdb distribution.
10171         * Uses GNU getopt(), with long option names.
10173         * The -Q/+quiet option is added, which suppresses warnings about
10174         missing or superflous arguments to built-in macros.
10176         * Added default options via the M4OPTS environment variable.
10178         * The built-in format can now be configured to use sprintf as
10179         the formatting engine, for systems without [efg]cvt(3).
10181         * GNU library code is moved to the ./lib subdirectory; other
10182         utility files are now in ./etc.
10184         * Several minor bugs have been fixed.
10186 1991-07-26  René Seindal <seindal@diku.dk>
10188         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
10189         François Pinard and Roland H. Pesch for providing me with reports.
10191         * The builtins incr and decr are now implemented without use of
10192         eval.
10194         * The builtin indir is added, to allow for indirect macro calls
10195         (allows use of "illegal" macro names).
10197         * The debugging and tracing facilities has been enhanced
10198         considerably.  See the manual for details.
10200         * The -tMACRO option is added, marks MACRO for tracing as soon
10201         as it is defined.
10203         * Builtins are traced after renaming iff they were before.
10205         * Named files can now be undiverted.
10207         * The -Nnum option can be used to increase the number of
10208         divertions available.
10210         * Calling changecom without arguments now disables all comment
10211         handling.
10213         * The function m4_patsubst() is now consistently declared
10214         static.
10216         * A bug in dnl is fixed.
10218         * A bug in the multi-character quoting code is fixed.
10220         * Several typos in the manual has been corrected.  More probably
10221         persist.
10223         * The m4.info file is now installed along with the program.
10225 1990-11-15  René Seindal <seindal@diku.dk>
10227         * Updated and enhanced version.  Release 0.75, manual 0.07.
10229         * Implemented search path for include files (-I option and
10230         M4PATH envronment variable).
10232         * Implemented builtin "format" for printf-like formatting.
10234         * Implemented builtin "regexp" for searching for regular
10235         expressions.
10237         * Implemented builtin "patsubst" for substitution with regular
10238         expressions.
10240         * Implemented builtin "esyscmd", which expands to a shell
10241         commands output.
10243         * Implemented "__file__" and "__line__" for use in error
10244         messages.
10246         * Implemented character ranges in "translit".
10248         * Implemented control over debugging output.
10250         * Implemented multi-character quotes.
10252         * Implemented multi-character comment delimiters.
10254         * Changed predefined macro "gnu" to "__gnu__".
10256         * Changed predefined macro "unix" to "__unix__", when the -G
10257         option is not used.  With -G, "unix" is still defined.
10259         * Changed "shift", "$@" and "$*" to not insert spaces afters
10260         commas.
10262         * Added program name to error messages.
10264         * Fixed two missing null bytes bugs.
10266 1990-01-22  René Seindal <seindal@diku.dk>
10268         * Initial beta release.  Release 0.50, manual 0.05.
10271         -----
10273         $Revision$ $Date$
10275         Local Variables:
10276         coding: utf-8
10277         End:
10279         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
10280         2005, 2006, 2007, 2008 Free Software Foundation, Inc.
10282         Copying and distribution of this file, with or without
10283         modification, are permitted provided the copyright notice
10284         and this notice are preserved.