Fix regression in argument collection, from 2008-01-21.
[m4/ericb.git] / ChangeLog
blobabec593751d9333da338da939aafebd7d8d95a53
1 2008-02-22  Gary V. Vaughan  <gary@gnu.org>
3         Fix regression in argument collection, from 2008-01-21.
4         * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
5         undo argument collection optimisation for strings, so that
6         m4_print_token doesn't abort when it otherwise receives an
7         unprintable M4_SYMBOL_VOID type token.
9 2008-02-20  Eric Blake  <ebb9@byu.net>
11         Stage 16: cache quotes and improve m4_arg_print.
12         Cache rather than always copying quotes when pushing $@ refs; in
13         particular, reconstruct single-byte quotes on the fly.  Allow NUL
14         through m4wrap.  Improve sharing of code that prints arguments.
15         Memory impact: slight improvement, due to cached quotes.
16         Speed impact: slight improvement, due to less copying.
17         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
18         (m4_arg_print): Adjust prototypes.
19         (m4_dump_args): Delete.
20         (m4_push_wrapup): Split...
21         (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
22         prototypes.
23         * m4/m4private.h (struct m4_syntax_table): Add cached_quote
24         member.
25         (m4__quote_cache, m4__quote_uncache): New prototypes.
26         * m4/syntax.c (m4_syntax_create): Initialize the cache.
27         (m4__quote_cache): New function.
28         (m4_set_syntax): Update caller.
29         * m4/symtab.c (m4_symbol_value_print): Add parameter.
30         (m4_symbol_print, dump_symbol_CB): Adjust all callers.
31         * m4/utility.c (m4_dump_args): Delete; callers should use
32         m4_arg_print instead.
33         * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
34         implementation, and allow embedded NUL.
35         (m4_print_token, pop_input, composite_print, composite_peek):
36         (composite_read, append_quote_token): Adjust all callers.
37         * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
38         Likewise.
39         (m4_arg_print): Add parameters.
40         (trace_pre): Rewrite in terms of m4_arg_print.
41         * modules/m4.c (errprint): Likewise.
42         (m4wrap): Rewrite to allow embedded NUL.
43         (dumpdef): Adjust caller.
44         * doc/m4.texinfo (Debuglen): Enhance debuglen test.
45         * tests/null.m4: Test for NUL in m4wrap.
46         * tests/null.out: Update expected output.
48         Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
49         * m4/utility.c (m4_verror_at_line): Properly terminate the string.
50         Reported by Ralf Wildenhues.
52         * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
54 2008-02-19  Eric Blake  <ebb9@byu.net>
56         Clean up example on filtering defined symbols.
57         * doc/m4.texinfo (Foreach, Improved foreach): Document another
58         shortcoming in foreach.m4, and improve filter example by using
59         foreach2.m4.
61         * src/main.c (usage): Fix typo.
63 2008-02-18  Eric Blake  <ebb9@byu.net>
65         Avoid some magic numbers.
66         * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
67         (CHAR_RETRY): Define in terms of UCHAR_MAX.
68         * m4/syntax.c (m4_syntax_create, set_syntax_set)
69         (reset_syntax_set, check_is_single_quotes)
70         (check_is_single_comments, check_is_macro_escaped)
71         (m4_set_quotes, m4_set_comment): Likewise.
72         * modules/gnu.c (regexp_compile): Likewise.
73         * modules/m4.c (translit): Likewise.
74         * src/freeze.c (produce_syntax_dump): Likewise.
75         Reported by Ralf Wildenhues.
77 2008-02-16  Eric Blake  <ebb9@byu.net>
79         Add regression test for multi-character quote recursion.
80         * examples/foreach2.m4: Use $0 rather than spelling out name.
81         * examples/foreachq2.m4: Likewise.
82         * examples/forloop2.m4: Likewise.
83         * examples/hanoi.m4: Likewise.
84         * examples/trace.m4: Likewise.
85         * doc/m4.texinfo (Improved forloop): Document advantage of $0.
86         (Improved foreach): Adjust dump from file.
88         Stage 15: return argv refs back to collect_arguments.
89         Collect an entire $@ reference at once rather than one argument at
90         a time, outside of quotes (but inside quotes, $@ is still
91         flattened for now).  The skip_last field allows concatenation of
92         $@ with other text when collecting arguments.
93         Memory impact: noticeable improvement, due to better reuse of $@.
94         Speed impact: noticeable improvement, due to less parsing.
95         * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
96         (enum m4__token_type): Add M4_TOKEN_ARGV.
97         (struct m4__symbol_chain): Add skip_last member to argv link.
98         (m4__next_token): Add parameter.
99         * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
100         (composite_peek, m4__next_token): Add new parameter.
101         (composite_read, append_quote_token): Support argv in quotes.
102         (init_argv_symbol): New function.
103         (m4__push_symbol, match_input, consume_syntax)
104         (m4__next_token_is_open, m4_print_token): Adjust callers.
105         * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
106         (arg_mark, m4_arg_text, make_argv_ref): Likewise.
107         (expand_argument, collect_arguments): Handle new token.
108         (arg_symbol): Drill through $@ reference.
109         * m4/syntax.c (set_quote_age): Detect disabled comments.
110         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
112 2008-02-15  Eric Blake  <ebb9@byu.net>
114         * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
116 2008-02-13  Eric Blake  <ebb9@byu.net>
118         Fix texinfo grammar.
119         * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
120         (History): Use @: after abbreviations.
121         (M4exit): Use correct Latin abbreviation.
122         (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
123         between sentences.
125 2008-02-11  Eric Blake  <ebb9@byu.net>
127         Allow builtin text macros to specify number of arguments.
128         * m4/m4module.h (struct m4_macro): Add argument limits to builtin
129         text macros.
130         * m4/module.c (install_macro_table): Allow text macros to warn on
131         extra arguments.
132         * modules/gnu.c (m4_macro_table): Update all clients.
133         * modules/load.c (m4_macro_table): Likewise.
134         * modules/mpeval.c (m4_macro_table): Likewise.
135         * modules/perl.c (m4_macro_table): Likewise.
136         * modules/shadow.c (m4_macro_table): Likewise.
137         * modules/traditional.c (m4_macro_table): Likewise.
138         * modules/modtest.c (m4_macro_table): Likewise.  Also add text
139         macros, for testing this.
140         * doc/m4.texinfo (Standard Modules): Update text, and enhance
141         test.
142         * tests/modules.at (modules: text): New test.
144         Fix regression in command line -D option, from 2006-08-25.
145         * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
146         * m4/m4module.h: Fix typo.
147         * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
148         of arguments.
149         * tests/macros.at (Command line define): Enhance test.
150         * tests/others.at (nul character): Enhance test.
151         * tests/null.m4: Likewise.
152         * tests/null.out: Likewise.
154         Use gnulib's git-merge-changelog driver when available.
155         * .gitattributes: Add merge attributes for ChangeLog.
156         * bootstrap: Install driver, if not already present.
158 2008-02-06  Eric Blake  <ebb9@byu.net>
160         Fix security hole introduced 2007-11-23.
161         * m4/utility.c (m4_verror_at_line): Properly escape macro names.
162         * src/main.c (main): Manage quoteargs defaults.
163         * doc/m4.texinfo (Indir): Document and test this.
165         Using raw strtod is not portable.
166         * ltdl/m4/gnulib-cache.m4: Import the strtod module.
168 2008-02-02  Eric Blake  <ebb9@byu.net>
170         Consistently use size_t for number of arguments.
171         * m4/m4module.h (m4_builtin_func): Alter prototype.
172         (struct m4_builtin): Adjust type of min_args, max_args.
173         (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
174         (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
175         (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
176         (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
177         (m4_arg_print, m4_push_arg): Adjust all clients.
178         * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
179         (m4_macro_args): Adjust type of various fields.
180         (m4__push_arg_quote): Adjust all clients.
181         * m4/input.c (m4_pop_wrapup): Likewise.
182         * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
183         (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
184         (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
185         (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
186         (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
187         * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
188         * modules/evalparse.c (m4_evaluate): Likewise.
189         * modules/gnu.c (changesyntax): Likewise.
190         * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
191         (undivert, traceon, traceoff): Likewise.
192         * modules/m4.h (m4_dump_symbols_func): Likewise.
193         * modules/perl.c (perleval): Likewise.
195         Stage 14b: allow pushing argv references.
196         Push a $@ reference to the input engine in one go, rather than
197         pushing each element.  For now, argument collection still gets one
198         argument of a $@ at a time; but the penalties of this patch make
199         it easier to manage $@ efficiently in future patches.
200         Memory impact: noticeable penalty, due to larger struct and O(n)
201         to O(n^2) on unboxed recursion.
202         Speed impact: noticeable penalty, due to more bookkeeping.
203         * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
204         fields.
205         (struct m4_macro_args): Add level field.
206         (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
207         * m4/input.c (m4__push_symbol, composite_peek, composite_read)
208         (composite_unget, composite_clean, composite_print): Support $@
209         refs.
210         * m4/macro.c (collect_arguments): Populate new field.
211         (expand_macro): Move argv cleanup...
212         (m4__arg_adjust_refcount): ...to this new function.
213         (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
214         (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
215         helper functions, to add parameters.
216         (m4_push_args): Adjust caller.
217         * m4/symtab.c (m4_symbol_value_print): Likewise.
219         Stage 14a: allow printing argv references.
220         Refactor symbol-value printing code for better sharing, and to
221         allow printing a contiguous text representation of a $@ ref.
222         Memory impact: none.
223         Speed impact: none.
224         * m4/m4module.h (m4_arg_print): New prototype.
225         (m4_symbol_value_print): Alter prototype.
226         * m4/input.c (struct input_funcs): Add parameter to peek_func.
227         (file_peek, builtin_peek, string_peek): Ignore new parameter.
228         (composite_peek): Ignore new parameter, for now.
229         (composite_clean, pop_input): Rework to minimize indirection, and
230         to avoid infinite recursion in next patch.
231         * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
232         (m4_arg_print): New function.
233         * m4/symtab.c (m4_symbol_value_print): Update signature.
234         (m4_symbol_print): Update caller.
235         * m4/output.c (m4_shipout_string_trunc): Update comments.
236         * m4/syntax.c (set_quote_age): Require comma as argument separator
237         when dealing with $@ as a unit.
238         * tests/builtins.at (ifelse): Augment test.
239         * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
241 2008-01-31  Eric Blake  <ebb9@byu.net>
243         Kill hack for M4 1.4.4.
244         * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
245         we require new enough autoconf which in turn requires M4 1.4.5.
247 2008-01-31  Gary V. Vaughan  <gary@gnu.org>
248         and Eric Blake  <ebb9@byu.net>
250         Depend on new libtool to use non-recursive build.
251         * configure.ac (LT_PREREQ): Bump to alpha release version.
252         (LTDL_INIT): Choose nonrecursive mode.  Perform sanity check that
253         installed libtool has correct symbols.
254         * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
255         top level.
256         (AM_CPPFLAGS): Drop directories covered by libtool.
257         (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
258         (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
259         macros, used by libtool.
260         (lib_LTLIBRARIES): Also used by libtool.
261         (ltdl/libltdlc.la): Delete, now that libtool does this.
262         * bootstrap: Mention new requirements.
263         (LIBTOOLIZE): Provide default program, and run libtoolize prior to
264         autoreconf.
265         (autoreconf): Also neutralize libtoolize, since it is run early.
266         * HACKING: Mention updated prerequisites.
268 2008-01-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
270         Fix build failure if installed libltdl is used.
271         * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
273 2008-01-28  Eric Blake  <ebb9@byu.net>
275         Depend on newer autoconf, for testsuite -C dir.
276         * Makefile.am (CD_TESTDIR): Delete, no longer required.
277         (check-local, installcheck-local, clean-local-tests): Use new -C
278         option from autotest.
279         * configure.ac (AC_PREREQ): Bump to 2.61a.347.
280         * bootstrap: Mention new dependency.
281         * HACKING: Likewise.
283 2008-01-27  Eric Blake  <ebb9@byu.net>
285         Stage 13: push composite text tokens.
286         Support pushing composite tokens, allowing back-references to be
287         reused through multiple macro expansions.  Add hueristic that
288         avoids creating new reference when pushing existing references.
289         Memory impact: noticeable improvement due to better reference
290         reuse, except for O(n) to O(n^2) copying in boxed recursion.
291         Speed impact: slight penalty, due to more bookkeeping.
292         * m4/m4private.h (m4__push_symbol): Adjust prototype.
293         * m4/input.c (m4__push_symbol): Add parameter, and support
294         composite tokens.
295         (append_quote_token): Add parameter, and support inlining of short
296         text.
297         (m4__next_token): Adjust caller.
298         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
300 2008-01-26  Eric Blake  <ebb9@byu.net>
302         Stage 12c: add macro for m4_arg_len.
303         Make a common action easier to type.
304         Memory impact: none.
305         Speed impact: none.
306         * m4/m4module.h (M4ARGLEN): New macro.
307         * m4/macro.c (process_macro): Adjust all callers.
308         * m4/utility.c (m4_dump_args): Likewise.
309         * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
310         (substr): Likewise.
311         * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
312         (renamesyms): Likewise.
313         * modules/stdlib.c (setenv): Likewise.
315         Stage 12b: add m4_string_pair.
316         Make passing quote delimiters around more efficient.
317         Memory impact: none.
318         Speed impact: slight penalty, due to more bookkeeping.
319         * m4/m4module.h (m4_string_pair): New type.
320         (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
321         (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
322         Alter signature.
323         * m4/m4private.h (struct m4_string): Delete.
324         (struct m4_syntax_table): Combine quote and comment members.
325         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
326         (m4_get_syntax_ecomm): Adjust accessors.
327         (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
328         accessors.
329         * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
330         Alter signatures.
331         * m4/input.c (string_print, composite_print, m4_input_print):
332         All callers updated.
333         * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
334         (check_is_single_quotes, m4_set_quotes, set_quote_age)
335         (m4_get_syntax_lquote, m4_get_syntax_rquote)
336         (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
337         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
338         (m4_get_syntax_comments): Likewise.
339         * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
340         * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
341         Likewise.
342         * modules/m4.c (dumpdef, m4_make_temp): Likewise.
343         * src/freeze.c (produce_frozen_state): Likewise.
344         * tests/freeze.at (reloading unknown builtin): Update test.
346         Stage 12a: make m4_symbol_chain a union.
347         Shrink size of symbol chains by using a union.
348         Memory impact: slight improvement, due to smaller struct.
349         Speed impact: slight improvement, due to less bookkeeping.
350         * m4/m4private.h (enum m4__symbol_chain_type): New enum.
351         (struct m4_symbol_chain): Rename...
352         (struct m4__symbol_chain): ...to this, since it is internal.
353         * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
354         callers updated.
355         * m4/input.c (struct m4_input_block, m4__push_symbol)
356         (composite_peek, composite_read, composite_unget)
357         (composite_clean, composite_print, m4__make_text_link)
358         (append_quote_token): Likewise.
359         * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
360         (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
361         (m4_push_args): Likewise.
363 2008-01-23  Eric Blake  <ebb9@byu.net>
365         Adjust to recent libtool interface change.
366         * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
367         (LT_WITH_LTDL): Delete, now that it is obsolete.
368         (LTDL_INIT): Use new libtool macro.
370 2008-01-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
371         and Eric Blake  <ebb9@byu.net>
373         Rely on newer automake.
374         * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
375         distribution.
376         * bootstrap: Update automake requirement.
377         (func_version): Fix --version output, broken since 2007-08-06.
378         * HACKING: Likewise.  Add lzma requirement.
379         * Makefile.am (clean-local-src): Not needed any more with newest
380         Automake.
381         (clean-local): Adjust.
382         * TODO: Remove completed item.
384 2008-01-22  Eric Blake  <ebb9@byu.net>
386         Doc tweak.
387         * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
388         example.
390 2008-01-21  Eric Blake  <ebb9@byu.net>
392         Stage 11: full circle for single argument references.
393         Pass quoted strings through to argument collection in a single
394         action, so that an argument can be reused throughout macro
395         recursion if it remains unchanged.
396         Memory impact: noticeable improvement, due to more reuse in
397         argument collection stacks; O(n^2) to O(n) on boxed recursion.
398         Speed impact: noticeable improvement, due to less copying.
399         * m4/m4module.h (m4_arg_text): Add parameter.
400         (M4ARG): Adjust.
401         * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
402         (m4__make_text_link): New prototype.
403         (struct m4_symbol_chain): Add quote_age member.
404         (struct m4_symbol_value): Add end member to chained symbol.
405         (struct m4_macro_args): Add wrapper member.
406         * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
407         (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
408         composite tokens.
409         * m4/input.c (make_text_link): Rename...
410         (m4__make_text_link): ...to this, and export.
411         (m4_push_string_finish): Adjust caller.
412         (make_text_link, m4__push_symbol): Update new field.
413         (file_read, builtin_read, string_read, composite_read, next_char):
414         Add parameter.
415         (m4_skip_line, match_input, consume_syntax): Adjust callers.
416         (append_quote_token): New function.
417         (m4__next_token): Pass quoted strings onto argument collection.
418         (m4_print_token) [DEBUG_INPUT]: Update.
419         * m4/macro.c (expand_argument): Collect composite arguments.
420         (collect_arguments): Update new field.
421         (expand_macro): Reduce ref-count of back-references after use.
422         (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
423         names.
424         (m4_is_arg_text): Also recognize composite symbols as text.
425         (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
426         (m4_arg_equal): Compare composite symbols.
427         (m4_push_arg, m4_push_args): Handle composite symbols.
428         (m4_arg_symbol): Relax assertion.
429         (process_macro): Use single-argument references.
430         * m4/output.c (m4_shipout_string_trunc): Update comment.
431         * tests/macros.at (Rescanning macros): Augment test.
433 2008-01-16  Eric Blake  <ebb9@byu.net>
435         Stage 10: avoid extra copying of strings and comments.
436         When collecting tokens that are immune to further expansion, avoid
437         copying data from one obstack to another by outputting it into the
438         destination obstack to begin with.  Also reduce copying done in
439         format builtin.
440         Memory impact: slight improvement, due to better obstack usage.
441         Speed impact: noticeable improvement, due less data copying.
442         * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
443         modules.
444         * m4/m4private.h (m4__token_type): Adjust prototype.
445         * m4/input.c (m4__next_token): Support new parameter.
446         * m4/macro.c (m4_macro_expand_input, expand_token)
447         (expand_argument, collect_arguments): Adjust callers.
448         * modules/m4.c (ntoa): Tighten buffer size.
449         * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
450         * modules/format.c (arg_int, arg_long, arg_double): New helper
451         functions, to detect overflow or unparsed characters.
452         (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
453         missing or excess arguments.
454         (format): Likewise, and also output directly into obstack if there
455         is room.
456         * doc/m4.texinfo (History): Update for new year.
457         (Format): Test for new warnings.
459 2008-01-15  Eric Blake  <ebb9@byu.net>
461         * TODO: Update with some newer URLs.
463         Verify linear `index'.
464         * tests/builtins.at (index): New test.
465         (translit): Make test take longer, to make quadratic algorithms
466         more apparent.
468 2007-12-20  Eric Blake  <ebb9@byu.net>
470         Stage 9: share rather than copy single-arg refs.
471         Use hooks of previous patch to create back-references to arguments
472         in the input engine, and inline short text rather than always
473         creating a FIFO link.  Also start testing embedded NUL behavior.
474         Until the argument collection engine also shares references, the
475         memory usage increases.
476         Memory impact: noticeable penalty, due to longer life of argv
477         changing O(n) to O(n^2) on boxed recursion.
478         Speed impact: slight improvement, due less data copying.
479         * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
480         * m4/m4module.h (m4_arg_scratch): New prototype.
481         * m4/m4private.h (m4__push_symbol): Add parameter.
482         (m4_arg_scratch): Add fast accessor.
483         (struct m4): Add expansion_level member, taken...
484         * m4/macro.c (expansion_level): ...from here.  Adjust all users.
485         (expand_argument): Minor cleanup.
486         (expand_macro): Track scratch space per macro call.
487         (m4_arg_scratch): New function.
488         (m4_make_argv_ref): Call new function.
489         (m4_push_arg): Push reference to $0.
490         (m4_push_args): Rework separator usage, since separators will
491         usually be inlined.
492         (process_macro): Allow embedded NUL.
493         * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
494         (m4__push_symbol): Add parameter.  Inline short strings, and save
495         references through rescanning.
496         * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
497         * modules/m4.c (errprint, index): Handle NUL transparently.
498         (dumpdef, translit): Use scratch space, rather than expansion
499         stack.
500         * modules/gnu.c (renamesyms, m4symbols): Likewise.
501         * tests/others.at (nul character): New test.
502         (iso8859): Quote absolute file name, remove XFAIL.
503         * tests/iso8859.m4: Avoid raw NUL in output.
504         * tests/null.m4: New file.
505         * tests/null.out: Likewise.
506         * tests/null.err: Likewise.
507         * Makefile.am (OTHER_FILES): Distribute new files.
508         * .gitattributes: Treat new files as text.
510 2007-12-17  Eric Blake  <ebb9@byu.net>
512         Stage 8: extend life of references into argv.
513         Add hooks to lengthen the lifetime of arguments reused in a macro
514         expansion, rather than always discarding arguments at the end of
515         expand_macro.  Rework the expand_macro obstacks to handle longer
516         lifetimes.  For now, the hooks remain unused.
517         Memory impact: slight penalty, due to larger structs.
518         Speed impact: slight penalty, due to more bookkeeping.
519         * m4/system_.h (obstack_regrow): Delete.
520         * m4/m4private.h (struct m4_symbol_chain): Add level field.
521         (m4__push_symbol): Adjust prototype.
522         (m4__adjust_refcount): New prototype.
523         (DEBUG_MACRO) [DEBUG]: New debug control.
524         (struct m4__macro_arg_stacks): New structure.
525         (struct m4): Add arg_stacks, stacks_count fields.
526         * m4/m4module.h (m4_make_argv_ref): Add parameter.
527         * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
528         context->arg_stacks.
529         (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
530         conditional on M4_DEBUG_MACRO envvar.
531         (collect_arguments): Adjust signature.
532         (expand_macro): Rework obstack handling.
533         (m4__adjust_refcount, arg_mark): New functions.
534         (m4_make_argv_ref): Populate new field.
535         (m4_push_arg, m4_push_args): Track inuse.
536         (process_macro): One less cast.
537         * m4/m4.c (m4_delete): Clean up arg_stacks.
538         * m4/input.c (make_text_link): Use new field.
539         (m4__push_symbol, file_clean): Update signature.
540         (composite_read): Bump refcount when done with reference.
541         (composite_clean): New function.
542         (pop_input): Adjust caller.
543         * m4/debug.c (m4_debug_message): Make assertion match comment.
544         * modules/gnu.c (builtin, indir): Adjust callers.
545         * tests/builtins.at (ifelse): New test.
546         (exp): Move and rename...
547         * tests/others.at (countdown): ...to this.
548         * doc/m4.texinfo (Improved foreach): Fix tracing usage in
549         example.
551 2007-12-13  Eric Blake  <ebb9@byu.net>
553         Yet more rewording.
554         * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
555         the previous patch.
557         * THANKS: Update.
559 2007-12-13  Paolo Bonzini  <bonzini@gnu.org>  (tiny change)
561         * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
562         example.
563         Reported by Giovanni Toffetti.
565 2007-12-11  Eric Blake  <ebb9@byu.net>
567         Stage 7: use chained input support in input parser.
568         Allow the LIFO input engine to rescan a macro expansion composed
569         of smaller chunks of FIFO data, rather than the old approach of a
570         monolithic string.  For now, all chunks are still copied.
571         Memory impact: slight penalty, due to FIFO chain overhead.
572         Speed impact: slight penalty, due to extra bookkeeping.
573         * m4/m4private.h (m4__push_symbol): New prototype.
574         (struct m4_symbol_chain): Add const-safety.
575         * m4/symtab.c (m4_symbol_value_print): Simplify.
576         (dump_symbol_CB): Update caller.
577         * m4/input.c (struct m4_input_block): Alter u_c member, first
578         introduced 2006-10-25, but unused until now.
579         (composite_peek, composite_read, composite_unget)
580         (composite_print, init_builtin_token): Rewrite accordingly.
581         (m4_push_wrapup): No longer need trailing NUL.
582         (m4__push_symbol, make_text_link): New functions.
583         (m4_push_string_finish): Use them.
584         * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
585         (expand_macro): Simplify logic of nesting_limit.
586         * src/main.c (main): Likewise.
587         * doc/m4.texinfo (Dumpdef): Augment test.
589 2007-12-08  Eric Blake  <ebb9@byu.net>
591         Stage 6: convert builtins to push arg at a time.
592         Add new methods to factor all builtins whose expansion includes an
593         argument, making back-reference creation easier in future patches.
594         Factor out length-limited printing to obstacks, and use -1 rather
595         than 0 for unlimited length.
596         Memory impact: none.
597         Speed impact: slight improvement, due to better code sharing.
598         * m4/m4module.h (m4_shipout_text): Rename...
599         (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
600         that does not worry about sync lines.
601         (m4_shipout_string_trunc): New prototype.
602         * m4/output.c (m4_shipout_text): Rename...
603         (m4_divert_text): ...to this.
604         (m4_shipout_string): Move guts...
605         (m4_shipout_string_trunc): ...to this new function.
606         * m4/macro.c (m4_push_arg, m4_push_args): New functions.
607         (expand_token, process_macro): Update callers.
608         * m4/input.c (string_print): Likewise.
609         * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
610         Likewise.
611         * modules/gnu.c (patsubst): Likewise.
612         (debuglen): Use SIZE_MAX for unlimited debug length.
613         * src/main.c (main): Likewise.
614         * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
615         zero.
617 2007-12-07  Eric Blake  <ebb9@byu.net>
619         Minor security fix: Quote output of mkstemp.
620         * modules/m4.c (m4_make_temp): Produce quoted output.
621         * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
622         tests.
624         Stage 5: add notion of quote age.
625         Cache the quoting rules that were in effect when a string was
626         parsed, to avoid reparsing that string if no changequote or other
627         quote age change took place in the meantime.  A quote_age of 0 is
628         always safe, but does not benefit from caching.
629         Memory impact: slight improvement, due to smaller struct in input
630         engine.
631         Speed impact: slight penalty, due to more bookkeeping.
632         * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
633         (m4_set_symbol_value_text): Adjust prototype.
634         (m4_has_syntax): Factor out the unsigned char cast.
635         * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
636         quote_age members.
637         (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
638         functions at this point.
639         (struct m4_symbol_value, struct m4_macro_args): Add quote_age
640         member.
641         (m4_set_symbol_value_text): Adjust fast accessor.
642         (m4_get_symbol_value_quote_age): New fast accessor.
643         * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
644         (m4_get_symbol_value_quote_age): New function.
645         (m4_symbol_value_copy): Adjust callers.
646         * m4/macro.c (expand_token): Add parameter, and track quote age.
647         (expand_argument, collect_arguments): Track quote age.
648         (m4_macro_expand_input, process_macro, m4_make_argv_ref)
649         (m4_macro_expand_input): Update callers.
650         (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
651         * m4/input.c: Comment cleanups.
652         (struct m4_input_block): Reduce size.
653         (m4__next_token): Report quote age.
654         (m4_push_builtin, init_builtin_token): Update callers.
655         * m4/utility.c (skip_space): Adjust callers.
656         * m4/module.c (install_macro_table): Likewise.
657         * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
658         (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
659         quote age.
660         (set_quote_age): New helper function.
661         (check_is_single_quotes, check_is_single_comments): Adjust
662         callers.
663         * src/freeze.c (reload_frozen_state): Likewise.
664         * src/main.c (main): Likewise.
665         * modules/m4.c (define, pushdef): No need to set macro text.
666         * tests/builtins.at (changequote, defn): New tests.
667         * examples/wrapfifo.m4: New file.
668         * examples/wraplifo.m4: New file.
669         * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
671 2007-12-04  Eric Blake  <ebb9@byu.net>
673         Fix builds with OpenBSD make.
674         * Makefile.am (HELP2MAN): New macro.
675         (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
676         srcdir.
677         * README: Update copyright.
678         * HACKING: Mention help2man and makeinfo dependencies.
680 2007-11-29  Eric Blake  <ebb9@byu.net>
682         Stage 4: route indir, builtin through ref; make argv opaque.
683         Finish making struct opaque to all but the input engine, by
684         reworking obstack usage in expand_macro to better support creation
685         of a $@ reference.  Canonicalize the empty argument, to allow
686         pointer comparison optimizations.
687         Memory impact: slight penalty, due to larger struct.
688         Speed impact: slight improvement, due to fewer function calls.
689         * m4/system_.h (obstack_regrow): Fix precedence.
690         * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
691         New prototypes.
692         (struct m4_macro_args): Move...
693         * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
694         to modules.  Add has_ref member.
695         (bool_bitfield): New helper typedef.
696         (struct m4_symbol_chain): Add flatten and len members.
697         * m4/macro.c (empty_symbol): New placeholder, for optimizing
698         comparison with empty string.
699         (m4_macro_expand_input): Initialize it.
700         (collect_arguments): Alter signature, and populate new fields.
701         (trace_pre, trace_post): Remove redundant parameter.
702         (expand_macro): Alter handling of obstacks.
703         (m4_arg_symbol): Account for wrapped argv.
704         (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
705         (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
706         * modules/m4.c (ifelse, syscmd): Likewise.
707         * modules/evalparse.c (m4_evaluate): Likewise.
708         (undefine, popdef, m4_dump_symbols): Optimize.
709         * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
710         methods.
711         (changesyntax, regexp): Optimize.
712         * m4/output.c (diversion_storage): Use typedef.
714         Stage 3b: cache length, rather than computing it, in modules.
715         Use cached token length in builtins and output engine.
716         Memory impact: none.
717         Speed impact: noticeable improvement, due to fewer function calls.
718         * m4/hash.c (m4_hash_remove): Avoid double free on remove
719         failure.
720         * m4/output.c (m4_shipout_string): Change semantics of len param.
721         (m4_shipout_int): Use cached length.
722         * m4/input.c (m4_push_string_finish): Likewise.
723         * modules/m4.h (m4_make_temp_func): Add parameter.
724         * m4/macro.c (expand_token, m4_arg_len): Use cached length.
725         (collect_arguments, expand_macro): Alter signature.
726         (trace_format): Don't use out-of-scope buffer.
727         (process_macro): All callers changed.
728         * m4/utility.c (m4_dump_args): Likewise.
729         * m4/symtab.c (m4_symbol_value_print): Likewise.
730         * modules/gnu.c (__file__, __program__, builtin, indir)
731         (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
732         renamesyms, patsubst, regexp, regexp_compile): Likewise.
733         * modules/load.c (m4modules): Likewise.
734         * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
735         (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
736         * modules/perl.c (perleval): Likewise.
737         * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
738         (hostname, uname, setenv): Likewise.
739         * modules/mpeval.c (numb_obstack): Likewise.
740         * src/freeze.c (dump_symbol_CB): Likewise.
741         * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
742         * tests/builtins.at (mkstemp): Likewise.
743         * tests/others.at (iso8859): XFAIL this test, now that
744         length-based handling allows NUL through part but not all of M4.
746 2007-11-28  Eric Blake  <ebb9@byu.net>
748         Stage 3a: cache length, rather than computing it, in libm4.
749         Cache the length of a token in the input engine and symbol table,
750         to avoid repeating lots of strlen calls.  Additionally, by using
751         obstack length rather than strlen, the input engine can now
752         support embedded NUL.
753         Memory impact: slight penalty, due to larger struct.
754         Speed impact: slight improvement, due to fewer function calls.
755         * m4/m4module.h (struct m4_macro_args): Cache length.
756         (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
757         (m4_set_symbol_value_text): Change signature.
758         * m4/m4private.h (struct m4_symbol_value): Store string length.
759         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
760         (m4_set_symbol_value_placeholder): Update accordingly.
761         (m4_set_symbol_value_text): Change signature.
762         (m4_get_symbol_value_len): New accessor.
763         * m4/input.c (struct m4_input_block, string_peek, string_read)
764         (string_unget, string_print, m4_push_string_finish)
765         (m4_push_wrapup): Track length of string input.
766         (m4__next_token): Adjust all users of symbol text to track length,
767         too.
768         * m4/macro.c (expand_argument, collect_arguments): Likewise.
769         * m4/module.c (install_macro_table): Likewise.
770         * modules/gnu.c (builtin, indir): Likewise.
771         * modules/m4.c (define, pushdef): Likewise.
772         * src/main.c (main): Likewise.
773         * src/freeze.c (reload_frozen_state): Likewise.
774         * m4/symtab.c (m4_symbol_value_copy): Likewise.
775         (m4_get_symbol_value_len): New function.
776         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
777         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
778         Adjust implementation.
780 2007-11-27  Eric Blake  <ebb9@byu.net>
782         Stage 2: use accessors, not direct reference, into argv.
783         Outside of macro.c, use accessor methods rather than direct access
784         into the argv struct.
785         Memory impact: none.
786         Speed impact: slight penalty, due to increased function calls.
787         * m4/m4private.h (m4_arg_argc): New fast accessor.
788         * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
789         (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
790         prototypes.
791         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
792         (m4_macro_call): Make argc unsigned.
793         (M4ARG): Use new accessors.
794         * modules/m4.c (define, pushdef): Likewise.
795         (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
796         (traceon, traceoff): Make argc unsigned.
797         * modules/m4.h (m4_dump_symbols_func): Likewise.
798         * modules/evalparse.c (m4_evaluate): Likewise.
799         * modules/gnu.c (builtin, indir): Use new accessors.
800         (changesyntax): Make argc unsigned.
801         * modules/perl.c (perleval): Likewise.
802         * m4/utility.c (m4_dump_args): Use new accessors.
803         * m4/macro.c (trace_pre): Likewise.
804         (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
805         (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
806         (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
807         usage.
809 2007-11-24  Eric Blake  <ebb9@byu.net>
811         Stage 1: convert m4_symbol_value** into new object.
812         Pass a variable-size wrapper structure instead of an array to
813         builtins, so that subsequent optimizations in the structure need
814         not impact every builtin client.
815         Memory impact: slight penalty, since struct is larger than array.
816         Speed impact: slight penalty, due to increased bookkeeping.
817         * ltdl/m4/gnulib-cache.m4: Import flexmember module.
818         * m4/m4module.h (m4_macro_args): New type, will be opaque to
819         modules later.
820         (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
821         (m4_macro_call): Alter signature to use m4_macro_args object.
822         (M4ARG): Redefine to access new struct.
823         * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
824         (struct m4_symbol_chain): New type.
825         (struct m4_symbol_value): Add chain alternative.
826         * m4/macro.c (collect_arguments): Build new struct.
827         (expand_macro, m4_macro_call, process_macro, trace_pre)
828         (trace_post): Adjust implementation to use it.
829         * m4/utility.c (m4_dump_args): Likewise.
830         * modules/gnu.c (builtin, indir): Likewise.
831         * modules/format.c (format): Likewise.
832         * modules/m4.h (m4_dump_symbols_func): Likewise.
833         * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
834         (shift, include, errprint, m4wrap): Likewise.
835         * modules/evalparse.c (m4_evaluate): Likewise.
837         Pass only macro name to utility functions.
838         * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
839         * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
840         implementation.
841         * m4/macro.c (m4_macro_call): Adjust callers.
842         * modules/gnu.c (builtin, debuglen): Likewise.
843         * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
844         (substr): Likewise.
845         * modules/evalparse.c (m4_evaluate): Likewise.
846         * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
847         * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
848         Likewise.
850 2007-11-23  Eric Blake  <ebb9@byu.net>
852         Add macro name to debugfile messages.
853         * m4/m4module.h (m4_debug_set_output): Add parameter.
854         * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
855         name through.
856         * modules/gnu.c (debugfile): Adjust caller.
857         * modules/m4.c (m4exit): Likewise.
858         * src/main.c (main): Likewise.
860         Factor out handling of macro name in error messages.
861         * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
862         (m4_warn_at_line): Add new parameter.
863         * m4/utility.c (m4_verror_at_line): New helper method.
864         (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
865         parameter.
866         (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
867         changed.
868         * m4/debug.c: Likewise.
869         * m4/input.c: Likewise.
870         * m4/macro.c: Likewise.
871         * m4/module.c: Likewise.
872         * m4/output.c: Likewise.
873         * m4/path.c: Likewise.
874         * modules/evalparse.c: Likewise.
875         * modules/format.c: Likewise.
876         * modules/gnu.c: Likewise.
877         * modules/load.c: Likewise.
878         * modules/m4.c: Likewise.
879         * modules/mpeval.c: Likewise.
880         * src/freeze.c: Likewise.
881         * src/main.c: Likewise.
883 2007-11-14  Eric Blake  <ebb9@byu.net>
885         Handle some defn corner cases differently.
886         * doc/m4.texinfo (Defn): Update documentation; although this still
887         doesn't match the branch, since it may be changed before 2.0.
888         * m4/macro.c (expand_argument): Consistently ignore builtins in
889         concatenation contexts.
890         * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
892 2007-11-13  Eric Blake  <ebb9@byu.net>
894         Note: Patches titled Stage 0 through N form a series of patches
895         which decreases the algorithmic complexity of tail recursion in
896         macro expansions from O(n^2) to O(n) in both time and memory, then
897         performs cleanups, such as handling of embedded NUL, made easier
898         by the code refactoring.
900         Stage 0: Fix memory leak in tail recursion.
901         Free expansion text in the input engine as soon as it is parsed,
902         rather than when the recursive expansion completes.
903         Memory impact: noticeable improvement, due to reduction from
904         O(n^2) to O(n) on recursion.
905         Speed impact: minor improvement, due to better memory usage.
906         * m4/input.c (pop_input): Add flag parameter and return type.
907         (next_char): Adjust caller.
908         (m4_push_string_init): Let go of memory earlier.
910 2007-11-07  Eric Blake  <ebb9@byu.net>
912         * tests/macros.at (Rescanning macros): Test more corner cases.
914 2007-11-06  Eric Blake  <ebb9@byu.net>
916         * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
918         * Makefile.am (tests/package.m4): Work around bash bug.
919         Reported by Ralf Wildenhues.
921 2007-11-05  Eric Blake  <ebb9@byu.net>
923         For consistency with other GNU projects, use build-aux directory.
924         * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
925         build-aux.
926         * bootstrap (config_aux_dir): Likewise.
927         * Makefile.am (config_aux_dir): Likewise.
928         * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
930 2007-11-02  Eric Blake  <ebb9@byu.net>
932         Update some documentation about version control.
933         * NEWS: M4 is now stored in git.
934         * HACKING: Likewise.
935         * README: Likewise.
936         * bootstrap: Likewise.
937         * commit: Delete, now that CVS commits are no longer necessary.
938         * ltdl/config/mailnotify: No longer necessary; git's patch
939         generation and mail capability is more powerful.
941         Update to recent gnulib changes.
942         * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
943         xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
945 2007-11-01  Eric Blake  <ebb9@byu.net>
947         Improve error message when early end of file occurs.
948         * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
949         (M4wrap): Adjust to new messages.
950         (Improved capitalize): Enhance test.
951         * m4/m4private.h (m4__next_token): Adjust prototype.
952         * m4/input.c (m4__next_token): Add new parameter, and improve
953         error message.
954         * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
955         callers.
956         (expand_argument): Likewise, and add parameter.
958 2007-10-31  Eric Blake  <ebb9@byu.net>
960         Test more corner cases.
961         * tests/macros.at (Rescanning macros): Beef up test.
962         * doc/m4.texinfo (Changecom): Beef up test.
963         (Improved foreach): Document alternate foreachq style.
964         * examples/foreachq3.m4: New file.
965         * examples/loop.m4: New file.
966         * Makefile.am (dist_pkgdata_DATA): Distribute them.
968 2007-10-28  Eric Blake  <ebb9@byu.net>
970         More test coverage for autoconf usage patterns.
971         * doc/m4.texinfo (Shift): Document cond macro, and add new test.
972         * tests/macros.at (Rescanning macros): New test.
973         * tests/builtins.at (include): Augment test.
975 2007-10-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
977         * Makefile.am: Adjust getopt handling to latest gnulib layout.
979 2007-10-27  Eric Blake  <ebb9@byu.net>
981         Document one use of changequote(`(',`)').
982         * doc/m4.texinfo (Changequote): Add new test, based on recent
983         autoconf addition of m4_expand.
985 2007-10-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
987         * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
989 2007-10-22  Eric Blake  <ebb9@byu.net>
991         Never let printf failures go undetected.
992         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
993         xprintf'.
994         * m4/system_.h: Include xprintf.h.
995         * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
996         use of printf, xprintf.
997         * m4/input.c [DEBUG_INPUT]: Likewise.
998         * m4/module.c [DEBUG_MODULES]: Likewise.
999         * m4/output.c (m4_shipout_text, m4_shipout_int)
1000         (m4_freeze_diversions): Likewise.
1001         * m4/path.c [DEBUG_INCL]: Likewise.
1002         * m4/symtab.c [DEBUG_SYM]: Likewise.
1003         * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
1004         * modules/modtest.c (export_test): Likewise.
1005         * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
1006         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
1007         Likewise.
1008         * src/main.c (usage): Likewise.
1009         * po/POTFILES.in: Adjust to new file.
1010         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
1012 2007-10-18  Eric Blake  <ebb9@byu.net>
1014         Fix 'm4 -F file -t undefined'.
1015         * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
1016         * src/freeze.c (dump_symbol_CB): Also skip void symbols.
1017         * tests/freeze.at (reloading unknown builtin): Test for this bug.
1018         * m4/m4module.h (m4_symtab_apply): Add parameter.
1019         * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
1020         requested.
1021         (m4_symtab_delete, symtab_dump): Adjust callers.
1022         * modules/m4.c (m4_dump_symbols): Likewise.
1024 2007-10-09  Eric Blake  <ebb9@byu.net>
1026         Fix regexp regression of 2007-09-29.
1027         * modules/gnu.c (substitute): Allow NULL buf when no
1028         subexpressions were present.
1029         (regexp): Handle \ escapes even with empty regex.
1030         * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
1032         Cache regex compilation for another autoconf speedup.
1033         * modules/gnu.c (gnu_buf): Replace...
1034         (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
1035         (m4_pattern_buffer): Add fields.
1036         (m4_regexp_compile): Rename...
1037         (regexp_compile): ...to this, and drop no_sub parameter.
1038         Implement caching.
1039         (M4FINISH_HANDLER): Clean up entire cache.
1040         (m4_regexp_search): Rename...
1041         (regex_search): ...to this, adjust to new struct contents, and add
1042         no_sub parameter.
1043         (m4_regexp_substitute): Rename...
1044         (regexp_substitute): ...to this.
1045         (substitute, patsubst, regexp, renamesyms): Adjust callers.
1047 2007-10-02  Eric Blake  <ebb9@byu.net>
1049         Document quoting pitfalls in capitalize.
1050         * doc/m4.texinfo (Patsubst): Use the examples directory.  Also
1051         document shortfall.
1052         (Improved capitalize): New node.
1053         * examples/capitalize.m4: Update to match manual.
1054         * examples/capitalize2.m4: New file.
1056 2007-10-01  Eric Blake  <ebb9@byu.net>
1058         Another Autoconf usage pattern optimization.
1059         * modules/m4.c (m4_index): Optimize search for one byte.
1060         * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
1061         code paths.
1063 2007-09-29  Eric Blake  <ebb9@byu.net>
1065         Optimize for Autoconf usage pattern.
1066         * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
1068         * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
1070 2007-09-24  Eric Blake  <ebb9@byu.net>
1072         Create .gitignore alongside .cvsignore.
1073         * bootstrap (version control): Update to reflect git usage.
1075 2007-09-13  Eric Blake  <ebb9@byu.net>
1077         * AUTHORS: Fix typo.
1079 2007-09-12  Gary V. Vaughan  <gary@gnu.org>
1081         Be consistent about using 'module' for m4_module types and
1082         'handle' for lt_dlhandle types:
1084         * m4/m4private.h (m4_symbol_value): Rename handle element to
1085         method.  Changed all references.
1086         (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
1087         SYMBOL_HANDLE respectively.  Changed all references.
1088         * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
1089         * m4/builtin.c (m4_builtin_find_by_name)
1090         (m4_builtin_find_by_func): Use module as the parameter name for
1091         pointers of type 'm4_module'.
1092         * m4/module.c (module_remove, m4_get_module_name)
1093         (install_builtin_table, install_macro_table)
1094         (m4_module_make_resident, m4__module_next, m4_module_refcount):
1095         Ditto.
1096         * src/freeze.c (produce_module_dump): Ditto.
1097         * m4/input.c (m4_input_block): Rename handle element to method.
1098         Changed all references.
1099         * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
1100         * modules/load.c: Use module as the variable name for pointers
1101         of type 'm4_module'.
1102         * modules/m4.c: Ditto.
1103         * modules/perl.c: Ditto.
1104         * modules/shadow.c: Ditto.
1106 2007-09-07  Eric Blake  <ebb9@byu.net>
1108         Add refcount builtin.
1109         * modules/load.c (refcount): New builtin.
1110         (m4modules): Use correct type.
1111         * doc/m4.texinfo (Refcount): New section.
1112         * m4/m4private.h (struct m4_module): Add refcount member.
1113         (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
1114         * m4/module.c (m4_module_load): Add symbols to table on first
1115         load by m4, regardless of other libltdl loads of same module.
1116         (m4_module_refcount): Use new struct member, rather than relying
1117         on libltdl count which might be inflated by unrelated loads.
1118         (m4__module_interface): Optimize.
1119         (m4__module_next, m4__module_find): Avoid assertions that could
1120         trigger with unrelated libltdl loads.
1121         (m4__module_open): Track m4 load count.
1122         (m4__module_exit): Only unload what m4 loaded.
1123         (module_remove): Track m4 unloads.
1124         * NEWS: Document new builtin.
1126         More conversion to m4_module*.
1127         * src/freeze.c (produce_module_dump, dump_symbol_CB)
1128         (reload_frozen_state): Use correct type.
1129         * m4/input.c (struct m4_input_block): Likewise.
1130         * m4/symtab.c (dump_symbol_CB): Likewise.
1132         * AUTHORS: Simplify, to match libtool and autoconf layout.
1133         * THANKS: Sync with branch.
1135 2007-09-06  Eric Blake  <ebb9@byu.net>
1137         Wrap lt_dlhandle in struct m4_module.
1138         * m4/m4module.h (includes): No longer require clients to know
1139         about lt_dlhandle.
1140         (m4_module): New opaque declaration.
1141         (m4_export): Delete unused type.
1142         (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
1143         (m4_module_finish_func, m4_module_load, m4_get_module_name)
1144         (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
1145         wrapper.
1146         (m4_module_makeresident, m4_module_refcount): New declarations.
1147         * m4/m4private.h (includes): Move <ltdl.h> here.
1148         (m4_module): New declaration.  Simple for now, but intended for
1149         growth.
1150         (m4__module_open, m4__module_next, m4__module_find)
1151         (m4__symtab_remove_module_references): Use new wrapper.
1152         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
1153         Likewise.
1154         * m4/module.c (m4_get_module_name, m4_module_import)
1155         (m4_module_load): Likewise.
1156         (install_builtin_table, install_macro_table): Likewise.  Also,
1157         change return type since these always returned NULL and no one
1158         used the result.
1159         (m4_module_makeresident, m4_module_refcount): New functions.
1160         (m4_module_unload, m4__module_next, m4__module_find): Use new
1161         wrapper.
1162         (m4__module_open): Populate new wrapper, and associate it with the
1163         lt_dlhandle.
1164         (m4__module_exit): Use new wrapper.
1165         (module_remove): Likewise.  Reclaim storage on last use.
1166         (module_close): Delete, and inline into module_remove.
1167         * m4/symtab.c (m4__symtab_remove_module_references): Use new
1168         wrapper.
1169         * modules/load.c (load_init): Use new API.
1170         * modules/m4.c (m4_export_table): Kill unused declaration.
1171         (m4_init): Use new API.
1172         * modules/shadow.c (shadow_init): Use new API.
1173         * src/main.c (main): Adjust callers.
1174         * src/freeze.c (reload_frozen_state): Likewise.
1175         * tests/modules.at (unload load module): New test.
1177 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
1179         * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
1180         * src/m4/.cvsignore: Add xstrtol module sources.
1182 2007-09-03  Gary V. Vaughan  <gary@gnu.org>
1184         Work around a bug in darwin's awk:
1186         * bootstrap (func_get_translations): Use $AWK instead of raw
1187         `awk' so that the user can use an alternative implementation
1188         if the first awk in PATH doesn't behave as expected.
1189         (func_get_translations): The first awk script mangles the last
1190         entry passed to it for at least the awk implementation shipped
1191         with Darwin 8.10.1.  Capture $3 into a variable too to work-
1192         around that problem.
1194 2007-08-29  Gary V. Vaughan  <gary@gnu.org>
1196         As gnulib xstrtol is only used by main, and unconditionally pulls
1197         in a copy of getopt, undo bootstrap change from 2007-08-11 below,
1198         and copy the xstrtol code into src/ so that main() can use it
1199         without pushing the extra code into libm4:
1201         * bootstrap (src_modules): Add getopt and xstrtol modules.
1202         * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
1203         * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
1205 2007-08-11  Eric Blake  <ebb9@byu.net>
1207         Another upstream xstrtol change.
1208         * po/POTFILES.in: Track changes in files containing messages.
1209         * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
1210         need to grab it separately.
1211         * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
1212         No longer needed.
1213         (size_opt): Adjust to latest xstrtol interface.
1215 2007-08-10  Eric Blake  <ebb9@byu.net>
1217         Documentation improvements.
1218         * doc/m4.texinfo (Defn): Resync with branch.
1219         (Compatibility, Extensions): Sync with branch.
1221 2007-08-07  Eric Blake  <ebb9@byu.net>
1223         Adjust to gnulib xstrtol changes.
1224         * src/main.c (size_opt): Adjust signature, so that error strings
1225         are easier to translate.
1226         (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
1227         for tracking long options.
1228         (main): Track which long option was used.
1229         * tests/options.at (--debuglen, --nesting-limit): Adjust to change
1230         in error message.
1231         (deprecated options): Test that --arglength spelling shows up in
1232         error message.
1234 2007-08-06  Eric Blake  <ebb9@byu.net>
1236         Normalize all GPL license notices.
1237         * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
1238         at this time.
1239         * Makefile.am: Update license wording.
1240         * bootstrap: Likewise.
1241         * commit: Likewise.
1242         * configure.ac: Likewise.
1243         * ltdl/config/mailnotify: Likewise.
1244         * ltdl/config/mkstamp: Likewise.
1245         * ltdl/m4/debug.m4: Likewise.
1246         * ltdl/m4/gmp.m4: Likewise.
1247         * ltdl/m4/m4-error.m4: Likewise.
1248         * ltdl/m4/m4-getopt.m4: Likewise.
1249         * ltdl/m4/m4-gettext.m4: Likewise.
1250         * ltdl/m4/m4-obstack.m4: Likewise.
1251         * ltdl/m4/m4-regex.m4: Likewise.
1252         * ltdl/m4/stackovf.m4: Likewise.
1253         * m4/builtin.c: Likewise.
1254         * m4/debug.c: Likewise.
1255         * m4/hash.c: Likewise.
1256         * m4/hash.h: Likewise.
1257         * m4/input.c: Likewise.
1258         * m4/m4.c: Likewise.
1259         * m4/m4module.h: Likewise.
1260         * m4/m4private.h: Likewise.
1261         * m4/macro.c: Likewise.
1262         * m4/module.c: Likewise.
1263         * m4/output.c: Likewise.
1264         * m4/path.c: Likewise.
1265         * m4/resyntax.c: Likewise.
1266         * m4/symtab.c: Likewise.
1267         * m4/syntax.c: Likewise.
1268         * m4/system_.h: Likewise.
1269         * m4/utility.c: Likewise.
1270         * modules/evalparse.c: Likewise.
1271         * modules/format.c: Likewise.
1272         * modules/gnu.c: Likewise.
1273         * modules/import.c: Likewise.
1274         * modules/load.c: Likewise.
1275         * modules/m4.c: Likewise.
1276         * modules/m4.h: Likewise.
1277         * modules/modtest.c: Likewise.
1278         * modules/mpeval.c: Likewise.
1279         * modules/perl.c: Likewise.
1280         * modules/shadow.c: Likewise.
1281         * modules/stdlib.c: Likewise.
1282         * modules/time.c: Likewise.
1283         * modules/traditional.c: Likewise.
1284         * po/Makevars: Likewise.
1285         * src/freeze.c: Likewise.
1286         * src/m4.h: Likewise.
1287         * src/main.c: Likewise.
1288         * src/stackovf.c: Likewise.
1289         * tests/builtins.at: Likewise.
1290         * tests/freeze.at: Likewise.
1291         * tests/generate.awk: Likewise.
1292         * tests/m4.in: Likewise.
1293         * tests/macros.at: Likewise.
1294         * tests/modules.at: Likewise.
1295         * tests/options.at: Likewise.
1296         * tests/others.at: Likewise.
1297         * tests/stackovf.test: Likewise.
1298         * tests/testsuite.at: Likewise.
1300 2007-07-22  Eric Blake  <ebb9@byu.net>
1302         Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
1303         * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
1304         * tests/builtins.at (divert): Enhance test to cover this.
1305         * THANKS: Update.
1306         Reported by Thomas Klausner.
1308 2007-07-20  Eric Blake  <ebb9@byu.net>
1310         Fix 'make distcheck' issues.
1311         * bootstrap: Add more files that might be more up-to-date in
1312         gnulib.
1313         * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
1314         * config/m4/gnulib-cache.m4: Update to latest gnulib.
1316 2007-07-16  Eric Blake  <ebb9@byu.net>
1318         * po/POTFILES.in: Track recent translation additions from gnulib
1319         updates.
1321 2007-07-14  Eric Blake  <ebb9@byu.net>
1323         Reflect upstream license .texi changes.
1324         * doc/m4.texinfo (Copying): Rename node...
1325         (GNU General Public License): ...to this.
1326         (GNU Free Documentation License): Adjust node location.
1327         * local/doc/gpl-3.0.texi.diff: Remove file.
1329 2007-07-10  Eric Blake  <ebb9@byu.net>
1331         Upgrade to GPLv3, and document 1.4.10.
1332         * bootstrap: Adjust to GPLv3.
1333         (func_update): Port from branch.
1334         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
1335         --local-dir=local --import gpl-3.0'.
1336         * doc/m4.texinfo (History): Mention 1.4.11.
1337         (Copying This Package): New appendix.
1338         * NEWS: Document 1.4.10.
1339         * local/doc/gpl-3.0.texi.diff: New file.
1340         * Makefile.am: Update license.
1341         (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
1342         * commit: Update license.
1343         * configure.ac: Likewise.
1344         * ltdl/config/mailnotify: Likewise.
1345         * ltdl/config/mkstamp: Likewise.
1346         * ltdl/m4/debug.m4: Likewise.
1347         * ltdl/m4/gmp.m4: Likewise.
1348         * ltdl/m4/m4-error.m4: Likewise.
1349         * ltdl/m4/m4-getopt.m4: Likewise.
1350         * ltdl/m4/m4-gettext.m4: Likewise.
1351         * ltdl/m4/m4-obstack.m4: Likewise.
1352         * ltdl/m4/m4-regex.m4: Likewise.
1353         * ltdl/m4/stackovf.m4: Likewise.
1354         * m4/builtin.c: Likewise.
1355         * m4/debug.c: Likewise.
1356         * m4/hash.c: Likewise.
1357         * m4/hash.h: Likewise.
1358         * m4/input.c: Likewise.
1359         * m4/m4.c: Likewise.
1360         * m4/m4module.h: Likewise.
1361         * m4/m4private.h: Likewise.
1362         * m4/macro.c: Likewise.
1363         * m4/module.c: Likewise.
1364         * m4/output.c: Likewise.
1365         * m4/path.c: Likewise.
1366         * m4/resyntax.c: Likewise.
1367         * m4/symtab.c: Likewise.
1368         * m4/syntax.c: Likewise.
1369         * m4/system_.h: Likewise.
1370         * m4/utility.c: Likewise.
1371         * modules/evalparse.c: Likewise.
1372         * modules/format.c: Likewise.
1373         * modules/gnu.c: Likewise.
1374         * modules/import.c: Likewise.
1375         * modules/load.c: Likewise.
1376         * modules/m4.c: Likewise.
1377         * modules/m4.h: Likewise.
1378         * modules/modtest.c: Likewise.
1379         * modules/mpeval.c: Likewise.
1380         * modules/perl.c: Likewise.
1381         * modules/shadow.c: Likewise.
1382         * modules/stdlib.c: Likewise.
1383         * modules/time.c: Likewise.
1384         * modules/traditional.c: Likewise.
1385         * po/Makevars: Likewise.
1386         * src/freeze.c: Likewise.
1387         * src/m4.h: Likewise.
1388         * src/main.c: Likewise.
1389         * src/stackovf.c: Likewise.
1390         * tests/builtins.at: Likewise.
1391         * tests/freeze.at: Likewise.
1392         * tests/generate.awk: Likewise.
1393         * tests/m4.in: Likewise.
1394         * tests/macros.at: Likewise.
1395         * tests/modules.at: Likewise.
1396         * tests/options.at: Likewise.
1397         * tests/others.at: Likewise.
1398         * tests/stackovf.test: Likewise.
1399         * tests/testsuite.at: Likewise.
1401 2007-07-09  Eric Blake  <ebb9@byu.net>
1403         * modules/format.c (format): Avoid undefined behavior with %c.
1405 2007-07-01  Gary V. Vaughan  <gary@gnu.org>
1407         The translation project has moved.
1408         * bootstrap (func_get_translations): Use the new translation
1409         project url.
1410         (TP_URL): Removed.
1412 2007-06-26  Karl Berry  <karl@freefriends.org>  (tiny change)
1414         Match Free Software Directory categories.
1415         * doc/m4.texinfo (dircategory): Update.
1417 2007-05-31  Eric Blake  <ebb9@byu.net>
1419         Add extension to divert builtin.
1420         * modules/m4.c (builtin_divert): Immediately divert second
1421         argument.
1422         * m4/output.c (m4_output_text): Allow 0 length.  Fixes regression
1423         from two days ago.
1424         (m4_shipout_text): Short-circuit on zero length.
1425         * tests/freeze.at (loading format 2): Expand test to catch
1426         regression.  Also check out-of-range version.
1427         * tests/builtins.at (divert): Expand test to check corner cases
1428         of extension.
1429         * NEWS: Document the extension.
1430         Reported by Daniel Richard G.
1432 2007-05-30  Eric Blake  <ebb9@byu.net>
1434         Port format improvements from branch.
1435         * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
1436         (Format): Enhance section.
1437         * modules/format.c (format): Accept %'hhd, and issue warnings on
1438         unrecognized specifiers.
1439         * modules/gnu.c (builtin_format): Adjust how format is called.
1441 2007-05-28  Eric Blake  <ebb9@byu.net>
1443         * tests/options.at (--syncoutput): Add xfailed test.
1445         Fix sync line interaction with multiline comments.
1446         * doc/m4.texinfo (Preprocessor features): Improve documentation.
1447         (Syncoutput): Improve testsuite.
1448         (Incompatibilities): Add testcase, and document bug.
1449         * src/freeze.c (reload_frozen_state): Don't interfere with
1450         synclines when reloading state.
1451         * m4/input.c (m4__next_token): Report line where multiline tokens
1452         start.
1453         * m4/m4private.h (m4__token_type): Add parameter.
1454         * m4/m4module.h (m4_output_text): Export.
1455         (m4_shipout_text): Add parameter.
1456         * src/macro.c (m4_macro_expand_input, expand_token)
1457         (expand_argument): Adjust callers so that line is passed from
1458         input to output.
1459         * m4/output.c (output_text): Rename...
1460         (m4_output_text): ...to this, and export.
1461         (m4_insert_file, insert_diversion_helper): Update callers.
1462         (m4_shipout_text): Take new parameter for start line of token.
1463         Output at most one syncline per token.
1464         Reported by Sergey Poznyakoff.
1466         Fix large diversion corner cases.
1467         * tests/freeze.at (large diversion): New test.
1468         * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
1469         (make_room_for): Use NULL, not 0, for pointers.
1470         (m4_freeze_diversions): Allow freezing large diversions.
1471         (insert_diversion_helper): Avoid using rewind.
1473         Also run gnulib unit tests during make check.
1474         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
1475         --tests-base=tests/gnu --with-tests'.
1476         * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
1477         * Makefile.am (SUBDIRS): Run gnulib tests before ours.
1479 2007-05-25  Eric Blake  <ebb9@byu.net>
1481         * m4/system_.h: Include <stdint.h>, for intmax_t.
1482         * THANKS: Update.
1483         Reported by Daniel Richard G.
1485 2007-05-24  Eric Blake  <ebb9@byu.net>
1487         Provide consistent shift semantics regardless of hardware.
1488         * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
1489         before shifting.
1490         (number, unumber): Always use [u]intmax_t.
1491         Reported by Gary V. Vaughan.
1493         Support POSIX flush semantics on all platforms.
1494         * modules/m4.c (m4_sysval_flush): Rely on gnulib.
1495         * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
1497         Work around cygwin and mingw fseeko bugs.
1498         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1499         fseeko'.
1500         * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
1502 2007-04-25  Eric Blake  <ebb9@byu.net>
1504         Test that regression in 1.4.9's eval doesn't recur.
1505         * doc/m4.texinfo (Eval): Check negative division.
1506         * THANKS: Update.
1508 2007-04-12  Eric Blake  <ebb9@byu.net>
1510         Allow for running test in sticky or setgid directory.
1511         * tests/builtins.at (mkdtemp): Adjust test.
1513         Don't test for broken sed too soon.
1514         * tests/others.at (stdin seekable): Rearrange subtests.
1516         Work around 'stdin seekable' shortcoming on glibc.
1517         * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
1518         * tests/others.at (stdin closed): Adjust to new output.
1519         * src/main.c (process_file): No need to return anything.
1520         (main): Use close_stdin instead of close_stdout.
1521         Reported by Ralf Wildenhues.
1523         Enable autobuild usage.
1524         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1525         autobuild'.
1526         * configure.ac (AB_INIT): Output autobuild information.
1528 2007-04-11  Eric Blake  <ebb9@byu.net>
1530         Address testsuite shortcoming in 'stdout full' on glibc.
1531         * tests/others.at (stdout full): Adjust expected output when more
1532         than 1k text is printed to /dev/full.
1533         Reported by Ralf Wildenhues.
1535 2007-04-10  Eric Blake  <ebb9@byu.net>
1537         * tests/macros.at (Arity and defn): Fix quoting.
1539 2007-04-09  Eric Blake  <ebb9@byu.net>
1541         Address failure of 'seekable stdin' on Mac OS X.
1542         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1543         fflush'.
1545 2007-04-07  Eric Blake  <ebb9@byu.net>
1547         Include <config.h> first in all C files, and not in headers.
1548         Fixes regression for --disable-assert builds from 2007-04-02.
1549         * src/m4.h (includes): Don't include config.h here.
1550         * m4/m4private.h (includes): Likewise.
1551         * m4/builtin.c: Include config.h before anything else.
1552         * m4/debug.c: Likewise.
1553         * m4/hash.c: Likewise.
1554         * m4/input.c: Likewise.
1555         * m4/m4.c: Likewise.
1556         * m4/macro.c: Likewise.
1557         * m4/module.c: Likewise.
1558         * m4/symtab.c: Likewise.
1559         * m4/syntax.c: Likewise.
1560         * m4/utility.c: Likewise.
1561         * src/freeze.c: Likewise.
1562         * src/stackovf.c: Likewise.
1564 2007-04-03  Eric Blake  <ebb9@byu.net>
1566         * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
1567         SIGFPE on x86 architectures.
1568         Reported by Ralf Wildenhues.
1570 2007-04-02  Eric Blake  <ebb9@byu.net>
1572         Fix warnings from last commit.
1573         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1574         fprintf-posix sprintf-posix'.
1575         * m4/macro.c (expand_macro, trace_format): Use correct specifier
1576         for size_t.
1577         (process_macro): Avoid negative array index.
1578         * src/freeze.c (produce_resyntax_dump, produce_module_dump)
1579         (dump_symbol_CB, produce_frozen_state): Use correct specifier for
1580         size_t.
1582 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
1584         Get rid of the last 'differs in signedness' compiler warnings:
1586         * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
1587         a regular 'char *', so variables to store the return address,
1588         and iterate through it should be regular 'char *' too.
1589         * m4/input.c (m4_input_block): The start and current members of
1590         the string part of this union store regular 'char *' types, so
1591         they should be regular 'char *' types too.
1593 2007-04-02  Gary V. Vaughan  <gary@gnu.org>
1595         M4 was designed to have a small number of header files defining
1596         the interfaces to several source files each.  Keeping this in
1597         mind allows us to tidy things up considerably.  Having done this,
1598         it becomes clear that some of the installed headers reference
1599         other headers which are not installed (but that's another patch):
1601         * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
1602         here...
1603         * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
1604         ...to here, so client modules can benefit too.
1605         (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
1606         lowest level to save doing it multiple times elsewhere.
1607         * m4/debug.c (stdio.h): Removed.  The portable <gnu/stdio--.h>
1608         is already included via m4private.h.
1609         * modules/time.c (stdio.h): Ditto.
1610         * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
1611         * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
1612         and <gnu/unistd--.h>,
1613         * m4/m4private.h (m4module.h): Use angle brackets for an installed
1614         file.
1615         * m4/hash.h (system.h): Ditto.
1616         * modules/gnu.c (progname.h): Removed.
1617         * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
1618         * m4/m4private.h (assert.h, errno.h): Already included via
1619         m4/m4module.h.
1620         * m4/input.c (ctype.h): Ditto.
1621         * m4/module.c (ltdl.h): Ditto.
1622         * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
1623         (unistd.h): Ditto.
1624         * m4/path.c (config.h, stdlib.h): Ditto.
1625         * m4/utility.c (config.h): Ditto.
1626         * modules/evalparse.c (assert.h, ctype.h): Ditto.
1627         * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
1628         * modules/import.c (assert.h): Ditto.
1629         * modules/m4.c (assert.h, errno.h): Ditto.
1630         * modules/modtest.c (assert.h): Ditto.
1631         * modules/stdlib.c (sys/types.h): DittAo.
1632         * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
1633         Ditto.
1634         * src/stackovf.c (assert.h): Ditto.
1635         * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
1636         private interfaces when NDEBUG is defined.
1637         * modules/import.c (m4/m4module.h, m4private.h): Ditto.
1638         * modules/load.c (m4/m4module.h, m4private.h): Ditto.
1639         * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
1640         * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
1641         * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
1642         * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
1643         * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
1644         * modules/time.c (m4/m4module.h, m4private.h): Ditto.
1645         * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
1646         * src/m4.h (locale.h): Moved from here...
1647         * src/main.h: ...to here.
1648         (m4private.h): Already included via m4.h.
1649         * src/stackovf.c (m4private.h): Ditto.
1651 2007-03-28  Gary V. Vaughan  <gary@gnu.org>
1653         * Makefile.am (stamp-vcl): Removed.
1654         (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
1656 2007-03-28  Eric Blake  <ebb9@byu.net>
1658         * src/main.c (usage): Improve note to TRANSLATORS.
1659         * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
1661         * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
1662         empty.
1664 2007-03-24  Eric Blake  <ebb9@byu.net>
1666         * m4/output.c (m4_output_init): Update to latest gnulib.
1667         * bootstrap (ltdl/m4/.cvsignore): No longer track generated
1668         .cvsignore in CVS.
1669         * NEWS: Reflect release of 1.4.9.
1670         * THANKS: Update.
1672 2007-03-07  Eric Blake  <ebb9@byu.net>
1674         * AUTHORS: Update
1676         Exercise gnulib's new POSIX *printf modules.
1677         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
1678         vasprintf-posix'.
1679         * modules/format.c (format): Support %a and %A.
1680         * doc/m4.texinfo (Format): Test this addition.
1681         * NEWS: Document this addition.
1683 2007-03-03  Eric Blake  <ebb9@byu.net>
1685         * m4/input.c (m4__next_token): Fix synclines when in batch mode.
1686         * doc/m4.texinfo (M4exit): Synch another section.
1687         (Syncoutput): Make similar to other sections.
1689 2007-03-01  Eric Blake  <ebb9@byu.net>
1691         * doc/m4.texinfo: Improve the indices.
1692         (Concept index): Rearrange to be last.
1693         (Sysval): Merge from branch.
1695         * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
1697 2007-02-28  Eric Blake  <ebb9@byu.net>
1699         POSIX XCU ERN 137 was approved.
1700         * modules/mpeval.c (numb_extension): Delete.
1701         * modules/m4.c (numb_extension): Likewise.
1702         * modules/evalparse.c (comma_term, condition_term): Always
1703         implement ?: and , operators.
1704         * m4/symtab.c: Update comment to match reality.
1705         * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
1706         dereferencing context directly when accessor exists.
1707         * src/main.c (usage): Prefer GNU_M4 over EMACS.
1708         (struct macro_definition): Rename...
1709         (struct deferred): ...to match usage.  All uses changed.
1710         * doc/m4.texinfo (Eval): Document this change.
1711         (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
1712         over emacs.
1713         (Preprocessor features, Changesyntax): Fix inaccuracies.
1714         * NEWS: Import branch NEWS items for 1.4.x series.  Document
1715         change in eval.
1717         POSIX XCU ERN 118 was approved.
1718         * modules/m4.c (define): Kill posixly_correct distinction in
1719         define behavior, since POSIX says GNU behavior complies.
1720         * tests/builtins.at (define): Restore original semantics.
1721         * doc/m4.texinfo (Pushdef): Document portability issues with
1722         define.
1723         (Incompatibilities): Clean up wording of what POSIX requires.
1724         * NEWS: Document this.
1726 2007-02-26  Eric Blake  <ebb9@byu.net>
1728         Re-enable clean bootstrap on cygwin.
1729         * Makefile.am (AM_LDFLAGS): For now, export all symbols from
1730         modules, since otherwise we run afoul of current libtool
1731         limitations on cygwin and mingw.
1733 2007-02-25  M. Levinson  <levinsm@users.sourceforge.net>  (tiny change)
1735         * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
1736         memory.  Fixes regression introduced 2007-01-20.
1738 2007-02-25  Eric Blake  <ebb9@byu.net>
1740         * tests/freeze.at (loading format 2): Augment test to catch
1741         regression introduced on 2007-01-20.
1742         * THANKS: Update.
1743         Reported by M. Levinson.
1745         * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
1746         latest gnulib.
1748 2007-02-05  Eric Blake  <ebb9@byu.net>
1750         * tests/options.at (--fatal-warnings): New test.
1751         * tests/others.at (stdin seekable): Exit on error.
1752         * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
1753         (m4_get_warnings_exit_opt): Access it.
1754         * m4/m4module.h (m4_context_opt_bit_table): Access it.
1755         * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
1756         on -EE.
1757         (m4_warn, m4_warn_at_line): Change exit status on -E, and force
1758         exit on -EE.
1759         * src/m4.c (usage): Document new -E behavior.
1760         (main): Make -E an additive option.
1761         * doc/m4.texinfo (Operation modes): Document the change.
1762         Reported by Ralf Wildenhues.
1764         * tests/others.at (stdin seekable): Fix bug in test.
1765         * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
1767         * m4/input.c (struct m4_input_block): Remove unused field traced.
1769 2007-02-03  Eric Blake  <ebb9@byu.net>
1770         and Bruno Haible  <bruno@clisp.org>  (tiny change)
1772         * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
1773         the examples.
1774         Reported by Bruno Haible.
1776 2007-01-31  Eric Blake  <ebb9@byu.net>
1778         * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
1779         failure.
1781 2007-01-26  Eric Blake  <ebb9@byu.net>
1783         * m4/symtab.c (includes): Adjust to latest gnulib.
1784         * modules/m4.c (includes): Likewise.
1786 2007-01-23  Eric Blake  <ebb9@byu.net>
1788         * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
1789         extension to make enough room.
1790         (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
1791         code in input.c special cases this category.
1792         (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
1793         for define(eleventh,${11}) extension.
1794         * m4/syntax.c: Update comments accordingly.
1795         (m4_syntax_create, m4_syntax_code): Handle { and }.
1796         * m4/input.c (m4__next_token): Likewise.
1797         * src/freeze.c (produce_frozen_state): Support new categories.
1798         (reload_frozen_state): When loading version 1, disable syntax
1799         features not present in 1.4.x.
1800         * tests/freeze.at: Sort and rename existing tests.
1801         (loading format 1): Ensure we don't break v1 frozen files that
1802         used raw ${.
1803         (loading format 2, reloading changecom, reloading changesyntax):
1804         New tests.
1805         * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
1806         the new syntax categories.
1807         (Arguments): Update the FIXME comment.
1808         (M4wrap): Merge examples from branch, before worrying about fixing
1809         m4wrap to obey POSIX.
1810         (Using frozen files): Start merging from branch.
1811         * NEWS: Update.
1813 2007-01-20  Eric Blake  <ebb9@byu.net>
1815         * src/freeze.c (produce_char_dump): Delete.  Replace with...
1816         (produce_mem_dump): ...this new function, to encode more strings.
1817         Also make the coding easier to read and slightly more compact.
1818         (produce_syntax_dump): Only dump non-default syntax codes.
1819         (produce_module_dump, dump_symbol_CB, produce_frozen_state):
1820         Encode non-ASCII characters in user-supplied strings.
1821         (GET_STRING): Accept escape sequences in version 2.
1822         * NEWS: Document this change.
1823         * TODO: Update.
1825 2007-01-16  Eric Blake  <ebb9@byu.net>
1827         Port patch from branch for stack overflow detection on BSD/OS.
1828         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
1829         * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
1830         ! HAVE_STACK_T_SS_SP]: Use this check.
1831         Reported by Chris McGuire.
1833 2007-01-15  Eric Blake  <ebb9@byu.net>
1835         * tests/builtins.at (__m4_version__): New test.
1836         * modules/traditional.c (m4_macro_table): Provide windows and os2
1837         macros, as appropriate.  Add __traditional__ macro.
1838         * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
1839         not __gmp__, to match module name.
1840         * modules/load.c (m4_macro_table): Name the macro __load__, not
1841         __modules__, to match module name.
1842         * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
1843         from the branch.
1844         (Standard Modules): Improve wording.
1845         (Incompatibilities): Move platform macros into their own node.
1846         (Load, Unload): Use actual examples.
1847         * NEWS: Document this change.
1848         * THANKS: Update.
1850 2007-01-13  Eric Blake  <ebb9@byu.net>
1852         * doc/m4.texinfo (Mpeval): Add tests.
1853         * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
1854         * tests/builtins.at (gmp): ...here.  Rename test to...
1855         (mpeval): ...this.
1856         * tests/generate.awk (new_test): Filter out mpeval tests when gmp
1857         is not available.
1858         * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
1859         no_gnu_extensions with posixly_correct_opt, since they were set in
1860         sync.
1861         * m4/m4private.h (struct m4): Remove no_gnu_extensions.
1862         * src/main.c (main): Update caller.
1863         * src/freeze.c (reload_frozen_state): Likewise.
1864         * modules/m4.c (m4wrap): Likewise.
1866 2007-01-12  Eric Blake  <ebb9@byu.net>
1868         * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
1869         POSIX, so update the comment.
1870         * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
1871         approved by POSIX, so we can always have blind macros, even when
1872         POSIXLY_CORRECT.
1873         (Ifelse): Mention the term `blind builtin'.
1875 2007-01-08  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1877         * doc/m4.texinfo: Fix a couple of typos.
1879 2007-01-08  Eric Blake  <ebb9@byu.net>
1881         * ltdl/m4/gnulib-cache.m4: Update for new year.
1882         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
1883         Reported by Ralf Wildenhues.
1885 2007-01-06  Eric Blake  <ebb9@byu.net>
1887         * m4/m4private.h (to_uchar): Move...
1888         * m4/m4module.h: here, so modules can use it.
1889         * src/main.c (usage, long_options): Support --posix as a synonym
1890         for --traditional.
1891         * modules/m4.c (numb_invert): Detect unsupported x**-y.
1892         (numb_incr, numb_urshift, numb_extension): New macros.
1893         (numb_obstack): Port patch from branch to support radix 1 output.
1894         * modules/mpeval.c (numb_obstack): Use \ for ratios.
1895         (numb_incr, numb_urshift, numb_extension): New macros.
1896         (mpq2mpz): Warn rather than error.
1897         * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
1898         enumerators.
1899         (eval_error): Rearrange, so that all ignorable errors are less
1900         than SYNTAX_ERROR.
1901         (eval_text, last_text): Obey C++ type safety rules.
1902         (numb_pow): Change return type.
1903         (exp_term): Adjust caller.
1904         (m4_evaluate): Fail on bad exponent.
1905         (logical_or_term, logical_and_term): Ignore failed ** in short
1906         circuit.
1907         (eval_lex): Fix typos when detecting <<= and >>=.  Use \ instead
1908         of : for ratio.  Support >>>, ,, and ?:.  Port patch from branch
1909         to parse radix 1 numbers.
1910         (condition_term, comma_term): New parse functions.
1911         (shift_term): Support >>>.
1912         (m4_evaluate): Port patch from branch to output radix 1 numbers.
1913         Warn instead of error for most parse problems.
1914         * doc/m4.texinfo (Limits control, Eval): Document these changes.
1915         * NEWS: Document new operators and new command line option.
1917 2007-01-04  Eric Blake  <ebb9@byu.net>
1919         * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
1921 2007-01-03  Eric Blake  <ebb9@byu.net>
1923         * doc/m4.texinfo (Format, Incr): More merges.
1924         (Eval): Ensure C precedence rules are met.
1925         * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
1926         (not_term, logical_not_term): Delete; these are same precedence
1927         as other unary operators.
1928         (equality_term): New; these are lower precedence than relational
1929         operators.
1930         (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
1931         operators for better error messages.
1932         (logical_or_term, logical_and_term): Short-circuit out the error
1933         of division by zero.
1934         (unary_term): Allow consecutive unary operators.
1935         * modules/m4.c (int2numb, numb2int): Delete; these potentially
1936         truncate bits.
1937         (numb_not, numb_eor, numb_ior, numb_and): Update callers.
1938         * modules/mpeval.c (reduce1, reduce2): Protect macros better.
1939         * NEWS: Document this change.
1941 2006-12-27  Eric Blake  <ebb9@byu.net>
1943         * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
1944         branch.
1945         * modules/m4.c (substr): Merge from branch.
1947 2006-12-26  Eric Blake  <ebb9@byu.net>
1949         * doc/m4.texinfo (Changesyntax): Check for regressions with
1950         changesyntax(W=...).
1952 2006-12-22  Eric Blake  <ebb9@byu.net>
1954         * m4/m4module.h (m4_set_syntax): Change signature.
1955         * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
1956         warning.
1957         (changesyntax): Likewise, and update caller.
1958         * m4/m4private.h (m4_syntax_table): Add orig member.
1959         * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
1960         Don't set is_single_quotes and is_single_comments when the begin
1961         character is shadowed by another syntax type.
1962         (m4_syntax_create): Populate default syntax table.
1963         (add_syntax_attribute): Don't lose quote assignment.
1964         (remove_syntax_attribute): Only allow removing rquote or ecomm.
1965         (add_syntax_set, subtract_syntax_set, set_syntax_set)
1966         (reset_syntax_set): New helper routines.
1967         (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
1968         to default, and empty chars reverts that key to default.
1969         (check_is_single_quotes, check_is_single_comments): New helper
1970         routines.
1971         * modules/m4.c (changecom): Merge from branch.
1972         * m4/input.c (m4__next_token): Rearrange token recognition order
1973         to macro, quote, comment, in order to match traditional
1974         implementations.
1975         * src/freeze.c (reload_frozen_state): Update caller.
1976         * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
1977         modifications.
1978         (Changeresyntax): Revise to match style of surrounding sections
1979         and add more examples.
1980         (Changesyntax): Likewise, and update to new semantics.
1981         * NEWS: Document this change.
1983         * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
1984         (M4wrap, Eval, Errprint): Fix typos.
1985         (Divnum): Not necessary to redivert in example.
1987 2006-12-21  Eric Blake  <ebb9@byu.net>
1989         * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
1990         from branch.
1992 2006-12-19  Eric Blake  <ebb9@byu.net>
1994         * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
1995         * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
1996         can track write errors without all other callers warning multiple
1997         times.
1998         (sysval_flush_helper): New function.
1999         (dumpdef, syscmd, errprint, m4exit): Adjust callers.
2000         * modules/gnu.c (esyscmd): Likewise.
2001         * tests/others.at (stdout closed, stdout full): Error message
2002         update.
2004 2006-12-16  Eric Blake  <ebb9@byu.net>
2006         * src/main.c: Fix missing include.
2008         * src/main.c (main): Check for errors when closing stdin.
2009         * modules/m4.c (m4exit): Missed part of previous patch: flush
2010         stdin before a successful exit.
2011         Reported by Ralf Wildenhues.
2013 2006-12-14  Eric Blake  <ebb9@byu.net>
2015         * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
2016         required by POSIX.
2017         * tests/others.at (stdin seekable): New test.
2019 2006-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2021         * doc/m4.texinfo: Fix some typos.
2023 2006-12-04  Eric Blake  <ebb9@byu.net>
2025         * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
2026         sections.
2027         (Modules): Make style consistent.
2029 2006-11-16  Eric Blake  <ebb9@byu.net>
2031         * bootstrap: Relax m4 requirement, thanks to...
2032         * configure.ac (Gettext support): ...this workaround to the 1.4.4
2033         bug.  Undoes restriction added on 2006-11-09.
2035         * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
2036         diversions are now closed when not active.
2037         (divert): Remove check now in the manual.
2038         * tests/others.at (stderr closed): Likewise.
2039         (stdout closed): Add a check.
2040         * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
2041         more docs with branch.
2043 2006-11-14  Eric Blake  <ebb9@byu.net>
2045         Remerge sparse diversion handling from branch.
2046         * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
2047         avltree-oset.
2048         * m4/output.c (diversion_table): Change type to gl_oset_t.
2049         (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
2050         (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
2051         (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
2052         (div0, diversion_storage): New variables.
2053         (diversions, equal_diversion_CB): Deleted.
2054         (threshold_diversion_CB): New callback.
2055         (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
2056         functions.
2057         (m4_tmpfile): Move cloexec action here.
2059         * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
2060         char.
2062 2006-11-13  Eric Blake  <ebb9@byu.net>
2064         Add several new command line options.
2065         * src/main.c (usage): Update.
2066         (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
2067         --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
2068         Make --regexp-syntax argument optional.
2069         (main): Support new options.  Fix regression in interactive
2070         behavior from Nov 8.
2071         * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
2072         M4_OPT_SYNC_OUTPUT_BIT.
2073         * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
2074         syncoutput, to match option.
2075         (m4_parse_truth_arg): New prototype.
2076         * m4/utility.c (m4_parse_truth_arg): Implement it.
2077         * m4/output.c (m4_shipout_text): Adjust sync_output caller.
2078         * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
2079         m4_parse_truth_arg.
2080         * doc/m4.texinfo (Operation modes, Dynamic loading features)
2081         (Preprocessor features, Limits control, Debugging options)
2082         (Command line files): Update documentation.
2083         * tests/builtins.at (mkstemp): Simplify.
2084         * tests/macros.at (Command line pushdef): New test.
2085         (Command line define): Improve.
2086         * tests/options.at (--traceon and --traceoff, --syncoutput): New
2087         tests.
2088         (POSIXLY_CORRECT): Likewise.
2089         (deprecated options): Augment.
2090         (--regexp-syntax): Update, now that -r takes optional arg.
2091         * NEWS: Reformat.  Document new options.
2093 2006-11-11  Eric Blake  <ebb9@byu.net>
2095         One step closer to allowing C++ compilation - don't blindly
2096         convert between char* and unsigned char*.
2097         * m4/m4module.h (m4_set_syntax): Change signature.
2098         * m4/m4private.h (m4_string): Use signed char.
2099         (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
2100         (m4_get_syntax_ecomm): No longer a need to cast.
2101         * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
2102         Reflect this change.
2103         * m4/macro.c (expand_argument): Simplify.
2104         (expand_token): Use proper type.
2105         * src/freeze.c (reload_frozen_state): Likewise.
2106         * m4/input.c (MATCH, match_input): Likewise.
2107         * modules/m4.c (translit): Likewise.
2108         * modules/gnu.c (substitute): Simplify.
2110         * m4/macro.c (trace_format): Use canonical type name.
2111         * m4/output.c (m4_freeze_diversions): Likewise.
2112         * src/freeze.c (produce_module_dump, dump_symbol_CB)
2113         (produce_frozen_state): Likewise.
2114         * m4/m4private.h (to_uchar): Grab from branch.
2115         * m4/input.c (string_peek, string_read): Use it.
2116         * m4/utility.c (skip_space): Likewise.
2117         * src/main.c (main): Likewise.
2118         * doc/m4.texinfo (Translit): Remerge from branch.
2119         * tests/builtins.at (translit): Test 8-bit range.
2120         * modules/m4.c (m4_expand_ranges): Merge from branch.
2122 2006-11-09  Eric Blake  <ebb9@byu.net>
2124         * bootstrap: Validate that installed M4 is powerful enough.
2125         Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
2127 2006-11-08  Eric Blake  <ebb9@byu.net>
2129         Merge deferred handling of -D option from branch.
2130         * doc/m4.texinfo (Debugging options, Preprocessor features)
2131         (Dynamic loading features, Operation modes, Invoking m4):
2132         Document this change.
2133         * src/main.c (OPTSTRING): Specify in-order processing.
2134         (process_file): New function.
2135         (main): Use it to interleave files and deferred options.
2136         * tests/macros.at (Command line define): New test.
2137         * tests/generate.awk: Allow '@comment file' as first example
2138         within a node.
2139         * tests/options.at (option grouping): Update to reflect actual
2140         POSIX semantics.
2141         (file names): New test.
2143 2006-11-07  Eric Blake  <ebb9@byu.net>
2145         * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
2146         for failure.
2148         * tests/builtins.at (m4exit): New test; failed on cygwin before
2149         this patch.
2150         * m4/output.c (cleanup_tmpfile): Close files before removing
2151         directory.
2152         (make_room_for, m4_output_exit): Ensure that atexit handler
2153         invoked from m4_error sees consistent state.
2155         * doc/m4.texinfo (Errprint): Merge another doc node.
2156         * tests/builtins.at (dumpdef, errprint): New tests.
2157         * modules/m4.c (errprint): Merge from branch: flush before
2158         printing to stderr.
2160 2006-11-02  Eric Blake  <ebb9@byu.net>
2162         * bootstrap: Update bootstrap requirement wording.
2163         Reported by Bruno Haible.
2165 2006-10-31  Eric Blake  <ebb9@byu.net>
2167         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2168         strstr'.
2169         * doc/m4.texinfo (Translit): Merge from branch.
2170         * modules/m4.c (divert, substr): Ignore excess arguments.
2171         (index, translit): Merge from branch.
2172         * tests/builtins.at (translit): Add a test.
2174 2006-10-30  Eric Blake  <ebb9@byu.net>
2176         * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
2177         checkin.
2178         * m4/symtab.c (m4_get_symbol_value_module): Likewise.
2180         * modules/m4.c (m4_make_temp): Make safe across libtool.
2181         * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
2182         * configure.ac (--with-modules): Accomodate changed module
2183         location when doing './configure --enable-debug'.
2185 2006-10-28  Eric Blake  <ebb9@byu.net>
2187         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2188         config-h.'
2190 2006-10-27  Eric Blake  <ebb9@byu.net>
2192         * bootstrap (gnulib): No longer a need to patch after gnulib-tool
2193         --update.
2194         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
2195         0.16, since 0.15 is incompatible with our automake requirement.
2197         * m4/macro.c (expand_argument): Fix missing initialization.
2198         * m4/m4private.h (struct m4_symbol_value): Store entire
2199         m4_builtin, not just the func.
2200         (m4_get_symbol_value_func): Update.
2201         (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
2202         fast accessors.
2203         * m4/m4module.h (m4_get_symbol_value_builtin)
2204         (m4_get_symbol_builtin): New prototypes.
2205         (m4_set_symbol_value_func): Delete, replace with...
2206         (m4_set_symbol_value_builtin): New function.
2207         (m4_builtin_find_by_name): Change signature.
2208         * m4/symtab.c (m4_symbol_value_print): Simplify.
2209         (m4_get_symbol_value_func): Update.
2210         (m4_get_symbol_value_builtin): New function.
2211         (m4_set_symbol_value_func): Delete, replace with...
2212         (m4_set_symbol_value_builtin): New function.
2213         (dump_symbol_CB) [DEBUG_SYM]: Simplify.
2214         * m4/builtin.c (m4_builtin_find_by_name): Change signature.
2215         * m4/input.c (struct m4_input_block): Remove unused trace member.
2216         (m4_push_builtin, builtin_print, init_builtin_token): Update
2217         callers.
2218         * m4/module.c (install_builtin_table): Likewise.
2219         * src/freeze.c (reload_frozen_state): Likewise.
2220         * modules/gnu.c (builtin): Make it possible to retrieve a builtin
2221         token, even after the builtin has been undefined.
2222         * doc/m4.texinfo (Builtin): Document new capability.
2223         * NEWS: Likewise.
2225         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2226         tempname'.
2227         * modules/m4.c (m4_make_temp): Use it.
2228         * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
2230 2006-10-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2232         * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
2233         files.
2235 2006-10-26  Eric Blake  <ebb9@byu.net>
2237         Silence -O2 -Wall -Wwrite-strings warnings.
2238         * m4/m4private.h (m4_symbol_value): Const-ify text.
2239         * m4/m4module.h (m4_get_symbol_value_text)
2240         (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
2241         (m4_set_symbol_value_placeholder): Likewise.
2242         * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
2243         fallout.
2244         * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
2245         (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2246         (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2247         Likewise.
2248         * modules/format.c (format): Likewise.
2249         * src/main.c (main): Likewise.
2250         * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
2251         * modules/shadow.c (shadow, test): Likewise.
2252         * m4/output.c (m4_make_diversion): Don't hold on to empty
2253         diversions.
2254         (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
2255         (m4_freeze_diversions): Likewise.  Don't use uninitialized
2256         variable.
2258         Convert diversions to list instead of sparse array, part 2.
2259         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2260         avltree-list'.
2261         * m4/output.c (m4_diversion): Add next pointer and divnum members.
2262         (diversion_table): Convert to a list instead of a sparse array.
2263         (free_list): Maintain free list of reclaimed diversions.
2264         (equal_diversion_CB, cmp_diversion_CB): New functions.
2265         (m4_output_init): Set up list.
2266         (m4_output_exit): Tear down list.
2267         (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
2268         list iteration.
2269         (m4_make_diversion): Change creation of new diversions.
2270         (m4_insert_diversion_helper): New function, to avoid list
2271         searches.
2272         * tests/builtins.at (divert): The test now passes.
2273         * NEWS: Document this improvement.
2275         Convert diversions to list instead of sparse array, part 1.
2276         * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
2277         for length.
2278         * m4/output.c (diversion, total_buffer_size, output_unused):
2279         Track size in size_t.  All users changed.
2280         (struct diversion): Reduce size now, to compensate for part 2.
2281         (m4_make_diversion, make_room_for): Avoid malloc overflow.
2282         (m4_output_exit): Fix typo in assert.
2283         (m4_output_init, make_room_for, m4_make_diversion)
2284         (m4_insert_diversion, m4_freeze_diversions): Adjust users of
2285         struct m4_diversion to disambiguate the new union.
2286         * tests/builtins.at (divert): Detect this failure.
2288 2006-10-25  Eric Blake  <ebb9@byu.net>
2290         * m4/m4module.h (m4_push_builtin): Add parameter.
2291         * modules/m4.c (defn): Update caller.
2292         * m4/input.c (file_read_init, string_read_init): No longer
2293         needed.
2294         (input_funcs): Change signature of read_func, all callers
2295         updated.
2296         (composite_peek, composite_read, composite_unget),
2297         (composite_print, composite_funcs): New input type.  Not yet
2298         fully utilized, but one step closer to fixing defn.
2299         (m4_input_block): Make every input block track current file and
2300         line.  Rename some members.  Remove unused out_line.  Add support
2301         for composite input block.
2302         (input_change): New flag.
2303         (file_peek, file_read, file_clean, file_unget, file_print):
2304         Update callers.
2305         (m4_push_file, m4_push_builtin, m4_push_string_init)
2306         (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
2307         (m4_skip_line, pop_input): Track input block changes.
2308         (m4_pop_wrapup): Avoid overflow.
2309         (init_builtin_token): Handle composite input.
2310         (next_char): Handle input block changes.
2311         * doc/m4.texinfo (Location): Remerge from branch.
2313         * src/m4.h (includes): Need <locale.h> after all; fixes
2314         regression from yesterday.
2316         * m4/system_.h (obstack_regrow): New macro.  Hopefully glibc will
2317         accept it someday.
2318         * m4/macro.c (expand_macro): Avoid referencing invalid memory.
2319         Handle nesting the argc obstack.
2320         (expand_token): Avoid unnecessary malloc.
2321         (collect_arguments): Copy name before invalidating it.
2322         (argc_stack, argv_stack): New variables.
2323         (m4_macro_expand_input): Initialize argc and argv stacks once per
2324         file, instead of once per macro.
2326 2006-10-24  Eric Blake  <ebb9@byu.net>
2328         * src/m4.h (includes): Add gettext.h, for N_.  Assume setlocale.
2330 2006-10-23  Eric Blake  <ebb9@byu.net>
2332         * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
2333         from branch regarding stripped leading whitespace.
2335         * modules/m4.c (includes): Use safe headers even when configured
2336         with --enable-assert.
2337         (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
2338         #defined as mkstemp_safer.
2340 2006-10-21  Eric Blake  <ebb9@byu.net>
2342         * modules/m4.c (m4_make_temp): Change signature.
2343         (maketemp, mkstemp): Update callers.
2344         * modules/m4.h (m4_make_temp_func): New export.
2345         * modules/gnu.c (mkdtemp): New macro.
2346         * doc/m4.texinfo (Operation modes): Document interaction with
2347         --safer.
2348         (Mkdtemp): New node.
2349         * tests/builtins.at (mkdtemp): New test.
2350         (mkstemp): Check for umask effect.
2351         * NEWS: Document new builtin.
2353         * tests/generate.awk (normalize): Update recognition of trailing
2354         spaces in tests.
2355         * doc/m4.texinfo: Minor formatting fixes from branch.
2356         (Foreach, Improved foreach): Merge from branch.
2357         * examples/foreach.m4: Merge from branch.
2358         * examples/foreachq.m4: New file from branch.
2359         * examples/foreach2.m4: Likewise.
2360         * examples/foreachq2.m4: Likewise.
2362         * doc/m4.texinfo (titlepage): Add myself as author.
2363         * src/main.c (AUTHORS): Likewise.
2365 2006-10-19  Eric Blake  <ebb9@byu.net>
2367         * modules/m4.c (m4_make_temp, mkstemp): New functions.
2368         (maketemp): Add POSIX behavior and a warning.
2369         * tests/others.at (maketemp): Move this test...
2370         * tests/builtins.at (mkstemp): ...to here, and beef up.
2371         * tests/options.at (--safer): Update to new warning message.
2372         * doc/m4.texinfo (Mkstemp): Sync from branch.
2373         (Extensions): Update maketemp behavior.
2374         * NEWS: Document that maketemp now always warns.
2376         * tests/generate.awk: For ease of doc-writing, simplify selection
2377         of '-Ipath/to/examples' to '@comment examples'.
2378         * examples/forloop.m4: Simplify.
2379         * examples/forloop2.m4: New file.
2380         * examples/quote.m4: New file.
2381         * doc/m4.texinfo (Improved forloop): New node.
2382         (Manual): Clarify use of examples directory.
2383         (Shift, Forloop): Resync from branch.
2384         (Include, Location): Update to new usage of examples directory.
2386         * m4/system_.h (includes): Pick up <unistd.h> before checking for
2387         _POSIX_VERSION.
2388         (gettext_noop): Don't define here, let gettext.h do it instead.
2389         * po/POTFILES.in: Update entries to reflect gnulib imports.
2391 2006-10-16  Eric Blake  <ebb9@byu.net>
2393         * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2394         configmake'.
2395         * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
2396         pkglibexecdir support.
2397         * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
2398         worry about pathconf.h, now that gnulib does it for us.
2399         (pkgmodincludedir): Simplify.
2400         (pkglibexecdir): Delete, now that automake does this.
2401         * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
2402         * src/main.c (usage): Likewise.
2403         * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
2405         * doc/m4.texinfo: Port some changes from the branch.
2406         (Invoking m4): Promote to a chapter, instead of a section of
2407         Preliminaries.
2408         (Operation modes, Dynamic loading features, Preprocessor features)
2409         (Limits control Frozen state, Debugging options)
2410         (Command line files): Subdivide into new sections.
2411         (Cleardivert): Rename from cleardiv.
2413 2006-10-14  Eric Blake  <ebb9@byu.net>
2415         * tests/others.at (stdin closed): Update to match previous patch.
2417         * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
2418         is not portable.
2419         Reported by Ralf Wildenhues.
2421         * modules/m4.c (undivert): Merge from branch.
2422         * doc/m4.texinfo (Improved fatal_error): Fix typo.
2423         (Improved exch): New node, copied from branch.
2424         (Improved cleardivert): Update from branch.
2425         * THANKS: Update.
2427 2006-10-13  Eric Blake  <ebb9@byu.net>
2429         * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
2430         not config-h.in.
2431         * modules/gnu.c (builtin, indir): Transparently handle builtin
2432         tokens from defn.
2433         * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
2434         * m4/input.c (m4_pop_wrapup): Display debug message when switching
2435         to wrapped text.
2436         (m4_input_init): No need to use empty file any more.
2437         (file_print): Display correct file name.
2438         * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
2439         dereference a NULL file name.
2440         * m4/m4module.h (m4_pop_wrapup): New parameter.
2441         (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
2442         prototypes.
2443         * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
2444         * m4/symtab.c (m4_symbol_value_groks_macro): New method.
2445         * src/main.c (main): Adjust caller.
2446         * tests/options.at (--debugmode): Test more output from -dV.
2448 2006-10-12  Eric Blake  <ebb9@byu.net>
2450         * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
2452         * m4/m4private.h (m4__next_token_is_open): New prototype.
2453         * m4/m4module.h (m4_push_single): Delete; push_string is an
2454         adequate interface, and removing support for this simplifies the
2455         input engine.
2456         (m4_push_wrapup): New parameter.
2457         (m4_is_syntax): Delete; m4_has_syntax is sufficient.
2458         (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
2459         start-quote and start-comment exclusive from other syntax
2460         categories.
2461         * m4/syntax.c: Likewise.
2462         * m4/input.c (input_funcs): Make polymorphic without requiring
2463         clients to know whether they are located at isp.  All users
2464         changed.
2465         (file_names): New variable.
2466         (m4_input_init): Initialize it.
2467         (m4_push_file): Use it.
2468         (m4_input_exit): Free it after use.
2469         (m4__next_token): Simplify slightly.
2470         (m4__peek_token): Rename and simplify...
2471         (m4__next_token_is_open): ... to this.  In particular, this
2472         allows us to avoid a double ungetc, which POSIX doesn't
2473         guarantee.
2474         (struct m4_input_block, m4_push_single, single_peek, single_read):
2475         Remove support for single characters, as the input engine now
2476         guarantees we don't need it.
2477         (file_unget, string_unget, m4_input_print, unget_input):
2478         Strengthen assertions.
2479         (file_init_funcs, file_read_init): New for file reading.
2480         (string_init_funcs, string_read_init): New for wrapped text.
2481         (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
2482         Support wrapped text with locations.
2483         (m4_skip_line): Support dnl across include file boundary.
2484         (peek_char): Don't pop input when peeking.
2485         (file_peek): Peek can be called at the end of the file.
2486         (string_read): Don't read beyond string bounds.
2487         * m4/macro.c (expand_token, collect_arguments): Update callers.
2488         (expand_macro): Report errors at location of open parenthesis.
2489         (expand_token, expand_argument, process_macro): Avoid negative
2490         array dereferences with m4_has_syntax.
2491         * m4/utility.c (skip_space): Likewise.
2492         * modules/m4.c (m4wrap): Update caller.
2493         * tests/builtins.at (__file__, __line__, dnl): New tests.
2494         * tests/options.at (--debugmode): Normalize the output.
2495         * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
2496         Remerge recent changes from branch.
2497         (Improved fatal_error): New node from branch.
2499 2006-10-11  Eric Blake  <ebb9@byu.net>
2501         * src/main.c (usage, long_options): Add --debugmode as an alias
2502         for --debug, to match macro name.
2503         * tests/options.at (--debugmode): Rename from --debug, and test
2504         for new alias.
2505         (--discard-comments): Augment test.
2506         * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
2507         * NEWS: Likewise.
2509 2006-10-10  Eric Blake  <ebb9@byu.net>
2511         Trace improvements: debugmode(c) was always printing the last two
2512         lines paired, combine them; and show non-text expansions.
2513         * m4/macro.c (trace_prepre): Update to show what the macro will
2514         expand to.
2515         (trace_pre): No need to special-case on debugmode(c).
2516         (trace_post): Likewise.  Also, show non-text expansions.
2517         (expand_macro): Update caller.  Collecting arguments can change
2518         debug mode, so cache values beforehand.
2519         (trace_format): Remove support for unused %l%S%r, and fix support
2520         for %z to match gcc's attribute((printf)).
2521         (trace_header): Update caller.
2522         * m4/input.c (struct m4_input_block): Rename from input_block.
2523         (struct input_funcs): Add print_func member.
2524         (file_print, builtin_unget, builtin_print, string_print)
2525         (m4_input_print): New functions.
2526         (m4_push_string_finish): Change return type.
2527         (m4_push_file): Fix missing use of close parameter.
2528         * m4/debug.c (m4_debug_decode): Don't clear pending traces.
2529         * m4/m4module.h (m4_input_print): New prototype.
2530         * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
2531         to match behavior change.
2532         * tests/options.at (--debug): Likewise.
2533         * tests/macros.at (Propagation of traceon)
2534         (Propagation of --trace): Likewise.
2535         * tests/others.at (stderr closed, stdout closed, stdin closed):
2536         Likewise.
2537         * doc/m4.texinfo (Forloop): Simplify.
2538         (Trace): Update to changed behavior.
2539         (Debugmode): Document this change.
2540         * src/main.c (usage): Likewise.
2541         * NEWS: Likewise.
2543 2006-10-09  Eric Blake  <ebb9@byu.net>
2545         * m4/path.c (m4_include_env_init): Don't alter result of getenv.
2546         Reported by Ralf Wildenhues.
2548         * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
2550 2006-10-07  Eric Blake  <ebb9@byu.net>
2552         * m4/m4module.h (m4_set_exit_failure): New prototype.
2553         * m4/utility.c (m4_set_exit_failure): New function.
2554         * modules/m4.c (m4exit): Use it to avoid yet another global
2555         variable export in libm4.
2557 2006-10-06  Eric Blake  <ebb9@byu.net>
2559         * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
2560         up.
2561         * tests/others.at (stdout closed): Fix final check.
2563         Replace uses of tmpfile with clean-temp, since tmpfile is
2564         incompatible with closeout.
2565         * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
2566         exit status of m4.
2567         * tests/others.at (stderr closed): Likewise.
2568         * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
2569         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
2570         clean-temp.
2571         * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
2572         (m4_tmpfile, cleanup_tmpfile): New functions.
2573         (make_room_for, m4_insert_diversion): Use clean-temp module.
2574         * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
2575         tmpfile.
2576         * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
2578         * m4/utility.c (m4_numeric_arg): Merge from branch.
2579         * modules/gnu.c (debuglen): New builtin.
2580         * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
2581         Rename --arglength to --debuglen.
2582         * tests/options.at (--arglength): Rename to --debuglen.
2583         (deprecated options): Augment test.
2584         * doc/m4.texinfo (Invoking m4): Document the name change.
2585         (Debugmode): Rename from Debug Levels.
2586         (Debugfile): Rename from Debug Output.
2587         (Debuglen): New node.
2588         * NEWS: Document these changes.
2590         * modules/m4.c (m4exit): Fix typo.  Ensure desired exit status in
2591         case closing a module exits.
2593         * modules/m4.c (m4exit): Merge from branch.
2594         * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
2596 2006-10-05  Eric Blake  <ebb9@byu.net>
2598         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
2599         closeout.
2600         * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
2601         * src/main.c (main): Close stdout on exit.
2602         * m4/debug.c (set_debug_file): Check for write failure.
2603         * m4/m4.c (m4_delete): Don't mask write failure.
2604         * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
2605         macros before calling AT_CHECK.
2606         (M4_ONE_MEG_DEFN): New helper macro.
2607         * tests/others.at (stdout full): New test.
2608         (stderr closed, stdin closed, stdout closed): Augment.
2609         * tests/builtins.at (syscmd): New test.
2610         (esyscmd): Augment.
2612 2006-10-04  Eric Blake  <ebb9@byu.net>
2614         * tests/builtins.at: Alphabetize tests.
2615         * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
2616         * tests/generate.awk (new_test): Fix underquoting.
2617         * tests/others.at (maketemp): Rename from misc.
2618         (stdin closed, stdout closed, stderr closed): New tests.
2620 2006-10-03  Eric Blake  <ebb9@byu.net>
2622         Avoid all global variables in modules, so that --disable-static
2623         can work on cygwin.
2624         * examples/incl.m4: New file, from branch.
2625         * Makefile.am (dist_pkgdata_DATA): Distribute it.
2626         * doc/m4.texinfo (Location): Merge this section from branch.
2627         (Include): Update the test.
2628         * tests/generate.awk (new_test): Allow for VPATH build
2629         pre-processing of expected __program__ output.
2630         * m4/m4module.h (m4_current_diversion, m4_output_current_line):
2631         Avoid global variables.
2632         (m4_context_field_table): Add current_diversion, output_line.
2633         (m4_output_init, m4_make_diversion): Add parameter.
2634         (m4_get_program_name, m4_set_program_name): New accessors.
2635         * m4/m4private.h (m4_get_current_diversion),
2636         (m4_set_current_diversion, m4_get_output_line)
2637         (m4_set_output_line): New accessors.
2638         * m4/utility.c (m4_get_program_name, m4_set_program_name): New
2639         methods.
2640         * modules/m4.c (divnum, divert): Adjust callers.
2641         * modules/gnu.c (__program__): Likewise.
2642         * m4/output.c (m4_output_init, m4_make_diversion)
2643         (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
2644         (m4_insert_diversion): Likewise.
2645         * m4/input.c (file_clean, m4_push_file): Likewise.
2646         * src/freeze.c (reload_frozen_state): Likewise.
2647         * src/main.c (main, usage): Likewise.
2649         Partially plug memory leak when unloading gnu module.
2650         * tests/modules.at (unload gnu module): New test.
2651         * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
2652         (m4_regexp_compile): Move static storage to module visibility.
2653         * tests/options.at (--debug): Adjust to new output.
2655 2006-09-29  Eric Blake  <ebb9@byu.net>
2657         Even when not the first option, --help can't have side effects.
2658         * tests/options.at (--debugfile): Detect bugs in this area.
2659         * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
2660         stderr.
2661         * src/main.c (main): Fix it by deferring debugfile change.  Also,
2662         defer closing streams until after module tracing is done.
2663         * modules/gnu.c (debugfile): Make message consistent with command
2664         line.
2665         * doc/m4.texinfo (Invoking m4): Touch up the documentation.
2666         * NEWS: Document this fix.
2668         * modules/m4.c (dnl): Include macro name in warning message.
2669         * m4/input.c (m4_skip_line): Add parameter.
2670         * m4/m4module.h (m4_skip_line): Likewise.
2671         * src/main.c (usage): Update wording.
2672         * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
2673         issue of blind macros vs. POSIX is resolved.
2674         (Dnl): Merge another node from branch.
2676         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
2677         xstrtol.
2678         * m4/system_.h (N_): Define.
2679         * src/main.c (main): Validate numeric arguments.
2680         (size_opt): New function, idea borrowed from coreutils.
2681         * m4/macro.c (expand_macro): -L0 implies no limit.
2682         * doc/m4.texinfo (Invoking m4): Document this change.
2683         * NEWS: Likewise.
2684         * tests/options.at: (--arglength, --nesting-limit)
2685         (--regexp-syntax): New tests of argument validation.
2687 2006-09-28  Eric Blake  <ebb9@byu.net>
2689         * tests/options.at: Alphabetize the tests.
2691 2006-09-27  Eric Blake  <ebb9@byu.net>
2693         * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
2694         another parameter to print module info.
2695         * m4/macro.c (trace_pre): Adjust caller.
2696         * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
2697         * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
2698         * NEWS: Document this.
2700         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
2701         strnlen.
2702         * m4/symtab.c (symbol_value_print): Rename to...
2703         (m4_symbol_value_print): ...this, and...
2704         (m4_symbol_print): Update to allow -L length truncation.  Now
2705         truncation also affects dumpdef output and builtin names.
2706         * m4/m4private.h (nesting_limit, max_debug_argument_length):
2707         Switch to size_t.
2708         * m4/m4module.h (m4_symbol_print): Add parameter.
2709         (m4_symbol_value_print): New function.
2710         * modules/m4.c (dumpdef): Allow length truncation.
2711         * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
2712         repeating code.
2713         * doc/m4.texinfo (Invoking m4): Document -l better.
2714         (Dumpdef, Debug Levels): Document the effect of -l.
2715         * NEWS: Document this change.
2717         * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
2718         (m4_expand_ranges): Ensure we aren't picking up partial object on
2719         obstack.
2720         * modules/stdlib.c (setenv): Allow extra arguments.
2721         * modules/time.c (ctime): Avoid side effect in call to
2722         obstack_grow.
2723         * modules/gnu.c (m4_regexp_substitute): Likewise.
2724         (renamesyms): Avoid extra obstack_init.
2725         * src/freeze.c (reload_frozen_state): Remove debug comment.
2726         (produce_frozen_state): Simplify fprintf to puts where possible.
2727         * modules/modtest.c (modtest_init, modtest_finish): Likewise.
2728         * modules/import.c (import, symbol_fail, modules_fail): Likewise.
2729         * m4/macro.c (trace_flush): Likewise.
2730         * m4/debug.c (m4_debug_message_prefix): Likewise.
2731         * m4/path.c (include_dump): Likewise.
2732         * m4/module.c (module_remove): Likewise.
2733         (install_builtin_table): Simplify malloc and string
2734         concatenation.
2736 2006-09-26  Eric Blake  <ebb9@byu.net>
2738         * m4/m4module.h (m4_symbol_print): New prototype.
2739         (M4_DEBUG_TRACE_STACK): New enumerator.
2740         (m4_is_debug_bit): Allow use without requiring m4private.h.
2741         * m4/symtab.c (symbol_value_print, m4_symbol_print): New
2742         functions.
2743         * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
2744         callback.
2745         (dumpdef): Allow printing pushdef'd stacks.
2746         * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
2747         * src/main.c (usage): Document it.
2748         * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
2749         * NEWS: Likewise.
2751         * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
2752         gnulib headers.
2753         * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
2754         of lines during make.
2755         (AM_CPPFLAGS): Remove unneeded include path.
2756         (src_m4_CPPFLAGS): Remove redundant include path.
2757         * m4/system_.h Make preprocessor indentation consistent.
2758         (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
2759         macros.
2760         (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
2761         branch.
2762         (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
2763         (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
2764         (bool, true, false): Don't undefine here; stdbool takes care of
2765         that.
2766         * src/m4.h (includes): Assume config.h, and several standard
2767         headers.
2768         (__CYGWIN__, WIN32): Don't define here; let system.h do it.
2769         * m4/m4private.h: Assume config.h.
2770         * m4/output.c: Likewise.
2771         * m4/path.c: Likewise.
2772         * m4/resyntax.c: Likewise.
2773         * m4/utility.c: Likewise.
2774         * modules/gnu.c: Likewise.
2775         * modules/import.c: Likewise.
2776         * modules/load.c: Likewise.
2777         * modules/m4.c: Likewise.
2778         * modules/modtest.c: Likewise.
2779         * modules/mpeval.c: Likewise.
2780         * modules/perl.c: Likewise.
2781         * modules/shadow.c: Likewise.
2782         * modules/stdlib.c: Likewise.
2783         * modules/time.c: Likewise.
2784         * modules/traditional.c: Likewise.
2786 2006-09-21  Eric Blake  <ebb9@byu.net>
2788         * doc/m4.texinfo (Invoking m4): Add clarification on option
2789         processing behavior.
2790         * tests/options.at (option grouping): Test this.
2791         * THANKS: Update.
2792         Reported by Mikhail Teterin.
2794         * bootstrap: Add --force option, based on idea from coreutils.
2795         * README: Document that ./bootstrap and autoreconf are for
2796         developers, and not lightly done in tarballs.
2798 2006-09-20  Eric Blake  <ebb9@byu.net>
2800         * src/main.c (usage, OPTSTRING, main): Rename -e to -i.  Make
2801         warnings consistent.
2802         (long_options, HASHSIZE_OPTION): Warn on -H.
2803         * doc/m4.texinfo (Invoking m4): Document this.
2804         * tests/options.at (deprecated options): Update.
2806         Change the default of interactive sessions to match sh.
2807         * src/main.c (usage): Document this.
2808         (enum interactive_choice): New enum.
2809         (main): Use it to defer decision of interactive until after
2810         argument processing.
2811         * doc/m4.texinfo (Invoking m4): Document this.
2812         * NEWS: Likewise, plus add missing mention of -b.
2813         Reported by Stepan Kasal.
2815 2006-09-19  Eric Blake  <ebb9@byu.net>
2817         * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
2818         well as --error-output; the goal is to add -o/--output in some
2819         future version with semantics like gcc or autom4te.
2820         * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
2821         (Extensions): Reflect this update.
2822         (Renamesyms): Add another test.
2823         (Defn): Xfail for now, so that `make check' is happy.
2824         * NEWS: Document this change.
2825         * tests/generate.awk: Mark dynamic loading tests as such.  Allow
2826         xfailing tests.
2827         * tests/macros.at (Renamesyms collisions): New test, exposing
2828         renamesyms' coredump.
2829         * tests/options.at (--debugfile, --safer): Update to match
2830         change.
2832         * m4/debug.c (set_debug_file): Fix regression in -o when stdout
2833         and stderr are same file, introduced 2003-07-23.
2834         * tests/options.at (--debugfile): New test, to catch the bug.
2835         (deprecated options): Test --error-output.
2836         * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
2837         Deprecate --error-output, and replace it with --debugfile.
2838         * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
2839         Document this change.
2840         * NEWS: Likewise.
2842 2006-09-18  Eric Blake  <ebb9@byu.net>
2844         * modules/load.c (modules): Rename to...
2845         (m4modules): ...this, since it is an English word with 0
2846         arguments.
2847         * modules/gnu.c (symbols, m4symbols): Likewise.
2848         * doc/m4.texinfo (Listing Modules): Rename to...
2849         (M4modules): ...this.
2850         (Symbols): Rename to...
2851         (M4symbols): ...this.
2852         (Load, Foreach, Trace, Answers): Update to new spellings.
2853         * NEWS: Document this.
2855         * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
2856         such that without arguments, the global trace flag is changed
2857         rather than walking the table of all currently-defined macros.
2858         (set_trace_CB): No longer needed.
2859         * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
2860         (m4_set_symbol_traced): Delete.
2861         (m4_symtab_create): Nuke the nuke parameter.
2862         * m4/m4private.h (m4_get_symbol_value): Delete.
2863         * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
2864         (m4_set_symbol_name_traced): Free undefined entries that are no
2865         longer traced.
2866         (symbol_destroy_CB): Update caller.
2867         * m4/m4.c (m4_create): Update caller.
2868         * src/main.c (main): Likewise.
2869         (usage): Fix typo in last commit.
2870         * doc/m4.texinfo: Minor cleanups throughout.
2871         (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
2872         more nodes from branch.
2873         (Trace): Document new semantics, and how to simulate the old.
2874         * tests/builtins.at (multiquotes): Adjust to new semantics.
2875         * NEWS: Update somewhat.
2877 2006-09-14  Eric Blake  <ebb9@byu.net>
2879         Add --safer option, per debian bug 5898.
2880         * src/main.c (usage): Document new option.
2881         (SAFER_OPTION): New enumerator.
2882         (main): Set the option bit.
2883         * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
2884         accessors.
2885         * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
2886         (m4_get_safer_opt): New accessor.
2887         * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
2888         * modules/m4.c (syscmd, maketemp): Likewise.
2889         * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
2890         (Sysval, Maketemp): Add tests of this.
2891         * tests/options.at (--safer): Likewise.
2893 2006-09-13  Eric Blake  <ebb9@byu.net>
2895         * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
2896         stderr filtering.
2897         Reported by Ralf Wildenhues.
2899         Fix installcheck.
2900         * Makefile.am (check_LTLIBRARIES): Build test libraries in the
2901         tests directory, so we can be sure an installed build is not
2902         picking up uninstalled non-test libraries.
2903         (check-local, installcheck-local): Depend on test libraries.
2904         * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
2905         after file name.  Fix quoting.  Remove skipping the test, now
2906         that makefile guarantees test modules will exist.
2907         (Freezing modules, modules: shadow, modules: unload)
2908         (modules: trace): Always put test modules in module path.
2909         (modules: importing): Likewise, and rely on AT_CHECK_M4 for
2910         stderr munging.
2911         * src/main.c (usage): Document default module search path.
2912         (import_environment, frozen_file_to_read, frozen_file_to_write):
2913         Move...
2914         (main): ...here.
2915         * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
2916         * tests/m4.in: ...not here.
2917         Reported by Ralf Wildenhues.
2919 2006-09-08  Eric Blake  <ebb9@byu.net>
2921         * bootstrap: Kill unrelated copy-n-paste code from argument
2922         parsing.  Let Makefile generate testsuite.
2923         * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
2925 2006-09-07  Eric Blake  <ebb9@byu.net>
2927         * m4/m4module.h (m4_peek_input): No longer export.
2928         (m4_error_at_line, m4_warn_at_line): New prototypes.
2929         (m4_is_symbol_void): New macro.
2930         (m4_push_file): Update prototype.
2931         * m4/m4private.h (m4__peek_token): New prototype.
2932         (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
2933         * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
2934         * src/main.c (main): Allow reading from stdin twice.
2935         * modules/m4.c (include): Adjust to new prototype.
2936         * m4/input.c: General comment cleanup.
2937         (file_peek, file_read, file_unget, push_file): Set end flag on
2938         EOF, so that we don't call getc twice.
2939         (push_file, file_clean): Port fix from branch to avoid closing
2940         stdin prematurely.
2941         (pop_input): Port fix from branch to avoid reading free'd memory
2942         when input ends mid-string.
2943         (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
2944         (string_peek, string_read): Always use unsigned char.
2945         (m4_skip_line): Warn when dnl cut short by EOF.
2946         (peek_input): Rename from m4_peek_input.
2947         (match_input): Update signature, to distinguish between `(' token
2948         and multi-char quote or comment beginning with `('.
2949         (m4_input_exit): Cleanup now done in m4_pop_wrapup.
2950         (m4__peek_token): New function, ported from branch.
2951         (m4__next_token): Update to new token types.
2952         * m4/macro.c (expand_token, expand_argument): Use peek_token.
2953         * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
2954         (Invoking m4): Remerge from branch.
2956         * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
2957         (check-local): and put dependency here.
2958         Reported by Ralf Wildenhues.
2960 2006-09-05  Eric Blake  <ebb9@byu.net>
2962         * m4/m4module.h (m4_debug_message): New prototype.
2963         (M4_DEBUG_TRACE_MODULE): New debug bit.
2964         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
2965         (M4_DEBUG_MESSAGE2): Delete these macros.
2966         * m4/debug.c (m4_debug_message): New method.
2967         (m4_debug_decode): Add module tracing as flag `m'.
2968         * m4/input.c (m4_push_file, file_clean): Use new method.
2969         * m4/path.c (m4_path_search): Likewise.
2970         * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2971         * m4/module.c (install_builtin_table, install_macro_table)
2972         (m4__module_open, module_close, module_remove): Promote several
2973         module debug messages outside of DEBUG_MODULES.
2974         (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
2975         DEBUG_MODULES with normal trace output.
2976         * src/main.c (usage): Document new flag.
2977         * doc/m4.texinfo (Debug Levels): Likewise.
2978         * Makefile.am ($(TESTSUITE)): Add missing dependency.
2979         * tests/m4.in: Neutralize platform-dependent module filenames.
2980         * tests/options.at (--debug): Update expected output.
2982 2006-09-05  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2984         * doc/m4.texinfo: Fix some typos.
2985         * tests/others.at: Likewise.
2987 2006-09-05  Eric Blake  <ebb9@byu.net>
2989         * m4/input.c (lex_debug): Remove dead code that broke compilation
2990         with --enable-debug.
2991         * m4/module.c (install_builtin_table, install_macro_table)
2992         (m4__module_init, m4__module_open, module_close)
2993         (module_remove): Fix compilation when --enable-debug.
2994         * m4/output.c (m4_shipout_text): Likewise.
2995         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
2996         libraries when --enable-debug.
2997         * configure.ac (DYNAMIC_MODULES): New variable, to pass
2998         information to testsuite.
2999         (modules to preload): Determine modules after we know whether
3000         shared libraries are supported.
3001         * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
3002         testsuite.
3003         * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
3004         * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
3005         (modules: shadow, modules: unload, modules: importing)
3006         (modules: trace): Use new macro.
3007         * tests/builtins.at (gmp): Likewise.
3009         * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
3010         All users updated.
3011         (expand_token): Avoid assertion just added to docs.
3012         (expand_macro): Track pending expansions, for when a symbol's
3013         definition changes during argument collection.
3014         (m4_macro_call, process_macro): Operate on symbol value, not
3015         symbol, since symbol may have changed during argument collection.
3016         * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
3017         (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
3018         (m4_get_symbol_value): Add fast macro version.
3019         * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
3020         (m4_macro_call): Adjust prototype.
3021         * m4/module.c (install_builtin_table): Check that flags are valid
3022         when creating builtin.
3023         * m4/symtab.c (m4__symtab_remove_module_references): Use
3024         m4_symbol_value_delete, rather than inlining it.
3025         (m4_symbol_value_copy): Copy placeholder text.
3026         (symbol_popval): Use m4_symbol_value_delete.
3027         (m4_symbol_value_delete): Implementation was missing when NDEBUG.
3028         Handle pending expansions.
3029         * modules/gnu.c (indir): Update to new prototype.
3030         * doc/m4.texinfo: Fix menus to be consistent with section names.
3031         (Defn): Add test that macro tokens flatten to empty string;
3032         triggered an assert before this patch.
3033         (Ifelse): Merge another node.
3034         (Loops): Split into...
3035         (Forloop, Foreach): New nodes; work is still underway on them.
3036         (Answers): Add more info on foreach macro; work is still underway.
3037         (Indir): Add test that indir collects arguments before looking up
3038         macro.
3039         * TODO: Update based on this patch.
3041 2006-09-01  Eric Blake  <ebb9@byu.net>
3043         * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
3044         * m4/hash.h (m4_free_hash_iterator): New prototype.
3045         * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
3046         ensure we don't do unsafe things while iterating.
3047         (HASH_ITER, ITER_CHAIN): New accessor macros.
3048         (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
3049         (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
3050         (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
3051         (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
3052         to catch unsafe actions.
3053         (m4_free_hash_iterator): New function, to avoid memory leaks, and
3054         when debugging, to track safe actions.
3055         (m4_hash_apply): Avoid memory leak.
3056         * m4/symtab.c (m4_symtab_apply): Likewise.
3057         * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
3058         in manually to src/ for now.
3059         * tests/builtins.at (gmp): Add keyword module.
3060         * tests/modules.at (Freezing modules, modules: shadow)
3061         (modules: unload, modules: importing, modules: trace): Likewise.
3063 2006-08-30  Eric Blake  <ebb9@byu.net>
3065         * m4/utility.c (m4_warn): Factor "Warning" out of messages into
3066         here.
3067         (m4_bad_argc, m4_numeric_arg): Update all callers.
3068         * m4/macro.c (m4_macro_call): Likewise.
3069         * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
3070         (Indir, Builtin, Ifdef): More doc merges.
3071         (Loops): Mention that documenting foreach would be nice.
3072         (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
3073         (Include, Eval, Location, M4exit): s/input.m4/stdin/.
3074         * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
3075         (substitute, syncoutput): Update all m4_warn callers.
3076         * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
3077         (traceon, traceoff): Make warning message consistent.
3078         (define, pushdef): Update all m4_warn callers.
3079         * tests/generate.awk: Choose file name so that documentation can
3080         show command-line behavior.
3081         * tests/builtins.at (define): Update to new wording.
3082         * tests/macros.at (pushdef/popdef): Likewise.
3083         * tests/freeze.at (loading format 1): Likewise.
3084         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
3086         * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
3087         the branch.
3088         (Defn): Add failing test case for mixing text and builtin.
3089         (Renamesyms): Improve wording, and identify core dump that needs
3090         fixing.
3092 2006-08-29  Eric Blake  <ebb9@byu.net>
3094         * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
3095         (Arguments, Pseudo Arguments): More doc merges from the branch.
3096         (Macro expansion): Turn example into test.
3097         (Pseudo Arguments): Add example of avoiding argument.
3098         * modules/m4.c (undefine, popdef): Accept multiple arguments.
3099         (define, pushdef): Warn on non-text macro name.
3100         (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
3101         warning/error messages.
3102         (ifdef): Ignore extra arguments.
3103         * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
3104         (m4__symtab_remove_module_references): Check that there is no leak.
3105         * tests/macros.at (pushdef/popdef): Update to new message.
3106         * tests/builtins.at (define): Likewise.
3107         * tests/freeze.at (loading format 1): Likewise.
3108         * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
3110         * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
3111         (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
3112         as accessor function, to avoid compiler warning.
3113         * m4/module.c (m4__module_open): Move declaration of variable to
3114         avoid compiler warning.
3115         * src/main.c (main): Avoid shadowing a global variable.
3116         * src/freeze.c (produce_symbol_dump): Avoid unused variable
3117         warning when NDEBUG.
3118         * tests/options.at (--discard-comments, --import-environment)
3119         (--debug, --prepend-include, --help and --version): Rename tests
3120         to name option tested.
3122 2006-08-28  Eric Blake  <ebb9@byu.net>
3124         * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
3125         * m4/module.c (install_builtin_table): ...to here, and add
3126         assertion that blind macros require arguments.
3127         * m4/m4module.h (struct m4_builtin): Document restrictions that
3128         must be met during module loading.
3129         * modules/gnu.c (changeresyntax, changesyntax): These are blind,
3130         so require an argument to avoid triggering assertion.
3131         (debugfile): Tweak error message.
3133 2006-08-25  Eric Blake  <ebb9@byu.net>
3135         * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
3136         (M4_BUILTIN_SIDE_EFFECT): New enumerators.
3137         (struct m4_builtin): New member flags replaces groks_macro_args,
3138         blind_if_no_args.  min_args and max_args are now 0-based.
3139         Rearrange members to reduce size on platforms where function
3140         pointers are 64 bits but regular pointers are 32.
3141         (m4_bad_argc): Add argument.
3142         * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
3143         * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
3144         effect into account.
3145         * m4/module.c (install_builtin_table): Adjust all users affected
3146         by this API change.
3147         * m4/macro.c (m4_macro_call): Likewise.
3148         * src/freeze.c (reload_frozen_state): Likewise.
3149         * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
3150         * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
3151         * modules/import.c (builtin_functions): Likewise.
3152         * modules/load.c (builtin_functions): Likewise.
3153         * modules/modtest.c (builtin_functions): Likewise.
3154         * modules/mpeval.c (builtin_functions): Likewise.
3155         * modules/perl.c (builtin_functions): Likewise.
3156         * modules/shadow.c (builtin_functions): Likewise.
3157         * modules/stdlib.c (builtin_functions): Likewise.
3158         * modules/time.c (builtin_functions, mktime_functions)
3159         (strftime_functions): Likewise.
3160         * doc/m4.texinfo (Loops): Update test now that shift is blind.
3161         (Macro Arguments): Fix typo in test.
3162         (Patsubst): Fix typo in test.
3163         * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
3164         end of string.  Fix return value when ignore_duplicates.
3165         * tests/builtins.at (patsubst): Fix typo in test.
3167         * tests/options.at (debug-flags): Update to reflect new message.
3168         (deprecated options, prepend-include, help and version): New
3169         tests.
3170         * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
3171         test omits an input file name.
3172         * src/main.c (long_options, main): Add -B/--prepend-include.
3173         (usage): Document it.
3174         (main): `m4 --help --version' now displays help, not version.
3175         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3176         dirname filenamecat.
3177         * m4/m4module.h (m4_add_include_directory): Add parameter.
3178         * m4/m4private.h (m4__include_init): New prototype.
3179         * m4/m4.c (m4_create): Put `.' on path before options are
3180         collected.
3181         * m4/path.c (includes): Assume C89.  Use gnulib for file name
3182         management.
3183         (m4__include_init): New function.
3184         (search_path_add): Allow prepending.
3185         (m4_add_include_directory, search_path_env_init): Adjust callers.
3186         (m4_path_search): Relative names now invoke path search, since
3187         `.' might not be first.
3188         * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
3190 2006-08-25  Bruno Haible  <bruno@clisp.org>  (tiny change)
3191         and Eric Blake  <ebb9@byu.net>
3193         * bootstrap: Run autopoint before gnulib-tool, since autopoint
3194         0.15 installs macros obsoleted by current gnulib.
3196 2006-08-25  Eric Blake  <ebb9@byu.net>
3198         * doc/m4.texinfo (Macro Arguments): Another section merged;
3199         testsuite failures now exposed.
3201 2006-08-23  Eric Blake  <ebb9@byu.net>
3203         * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
3204         (Input processing): More doc merges from the branch.
3205         (Regular expression syntax): Add introductory text.
3206         (Inhibiting Invocation): More doc merges from the branch.
3207         (Other tokens): Reorder after comments.
3208         * tests/generate.awk: Allow passing options to doc examples.
3210 2006-08-22  Eric Blake  <ebb9@byu.net>
3212         * tests/options.at (debug-flags): New test.
3213         * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
3214         not negative, to distinguish failure in m4_debug_decode.
3215         (m4_debug_decode): Add new parameter.
3216         * modules/gnu.c (regexp): Slight cleanup.
3217         (renamesyms): Ignore excess arguments.
3218         (syncoutput): Make case-insensitive, warn on bad argument.
3219         (debugmode): Factor -+ handling out to...
3220         * m4/debug.c (m4_debug_decode): ...here.
3221         (m4_debug_message_prefix): Fix spacing.
3222         * src/main.c (main): Let -d option adjust flags.
3223         * m4/input.c (file_clean): Avoid printing empty file name.
3224         * doc/m4.texinfo (Syncoutput): Document new range of input.
3225         (Invoking m4): Document use of multiple -d flags.
3227         Start porting various fixes from the branch that use gnulib.
3228         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3229         binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
3230         regexprops-generic stdlib-safer unlocked-io.
3231         * m4/debug.c (m4_debug_set_output): Close debug file on exec.
3232         * m4/path.c (m4_path_search): Close input file on exec, reject
3233         empty file name, fix parameter naming.
3234         * m4/output.c (make_room_for): Close diversion file on exec.
3235         (includes): Assume C89 headers.
3236         (tmpfile): For now, we don't want tmpfile-safer, because we want
3237         clean-temp later.
3238         * m4/m4private.h (includes): Use various gnulib headers.
3239         * doc/regexprops-generic.texi: Use gnulib's copy.
3241         * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
3242         * AUTHORS: Add copyright.
3243         * ChangeLog: Likewise.
3244         * README: Likewise.  Require automake 1.9b or later.
3245         * HACKING: New file.
3246         * README-alpha: Add copyright.
3247         * THANKS: Likewise.  Update.
3248         * doc/STYLE: Add copyright, and tweak for changed directories.
3249         * modules/README: Add copyright, and tweak for libtool version.
3250         * examples/COPYING: New file.
3251         * examples/WWW/COPYING: Likewise.
3252         * examples/WWW/m4lib/COPYING: Likewise.
3253         * modules/shadow.m4: Add copyright.
3254         * modules/perl.m4: Likewise.
3255         * modules/modtest.m4: Likewise.
3256         * modules/stdlib.m4: Likewise.
3257         * modules/time.m4: Likewise.
3258         * modules/time2.m4: Likewise.
3259         * po/Makevars: Likewise.
3260         * tests/iso8859.m4: Likewise.
3261         * tests/m4.in: Likewise.
3262         * NEWS: Add (C) to copyright.
3263         * TODO: Likewise.
3264         * m4/system_.h: Likewise.
3265         * tests/atlocal.in: Likewise.
3266         * tests/builtins.at: Likewise.
3267         * tests/freeze.at: Likewise.
3268         * tests/generate.awk: Likewise.
3269         * tests/macros.at: Likewise.
3270         * tests/modules.at: Likewise.
3271         * tests/options.at: Likewise.
3272         * tests/others.at: Likewise.
3273         * tests/testsuite.at: Likewise.
3274         * m4/utility.c: Spell out copyright years.
3275         * src/main.c: Likewise.
3277         * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
3279 2006-08-21  Eric Blake  <ebb9@byu.net>
3281         * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
3282         * modules/gnu.c (esyscmd): Use -1 for failure.  Set sysval to 0
3283         when no arguments are given, but without losing warning about 0
3284         arguments.
3285         * modules/m4.c (syscmd): Likewise.
3286         (includes): Assume C89.
3287         (m4_sysval): Make static.
3288         (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
3289         (sysval): Port calculation from branch.
3291 2006-08-20  Eric Blake  <ebb9@byu.net>
3293         * m4/macro.c (expand_macro): Move argument check...
3294         (m4_macro_call): ...to here, so indir will warn.
3295         * modules/gnu.c (__program__): New macro, ported from branch.
3296         (builtin): Perform argument check.
3297         (changesyntax): Avoid out-of-bounds read.
3299         * modules/gnu.c (includes): Assume stdlib.h, errno.
3300         (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
3301         (substitute): Add caller parameter, avoid out-of-bounds memory
3302         references.
3303         (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
3304         callers.
3306 2006-08-16  Eric Blake  <ebb9@byu.net>
3308         * po/POTFILES.in: Add more files that contain translatable
3309         strings.
3310         * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
3311         information to translators.
3312         (USE_MSGCTXT): New var for gettext 0.15.
3313         * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
3314         debug/trace messages in lower case.
3315         * m4/macro.c (expand_argument): Likewise.
3316         * m4/path.c (m4_path_search): Likewise.
3317         * src/main.c (main): Likewise.
3319 2006-08-14  Eric Blake  <ebb9@byu.net>
3321         * src/main.c (usage): Document --import-environment.
3322         * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
3324 2006-08-11  Eric Blake  <ebb9@byu.net>
3326         * bootstrap (func_get_translations): Only remove files when doing
3327         full update.
3328         (func_update_po): Avoid CDPATH problems.
3330 2006-08-10  Eric Blake  <ebb9@byu.net>
3332         * bootstrap (func_get_translations): New function.
3333         (func_update_po): Borrow ideas from tar to correctly pull in
3334         translations from newer location.
3336 2006-08-09  Eric Blake  <ebb9@byu.net>
3338         * bootstrap: Recent gnulib no longer has jm_* macros to worry
3339         about.
3340         * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3341         verror.
3342         * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
3343         (m4_error, m4_warn): ... these new prototypes.
3344         (m4_current_file, m4_current_line): Move into context, rather
3345         than leaving as globals.
3346         (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
3347         (m4_undivert_all, m4_input_init): Now takes context.
3348         * m4/utility.c (m4_error, m4_warn): New functions.
3349         * m4/m4private.h: Assume errno exists.
3350         (struct m4): Move warning_status to a bit flag,
3351         and add exit_status.  Adjust accessors accordingly.
3352         * src/main.c (print_program_name_CB): No longer needed.
3353         (main): Use new m4_get_fatal_warnings_opt.
3354         * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
3355         instead of issuing "INTERNAL ERROR".  Pass context when needed,
3356         and use new accessors.
3357         * m4/input.c: Likewise.
3358         * m4/macro.c: Likewise.
3359         * m4/output.c: Likewise.
3360         * m4/utility.c: Likewise.
3361         * modules/evalparse.c: Likewise.
3362         * modules/gnu.c: Likewise.
3363         * modules/load.c: Likewise.
3364         * modules/m4.c: Likewise.
3365         * modules/mpeval.c: Likewise.
3366         * src/freeze.c: Likewise.
3367         * src/main.c: Likewise.
3368         * tests/macros.at: Adjust to new message format.
3369         * tests/builtins.at: Likewise.
3370         * tests/freeze.at: Likewise.
3371         * tests/modules.at: Likewise.
3372         * doc/m4.texinfo: Likewise.
3374         * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
3375         newer gettext 0.15.
3377 2006-08-03  Eric Blake  <ebb9@byu.net>
3379         * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
3380         gracefully handle ENOSYS.
3381         * TODO: Update.
3382         * THANKS: Update.
3384 2006-07-28  Eric Blake  <ebb9@byu.net>
3386         * src/freeze.c (reload_frozen_state): Copy string when creating
3387         placeholder, to avoid memory corruption.
3388         * m4/symtab.c (symbol_popval): Avoid memory leak.
3389         (m4_symbol_rename): Avoid shadowing rename function.
3390         (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
3391         * tests/freeze.at (reloading unknown builtin): Add test.
3392         * tests/generate.awk: Capture m4.texinfo line number in
3393         testsuite.log, not just generated.at.
3395         Port idea from branch that a frozen file can request an unknown
3396         builtin without producing a warning unless the builtin is
3397         actually used.
3398         * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
3399         (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
3400         (m4_set_symbol_value_placeholder): New accessors.
3401         * m4/m4module.h (m4_is_symbol_placeholder),
3402         (m4_get_symbol_value_placeholder),
3403         (m4_set_symbol_value_placeholder),
3404         (m4_get_symbol_placeholder): Likewise.
3405         * m4/symtab.c (m4_is_symbol_value_placeholder),
3406         (m4_get_symbol_value_placeholder),
3407         (m4_set_symbol_value_placeholder): Likewise.
3408         (dump_symbol_CB): Handle new symbol type.
3409         * m4/macro.c (trace_pre): Likewise.
3410         (m4_macro_call): Warn when invoking a placeholder.
3411         * modules/m4.c (dumpdef): Handle dumping a placeholder.
3412         (defn): Warn when referencing a placeholder.
3413         * src/freeze.c (dump_symbol_CB): Ignore placeholder when
3414         freezing.
3415         (reload_frozen_state): When reloading unknown builtin, install a
3416         placeholder instead of warning.
3417         * tests/freeze.at (loading format 1): Allow warning when
3418         popdef'ing undefined function.
3420 2006-07-27  Paul Eggert  <eggert@cs.ucla.edu>  (tiny change)
3422         * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
3423         function. Shift by 7, not 3, for consistency with
3424         gnulib/lib/hash.c. Don't assume hash word is 32 bits.
3426 2006-07-27  Eric Blake  <ebb9@byu.net>
3428         * src/main.c (usage): Update to match branch.
3429         (main): Update --version info to distinguish between program name
3430         `m4' and package name `GNU M4'.
3431         (AUTHORS): Translate René Seindal's name.
3432         * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
3433         * Makefile.am (doc/m4.1): Update to match branch.
3434         * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
3435         branch.
3437         * m4/system_.h (EXIT_MISMATCH): Define.
3438         * src/main.c (main): Don't clear syntax table for version 1.
3439         (usage): Document exit status.
3440         * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
3441         branch, and require V directive to appear first in file.  Fix
3442         broken logic for detecting F and T in version 1 files.
3444 2006-07-22  Eric Blake  <ebb9@byu.net>
3446         * src/main.c (stackovf_handler): Document the problems in our
3447         overflow handler.
3448         * src/stackovf.c: Forward port changes in branch to use POSIX
3449         sa_sigaction when available.
3450         (process_sigsegv): Avoid buffer overrun when error string is
3451         translated, although the fact that we translate in a signal
3452         handler is still a bug.
3453         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
3454         from branch to modernize checks.
3456         * modules/format.c (format): Avoid compiler warning that str may
3457         be used uninitialized.
3459         * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
3460         spelling.
3461         (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
3462         (DEBUG_MACRO): Remove unused macro.
3463         * src/stackovf.c: Avoid compiler warnings.
3464         * m4/input.c: Likewise.
3465         * m4/module.c: Likewise.
3466         * m4/output.c: Likewise.
3467         * m4/path.c: Likewise.
3468         * m4/symtab.c: Likewise.
3469         * m4/syntax.c: Likewise.
3471 2006-07-20  Eric Blake  <ebb9@byu.net>
3473         * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
3474         Regenerate to explicitly ask for --assume-autoconf=2.60.
3476 2006-07-19  Eric Blake  <ebb9@byu.net>
3478         * po/ChangeLog: Merge into main ChangeLog, then delete file.
3479         * THANKS: Update.
3481         * doc/m4.texinfo (copying): Relax restriction on front-cover and
3482         back-cover texts.
3484 2006-07-17  Eric Blake  <ebb9@byu.net>
3486         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3487         0.14.5.
3489         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
3490         xvasprintf'.
3491         * modules/format.c (includes): Use xvasprintf.h.
3492         (format): Make static.  Avoid buffer overflow, that can lead to
3493         arbitrary code execution exploit.  Only pass unsigned char to
3494         is*().  Support F, g, and G specifiers.
3495         * doc/m4.texinfo (Format): Expose buffer overrun bug.  Document
3496         new specifiers.
3498 2006-07-17  Gary V. Vaughan  <gary@gnu.org>
3500         Ensure M4 compiles correctly with -DDEBUG, and use a single
3501         consistent definition of various /DEBUG_[A-Z]+/ symbols:
3503         * m4/input.c: Have commented out out DEBUG_INPUT only by default.
3504         (m4_print_token): Use m4_get_symbol_value_text and
3505         m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
3506         and VALUE_FUNC respectively.
3507         (m4__next_token): Use m4_print_token call instead of obsolescent
3508         print_token symbol.
3509         * m4/module.c: Have commented out out DEBUG_MODULE only by default.
3510         * m4/output.c: Similarly for DEBUG_OUTPUT.
3511         * m4/path.c: Similarly for DEBUG_INCL.
3512         * m4/symtax.c: Similarly for DEBUG_SYM.
3513         * m4/syntax.c: Similarly for DEBUG_SYNTAX.
3514         * src/stackovf.c: Similarly for DEBUG_STACKOVF.
3515         * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
3516         preprocessor macros defined with -DDEBUG compiles.
3518 2006-07-17  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3520         * bootstrap: Correct typo in --download-po argument parsing.
3522 2006-07-15  Eric Blake  <ebb9@byu.net>
3524         * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
3525         gendocs fdl'.
3526         * tests/generate.awk (normalize): Recognize @tabchar.
3527         * doc/m4.texinfo (Top): Start merging from branch.  Remove tabs.
3528         Fix menus.  Upgrade FDL license from 1.1 to 1.2.  Fix overfull
3529         hboxes.
3530         (Index macro, Shell commands, Incompatiblities): Rename nodes
3531         from Index, UNIX commands, Other incompat.
3532         (Platform macros, Using frozen files, Frozen file format 1)
3533         (Frozen file format 2, Copying This Manual, Indices): New nodes.
3534         * Makefile.am (EXTRA_DIST): Distribute gendocs.
3535         (MAINTAINERCLEANFILES): Clean up files from gnulib.
3536         (doc_m4_TEXINFOS): Depend on fdl.texi.
3537         (web-manual): New maintainer target.
3539 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
3541         * doc/m4.texinfo (Modules):  RMS asked me for an explanation of
3542         the modular architecture of M4.  The result is paraphrased here
3543         for the benefit of future readers of the manual.
3545 2006-07-14  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3547         * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
3549 2006-07-14  Eric Blake  <ebb9@byu.net>
3551         * src/main.c (main): Avoid compiler warning.
3552         * modules/gnu.c (renamesyms): Remove unused variable.
3554 2006-07-14  Gary V. Vaughan  <gary@gnu.org>
3556         * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
3557         (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
3558         new functions for managing regexp syntax options.
3559         * m4/m4private.h (m4): Add regexp_syntax field.
3560         * m4/resyntax.c: New file implements the above.
3561         * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
3562         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
3563         (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
3564         (m4_patsubst_do, m4_renamesyms_do): Removed.
3565         (builtin_changeresyntax): New builtin to change regular expression
3566         syntax.
3567         (m4_resyntax_encode_safe): Factor out diagnostics code.
3568         * src/freeze.c (produce_resyntax_dump): New function to dump
3569         default regexp syntax specifier to frozen file.
3570         (reload_frozen_state): Updated to action 'R' directive.
3571         * src/main.c (usage): Describe new -r option.
3572         (long_options, OPTSTRING): Declare it.
3573         (main): Encode and store cli regexp syntax option argument.
3574         * tests/freeze.at (regexp syntax): New test that regexp syntax
3575         survives freezing.
3576         * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
3577         * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
3578         (Epatsubst and Patsubst): Renamed to...
3579         (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
3580         documentation and added new examples.
3581         (Changeresyntax): New section describing changeresyntax builtin,
3582         and regexp syntax names.
3583         (Regular expression syntax): New section describing differences
3584         between various regular expression syntaxes.
3585         (Frozen files): Document 'R' directive.
3586         * NEWS: Updated.
3588 2006-07-13  Gary V. Vaughan  <gary@gnu.org>
3590         * bootstrap: Enhanced to work more like our other scripts:
3591         Add a copyright statement; support --version and --help; accept a
3592         --download-po option with argument as a substitute for DOWNLOAD_PO
3593         in the environment.
3595 2006-07-11  Eric Blake  <ebb9@byu.net>
3597         * Makefile.am (doc/m4.1): Port patch from branch that avoids
3598         intermediate file.
3599         * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
3600         changed.
3602 2006-07-10  Gary V. Vaughan  <gary@gnu.org>  (tiny change)
3604         * tests/builtin.at (patsubst, regexp):  Adjust these tests, now
3605         that `\0' is no longer accepted.
3607         * src/main.c (usage): Alphabetize options within their sections.
3609         * modules/gnu.c (m4_regexp_search, regsub, substitute)
3610         (esyscmd):  Improve comments.
3612         * modules/gnu.c (substitute): Remove old warning for \0.
3613         (substitute_warned): No longer required.  Removed.
3615         * modules/gnu.c: Put macro definitions into alphabetical order.
3617 2006-07-07  Eric Blake  <ebb9@byu.net>
3619         * tests/freeze.at (loading format 1): New file, with new test.
3620         * tests/testsuite.at: Include it.
3621         * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
3622         * tests/modules.at (Freezing modules): Likewise.
3624         * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
3625         (AC_CHECK_HEADERS): Assume signal.h.
3626         (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
3627         (AC_CHECK_FUNCS_ONCE): Likewise.
3628         * src/m4.h (includes): Assume signal.h.
3630 2006-07-05  Eric Blake  <ebb9@byu.net>
3632         Fix all testsuite failures on cygwin.
3633         * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
3634         branch-1_4.  Solves testsuite failure when uninstalled m4 is
3635         shadowed by redefinition of PATH in libtool wrapper.
3636         * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
3637         contains the -no-undefined required by cygwin.
3638         (TESTS_ENVIRONMENT): Export abs_top_builddir.
3639         * tests/others.at (misc): Port to platforms where /etc/passwd
3640         does not exist or does not contain user named root.
3641         * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
3642         directory.
3643         * tests/builtins.at (define, divert): Avoid overquoting.
3644         * tests/generate.awk (new_group): Likewise.
3646 2006-07-05  Gary V. Vaughan  <gary@gnu.org>
3648         The regs_allocated field in a struct re_pattern_buffer refers
3649         to the state of a particular re_registers struct when used in
3650         successive matches using the same compiled pattern.  Avoid a
3651         SEGV in `renamesyms' resulting from using a new re_registers
3652         with an existing re_pattern_buffer:
3654         * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
3655         pattern buffer and registers.
3656         (m4_regexp_search): New function to call re_regexp_search with
3657         correctly matched pattern buffer and register instantiations.
3658         (m4_regexp_compile): Return an m4_pattern_buffer.  Adust all
3659         callers.
3661 2006-07-04  Gary V. Vaughan  <gary@gnu.org>
3663         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
3664         changes to gnulib getopt.m4 since last build.
3665         * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
3666         if the system getopt fails M4_GETOPT tests.
3668 2006-06-22  Eric Blake  <ebb9@byu.net>
3670         * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
3671         Reported by Bruno Haible.
3673 2006-06-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3675         * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
3677 2006-06-19  Eric Blake  <ebb9@byu.net>
3679         * THANKS: Update.
3681 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3683         * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
3684         (clean-local): Split into and depend upon...
3685         (clean-local-tests, clean-local-src): ...these two.  The latter
3686         removes the libtool object directory below `src', to work around
3687         a buglet in Automake, failing to list it.
3688         (EXTRA_DIST): Distribute modules/perl.c.
3690 2006-06-19  Eric Blake  <ebb9@byu.net>
3692         * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
3693         right side of dependency; VPATH does that.
3694         (stamp-vcl): Update to use libtool's algorithm.
3695         (EXTRA_DIST): Distribute stamp-vcl.
3696         Reported by Ralf Wildenhues.
3697         (TESTSUITE): Revert earlier change that used absolute path, as
3698         that broke 'make dist' in VPATH.  Stick with $(srcdir) instead.
3699         (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
3700         (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
3701         atlocal takes care of it instead.
3702         (check-local, installcheck-local, clean-local): Inline absolute
3703         path to testsuite here, rather than relative path to testsuite
3704         elsewhere.
3706 2006-06-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3708         * m4/m4private.h (DELETE): Cast away const here...
3709         * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
3710         * src/freeze.c (reload_frozen_state): Avoid uninitialized
3711         variable warning.
3713 2006-06-19  Eric Blake  <ebb9@byu.net>
3715         * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
3716         .info pages are built.
3717         Reported by Ralf Wildenhues.
3718         (EXTRA_DIST): Inline definition of testsuite, so that make dist
3719         works again.
3721 2006-06-16  Eric Blake  <ebb9@byu.net>
3723         Follow recommendations from autoconf manual for autotest.
3724         * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
3725         turn it into an absolute path until autotest provides an option
3726         that allows us to avoid changing directories.  Properly quote
3727         throughout.
3728         (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
3729         (check-recursive): Delete unused target.
3730         ($(TESTSUITE)): Atomically update testsuite.
3731         (CD_TESTDIR): Simplify.
3732         (m4__cd): Delete unused macro.
3733         (check-local): Let TESTSUITEFLAGS influence the run.
3734         (installcheck-local): Let TESTSUITEFLAGS override
3735         AUTOTEST_PATH.  Add dependencies.
3736         (clean-local): Clean up.
3737         (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
3738         * README: Document how to use the testsuite.
3740 2006-06-15  Eric Blake  <ebb9@byu.net>
3742         * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
3744         * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
3745         clashes with m4sugar.
3746         * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
3747         * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
3748         * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
3749         * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
3750         * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
3751         * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
3752         * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
3753         * configure.ac: Likewise.
3754         (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
3755         * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
3756         conditional.
3757         * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
3759         Reduce compiler warnings.  Inside GMP, mpq_t is an array type, so
3760         const mpq_t is not assignable from plain mpq_t.  Avoid
3761         type-punning warnings caused trying to mix these types.
3762         * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
3763         (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
3764         * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
3765         (mult_term, exp_term): Remove type-punning casts.
3766         (numb_pow): Remove const qualifier.
3767         * src/freeze.c (reload_frozen_state): Fix typo in messages.
3768         Fix variables that can be used uninitialized, which fixes
3769         security hole where malicious frozen file can execute arbitrary
3770         code.
3772 2006-06-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3774         * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
3776 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3777         and Eric Blake  <ebb9@byu.net>
3779         Allow `make dist' to work again.
3780         * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
3781         (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
3782         (cvs-dist): Fix typo.
3783         * NEWS: Match current version number.
3785 2006-06-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3787         * Makefile.am (AM_CPPFLAGS):  Add $(LTDLINCL), so the right
3788         ltdl.h is used.
3790         * bootstrap: Do not run libtoolize manually, this is done
3791         correctly by autoreconf.  Invoke autoreconf with --no-recursive
3792         to avoid unnecessary rerunning of autotools for libltdl.
3794 2006-06-13  Eric Blake  <ebb9@byu.net>
3796         * THANKS: Update.
3798 2006-06-12  Eric Blake  <ebb9@byu.net>
3800         * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
3801         bother with mktemp.
3802         * src/m4.h: Don't declare mktemp.
3803         * m4/input.c (m4__next_token): Avoid bzero.
3804         * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
3805         * Makefile.am (doc/m4.1): Depend on installed help2man, rather
3806         than distributing outdated helptoman.pl.
3807         * doc/helptoman.pl: Delete.
3809 2006-06-10  Eric Blake  <ebb9@byu.net>
3811         * README (Patches): Document the current dependence on CVS
3812         builds of autotools.
3813         * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
3814         * configure.ac: Use consistent quoting throughout.
3815         (AC_PREREQ): Bump to 2.59d.
3816         (AC_INIT): Package name begins with uppercase.
3817         (AC_ARG_WITH): Use AS_HELP_STRING.
3818         (AM_INIT_AUTOMAKE): Enable gnits mode.
3819         (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
3820         (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
3821         (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
3822         done by gnulib or automake, or which autoconf has declared
3823         obsolete.
3824         * m4/m4private.h (Includes): Assume C89 or better, and use errno
3825         unconditionally.
3826         * m4/output.c (Includes): Likewise.
3827         * modules/gnu.c (Includes): Likewise.
3828         * modules/m4.c (Includes): Likewise.
3829         * src/m4.h (Includes): Likewise.
3831         * README-alpha: Update web address.
3832         * README: Likewise. Change encoding to ASCII.  Remove old advice
3833         about cygwin.  Document bootstrapping dependency.
3834         * AUTHORS: Update from branch-1_4.
3835         * THANKS: Likewise.  Change encoding to UTF-8.
3836         * BACKLOG: Delete.  This file is too old and unmaintained to be
3837         worthwhile.
3838         * ChangeLog: Change encoding to UTF-8.
3840         Avoid compiler warnings.
3841         * m4/macro.c (trace_format): Don't mark this as a printf format,
3842         since we don't accept the same set of modifiers as printf.  It
3843         would be nice if gcc let us specify a custom format archetype.
3844         * src/main.c (main): Cast away const.
3846 2006-06-10  Andreas Schwab  <schwab@suse.de>  (tiny change)
3847             Eric Blake  <ebb9@byu.net>
3849         * modules/time.c (ctime): Pass correctly typed variable to
3850         m4_numeric_arg.
3851         (gmtime): Likewise.
3852         (localtime): Likewise.
3853         (strftime): Likewise.
3854         * m4/utility.c (m4_numeric_arg): For now, document arbitrary
3855         limit inherent in this interface.
3857 2006-05-08  Bruno Haible  <bruno@clisp.org>  (tiny change)
3859         * modules/m4.c (WEXITSTATUS): Provide fallback definition.
3860         (sysval): Use WEXITSTATUS.
3861         * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
3862         big-endian and little-endian wait status definitions.
3864 2006-05-06  Eric Blake  <ebb9@byu.net>
3866         * po/Makevars (MSGID_BUGS_ADDRESS): Add.
3867         * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
3868         in src, not gnu.
3870 2006-05-06  Eric Blake  <ebb9@byu.net>
3872         * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
3873         subdirectory to use.
3874         (support for -pipe): Move after LT_INIT, since it relies on
3875         libtool internals.
3877 2006-05-05  Eric Blake  <ebb9@byu.net>
3879         * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
3881         * THANKS: Update.
3883 2006-05-05  Bruno Haible  <bruno@clisp.org>
3884         and Eric Blake  <ebb9@byu.net>
3886         * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
3887         * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
3888         usage pattern.
3889         * bootstrap: Update usage of gnulib-tool.
3891 2006-05-04  Eric Blake  <ebb9@byu.net>
3893         * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
3894         Cleanup whitespace.
3896 2005-12-05  Gary V. Vaughan  <gary@gnu.org>
3898         * bootstrap (func_update_po): Synch with CVS GNU tar.  wget 1.9.x
3899         and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
3900         Reported by Eric Blake <ebb9@byu.net>
3902 2005-12-04  Gary V. Vaughan  <gary@gnu.org>
3904         * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
3905         http caching as -C is no longer supported by wget 1.10.x.
3906         Reported by Eric Blake <ebb9@byu.net>
3908 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
3910         * m4/module.c (caller_id): To match libtool-2.0 interface, changed
3911         to ...
3912         (iface_id): ...an lt_dlinterface_id type.
3913         (m4__module_find): New abstraction for lt_dlhandle_fetch.  Use
3914         throughout, instead of calling obsolete lt_dlhandle_find directly.
3915         (m4__module_next): Use multiloader-safe lt_dlhandle_iterate.  Use
3916         throughout, instead of calling obsolete lt_dlhandle_next.
3917         * m4/m4private.h (m4__module_find): Declare it.
3918         * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
3919         Use m4__module_next instead of obsolete lt_dlhandle_next.
3921 2005-10-20  Gary V. Vaughan  <gary@gnu.org>
3923         * bootstrap (func_update_po): Update pofiles directly from the
3924         translation project.
3925         * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
3926         po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
3927         these files under source control anymore.
3928         Suggested by Eric Blake <ebb9@byu.net>
3930 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3932         * ltdl/m4/m4-gnulib.m4: Update FSF contact address.  Somehow this
3933         file escaped the address updates on 2005-05-01.
3935 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
3937         * bootstrap: Allow user overriding of gnulib-tool location, and
3938         correctly determine module source directories whether gnulib-tool
3939         is given as a relative or absolute path, or is found by searching
3940         PATH.
3941         Reported by Eric Blake <ebb9@byu.net>
3943 2005-07-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3945         * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
3946         and $RM are defined for various versions of
3947         AC_LIBTOOL_COMPILER_OPTION.
3949         * bootstrap (AUTORECONF): New variable to allow user overriding of
3950         autoreconf path.
3952 2005-07-07  Gary V. Vaughan  <gary@gnu.org>
3954         * doc/m4.texinfo (History): Add better notes on the ancestory of
3955         GNU m4, and other historical interest.
3957 2005-05-08  Gary V. Vaughan  <gary@gnu.org>
3959         * m4/symtab.c (m4_symbol_rename): New function that performs a low
3960         level symbol rename.
3961         * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
3962         * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
3963         (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
3964         regsub...
3965         (erenamesyms, renamesyms): ...builtins that use these to implement
3966         macro renaming by regular expression.
3967         * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
3968         * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
3969         to stop the new generated tests from choking.
3971 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
3973         Since most of the build is handled from a single Makefile.am now,
3974         we can teach make about the dependencies between the m4 binary and
3975         the preopened modules it is built against:
3977         * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
3978         preopened modules.
3979         * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
3980         of the preopened modules have changed.
3982 2005-05-07  Gary V. Vaughan  <gary@gnu.org>
3984         * configure.ac (gl_MODULES): Add mkstemp for machines that don't
3985         have a native implementation.
3987 2005-05-06  Gary V. Vaughan  <gary@gnu.org>
3989         * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed.  These are
3990         handled already by gnu/exit.h.
3992         * configure.ac (gl_MODULES): Add assert to support a
3993         --disable-assert configure time option for NDEBUG setting.
3995         * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
3996         * bootstrap (src_modules): Add version-etc-fsf.
3997         * src/main.c (version_etc_copyright): Removed.
3999         * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
4001 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
4003         * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
4004         recognition macros.
4005         * src/freeze.c (produce_frozen_state): Use \n line-endings even
4006         on Windows, so that the frozen file reader will work.
4007         Reported by Josef T. Burger <bolo@bolo.com>
4009 2005-05-04  Vincent Lonngren  <Vincent.lonngren.759@student.lu.se>
4011         Forward port of a patch that allowed m4-1.4.2 to compile on
4012         QNX 6.3:
4014         * configure.ac (AC_CHECK_HEADERS):  Add signal.h,
4015         sys/signal.h.
4016         * src/m4.h: And include them as appropriate.
4017         * src/main.c, src/stackovf.h: Don't include signal.h literally;
4018         m4.h will include the correct file.
4020 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
4022         * m4/m4private.h: Make errno visible for the sources patched
4023         below.
4025 2005-05-04  Paul Eggert  <eggert@twinsun.com>
4027         * src/main.c (print_program_name_CB): Preserve errno, since
4028         M4ERROR relies on this.
4029         * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
4030         * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
4031         * m4/path.c (m4_path_search): Don't let "free" trash errno when
4032         returning NULL.
4034         * m4/output.c (m4_insert_file): Don't assume errno has a valid
4035         value simply because fread returns zero.  This fixes a
4036         portability bug reported by Marion Hakanson in
4037         <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
4039 2005-05-04  Santiago Vila  <sanvila@debian.org>
4041         * tests/stackovf.test: Use tempfile if available.
4043 2005-05-04  Robert Bihlmeyer  <robbe@orcus.priv.at>  (tiny change)
4045         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
4046         * m4/output.c (m4_insert_file): Do not mix buffered and
4047         unbuffered I/O, as this breaks on the Hurd.
4049 2005-05-04  Gary V. Vaughan  <gary@gnu.org>
4051         Gnulib has changed again.  Reimport.  Adjust.  Rinse.  Repeat.
4052         Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
4053         and libtoolize does a better job of ltdl importing now too, so
4054         take advantage of that while updating the tree:
4056         * acm4, config: Moved from here...
4057         * ltdl/m4, ltdl/config: ...to here.
4058         * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
4059         src/Makefile.am, tests/Makefile.am: Removed...
4060         * Makefile.am: ...and migrated to here, with adjustments to
4061         compensate for relative path differences.
4062         * commit: Adjust relative paths.
4063         * configure.ac: Adjust relative paths.
4064         (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
4065         patch.
4066         (LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
4067         the meanwhile, CVS HEAD libtool is needed.
4068         (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
4069         stricly new enough, we also need a patch.
4070         (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
4071         (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
4072         (gl_MODULES): Don't list getopt and version-etc, as they don't
4073         belong in libm4.
4074         * bootstrap: After running gnulib-tool to import the listed
4075         modules, fetch getopt and version-etc into src manually.
4076         (ltdldir): Change to ltdl.
4077         * src/main.c: Adjust for changes in version-etc API.
4078         * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
4079         but works when the getopt module isn't to be included in the lib.
4080         * README: Add note about patching autoconf and automake to
4081         bootstrap CVS m4.
4083 2005-05-02  Matt Kraai  <kraai@debian.org>  (tiny change)
4085         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
4086         * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
4087         empty file rather than to a nonexistent file.  This closes a
4088         common security hole.
4089         * modules/m4.c (m4_maketemp): Implement the above, by using
4090         mkstemp rather than mktemp.
4092 2005-05-01  Gary V. Vaughan  <gary@gnu.org>
4094         The FSF are moving offices today.  Changed their contact address
4095         in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
4096         `51 Franklin Street, Fifth Floor, MA 02110-1301'.
4098 2005-03-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
4100         * tests/Makefile (clean-local): Ignore testsuite cleanup
4101         failures.
4103 2005-03-11  Per Bothner  <per@bothner.com>  (tiny change)
4105         * tests/Makefile (clean-local): Only run the testsuite cleanup
4106         if the testsuite has been generated.
4108 2005-02-11  Stepan Kasal  <kasal@ucw.cz>
4110         * TODO: slight clarification of the example of qindir usage.
4112 2005-02-08  Gary V. Vaughan  <gary@gnu.org>
4114         * TODO: Add qindir requirement, and defn bug.
4115         From Stepan Kasal  <kasal@ucw.cz>
4117 2005-02-08  Stepan Kasal  <kasal@ucw.cz>
4119         * TODO: Add ``execution stack'', fix a typo.
4120         * doc/m4.texinfo: Typos.
4122 2004-12-24  Eric Blake  <ebb9@byu.net>
4124         * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
4125         to the gnu subdirectory.
4126         * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
4127         * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
4128         * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
4129         * m4/system_.h: Likewise, in non-configured includes.
4131 2004-10-14  Noah Misch  <noah@cs.caltech.edu>,
4132             Gary V. Vaughan  <gary@gnu.org>
4134         * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
4135         Protect definitions from macro expansion under -DNDEBUG by
4136         parenthesising the expanded function names.
4137         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
4138         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
4139         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
4140         (m4_is_syntax_macro_escaped): Similarly protect function
4141         definitions from macro expansion under -DNDEBUG by #undefing the
4142         matching macro names before each definition.  Also, move all the
4143         function definitions to the end of the file so that any
4144         invocations in the rest of the file pick up the fast macro
4145         versions.
4146         * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
4147         (m4_set_debug_file, m4_set_trace_messages)
4148         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
4149         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
4150         (m4_set_max_debug_arg_length_opt): New fast macro versions of the
4151         option setter functions.
4153 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
4155         * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
4156         to gnu.
4158 2004-09-23  Gary V. Vaughan  <gary@gnu.org>
4160         * src/main.c: Include gnulib files from the correct directory.
4162         * gnulib/*: Don't store any of the gnulib files in arch, as they
4163         generate spurious changes.
4164         * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
4165         gnulib macros now share our macro directory.
4166         (SUBDIRS): Descend into `gnu' rather than `gnulib'.
4167         * bootstrap: Call gnulib-tool to import from the gnulib tree.
4168         (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
4169         gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
4170         the gettext macros from autopoint that overwrite the gnulib-tool
4171         imported versions.  Import sources and Makefile.am into the `gnu'
4172         directory.  Changed all callers.
4173         * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
4174         gl_INIT): Call these gnulib-tool macros instead of the hardcoded
4175         for imported modules.
4176         * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
4177         acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
4178         hardcoding the gnulib macros they wrap.
4180 2004-07-15  Gary V. Vaughan  <gary@gnu.org>
4182         Latest CVS libtool can preload modules in libraries, including
4183         its own module loaders!  Tweak m4 so that it doesn't try to treat
4184         libltdl's module loaders as m4 modules when freezing and on exit:
4186         * gnulib/acm4/*.m4: Don't store these files in arch since they
4187         generate spurious changes.
4188         * bootstrap: Simplify initial libtoolize call, since CVS
4189         libtoolize is smarter these days.
4190         * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
4191         build.
4192         * m4/module.h (m4__module_exit): Missing declaration.
4193         * m4/m4private.h (m4__module_next): New function declaration.
4194         * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
4195         encapsulation.  Changed all callers.
4196         (m4__module_interface): New function to verify m4 loadable module
4197         interfaces.
4198         (m4__module_init): Register the interface validator.
4199         (m4__module_exit): Only close my own modules.
4200         * modules/m4.c (unistd.h): Provide missing declaration.
4201         (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
4202         (m4_expand_ranges): More missing declarations.
4203         * modules/modtest.c (export_test): Ditto.
4204         * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
4205         * src/main.c (main): Bump copyright year.
4206         * tests/modules.at: Fix sed syntax error.
4209 2004-06-17  Gary V. Vaughan  <gary@gnu.org>
4211         Tweaking to enable compilation with latest CVS libtool and
4212         libltdl.  We can't just dump the library files directly into the
4213         m4 directory anymore now that libltdl is built from pieces itself:
4215         * bootstrap: Rewritten to use latest libtoolize sanely, and to
4216         set up libltdl subdirectory.
4217         * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
4218         gnulib subdirectory's config.
4219         (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
4220         (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
4221         macros from gnulib.
4222         (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
4223         configure.ac, so use AC_WITH_LTDL instead.
4224         * Makefile.am (SUBDIRS): Add libltdl.
4225         * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated.  gnulib now uses
4226         gl_INCLUDED_REGEX.
4227         * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
4228         (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
4229         (libm4_la_LIBADD): Add LIBLTDL.
4230         * m4/ltdl.c, m4/ltdl.h: Removed.
4231         * m4/m4module.h: Include canonical ltdl.h.
4232         * po/*.po: Updated.
4234 2004-06-14  Gary V. Vaughan  <gary@gnu.org>
4236         * gnulib/import: Now updates makefile fragments, and configure.ac.
4237         * gnulib/m4/gnulib.am: New file.  Generated makefile fragments.
4238         * gnulib/m4/Makefile.am: include it.
4239         * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
4240         gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
4241         gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
4242         gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
4243         gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
4244         * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
4245         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
4246         gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
4247         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
4248         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
4249         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
4250         gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
4251         gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
4252         import.
4253         * gnulib/m4/getopt_int.h: New source file from latest gnulib
4254         import.
4255         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
4256         gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
4257         gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
4258         gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
4259         Updated source files from latest gnulib.
4261 2004-02-29  Gary V. Vaughan  <gary@gnu.org>
4263         * config/mailnotify: New file for mailing commit notifications,
4264         imported from cvs-utils.
4265         * commit: Updated from cvs-utils and tweaked for m4.
4267 2003-12-01  Gary V. Vaughan  <gary@gnu.org>
4269         * config/mkstamp: Updated from CVS libtool.
4270         * configure.ac: Generate a gnu coding standards compliant version
4271         number, and use it for the banner.
4272         * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
4273         mhen the TIMESTAMP changes in ChangeLog, but the file modification
4274         time doesn't (e.g. in cvs commit).  Otherwise dist tarballs will
4275         contain the previous version number.
4276         * src/main.c: Make --version output conform to the GNU standard.
4278         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
4279         * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
4280         m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
4281         shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
4282         time_la_SOURCES): ...so that these are defaulted correctly, and
4283         can be removed from this file.
4284         (AM_LDFLAGS): Add -module...
4285         (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
4286         traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
4287         import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
4288         the individual settings can be removed.
4289         * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
4290         * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
4291         m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
4292         shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
4293         time_la_LIBADD): ...so that these are picked up as a deplib of
4294         libm4 and don't need to be set explicitly.
4296 2003-11-18  Gary V. Vaughan  <gary@gnu.org>
4298         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
4299         from the standard build.  It is too fragile.
4301         * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
4302         CVS libtool after merging m4 changes across to libtool.
4304         * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
4305         * m4/path.c (search_path_add): Ditto.
4307 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
4309         * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
4310         libtool tags we don't use in configure.  This reduces the size
4311         of the script from over 1Mb to under 700Kb.
4313 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
4315         The import script was not written properly, and the last gnulib
4316         import was incomplete.  Fixed that problem, and reimport our
4317         gnulib dependencies, which picks up the address calculation
4318         overflow checks described by Paul below.  Also tweak the clients
4319         of the gnulib xalloc module not to use deprecated macros:
4321         * gnulib/import: Recurse through module dependencies rather than
4322         naively descending only one level.
4323         * configure.ac: Add calls to gnulib's strnlen and extension module
4324         macros.
4325         * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
4326         extension modules.
4327         * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
4328         gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
4329         gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
4330         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
4331         gnulib.
4332         * gnulib/acm4/libtool.m4: Updated from CVS libtool.
4333         * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
4334         place of `xcalloc (1, S)'.
4335         * m4/m4.c (m4_create): Likewise.
4336         * m4/m4private.h (m4_symbol_value_create): Likewise.
4337         * m4/symtab.c (symtab_fetch): Likewise.
4338         * m4/syntax.c (m4_syntax_create): Likewise.
4339         * src/freeze.c (reload_frozen_state): Likewise.
4340         * m4/path.c (search_path_add): Eliminate use of deprecated NEW
4341         macro.
4342         * m4/symtab.c (m4_symtab_create): Likewise.
4344 2003-11-13  Gary V. Vaughan  <gary@gnu.org>
4346         * tests/module.at: Comment typo.
4348 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
4350         * tests/modules.at (modules: importing): Apply some lateral
4351         thinking, and use AT_CHECK to compare the output of a sed pass
4352         over stderr against the canonical strerror string.
4354         * tests/modules.at (modules: importing): Edit the generated stderr
4355         output to canonicalize strerror output, before a comparison.
4357 2003-10-10  Gary V. Vaughan  <gary@gnu.org>
4359         Tru64UNIX perl is sloppy with namespace pollution.  This patch is
4360         careful not to trip over the mess:
4362         * modules/perl.c: Some builds of perl install headers that contain
4363         `#define try __builtin_try'.  Be sure to undefine that macro
4364         before `m4/hash.h' gets included, which uses the `try' symbol.
4365         * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
4366         `false' before including `stdbool.h'.
4367         (DELETE):  This symbol is not in m4's namespace, and is in any
4368         case only used internally...
4369         * m4/m4private.h (DELETE): ...so move it to here.
4370         Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
4372 2003-10-08  Paul Eggert  <eggert@twinsun.com>
4374         Don't use XMALLOC and XCALLOC.  Once we install the
4375         corresponding patch into gnulib, this will fix some
4376         address-calculation overflow bugs on hosts where calloc (A, B)
4377         returns garbage when A*B overflows.
4379         * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
4380         maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
4381         xmalloc, XCALLOC with xcalloc.
4382         * m4/m4.c (m4_create): Likewise.
4383         * m4/m4private.h (m4_symbol_value_create): Likewise.
4384         * m4/output.c (m4_output_init): Likewise.
4385         * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
4386         * m4/syntax.c (remove_syntax_attribute): Likewise.
4387         * src/freeze.c (reload_frozen_state): Likewise.
4388         * src/main.c (main): Likewise.
4390 2003-10-07  Gary V. Vaughan  <gary@gnu.org>
4392         * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
4393         gnulib/acm4 directories for aclocal m4 macros.
4394         * gnulib/Makefile.am (EXTRA_DIST): Removed.
4395         (MAINTAINERCLEANFILES): Add Makefile.in.
4396         * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
4397         modules we use.
4398         * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
4399         * gnulib/import: New file.  Temporary script for updating gnulib
4400         imported files, until gnulib-tool is working.
4401         * gnulib/config/codeset.m4, gnulib/config/error.m4,
4402         gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
4403         gnulib/config/getopt.m4, gnulib/config/gettext.m4,
4404         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
4405         gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
4406         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
4407         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
4408         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
4409         gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
4410         gnulib/config/nls.m4, gnulib/config/obstack.m4,
4411         gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
4412         gnulib/config/progtest.m4, gnulib/config/realloc.m4,
4413         gnulib/config/regex.m4, gnulib/config/restrict.m4.
4414         gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
4415         gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
4416         gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
4417         gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
4418         gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
4419         gnulib/config/xstrndup.m4: Removed.
4420         * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
4421         gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
4422         gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
4423         gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
4424         gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
4425         gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
4426         gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
4427         gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
4428         gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
4429         gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
4430         gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
4431         gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
4432         gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
4433         gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
4434         gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
4435         gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
4436         gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
4437         gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
4438         gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
4439         gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
4440         gnulib/import script.
4441         * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
4442         gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
4443         gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
4444         gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
4445         gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
4446         gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
4447         gnulib with gnulib/import script.
4448         * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
4449         guards ready for gnulib-tool to autoupdate on import.
4450         * config/debug.m4, config/gmp.m4, config/m4-error.m4,
4451         config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
4452         config/stackovf.m4: Moved from here...
4453         * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
4454         acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
4455         acm4/stackovf.m4: ...to here, to separate aclocal macros from
4456         configure time helper scripts.
4457         * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
4458         * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
4459         m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
4460         src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
4461         gnulib xalloc.h.
4462         * src/main.c (version_etc_copyright): Only output the current
4463         year.
4464         (version_etc): Call with new variadic API.
4466 2003-09-16  Gary V. Vaughan  <gary@gnu.org>
4468         * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
4469         version-etc module from CVS gnulib.
4470         * po/POTFILES.in: Add gnulib/m4/version-etc.c.
4471         * src/Makefile.am: Build it.
4472         * src/main.c: Use it.
4474         * gnulib/m4/exit.h: Import exit module from CVS gnulib.
4475         * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
4476         * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
4477         exit.h instead.
4479 2003-09-15  Charles Wilson  <cygwin@cwilson.fastmail.fm>,
4480             Gary V. Vaughan  <gary@gnu.org>
4482         * bootstrap: Separate options.
4483         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
4484         * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
4485         not set.
4486         * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
4487         (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
4488         (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
4489         (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
4490         $(LTLIBINTL) for gettext support on cygwin.
4491         * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
4492         have $(LTLIBINTL) from the preloaded module la files.
4493         * README: Remove the warning about using --disable-nls on Windows
4494         machines.
4496 2003-09-15  Gary V. Vaughan  <gary@gnu.org>
4498         * gnulib/m4/regex.c:  s/<regex.h>/"regex.h"/ or else the compiler
4499         picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
4500         is required.
4502 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
4504         * doc/STYLE: Document the gnulib header naming conventions, and
4505         #include policy.
4506         * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
4507         gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
4508         gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
4509         respectively.
4510         * gnulib/m4/Makefile.am: Remove the rules to build these headers.
4512         * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
4513         module from CVS gnulib.
4514         * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
4515         (gl_FUNC_STRTOL): In favour of the module macro.
4517 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
4519         Replace the getopt code with CVS gnulib getopt.  The source files
4520         detect whether they are in a glibc environment and preprocess away
4521         all of the code if there is a system getopt, so we can compile
4522         them into the m4 executable unconditionally:
4524         * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
4525         gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
4526         * configure.ac (gl_GETOPT): Use this instead of homebrew inline
4527         macros.
4528         * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
4529         version.
4530         * src/Makefile.am: Adjust.
4531         * src/main.c: Always include our shipped getopt.h.
4532         * po/POTFILES.in: Use new location of getopt.c.
4534 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
4536         * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
4537         * config/Makefile.am: Removed.  Automake 1.8 distributes the files
4538         in this directory automatically.
4539         * Makefile.am (EXTRA_DIST): Except config/mkstamp.
4541         * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
4542         isn't set yet.
4543         * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
4544         inline.
4545         * modules/Makefile.am (pkglibexecdir): Set it here.
4546         (pkgmodincdir): Renamed to pkgmodincludedir).  Changed all clients.
4548         * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
4549         Import regex module from CVS gnulib.
4550         * gnulib/config/restrict.m4: Ditto for dependee module restrict.
4551         * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
4552         do extra substitutions for Makefile.
4553         * configure.ac: Use it.
4554         * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
4555         from regex_.h if necessary.
4556         * m4/system_.h: Include the correct version of regex.h.
4557         * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
4558         version.
4559         * po/POTFILES.in: Use new location of regex.c.
4561         * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
4562         realloc.c: automake distributes these files already.
4564 2003-09-12  Gary V. Vaughan  <gary@gnu.org>
4566         Replace the xstrzdup code by importing the xstrndup module from
4567         CVS gnulib, along with its dependencies: strndup and strnlen:
4569         * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
4570         gnulib/config/xstrndup.m4: Import xstrndup module from CVS
4571         gnulib.
4572         * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
4573         gnulib/config/strndup.m4: Ditto wrt strndup.
4574         * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
4575         strnlen.
4576         * gnulib/m4/Makefile.am: Add rules from newly imported modules.
4577         However, contrary to gnulib, we install xstrndup.h.
4578         * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
4579         * gnulib/lib/xstrzdup.c: Delete.  This was never a gnulib file, it
4580         is an artifact of the old m4 portability layer.
4581         * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
4582         * m4/system_.h: Include xstrndup.h.
4583         * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
4585 2003-09-11  Gary V. Vaughan  <gary@gnu.org>
4587         Reimport the latest xalloc module from CVS gnulib, and adjust the
4588         m4 sources to take advantage of xalloc xfree.  Also create a new
4589         macro DELETE with the same semantics as the old m4 XFREE macro,
4590         and carefully tweak callers:
4592         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
4593         gnulib.
4594         * m4/utility.c (xfree): Removed.  This function is now supplied by
4595         gnulib xalloc.
4596         * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
4597         * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
4598         * m4/symtab.c (m4_symtab_create): Ditto.
4599         * m4/system_.h: Removed XFREE redefine.
4600         (DELETE): New macro with same functionality as the original m4
4601         XFREE macro, but based on xalloc.h now.  Changed all callers.
4602         * src/main.c (main): Use XMALLOC macro.
4603         * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
4604         instead of XFREE.
4605         * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
4607 2003-09-10  Gary V. Vaughan  <gary@gnu.org>
4609         Import the xalloc module from CVS gnulib, along with its
4610         dependencies: exitfail, malloc and realloc. We had different
4611         semantics for our XFREE and a function xfree() not supplied by
4612         gnulib, so also a bit of work to keep everything running
4613         smoothly:
4615         * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
4616         (gl_XALLOC): Use gnulib equivalents.
4617         * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
4618         gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
4619         * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
4620         * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
4621         realloc.
4622         * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
4623         gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
4624         * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
4625         imported modules.
4626         (pkgincdir): Removed.  Use pkgincludedir instead.
4627         * m4/m4private.h (XFREE): xfree already checks for NULL.
4628         * m4/system_.h: Use xalloc module, and remove macros already
4629         supplied by xalloc.h.
4630         * m4/utility.c (xfree): xalloc does not yet implement xfree, so
4631         moved the old definition from m4/xmalloc.c to here for now.
4633 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
4635         Import the error and progname modules from CVS gnulib.  Our old
4636         error.c subsumed the functionality of both, so a little adjustment
4637         was required to accomodate the split in sources.  Also added more
4638         wrapper macros to choose between a system installed error.h or our
4639         shipped gnulib error module:
4641         * m4/error.c, m4/error.h: Removed.
4642         * m4/Makefile.am: Adjust.
4643         (pkgincdir): Removed.  Use pkgincludedir instead.
4644         * m4/module.h, src/main.c: Don't include `m4/error.h'.
4645         * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
4646         error.h.
4647         * gnulib/m4/progname.c: Imported from CVS gnulib.
4648         * gnulib/m4/progname.h: Ditto.
4649         * src/main.c: Adjust to use progname module.
4650         * gnulib/m4/error.c: Imported from CVS gnulib.
4651         * gnulib/m4/error_.h: Ditto.
4652         * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
4653         if appropriate, and link a local error.h if the system version is
4654         missing.
4655         (libgnu_la_SOURCES) Add progname module sources.
4656         * gnulib/config/error.m4: Imported from CVS gnulib.
4657         * gnulib/config/strerror_r.m4: Ditto.
4658         * config/m4-error.c: New file.  Wrap gnulib error.m4 but arrange
4659         to have ERROR_H for Makefile substitutions and tell system.h
4660         whether the system error.h should be used, or a locally installed
4661         version.
4662         * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
4664 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
4666         * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
4667         s/gettext_.h/gettext.h/.
4669         * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
4670         automake have been fixed.
4672         * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
4673         gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
4674         of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
4675         rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
4677 2003-09-09  Gary V. Vaughan  <gary@gnu.org>
4679         The gnulib obstack module requires the gnulib gettext module for
4680         systems that do not have GNU gettext installed.  Because we use
4681         -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
4682         that directory incase it clashes with the system gettext.h.  This
4683         delta uses gettext_.h and extra rules in the Makefile to make a
4684         link to gettext.h when needed:
4686         * Makefile.am (auxdir): Removed.  No longer used.
4687         * configure.ac (ac_aux_dir): Removed AC_SUBST.  No longer used.
4688         (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
4689         moved.
4690         (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
4691         Makefile based build.
4692         (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
4693         of the macros are kept.
4694         * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
4695         * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
4696         * config/Makefile (ACLOCAL_MACROS): Removed.  Automake 1.7a
4697         distributes these automatically.
4698         * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
4699         warning from automake-1.7a.
4700         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
4701         m4_CHECK_DEBUGGING for consistency with gnulib prefixes.  Changed
4702         all callers.
4703         * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
4704         wrt. m4_FUNC_OBSTACK.
4705         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
4706         wrt. m4_sys_STACKOVF.
4707         * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
4708         wrt. _m4_LIB_GMP, m4_LIB_GMP.
4709         (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
4710         namespace.  Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
4711         respectively.
4712         * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
4713         * gnulib/m4/Makefile.am: Added a new block to make an appropriate
4714         gettext.h link on deficient systems.
4715         (pkginc_HEADERS): Mention $(GETTEXT_H).
4716         (EXTRA_HEADERS): Mention gettext.h.
4717         * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
4718         * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
4719         gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
4720         gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
4721         gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
4722         gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
4723         gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
4724         gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
4725         gnulib/config/po.m4, gnulib/config/progtest.m4,
4726         gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
4727         gnulib/config/ulonglong.m4: Imported from CVS gnulib.
4729 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
4731         We can't mirror the gnulib directory structure here, since we need
4732         to be able to eg. `#include <m4/obstack.h>' from our source files,
4733         which is much easier if the local obstack.h is created in a
4734         directory named m4.  Rather than trying to symlink everything into
4735         the m4 directory, now we build a libtool convenience library from
4736         the sources we get from gnulib and link that with libm4.la:
4738         * gnulib/config/extensions.m4: Imported from CVS gnulib.
4739         * gnulib/config/unlocked-io.m4: Ditto.
4740         * gnulib/m4/unlocked-io.h: Ditto.
4741         * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
4742         gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
4743         * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
4744         gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
4745         * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
4746         * m4/Makefile.am: Adjust.
4747         * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
4748         macros we redistribute.
4749         * gnulib/m4/Makefile.am: New file.  Build libgnu.la convenience
4750         library among others.
4751         (GNULIB_SRCS, GNULIB_MACROS): Removed.
4752         * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
4753         * config/m4-obstack.m4: Adjust.
4754         * po/POTFILES.in: Adjust.
4755         * configure.ac: Reformatting.  Call newly imported gnulib macros.
4756         * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
4757         bogus calls of `#include "m4.h"'.
4758         * Makefile.am: INCLUDES has been deprecated in favour of
4759         AM_CPPFLAGS.
4760         * m4/Makefile.am: Ditto.
4761         * modules/Makefile.am: Ditto.
4762         * src/Makefile.am: Ditto.
4764 2003-09-05  Gary V. Vaughan  <gary@gnu.org>
4766         * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
4768 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
4770         Migrate the obstack support into the gnulib directories for easy
4771         synchronisation with upstream files in gnulib:
4773         * config/gnu-obstack.m4: Moved from here...
4774         * config/m4-obstack.m4: ...to here.
4775         * config/Makefile.am (SPECIFIC_MACROS): Adjust.
4776         * m4/obstack.c, m4/obstack_.h: Moved from here...
4777         * gnulib/obstack.c, gnulib/obstack.h: ...to here.
4778         * po/POTFILES.in: Adjust.
4779         * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
4780         * m4/Makefile.am: Add a whole new section to link the obstack
4781         sources from the gnulib tree if necessary.
4782         * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
4783         from gnulib.
4784         * config/m4-obstack.m4: Rewrite as a wrapper for
4785         gnulib/m4/obstack.m4.
4787 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
4789         GNU M4 currently builds with a number of files adapted from
4790         upstream sources.  Recently the gnulib project on savannah.gnu.org
4791         has pulled together a great many of these externally maintained
4792         files.  This delta is the beginnings of isolating those files
4793         maintained in gnulib to make it easy to synchronise M4 with the
4794         upstream files prior to releases.
4796         * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
4797         directory.
4798         (SUBDIRS): Added new gnulib subdirectory.
4799         * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
4800         * config/stdbool.m4: Moved from here...
4801         * gnulib/m4/stdbool.m4: ...to here.
4802         * m4/stdbool_.h: Moved from here...
4803         * gnulib/lib/stdbool_.h: ...to here.
4804         * gnulib/Makefile.am: New file.  Make sure the gnulib tree is
4805         distributed.
4806         * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
4807         code to work with new stdbool_.h location.
4808         (gnulib_srcdir): New.
4810 2003-09-04  Gary V. Vaughan  <gary@gnu.org>
4812         * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
4813         (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
4814         builds to work.
4815         (SPECIFIC_TOOLS): New variable.  Moved mkstamp to here.
4816         (EXTRA_DIST): Use it.
4818         * bootstrap: CVS autoreconf leaves file droppings.  Remove
4819         aclocal.m4t incase autoreconf doesn't.
4821 2003-08-29  Gary V. Vaughan  <gary@gnu.org>
4823         * m4/gnu-obstack.h: Updated from CVS gnulib.  For consistency with
4824         the other gnulib imports, renamed to m4/obstack_.h.
4825         * m4/obstack.c: Updated from CVS gnulib.
4826         * m4/Makefile.am (EXTRA_HEADERS): Adjust.
4827         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
4828         header tests from gnulib obstack module.  AC_CONFIG_LINKS knows
4829         about vpath already, and $top_srcdir upsets CVS Automake, so the
4830         $top_srcdir reference was removed.
4832         * m4/system-h.in: For consistency with the gnulib imports, renamed
4833         to m4/system_.h.
4834         * m4/Makefile (EXTRA_HEADERS): Adjust.
4835         * configure.ac (AC_CONFIG_FILES): Adjust.
4837         * m4/stdbool_.h: New file from gnulib for systems without their
4838         own.
4839         * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
4840         * config/stdbool.m4: New file.  Macros from gnulib for same.
4841         * configure.ac: Use it.
4843 2003-08-27  Gary V. Vaughan  <gary@gnu.org>
4845         * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
4846         * config/gmp.m4: Ditto.
4847         * config/gnu-obstack.m4: Ditto.
4848         * config/stackovf.m4: Ditto.
4849         * m4/builtin.c: Ditto.
4850         * m4/debug.c: Ditto.
4851         * m4/error.c: Ditto.
4852         * m4/error.h: Ditto.
4853         * m4/gnu-obstack.h: Ditto.
4854         * m4/hash.c: Ditto.
4855         * m4/hash.h: Ditto.
4856         * m4/input.c: Ditto.
4857         * m4/m4.c: Ditto.
4858         * m4/m4module.h: Ditto.
4859         * m4/m4private.h: Ditto.
4860         * m4/macro.c: Ditto.
4861         * m4/module.c: Ditto.
4862         * m4/obstack.c: Ditto.
4863         * m4/output.c: Ditto.
4864         * m4/path.c: Ditto.
4865         * m4/regex.c: Ditto.
4866         * m4/regex.h: Ditto.
4867         * m4/strtol.c: Ditto.
4868         * m4/symtab.c: Ditto.
4869         * m4/syntax.c: Ditto.
4870         * m4/utility.c: Ditto.
4871         * m4/xmalloc.c: Ditto.
4872         * m4/xstrdup.c: Ditto.
4873         * m4/xstrzdup.c: Ditto.
4874         * modules/evalparse.c: Ditto.
4875         * modules/format.c: Ditto.
4876         * modules/gnu.c: Ditto.
4877         * modules/import.c: Ditto.
4878         * modules/load.c: Ditto.
4879         * modules/m4.c: Ditto.
4880         * modules/m4.h: Ditto.
4881         * modules/modtest.c: Ditto.
4882         * modules/mpeval.c: Ditto.
4883         * modules/perl.c: Ditto.
4884         * modules/shadow.c: Ditto.
4885         * modules/stdlib.c: Ditto.
4886         * modules/time.c: Ditto.
4887         * modules/traditional.c: Ditto.
4888         * src/freeze.c: Ditto.
4889         * src/getopt.c: Ditto.
4890         * src/getopt1.c: Ditto.
4891         * src/m4.h: Ditto.
4892         * src/main.c: Ditto.
4893         * src/stackovf.c: Ditto.
4895         * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
4896         ac_default_headers is an autoconf internal variable.
4897         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
4898         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
4900         * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
4901         * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
4902         delta.
4904 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
4906         * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
4907         C99 bool.
4908         * system-h.in (m4_boolean): Removed in favour of using C99 bool if
4909         possible or faking one with a typedef.  Changed all callers.
4911 2003-08-15  Gary V. Vaughan  <gary@gnu.org>
4913         Still cleaning up the users' module API, by taking out the stuff
4914         that isn't used by any existing modules, and moving specialised
4915         functions out of libm4 and into the module they are used by.
4917         * m4/m4module.h (m4_skip_space): No need to export this.  Moved...
4918         * m4/utility.c (m4_skip_space): ...to here the home of its only
4919         use, made static and renamed to `skip_space'.  Changed all
4920         callers.
4921         * m4/m4module.h (m4_expand_ranges): Removed prototype.
4922         * m4/utility.c (m4_expand_ranges): Moved definition from here...
4923         * modules/m4.c (m4_expand_ranges): ...to here, and exported using
4924         ltdl.
4925         * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
4926         casting .
4927         * modules/gnu.c (builtin_syntax): Import and use in this
4928         builtin implementation.
4929         * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
4930         Not used.  Deleted.
4931         * m4/macro.c (trace_flush): Except here where the macro is now
4932         manually inlined.
4933         * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4934         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
4935         moved...
4936         * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4937         (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
4939 2003-08-14  Gary V. Vaughan  <gary@gnu.org>
4941         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
4942         compiler based AC_CHECK_HEADER that was introduced in
4943         autoconf-2.56.
4944         * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
4945         * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
4946         * configure.ac: Use renamed M4_AC_LIB_GMP.
4948         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
4949         macro that requires arguments! This stops the shell's bad
4950         substitution error at configure time.
4952         * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
4953         variables to the testsuite shell.  Set the value of USE_GMP so
4954         that the gmp test will run!
4955         (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
4957 2003-08-11  Gary V. Vaughan  <gary@gnu.org>
4959         Libltdl already has an excellent mechanism for accessing C symbols
4960         in modules.  Lets use that!  Remove all the exporting cruft and
4961         just use lt_dlsym in conjunction with a few conventions to
4962         simplify module writers' jobs.  Also removed the table address
4963         caching code and otherwise simplified the module loader quite a
4964         bit.  To access exported symbols in other modules, first the
4965         exporting module must name the symbols <modname>_LTX_<symname>,
4966         and the importing module must define a function type called
4967         <symname>_func.  The importer then adds
4968         M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
4969         that wishes to call out to the exported functions.  Care must be
4970         taken that <symname> is non-NULL in the importing module incase
4971         M4_MODULE_IMPORT fails, but otherwise it can be called as if the
4972         definition was in the importers source.  Study
4973         `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
4974         m4_module_import will attempt to automatically load a module
4975         required for symbol access if it is not loaded already.
4977         * TODO: Removed the items fixed in this delta.
4978         * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
4979         module name.
4980         * m4/ltdl.h (lt_dlhandle_find): Declare it.
4981         * m4/module.c (m4_module_unload): Use it.
4982         * src/freeze.c (reload_frozen_state): Ditto.
4983         * m4/m4module.h (m4_export): Deleted.  Removed all references.
4984         (M4_MODULE_IMPORT): New user convenience macro for importing
4985         arbitrary symbols from other modules.
4986         * m4/module.c (m4_module_import): New function to service
4987         M4_MODULE_IMPORT macro.
4988         (module_data): Removed.  Looking up the tables on demand with
4989         lt_dlsym, rather than caching their addresses here simplifies the
4990         code substantially.
4991         (m4_get_module_builtin_table, m4_get_module_macro_table):
4992         Removed.  Changed all callers.
4993         (set_module_macro_table, set_module_builtin_table): Renamed to
4994         install_macro_table and install_builtin_table respectively, and
4995         simplified now that the cache is no more.
4996         * modules/gnu.c (builtin_symbols): Use this new mechanism to
4997         import m4_dump_symbols from the m4 module.
4998         (builtin_esyscmd): Likewise for m4_set_sysval and
4999         m4_sysval_flush.
5000         * modules/m4.c (m4_export_table): Removed.  Functions are
5001         addressed with the new mechanism which doesn't need this.
5002         (m4_set_sysval): New exported accessor function to prevent
5003         problems with variable access on inferior architectures.
5004         * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
5005         (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
5006         that we can have some type safety.
5007         * modules/modtest.c (export_test): C level exported function for
5008         testing the new import mechanism.
5009         * modules/import.c: New file for the import end of the test.
5010         * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
5011         * tests/modules.at: New test cases for intermodule symbol
5012         importing.
5014 2003-08-07  Gary V. Vaughan  <gary@gnu.org>
5016         * m4/m4module.c (m4_string): Moved from here...
5017         * m4/m4private.c (m4_string): ...to here.
5019         * m4/utility.c (dumpdef_cmp): Removed stale declaration.
5021 2003-07-29  Gary V. Vaughan  <gary@gnu.org>
5023         * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
5024         already available to module writers through
5025         m4_{get,set}_nesting_limit_opt(), so moved from here...
5026         * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
5027         (m4_create): Use it.
5029 2003-07-28  Gary V. Vaughan  <gary@gnu.org>
5031         Aside from auditing path.c for m4module.h api obfuscation, this
5032         delta introduces the concept of private struct members in opaque
5033         data types to GNU m4: See the STYLE file for details.
5035         * TODO: Remind ourselves that a rewrite of path.c is needed.
5036         * m4/m4module.h (m4_search_path, struct m4_search_path_info):
5037         Moved from here...
5038         * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
5039         here and renamed.  These type definitions are for internal api use
5040         only.  Changed all callers.
5041         * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
5042         Moved from here...
5043         * m4/path.c (search_path_env_init, search_path_add): ...to here
5044         and renamed.  These calls were never used outside this file.
5045         Changed all callers.
5046         (dirpath): Moved functionality of this static declaration...
5047         * m4/m4private.h (struct m4): ...to this new internal only
5048         search_path field.  Changed all callers.
5049         (m4__get_search_path): Added new internal api accessor.
5050         * m4/path.c (m4_search_path_info_new):  Removed.  Not used.
5051         (m4_include_init): Removed...
5052         * m4/m4.c (m4_create): ...because the new m4 field is now
5053         initialised here.
5054         (m4_delete): Recycle search_path memory.
5055         * src/main.c (main): Don't call m4_include_init now that it's
5056         gone!
5057         * doc/STYLE: Document convention for private fields in opaque
5058         ADTs.
5060 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
5062         Sometimes exporting the address of a symbol from a module isn't
5063         enough for other modules to call that symbol correctly.  If
5064         custom data types are used for function parameters, they need to
5065         be known to the caller.  This change introduces the concept of
5066         $(prefix)/include/modules/$(modulename).h to declare those
5067         structures.  Also we move m4_dump_symbols from libm4 to the m4
5068         module to show this concept in action.
5070         * m4/m4module.h (m4_dump_symbol_data): Moved from here...
5071         * modules/m4.h (m4_dump_symbol_data): ...to this new file for
5072         exporting data structures from modules/m4.c.
5073         * modules/m4.c, modules/gnu.c: Include it.
5074         * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
5075         * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
5076         prototypes.
5077         * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
5078         Moved from here...
5079         * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
5080         ...to here, with slight renaming.
5081         (m4_export_table): Prototype and add m4_dump_symbols.
5082         * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
5083         definition of m4_dump_symbols.
5084         * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
5085         * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
5087 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
5089         Create an export table in modules/m4.c in readiness for beefing up
5090         the module loader to track module exports and imports.
5092         * m4/m4module.h (m4_debug_flush_files): Removed prototype.
5093         * m4/debug.c (m4_debug_flush_files): Moved...
5094         * modules/m4.c (m4_sysval_flush): ...to here and renamed.
5095         * modules/gnu.c (builtin_esysval): Use it.
5096         * m4/m4module.h (m4_export): New type for declaring module symbols
5097         for export.
5098         * modules/m4.c (m4_export_table): List symbols exported from this
5099         module for use by other modules.
5101 2003-07-24  Gary V. Vaughan  <gary@gnu.org>
5103         An experiment: There is loads of code in libm4 which should be in
5104         the m4 module, but is also used by another module. Just because
5105         some linkers won't cope with calls across dynamic runtime loaded
5106         objects I initially left the code in libm4.  It will tidy the
5107         module api immensely if this code moves to the right place, I just
5108         need to remember to invent a suitable calling mechanism at some
5109         point.  For now, only modules that are statically linked and
5110         preloaded will get this treatment, so the only platforms that will
5111         break are those that require all symbols to be resolved at link
5112         time.
5114         * TODO: Reminder that what I am doing could reduce portability
5115         unless I do something more robust later.
5116         * m4/m4module.h (m4_sysval): No longer exported from libm4.
5117         * m4/utility.c (m4_sysval): No longer declared in libm4.
5118         * modules/Makefile.am: Reformatting.
5119         * modules/m4.c (m4_sysval): Declare it at place of use.
5120         * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
5122 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
5124         * m4/m4module.h: Reformatting and rearranging lines a bit.
5125         (m4_obstack): Save typing by typedefing `struct obstack'.  Changed
5126         all users.
5127         (m4_call_macro, m4_expand_input): Renamed...
5128         (m4_macro_call, m4_macro_expand_input): ...to these.  Changed all
5129         callers.
5130         (m4_expansion_level, m4_process_macro): Moved...
5131         * m4/macro.c (expansion_level, process_macro): ...to here, and
5132         made static.
5134         * m4/m4module.h (program_name): Not used by modules at all, so
5135         moved...
5136         * src/main.c (program_name): ...to here.
5137         (print_program_name): Renamed...
5138         (print_program_name_CB): ...to conform to the STYLE guide.
5140 2003-07-23  Gary V. Vaughan  <gary@gnu.org>
5142         More refactoring of the m4module.h API.  Replace #defines with an
5143         enum, and move non-public functions out of the public API.
5145         * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
5146         inclusion.
5147         * m4/macro.c (stdarg.h): Add ANSI C variadic header.
5148         * m4/debug.c (m4_debug, trace): Moved...
5149         * m4/m4private.h (struct m4): ...to fields of this struct.
5150         (m4_get_debug_file, m4_get_trace_messages): New fast access macros
5151         for the new fields.
5152         * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
5153         * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
5154         * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
5155         * m4/m4module.h (m4_context_field_table): Add entries for new
5156         debug_file and trace_messages fields.
5157         (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
5158         (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
5159         (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
5160         (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
5161         (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
5162         (m4_is_debug_bit): New macro to simplfy checks against the debug
5163         bits above.
5164         (m4_trace_format, m4_trace_header, m4_trace_flush)
5165         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
5166         prototypes.
5167         * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
5168         (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
5169         * m4/macro.c (trace_format, trace_header, trace_flush)
5170         (trace_prepre, trace_pre, trace_post): ...to these newly static
5171         functions, since they are only ever used from this file.  Changed
5172         all callers.
5174 2003-07-17  Gary V. Vaughan  <gary@gnu.org>
5176         Change the macros for checking syntax so that matching against
5177         multiple possible syntax classes can be done with a single
5178         comparison some of the time.  The various classes are now bits of
5179         an int that can be checked with bitwise logic operators.
5181         * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
5182         (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
5183         (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
5184         (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
5185         (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
5186         (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
5187         (M4_SYNTAX_ALNUM): Removed.  Changed all callers.
5188         (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
5189         (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
5190         (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
5191         (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
5192         Replace all calls with invocations of these...
5193         (m4_is_syntax, m4_has_syntax): ...New macros.
5194         * src/freeze.c (produce_syntax_dump): Remove mask argument, which
5195         is no longer required with new macros.  Changed all callers.
5197 2003-07-15  Gary V. Vaughan  <gary@gnu.org>
5199         * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
5200         values are returned as part of the internal interface, so they
5201         need to be moved...
5202         * m4/private.h: ...to here.
5203         * m4/macro.c (expand_token): Check for out of range
5204         m4_peek_input() results before looking up in the syntax table.
5205         (collect_arguments): Ditto.
5207         * NEWS: Note `$' syntax class.
5209 2003-07-08  Paul Eggert  <eggert@twinsun.com> and
5210             Gary V. Vaughan  <gary@gnu.org>
5212         Conform to POSIX if the POSIXLY_CORRECT environment is set.
5213         --traditional `define' now smashes all the definitions.
5215         * NEWS: Explain this.
5216         * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
5217         (Extensions): Explain that extensions that are incompatible with
5218         POSIX are disabled if POSIXLY_CORRECT is set.
5219         (Incompatibilities): Remove.
5220         (Define, Other Incompat): Explain difference
5221         between GNU and POSIX behavior of define, pushdef, popdef.
5222         * m4/m4.c (m4_get_posixly_correct_opt): New undef.
5223         * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
5224         * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
5225         (m4_get_posixly_correct_opt): New macro.
5226         * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
5227         POSIXLY_CORRECT.
5228         * modules/m4.c (builtin_functions): defn now takes any number of args.
5229         (builtin_define): Smash all the definitions if
5230         POSIXLY_CORRECT.
5231         (builtin_defn)): Allow any number of arguments.
5232         (builtin_undivert): Do not allow nonnumeric arguments
5233         if POSIXLY_CORRECT.
5234         * src/main.c (main): Set posixly-correct behavior if either
5235         POSIXLY_CORRECT is set, or if -G is given.
5236         * tests/builtins.at: New test for smashed definitions.
5238 2003-06-27  Gary V. Vaughan  <gary@gnu.org>
5240         * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
5241         * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
5242         not to slow the parser down.
5243         (M4__IS_STRING): New macro to test string syntax class membership.
5244         * m4/syntax.c: Adjust docucomment.
5245         (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
5246         (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
5247         * m4/input.c (init_builtin_token): Comment typo.
5248         (m4__next_token): Comment typo.
5249         Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
5250         by using the new M4__IS_STRING macro.
5251         * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
5252         variable references in macro expansions.
5254         * doc/m4.texinfo (Eregexp and Regexp): Typo.
5255         (Epatsubst and Patsubst): Typo.
5256         (Eval): Typo.
5258 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
5260         Move the global variables that pertain to syntax to a new `struct
5261         m4_syntax_table', and then add one of these to `struct m4'.  The
5262         ripple effect through the code to both change formerly global
5263         references, and make sure a suitable context is available in
5264         lexical scope is disproportionately large compared to the size of
5265         the change proper.  This change is a large part of decoupling
5266         syntax.c from the rest of the code that uses it.
5268         * m4/m4private.h (struct m4): Add a syntax field.
5269         * m4/m4.c (m4_create): Initialise it,
5270         (m4_delete): Recycle it.
5271         (m4_get_symtab): Remove hand coded version...
5272         (m4_get_symbol_table): ...and generate this with cpp.  Changed all
5273         callers.
5274         * m4/m4module.h (m4_context_field_table): Add an extra field so we
5275         can generate m4_get_symbol_table.  Add a new row for
5276         m4_get_syntax_table.
5277         (M4SYNTAX): Syntactic sugar for module writers.
5278         (m4_symtab): Renamed to m4_symbol_table.  Changed all callers.
5279         (m4_syntax_table): New home for syntax related formerly global
5280         variables.
5281         * m4/m4private.h (struct m4_syntax_table): Define it.
5282         * m4/input.c (m4_input_init): Initialisation of these formerly
5283         global variables moved...
5284         * m4/syntax.c (m4_syntax_create): ...to here.
5285         * m4/input.c (m4_input_exit): And similarly, recycling of the
5286         memory used by those values moved...
5287         * m4/syntax.c (m4_syntax_delete): ...to here.
5288         * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
5289         Moved to m4/m4private.h.
5290         * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5291         (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5292         (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5293         (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
5294         objects.  Changed all callers that used to directly access the
5295         global equivalents.
5296         (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
5297         Removed and incorporated into m4_syntax_table structure.
5298         * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
5299         * m4/syntax.c (m4_set_syntax): Now returns an error status,
5300         instead of requiring a `struct m4' to generate its own errors.
5301         Changed all callers.
5302         * src/main.c (main): Now that the syntax table is initialised as
5303         part of m4_create, we have to manually wipe the syntax entries if
5304         we are about to read a frozen file.
5306 2003-06-26  Gary V. Vaughan  <gary@gnu.org>
5308         * doc/STYLE: Added notes on callback naming schemes.
5310         * m4/module.c (m4_set_module_macro_table)
5311         (m4_set_module_builtin_table): Declarations weren't changed when
5312         definitions were renamed on 2003-06-19.
5314         * m4/hash.c (m4_hash_resize): ifdefed out.  This function is
5315         neither used nor particularly appropriate since it exposes the
5316         internal workings of the hash module.  I haven't yet decided
5317         whether to remove it entirely.
5319 2003-06-20  Gary V. Vaughan  <gary@gnu.org>
5321         Two related changes, and a huge knockon effect throughout the
5322         source: Moved the option variables out of global space and into
5323         `struct m4'; made `m4_symtab' a real datatype, so that its api
5324         is not marred passing `struct m4' around just so it can decide
5325         whether to keep traced symbol names or not.  Added setters and
5326         getters for the formerly global option variables, and obviously
5327         changed a vast number of functions to take a `struct m4' and use
5328         the getter funcs to find option values.
5330         * m4/utility.c (interactive, sync_output, debug_level)
5331         (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
5332         (max_debug_argument_length, warning_status, nesting_limit)
5333         (discard_comments): Removed.
5334         * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
5335         (debug_level, max_debug_argument_length, prefix_all_builtins)
5336         (suppress_warnings, discard_comments, interactive, sync_output):
5337         Removed from here...
5338         * m4/m4private.h (struct m4): ...and equivalent fields added to
5339         this structure.
5340         (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
5341         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
5342         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
5343         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
5344         (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
5345         macros for the new fields.
5346         * m4/m4module.h (m4_context_field_table)
5347         (m4_context_opt_bit_table): Helper macros used to generate
5348         prototypes, setters and getters for new option fields
5349         consistently.
5350         * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
5351         (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
5352         (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
5353         (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
5354         (m4_get_interactive_opt, m4_get_sync_output_opt)
5355         (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5356         (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5357         (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
5358         (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
5359         (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
5360         setter and getter functions generated by cpp from
5361         m4_context_field_table and m4_context_opt_bit_table, exported as
5362         part of the module api.  Changed all callers.
5363         * m4/symtab (struct m4_symtab): Used as the concrete type for
5364         m4_symtab now.
5365         (m4_symtab_create): Allocate and initialise a new struct.
5366         (m4_symtab_apply): New function that works like m4_hash_apply, but
5367         with different callbacks specific to symbol tables.  Changed all
5368         callers.
5369         (symbol_destroy, arg_destroy, arg_copy): Renamed
5370         symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
5371         they have unused parameters for a reason!
5372         (dump_symbol_CB): New callback to dump the contents of a single
5373         symbol.
5374         (symtob_dump): Rewritten in terms of dump_symbol_CB.
5375         * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
5376         Changed all callers.
5377         * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
5378         of the contained `m4_symtab' at the `no_gnu_extensions' field.
5379         Although I'm not convinced these semantics are correct, they are
5380         at least consistent with how things were before this delta.  Also
5381         set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
5383 2003-06-19  Gary V. Vaughan  <gary@gnu.org>
5385         Tie down the interface to libm4 some more.  Make more structures
5386         opaque to modules by moving them to m4private.h, and writing
5387         setters and getters.  To win back the speed penalty for doing this
5388         also wrote macroized versions that do know about structure layout
5389         in m4private.h and #include that file into modules when NDEBUG is
5390         defined at compile time.  There are still some accessor macros in
5391         m4private.h that need to go, but that is not necessary to clean
5392         the module api up.
5394         * m4/m4module.h (m4_symbol_type): Moved...
5395         * m4/m4private.h (m4__symbol_type): ...to here.
5396         * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
5397         (m4_set_symbol_traced, m4_set_symbol_name_traced)
5398         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
5399         (m4_get_symbol_func, m4_symbol_value_create)
5400         (m4_symbol_value_delete, m4_set_symbol_value_text)
5401         (m4_set_symbol_value_func): New exported api to symbols.
5402         (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
5403         and m4_is_symbol_value_func.
5404         * m4/m4module.h: Prototype these guys.
5405         * m4/module.c (m4_set_module_macro_table)
5406         (m4_set_module_builtin_table): Make these static, there is no
5407         reason to pollute the api with them.
5408         * m4/m4private.h: Reformatting.
5409         (m4_get_symtab): Only define when NDEBUG is defined.
5410         (m4_get_symbol_value, m4_get_symbol_traced)
5411         (m4_set_symbol_traced, m4_set_symbol_name_traced)
5412         (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
5413         (m4_get_symbol_func, m4_symbol_value_create)
5414         (m4_symbol_value_delete, m4_set_symbol_value_text)
5415         (m4_set_symbol_value_func): Macro implementations of the new
5416         functions when NDEBUG is defined.
5417         (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
5418         (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
5419         Superceded by the above.  All callers changed.
5420         (M4ARG): Removed.  This is no longer different to the
5421         m4/m4module.h definition.
5422         * modules/gnu.c, modules/m4.c: Only include m4private.h when
5423         NDEBUG is defined.  That way we exercise the same (albeit slower)
5424         api that external modules must use.
5426 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
5428         Renamed some of the types and their accessors to make more sense.
5429         Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
5430         has a stack of SYMBOL_VALUEs.
5432         * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
5433         (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
5434         m4_get_symbol_value_type,  m4_get_symbol_value_text,
5435         m4_get_symbol_value_func and m4_symbol_value_copy respectively.
5436         Changed all callers.
5437         (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
5438         (m4_get_token_type): Renamed
5439         * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
5440         to the internal api.
5441         * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
5442         s/TOKEN_/VALUE_/
5443         (m4__symtab_init, m4__symtab_exit): Removed prototypes.
5444         (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
5445         (m4__token_type): Moved here from m4module.h.
5446         (m4__next_token): Renamed from m4_next_token.
5447         * m4/symtab.c: Removed some of the parameterised macro support
5448         functions for modularisation later.
5449         (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
5450         m4_hash_dup to perform a true deep copy of the SRC.
5451         (arg_copy): Callback for m4_symbol_value_copy.
5452         * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
5453         Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
5454         m4_get_symbol_value_func.  Changed all callers.
5456 2003-06-18  Gary V. Vaughan  <gary@gnu.org>
5458         Tidy up style of hash.[ch] in accordance with doc/STYLE.
5460         * m4/hash.c: Internal symbol renaming and formatting.
5461         (m4_hash_dup): New function to facilitate deep copies of hash
5462         tables.
5463         (m4_hash_apply_func): Returns a void* now, which is a richer type
5464         for returning exceptions (NULL means keep going).
5465         (m4_hash_apply): Ditto.
5466         * m4/hash.h: Declare exported symbols with an explicit extern.
5467         Reformated.
5469 2003-06-17  Gary V. Vaughan  <gary@gnu.org>
5471         Still refactoring furiously.  This delta represents a change in
5472         semantics to symtab.c.  Instead of building temporary m4_tokens
5473         in the caller, and copying fields in the methods, we now create
5474         the actual m4_token for hashing in the caller so the methods just
5475         slot them in directly.  Also, this means that we don't lookup a
5476         symbol and get back an allocated but VOID token to copy fields
5477         into, we create the token we want to push and pass that to
5478         m4_symbol_define or m4_symbol_pushdef.  And that's it.  There are
5479         a few other small changes to stop knowledge of the implementation
5480         of symtab.c leaking out into other files.
5482         * m4/macro.c (expand_argument): Comment typo corrected.
5483         * m4/symtab.c (symtab_fetch): New function to fetch the address of
5484         an interned symbol.
5485         (m4_symbol_pushdef): Take an extra value parameter and use this
5486         directly as the new top of the value stack.  All callers changed
5487         to build a token and pass responsibility for memory in, rather
5488         than copying as we used to.
5489         (m4_symbol_define): Also use the new value parameter directly as a
5490         replacement for the top of the value stack.  All callers changed
5491         to build a token as above.
5492         (m4_set_symbol_traced): New function to set the traced bit on the
5493         named symbol, creating it if necessary.
5494         (symbol_popval): The guts of the old m4_symbol_popdef.
5495         (m4_symbol_popdef): Use it.
5496         * m4/builtin.c (m4_symbol_set_token): Removed,
5497         (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
5498         replaced...
5499         * m4/module.c (m4_set_module_builtin_table)
5500         (m4_set_module_macro_table): ...with these more orthogonal
5501         functions.
5502         * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
5503         (m4_builtin_pushdef, m4_builtin_define): Removed.  No longer
5504         required.
5505         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
5506         (m4_arg_signature_parse): Moved...
5507         * m4/symtab.c: ...to here.
5508         * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
5509         screw something up. Moved...
5510         * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
5511         actually does a proper deep copy of source to dest.
5513 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
5515         Further refactoring to stabilise the module API.  Renaming some
5516         functions for orthogonality, and judicious definition migration to
5517         move things out of the set of exported symbols.
5519         * doc/STYLE: New file.  Notes on coding style.
5520         * m4/m4module.c: Updated bitrotted docucomment at the top of the
5521         file.
5522         (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
5523         m4_get_module_name, m4_get_module_builtin_table,
5524         m4_get_module_macro_table which are verb phrases.  Changed all
5525         callers.
5526         * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
5527         Moved to...
5528         * m4/module.c (m4_set_module_builtin_table)
5529         (m4_set_module_macro_table): ...here, and renamed. Changed all
5530         callers.
5531         * m4/m4module.c (m4_module_data): This...
5532         * m4/m4private.c (struct m4_module_data): ...and this...
5533         * m4/module.c (module_data) ...consolidated here and no longer
5534         exported.  Changed all callers.
5536 2003-06-16  Gary V. Vaughan  <gary@gnu.org>
5538         Begin work on lifting the curse of the global variables.  To start
5539         with create a `struct m4' context container, and replace
5540         `m4__symtab' with `context->symtab' throughout.  This means
5541         initialising a context container in main, and adjusting many
5542         functions between main and the module entry points so that the
5543         container gets passed through.  It would have been nice to
5544         defer this until after 1.5, but it has a major effect on the
5545         user's module writing ABI, so it needs to be addressed now - at
5546         least in the areas that impact the ABI.  An interrelated change
5547         in the symtab API removes the dependency on a global symbol table,
5548         and instead focuses on a passed table (from the context
5549         container).
5551         * TODO: Reminders for finishing context functionality.
5552         * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
5553         * m4/m4.c: New file. Manage new struct m4 objects to eliminate
5554         global variables and eventually allow m4 to be reentrant.
5555         * m4/m4private.h (m4): Define the new structure here...
5556         (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
5557         don't carry the overhead of a function call.
5558         * m4/m4module.h: Prototype extern functions from m4/m4.c.
5559         (m4): Declare type for new struct m4 objects.
5560         (M4SYMTAB): User macro to ease finding the symbol table for the
5561         current context for module developers.
5562         (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
5563         verb.
5564         (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
5565         (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
5566         (m4_call_macro, m4_dump_symbols, m4_expand_input)
5567         (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
5568         (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
5569         (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
5570         m4* context parameter. Changed definitions and all callers.
5571         (m4_symtab): Alias for m4_hash to decouple the
5572         m4_symtab api from m4_hash.
5573         (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
5574         m4_hash.
5575         (m4_symtab_create): New function to return an initialised
5576         m4_symtab.
5577         (m4_symtab_delete): New function to delete an m4_symtab's memory.
5578         (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
5579         (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
5580         instead of simply using the global m4__symtab.  Changed
5581         definitions and all callers.
5582         * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
5583         * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
5584         * src/main.c (main): Create a context and use that instead of the
5585         former global m4__symtab.
5587 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
5589         * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
5590         to the callback.  Callbacks should not need to hardcode the
5591         hashtable they are working from, nor should we have to waste the
5592         userdata parameter to pass the table in.
5593         * m4/hash.h (m4_hash_apply_func): Require the initial table
5594         parameter.
5595         * m4/symtab.c (symtab_destroy): Use the passed table instead
5596         of hardcoding m4__symtab.
5597         (m4_symbol_popdef): Don't use the userdata parameter to pass the
5598         table to arg_destroy.
5599         (arg_destroy): Use the hash parameter, ignore userdata.
5600         * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
5601         prototype.
5602         (traceon, traceoff): Call set_trace with the extra initial
5603         parameter.
5605 2003-06-13  Gary V. Vaughan  <gary@gnu.org>
5607         More refactoring to stabilise the module api, this time for
5608         symtab.c.  Additionally, start to pay attention to function names
5609         that don't contain a verb like they should.
5611         * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
5612         wrapper for m4_hash_apply to decouple the symtab module from the
5613         hash module.
5614         (m4_symbol_builtin, m4_symbol_macro): Renamed to
5615         m4__symbol_set_builtin and m4__symbol_set_macro.  Changed all
5616         callers.
5617         (m4_symbol_delete): Create a macro version to save a function
5618         call.
5619         (m4_token_t, m4_data_t): These violate the POSIX reserved
5620         namespace.  Renamed to m4_token_type and m4_symbol_type. Changed
5621         all callers.
5622         (m4_token_type): Renamed to m4_token_get_type.
5623         (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
5624         (m4_symtab_exit): Removed from the exported module
5625         api...
5626         * m4/m4private.h (m4__symtab, m4__symtab_init)
5627         (m4__symtab_remove_module_references, m4__symtab_exit): ...and
5628         renamed and added to the internal api. Changed all callers.
5629         (m4_symtab_apply): A faster macro version of the function for
5630         users of the internal api.
5631         * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
5632         symbol_destroy and arg_destroy.
5633         (symtab_debug): Added a prototype.
5634         (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
5635         so that callers in this file get the faster macro versions from
5636         m4/m4private.h.
5638 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
5640         Refactoring modules to rationalise the API into an external
5641         documented (eventually!) API for use by modules in the `m4_'
5642         namespace declared in m4/m4module.h, an internal API between the
5643         source files we ship (including our shipped modules) in the `m4__'
5644         namespace declared in m4/m4private.h and making the rest as
5645         cohesive as possible with liberal use of the `static' keyword.
5646         This change represents an audit to m4/module.c along these
5647         guidelines.
5649         * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
5650         Removed.  No longer used.
5651         (m4_module_close): Removed prototypes.
5652         (m4_module_init, m4_module_open, m4_module_unload_all): Removed
5653         from the exported module api...
5654         * m4/m4private.h (m4__module_init, m4__module_open)
5655         (m4__module_exit): ...and renamed and added to the internal api.
5656         Changed all callers.
5657         (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
5658         Centralised definitions after renaming...
5659         * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
5660         (M4_FINISH_SYMBOL): ...and removing from here.
5661         (m4_module_dlerror, m4_module_remove, m4_module_close)
5662         (m4_caller_id): Not exported at all, so renamed to module_dlerror,
5663         module_remove, module_close and caller_id.
5664         (MODULE_SELF_NAME): New macro to make reporting self errors
5665         easier.
5666         (m4_module_load, module_close, module_remove): Use it.
5667         * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
5668         name.
5669         * src/main.c (main): Use it.
5671 2003-06-12  Gary V. Vaughan  <gary@gnu.org>
5673         * README: Remove references to --enable-changeword, which has been
5674         removed from the code.
5676 2003-06-11  Gary V. Vaughan  <gary@gnu.org>
5678         Getting rid of the annoying bug with configure --enable-debug,
5679         which spewed -e: command not found errors.  This was an interaction
5680         between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
5681         You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
5682         branch-1-5) to get the full fix.
5684         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
5685         of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
5686         and then use the probed value of $SED.
5687         (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
5688         this, it messes up the AC_REQUIRE stack.
5690 2003-06-10  Gary V. Vaughan  <gary@gnu.org>
5692         * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
5693         the destroy callback.
5694         (m4_arg_destroy): Use the hash address to free the hash node key
5695         field.
5697 2003-06-06  Gary V. Vaughan  <gary@gnu.org>
5699         First cut at formal parameters in macros.
5701         * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
5702         * m4/xstrzdup.c: New file.
5703         * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
5704         associative array of parameter names to details.
5705         (m4_symbol_token): Capture macro names with parameter lists.
5706         (m4_arg_signature_parse): And build an associative array to hang
5707         from the symbol structure to map names to details.
5708         * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
5709         m4_hash_resize idiom.  Now that we potentially add a little hash
5710         table to many of the entries in the symbol table, added an extra
5711         arg to set the initial size.  Changed all callers.
5712         (m4_hash_apply): New function that is basically a generalised
5713         version of...
5714         * m4/symtab.c (m4_symbol_apply): ...this.  Now deleted.  Adjusted
5715         all callers to call m4_hash_apply instead.
5716         (m4_arg_destroy): Recycle memory used by an m4_token_arg.
5717         (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
5718         m4_arg_signature association that might be attached to the symbol,
5719         * m4/hash.h (m4_hash_apply_func): Replacement type for...
5720         * m4/m4module.h (m4_symtab_apply_func): ...this.  Now deleted.
5721         (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
5722         parameter lists.
5723         (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
5724         (M4_IS_IDENT): Detect characters that can be safely used in
5725         parameter names.
5726         * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
5727         * m4/macro.c: Corrected grammar in some comments.  Use `token'
5728         rather than `td' for m4_token variables.
5729         (m4_process_macro): If we find a dollar followed by some
5730         M4_IS_IDENT characters, replace that with the contents of the argv
5731         entry with offset stored in the m4_token_arg associated with the
5732         collected identifier.
5734 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
5736         Begin preparations for supporting formal parameters in m4 macros.
5738         * m4/m4private.h (struct m4_token_arg): Placeholder for holding
5739         the details of a formal parameter.
5740         (m4_token): Add an arg_signature member to hold a hash table for
5741         looking up formal parameters.
5742         * m4/input.c: Update more bitrotted comments.
5743         (m4_push_builtin): Initialise arg_signature member.
5744         (init_builtin_token): Copy arg_signature member.
5745         * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
5746         (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
5747         replace...
5748         * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
5749         (m4_macro_pushdef, m4_macro_define): ...these, And...
5750         (m4_symbol_token): ...wrapped around this new function, which
5751         vastly simplifies the arguments required by the functions it
5752         replaces.
5753         Changed all callers.
5755 2003-06-05  Gary V. Vaughan  <gary@gnu.org>
5757         * m4/macro.c: Format changes.
5759 2003-06-04  Gary V. Vaughan  <gary@gnu.org>
5761         * m4/input.c: Updated various bitrotted comments.
5762         (m4_push_builtin): Just pass the whole m4_token, rather than
5763         extracting all the fields in the caller.  This also allows us to
5764         check the token type for consistency.
5765         (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
5766         Renamed to builtin_funcs, builtin_peek, builtin_read,
5767         m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
5768         the code.  Changed all callers.
5769         (struct input_block): Similarly renamed u_m member to u_b, and
5770         changed all callers.
5771         (m4_next_token): Use bzero to initialise the data fields.
5772         * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
5774 2003-05-29  Gary V. Vaughan  <gary@gnu.org>
5776         These changes were necessary to get m4 to build on my iBook
5777         running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
5778         (GCC) 3.1 20020420 (prerelease)":
5780         * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
5781         inclusion of module loader headers.
5782         * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
5783         * m4/Makefile.am: Ditto.
5784         (libm4_la_LIBADD): Added $(LTLIBINTL).
5785         * m4/utility.c (program_name): Removed declaration in favour of
5786         the one already in error.c!
5787         * m4/m4module.h (program_name): Define to program_invocation_name
5788         when using GNU C library. Use an explicit extern declaration.
5789         (interactive, sync_output, debug_level, hash_table_size)
5790         (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
5791         (suppress_warnings, warning_status, nesting_limit, discard_comments)
5792         (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
5793         (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
5794         (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
5795         (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
5796         (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
5797         (m4_expansion_level, m4_expand_ranges, m4_expand_input)
5798         (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
5799         (m4_current_line, m4_current_diversion, m4_output_current_line):
5800         Don't rely on default, use an explicit extern.
5801         * m4/error.h (error, error_at_line, error_print_progname)
5802         (error_message_count, error_one_per_line): Ditto.
5803         * m4/ltdl.c: Update from CVS libtool.
5804         * m4/ltdl.h: Ditto.
5805         * commit: Update from CVS cvs-utils.
5807 2002-11-04  gettextize  <bug-gnu-gettext@gnu.org>
5809         * po/Makefile.in.in: Upgrade to gettext-0.11.5.
5810         * po/boldquot.sed: New file, from gettext-0.11.5.
5811         * po/en@boldquot.header: New file, from gettext-0.11.5.
5812         * po/en@quot.header: New file, from gettext-0.11.5.
5813         * po/insert-header.sin: New file, from gettext-0.11.5.
5814         * po/quot.sed: New file, from gettext-0.11.5.
5815         * po/remove-potcdate.sin: New file, from gettext-0.11.5.
5816         * po/Rules-quot: New file, from gettext-0.11.5.
5818 2002-11-04  Akim Demaille  <akim@epita.fr>
5820         * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
5821         running m4 itself.
5822         * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
5824 2002-11-04  Akim Demaille  <akim@epita.fr>
5826         * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
5828 2002-11-04  Akim Demaille  <akim@epita.fr>
5830         * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
5831         used as `external', and Libtool 1.4.3.
5832         (LINGUAS): Remove.
5833         (LTLIBOBJS): Don't play with it.
5834         * intl/: Remove.
5835         * Makefile.am (SUBDIRS): Remove intl.
5836         (ACLOCAL_AMFLAGS): Add -I config.
5837         (EXTRA_DIST): Add config/config.rpath.
5838         * po/LINGUAS: New.
5839         * po/Makevars: New.
5840         * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
5842 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
5844         Preparations for refactoring syntax tables to allow reverse
5845         lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
5846         speed of normal lookups in an array of unsigned short.
5848         * m4/input.c (single_quotes, single_comments, use_macro_escape):
5849         Moved from here...
5850         * m4/m4private.h (m4__single_quotes, m4__single_comments,
5851         m4__use_macro_escape): ...to here, and renamed.  The `m4__' prefix
5852         is for internal symbols which unavoidably pollute the global
5853         namespace, but are not published APIs.
5854         Adjusted all callers.
5855         * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
5856         m4_set_comment, m4_set_syntax, set_syntax_internal,
5857         unset_syntax_attribute): Moved from this file...
5858         * m4/syntax.c: New. ...to this file.
5859         Also added an m4_syntax_exit stub for orthogonality.
5860         * src/main.c (main): Use it.
5861         * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
5862         * m4/m4module.h: Reformatting.  New prototypes.
5864 2002-05-29  Gary V. Vaughan  <gary@gnu.org>
5866         * bootstrap (aclocal_apiversion): The aclocal apiversion is
5867         distinct from the automake release number (in that the apiversion
5868         apparently has no micro-version-component).
5869         (aclocal_apilibdir): Use it.
5871 2002-05-28  Gary V. Vaughan  <gary@gnu.org>
5873         * m4/hash.c (m4_hash_resize): New function.
5874         * m4/hash.h: Add prototype.
5875         * m4/symtab.c (m4_symtab_init):  Use it.  This could do with some
5876         benchmarking to find a good value for, say, autoconf.  This is
5877         already a little quicker than before for me.
5879         * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
5880         * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
5881         and reenamed.
5882         * m4/hash.h: Adjust prototypes.
5884 2002-01-22  Akim Demaille  <akim@epita.fr>
5886         * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
5887         APIVERSION scheme.
5888         * tests/Makefile.am (package.m4): New.
5889         * tests/atlocal.in: Adjust to CVS Autotest.
5890         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
5891         * configure.ac: LIBOBJ is a forbidden string.
5892         Simplify AM_INIT_AUTOMAKE invocation.
5893         * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
5894         options.m4.
5896 2002-01-21  gettextize  <bug-gnu-utils@gnu.org>
5898         * po/Makefile.in.in: Upgrade to gettext-0.10.40.
5900 2001-10-19  Akim Demaille  <akim@epita.fr>
5902         * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
5904 2001-10-19  Akim Demaille  <akim@epita.fr>
5906         * m4/input.c (m4_next_token): Display where was opened what is
5907         not closed.
5909 2001-10-19  Akim Demaille  <akim@epita.fr>
5911         * m4/macro.c (expand_argument): Display where was opened what is
5912         not closed.
5914 2001-10-18  Akim Demaille  <akim@epita.fr>
5916         * m4/input.c, modules/m4.c: Formatting changes.
5918 2001-10-17  Gary V. Vaughan  <gary@gnu.org>
5920         * bootstrap: s/configure.in/configure.ac/
5922 2001-10-16  Gary V. Vaughan  <gary@gnu.org>
5924         * m4/symtab.c (m4_symbol_destroy): This function calls
5925         m4_symbol_popdef, which recycles a symbols memory when the last
5926         definition is popped.  Since we were passing the address of the
5927         symbol name found in the symbol table, and it was being removed
5928         partway through m4_symbol_destroy() we were referencing freed
5929         memory for the balance of the function.  Now we take a copy of the
5930         symbol name tring and use that as a key into the symbol
5931         table... that way if the original symbol name is freed, the copy
5932         is still valid.
5934 2001-10-13  Akim Demaille  <akim@epita.fr>
5936         * m4/ltdl.c: Update.
5938 2001-10-13  Akim Demaille  <akim@epita.fr>
5940         * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
5941         Don't gettextize internal error messages.
5943 2001-10-13  Akim Demaille  <akim@epita.fr>
5945         * tests/macros.at (Arity and defn): New failing test.
5946         (Arity, defn, and freeze): New.
5948         Fix `Arity and defn'.
5950         * m4/input.c (m4_push_macro): Don't forget the arity.
5951         * modules/m4.c (defn): Likewise.
5953 2001-10-13  Akim Demaille  <akim@epita.fr>
5955         * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
5956         to...
5957         * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
5958         (Propagation of traceon, Propagation of --trace): this new file.
5960 2001-10-13  Akim Demaille  <akim@epita.fr>
5962         * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
5963         interface instead of (name, argc...).
5964         Upon failure, specify which argument was guilty.
5965         Adjust callers.
5967 2001-10-13  Akim Demaille  <akim@epita.fr>
5969         * modules/evalparse.c: Save translators' time: don't translate
5970         internal error messages.
5971         (m4_evaluate): Simplify/normalize error messages.
5972         * doc/m4.texinfo (Eval): Adjust.
5974 2001-10-13  Akim Demaille  <akim@epita.fr>
5976         * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
5977         where no checking is needed.
5978         * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
5979         interface instead of (name, argc...).
5980         Adjust callers.
5981         * modules/gnu.c (m4_patsubst_do): Don't check argc, done
5982         elsewhere.
5984 2001-10-13  Akim Demaille  <akim@epita.fr>
5986         * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
5987         exclude the builtin name from the count.
5988         * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
5989         calling ifelse with a single argument is valid.
5990         * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
5991         with 1 and 2 args, mostly to strengthen the test suite.
5993 2001-10-13  Akim Demaille  <akim@epita.fr>
5995         * m4/output.c (m4_make_diversion, m4_insert_file)
5996         (m4_insert_diversion, +m4_freeze_diversions): Ansify.
5998 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
6000         * m4/input.c (init_builtin_token):  Renamed from init_macro_token,
6001         since we call these things builtins in the rest of the code!
6003         * modules/gnu.c (m4_regexp_compile): s/%0/%s/
6005 2001-10-12  Gary V. Vaughan  <gary@gnu.org>
6007         Rather than forcing each builtin definition to manage its own
6008         argument range checking, tabulate the maxima and minima for all
6009         builtins in each module.  This forces us to consider what the
6010         valid ranges for each builtin should be, and moves the checking
6011         code out of each builtin implementation and into the builtin
6012         caller infrastructure.
6014         * m4/m4module.h (struct m4_builtin): Add argument minima and
6015         maxima.
6016         * m4/m4private.h (struct m4_token): Reflect them here too.
6017         * m4/input.c (struct input_block): ...and here.
6018         (m4_token_copy): New function for token copying.
6019         (init_macro_token): Copy them from a token to the input stack.
6020         (m4_next_token): Don't forget to initialise them for text
6021         macros.
6022         * m4/macro.c (expand_argument): Use m4_token_copy, and also
6023         check argument counts before calling the builtin handler.
6024         * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
6025         (m4_symbol_macro): Likewise.
6026         * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
6027         parameters.  Updated all callers.
6028         (m4_builtin_define): Ditto.
6029         (m4_macro_pushdef, m4_macro_define): Ditto.
6030         * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
6031         * modules/evalparse.c:  Declare argument counts for defined
6032         builtins and remove explicit calls to m4_bad_argc().
6033         * modules/gnu.c: Ditto.
6034         * modules/load.c: Ditto.
6035         * modules/m4.c: Ditto.
6036         * modules/modtest.c: Ditto.
6037         * modules/mpeval.c: Ditto.
6038         * modules/perl.c: Ditto.
6039         * modules/shadow.c: Ditto.
6040         * modules/stdlib.c: Ditto.
6041         * modules/time.c: Ditto.
6042         * TODO: Updated.
6044 2001-10-10  Gary V. Vaughan  <gary@gnu.org>
6046         The trace semantics now attach the trace bit to a symbol name.
6047         For as long as a traceon(`foo') is active, calls to foo will be
6048         traced regardless of intervening undefines or module unloads.
6049         Fixed the flag propogation issues differently to the fixes
6050         reverted with the last attempt at nailing down trace:
6052         * m4/m4private.h:  This file is not visible outside of the m4
6053         source tree, so I removed all the `M4_' and `m4_' prefixes to save
6054         on typing.  Updated all clients.
6055         (m4_token): New typedef contains the fields that need to be passed
6056         around with the low level tokeniser.
6057         (m4_token_data):  Removed.
6058         (m4_symbol): Now contains the traced flag again.
6059         * m4/symtab.c:  Rewritten again.  Now we don't remove symbols with
6060         the trace bit set.  This change is contained entirely within this
6061         module and doesn't leak out into the callers.  Updated all
6062         clients.
6063         (m4_symbol_builtin, m4_symbol_macro):  Adjusted to make use of the
6064         new fields in m4_token.  Updated all clients.
6065         * m4/builtin.c (m4_builtin_pushdef):  Needs a flags argument so
6066         that `groks_macro_args' and `blind_if_no_args' flags are retained
6067         when defn() results are passed around in m4 code.  Updated all
6068         callers.
6069         (m4_builtin_define): Ditto.
6070         (m4_macro_pushdef, m4_macro_define): Ditto.
6071         * m4/input.c (struct input_block): Add a flags field to facilitate
6072         the above.
6073         (m4_push_macro):  ...use it.
6074         (init_macro_token):  Retrieve it.
6075         (m4_next_token): Initialise it.
6076         * m4/macro.c (expand_argument):  Copy it.
6077         * m4/m4module.h: Adjust.
6078         * tests/builtins.at:  Adjust the expected output of the trace
6079         tests to reflect the change in semantics.
6080         * tests/modules.at (modules: trace):  Check that unloading a
6081         module which supplies a traced symbol definition doesn't lose te
6082         trace bit.
6084 2001-10-07  Gary V. Vaughan  <gary@gnu.org>
6086         * modules/gnu.c (m4_macro_table): Display the timetamp when
6087         expanding __m4_version__.
6089         * configure.ac (--with-modules): Forgot a comma in the
6090         AC_HELP_STRING parameter list.
6092 2001-10-05  Gary V. Vaughan  <gary@gnu.org>
6094         * bootstrap: Remove aclocal.m4t when it is no longer required.
6096 2001-10-05  Akim Demaille  <akim@epita.fr>
6098         * tests/Makefile.am: Adjust for gnuprog2.
6099         * tests/m4.in: There can be a leading path.
6100         * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
6101         * tests/testsuite.at: Adjust to the most recent Autotest.
6102         (AT_CHECK_M4_FILTER): Fix and rename as...
6103         (AT_TEST_M4): this.
6104         * tests/others.at: Use it.
6106         * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
6107         variable in shell scripts, one uses `$'...
6109 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
6111         * configure.ac: `rm -f $m4_getopt_h' was lost.
6113 2001-10-04  Gary V. Vaughan  <gary@gnu.org>
6115         * configure.ac (TIMESTAMP): Display with AS_BOX at configure
6116         time.  Define it for config.h in order to...
6117         * src/main.c (main): ...display the timestamp for --version.
6119 2001-10-04  Akim Demaille  <akim@epita.fr>
6121         * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
6122         previous builtins `regexp' and `patsubst'.
6123         (regexp, patsubst): Use them.
6124         (eregexp, epatsubst): New builtins.
6125         * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
6126         (Epatsubst and Patsubst, Eregexp and Regexp): these.
6127         (Extensions): More info on REs.
6129 2001-10-04  Akim Demaille  <akim@epita.fr>
6131         * modules/modtest.c (init_handler): Consistently output to stderr.
6132         (finish_handler): New.
6133         (test): The `if' is an `assert'.
6134         * tests/modules.at: Adjust.
6136 2001-10-04  Akim Demaille  <akim@epita.fr>
6138         * m4/utility.c (m4_bad_argc): Detail the mismatches.
6140 2001-10-01  Akim Demaille  <akim@epita.fr>
6142         * tests/generate.awk: Tag the tests with `documentation'.
6143         * tests/modules.at (AT_CHECK_M4_MODTEST): New.
6144         Use the make the existing modtest tests more uniform, and complete
6145         the set of possibilities.
6147 2001-10-01  Akim Demaille  <akim@epita.fr>
6149         * config/gmp.m4: Consult the user before using GMP: use
6150         --without-gmp.
6151         * configure.ac: Adjust.
6152         * modules/gmp.c: No protection needed as the module is not built
6153         if GMP is not used.
6155 2001-10-01  Akim Demaille  <akim@epita.fr>
6157         * tests/generate.awk: Remove debugging code.
6158         (fatal): Specify the current location.
6160         * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
6161         * modules/gnu.c, modules/m4.c: Use M4ARG.
6163 2001-10-01  Akim Demaille  <akim@epita.fr>
6165         * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
6166         (m4_regexp_compile): New.
6167         (regexp, patsubst): Use it.
6169 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
6171         Reinstate the memory handling improvements from the patch I just
6172         reverted.  Relevant ChangeLog entries repeated here:
6174         * m4/module.c (m4_module_remove): New function that holds the core
6175         of the old m4_module_unload.
6176         (m4_module_unload): Use it.
6177         (m4_module_unload_all): When we know the modules will never be
6178         used again (i.e. on exit), free up as much module memory as
6179         possible.  There are still some artifacts from resident modules
6180         living inside ltdl.c, but everything else is freed.
6181         * m4/debug.c (m4_debug_exit): Free memory allocated in
6182         m4_debug_init().
6183         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
6184         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
6185         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
6186         * m4/m4module.h: Updated prototypes.
6187         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
6188         * m4/hash.h: Updated prototypes.
6189         * src/main.c (main): Use all these new functions to clean up as
6190         much memory as possible before exit.
6192 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
6194         Reverted my large patch for removing the old m4_symbol
6195         structure on 2001-09-20.  We are still not happy about the way
6196         trace works in conjunction with defn and undefine, and leaving
6197         the reverted patch active prevents us from moving the traced
6198         bit from the definition back to the symbol.
6200 2001-09-30  Gary V. Vaughan  <gary@gnu.org>
6202         * configure.in: Moved to...
6203         * configure.ac: ...here.  Added a libtool like timestamped
6204         banner, and tidied up the libltdl cruft.
6205         * config/mkstamp: Script to extract a timestamp from ChangeLog.
6206         * modules/Makefile.am (INCLTDL):  Removed.  This is required
6207         only when libltdl is configured in a subdirectory.
6208         * src/Makefile.am: Ditto.
6209         (LIBADD_DL):  No need to add this again, libtool already knows
6210         that libm4.la depends on it.
6211         * m4/Makefile.am: Automake sets variables from AC_SUBST.  Use
6212         them.
6214         * TODO: stackovf.c is basically broken.
6215         Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
6217 2001-09-28  Akim Demaille  <akim@epita.fr>
6219         * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
6221 2001-09-27  Akim Demaille  <akim@epita.fr>
6223         * tests/m4.in: Don't use short options.
6224         Simplify the stderr signature normalization.
6226 2001-09-27  Akim Demaille  <akim@epita.fr>
6228         tests/m4 shall be position independent.
6230         * tests/m4.in: New.
6231         * tests/m4: Remove.
6232         * tests/testsuite.at: No args to AT_INIT.
6233         * configure.in, tests/Makefile.am: Adjust.
6235 2001-09-22  Akim Demaille  <akim@epita.fr>
6237         Autotest has changed again.
6239         * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
6240         (package.m4): Remove.
6241         * configure.in: Adjust to LIBADD_GMP.
6243 2001-09-21  Gary V. Vaughan  <gary@gnu.org>
6245         * config/gmp.m4 (AC_ARG_WITH): Removed.
6246         (GMP_LIB): Renamed to LIBADD_GMP for consistency.
6247         (AC_LIB_GMP): When performing a test compile against libgmp,
6248         include the header gmp.h if possible, and link against -lgmp.  If
6249         they both work define USE_GMP.
6250         * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
6251         (mpeval_LTX_init_func): Complain on load that there was no libgmp
6252         at compile time.
6254 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
6256         * m4/evalparse.c: Moved to...
6257         * modules/evalparse.c:  ...here.  This code is shared between
6258         modules/mpeval.c and modules/m4.c, so there is no need to pollute
6259         the libm4 API with its details.  Moderately rewritten to interface
6260         into its clients more simply.
6261         * m4/eval.c: Deleted.  Migrated functionality to...
6262         * modules/m4.c: ...here.
6263         (builtin_eval):  Implemented in terms of the new interface style.
6264         * modules/mpeval.c (builtin_mpeval): Ditto.
6265         * m4/m4module.h: Removed references to the former m4/eval.c.
6266         * m4/Makefile.am (libm4_la_SOURCES):  Removed eval.c.
6267         (EXTRA_libm4_la_SOURCES): Deleted.
6268         * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
6269         (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
6271 2001-09-20  Akim Demaille  <akim@epita.fr>
6273         * config/gmp.m4 (AM_WITH_GMP): Rename as...
6274         (AC_LIB_GMP): this.
6275         By default, use gmp.
6276         Massive revamping.
6277         * configure.in: Adjust.
6278         Use Automake conditionals for USE_GMP.
6279         Always compute sizeof (long long int).
6280         This was a bug BTW, as `eval' (not `mpeval') depends on it:
6281         before, it was used _only_ if mpeval was not activated.
6282         * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
6283         (mpeval_la_LIBADD): New macros.
6284         * modules/mpeval.c: No longer be conditioned by WITH_GMP.
6285         Indent.
6286         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
6287         * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
6288         WITH_GMP.
6290 2001-09-20  Akim Demaille  <akim@epita.fr>
6292         * tests/Makefile.am (package.m4): New.
6293         * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
6295 2001-09-20  Gary V. Vaughan  <gary@gnu.org>
6297         More cleanup.  After the last patch, m4_symbol holds nothing but
6298         the head of a chain of m4_token_data.  So I have removed the old
6299         m4_symbol, so that m4_token_data chains are stored directly in the
6300         value cell of a hash table node.  But there's more... m4_symbol
6301         was a more natural name for the symbol value cell, and now that it
6302         is gone I have renamed the former m4_token_data structure to
6303         m4_symbol.  This change turned out to be a pig to get right, since
6304         the original code didn't need to modify the value cell itself,
6305         since changing the chain happened inside the m4_symbol that used
6306         to be returned -- I had to pass the address of the value cell
6307         across various function calls, incase the head value changed.  I
6308         also tightened up the memory management to help me find a nasty
6309         memory corruption bug that took me all night to track down...
6311         * m4/m4private.h (struct m4_symbol): Removed.
6312         (struct m4_token_data): Renamed to `struct m4_symbol'.  Updated
6313         all references.
6314         * m4/hash.c (m4_hash_iterator_value): Return the address of the
6315         value cell.  Updated all callers.
6316         * m4/symtab.c: Took advantage of the simplification in the data
6317         structures to rewrite a lot of this file more simply.  There is
6318         still some room for optimisation here, but we should tackle that
6319         systematically closer to the release.
6321         * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
6322         revealed.  This version is ahead of CVS libtool until I get chance
6323         to flush my changes.
6324         * m4/module.c (m4_module_remove): New function that holds the core
6325         of the old m4_module_unload.
6326         (m4_module_unload): Use it.
6327         (m4_module_unload_all): When we know the modules will never be
6328         used again (i.e. on exit), free up as much module memory as
6329         possible.  There are still some artifacts from resident modules
6330         living inside ltdl.c, but everything else is freed.
6331         * m4/debug.c (m4_debug_exit): Free memory allocated in
6332         m4_debug_init().
6333         * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
6334         * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
6335         * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
6336         * m4/m4module.h: Updated prototypes.
6337         * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
6338         * m4/hash.h: Updated prototypes.
6339         * src/main.c (main): Use all these new functions to clean up as
6340         much memory as possible before exit.
6342 2001-09-18  Gary V. Vaughan  <gary@gnu.org>
6344         The `traced' flag needs to be attached to the definition of a
6345         symbol rather than the current symbol containing the definition.
6346         Implementing this showed up some long standing post 1.4 bugs in
6347         flag propogation which I also fixed.
6349         * m4/m4private.h (struct m4_symbol): Remove the traced flag.
6350         (struct m4_token_data): And add it back in here.
6351         * m4/input.c (init_macro_token): Propogate the traced flag
6352         correctly.
6353         * m4/macro.c (expand_argument): Ditto.
6354         * tests/builtins.at (trace2, trace3): New tests based on Akim's
6355         sadistic email ;-)
6357 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
6359         * m4/m4private.h (struct m4_token_data): Simplified by removing
6360         the redundant `traced' flag, and one level of structure nesting.
6361         (M4_TOKEN_DATA_FUNC_TRACED): Removed.
6362         * m4/input.c (init_macro_token): No need to initialise removed
6363         `traced' field.
6364         * m4/macro.c (expand_argument): No need to copy it either.
6365         * m4/utility.c (m4_token_data_func_traced): Or provide an access
6366         function.
6368         * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
6369         dependant on multiple symbols with the same key, so preserving
6370         relative symbol order in each bucket during resizing is no longer
6371         required.  The resize function is considerably faster as a result.
6373         * m4/m4module.h, m4/builtin.c, m4/symtab.c:
6374         s/m4_symbol_insert/m4_symbol_define/g;
6375         s/m4_builtin_insert/m4_builtin_define/g;
6376         s/m4_macro_insert/m4_macro_define/g.  Updated all callers.
6378 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
6380         Get rid of m4_symbol_lookup_t entirely.  With Akim's earlier
6381         commits, the m4_lookup_symbol dispatch function is split into
6382         specialised functions that must be called directly.
6384         * m4/m4module.h (m4_symbol_lookup_t): Removed.
6385         * m4/symtab.c (m4_lookup_symbol): Removed.
6386         (m4_symbol_builtin, m4_symbol_macro): New functions.
6387         * m4/builtin.c (m4_builtin_define): Split into...
6388         (m4_builtin_pushdef, m4_builtin_insert): ...these.
6389         (m4_macro_define): Split into...
6390         (m4_macro_pushdef, m4_macro_insert): ...these.
6391         * src/main.c (main): Set command line macros from `-D' parameters
6392         using `m4_macro_define'.
6394 2001-09-08  Gary V. Vaughan  <gary@gnu.org>
6396         * m4/symtab.c (m4_symtab_remove_module_references):  Renamed as
6397         this from m4_remove_table_reference_symbols().
6398         * m4/m4module.h, m4/module.c: Updated all references.
6400 2001-09-07  Akim Demaille  <akim@epita.fr>
6402         * modules/stdlib.c, modules/times.c: Misc cleanups.
6404 2001-09-07  Akim Demaille  <akim@epita.fr>
6406         * configure.in: We now need Autoconf 2.52e.
6407         * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
6408         and `M4_SYMBOL_DELETE'.
6409         * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
6410         * src/main.c (main): Adjust.
6412 2001-09-06  Gary V. Vaughan  <gary@gnu.org>
6414         Fix the obstack.h problem once and for all!  At configure time we
6415         can test for a system supplied obstack.h:  depending on the
6416         result, we now generate system.h with an #include of the correct
6417         header.  As a bonus, I've also added a --with-included-obstack,
6418         incase the user doesn't like the system obstack for some
6419         reason... and also we can test the shipped obstack on a system
6420         that has oe of its own.  We also now need to be careful to add
6421         build directories to the include search path, since the generated
6422         system.h will be in the build tree.
6424         * configure.in (AC_CONFIG_FILES): Generate system.h from
6425         system-h.in.
6426         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
6427         include the system obstack header or the copy shipped with M4.
6428         Allow the user to override configure and force the build to use
6429         the shipped version.
6430         * m4/system-h.in: New file, template for...
6431         * m4/system.h: ...this.  Now deleted.
6432         * m4/m4module.h: Include system.h before everything else.
6433         * src/freeze.c: Ditto.
6434         * m4/Makefile.am (dist-hook): Remove generated system.h.
6435         (INCLUDES): Check builddir for generated headers before checking
6436         srcdir.
6437         * modules/Makefile.am (INCLUDES): Ditto.
6438         * src/Makefile.am (INCLUDES): Ditto.
6440 2001-09-05  Gary V. Vaughan  <gary@gnu.org>
6442         * TODO: Remove the items that have been addressed already.
6444 2001-09-05  Akim Demaille  <akim@epita.fr>
6446         * src/main.c (main): Standardize --version.
6448 2001-09-05  Akim Demaille  <akim@epita.fr>
6450         * modules/format.c (format): Have a bigger `str'.
6452 2001-09-05  Akim Demaille  <akim@epita.fr>
6454         Rationalize warnings, reporting the macro name as if it were a
6455         program name, and assertions.
6457         * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
6458         (M4WARN): New.
6459         * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
6460         (m4_symbol_delete):
6461         Use assert for internal errors.
6462         * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
6463         M4WARN.
6464         * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
6465         M4WARN and assert.
6466         * tests/builtins.at (pushpop): Adjust.
6468 2001-09-05  Akim Demaille  <akim@epita.fr>
6470         * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
6471         with pointers.
6473 2001-09-05  Akim Demaille  <akim@epita.fr>
6475         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
6476         * m4/macro.c, m4/symtab.c: Adjust.
6478 2001-09-05  Akim Demaille  <akim@epita.fr>
6480         * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
6481         (m4_symbol_pop, m4_symbol_del): this.
6482         (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
6483         (m4_symbol_popdef, m4_symbol_delete): New.
6484         (m4_lookup_symbol): Adjust.
6485         * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
6487 2001-09-05  Akim Demaille  <akim@epita.fr>
6489         * m4/m4module.h (m4_symbol_lookup): Rename as...
6490         (m4_symbol_lookup_t): this.
6492 2001-09-05  Akim Demaille  <akim@epita.fr>
6494         * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
6495         unused.
6496         * m4/symtab.c (m4_lookup_symbol): Adjust.
6498 2001-09-03  Gary V. Vaughan  <gary@gnu.org>
6500         Bootstrap will now work with Libtool 1.4.1 or higher:
6501         * bootstrap: Remove stale autom4te.cache files when
6502         rebootstrapping.
6503         * config/Makefile.am (ACLOCAL_MACROS):  Add ltdl.m4 and
6504         libtool.m4.
6505         * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
6506         libtool.m4 directly.
6507         Run libtoolize to refresh ltmain.sh.
6508         * config/ltmain.sh:  Deleted.
6509         * acinclude.m4: Deleted.
6510         * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
6512         * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
6513         implementation for the cvs impaired libtool user.
6515 2001-09-03  Akim Demaille  <akim@epita.fr>
6517         * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
6518         internal errors.
6519         Avoid using `default' in switch, as it hides useful compiler
6520         warnings when a case is forgotten.
6522 2001-09-03  Akim Demaille  <akim@epita.fr>
6524         * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
6525         is no such thing as `WITH_MODULES'.
6527 2001-09-03  Akim Demaille  <akim@epita.fr>
6529         Improve the test suite's selfcontainedness.
6531         * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
6532         (Include, Undivert): Tag the other input files.
6533         * tests/generate.awk: Catch `@comment file:'.
6534         `-I $src' is no longer needed.
6535         `next' is really like `return': the rest is skipped.
6536         Adjust to `input.m4'.
6537         (fatal): New function.
6538         * tests/foo, tests/incl.m4: Remove.
6540 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
6542         The shadowing mechanism and, infact, the whole symbol table
6543         implementation was creaking under the weight of the features piled
6544         on top of it.  We now have a separate hash table module which will
6545         dynamically resize to keep symbol density withing good performace
6546         limits, and a new symtab module layered above it.  Symbol lookups
6547         are now marginally more efficient (since the shadowed flag is no
6548         longer required) and symbol removal, such as on module unload, is
6549         considerably faster due to a reorganisation of the data structures
6550         used in symtab.c.
6552         * src/main.c (main):  Don't mention `-H'.
6553         * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
6554         effect.
6555         * NEWS: Updated.
6556         * m4/hash.c: New generalised dynamic hash table data structure
6557         management module.
6558         * m4/hash.h: Public interface.
6559         * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
6560         (libm4_la_SOURCES): Add hash.c.
6561         * m4/symtab.c: More or less rewritten from scratch, within the
6562         bounds of the previous API.
6563         (m4_symtab_apply): A cleaner version of the old hack_all_symbols
6564         call.  Updated all callers.
6565         * m4/m4module.c: #include <m4/hash.h>, and changed all affected
6566         declarations to reflect API changes.
6567         (M4INIT): Generate a declaration too, to avoid the warning with
6568         --enable-debug builds.
6569         (M4FINISH): Ditto.
6570         (HASHMAX): Removed.
6571         * m4/utility.c (hash_table_size):  Removed.
6572         (m4_dump_symbols): Rewritten to build and qsort an array of symbol
6573         names, which are then looked up by builtin_dumpdef() as necessary.
6574         This implies a small speedup in builtin_symbols(), which discarded
6575         all of the symbol info under the old call.
6576         * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
6577         shadowing is implicit in respect to the new data structures.
6578         symbol names are no longer duplicated here, they are stored in the
6579         key field of the hash table.
6580         Moved macro_args and blind_no_args...
6581         (m4_token_data): ...to here.
6582         m4/macro.c (expand_macro):  Added a name argument since the symbol
6583         name is no longer copied into each struct m4_symbol.  Modified all
6584         callers.
6585         (collect_arguments):  Ditto.
6586         * modules/m4.c (set_trace): Ditto.
6587         * modules/gnu.c (builtin_symbols): Updated.
6588         * src/freeze.c (produce_symbol_dump): Much improved in light of
6589         the improved symbol table layout.
6591 2001-09-01  Gary V. Vaughan  <gary@gnu.org>
6593         * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
6594         to M4_SYMBOL_NEXT.
6595         (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
6596         (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
6597         SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
6598         SYMBOL_HANDLE): Ditto.
6599         * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
6600         modules/gnu.c, modules/m4.c, src/freeze.c,
6601         src/main.c:  Updated all references.
6603         * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
6604         Automake 1.5 chokes on dynamic source file lists,  Besides, it is
6605         already listed in m4_LDADD... how did that ever used to work?
6606         * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
6607         link.
6608         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6609         Suggested by Tim Van Holder <tim.van.holder@pandora.be>
6611         * tests/m4: Don't call the m4 wrapper script with libtool, it
6612         works fine all by itself.
6614 2001-08-30  Gary V. Vaughan  <gary@gnu.org>
6616         The experimental `changeword' feature never took off, and has
6617         no obvious advantages over `changesyntax' to compensate the
6618         enormous speed penalty it carries:
6619         * configure.in (ENABLE_CHANGEWORD): Removed.
6620         * m4/m4module.h (m4_set_word_regexp): Removed.
6621         * m4/m4private.h (m4_token_data): Removed original_text field.
6622         * m4/utility.c (m4_token_data_orig_text): Removed.
6623         * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
6624         * m4/macro.c: Ditto.
6625         * src/main.c: Ditto.
6626         * modules/Makefile.am (changeword.la): Removed.
6627         * modules/changeword.c: File removed.
6628         * doc/m4.texinfo: References to changeword and --word-regexp
6629         removed.
6630         * po/POTFILES.in: modules/changeword.c removed.
6631         * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
6632         * tests/builtins.at (changeword): Test removed.
6634 2001-08-30  Akim Demaille  <akim@epita.fr>
6636         * bootstrap.sh: Create aclocal.m4 instead of modifying it.
6637         This also help having a single list of m4 files: in
6638         config/Makefile.am.
6639         * config/Makefile.am (STANDARD_MACROS): Rename as...
6640         (ACLOCAL_MACROS): this.
6641         (list-standard-macros): Remove.
6642         (spy): New.
6644 2001-08-29  Gary V. Vaughan  <gary@gnu.org>
6646         In an attempt to moderate my egomania...
6647         * tests/modules.at: Remove attributions.
6649         * tests/generate.awk: When making substitutions to "@&t@", either
6650         "&" or "\&" in the substitution string argument to gsub refer back
6651         to the matched text.  "@\\&t@" seems to work though, Tests 43 and
6652         67 now pass for me.
6654 2001-08-29  Akim Demaille  <akim@epita.fr>
6656         * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
6657         (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
6658         (sync-lines, trace, translit, undivert, wrap): Move to...
6659         * tests/builtins.at: this new file.
6660         * tests/others.at (Discard comments, import-environment): Move to...
6661         * tests/options.at: this new file.
6663 2001-08-29  Akim Demaille  <akim@epita.fr>
6665         * tests/others.at (Freezing modules)
6666         (--module-directory: absolute path, modpath2, modpath3)
6667         (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
6668         * tests/modules.at: here, new file.
6669         * tests/others.at, tests/generate.awk: Add a banner.
6670         * tests/testsuite.at: Adjust.
6671         (AT_CHECK_M4_FILTER): New, but unused.
6673 2001-08-29  Akim Demaille  <akim@epita.fr>
6675         * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
6676         handle that.
6677         * tests/others.at (wrap): Inline wrap.m4.
6678         (shadow): Inline shadow.m4.
6679         (iso8859): Don't specify the path from top_srcdir, but from srcdir.
6680         * tests/m4: Simplify.
6682 2001-08-29  Akim Demaille  <akim@epita.fr>
6684         * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
6685         --language.
6687 2001-08-29  Akim Demaille  <akim@epita.fr>
6689         * tests/generate.awk (normalize): s/@__@/@&t@/.
6691 2001-08-28  Akim Demaille  <akim@epita.fr>
6693         * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
6695 2001-08-28  Gary V. Vaughan  <gary@gnu.org>
6697         * bootstrap (generate.awk): Generate test cases with new script.
6699 2001-08-27  Akim Demaille  <akim@epita.fr>
6701         * tests/Makefile.am (installcheck-local): Don't use
6702         `dc_install_base' which is not visible here, but `exec_prefix'
6703         which is clearly the RT anyway.
6704         * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
6705         related to testing a now installed m4.
6706         * tests/m4: Do it here.
6708 2001-08-27  Akim Demaille  <akim@epita.fr>
6710         * tests/others.at (indir): Formatting change.
6712 2001-08-27  Akim Demaille  <akim@epita.fr>
6714         * tests/Makefile.am (installcheck-local): New.
6715         * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
6716         the test suite.
6717         Prefer options over envvars.
6718         * src/main.c (main): First bug caught by the test suite (yeah!):
6719         --batch lacked a `break' which resulted in an accidental
6720         invocation of --discard-comments.
6722 2001-08-27  Akim Demaille  <akim@epita.fr>
6724         * tests/others.at (capitalize, changeword, comments, ddivert)
6725         (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
6726         (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
6727         (sysv-args, trace, translit, undivert): Don't rely on files in
6728         examples/: AT_DATA them.
6730 2001-08-27  Akim Demaille  <akim@epita.fr>
6732         Let the test suite use a wrapper around the not installed m4 to
6733         pretend it is (installed).
6735         * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
6736         such a way that m4 does not process them.
6737         * configure.in: The package name seems to be `m4', not `M4'.
6738         * tests/m4: New.
6739         * tests/atlocal.in (at_package, M4): Remove.
6740         * tests/testsuite.at, tests/others.at: Use m4, not $M4.
6742 2001-08-27  Akim Demaille  <akim@epita.fr>
6744         * tests/Makefile.am (CLEANFILES): Remove.
6745         (DISTCLEANFILES, clean-local): New.
6746         * examples/mktests.sh: Remove.
6748 2001-08-27  Akim Demaille  <akim@epita.fr>
6750         * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
6751         Don't use aclocal: it's written by hand.
6752         * aclocal.m4: m4_include all the files instead of being built by
6753         aclocal.
6754         * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
6755         until it reads the traces by itself.
6756         * configure.in: Require Autoconf 2.42c as we are now using
6757         AC_CONFIG_TESTDIR instead of AT_CONFIG.
6758         Catch unexpanded `jm_' macros.
6759         * config/atconfig.m4: Remove.
6760         * config/error.m4: new.
6761         * config/Makefile.am: Ship the files included by aclocal.m4.
6762         * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
6763         (TESTSUITE_AT): this, to please Automake.
6764         (TESTSUITE): This target uses autotest/autotest.m4, not
6765         autotest/general.m4.
6766         * tests/testsuite.at: Prereq Autotest 2.52c.
6767         * examples/Makefile.am (pkgdata_DATA): Rename as...
6768         (dist_pkgdata_DATA): this.
6769         * doc/Makefile.am (man_MANS): Rename as...
6770         (dist_man_mans): this.
6772 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
6774         * m4/system.h [cygwin*]:  Thanks to Paul Sokolovsky and
6775         Robert Collins, building on Cygwin no longer requires Windows
6776         import and export symbol decorations.
6777         * m4/m4module.h (M4_SCOPE) [cygwin*]:  Deleted all occurences.
6778         * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
6779         * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6780         * m4/error.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6781         * m4/input.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6782         * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6783         * m4/output.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6784         * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6785         * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]:  Ditto.
6786         * configure.in (LIBM4_DLL_IMPORT) [cygwin*]:  Don't set this
6787         anymore.
6788         * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
6789         * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
6791 2001-08-20  Gary V. Vaughan  <gary@gnu.org>
6793         Ansify the source.  Previously we had a mix, where my code was
6794         in a K&R compatible style, and the preexisting code was in ANSI
6795         style.  Nothing is lost wrt release 1.4 by reverting to ANSI,
6796         and now the code base is much cleaner.
6798         * m4/system.h:  Remove M4_PARAMS macro and all users.  Remove
6799         VOID macro and all users.
6800         * m4/m4module.h:  Ansify function prototypes and headers.
6801         * m4/builtin.c:  Ditto.
6802         * m4/evalparse.c:  Ditto.
6803         * m4/input.c:  Ditto.
6804         * m4/macro.c:  Ditto.
6805         * m4/module.c:  Ditto.
6806         * m4/output.c:  Ditto.
6807         * m4/path.c:  Ditto.
6808         * m4/symtab.c:  Ditto.
6809         * m4/utility.c:  Ditto.
6810         * modules/format.c:  Ditto.
6811         * modules/gnu.c:  Ditto.
6812         * modules/m4.c:  Ditto.
6813         * modules/mpeval.c:  Ditto.
6814         * src/freeze.c:  Ditto.
6815         * src/m4.h:  Ditto.
6816         * src/main.c:  Ditto.
6818 2001-08-20  Akim Demaille  <akim@epita.fr>
6820         * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
6821         generated with stock 2.52.
6823 2001-08-20  Akim Demaille  <akim@epita.fr>
6825         * config/atconfig.m4: New, until part of Autoconf per se.
6826         * configure.in (AT_CONFIG): Use it.
6827         Adjust.
6828         * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
6829         * tests/atlocal.in: New.
6830         * tests/generate.awk: For the time being, the empty quadrigraph is
6831         `@__@'.
6832         * tests/others.at (changeword, gmp): Check the configuration
6833         variable against `yes'.
6834         * tests/testsuite.at (dnl): Allow it, as it's used all over the
6835         place.
6837 2001-08-20  Akim Demaille  <akim@epita.fr>
6839         * m4/utility.c (m4_numeric_arg): Spell out the culprit.
6840         * modules/m4.c (undivert): Disable the possibility of undiverting
6841         several files at once: it is not documented, it is inconsistent
6842         with the other macros, it can be straightforwardly mocked by
6843         several invocations, and most importantly, it prevents the
6844         possibility of other kinds of extension.
6845         Use `m4_numeric_arg'.
6847 2001-08-20  Akim Demaille  <akim@epita.fr>
6849         * examples/include.m4: Typo.
6850         * tests/generate.awk: Really add it.
6851         * tests/Makefile.am: Adjust.
6852         * tests/others.at (Discard comments): It sure fails without `-c'.
6853         (include, undivert): Add -I examples/.
6855 2001-08-20  Akim Demaille  <akim@epita.fr>
6857         Use sprintf, not ecft and friends since it is standard, portable,
6858         simplifies the code, and since the latter is even deprecated
6859         according to the GNU libc documentation.
6861         * modules/format.c: Drop evct support.
6863 2001-08-19  Gary V. Vaughan  <gary@gnu.org>
6865         * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up.  Don't test
6866         for `-pipe' here...
6867         * configure.in: ...do it here instead.
6869         * c-boxes.el: Deleted.
6870         * m4/builtin.c: Reformat box comments to be closer to GNU
6871         standards.
6872         * m4/debug.c:  Ditto.
6873         * m4/eval.c:  Ditto.
6874         * m4/evalparse.c:  Ditto.
6875         * m4/input.c:  Ditto.
6876         * m4/m4module.h:  Ditto.
6877         * m4/macro.c:  Ditto.
6878         * m4/output.c:  Ditto.
6879         * m4/symtab.c:  Ditto.
6880         * m4/utility.c:  Ditto.
6881         * modules/changeword.c:  Ditto.
6882         * modules/format.c:  Ditto.
6883         * modules/gnu.c:  Ditto.
6884         * modules/load.c:  Ditto.
6885         * modules/m4.c:  Ditto.
6886         * modules/modtest.c:  Ditto.
6887         * modules/mpeval.c:  Ditto.
6888         * modules/perl.c:  Ditto.
6889         * modules/shadow.c:  Ditto.
6890         * modules/stdlib.c:  Ditto.
6891         * modules/time.c:  Ditto.
6892         * src/freeze.c:  Ditto.
6893         * src/main.c:  Ditto.
6895 2001-08-17  Gary V. Vaughan  <gary@gnu.org>
6897         * m4/module.c: Fixup some errors in the description comment.
6899 2001-08-17  Akim Demaille  <akim@epita.fr>
6901         * tests/others.at (iso8859): Specify the path to the M4 test file.
6902         * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
6903         files in error messages.
6905 2001-08-17  Akim Demaille  <akim@epita.fr>
6907         * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
6908         * tests/others.at: Adjust input files paths.
6909         * tests/atconfig.in: Set top_builddir.
6910         * tests/Makefile.am: Adjust.
6911         `testsuite' is in src, not build.
6913 2001-08-17  Akim Demaille  <akim@epita.fr>
6915         * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
6916         (generate.at): Install a temporary hack until the actual
6917         generate.awk is added to the repository.
6918         * tests/atconfig.in: New.
6920 2001-08-17  Akim Demaille  <akim@epita.fr>
6922         Really apply the patch ``Drop Autoconf 2.13 compatibility.''
6924 2001-08-17  Akim Demaille  <akim@epita.fr>
6926         * doc/m4.texinfo: Promote proper quotation.
6928 2001-08-17  Akim Demaille  <akim@epita.fr>
6930         Remove the non Autotest tests.
6932         * tests/other-tests/capitalize.test,
6933         * tests/other-tests/changeword.test,
6934         * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
6935         * tests/other-tests/debug.test,
6936         * tests/other-tests/discard-comments.m4,
6937         * tests/other-tests/discard-comments.test,
6938         * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
6939         * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
6940         * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
6941         * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
6942         * tests/other-tests/hanoi.test,
6943         * tests/other-tests/import-environment.m4,
6944         * tests/other-tests/import-environment.test,
6945         * tests/other-tests/include.test, tests/other-tests/indir.test,
6946         * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
6947         * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
6948         * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
6949         * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
6950         * tests/other-tests/modtest.test,
6951         * tests/other-tests/multiquotes.test,
6952         * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
6953         * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
6954         * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
6955         * tests/other-tests/sync-lines.m4,
6956         * tests/other-tests/sync-lines.test,
6957         * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
6958         * tests/other-tests/translit.test, tests/other-tests/undivert.test,
6959         * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
6960         * tests/other-tests/wrap.test: Remove.
6962         * tests/run-test, tests/get-them: Remove.
6963         * tests/Makefile.am: Adjust.
6965 2001-08-17  Akim Demaille  <akim@epita.fr>
6967         others.at no longer depends on other-tests/.
6969         * tests/others.at (stackovf): You're actually...
6970         (sync-lines): this.
6971         (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
6972         (unload.test): Keep their authorship.
6973         (discard-comments, gmp, import-environment, modfreeze)
6974         (sync-lines): Embed the input files.
6975         * tests/stackovf.test: Copy from other-tests/stackovf.test.
6976         * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
6978 2001-08-17  Akim Demaille  <akim@epita.fr>
6980         * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
6981         (M4exit): Tag the exit status of the example.
6982         * tests/get-them: Adjust.
6983         * tests/generate.awk: New, based on get-them.
6984         * tests/Makefile.am: Adjust to generate `generated.at'.
6985         * tests/testsuite.at: Adjust.
6986         (AT_CHECK_M4): Don't overquote.  Blush...
6988 2001-08-17  Akim Demaille  <akim@epita.fr>
6990         Start using Autotest.  atconfig creation is still lacking.
6992         * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
6993         * examples/reverse.m4, tests/other-tests/import-environment.m4,
6994         * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
6995         * tests/other-tests/import-environment.test: Don't check LANGUAGE
6996         as it might be `unset', or set to `C'.
6997         * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
6998         * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
6999         * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
7000         * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
7001         * tests/other-tests/shadow.test: Adjust.
7002         * tests/testsuite.at, tests/others.at: New.
7003         * tests/Makefile.am: Adjust.
7005 2001-08-17  Akim Demaille  <akim@epita.fr>
7007         Drop Autoconf 2.13 compatibility.
7009         * configure.in (changeword): No need to undefine it, as anyway if
7010         it's defined, M4sugar moved it as m4_changeword.
7011         And anyway, proper quotation is enough.
7012         (m4_pattern_allow): As it exists in 2.50, just use it.
7013         (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
7014         Don't handle Gettext's duties, let it handle them.
7015         * config/gnu-obstack.m4: Use m4_pattern_allow directly.
7017 2001-08-17  Akim Demaille  <akim@epita.fr>
7019         * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
7020         (m4_errprint): Use fputs.
7021         * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
7022         dumpdef are not concerned.
7023         (Dumpdef, Errprint): Emphasize their insensitivity to
7024         --error-output.
7025         * doc/Makefile.am: Add `TAGS' support.
7026         (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
7027         in `config/' now.
7028         * config/Makefile.am (MAINTAINERCLEANFILES): New.
7030 2001-08-17  Akim Demaille  <akim@epita.fr>
7032         * modules/Makefile.am (ETAGS_ARGS): New.
7034 2001-08-17  Akim Demaille  <akim@epita.fr>
7036         * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
7037         changes.
7039 2001-08-17  Akim Demaille  <akim@epita.fr>
7041         * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
7043 2001-08-17  Akim Demaille  <akim@epita.fr>
7045         * m4/m4module.h (m4/list.h): Don't include it.
7047 2001-08-16  Gary V. Vaughan  <gary@gnu.org>
7049         m4_modules are no more, we use lt_dlhandles directly and let
7050         latest libltdl features manage the list of loaded modules.
7051         * acinclude.m4: Regenerated.
7052         * m4/ltdl.c: Updated from master copy.
7053         * m4/module.c: Reimplemented to take advantage of advances in
7054         libltdl.
7055         * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
7056         list with lt_dlhandle_next.
7057         (m4_builtin_find_by_func): Ditto.
7058         (m4_builtin_table_install): Use lt_dlhandle.
7059         (m4_macro_define): Ditto.
7060         (m4_macro_table_install): Ditto.
7061         m4/module.h: Prototype new module management API.
7062         (m4_modules): No longer required.
7063         (m4_module_init_t, m4_module_finish_t): POSIX namespace
7064         violations, renamed to...
7065         (m4_module_init_func, m4_module_finish_func): ...these,
7066         respectively.
7067         (M4INIT_HANDLER): Clean way to declare init functions in modules.
7068         (M4FINISH_HANDLER):  And similarly for finish functions.
7069         * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
7070         -- Add indirection to the CONC macro so that arguments are
7071         correctly expanded.
7072         * modules/modtest.c (m4_init_module):  Replaced with M4INIT_HANDLER.
7073         * modules/shadow.c (m4_init_module):  Ditto.
7074         Due to new init function semantics, be careful to perform the
7075         initialisation only on first load.
7076         * modules/perl.c (m4_init_module):  Ditto. And Ditto.
7077         (m4_finish_module): Replaced with M4FINISH_HANDLER.
7078         Due to new finish function semantics, be careful to perform the
7079         finalisation only on first load.
7080         * m4/m4private.h (m4_module): Removed in favour of...
7081         (m4_module_data): ...structure without all the wrapper fields.
7082         Instances of this new structure are stored associated lt_dlhandles
7083         with lt_dlcaller_data_set().
7084         * m4/builtin.c (m4_builtin_define): Takes a handle argument
7085         instead of the old module argument.
7086         (m4_builtin_table_install): Ditto.
7087         * modules/load.c (m4_resident_module):  Removed.  This is no
7088         longer implemented as a magic symbol...
7089         * modules/m4.c (m4_resident_module): Ditto.
7090         * modules/load.c (M4INIT_HANDLER): ...the module init function now
7091         uses the ltdl api to make the module resident.
7092         * modules/m4.c (M4INIT_HANDLER): Ditto.
7093         * modules/load.c (builtin_modules): Traverse the loaded module
7094         list with lt_dlhandle_next.
7095         (builtin_load): Much simplified in light of the reimplemented
7096         module loader.
7097         * src/freeze.c (produce_module_dump):  Cleaned up and optimised in
7098         light of the m4/module.c rewrite.
7099         (produce_symbol_dump): Ditto.
7100         (reload_frozen_state): Ditto.
7101         * m4/list.c, m4/list.h: Files deleted.  No longer required.
7102         * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
7103         (libm4_la_SOURCES): Delete list.c reference.
7104         * m4/m4private.h (m4_token_data):  Add a handle field.  This
7105         eliminates many of the searches to find the handle associated with
7106         various tokens that are passed between functions.
7107         (struct m4_symbol):  Removed the module field.  The
7108         module association does not belong with the symbol...
7109         * m4/input.c (struct m4_builtin): ...it belongs with the builtin
7110         that the module implementation code is from.  Added a handle
7111         field.
7112         (m4_push_macro): Add a `handle' argument.  Changed all callers.
7113         (init_macro_token):  Set the `handle' field for the
7114         m4_token_data.
7115         * m4/macro.c (expand_argument): Copy the new handle field during
7116         reassignment.
7117         * modules/m4.c (macro_install): Use the new handle field to
7118         optimise the search for the correct builtin structure, and pass
7119         the handle details to m4_builtin_define.
7121 2001-08-15  Akim Demaille  <akim@epita.fr>
7123         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
7124         when creating `m4/obstack.h'.
7125         * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
7126         top_builddir.
7127         * tests/defs: Make them absolute.
7128         (CDPATH) Neutralize.
7129         * tests/gethem: Use them.
7131 2001-08-14  Gary V. Vaughan  <gary@gnu.org>
7133         * config/ltmain.sh: Doh!  Import again for a quoting fix that
7134         prevented any regression test from passing.
7136         * m4/m4module.h (obstack.h): Choose between installed version
7137         and shipped version based on configure tests.
7138         * src/freeze.c (obstack.h): Ditto.
7140         * acconfig.h: Removed.  No longer required.
7142         * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
7143         * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
7144         them to AC_INIT and AM_INIT_AUTOMAKE.
7145         * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
7146         disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
7147         * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
7148         shell variable m4_cv_func_obstack_h.
7149         * tests/defs (M4): Be more careful about relative path to libtool
7150         script and m4 binary by using $srcdir.
7152         * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
7153         optargs to the existing libltdl search path.
7154         * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
7155         * m4/ltdl.c: Updated.
7156         * m4/ltdl.h: Ditto.
7157         * config/ltmain.sh: Ditto.
7159 2001-08-11  Gary V. Vaughan  <gary@gnu.org>
7161         * src/main.c (main): Add `-b' (for `batch') mode switch to force
7162         interactive mode off.
7164 2001-08-10  Akim Demaille  <akim@epita.fr>
7166         * configure.in: Require Autoconf 2.52.
7167         (AC_ARG_PROGRAM): Remove, handled by Automake.
7168         (m4_getopt): Rename as...
7169         (m4_getopt_h): this.
7170         Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
7171         Undefine `changeword' only if defined.
7172         * config/gnu-obstack.m4: Require Autoconf 2.52.
7173         (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
7174         Allow this token.
7176 2001-08-09  Yuji Minejima  <ggb01164@nifty.ne.jp>
7178         * doc/m4.texinfo: Fix some typos, and apply some small
7179         clarifications.
7181 2001-08-09  Andreas Schwab  <schwab@suse.de>
7183         * src/main.c (main): Fix improper uses of error (missing format
7184         string).
7186 2001-08-07  Akim Demaille  <akim@epita.fr>
7188         Improve `make distcheck'.
7190         * configure.in: Be sure to be able to run `mkconfig.sh' when src
7191         != build.
7192         * Makefile.am (dist-hook): Remove, as it is no longer needed.
7193         * doc/m4.texinfo (Include): Add missing blank.
7194         * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
7195         obstack.c.
7197 2001-08-07  Akim Demaille  <akim@epita.fr>
7199         * m4/evalparse.c: A better introductory comment.
7200         * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
7201         * m4/macro.c: Adjust old comments.
7202         * modules/README: Typo.
7204 2001-08-07  Akim Demaille  <akim@epita.fr>
7206         * config/gnu-obstack.m4: New.
7208 2001-08-07  Akim Demaille  <akim@epita.fr>
7210         * config/Makefile.am, config/stackovf.m4: New.
7211         * configure.in, Makefile.am: Adjust.
7213 2001-08-05  gettextize  <bug-gnu-utils@gnu.org>
7215         * po/Makefile.in.in: Upgrade to gettext-0.10.39.
7216         * po/cat-id-tbl.c: Remove file.
7217         * po/stamp-cat-id: Remove file.
7219 2001-04-08  Roderick Koehle <Roderick.Koehle@infineon.com>
7221         * modules/format.c (format):  Formatting for %f was not
7222         interpreting the position of the decimal point correctly for
7223         whole numbers.
7225 2000-12-01  Gary V. Vaughan  <gary@gnu.org>
7227         * TODO:  Removed m4exit bug.
7228         * modules/load.c (m4_resident_module): Make this module resident.
7229         * module/m4.c (m4_resident_module): Ditto.
7230         * m4/modules.c (m4_module_load):  Use new ltdl resident modules
7231         feature to mark modules as resident if they export
7232         `m4_resident_module' as TRUE.
7233         (m4_module_unload): Do not remove resident modules, and take care
7234         with symbol insertion and deletion with resident modules.
7235         * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
7236         use resident modules feature.
7238 2000-11-30  Gary V. Vaughan  <gary@gnu.org>
7240         * TODO: Updated.  Removed some cruft that has since been fixed
7241         or implemented.  Added some more entries.
7242         * NEWS: Updated.
7243         * README: Updated.
7244         * modules/README: Updated.
7245         * doc/m4.texinfo: Updated.
7247         * modules/gnu.c (builtin_functions): Make indir orthogonal to
7248         builtin, in that each is recognised as a macro only with parameters
7249         (builtin_indir): Passing 0 arguments is now an error, as with
7250         builtin.
7252         * src/main.c (usage): Added missing description of `-c' option.
7254 2000-11-29  Gary V. Vaughan  <gary@gnu.org>
7256         Consolidate the myriad of dispersed test scripts into the
7257         tests subdirectory.  I think I now have all the file where I
7258         want them, so there shouldn't be anymore upheaval =)O|
7259         Honest!
7260         * tests/Makefile.am: Updated to run the new tests added below.
7261         * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
7262         tests/other-tests/ddivert.test, tests/other-tests/debug.test,
7263         tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
7264         tests/other-tests/foreach.test, tests/other-tests/forloop.test,
7265         tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
7266         tests/other-tests/hanoi.test, tests/other-tests/include.test,
7267         tests/other-tests/indir.test, tests/other-tests/misc.test,
7268         tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
7269         tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
7270         tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
7271         tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
7272         tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
7273         tests/other-tests/reverse.test, tests/other-tests/shadow.test,
7274         tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
7275         tests/other-tests/translit.test, tests/other-tests/undivert.test,
7276         tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
7277         tests/other-tests/wrap.test:  New tests based on the contents
7278         of the tests removed below.
7279         * examples/Makefile.am, modules/Makefile.am:  Updated to
7280         reflect removed tests.
7281         * examples/defs,modules/defs: Removed.
7282         * examples/capitalize.test, examples/comments.test,
7283         examples/ddivert.test, examples/debug.test,
7284         examples/esyscmd.test, examples/exp.test,
7285         examples/foreach.test, examples/forloop.test,
7286         examples/fstab.test, examples/hanoi.test,
7287         examples/include.test, examples/indir.test,
7288         examples/misc.test, examples/multiquotes.test,
7289         examples/patsubst.test, examples/pushpop.test,
7290         examples/regexp.test, examples/reverse.test,
7291         examples/sysv-args.test, examples/trace.test,
7292         examples/translit.test, examples/undivert.test,
7293         examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
7294         modules/modpath1.test, modules/modpath2.test,
7295         modules/modpath3.test, modules/modpath4.test,
7296         modules/modtest.test, modules/shadow.test,
7297         modules/unfrozen.m4, modules/unload.test: Removed.
7299         Move the implementation of GMP support for the mpeval() builtin
7300         into a loadable module that depends on libgmp.  mpeval() and
7301         eval() share a common parser, now in m4/evalparser.c; the code
7302         in m4/numb.c and m4/numb.h is now physically split between
7303         m4/eval.c (the eval() backend) and modules/mpeval.c (the
7304         mpeval() backend), rather than being differentiated by cpp
7305         macros and multiple inclusion.  The mpeval module is always
7306         built but will generate an diagnostic if it is used from an
7307         installation that didn't link in the gmp library.
7308         * modules/Makefile.am: build and install the new mpeval module.
7309         * modules/mpeval.c: Now contains the former parts of m4/numb.c
7310         and m4/numb.h that are required for gmp support in mpeval().
7311         * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
7312         * m4/evalmp.c:  Removed.
7313         * m4/m4module.h: Removed conditional prototype for
7314         m4_mp_evaluate().
7315         * m4/eval.c: Rewritten.  Contains the former parts of m4/numb.c
7316         and m4/numb.h that do not rely on gmp.
7317         * m4/evalparse.c:  New file, contains the shared parts of the
7318         eval() and evalmp() parser implementations, and is no longer
7319         unencumbered by cpp magic to uncover the right parts.
7320         * m4/numb.h:  Removed.  It's former contents are split between
7321         m4/eval.c and modules/mpeval.c.
7322         * m4/numb.c: ditto.
7324         * tests/other-tests/changeword.test: New test.  Rudimentary
7325         testing of changeword builtin runs only if --wnable-changeword
7326         was used at configure time.
7327         * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
7328         alternation correctly.  Split into two expressions to compensate.
7329         * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
7330         * modules/Makefile.am: Build changeword module.
7331         * modules/changeword.c (m4_macro_table): Define __m4_changeword__
7332         only when --enable-changeword was passed to configure.
7333         (builtin_changeword): If --enable-changeword was not used, then
7334         report that changeword() builtin has no support in m4 binary.
7336 2000-11-28  Gary V. Vaughan  <gary@gnu.org>
7338         * src/main.c (main): Fixed a particularly nasty bug is
7339         user_search_path setting -- the -M flag processing must be
7340         extremely careful with search path ordering, or else the default
7341         installed module directory (possibly containing modules from a
7342         previous release) is placed earlier in the search path than any -M
7343         arguments (which are relied upon to load uninstalled modules with
7344         most of the tests in the regresion suite).
7346         * modules/load.c (builtin_load):  Nasty hack to prevent adding
7347         symbols to symtab again if a module is loaded more than once.
7348         * modules/m4.c (builtin_ifelse): removed unused variable argv0.
7350         * m4/symtab.c (m4_remove_table_reference_symbols):  Fixed a
7351         possible NULL pointer dereference.
7353         * m4/module.c (m4_module_find_by_modname): Renamed from
7354         m4_module_modname_find.   Fixed all references.
7355         (m4_module_find_by_builtin):  New function.
7357         * modules/modfreeze.test: load the `load' module with each
7358         invocation.
7359         * src/freeze.c (produce_frozen_state): Simplified in light of
7360         module field in m4_symbol.  Allow a third argument for text macros
7361         to name the originating module.
7362         (reload_frozen_state): ditto.
7363         * m4/m4module.h:  Fixup prototypes.
7364         * m4/builtin.h (m4_builtin_define): Add a module argument so
7365         that symbols can be registered against the defining module.
7366         (m4_macro_define): ditto.
7367         * m4/m4private.h (m4_symbol): Make the module field const to save
7368         on casting in the rest of the code.
7369         (SYMBOL_MODULE): New macro.
7371         * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
7372         symbol reference maintenance bugs when removing a symbol from the
7373         symtab.
7375         * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
7377 2000-11-27  Gary V. Vaughan  <gary@gnu.org>
7379         * configure.in (m4_cv_func_obstack): A better check for whether
7380         libc has an obstack implementation.
7381         * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
7383         * configure.in (--with-modules): Changed semantics.  This
7384         option is now used to list modules to be preopened.
7385         * src/m4.h: #include "ltdl.h" unconditionally.
7386         * src/main.c: Removed all dependencies on WITH_MODULES.
7387         * src/freeze.c: ditto.
7388         * modules/Makefile.am: ditto.
7389         * m4/m4.c (builtin_m4exit): ditto.
7390         * modules/modpath1.test: ditto.
7391         * modules/modpath2.test: ditto.
7392         * modules/modpath3.test: ditto.
7393         * modules/modpath4.test: ditto.
7394         * modules/modtest.test: ditto.
7395         * modules/shadow.test: ditto.
7396         * modules/unload.test: ditto.
7398         * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
7399         comes up on demand in LTLIBOBJS now.
7400         * configure.in (getopt_long):  Creating and relying on a link for
7401         getopt.h on hosts with no getopt_long() of thier own works
7402         correctly now.  This is necessary so that callers of getopt_long()
7403         can simply `#include <getopt.h>': the naive way of doing this
7404         would end up using our own getopt.h and the installed
7405         getopt_long(), which is asking for trouble!
7406         (obstack_init): A similar argument applies to obstack.h and
7407         obstack_init().
7409         * m4/ltdl.c: Upgraded to latest bleeding edge version again.
7410         On Solaris-2.5 (at least) the native dlopen implementation
7411         gets confused about m4.o when looking for module "m4".  This
7412         version always looks for .la an .$lib_ext suffixed names first
7413         to work around the problem.  Sigh.
7415         * po/POTFILES.in: Take account of these file movements.
7416         * src/Makefile.am (m4_SOURCES): removed eval.c.
7417         (EXTRA_m4_SOURCES): removed numb.c and numb.h.
7418         * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
7419         (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
7420         * modules/m4.c (builtin_eval): Use m4_evaluate().
7421         * m4/eval.c: Moved here from src/eval.c to facilitate
7422         implementation of eval() builtin as part of the `m4' loadable
7423         module.
7424         (m4_evaluate): renamed from evaluate for namespace cleanliness.
7425         * m4/numb.c: Moved here from src/numb.c, since it is #included
7426         into eval.c at compile time.
7427         * m4/m4module.h (m4_evaluate): Added prototype.
7428         * src/m4.h (evaluate): Removed prototype.
7430 2000-11-25  Gary V. Vaughan  <gary@gnu.org>
7432         * modules/perl.c (builtin_perleval):  Use PL_na for
7433         compatibility with perl-5.6.
7435         * src/main.c (main):  It is now safe to
7436         ``m4_module_install("m4")'', without tripping over the m4
7437         binary itself!
7438         * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
7439         versions having fixed the insidious module search order bug.
7441         * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
7442         supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
7444         * configure.in: Figure out whether to use the installed
7445         getopt.h or the supplied one.
7446         * src/Makefile.am: ditto.
7448         * po/POTFILES.in: List files in their new positions.
7450         * config/ltmain.sh:  This needs to be checked in to match the
7451         libtool macros copied to acinclude.m4 (until a released
7452         libtool copes with m4's needs).
7453         * bootstrap:  Run gettextize.
7455 2000-11-24  Gary V. Vaughan  <gary@gnu.org>
7457         * AUTHORS:  Added my details.
7458         * TODO: updated.
7459         * NEWS: updated.
7460         * bootstrap: temporary update until released libtool catches up.
7462         * All files:  Use new GNU GPL copyright blurb with current contact
7463         address.
7465         * configure.in (LTLIBOBJS): Use canonical code for calculation of
7466         this variable.
7468         * config: renamed acm4 directory to config to be more like
7469         other autoconfiscated packages.
7471         * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
7472         * config/debug.m4:  New file implementing configure macros to add
7473         suitable debug flags to the compiler invocation.
7475         * modules/load.c:  New file implementing the ``load'' and
7476         ``unload'' builtins.
7477         * tests/get-them:  Set the module search directory to the modules
7478         build directory in generated tests.
7479         * modules/shadow.test: ditto.
7480         * modules/modtest.test: ditto.
7481         * modules/modpath1.test: ditto.
7482         * modules/modpath2.test: ditto.
7483         * modules/modpath3.test: ditto.
7484         * modules/modpath4.test: ditto.
7485         * modules/modtest.test: ditto.
7486         * modules/modfreeze.test: ditto.
7487         * modules/unload.test: ditto.
7489         * modules/changeword.c:  New file implementing the ``changeword''
7490         builtin as a loadable module.
7491         * modules/mpeval.c:  New file implementing the ``mpeval'' builtin
7492         as a loadable module.
7494         * src/main.c (main):  Load the gnu module if m4 was started
7495         normally -- i.e. without the -G option.
7496         * modules/gnu.c:  New file implementing a new loadable module wuth
7497         definitions for all the gnu extension builtins.
7498         * modules/format.c:  Moved here from src/format.c.  Now included
7499         directly by gnu.c.
7501         * src/main.c (main):  Load the traditional module if m4 was
7502         started in `no_gnu_extensions' mode.
7503         * modules/traditional.c:  New file implementing the ``unix'' macro,
7504         required when m4 is executed in traditional mode, as a loadable
7505         module.
7507         * src/main.c:  Renamed from m4.c to avoid confusion with
7508         modules/m4.c.
7509         (main):  Always load the m4 module.
7510         * modules/m4.c:  New file implementing a new loadable module with
7511         definitions for all m4 builtins that are not gnu extensions.
7513         * m4/Makefile.am:  Adjusted to take new files below into account.
7514         * m4/m4module.h: Prototypes for exported functions and types moved
7515         to this directory from the src directory.
7516         * m4/m4private.h: Moved here from src/m4private.h to facilitate
7517         the migration of all builtin implementations to loadable modules.
7518         * m4/macro.c: Moved this file here from the src directory,
7519         renaming all exported symbols to use the prefix ``m4_''.
7520         * m4/builtin.c: ditto.
7521         * m4/module.c: ditto.
7522         * m4/symtab.c: ditto.
7523         * m4/debug.c: ditto.
7524         * m4/input.c: ditto.
7525         * m4/output.c: ditto.
7526         * m4/path.c: ditto.
7527         * m4/ltdl.h, m4/ltdl.c: ditto.
7528         * m4/utility.c: Odd functions moved here from files in the src
7529         directory to facilitate builtin migration.
7531 2000-08-12  Gary V. Vaughan  <gary@gnu.org>
7533         * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
7534         error message, to make translators' jobs a little easier.
7535         (builtin_builtin): ditto.
7536         (builtin_traceon): ditto.
7537         (builtin_traceoff): ditto.
7538         Reported by Akim Demaille <akim@epita.fr>
7540         * m4/Makefile.am (pkgincdir):  Deleted.  Use automake's built in
7541         pkgincludedir instead.
7543         * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
7544         it is exported globally.  Fixed all references.
7545         (lquote): ditto.
7546         (bcomm): ditto.
7547         (ecomm): ditto.
7548         (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
7549         globally.  Fixed all references.
7550         (DEF_LQUOTE): ditto.
7551         (DEF_BCOMM): ditto.
7552         (DEF_ECOMM): ditto.
7554 2000-07-28  Gary V. Vaughan  <gary@gnu.org>
7556         * NEWS: updated.
7557         * TODO: updated.
7559         * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
7560         (AC_OUTPUT): touch stamp-h.in, not stamp-h.
7562         * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
7563         Removed `Prev', `Next' and `Up' fields of all @nodes now that
7564         makeinfo calculates them for us, and to make any future
7565         reorganisation easier.
7566         (Frozen files): Document format version 2.
7567         `V' now takes argument `2'.
7568         `F' can take a single argument if symbol and builtin names
7569         are the same, or 3 arguments if the builtin is from a module.
7570         New `S' specification for saving syntax table contents.
7571         New `M' specification for saving loaded module names.
7572         * src/freeze.c: Implement them.
7573         * src/input.c (syntax_code): For interpreting frozen syntax
7574         state.
7576         * examples/Makefile.am:  Add the contents of the WWW directory to
7577         the distribution.
7578         * examples/WWW/Makefile:  ditto,
7579         (%.htm): Compares file contents (not just sizes) to determine
7580         whether a change has occured.
7581         * examples/WWW/_header.htm: Bumped version number.
7582         * examples/WWW: Regenerated content.
7584         * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
7585         compilers comes much easier without ansi2knr.
7586         * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
7588         * m4/list.c: New generic list container type.
7589         * m4/list.h: Interface to new container type.
7590         * m4/Makefile.am (pkginc_HEADERS): Install list.h.
7591         (libm4_la_SOURCES): compile and link list.c.
7592         * src/builtin.c (builtin_tables): Use list container.
7593         * src/module.c (symtab): ditto.
7594         * src/symtab.c (symtab): ditto.
7596         * m4/system.h: New file for common preprocessor definitions.
7597         * m4/Makefile.am (pkginc_HEADERS): install system.h.
7598         * m4/error.c: Use system.h in place of inline preprocessor.
7599         * m4/error.h: ditto.
7600         * m4/module.c: ditto.
7601         * m4/module.h: ditto.
7602         * m4/xmalloc.c: ditto.
7604         * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
7605         compatibility.
7606         * m4/xmalloc.c (xmalloc_exit_failure): ditto.
7608         * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
7609         it is exported globally.  Fixed all references.
7610         (builtin): ditto.
7611         (module_init_t): ditto.
7612         (module_finish_t): ditto.
7613         (token_data): ditto.
7614         (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
7615         it is exported globally.  Fixed all references.
7616         (SYNTAX_IGNORE): ditto.
7617         (SYNTAX_SPACE): ditto.
7618         (SYNTAX_OPEN): ditto.
7619         (SYNTAX_CLOSE): ditto.
7620         (SYNTAX_COMMA): ditto.
7621         (SYNTAX_DOLLAR): ditto.
7622         (SYNTAX_ACTIVE): ditto.
7623         (SYNTAX_ESCAPE): ditto.
7624         (SYNTAX_ALPHA): ditto.
7625         (SYNTAX_NUM): ditto.
7626         (SYNTAX_ALNUM): ditto.
7627         (SYNTAX_LQUOTE): ditto.
7628         (SYNTAX_RQUOTE): ditto.
7629         (SYNTAX_BCOMM): ditto.
7630         (SYNTAX_ECOMM): ditto.
7631         (SYNTAX_VALUE): ditto.
7632         (SYNTAX_MASKS): ditto.
7633         (IS_OTHER): ditto.
7634         (IS_IGNORE): ditto.
7635         (IS_SPACE): ditto.
7636         (IS_OPEN): ditto.
7637         (IS_CLOSE): ditto.
7638         (IS_COMMA): ditto.
7639         (IS_DOLLAR): ditto.
7640         (IS_ACTIVE): ditto.
7641         (IS_ESCAPE): ditto.
7642         (IS_ALPHA): ditto.
7643         (IS_NUM): ditto.
7644         (IS_ALNUM): ditto.
7645         (IS_LQUOTE): ditto.
7646         (IS_RQUOTE): ditto.
7647         (IS_BCOMM): ditto.
7648         (IS_ECOMM): ditto.
7649         (TOKEN_EOF): ditto.
7650         (TOKEN_NONE): ditto.
7651         (TOKEN_STRING): ditto.
7652         (TOKEN_SPACE): ditto.
7653         (TOKEN_WORD): ditto.
7654         (TOKEN_SIMPLE): ditto.
7655         (TOKEN_MACDEF): ditto.
7657         * m4/m4module.h (voidstar): Removed in favour of `VOID' for
7658         consistency.  Fixed all references.
7659         (STRING): Renamed to `m4_string' for consistency, and because if
7660         is exported globally.  Fixed all references.
7661         (token_type): Renamed to `m4_token_t' for the same reasons.
7662         (token_data_type): Renamed to `m4_token_data_t' for the same
7663         reasons.
7665         * m4/m4module.h (XCALLOC): Wrapper macro which handles type
7666         sizes.
7667         (XMALLOC): ditto.
7668         (XREALLOC): ditto.
7669         (XFREE): Wrapper macro which avoids freeing NULL pointers.
7671         * m4/m4module.h (m4_macro):  New type for module defined user
7672         macros.
7673         * modules/modtest.c (m4_macro_table):  Define module user macros.
7674         * modules/shadow.c (m4_macro_table):  ditto.
7676         * m4/m4module.h (M4BUILTIN_HANDLER):  For defining handlers
7677         declared with M4BUILTIN.
7679         * m4/xmalloc.c: Use memset if bzero is not available when
7680         emulating calloc with malloc.
7681         (xcalloc): Fallback to malloc/bzero if calloc is not available.
7682         (xfree): Added for consistency.  Will not try to free NULL
7683         pointers.
7684         * src/m4.c (xfree):  Deleted in favour of the above.
7685         * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
7686         linking with libdmalloc.
7687         * m4/xstrdup.c (WITH_DMALLOC): ditto.
7689         * modules/frozen.m4:  New test case.
7690         * modules/unfrozen.m4:  ditto.
7691         * modules/modfreeze.test:  New test.
7692         * modules/unload.test:  ditto.
7693         * modules/Makefile.am (EXTRA_DIST):  Distribute them.
7694         (TESTS): Use them.
7695         * modules/modpath1.test:  Don't try this test if module support is
7696         not compiled in.
7697         * modules/modpath2.test: ditto.
7698         * modules/modpath3.test: ditto.
7699         * modules/modpath4.test: ditto.
7700         * modules/modtest.test: ditto.
7701         * modules/shadow.test: ditto.
7703         * modules/perl.c: New module.
7704         * modules/perl.m4: Example of using it.
7705         * modules/Makefile.am (perl_la_SOURCES):  Build new perl module.
7707         * src/m4.c (main): Assume interactive mode if STDIN is connected
7708         to a tty.
7709         Changed startup sequence slightly so that syntax is not
7710         initialised from here when loading a frozen file.
7712         * src/builtin.c:  Much improved macro definition style.
7713         * src/m4private.h:  Internal structures for m4_builtin and
7714         m4_macro instances.  These are not exposed to module writers.
7715         * src/module.c (module_modname_find):  Find a module structure
7716         from the its name.
7717         (make_macro_table):  Build an internal macro table from a external
7718         definition.
7719         (make_builtin_table):  Build an internal builtin table from an
7720         external definition.
7722         * src/module.c (module_unload): Be extremely careful to remove
7723         builtins and macros that match the module being unloaded -- no
7724         longer assume that the top element can be removed incase another
7725         odule defines an identical name.
7726         * src/symtab.c (remove_table_reference_symbols): remove all symbol
7727         table entries which refer to a given builtin table.
7728         * src/builtin.c (remove_tables): Use it!
7730 2000-07-13  Thomas Tanner  <tanner@ffii.org>
7732         * Makefile.am (SUBDIRS): we need modules/ for "make dist"
7733         * acm4/modules.m4: deleted
7734         * bootstrap: don't libtoolize libltdl!
7735         * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
7736         if set, enable WITH_MODULES and add modules to DLPREOPEN
7737         * examples/misc.test: redirect standard output
7738         * lib/Makefile.am: don't use DLLDFLAGS
7739         * lib/m4module.c: include necessary headers to silence GCC -Wall
7740         * lib/m4regex.c: fixes to silence GCC -Wall
7741         * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
7742           build modules conditionally
7743         * modules/shadow.c: define symbol aliases before using them
7744         * modules/test.c: define symbol aliases before using them
7745         * po/de.po: update translation
7746         * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
7747         pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
7748         LIBLTDL to LIBS.
7749         * src/m4.c: initialize libltdl's preloaded symbols via
7750         LTDL_SET_PRELOADED_SYMBOLS
7751         * src/module.c: libltdl's memory management must be initialized
7752         before calling lt_dlinit!, fix warnings
7754 2000-01-18  Gary V. Vaughan  <gary@gnu.org>
7756         * README:  Caveat about nls not supported by dll architecture on
7757         Windows.
7759         * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
7761         * tests/Makefile.am (stamp-TESTS):  now works with VPATH.
7762         * src/Makefile.am (m4_LDADD):  use $(builddir) for VPATH.
7763         * modules/Makefile.am (LIBS): ditto.
7764         (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
7765         $(top_srcdir)/m4 (for only <m4module.h>).
7766         * modules/shadow.test: fixed for VPATH.
7767         * modules/modtest.test: ditto.
7768         * modules/modpath4.test: ditto.
7769         * modules/modpath3.test: ditto.
7770         * modules/modpath2.test: ditto.
7771         * modules/modpath1.test: ditto.
7773         * modules/time.test: Removed due to timezone dependence,
7774         * modules/Makefile.am (TESTS): Removed time.test.
7776         * configure.in: Use $3 of AC_DEFINE so that we can,,,
7777         * acconfig.h: Remove everything except the gettext parameters.
7778         * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
7779         AC_DEFINE.
7780         * acm4/ltdl.m4:  Updated to latest from libtool cvs.
7781         * acm4/modules.m4:  Remove code which duplicates ltdl.m4 and
7782         increment serial number.
7784         * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
7785         src dir and immediately after libm4 is built for confidence that
7786         it doesn't rely on the src directory.
7787         (SUBDIRS): Moved doc dir to the end since helptoman.pl and
7788         makeinfo stop the build on cygwin (because they don't work).
7790         * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
7792         * m4/m4private.h: ...is not a public header, so moved to src.
7793         Add `#include <config.h>', `#define _COMPILING_M4' and
7794         `#include "m4.h".
7795         * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
7796         * src/Makefile.am (noinst_HEADERS): add m4private.h.
7797         * src/builtin.c: `#include "m4private.h"' now takes care of the
7798         above.  Duplicates removed.
7799         * src/debug.c: ditto.
7800         * src/eval.c: ditto.
7801         * src/evalmp.c: ditto.
7802         * src/format.c: ditto.
7803         * src/freeze.c: ditto.
7804         * src/input.c: ditto.
7805         * src/m4.c: ditto.
7806         * src/macro.c: ditto.
7807         * src/module.c: ditto.
7808         * src/numb.h: ditto.
7809         * src/output.c: ditto.
7810         * src/path.c: ditto.
7811         * stackovf.c: ditto.
7812         * symtab.c: ditto.
7814         * po/POTFILES.in: compensate for renaming of lib/*.
7815         * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
7816         (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
7817         and then in $(top_srcdir)/lib (for eg. "m4private.h").
7818         * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
7819         m4/libm4.la.
7820         * m4/m4error.h:  Renamed error.h, for installation to
7821         $prefix/include/m4..
7822         * m4/m4obstack.h:  Renamed obstack.h, for same reason.
7823         * m4/m4regex.h: Renamed regex.h, for same reason.
7824         * m4/m4error.c:  Renamed error.c, and use #include "error.h".
7825         * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
7826         * m4/m4regex.c: Renamed regex.c, and fix #includes.
7828         * lib: moved to m4 to easily support header installation to
7829         $prefix/include/m4.
7830         * Makefile.am (SUBDIRS): renamed lib dir to m4.
7831         * configure.in (AC_OUTPUT): reference m4/Makefile.in.
7832         * acm4/regex.m4: Point to m4/regex.c.
7834         * examples/foreach.m4:  Sanitise quoting.
7835         * examples/foreach.test:  New torture test.
7836         From Akim Demaille <akim@epita.fr>
7838 2000-01-17  Gary V. Vaughan  <gary@gnu.org>
7840         * src/ltdl.c: Use access() to abort doomed module load attempts
7841         if module file does not exist.
7843         * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
7844         getopt1.o will already be used if appropriate, so I moved getopt.c
7845         and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
7847         * modules/modpath1.test: Use correct filename in header line.
7848         * modules/modpath2.test: ditto.
7849         * modules/modpath3.test: ditto.
7850         * modules/modpath4.test: ditto.
7852         Without these changes lt_dlopen("test") attempts to
7853         LoadLibrary("/bin/test") on Windows, which although harmless
7854         generates a spurious error message which spoils most of the tests:
7855         * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
7856         (TESTS): s/test.test /modtest.test /
7857         (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
7858         (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
7859         * modules/modpath1.test: s/test.m4 /modtest.m4 /
7860         * modules/modpath2.test: ditto.
7861         * modules/modpath4.test: ditto.
7862         * modules/modpath3.test: s/-m test /-m modtest /
7863         * modules/shadow.m4: use {un,}loadmodule(`modtest').
7865 2000-01-16  Gary V. Vaughan  <gary@gnu.org>
7867         * src/ltdl.c (find_file): Updated to new version with fixed memory
7868         allocation bug in `next'.
7869         * src/ltdl.h: updated to match.
7871         * modules/Makefile.am:  Cleaned up and reordered.
7873 2000-01-16  René Seindal  <rene@seindal.dk>
7875         * modules/Makefile.am (TESTS): New tests for the module system.
7877         * modules/*.test: New files.
7879         * src/m4.c (main): Added call to module_init().
7880         Treats -M and -m as the arguments -D -U and -t, ie deferred.
7882         * src/m4.h: Added declaration of module_init().
7884         * src/module.c (module_init): No longer static
7886         * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
7887         Added to shut up automake about non standard libtool library
7888         names.
7890         * src/module.c: Disabled DEBUG by default.
7892         * modules/README: Changed example from unload.m4 to shadow.m4
7894         * modules/shadow.m4: Renamed from unload.m4
7896         * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
7898         * src/m4.c (main): Functionality for -m and -M were reversed.
7899         Fixed.
7901 2000-01-12  Gary V. Vaughan  <gary@gnu.org>
7903         * doc/help2man.pl: updated to version 1.020.
7905         * lib/COPYING.LIB:  updated to version 2.1.
7907         * lib/m4module.h: restructure the M4_SCOPE code to work when
7908         creating a dll which links with libm4.la and both DLL_EXPORT
7909         (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
7910         both defined.
7912 2000-01-11  Gary V. Vaughan  <gary@gnu.org>
7914         Merged the following changes from my tree:
7916         1999-06-15  Gary V. Vaughan  <gary@gnu.org>
7918         * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
7919         ported to compile shared libs.
7921         * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
7922         use `__declspec(dllimport)' when linking libm4.la on win32.
7923         * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
7925         * configure.in (M4OBJS): Discover whether we need the shipped
7926         implementation of getopt_long.
7927         * src/Makefile.am (m4_LDADD): Link the getopt objects into the
7928         main binary here, as opposed to the module library in lib/libm4.la.
7930         1999-06-14  Gary V. Vaughan  <gary@gnu.org>
7932         * modules/README: Updated to describe the improved libltdl based
7933         module scheme.
7934         * README (cygwin): Added some compilation notes for building m4
7935         correctly under cygwin.
7936         * TODO: Cleaned out the entries for the module system since they
7937         are now implemented.
7939         * *.[ch]: __P is in the compiler's reserved namespace, so replaced
7940         all instances of __P with M4_PARAMS.
7942         * lib/getdate.h: removed unreferenced file.
7944         * lib/m4private.h: New file to define the private interface to the
7945         token_data struct, which must be shared between m4module.c, and
7946         builtin.c but not exported to modules built from the installed
7947         m4module.h since it's size changes depending on compile time
7948         options.
7950         * src/m4.h: Lots of stuff moved to lib/m4module.h.
7952         * lib/m4module.h: New file to define the interface available when
7953         compiling m4 modules.
7954         * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
7955         necessary for module compilation into this new file.
7957         * lib/Makefile.am (include_HEADERS): install headers (renamed to
7958         avoid nameclash with other system headers) necessary for compiling
7959         modules.
7960         (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
7961         so that modules can include the (renamed) installed headers and
7962         be guaranteed a matching implementation.
7963         * lib/m4error.h: renamed from error.h.
7964         * lib/m4obstack.h: renamed from obstack.h.
7965         * lib/m4regex.h: renamed from regex.h.
7966         * configure.in (AC_REPLACE_FUNCS):  Don't look for a system
7967         implementation, simply include the shipped version
7968         unconditionally, otherwise it is hard for a module to know
7969         whether the m4obstack.h header it is using matches the
7970         implementation it ends up linking against.
7971         (jm_WITH_REGEX):  Include regex into libm4 unconditionally for
7972         the same reason.
7974         1999-05-18  Gary V. Vaughan  <gary@gnu.org>
7976         * examples/misc.test: Don't run this test on machines which don't
7977         have a root user in /etc/passwd (e.g. cygwin).
7979         * tests/get-them (/^@example$/): Error messages might have a
7980         ``.exe'' suffix to the program name, or else use the libtool
7981         ``.libs/lt-m4'' binary, or generally have an unexpected path.  All
7982         of these cases are now catered for when comparing error messages
7983         in generated tests.
7984         * tests/other-tests/*.test: ditto.
7985         * examples/*.test: ditto.
7987         * tests/defs (M4): use libtool execute mode.
7988         * examples/defs (M4): ditto.
7990         * tests/get-them (END): explicitly close any open file.
7991         (printthem): In a regular expression, '{' is the start of a repeat
7992         count!  Use `[{]' for a literal open brace.
7993         (/^@node /): Don't use substr on a string shorter than the trim
7994         length.
7996         1999-05-17  Gary V. Vaughan  <gary@gnu.org>
7998         * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
7999         substituted.
8000         (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
8002 2000-01-10  Andreas Schwab  <schwab@suse.de>
8004         * tests/other-tests/gmp.test: Find config.sh in build directory.
8006         * configure.in: Find tests/mkconfig.sh in $srcdir.
8008         * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
8009         <signal.h> (for SUS2 compliant systems).
8011         * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
8012         HAVE_SIGINFO_H.
8014 2000-01-10  René Seindal  <rene@seindal.dk>
8016         * Prerelease 1.4o.
8018         * TODO, NEWS: Cleaned up and updated.
8020         * src/m4.c (main): New variable exit_status for exit status in
8021         case of unreadable files.  Now m4 will exit with EXIT_FAILURE if a
8022         file cannot be read instead of EXIT_SUCCESS.
8024         * src/builtin.c (m4_indir): Changed error message to help
8025         translators (from Akim Demaille <demaille@inf.enst.fr>).
8027         * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
8028         Cygnus.
8030         * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
8031         from glic 2.1.2.
8033         * src/input.c (match_input): Reordering of code, to avoid multiple
8034         calls to push_string_init() from obstack_grow(), which can happen
8035         with some compilers (found and fixed by James Bonfield
8036         <jkb@mrc-lmb.cam.ac.uk>).
8038         * src/stackovf.c: Added prototypes for ultrix.
8039         (setup_stackovf_trap): Added __P to cast.
8040         (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
8042 2000-01-09  René Seindal  <rene@seindal.dk>
8044         * doc/m4.texinfo (Changequote): Added comment about changing
8045         quotes when the old quote is a part of the new.
8047         * src/builtin.c (expand_ranges): Added break after trailing dash.
8048         This caused misbehavious on some systems (found and fixed by Akim
8049         Demaille <demaille@inf.enst.fr>).
8051         * AUTHORS: Thomas Tanner included
8053         * acconfig.h: Added entry for ss_sp (see below).
8055         * configure.in (use_stackovf): Added check for stack_t with member
8056         ss_base instead of ss_sp (BSDI notably).  (Reported by Paul Eggert
8057         <eggert@twinsun.com>).
8059         * doc/m4.texinfo (Frozen files): Added a simpler example for
8060         generating frozen files from several input files.
8062 1999-11-14  Paul Eggert  <eggert@twinsun.com>
8064         * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
8065         lib/regex.c, lib/xmalloc.c.
8067 1999-11-10  René Seindal  <rene@seindal.dk>
8069         * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
8071         * src/module.c: reindented.
8072         (module_load): return if this is a repeated load of same module.
8073         (module_init): slight change of logic to avoid repeated
8074         initialisation debug messages.
8076         * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
8077         in the distribution.
8079         * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
8080         automake warnings about missing lib prefix.
8081         (time_la_LDFLAGS): ditto
8082         (stdlib_la_LDFLAGS): ditto
8084 1999-11-10  Paul Eggert  <eggert@twinsun.com>
8086         * src/m4.h: Include error.h, since our macros use error.
8087         * src/m4.c: Don't need to include error.h.
8089 1999-11-09  Paul Eggert  <eggert@twinsun.com>
8091         * src/m4.h (voidstar): Define to void * if __STDC__ is defined
8092         and zero, as Solaris 7 cc does.
8093         (bcopy): Remove macro; no longer needed with new obstack.h.
8095         * src/output.c (freeze_diversions): Don't assume that a
8096         diversion size can fit in `int'.  Check for diversion file
8097         size too large to be printed with `unsigned long'.
8099         * src/Makefile.am (CFLAGS): Omit -Wall.
8101         * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
8103         * src/debug.c (trace_format):
8104         Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
8106         * src/freeze.c (produce_frozen_state):
8107         Don't assume string lengths fit in int.
8109 1999-10-13  René Seindal  <rene@seindal.dk>
8111         * po/cs.po: Czech translation added.
8113         * po/sv.po: Updated Swedish translation.
8115         * po/ru.po: Updated Russian translation.
8117         * po/pl.po: Updated Polish translation.
8119         * po/el.po: Greek translation added.
8121 1999-10-13  René Seindal  <rene@seindal.dk>
8123         * configure.in (ALL_LINGUAS): Added Greek translation (el).
8124         (ALL_LINGUAS): Added Czech translation (cs).
8126 1999-03-30  Gary V. Vaughan  <gary@gnu.org>
8128         * src/builtin.c: moved module loading functions into...
8129         * src/module.c: entirely new implementation using libltdl.
8130         * po/POTFILES.in: added src/module.c.
8131         * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
8132         are modules, not linktime libraries.
8133         (LDFLAGS): added -no-undefined -module and -avoid-version flags.
8134         * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
8135         avoidance on exported symbols.
8136         * modules/test.c (m4_macro_table, m4_init_module,
8137         m4_finish_module): ditto.
8138         * modules/time.c (m4_macro_table): ditto.
8140         * modules/time2.m4: new file which requires command line loading
8141         of modules.
8142         * src/m4.c (--load-module): dynamically load named runtime module
8143         into running executable before reading the source.
8144         (--module-directory): prepend a directory to the module search
8145         path.
8146         (module_init()): Do this the first time we load a module instead;
8147         if the module subsystem is broken normal m4 scripts can still run.
8148         * src/m4.h (install_builtin_table): is now exported.
8150 1999-03-26  Gary V. Vaughan  <gary@gnu.org>
8152         * src/module.c: removed.  No longer required.
8153         * po/POTFILES.in: removed src/module.c.
8155         * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
8156         the bootstrap script can recreate.
8157         * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
8158         * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
8159         * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
8160         * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
8161         (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
8162         * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
8163         * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
8164         * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
8166         * acinclude.m4: removed.  `aclocal -I acm4' handles this much
8167         better.
8168         * acm4/Makefile.am (ACINCLUDE_M4): ditto.
8169         * acm4/gettext.m4: removed.  It causes a multiple definition vs.
8170         the installed gettext.m4 file when running aclocal.
8172 1999-03-25  Gary V. Vaughan  <gary@gnu.org>
8174         * configure.in (AM_INIT_AUTOMAKE): bumped version number to
8175         distinguish this from the last prerelease.
8176         (AC_LIBLTDL_CONVENIENCE):  build libltdl as a convenience library
8177         in its own subdirectory.
8179         * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
8180         lib prefix on a module" feature.
8181         (LDFLAGS): Added `-module -avoid-version' flags to build
8182         versionless module libraries.
8183         * src/builtin.c (m4_load_module): use libltdl.
8184         (module_unload_all): use libltdl.
8185         * src/m4.c (module_init): initialise module loading on demand for
8186         better diagnostics, and so that m4 will still work even if
8187         the module code is broken.
8188         * src/m4.h (module_init): removed.  No longer relevant.
8189         * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
8190         exported symbols for compatibility with dlpreopening.
8191         * modules/test.c (m4_macro_table, m4_init_module,
8192         m4_finish_module): ditto.
8193         * modules/time.c (m4_macro_table): ditto.
8195         * bootstrap: New file.  Runs all the autoutils in the right order
8196         after a fresh checkout, or a make maintainer-clean.
8198 1999-02-18  Akim Demaille  <demaille@inf.enst.fr>
8200         * src/builtin.c (dump_symbols): New function, factoring common
8201         content of m4_dumpdef and m4_symbols.
8202         (m4_dumpdef): Use it.
8203         (m4_symbols): New function, implementing `symbols'.  Use it.
8204         * doc/m4.texinfo: Fixed missing commas after @xref, so that the
8205         file compile with modern makeinfo.
8206         (Symbols): New node, documenting symbols.
8207         (direntry): Modernize.
8209 1998-12-11  René Seindal  <rene@seindal.dk>
8211         * src/builtin.c (predefined_tab): New predefined macros
8212         __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
8213         configure time options.
8215 1998-12-01  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
8217         * src/module.c (module_try_load): Don't try to be clever and
8218         overwrite argument string.  Instead allocate all constructed
8219         strings locally, since they can have arbitrary lengths.  Make
8220         arguments pointers to const.
8221         (module_search): Simplify due to above change.
8223 1998-11-29  René Seindal  <rene@seindal.dk>
8225         * Prerelease 1.4n.
8227         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
8229         * tests/other-tests/import-environment.{m4,test}: New test.
8231         * tests/other-tests/discard-comments.{m4,test}: New test.
8233         * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
8235         * src/m4.c (main): New option -c --discard-comments.
8236         New global variable discard_comments.
8238         * src/m4.h (token_type): New TOKEN_NONE for tokens to be
8239         discarded, ie never returned from next_token().
8240         Added declaration of discard_comments.
8242         * src/input.c (next_token): Now loops until token type is not
8243         TOKEN_NONE.  Comments are now given this type when comments should
8244         be discarded.
8246         * doc/m4.texinfo (Invoking m4): Updated for --import-environment
8247         and mpeval.
8249 1998-11-28  René Seindal  <rene@seindal.dk>
8251         * src/m4.c (main): New option --import-environment (no single
8252         letter option).
8254         * When configured with --with-gmp both the normal (fast) eval()
8255         and the gmp aware mpeval() are defined.  To restore previous
8256         bahaviour use "define(`eval', defn(`mpeval'))".
8258         * tests/other-tests/gmp.m4: Changed to use mpeval().
8260         * src/evalmp.c: New file for compiling eval.c as gmp aware.
8261         Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
8263         * src/eval.c: Now includes "numb.c" directly.  Everything in this
8264         file must by static, except evaluate(), which is changed to
8265         mp_evaluate() if USE_GMP in force.
8267         * src/numb.c: Changed to be included by eval.c instead of being
8268         compiled separately.  Everything is declared static.
8270         * src/numb.h: Removed declarations of functions, as numb.c is now
8271         included by eval.c.
8273         * src/builtin.c: Declaration of m4_mpeval() added.
8274         Inserted `mpeval' in builtin table.
8275         (do_eval): New function with common code for m4_eval and m4_mpeval.
8276         (m4_mpeval): New function for gmp version of eval.
8278         * src/m4.h: Declaration of mp_evaluate().
8280         * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
8281         (EXTRA_m4_SOURCES): Now has numb.c and numb.h
8283         * src/m4.c (main): m4 --version also shows which options were used
8284         for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
8286 1998-11-27  René Seindal  <rene@seindal.dk>
8288         * Error messages now always print program name before input file
8289         name as specified by GNU coding standards.  Reported by Akim
8290         Demaille <demaille@inf.enst.fr>.
8292         * doc/m4.texinfo (Include): Change due to changed error message
8293         format.
8294         (Eval): Do.
8296         * tests/get-them: Minor change to sed script due to changed error
8297         message format.
8299         * src/m4.c (print_program_name): New func used to print program
8300         name, input file and line number in error ().  Used as an
8301         error_print_progname handler.
8302         (reference_error): Removed.
8303         (main): Assigns error_print_progname.
8305         * src/m4.h (M4ERROR): Removed reference_error ().
8307 1998-11-25  René Seindal  <rene@seindal.dk>
8309         * Updated to libtool 1.2b.
8311         * src/builtin.c (install_builtin_table): Added braces to avoid
8312         warning of ambiguous 'else'.
8314         * src/module.c: Inserted search path code from path.c modified to
8315         use new interface.
8316         (module_init): Configured default path used only if M4MODPATH is
8317         not set.
8318         (module_try_load): Now reads libMODULE.la as generated by libtool
8319         for actual module name.
8320         (module_load): Gives better error messages on failure.
8322         * src/m4.h: Added declarations of structures and functions for
8323         generic search path handling.
8325         * src/path.c: Removed all module specific code and introduced new
8326         functions of more generic search path handling.
8328 1998-11-24  René Seindal  <rene@seindal.dk>
8330         * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
8331         included gettext, as <libintl.h> might not be found
8332         otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
8334 1998-11-22  René Seindal  <rene@seindal.dk>
8336         * src/output.c (insert_diversion): Fixed bug that might cause m4
8337         to read from standard output!  Triggered by input
8338         'divert(1)undivert(0)'.  Test for divnum>0 changed to divnum>=0,
8339         so now 'undivert(0)' does nothing.
8341 1998-11-18  René Seindal  <rene@seindal.dk>
8343         * Prerelease 1.4m.
8345         * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
8346         could be changed when compiling a illegal regexp, causing later
8347         use of the regexp to dump core.
8349         * src/module.c (module_load): Changed error message to conform to
8350         standards.
8352         * src/m4.c (usage): Added message about reporting bugs.
8354         * doc/m4.texinfo (Changeword): Corrected a wrong example.
8355         (Changeword): Added note about the type of regexps used.
8357         * ltconfig, ltmain.sh: New files from Libtool 1.2.
8359         * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
8360         and AM_PROG_LIBTOOL.
8362         * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
8363         with libtool.
8365         * modules/Makefile.am: Changed completely to compile modules using
8366         libtool.  The modules are compiled as shared libraries, and are
8367         renamed when installed.
8369         * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
8370         USE_SHL_LOAD to HAVE_SHL_LOAD
8372         * src/builtin.c (shipout_string): Now tests for a NULL string.
8374         * src/module.c: New level of indirection around non-portable
8375         functions to load shared objects.  Intended to encapsulate the non
8376         portable parts better and to reduce the number of #ifdefs in the
8377         code.
8379         * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
8380         directory modules/ to the distribution.
8382 1998-11-15  René Seindal  <rene@seindal.dk>
8384         * Prerelease 1.4l.
8386         * modules/stdlib.c: New module `stdlib' defining some standard
8387         functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
8388         getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
8390         * src/builtin.c (shipout_string): New convenience function for
8391         builtins and modules.
8393         * src/module.c (module_load): Tentative support for
8394         shl_load/shl_findsym, but I cannot test it.  Copied from MetaHTML.
8396         * Makefile.am (SUBDIRS): Directory modules added if configured.
8398         * modules/Makefile.am: Now correctly compiles and installs
8399         modules in pkglibexecdir.
8401         * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
8402         These two are now initialised by autoconf macros.
8404         * src/path.c (module_env_init): MODULE_PATH is always on the
8405         search path.
8407         * src/Makefile.am: Now generated pathconf.h which defined the
8408         default MODULE_PATH.
8410         * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
8411         where modules are installed.
8413         * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
8414         by Brian J. Fox <bfox@datawave.net>.  This change allow modules to
8415         build and install automatically, and it is prepared for other
8416         interfacec than dlopen().
8418         * src/builtin.c (predefined_tab): Added __m4_version__ for the
8419         current version of GNU m4.  It is a GNU extension.
8421 1998-11-14  René Seindal  <rene@seindal.dk>
8423         * tests/Makefile.am (GENERATED_TESTS): Added new
8424         generated-tests/changesy.8.test
8426         * doc/m4.texinfo (Changesyntax): Documentation for escape
8427         syntax class.
8429         * src/macro.c (expand_token): Check for escaped macro call before
8430         symbol table lookup.
8432         * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
8433         characters
8435         * src/input.c: New static variable use_macro_escape, which is TRUE
8436         iff some character has code SYNTAX_ESCAPE
8437         (input_init): Added initialisation of use_macro_escape.
8438         (check_use_macro_escape): New function to synchronise
8439         use_macro_escape with the syntax table.
8440         (set_quotes): Added call to check_use_macro_escape()
8441         (set_comment): Do.
8442         (set_syntax): Do.
8443         (next_token): Added new case for IS_ESCAPE.
8445         * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
8447 1998-10-13  René Seindal  <rene@seindal.dk>
8449         * Prerelease 1.4k.
8451         * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
8452         generated-tests.
8454         * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
8455         maintained tests in tests/other-tests.  These currently tests for
8456         8-bit transparency, multiple precision arithmetic and sync-line
8457         output.  Test for stackoverflow detection does not work.
8459         * examples/Makefile.am (TESTS): Added tests for all example files.
8461         * examples/mktests.sh: New file.  Help program for creating test
8462         files.
8464         * tests/mkconfig.sh: New file to generate tests/config.m4 and
8465         tests/config.sh.  This is for tests of configure selectable
8466         features.  Picks up all set WITH_ and ENABLE_ veriables from
8467         config.h
8469         * src/path.c (path_search): Added argument 'char **expanded_name'
8470         to return the expanded name.
8472         * src/m4.h: Added 2nd argument to declaration of path_search().
8474         * src/m4.c (main): Added 2nd argument to path_search().
8476         * src/freeze.c (reload_frozen_state): Do.
8478         * src/builtin.c (m4_undivert): Do.
8479         (include): Do.
8481 1998-10-11  René Seindal  <rene@seindal.dk>
8483         * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
8485         * acm4/modules.m4: New file.  Defines AM_WITH_MODULES.
8487         * acm4/gmp.m4: New file.  Defines AM_WITH_GMP.
8489         * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
8491         * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
8493         * intl/: Updated to GNU gettext 0.10.35.
8495         * doc/m4.texinfo (Format): Documented that format is blind.
8497         * src/builtin.c (builtin_tab): Builtin format marked as blind.
8499 1998-10-07  René Seindal  <rene@seindal.dk>
8501         * Prerelease 1.4j.
8503         * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
8504         .test, as the files are no longer just m4 input.
8506         * tests/get-them (FILE): Changed .m4 extension to .test.
8508         * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
8509         Otherwise quoted strings with leading whitespace first in a macro
8510         argument would be eliminated.
8512         * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
8513         (expand_argument): Do.
8515         * src/input.c (next_token): SPACE and NUM/OTHER characters are only
8516         grouped together iff both quote and comment strings are single
8517         character.  Otherwise they might include a comment/quote leader.
8518         (next_token): Returns new token type TOKEN_SPACE.
8520         * src/builtin.c (push_builtin_table): New function to push a
8521         builtin_table on the stack without installing its contents.
8522         (find_builtin_by_name): Added call to push_builtin_table() if
8523         reading frozen files.  Otherwise the builtins named in the frozen
8524         files could not be found.
8525         (install_builtin_table): Changed to use push_builtin_table()
8527 1998-10-04  René Seindal  <rene@seindal.dk>
8529         * po/pl.po: Polish translation added.
8531         * po/POTFILES.in: src/module.c added.
8533 1998-10-04  René Seindal  <rene@seindal.dk>
8535         * Prerelease 1.4i.
8537         * configure.in (ALL_LINGUAS): Added Polish pl.po
8539 1998-10-03  René Seindal  <rene@seindal.dk>
8541         * Many files: Incorporated changes to implement dynamic modules.
8542         Detailed comments in src/modules.c and modules/README
8544         * src/module.c: New file, implements the OS dependant parts of
8545         dynamic module loading.
8547         * src/Makefile.am (m4_SOURCES): Added module.c
8549         * src/builtin.h: New file, declares some functions from builtin.c
8550         that are of use for other modules (shipout_int, numeric_arg,
8551         skip_space, bad_argc), and the macros ARG() and DECLARE().
8553         * src/builtin.c (install_builtin_table): New function.  Each
8554         module brings in a builtin_table, which is pushed on a stack.
8555         (struct builtin_table): New struct for list of builtin_tables.
8556         (m4_loadmodule): New function to implement builtin "loadmodule".
8557         (shipout_int): No longer static, to be used by modules.
8558         (numeric_arg): do.
8559         (skip_space): do.
8560         (bad_argc): do.
8561         (builtin_init): changed to call install_builtin_table()
8562         (find_builtin_by_name): Now searches all builtin_tables
8563         (find_builtin_by_addr): do.
8565         * src/path.c: Reorganised to allow for two search paths, one for
8566         include files and one for modules.
8568         * src/m4.h: Added declarations for new functions in module.c and
8569         in path.c.
8571         * src/m4.c (main): Added call to module_init().
8573         * modules: New directory with a few demo modules.
8575         * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
8576         in SUBDIRS.
8578         * configure.in: Added modules/Makefile to AC_OUTPUT.
8580         * configure.in: Added code to implement --with-modules.  Tests for
8581         <dlfcn.h> and -ldl.
8583         * acconfig.h: Added WITH_MODULES
8585 1998-10-02  René Seindal  <rene@seindal.dk>
8587         * examples/Makefile.am (pkgdata_DATA): Removed special target for
8588         check and variables TESTS.  These tests are now run from the
8589         tests/ directory.
8591         * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
8592         directory.  The files stay there but the tests are run from the
8593         tests/ directory.
8595         * tests/Makefile.am (EXTRA_DIST): Added run-test.
8597         * tests/run-test: New file.  Run a test manually
8599         * tests/Makefile.am, tests/get_them: Moved automatically generated
8600         tests (from the manual) to sub directory tests/gentest/.  The
8601         tests/ directory had gotten a bit messy.
8603 1998-09-06  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8605         * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
8606         wrap}.test: Added a few testcases.
8608 1998-08-21  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8610         * Prerelease 1.4h.
8612         * lib/Makefile.am (noinst_HEADERS): regex.h added
8614         * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
8615         acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
8617         * acm4/Makefile.am: created providing rules to create
8618         $(top_srcdir)/acinclude.m4 to be used by aclocal.
8620         * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
8621         `C'. Reported by Ulrich Drepper.
8623         * Makefile.am (SUBDIRS): Removed checks directory
8624         * configure.in (AC_OUTPUT): Removed checks/Makefile
8626         * doc/m4.texinfo (Patsubst,example): @comment added to preserve
8627         the space when m4.texinfo is edited and whitespace.el is active.
8628         (Defn,example): idem.
8630 1998-08-20  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8632         * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
8633         ../COPYING. ../Makefile is a file which is certainly present when
8634         test is executed in testSubDir. One can't be sure that the COPYING
8635         file is in .. or ../.. in all situations, the ../Makefile is
8636         always there.
8638         * doc/m4.texinfo (Include): adjusted expected test output
8639         according to new tests, i.e. the input will always come from the
8640         file `in' created by the test.
8642         * tests/Makefile.am: Added three lines at the top to get
8643         esyscmd.1.test working.
8645         * tests/get-them: modified to generate clearer tests who will need
8646         less maintenance when new test examples are created in
8647         `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
8648         need the generic file `defs') shell scripts creating `in', `ok',
8649         `out' and when apropriate `okerr' and `err' in the directory
8650         `testSubDir' when executed. The compare of `ok' and `out'
8651         (and of `okerr' and `err') will be the exit status of the test.
8652         `out' must match `ok' (and `okerr' must match `err') for the test
8653         to be succesful.
8655         * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
8656         the tests generated by tests/get-them getting it input normally
8657         from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
8658         (dot) before the numeric part) is reserved for all other (hand
8659         written) tests. The `+' means one or more times.
8661 1998-08-12  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8663         * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
8664         supported short man page to refer to info documentation
8665         * helptoman.pl: added
8666         * configure.in: AC_PATH_PROG(PERL,perl)
8667         * Makefile.am (SUBDIRS): doc after src
8669         * libitized with libit 0.5 from
8670         ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
8672         * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
8673         * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
8674          replacement functions, (libm4_a_LIBADD): @LIBOBJS@
8675         * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
8676           lib/rx.{c,h}: added
8677         * configure.in (AC_CHECK_FUNC): getopt_long
8679         * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
8681         * TODO: added entry about dependencies
8683 1998-08-10  René Seindal  <rene@seindal.dk>
8685         * Prerelease 1.4f
8687         * doc/m4.texinfo (Changesyntax): Added documentation for the macro
8688         "changesyntax".
8690         * src/builtin.c (m4_changesyntax): Added builtin macro
8691         "changesyntax" to modify the syntax table.
8693         * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
8694         table.  All categories are assigned a syntax code and tokens are
8695         read according to this table.
8697 1998-08-09  René Seindal  <rene@seindal.dk>
8699         * src/numb.{c,h}: New files, implements multiple precision eval
8700         using GNU gmp.  Originally submitted by John Gerard Makecki
8701         (johnm@vlibs.com), later modified.  Tested with GNU gmp 2.0.2.
8703         * doc/m4.texinfo (Eval): Added documentation for multiple
8704         precision arithmetic library support.
8706         * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
8707         to accommodate multiple precision eval.
8709 1998-08-07  René Seindal  <rene@seindal.dk>
8711         * src/input.c (MATCH, match_input), src/m4.h: changed definition
8712         of comment and quote strings to `unsigned int' to allow eight bit
8713         chars (reported by andrewb@zip.com.au (Andrew Bettison)).
8715         * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
8716         patch from Mike Howard <mike@clove.com>
8718 1998-08-06  René Seindal  <rene@seindal.dk>
8720         * gettext.m4: corrected AM_WITH_NLS to handle use of installed
8721         -lintl.
8723 1998-08-03  René Seindal  <rene@seindal.dk>
8725         * Prerelease 1.4e
8727         * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
8728         and _ macro.  M4 now builds with --disable-nls.
8730         * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
8731         to look for right message catalogs.  Call indef'ed by ENABLE_NLS.
8733         * configure.in (ALL_LINGUAS): Added complete list of translations:
8734         de fr it ja nl ru sv.
8736 1998-05-23  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8738         * po/nl.po: Dutch translation by Erick Branderhorst.
8740         * po/fr.po: French translation by Erick Branderhorst, based on the
8741         translations by François Pinard in fr.msg and m4.cod.
8743 1998-05-22  Erick Branderhorst  <Erick.Branderhorst@asml.nl>
8745         * Prerelease 1.4d.
8747         * src/m4.c: #include <signal.h> not <sys/signal.h>.
8749         * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
8751         * checks/Makefile.am: explicit list tests in CHECKS.
8753         * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
8754         src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
8755         mkinstalldirs, install-sh: Added automake (1.3) support.
8757         * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
8758         obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
8759         Used libitize (0.4) to update.
8761         * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
8762         (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
8763         README accordingly.
8765         * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
8766         stack overflow functionality.
8768 1994-12-03  François Pinard  <pinard@iro.umontreal.ca>
8770         * Prerelease 1.4.1.
8772         * Makefile.in (realclean-local): Delete stamp-h.in.
8774         * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
8775         Localize, adapting from how it is done in sharutils.
8777         * fr.tt: New file, for French.
8779         * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
8780         src/freeze.c: Rename PRODUCT to PACKAGE.
8782 1994-11-26  François Pinard  <pinard@iro.umontreal.ca>
8784         * configure.in: Check for <libintl.h> and <locale.h>.
8785         * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
8786         src/stackovf.c: Rename _ to __P.
8787         * src/m4.h: Declare _ as a macro returning its argument, or else,
8788         include <libintl.h> and declare _ as gettext.
8789         * src/m4.c: Possibly include <locale.h> and call setlocale.
8790         * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
8791         src/input.c, src/macro.c, src/output.c, src/path.c,
8792         src/stackovf.c, src/symtab.c: Use _ macro over all localizable
8793         strings.
8795 1994-11-07  François Pinard  <pinard@iro.umontreal.ca>
8797         * doc/Makefile.in (stamp-vti): Use new -r option to date.
8799         * configure.in: Put --with-gmp in place, in prevision for John
8800         Gerard's work.
8801         * acconfig.h: Document WITH_GMP.
8803 1994-11-05  François Pinard  <pinard@iro.umontreal.ca>
8805         * Release 1.4.
8807         * doc/Makefile.in (realclean): Also remove stamp-vti.
8808         Reported by Eric Backus.
8810 1994-11-02  François Pinard  <pinard@iro.umontreal.ca>
8812         * src/freeze.c (produce_frozen_state): If the frozen file cannot
8813         be opened, return immediately after producing the error message.
8814         Reported by Andreas Schwab.
8816         * configure.in: Check for const only after having found possible
8817         ANSIfying compiler flags, this is of no use to check it before.
8818         Reported by Alexander Lehmann.
8820 1994-11-01  François Pinard  <pinard@iro.umontreal.ca>
8822         * src/macro.c (collect_arguments): Cast obstack arguments to
8823         (voidstar), so avoiding compiler warnings.
8824         Reported by Joseph E. Sacco.
8826         * src/freeze.c (produce_frozen_state): Cast printed lengths to
8827         (int) so they correspond to %d format items.
8828         Reported by Joseph E. Sacco.
8830         * src/m4.c (main): Cast the argument to xfree to (voidstar).
8831         * src/symtab.c (free_symbol): Idem.
8832         Reported by Karl Vogel.
8834 1994-10-31  François Pinard  <pinard@iro.umontreal.ca>
8836         * Makefile.in (DISTFILES): Distribute BACKLOG.
8838         * configure.in: Define PRODUCT and VERSION.
8839         * acconfig.h: Document PRODUCT and VERSION.
8840         * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
8841         constant string m4 and variable or parameter named version.
8843 1994-10-30  François Pinard  <pinard@iro.umontreal.ca>
8845         * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
8846         __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
8847         defines __STDC__ to 0, for indicating it is *not* ANSI!
8848         Reported by Kaveh R. Ghazi.
8850         * configure.in: Added obsolescent tests for AIX and Minix.
8852         * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
8853         which texclean does not exist anymore.
8854         Reported by Eric Backus, Jim Meyering, John David Anglin and
8855         Joseph E. Sacco.
8857 1994-10-29  François Pinard  <pinard@iro.umontreal.ca>
8859         * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
8860         Reported by John David Anglin.
8862         * src/ansi2knr.c: New version, sent by Peter Deutsch.
8863         * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
8864         ANSI2KNR, depending on the fact the compiler is ANSI or not.
8865         * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
8866         Remove the sed filter after ansi2knr for debug.c.  Use $O instead
8867         of $U, put underline in extensions rather than in basenames.  Use
8868         implicit rules, now that regularity makes this possible.
8869         Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
8870         of ansi2knr whenever it is needed.
8871         * configure.in: Adjusted for correct STACKOVF substitution.
8872         * src/debug.c (trace_format): When not __STDC__, use (...) as a
8873         parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
8874         Reported by David MacKenzie.
8876         * Makefile.in: Remove binprefix.  Use transform_name instead.
8877         Reported by David MacKenzie.
8879         * doc/Makefile.in: Create version.texi, use it, clean it.
8880         Reported by Jim Meyering.
8882 1994-10-28  François Pinard  <pinard@iro.umontreal.ca>
8884         * Makefile.in (all, install, uninstall): Depend on Makefile.
8886         * Makefile.in: For actions invoking $(MAKE) from within compound
8887         sh statements, exit non-zero if the sub-make fails.  Otherwise,
8888         the top-level make may exit successfully when it should fail.
8889         Reported by Jim Kingdon.
8891         * {,/*}Makefile.in: Use && after all cd, in case they fail.
8893         * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
8894         (dist): Use PRODUCT and VERSION instead of tricks on .fname.
8895         * configure.in: Substitute PRODUCT and VERSION.
8897         * {,*/}Makefile.in (dist): Always try a hard link before a copy.
8899 1994-10-27  François Pinard  <pinard@iro.umontreal.ca>
8901         * Makefile.in (mostlyclean-local): Do not remove *~.
8902         * */Makefile.in (mostlyclean): Idem.
8903         Reported by Robert E. Brown and Richard Stallman.
8905 1994-10-09  François Pinard  <pinard@iro.umontreal.ca>
8907         * src/m4.h: Get rid of CONFIG_BROKETS.
8909 1994-10-02  François Pinard  <pinard@iro.umontreal.ca>
8911         * configure.in: Use AC_ARG_PROGRAM.
8912         * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
8913         Reported by David MacKenzie.
8915 1994-10-01  François Pinard  <pinard@iro.umontreal.ca>
8917         * configure.in: Do not add -O to CFLAGS for GNU C, now that
8918         configure does it automatically.
8919         Reported by Jim Meyering.
8921 1994-09-23  François Pinard  <pinard@iro.umontreal.ca>
8923         * src/stackovf.c: Declare the handler_t typedef earlier in the
8924         code, use it for stackovf_handler.
8925         (setup_stackovf_trap): Use RETSIGTYPE instead of void while
8926         casting sigsegv_handler.
8927         Reported by Robert Bernstein.
8929         * src/m4.c (main): Initialize program_name to argv[0] without
8930         basename'ing it.
8931         Reported by Karl Berry.
8933 1994-09-18  François Pinard  <pinard@iro.umontreal.ca>
8935         * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
8936         Reported by Karl Berry.
8938 1994-09-14  François Pinard  <pinard@iro.umontreal.ca>
8940         * lib/Makefile.in (mostlyclean): Added.
8941         (TAGS): Make in $(srcdir).
8943         * configure.in: Use `choke me' in test, like everywhere!
8945         * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
8946         unreacheable and useless.
8948         * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
8950         * lib/Makefile.in (DISTFILES): Distribute TAGS.
8951         (distclean): Do not remove TAGS.
8952         (realclean): Remove it.
8953         * Makefile.in: Make TAGS in lib also, not just in src.
8954         Reported by Karl Berry.
8956         * Makefile.in (distclean, realclean): Instead of recursively
8957         calling $(MAKE) for the -local part, allow parallel execution of
8958         -recursive and -local, only delay the removal of config.status,
8959         which is repeated in both goals.
8961 1994-09-13  François Pinard  <pinard@iro.umontreal.ca>
8963         * Release 1.3.
8965         * Makefile.in: Group all *clean-recursive goals in one, using sed
8966         to remove `-recursive' while calling make recursively.  Also, use
8967         a subshell for each recursive $(MAKE).
8968         Reported by Jim Meyering.
8970         * src/m4.h (memcpy): Define with bcopy for BSD systems.
8971         Reported by Kaveh R. Ghazi.
8973         * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
8974         4.1.3 requires -ldl to link even ansik2nr, and we need a way to
8975         specify it.
8977         * configure.in: Use date instead of touch for stamp-h.
8978         * Makefile.in (stamp-h.in): Idem.
8980         * Makefile.in (distclean, realclean): Force serial execution of
8981         both goals, in case parallel makes are being used.
8982         Reported by Jim Meyering.
8984         * src/Makefile.in (DISTFILES): Distribute TAGS.
8985         (distclean): Do not remove TAGS.
8986         (realclean): Remove it.
8987         Reported by Karl Berry.
8989 1994-09-10  François Pinard  <pinard@iro.umontreal.ca>
8991         * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
8992         to old names, for following Autoconf.
8994 1994-09-08  François Pinard  <pinard@iro.umontreal.ca>
8996         * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
8997         ./install.sh will not be correctly referred to in sub-Makefiles.
8998         Reported by John David Anglin.
9000         * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
9001         Reported by Eric Backus.
9003         * Makefile.in, checks/Makefile.in, doc/Makefile.in,
9004         examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
9005         config.status into remaking this directory's Makefile only.
9006         * Makefile.in (stamp-h): Do not check nor touch stamp-h.
9007         * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
9008         Reported by Jim Meyering.
9010 1994-09-06  François Pinard  <pinard@iro.umontreal.ca>
9012         * configure.in: Correct stack overflow detection logic, taking
9013         care of systems having only incomplete implementations (like for
9014         Pyramid 9820 OSx 5.0d).
9015         Reported by Kaveh R. Ghazi.
9017         * src/Makefile.in (TAGS): Remote -t from etags call.
9019 1994-09-02  François Pinard  <pinard@iro.umontreal.ca>
9021         * lib/Makefile.in (install): Depend on all.
9023 1994-08-31  François Pinard  <pinard@iro.umontreal.ca>
9025         * examples/Makefile.in (mostlyclean): Do not depend on texclean.
9026         Reported by Jim Meyering and John David Anglin.
9028         * Makefile.in (distclean-local): Delete config.log.
9029         Reported by Jim Meyering.
9031         Solidify frozen files with respect to -P:
9032         * src/m4.c: Have -P set prefix_all_buitins variable instead of
9033         calling a function by that name.  Declare the variable.
9034         * src/m4.h: Adjust declaration for prefix_all_buitins.
9035         * src/builtin.c (builtin_init): Merge in functionality from
9036         previous prefix_all_buitins function, while making entries in the
9037         symbol table, but not modifying the builtin description itself.
9039         * src/freeze.c (reload_frozen_state): Add a useless `break;',
9040         because *many* compilers do not accept an empty `default:'.
9041         Reported by Akiko Matsushita, Eric Backus, John David Anglin,
9042         Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
9044         * configure.in: Use AC_TYPE_SIGNAL.
9045         * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
9046         Reported by Robert Bernstein.
9048         * checks/Makefile.in (check): Modify PATH so check-them will find
9049         m4 in the src directory.
9050         * Makefile.in (check): Don't.
9051         Reported by Akiko Matsushita and Jim Meyering.
9053         * src/output.c (make_room_for, output_character_helper): New
9054         functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
9055         a per buffer MAXIMUM_BUFFER_SIZE.
9057         * src/output.c (output_text): New function, for optimizing the
9058         output of strings of characters.  Use it.
9060 1994-08-30  François Pinard  <pinard@iro.umontreal.ca>
9062         * doc, src: New directories reorganizing the distribution.
9063         * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
9064         files.
9065         * Makefile.in: Adjusted.
9066         * configure.in: Configure new Makefiles.
9068         * m4.h: Declare STRING typedef.  Use it for comment and quote
9069         strings, adjusting all references.  (This is the rudiments of a
9070         beginning for the eventual withdrawal of NUL terminated strings.)
9071         * output.c (shipout_text): Accept a length parameter, and use it.
9072         All callers adjusted.
9074 1994-08-29  François Pinard  <pinard@iro.umontreal.ca>
9076         * m4.h: Include <unistd.h> if it exists.
9077         * stackovf.c: Don't.
9079         Clean up for current_diversion variable:
9080         * output.c: Move current_diversion from builtin.c.
9081         * m4.h: Declare current_diversion so builtin.c can access it.
9082         * output.c (output_init, make_diversion): Initialize or update
9083         current_diversion.
9084         * builtin.c (builtin_init, m4_divert): Leave current_diversion
9085         alone.
9087         Remove limit on number of diversions:
9088         * output.c: Replace ndiversion by diversions, declare it.
9089         (output_init): Allocate only diversion 0.
9090         (make_diversion): Allocate new diversions as needed.
9091         * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
9092         * m4.c: Still accept -N, but do nothing with it.
9093         Reported by David MacKenzie.
9095         Freeze diversions:
9096         * output.c (freeze_diversions): New function.
9097         * m4.h: Declare freeze_diversions.
9098         * freeze.c: Document frozen file format, revise it, call
9099         freeze_diversions to add diversions to frozen format, and code to
9100         reload them properly.
9101         * m4.c: Do not undivert automatically at end when status being
9102         frozen.  Do not call builtin_init when reloading frozen state.
9104         Speed up diversion processing:
9105         * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
9106         COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
9107         structure and variables, cached variables out of output_diversion,
9108         reallocate_diversion_for and OUTPUT_CHARACTER.
9109         (shipout_text, make_diversion, insert_diversion): Adapted to new
9110         structures.
9111         (insert_file): Use better buffering.
9112         Reported by David MacKenzie.
9114 1994-08-28  François Pinard  <pinard@iro.umontreal.ca>
9116         * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
9117         dist works from another build directory.
9119 1994-08-27  François Pinard  <pinard@iro.umontreal.ca>
9121         * symtab.c (hack_all_symbols): Use hash_table_size instead of
9122         constant HASHMAX, for -H option to work better.
9124         * builtin.c (DECLARE): Simplify by using _ ().
9126         * freeze.c: New file.
9127         * Makefile.in: Compile it, distribute it.
9128         * m4.c: Recognize, document and process --freeze-state (-F) and
9129         --reload-state (-R) options.  Pass a true flag to builtin_init
9130         only if no reloading some state.
9131         * builtin.c (define_builtin): Remove static specifier.
9132         (find_builtin_by_name): Remove static specifier.
9133         (builtin_init): Accept and obey a flag argument.
9134         * m4.h: Add declarations for freeze.c, changes for builtin.c.
9136 1994-08-24  François Pinard  <pinard@iro.umontreal.ca>
9138         * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
9139         specifier.
9141         * configure.in: Implement --with-dmalloc.
9142         * acconfig.h: Document WITH_DMALLOC.
9143         * m4.h: Add code for when WITH_DMALLOC.
9145 1994-08-15  François Pinard  <pinard@iro.umontreal.ca>
9147         * m4.c (long_options): Use "error-output", the dash was missing.
9148         Reported by Akiko Matsushita.
9150 1994-08-12  François Pinard  <pinard@iro.umontreal.ca>
9152         * m4.h: Include <sys/types.h>.
9153         * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
9154         * m4.h: Declare len_lquote and len_rquote as size_t, not int.
9155         int.
9156         * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
9157         as size_t, not int.
9158         * builtin.c (dump_args): Declare len as size_t, not int.
9160         * debug.c: Prototype the forward declaration of debug_set_file.
9162         * builtin.c (m4_undivert):  Replace div by file, for avoiding the
9163         shadowing of this variable.
9164         * output.c (insert_diversion): Idem.
9166         * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
9167         (input_init): Duplicate default quote and comment strings.
9168         (set_quotes): Free previous quote strings in all cases.  Duplicate
9169         even default quote strings.
9170         (set_comment): Free previous comment strings in all cases.
9171         Duplicate even default comment strings.
9173         * configure.in: Updated for Autoconf 2.0.
9174         * Makefile.in (distclean-local): Also delete config.cache.
9176         * m4.c (usage): Reorganize the --help output by topic.  Include a
9177         description for debugging flags.
9179 1994-07-29  François Pinard  <pinard@iro.umontreal.ca>
9181         * configure.in: If sigaction is available and SA_ONSTACK defined,
9182         use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
9183         defined, use sigvec.  Else don't compile stackovf.c.
9184         * stackovf.c (setup_stackovf_trap): Idem.
9185         Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
9186         and Simon Leinen.
9188 1994-07-21  François Pinard  <pinard@iro.umontreal.ca>
9190         * m4.c (usage): Replace printf par fputs.
9192 1994-07-18  François Pinard  <pinard@iro.umontreal.ca>
9194         * Release 1.2
9196 1994-07-17  François Pinard  <pinard@iro.umontreal.ca>
9198         * configure.in: Check for sigaction and sigvec.  Add a new delayed
9199         check for RLIMIT_STACK, combine in the checking for getrlimit.
9200         All those things are not universally available.
9201         * stackovf.c: Split setting up the trap handler and catching
9202         signals, for better taking care of various configure outcomes.
9203         * examples/stackovf.sh: Correct a typo.
9204         Reported by Eric Backus, Jim Avera and Jim Meyering.
9206 1994-07-16  François Pinard  <pinard@iro.umontreal.ca>
9208         * ansi2knr.c: New version sent by its author, Peter Deutsch.
9210 1994-07-15  François Pinard  <pinard@iro.umontreal.ca>
9212         * Makefile.in: Modify so parallel make will not try making
9213         lib/libm4.a twice simultaneously.
9214         Reported by Jim Meyering.
9216 1994-07-14  François Pinard  <pinard@iro.umontreal.ca>
9218         * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
9219         error message, for when no code possibility exists.  Even if this
9220         line is completely #ifdef'ed out, it brings a syntax error.
9221         Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
9223         * Makefile.in (install): Have install depend on all too, for lib
9224         to be remade as needed.
9226         * examples/stackovf.sh: Try ksh, bsh and bash for shells
9227         providing ulimit, instead of using only ksh.
9228         Reported by Jim Avera and Joseph E. Sacco.
9230 1994-07-12  François Pinard  <pinard@iro.umontreal.ca>
9232         * Makefile.in (check): Have it depend on all instead of m4.  In
9233         this way, a change in lib will be detected and processed.
9235         * builtin.c (numeric_arg): Use strtol and verify the conversion,
9236         instead of using sscanf which stops as soon as there is a
9237         non-digit in the input.  Previously, incr(1xyzzy), eval(1,2xyzzy)
9238         and divert(1xyzzy) were all accepted without any warning or error
9239         messages.
9240         * m4.h: Declare strtol as long if not including stdlib.h.
9241         * configure.in: Check for limits.h, and replace strtol if missing.
9242         * lib/Makefile.in: Substitute LIBOBJS.  Distribute strtol.c.
9243         * lib/strtol.c: New file, from elsewhere.
9244         Reported by Andreas Schwab.
9246 1994-07-07  François Pinard  <pinard@iro.umontreal.ca>
9248         * macro.c (expand_macro): Cast value to (boolean) prior to
9249         assigning it to traced.
9250         Reported by Tom McConnell.
9252         * Makefile.in (m4): Always make all in lib first.
9253         Reported by Jim Meyering.
9255 1994-07-06  Jim Avera <jima@netcom.com>
9257         * stackovf.c: Isolated OS-dependent sections; Improved portability,
9258         adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
9259         handlers), and a default error message if the fault address is not
9260         available (when neither siginfo.h nor BSD sigcontext are supported).
9261         * configure.in: Changes for stackovf.h: Check for sigcontext,
9262         sigaction, sigstack, and define rlim_t as int if necessary.
9263         * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
9264         * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
9265         * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
9267 1994-07-05  François Pinard  <pinard@iro.umontreal.ca>
9269         * configure.in: Use AC_SET_MAKE.
9270         * Makefile.in: Use @SET_MAKE@.
9271         Reported by Jim Meyering.
9273         * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
9274         Reported by Ian Taylor.
9276 1994-07-02  François Pinard  <pinard@iro.umontreal.ca>
9278         * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
9279         because siginfo.h is unrelated to standard headers, and siginfo.h
9280         is already checked for.
9281         Reported by Joseph E. Sacco.
9283         * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
9284         PROTOTYPES.
9285         * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
9286         AC_PROTOTYPES.
9288 1994-06-29  François Pinard  <pinard@iro.umontreal.ca>
9290         * builtin.c (substitute): Use \& to represent this part of the
9291         string which was matched by the whole regexp, instead of
9292         representing the whole string.  Any usage of \0 issues a warning
9293         and acts like \&, it will disappear in some subsequent release.
9295 1994-06-27  François Pinard  <pinard@iro.umontreal.ca>
9297         * m4.c: Complete prototype for forwarded declaration of usage.
9299         * input.c (init_macro_token): Correct own reference in error
9300         message.  Previous name get_macro_func was referred to instead.
9301         (next_char):  Correct own reference in error message.  Previous
9302         name advance_input was referred to instead.
9304         * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
9305         * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
9306         and_term, not_term, logical_not_term, cmp_term, shift_term,
9307         add_term, mult_term, exp_term, unary_term, simple_term): Add
9308         prototype to forwarded declarations.  Declare parameter v1 as
9309         eval_t * instead of int *.  Same for local variable v2 in dyadic
9310         functions.  Same for result in exp_term.
9311         * builtin.c (m4_eval): Declare value as eval_t instead of int.
9312         (ntoa): Declare value as eval_t instead of int.  Declare uvalue as
9313         unsigned_eval_t instead of unsigned int.  Change casts accordingly.
9314         (shipout_int): Cast first argument of ntoa to eval_t.
9315         Reported by Thorsten Ohl.
9317         * macro.c: Complete the prototypes of forwarded expand_macro and
9318         expand_token.
9319         Reported by Thorsten Ohl.
9321         * m4.h: Define voidstar as void * or char * depending on __STDC__.
9322         The Ultrix 3.1 compiler cannot do much with void pointers.
9324         * builtin.c (dumpdef_cmp): Replace void * by voidstar.
9325         * m4.c (xfree):  Replace void * by voidstar.
9326         Reported by Tom McConnell.
9328         * ansi2knr.1: New, from elsewhere.
9329         * Makefile.in (DISTFILES): Distribute ansi2knr.1
9331         * Makefile.in (stamp-h.in): Avoid running ./config.status if
9332         stamp-h does not exist yet.  This avoids running it a second time
9333         just after the initial ./configure.
9334         Reported by David MacKenzie and Tom McConnell.
9336         * m4.h: Replace the enum debug_info declaration with a series of
9337         #define's.  The Ultrix 3.1 compiler would otherwise need casting
9338         (int) to most references, when used in expressions.
9339         Reported by Tom McConnell.
9341 1994-06-25  François Pinard  <pinard@iro.umontreal.ca>
9343         * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
9344         following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
9345         calls the compiler.  Previously, FP_PROTOTYPES was only calling
9346         the preprocessor; by not being subject to CFLAGS, this was
9347         discouraging those flags asking for ANSI compilation.
9348         * acconfig.h: Document HAVE_PROTOTYPES.
9349         * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
9350         * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
9351         Reported by Eric Backus.
9353         * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
9354         from the environment.  Default CFLAGS to -g if not set.
9355         * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
9356         * lib/Makefile.in: Have CFLAGS substituted from configure.
9357         Reported by Eric Backus and Tom McConnell.
9359         * configure.in: m4_undefine changeword before using AC_ENABLE.
9361         * m4.h: Declare prototypes for error (for ANSI compilers only),
9362         prefix_all_builtins and reference_error.
9363         Reported by Tom McConnell.
9365         * input.c (set_word_regexp): Do not try to initialize the array
9366         test from a string, this does not work with non-ANSI compilers.
9367         Reported by Eric Backus.
9369         * Makefile.in (dist): Clean examples/ before saving it.
9370         (distclean-local): Also remove stamp-h.
9371         Reported by Eric Backus.
9373         * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
9374         non ANSI compilers.
9375         Reported by Tom McConnell.
9377         * checks/Makefile.in (clean): Depends on mostlyclean.
9378         (mostlyclean): New goal.
9380 1994-06-24  François Pinard  <pinard@iro.umontreal.ca>
9382         * Makefile.in (DISTFILES): Distribute install.sh.
9383         * install.sh: New file, copied from elsewhere.
9384         Reported by Assar Westerlund and Kaveh R. Ghazi.
9386 1994-06-23  François Pinard  <pinard@iro.umontreal.ca>
9388         * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
9389         * acconfig.h: Explain ENABLE_CHANGEWORD.
9391         [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
9392         from code provided by Pete Chown]
9393         * m4.h: Add original_text field to u_t variant of union u.
9394         Declare TOKEN_DATA_FUNC macro.
9395         * builtin.c: Declare changeword.
9396         (m4_changeword): New function.
9397         * input.c: Include "regex.h", define variables with word regexps.
9398         (input_init): Initialize the word regexp.
9399         (set_word_regexp): New.
9400         (next_token): Declare local variables, use the previous code if
9401         default_word_regexp is true.  Else, match using a new code.  Save
9402         the original text.
9403         * macro.c (expand_token): Ship out original text if not a macro
9404         name.
9405         Reported by Krste Asanovic and Pete Chown.
9407         [These modifs all depend upon ENABLE_CHANGEWORD]
9408         * m4.h: Declare external user_word_regexp.
9409         * m4.c: Declare user_word_regexp, and initialize it from
9410         --word-regexp or -W, or NULL if not specified.
9411         * input.c: Use user_word_regexp if specified, instead of
9412         DEFAULT_WORD_REGEXP.
9414         * Makefile.in (m4): Revert Jan 3 1994 change.  I'm unable to
9415         agree with it.
9417         * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
9418         * checks/Makefile.in: Empty the suffix list.
9419         Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
9421         * m4.c: Declare nesting_limit and initialize it to 250.
9422         Implement -LNUMBER or --nesting-limit=NUMBER to change its
9423         value.
9424         * m4.h: Declare nesting_limit as external.
9425         * macro.c (expand_macro): Stop execution whenever nesting limit
9426         is exceeded.
9427         Reported by Bengt Mertensson.
9429         * eval.c (evaluate): Diagnose excess characters in eval input.
9430         Things like `eval(08)' used to return 0 with no diagnostic.
9432         * m4.h: Capitalize first letter of all macro arguments in
9433         definitions.
9435         * m4.c: Declare warning_status, initialize it to 0.  Add new
9436         option -E, or --fatal-warnings, which sets warning_status to
9437         EXIT_FAILURE instead.
9438         * m4.h: Declare external warning_status.  Define EXIT_SUCCESS and
9439         EXIT_FAILURE if not otherwise done by header files.
9440         * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
9441         * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
9442         eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
9443         argument of all M4ERROR calls.
9444         Reported by Noah Friedman.
9446         * examples/incl-test.m4: Renamed from incl_test.m4.
9447         * examples/include.m4: Include incl-test.m4 instead of
9448         incl_test.m4.
9449         * examples/multiquotes.m4: Renamed from multi-quotes.m.
9451 1994-06-22  François Pinard  <pinard@iro.umontreal.ca>
9453         * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
9454         that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
9455         also tested it on a Sun Sparc workstation running SunOS 4.x.
9457         * format.c (format): When not HAVE_EFGCVT, m4 was failing the
9458         49.format check, abusing a `union values' argument with sprintf
9459         without selecting the proper field.  Now, save the formatting type
9460         first, delaying the fetch of the corresponding argument.
9461         Reported by Joseph E. Sacco and Tom Quinn.
9463         * format.c (format): Remove const from char *fmt declaration when
9464         not HAVE_EFGCVT, because a NUL may be forced into it.
9466         * m4.h: Declare atof() when not STDC_HEADERS.
9467         Reported by Joseph E. Sacco.
9469         * Regenerate configure using Autoconf 1.11, this corrects a
9470         problem about an incorrect cpp seting on NeXT 3.1.
9471         Reported by Alexander Lehmann.
9473 1994-06-05  François Pinard  <pinard@iro.umontreal.ca>
9475         * m4.h (_): Change argument from `x' to `Args'.
9477 1994-04-22  François Pinard  <pinard@iro.umontreal.ca>
9479         * m4.h: Rename Args() to _().
9480         * m4.h: Remove extern specifier from all function declarations.
9482 1994-04-22  Jim Avera <jima@netcom.com>
9484         * stackovf.c: New file implementing stack-overflow detection.
9485         * configure.in: Check for getrlimit, sigaction.  If all of
9486         standard headers, getrlimit and sigaction, define USE_STACKOVF and
9487         substitute ${U}stackovf.o for STACKOVF.
9488         * acconfig.h: Declare USE_STACKOVF.
9489         * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
9490         * m4.h: Declare setup_stackovf_trap().
9491         * m4.c: Call setup_stackovf_trap().
9492         * tests/stackovf_test.sh: New file.
9494 1994-04-13  François Pinard  <pinard@iro.umontreal.ca>
9496         * checks/Makefile.in: Rename .all-stamp to stamp-checks.
9498         * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
9500 1994-01-30  François Pinard  <pinard@iro.umontreal.ca>
9502         * m4.h: Remove definition of volatile, not used anymore.
9503         Reported by Jim Meyering and Joseph E. Sacco.
9505         * m4.h: Consistently use `do { ... } while (0)' in macros, instead
9506         of `if ... else /* nothing */' for if macros.
9507         Reported by Jim Meyering.
9509         * builtin.c (m4_regexp): Reorganize the code for avoiding a
9510         warning from gcc about `repl' possibly used before defined.
9511         Reported by Jim Meyering.
9513         * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
9514         Reported by Jim Meyering.
9516 1994-01-25  François Pinard  <pinard@iro.umontreal.ca>
9518         * m4.h: Move the conditional definition of volatile after the
9519         inclusion of system files, because they may define it first.
9521 1994-01-04  François Pinard  <pinard@iro.umontreal.ca>
9523         * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
9524         get around a problem with Alpha make seeing a syntax error, there.
9525         Reported by Vern Paxson.
9527 1994-01-03  François Pinard  <pinard@iro.umontreal.ca>
9529         * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
9530         Reported by Richard Stallman.
9532 1993-12-25  François Pinard  <pinard@iro.umontreal.ca>
9534         * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
9535         instead of AC_HAVE_FUNCS.
9536         Reported by Noah Friedman.
9538 1993-12-01  François Pinard  <pinard@iro.umontreal.ca>
9540         * m4.c: Initialize show_help and show_version to zero.
9542         * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
9543         Use them in exit() and usage() calls.
9545 1993-11-27  François Pinard  <pinard@iro.umontreal.ca>
9547         * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
9548         syserr() macro.  Delete errref, add reference_error and M4ERROR.
9549         * m4.c: Replace errref, which was returning an input reference
9550         string, with reference_error, which prints it on standard error.
9551         * builtin.c, output.c: Use errno as second parameter to error,
9552         instead of using syserr() with %s.
9553         * *.c: Use M4ERROR instead of error: no more errref() with %s.
9554         Doing so, the program name appears after the input reference
9555         instead of before, which eases M-x next-error processing.
9557 1993-11-24  François Pinard  <pinard@iro.umontreal.ca>
9559         * checks/get-them: Escape braces with backslashes in patterns,
9560         because HPUX-9.01 awk needs this.
9561         Reported by Jim Meyering.
9563 1993-11-22  François Pinard  <pinard@iro.umontreal.ca>
9565         * builtin.c: Declare "FILE *popen ();".
9567         * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
9568         macros, replace error_message_prefix() declaration by errref()'s.
9569         Declare xrealloc, for use in errref().
9570         * m4.c: Delete error_message_prefix() function, add errref().
9571         * *.c: Use error() systematically in place of all error macros,
9572         now that error() flushes stdout first.  Make needed adjustments.
9574         * m4.h: Remove const in sys_errlist[] declaration, it creates
9575         conflicts on SGI and Alpha.
9576         Reported by Kaveh R. Ghazi.
9578 1993-11-20  François Pinard  <pinard@iro.umontreal.ca>
9580         * m4.c: Include <getopt.h> instead of "getopt.h".
9582         * configure.in: Output to config.h.  Use HAVE_FUNCS preferably.
9583         * acconfig.h: New, for documenting HAVE_EFGCVT.
9584         * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
9585         use them wherever appropriate.  Also use -I. for compilations.
9586         * lib/Makefile.in: Use -I.. for compilations.
9587         * *.c: Include <config.h> or "config.h".
9589         * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
9590         * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
9592 1993-11-17  François Pinard  <pinard@iro.umontreal.ca>
9594         * builtin.c (m4_eval): Cast strlen to (int) before comparing.
9596         * input.c (input_init): Initialize quote and comment strings
9597         explicitely instead of calling set_quotes and set_comment: by
9598         doing so, we ensure we do not free uninitialized variables.
9600         * checks/check-them: Reverse arguments to both diff, so the
9601         expected is on the left and the obtained on the right.
9603         * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
9604         macros. Delete declarations for m4error, warning, fatal and
9605         internal_error, add declaration for error_message_prefix.
9606         * m4.c:  Delete m4error, warning, fatal and internal_error
9607         routines, add error_message_prefix routine.
9608         * *.c: Replace m4error routine calls with MESSAGE* macro calls,
9609         warning with WARNING*, fatal with FATAL* and internal_error with
9610         INTERNAL_ERROR*.
9611         * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
9612         this is not needed anymore.
9614         * m4.h: Declare extern FILE *debug.  Add DEBUG_PRINT{1,3} and
9615         DEBUG_MESSAGE{,1,2} macros.  Delete declarations for debug_print
9616         and debug_message, add declaration for debug_message_prefix.
9617         * debug.c: Remove static specifier for FILE *debug declaration.
9618         Delete debug_print and debug_message routines, add
9619         debug_message_prefix routine.
9620         * builtin.c, debug.c: Replace debug_print routine calls with
9621         DEBUG_PRINT* macro calls.
9622         * input.c, path.c: Replace debug_message routine calls with
9623         DEBUG_MESSAGE* macro calls.
9625         * m4.h: Remove inclusion of <varargs.h>.
9626         * debug.c: Include <stdarg.h> or <varargs.h>.
9627         (trace_format): Use stdarg instead of varargs if __STDC__.
9629         * configure.in: Remove checks for vfprintf and _doprnt.  These
9630         implementations use varargs tricks which are not portable enough.
9631         * lib/vfprintf.c: Deleted.
9632         * lib/_doprnt.c: Deleted.
9633         * lib/Makefile.in: Adjusted accordingly.  Remove LIBOBJS.
9634         Reported by Joel Sherrill.
9636         * path.c (add_include_directory): Use xstrdup.
9638         * builtin.c (find_builtin_by_name): Declare static.
9640         * *.[ch]: Add const to a few "char *" declarations.
9642         * configure.in: Remove commented tests for fileno() and fstat().
9643         * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
9645         * debug.c (debug_flush_files): New.
9646         * m4.h: Declares it.
9647         * builtin.c (m4_syscmd, m4_esyscmd): Use it.
9648         Reported by Nicolas Pioch.
9650 1993-11-12  François Pinard  <pinard@iro.umontreal.ca>
9652         * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
9653         Reported by Joel Sherrill.
9655         * builtin.c (prefix_all_builtins): Instead of the table size, use
9656         the null entry at end for stopping the loop.  It was overwritten.
9657         Reported by Andreas Schwab and Jim Meyering.
9659         * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
9660         Reported by Kaveh R. Ghazi.
9662         * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
9663         Reported by Karl Vogel.
9665 1993-11-09  François Pinard  <pinard@iro.umontreal.ca>
9667         * m4.h: Do not define volatile if already defined.
9668         Reported by René Seindal.
9670         * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
9672         Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
9673         Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
9675 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
9677         * m4.h: Define strchr and strrchr in terms of index and rindex,
9678         instead of the other way around.
9679         * builtin.c, m4.c, path.c: Use strchr instead of index.
9681         * input.c (next_char): Remove a "break;" after a "return ...;".
9682         Reported by Tom McConnell.
9684 1993-11-08  François Pinard  <pinard@iro.umontreal.ca>
9686         * Release 1.1
9688         * configure.in: Do not copy check files in the build hierarchy.
9689         * checks/check-them: Identify the m4 version being checked.  For
9690         finding m4, look in $PATH instead of in the parent directory.
9691         * Makefile.in (check): Prepend `pwd` to $PATH before checking.
9692         * checks/Makefile.in (.all-stamp): Always create check files in
9693         the source hierarchy, not anymore in the build hierarchy.
9694         (check): cd to the source hierarchy before performing checks.
9695         Do not copy nor clean COPYING anymore, take it from `..'.
9696         Reported by Tom McConnell.
9698         * Makefile.in (Makefile): Use $(SHELL).
9699         (config.status): Use $(SHELL).  Use "config.status --recheck"
9700         instead of "configure --no-create", which is obsolete.
9701         Reported by Tom McConnell.
9703 1993-11-05  François Pinard  <pinard@iro.umontreal.ca>
9705         * m4.c (usage): Use "%s" instead of "m4" in format string.
9706         Reported by Jim Meyering.
9708         * Makefile.in: Distribute mkinstalldirs.
9709         Reported by Pierre Gaumond.
9710         Reported by Jim Meyering.
9711         Reported by Tom McConnell.
9712         Reported by Andreas Gustafsson.
9714         * checks/check-them: Renamed from checks/check_them.
9715         * checks/get-them: Renamed from checks/get_them.
9716         * checks/.all-stamp: Renamed from checks/.all_stamp.
9717         * checks/Makefile.in: Changed accordingly.
9718         Reported by Jim Meyering.
9720 1993-11-04  François Pinard  <pinard@iro.umontreal.ca>
9722         * lib/Makefile.in (dist): Correct permissions on files.
9724         * output.c: Declare tmpfile, some systems don't.
9726 1993-11-03  François Pinard  <pinard@iro.umontreal.ca>
9728         * checks/Makefile.in (dist): Correct permissions on files.
9730         * Makefile.in (dist): Ensure recursive linking for subdirectory
9731         `examples', also set read/write permissions on all its files.
9733         * mkinstalldirs: New, from elsewhere.
9734         * Makefile.in: Use it.
9736         * debug.c: Synchronize debug messages and regular output when
9737         the debug file and stdout are redirected to the same file.
9738         * configure.in: Add (commented) checks for fileno and fstat.
9739         Reported by Jim Avera.
9741         * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
9742         etc., arguments, then ignore the superfluous one.  m4 used to
9743         diagnose missing arguments and return the empty string.
9744         Reported by Nick S. Kanakakorn.
9746 1993-11-02  François Pinard  <pinard@iro.umontreal.ca>
9748         * m4.c (main): At end of all input, ensure all undiverted text
9749         goes to the main output stream.
9750         Reported by Andreas Gustafsson.
9752         * m4.c (main): exit (0), instead of return 0.
9754         * m4.c: Implement -P and --prefix-builtins.
9755         * builtin.c: Delete const specifier on builtin_tab.
9756         (prefix_all_builtins): New.
9757         Reported by Noah Friedman.
9758         Reported by Scott Bartram.
9760         * c-boxes.el: New, from elsewhere.
9761         * Makefile.in: Distribute it.
9763         * m4.h: Do not define bcopy if <string.h> defines it.
9764         Reported by Stephen Perkins.
9766         * builtin.c (define_macro): Allow a missing second argument, in
9767         which case it is implied empty.  Affects define and pushdef.
9768         Reported by Eric Allman.
9770 1993-11-01  François Pinard  <pinard@iro.umontreal.ca>
9772         * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
9773         struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
9774         * builtin.c: Initialize all the blindness fields in builtin_tab.
9775         (define_builtin): Copy the blindness of a builtin into its symbol.
9776         * macro.c (expand_token): Avoid processing a blind builtin if the
9777         next character is not an opening parenthesis.
9778         Reported by David MacKenzie.
9779         Reported by Noah Friedman.
9781         * configure.in: Ensure an exit status of 0 on completion.
9782         Reported by Vivek P. Singhal.
9784         * eval.c (eval_lex): Admit both lower and upper case letters for
9785         bases greater than 10.  Only lower case letters were accepted.
9787         * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
9788         Reported by Krste Asanovic.
9790         * eval.c:  Rename NOT to LNOT.  Add XOR, NOT, LSHIFT and RSHIFT.
9791         * eval.c (logical_not_term): New name for not_term.
9792         * eval.c (xor_term): New, between or_term and and_term.
9793         * eval.c (not_term): New, between and_term and logical_not_term.
9794         * eval.c (shift_term): New, between cmp_term and add_term.
9795         Reported by Krste Asanovic: ~, ^, <<, >>.
9796         Reported by Ben A. Mesander: ** vs ^.
9798         * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
9799         * m4.h: Delete xrealloc.c.
9800         * lib/xmalloc.c: New, from elsewhere.
9801         * lib/xstrdup.c: New, from elsewhere.
9802         * lib/Makefile.in: Distribute and compile them.
9804         * m4.c: Change progname to program_name.
9805         * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
9806         * lib/error.c: New, from elsewhere.
9807         * lib/Makefile.in: Distribute and compile error.c.
9808         * configure.in: Check AC_VPRINTF and for strerror.
9809         * m4.c: Delete cmd_error.  Use error instead.
9810         * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
9812         * m4.h: Delete #define const, let Autoconf takes care of this.
9814         * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
9815         Merge parse_args into main.  Declare argv to be `char *const *',
9816         then remove superfluous casts.
9818         * m4.c: Rename --no-gnu-extensions to --traditional.
9819         Reported by Ben A. Mesander.
9821         * m4.c (usage): Add a status parameter.  Supply one in various
9822         calls.  Add --help processing.  Remove -V for --version.
9824         * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
9826         * lib/Makefile.in: Have an AR=ar declaration.
9827         Reported by Eric Backus.
9828         Reported by Bjorn R. Bjornsson.
9829         Reported by Tom Tromey.
9830         Reported by Kristine Lund.
9831         Reported by Marion Hakanson.
9833 1993-10-30  François Pinard  <pinard@iro.umontreal.ca>
9835         * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
9836         Reported by Noah Friedman.
9838 1993-10-25  François Pinard  <pinard@iro.umontreal.ca>
9840         * Makefile.in: Remove MDEFINES and cleanup.
9842 1993-06-09  François Pinard  <pinard@iro.umontreal.ca>
9844         * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
9845         Create a gzip file.
9847 1993-02-06  François Pinard  <pinard@iro.umontreal.ca>
9849         * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
9850         ensure 777 mode for directories, so older tar's will restore file
9851         modes properly.
9853 1993-01-17  François Pinard  <pinard@iro.umontreal.ca>
9855         * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
9856         so the installer can override automatically configured choices.
9857         Reported by Karl Berry.
9859 1993-01-15  François Pinard  <pinard@iro.umontreal.ca>
9861         * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
9862         previous version was not working properly on m68k-hp-bsd4.3.
9863         Reported by Roland McGrath.
9865         * lib/_doprnt.c: Stolen from Oleo distribution.
9866         * configure.in: Check for _doprnt.c if vfprintf.c selected.
9867         * lib/Makefile.in: Distribute _doprnt.c.
9868         Do not distribute regex.[ch].old anymore.
9870 1993-01-01  François Pinard  <pinard@iro.umontreal.ca>
9872         * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
9873         Richard wants it there.
9875 1992-12-27  François Pinard  <pinard@iro.umontreal.ca>
9877         * Makefile.in: Add DEFS to MDEFINES.
9878         * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
9879         (libm4.a): Remove the library before creating it.
9880         (distclean): Remove tags and TAGS too.
9882 1992-12-23  François Pinard  <pinard@iro.umontreal.ca>
9884         * Makefile.in (dvi, m4.dvi): New goals.
9886         * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
9887         macro.c, output.c, path.c, symtab.c: Change Copyright from
9888         1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
9890         * examples/divert.m4: Deleted, this bug has been corrected.
9892         * Makefile.in (texclean, mostlyclean): New goals.
9894         * Makefile.in (clean): Remove clutter from ansi2knr.
9895         Reported by Pierre Gaumond.
9897 1992-12-20  François Pinard  <pinard@iro.umontreal.ca>
9899         * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
9900         might well use CFLAGS is s/he needs it.
9902         * Makefile.in: Allow installation of info files from a separate
9903         build directory.
9904         Reported by Jason Merrill.
9905         Reported by David MacKenzie.
9906         Reported by Skip Montanaro.
9907         Reported by Erez Zadok.
9908         Reported by Assar Westerlund.
9910 1992-12-19  François Pinard  <pinard@iro.umontreal.ca>
9912         * Release 1.0.3
9913         This is still a beta release for the future GNU m4 version 1.1.
9915         * lib/alloca.c: New, from elsewhere.
9916         * lib/Makefile.in: Distribute it.  Define and use $(ALLOCA).
9918         * m4.h: Do not define index/rindex if already defined.  If
9919         FALSE/TRUE are already defined, do not redefine them, but merely
9920         define boolean typedef to int.
9922         * Makefile.in: Use $(DEFS) while compiling ansi2knr.
9923         * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
9924         because some C compilers do not like connectives with #ifdef.
9925         * m4.h: Define `volatile' only if __GNUC__, instead of once for
9926         __GNUC__ and once for __STDC__.
9927         * lib/regex.h: Leave const alone, AC_CONST will take care of it.
9929         * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
9930         Makefile dependencies.  Without it, make keeps destroying and
9931         remaking $(CHECKS) in a loop (why?).  Distribute .all_stamp.
9933         * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
9934         to diversion/DIVERSION, this was a spelling error.
9936         * m4.c: Declare version[], remove #include "version.h".
9937         * version.h: Deleted.
9938         * Makefile.in: Remove references to version.h.
9940         * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
9941         production, by using a simpler and more robust algorithm.  This
9942         solves the problem of synclines sometimes written in the middle of
9943         an output line.  Delete sync_line() and output_lines variable.
9944         * m4.h: Remove sync_line prototype and output_lines declaration.
9945         * input.c (next_char), output.c (shipout_text): Remove references
9946         to output_lines.
9947         * input.c (push_file, pop_file): Merely put the value -1 in
9948         output_current_line instead of calling sync_line, for delaying a
9949         single `#line NUM FILE' before next output line.  Do not test
9950         for sync_output, because this is unnecessary clutter.
9951         * output.c (make_divertion, insert_divertion): Idem.
9952         * input.c: Rename must_advance_line to start_of_input_line, for
9953         consistency.
9955         * debug.c (trace_header): Select a new debug line format, which
9956         better complies with GNU standards for formatting error messages.
9957         With option `-dfl', M-x next-error might be used on the output.
9958         * m4.c (vmesg): Adjust format of error output to GNU standards.
9959         * m4.texinfo: Adjust examples for `make check' to work.
9961         * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
9962         case for enum debug_info constants, which were all lower case.
9964         * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
9965         re_search_2.
9966         * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
9967         collected patches.  I tried a few times using newer regex.[ch], it
9968         mysteriously stopped aborting with this one.  Insecure feeling...
9969         * lib/Makefile.in: Distribute regex.[ch].old, just in case!
9971 1992-12-18  François Pinard  <pinard@iro.umontreal.ca>
9973         * m4.c: Change `--no-warnings' to `--silent'.
9974         Reported by David MacKenzie.
9976         * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
9977         leave it off for now.  See comment in m4.c for justification.
9978         Reported by David MacKenzie.
9980         * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
9981         * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
9983         * Makefile.in: Add a new `info' goal.  Use macro MAKEINFO.
9985         * Makefile.in: Ensure recursive cleaning is done before local
9986         cleaning for all clean goals.
9988         * builtin.c (ntoa): Ensure the value is always interpreted as a
9989         signed quantity, whatever the radix is.
9991 1992-11-18  Jim Meyering  <meyering@idefix>
9993         * builtin.c, format.c, input.c: Split long lines.
9994         * m4.c: Use typedef macro_definition instead of struct
9995         macro_definition.
9996         * symtab.c: Use typedef symbol instead of struct symbol.
9998 1992-11-17  François Pinard  <pinard@iro.umontreal.ca>
10000         * *.[ch]: Remove all trailing whitespace, in code and comments.
10002         * configure.in: Find some awk.
10003         * Makefile.in: Add $(AWK) to MDEFINES.
10004         * checks/Makefile.in: Transmit $(AWK) to get_them.
10005         * checks/get_them: Use $AWK instead of gawk.  Add a close in the
10006         awk script when switching files, because without this, mawk runs
10007         out of file descriptors.
10009 1992-11-16  François Pinard  <pinard@iro.umontreal.ca>
10011         * Makefile.in (realclean): Delete m4.info*.
10012         Reported by Jim Meyering.
10014         * Makefile.in: Adjust and link with checks/Makefile.
10015         * checks/Makefile.in: New.
10016         * configure.in: Output checks/Makefile.
10018         * checks/get_them: Have the dnl header of each test more
10019         recognizable by next-error, also use a better message.
10021 1992-11-16  Jim Meyering  <meyering@idefix>
10023         * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
10024         And use that only if __GNUC__ since we're using it's GCC-specific
10025         semantics that tell the compiler the associated function doesn't
10026         return.
10028         * builtin.c (substitute): Don't use character as an array index.
10029         (dumpdef_cmp): Make formal arguments `const void *' to avoid
10030         warnings with gcc -W -Wall on systems with qsort prototype.
10031         (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
10032         from gcc -W -Wall.
10034         * eval.c (most functions): Add parentheses to assignments used
10035         as truth values go avoid warnings from gcc -Wall.
10037         * input.c, m4.c, output.c, path.c, symtab.c: Declare static
10038         any functions that don't need external scope.
10040         * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
10041         (many functions and arrays): Declare `const'.
10043 1992-11-15  François Pinard  <pinard@iro.umontreal.ca>
10045         * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
10046         removing the declaration from m4.h.  Also rename false to FALSE
10047         and true to TRUE.
10049         * lib/Makefile.in (Makefile): New goal.
10051         * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
10052         so heavily loaded.  It gets more easily overridable, calling make.
10053         Reported by Jim Meyering.
10055         * Makefile.in (dist): Get .fname from the current directory name,
10056         instead of from version.h.  I need updating many files manually,
10057         when the version changes, version.h is just one of them.
10059 1992-11-14  François Pinard  <pinard@iro.umontreal.ca>
10061         * m4.h: Remove the tag `boolean' on the enum introducing typedef
10062         `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
10063         Reported by Tom McConnell.
10065 1992-11-13  François Pinard  <pinard@iro.umontreal.ca>
10067         * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
10068         39.cleardiv, which were describing missing or spurious newlines.
10069         Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
10070         do not depend on machine word size, `/bin/false' implementation,
10071         or `wc' output format.  `make check' is more dependable, now.
10073         * checks/check_them: Summarize the failed tests by listing their
10074         name, at end.  If none, issue `All checks successful'.  Output
10075         `Checking' instead of `Input file:'.
10077         * checks/get_them, checks/check_them: Reindented.
10079         * Makefile.in (dist): chmod a+r before making the tar file.
10081 1992-11-12  François Pinard  <pinard@iro.umontreal.ca>
10083         * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
10085         * input.c (next_token): Reinitialize token_buttom just after using
10086         it as a watermark with obstack_free.  Or else, a future token, big
10087         enough for triggering reallocation of the obstack chunk, could
10088         void the initialized value of token_buttom, later causing panic in
10089         obstack_free.  Rename token_buttom to token_bottom everywhere.
10091         * m4.h: Before declaring errno, first include <errno.h> and
10092         ensure that it does not define errno.
10093         Reported by Richard Stallman.
10095 1992-11-11  François Pinard  <pinard@iro.umontreal.ca>
10097         * builtin.c: Define and use DECLARE macro for builtins.
10099         * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
10100         argument, this is a common idiom for introducing long comments.
10102         * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
10103         arguments.  The last argument was silently ignored.
10105         * m4.c (cmd_error): Add a missing semicolon before va_end().
10107 1992-11-10  François Pinard  <pinard@iro.umontreal.ca>
10109         * Makefile.in: Now handle protoized sources.  Define and use U.
10110         Compile and use ansi2knr with old compilers.  Update DISTFILES.
10111         Add `aclocal.m4' to `configure' dependencies.
10112         * ansi2knr.c: New, from Ghostscript distribution.
10113         * configure.in: Define U through FP_PROTOTYPES for old compilers.
10114         Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
10115         * aclocal.m4: New, provide FP_PROTOTYPES.
10116         * m4.h: Conditionnaly protoized through Args, save for varags.
10117         * builtin.c: Protoized.  Then:
10118         Include <sys/types.h> if size_t is not defined, before "regex.h".
10119         (m4_ifelse): Fetch built-in name properly for diagnostic.
10120         (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
10121         (m4_regexp): Add const to `msg' declaration.
10122         (m4_patsubst): Add const to `msg' declaration.
10123         * debug.c: Protoized, save for varargs.
10124         * eval.c: Protoized.
10125         * format.c: Protoized.
10126         * input.c: Protoized.
10127         * m4.c: Protoized, save for varargs.  Then:
10128         (xfree): Accept void * instead of char *.
10129         (xmalloc): Return void * instead of char *.
10130         (xrealloc): Accept and return void * instead of char *.
10131         * macro.c: Protoized.
10132         * output.c: Protoized.
10133         * path.c: Protoized.  Then cast some (char *) over xmalloc's.
10134         * symtab.c: Protoized.
10136 1992-11-06  François Pinard  <pinard@iro.umontreal.ca>
10138         * m4.texinfo: Remove directory from diagnostics in 30.include,
10139         51.eval, 56.errprint and 57.m4exit tests.
10141         * m4.h: Remove declarations for int or void system functions, they
10142         cause more conflicting trouble than they make good.
10144         * configure.in: Avoid configuration header file.  Add some tests.
10145         * m4.h: Remove #include "config.h".
10146         * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
10147         Then, rewritten for better compliance with GNU standards.
10149 1992-11-05  François Pinard  <pinard@iro.umontreal.ca>
10151         * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
10152         because of a misplaced #endif.
10154         * Many *.[hc] files: Correct intra-line spacing here and there,
10155         according to GNU indent 1.6 advice.
10157         * configure.in: New, using Autoconf 1.2.
10158         * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
10159         * Delete old configure.in, configure, etc/configure.in,
10160         etc/configure, lib/configure.in, lib/configure and config/*.
10161         Reported by Jason Merrill.
10163         * symtab.c (hash): Change (char) NULL to '\0'.
10164         Reported by Jason Merrill.
10166         * Delete .vers, etc/newdist.sh, etc/newvers.sh and
10167         etc/nextvers.sh.  Release numbers will be edited `by hand'.
10168         * version.h: De-automatize, force value in.
10170         * m4.c: Changes in order to use a newer getopt.h.
10171         Reported by David MacKenzie.
10173         * checks/: New name for examples/.
10174         * checks/get_them: New location for etc/get_examples.
10175         * checks/check_them: New location for etc/check_examples.
10176         * Makefile.in, checks/get_them, checks/check_them: Adjust.
10177         * lib/vfprintf.c: New location for etc/vfprintf.c.
10178         * Delete empty etc/.
10179         * examples/: New name for test/.
10181 1992-03-10  François Pinard  <pinard@iro.umontreal.ca>
10183         * Makefile.in (check): Add m4 as dependency.
10185         * m4.c: Accept --no-warnings instead of --no_warnings, and
10186         --no-gnu-extensions instead of --no_gnu_extensions.  Make the
10187         usage message more informative.
10188         Reported by David MacKenzie.
10190 1992-03-09  François Pinard  <pinard@iro.umontreal.ca>
10192         * etc/check_examples: New name for check_examples.sh.
10193         * etc/get_examples: New name for get_examples.sh.
10194         * Makefile.in, etc/Makefile.in: Use new names.
10196         * Makefile.in: Transmit $(CC) while making in lib.
10198         * Many *.[hc] files: GNU indent'ed, with further fine tuning of
10199         code disposition by hand.
10201 1992-03-08  François Pinard  <pinard@iro.umontreal.ca>
10203         * m4.h: Delete definitions for abort() and exit().
10204         Reported by Richard Stallman.
10206         * config/hmake-unicos, config/s-unicos.h: New files.
10207         Reported by Hal Peterson.
10209         * eval.c (exp_term): Have N^0 return 1.
10210         Reported by Michael Fetterman.
10212         * eval.c, input.c, m4.h: Remove last comma in enums.
10213         Reported by Mike Lijewski.
10215         * Transfer of maintenance duties from René to François.
10217 1991-10-24  René Seindal <seindal@diku.dk>
10219         * Release 1.0.  Many thanks to those, who provided me with bug
10220         reports and feedback.
10222         * Uses GNU configure, taken from the gdb distribution.
10224         * Uses GNU getopt(), with long option names.
10226         * The -Q/+quiet option is added, which suppresses warnings about
10227         missing or superflous arguments to built-in macros.
10229         * Added default options via the M4OPTS environment variable.
10231         * The built-in format can now be configured to use sprintf as
10232         the formatting engine, for systems without [efg]cvt(3).
10234         * GNU library code is moved to the ./lib subdirectory; other
10235         utility files are now in ./etc.
10237         * Several minor bugs have been fixed.
10239 1991-07-26  René Seindal <seindal@diku.dk>
10241         * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
10242         François Pinard and Roland H. Pesch for providing me with reports.
10244         * The builtins incr and decr are now implemented without use of
10245         eval.
10247         * The builtin indir is added, to allow for indirect macro calls
10248         (allows use of "illegal" macro names).
10250         * The debugging and tracing facilities has been enhanced
10251         considerably.  See the manual for details.
10253         * The -tMACRO option is added, marks MACRO for tracing as soon
10254         as it is defined.
10256         * Builtins are traced after renaming iff they were before.
10258         * Named files can now be undiverted.
10260         * The -Nnum option can be used to increase the number of
10261         divertions available.
10263         * Calling changecom without arguments now disables all comment
10264         handling.
10266         * The function m4_patsubst() is now consistently declared
10267         static.
10269         * A bug in dnl is fixed.
10271         * A bug in the multi-character quoting code is fixed.
10273         * Several typos in the manual has been corrected.  More probably
10274         persist.
10276         * The m4.info file is now installed along with the program.
10278 1990-11-15  René Seindal <seindal@diku.dk>
10280         * Updated and enhanced version.  Release 0.75, manual 0.07.
10282         * Implemented search path for include files (-I option and
10283         M4PATH envronment variable).
10285         * Implemented builtin "format" for printf-like formatting.
10287         * Implemented builtin "regexp" for searching for regular
10288         expressions.
10290         * Implemented builtin "patsubst" for substitution with regular
10291         expressions.
10293         * Implemented builtin "esyscmd", which expands to a shell
10294         commands output.
10296         * Implemented "__file__" and "__line__" for use in error
10297         messages.
10299         * Implemented character ranges in "translit".
10301         * Implemented control over debugging output.
10303         * Implemented multi-character quotes.
10305         * Implemented multi-character comment delimiters.
10307         * Changed predefined macro "gnu" to "__gnu__".
10309         * Changed predefined macro "unix" to "__unix__", when the -G
10310         option is not used.  With -G, "unix" is still defined.
10312         * Changed "shift", "$@" and "$*" to not insert spaces afters
10313         commas.
10315         * Added program name to error messages.
10317         * Fixed two missing null bytes bugs.
10319 1990-01-22  René Seindal <seindal@diku.dk>
10321         * Initial beta release.  Release 0.50, manual 0.05.
10324         -----
10326         $Revision$ $Date$
10328         Local Variables:
10329         coding: utf-8
10330         End:
10332         Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
10333         2005, 2006, 2007, 2008 Free Software Foundation, Inc.
10335         Copying and distribution of this file, with or without
10336         modification, are permitted provided the copyright notice
10337         and this notice are preserved.