1 2008-12-23 Eric Blake <ebb9@byu.net>
3 Add debugmode(o) to control dumpdef output location.
4 * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
5 (M4_DEBUG_TRACE_VERBOSE): Update.
6 * m4/debug.c (m4_debug_decode): Support new debug option.
7 * src/freeze.c (produce_debugmode_state): Likewise.
8 * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
10 * src/main.c (usage): Document it.
11 * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
12 (Debugfile): Likewise.
14 Based on an autoconf bug report by Paolo Bonzini.
16 Make --debugfile argument optional.
17 * src/main.c (long_options): Make the argument optional, to allow
18 setting debug file back to stderr.
19 (main): Make --debugfile order-dependent.
20 (usage): Document this.
21 * doc/m4.texinfo (Debugging options): Likewise.
23 * tests/options.at (--debugfile): Enhance test.
24 (--safer): Adjust to new semantics.
26 2008-12-22 Eric Blake <ebb9@byu.net>
29 * doc/m4.texinfo (Operation modes, Preprocessor features)
30 (Limits control, Frozen state, Debugging options)
31 (Dynamic loading features): Use lower case names in @var.
32 (Improved copy): Use @code, not @var, as appropriate.
34 2008-12-18 Eric Blake <ebb9@byu.net>
36 Deal with M4 1.4.x limitation on builtin tokens.
37 * doc/m4.texinfo (Composition): Mention limitation on curry.
38 (Improved copy): New node.
40 * examples/stack.m4: Likewise.
41 * examples/stack_sep.m4: New file.
42 * Makefile.am (dist_pkgdata_DATA): Distribute it.
44 2008-12-15 Eric Blake <ebb9@byu.net>
46 Double size of temp file cache.
47 * m4/output.c (tmp_file, tmp_file_owner): Split...
48 (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
50 (tmp_file2_recent): New variable.
51 (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
52 (m4_output_exit): Adjust callers.
54 Use fewer seeks on cached files.
55 * m4/output.c (m4_tmpfile): Use write, not append mode.
56 (m4_tmpopen): Add parameter to decide when to skip seeks.
57 (m4_tmprename, m4_make_diversion, insert_diversion_helper)
58 (m4_freeze_diversions): Adjust callers.
60 Cache most recently spilled diversion.
61 * m4/output.c (tmp_file, tmp_file_owner): New variables, for
62 1-deep cache of spilled diversions.
63 (m4_tmpfile): Open in append mode, since we might revisit
64 diversion without closing it now.
65 (m4_tmpopen): Check cache first.
66 (m4_tmpclose): Update cache, rather than closing. Add parameter.
67 (m4_tmpremove): Close cache before removing.
68 (m4_tmprename): Deal with open files when renaming.
69 (m4_output_exit): Close cache before exiting.
70 (make_room_for, m4_make_diversion, insert_diversion_helper):
72 * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
73 * configure.ac (M4_RENAME): Invoke it.
75 Correctly track size of in-memory diversions.
76 * m4/output.c (insert_diversion_helper): Correctly track total
77 in-memory diversion size after undivert.
79 Avoid quadratic behavior for some cases of divert/undivert.
80 * m4/output.c (struct m4_diversion): Improve comments.
81 (m4_tmpname, m4_make_diversion): Strengthen preconditions.
82 (m4_tmprename): New function.
83 (m4_output_init, m4_output_exit): Move after internal functions.
84 (make_room_for): Don't bother copying uninitialized bytes.
85 (insert_diversion_helper): Transfer metadata, rather than copying
86 contents, when undiverting into a previously unused diversion.
87 * tests/builtins.at (divert): Add a check to the test.
88 * doc/m4.texinfo (Undivert): Enhance test.
89 * NEWS: Document the speedup.
91 2008-12-02 Eric Blake <ebb9@byu.net>
93 Stage 27: Allow embedded NUL in text processing macros.
94 Pass NUL through regular expressions, format, and translit, and
95 diagnose it in eval and changeresyntax. Improve warning
96 capabilities of format.
98 Speed impact: none noticed.
99 * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
100 (translit): Manage NUL bytes.
101 * modules/format.c (format): Likewise.
102 * modules/gnu.c (substitute, regexp_substitute): Likewise.
103 (m4_resyntax_encode_safe): Add parameter.
104 (regexp, patsubst, renamesyms): Update callers.
105 (regexp_compile): Adjust error message.
106 * modules/evalparse.c (m4_evaluate): Use consistent message.
107 (end_text): New variable.
108 (eval_init_lex): Add parameter.
109 (eval_lex): Detect embedded NUL.
110 * src/freeze.c (reload_frozen_state): Likewise.
111 * doc/m4.texinfo (Format): Update to cover new behavior.
112 (Eval): Mention that result is unquoted.
113 * tests/freeze.at (reloading nul): Enhance test.
114 * tests/null.m4: Likewise.
115 * tests/null.err: Update expected output.
116 * tests/null.out: Likewise.
117 * tests/options.at (--regexp-syntax): Likewise.
119 2008-11-28 Eric Blake <ebb9@byu.net>
121 Resync NEWS with branches.
122 * NEWS: Mention 1.4.12, update state of 1.6.
124 2008-11-26 Eric Blake <ebb9@byu.net>
126 Keep COPYING in repository.
127 * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
128 * .cvsignore: Don't ignore it.
129 * .gitignore: Likewise.
130 * COPYING: Store in repository, per automake 1.10.2
133 2008-11-26 Eric Blake <ebb9@byu.net>
135 Document optimized forloop.
136 * doc/m4.texinfo (Improved forloop): Mention alternate style that
137 avoids define overhead.
138 * examples/forloop3.m4: New file.
139 * Makefile.am (dist_pkgdata_DATA): Distribute it.
141 Document copy composite using stack_foreach and curry.
142 * doc/m4.texinfo (Stacks): New node, to document pushdef stack
144 (Ifelse): Move define_blind...
145 (Composition): ...to this new node. Document currying, then use
146 it to implement copy and rename.
147 * examples/curry.m4: New file.
148 * examples/stack.m4: Likewise.
149 * Makefile.am (dist_pkgdata_DATA): Distribute them.
151 2008-11-04 Eric Blake <ebb9@byu.net>
154 * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
155 * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
157 * doc/m4.texinfo (GNU Free Documentation License): Likewise.
159 2008-10-22 Eric Blake <ebb9@byu.net>
161 Give nicer error if user modifies testsuite but lacks autoconf.
162 * Makefile.am (AUTOM4TE): Use missing in the definition.
164 2008-10-09 Eric Blake <ebb9@byu.net>
166 Allow user to choose which sed to use in testsuite.
167 * tests/atlocal.in (SED): Inherit from configure results.
168 * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
169 (mkstemp, syscmd): Use $SED.
170 * tests/generate.awk (new_test): Likewise.
171 * tests/options.at (deprecated options, unknown option)
172 (--debugmode, --help and --version): Likewise.
173 * tests/testsuite.at (AT_CHECK_M4): Likewise.
174 * tests/others.at (directory, stderr closed, stdin seekable)
175 (stdout closed): Likewise.
176 (nul character): Likewise. Also, skip test if sed can't handle
179 Clean up testsuite invocation.
180 * tests/atlocal.in: Fix copyright notice.
181 * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
182 (check-local, installcheck-local): Adjust clients. Add missing
185 2008-09-25 Eric Blake <ebb9@byu.net>
187 Tweak error message on command line failure.
188 * m4/m4private.h (includes): Use "quotearg.h".
189 * src/main.c (process_file, main): Use nicer quotes for file name
191 * m4/input.c (file_clean, m4_push_file): Likewise.
192 * m4/module.c (m4__module_open): Likewise.
193 * src/freeze.c (produce_frozen_state, reload_frozen_state):
195 * modules/gnu.c (debugfile): Likewise.
196 * modules/m4.c (undivert, include): Likewise.
197 * tests/others.at (directory, stdin closed): Update tests.
198 * tests/options.at (file names, --debugmode): Likewise.
199 * doc/m4.texinfo (Debugmode): Likewise.
201 Unify error handling for reading directories.
202 * m4/path.c (m4_path_search): Factor open attempts...
203 (m4_fopen): ...into new function, to reject directories.
204 * tests/others.at (directory): Enhance test.
205 * doc/m4.texinfo (Include): Document that directories cannot be
208 Avoid bugs on platforms that mishandle trailing /.
209 * ltdl/m4/gnulib-cache.m4: Import fopen module.
210 * tests/others.at (directory): New test.
212 2008-09-16 Eric Blake <ebb9@byu.net>
214 Fix bootstrap for Solaris /bin/sh.
215 * bootstrap: Avoid shell quoting pitfall.
217 2008-09-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
219 Typos in source code comments.
220 * modules/m4.c: Fix typos in comments.
221 * m4/input.c: Likewise.
222 * src/main.c: Likewise.
224 2008-08-29 Eric Blake <ebb9@byu.net>
226 Fix manual date information.
227 * doc/m4.texinfo: UPDATED refers to the day the manual was built,
228 not the release date of M4.
229 Based on a bison patch by Akim Demaille.
231 2008-08-27 Eric Blake <ebb9@byu.net>
234 * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
238 2008-08-23 Eric Blake <ebb9@byu.net>
240 Allow debugmode control over whether defn(undef) warns.
241 * ltdl/m4/gnulib-cache.m4: Import verify module.
242 * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
244 (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
245 * m4/m4.c (m4_create): Start with debugmode = d.
246 * src/main.c (usage): Mention this.
247 (main): Let -E impact debug mode.
248 * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
250 * modules/gnu.c (builtin, inder): Likewise.
251 * m4/debug.c (m4_debug_decode): Parse new mode.
252 * src/freeze.c (produce_debugmode_state): Accomodate new mode.
253 * doc/m4.texinfo (Debugging options): Mention change in the
255 (Debugmode): Mention new flag d.
256 (Operation modes): Mention interaction with -E.
257 (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
259 * tests/options.at (--debugmode): Update tests.
260 * tests/freeze.at (reloading debugmode): Likewise.
261 * NEWS: Document this.
262 Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
263 incompatible with Autoconf 2.62.
265 2008-08-22 Eric Blake <ebb9@byu.net>
267 Improve --debugmode behavior.
268 * m4/m4module.h (m4_debug_decode): Simplify interface.
269 * m4/debug.c (m4_debug_decode): Remove parameter, and handle
270 setting the new value.
271 * modules/gnu.c (debugmode): Adjust caller.
272 * src/freeze.c (reload_frozen_state): Likewise.
273 * src/main.c (main): Likewise.
274 (usage): Fix default for --debug.
275 * doc/m4.texinfo (Debugging options): Add an example.
277 2008-08-21 Eric Blake <ebb9@byu.net>
279 Avoid regression in defn(undef).
280 * doc/m4.texinfo (Trace): Enhance test, to cover regression
281 recently fixed on the branch.
283 2008-08-18 Eric Blake <ebb9@byu.net>
285 Remove deprecated -N option; fixes a regression from 2006-09-14.
286 * src/main.c (DIVERSIONS_OPTION): Delete.
287 (long_options, OPTSTRING, main): Remove -N/--diversions option.
288 * doc/m4.texinfo (Limits control): Remove it from the manual.
289 * NEWS: Mention that it is gone.
290 * tests/options.at (deprecated options): Update test.
292 Improve 'git diff' of manual source.
293 * .gitattributes (*.texi*): Add diff attribute.
294 * bootstrap: Tell git how to use it.
295 Inspired by Jim Meyering's similar patch for coreutils.
297 2008-08-07 Bruno Haible <bruno@clisp.org> (tiny change)
299 Run m4 tests prior to gnulib unit tests.
300 * Makefile.am (SUBDIRS): Swap order of directories.
302 2008-08-03 Eric Blake <ebb9@byu.net>
304 Stage 26: Allow embedded NUL in macro definitions.
305 Clean up final few locations that did not track macro definitions
306 by length, to allow embedded NUL. Make m4_arg_len callers aware
307 of issue of flattening builtins when determining length.
309 Speed impact: none noticed.
310 * m4/m4module.h (m4_arg_len): Add parameter.
311 (M4ARGLEN): Provide default for the parameter.
312 * m4/m4private.h (includes): Share xmemdup0.h among all libm4
314 * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
315 * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
316 * m4/symtab.c (includes): Likewise.
317 (m4_symbol_value_copy): Use xmemdup0.
318 * m4/module.c (install_macro_table): Likewise.
319 * src/freeze.c (reload_frozen_state): Likewise.
320 * tests/freeze.at (reloading nul): Enhance test.
321 * tests/null.m4: Likewise.
322 * tests/null.err: Update expected output.
323 * tests/null.out: Likewise.
325 Fix regression in commenting unbalanced quotes, from 2008-02-16.
326 * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
327 * m4/input.c (m4__next_token, m4_print_token): Supply new token
329 * m4/macro.c (expand_token): Penalize comments, as they can
330 contain unbalanced quotes; latent bug since 2007-12-07, exposed by
331 passing $@ references built from comments.
332 (expand_argument): Adjust caller.
333 * tests/others.at (Comments): Enhance test to catch it.
334 * NEWS: Mention the fix.
336 2008-07-30 Eric Blake <ebb9@byu.net>
338 Fix regression in trace output, introduced 2008-05-08.
339 * m4/input.c (m4__push_symbol): When cloning chains, break pointer
340 back to original chain; latent bug from 2008-02-02 that did not
341 cause misbehavior until trace output read unfinished chain.
342 * tests/builtins.at (debug): Add test for this.
344 2008-07-28 Eric Blake <ebb9@byu.net>
346 Optimize iteration examples.
347 * examples/forloop2.m4: Avoid excess indir, by passing current
348 counter value as parameter.
349 * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
351 * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
352 documentation to match.
354 2008-07-26 Eric Blake <ebb9@byu.net>
356 Give example for O(n) foreach on m4 1.4.x.
357 * examples/foreachq4.m4: New file.
358 * Makefile.am (dist_pkgdata_DATA): Distribute it.
359 * tests/others.at (recursion): Test it.
360 * doc/m4.texinfo (Improved foreach): Document linear foreach with
361 m4 1.4.5 and greater.
363 2008-07-19 Eric Blake <ebb9@byu.net>
365 Resynchronize docs from branch.
366 * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
367 name, particularly since the old documentation didn't match code.
368 (Standard Modules): Add caveat about using __m4_version__.
370 2008-07-11 Eric Blake <ebb9@byu.net>
372 Bump required automake to 1.10a; regression introduced 2008-01-22.
373 * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
374 1.10.1, since we also rely on pkglibexecdir.
375 * HACKING: Fix minimum requirement.
376 * bootstrap: Likewise.
378 Reported by Joel E. Denny.
380 Avoid bogus whitespace in @ovar, @dvar.
381 * doc/m4.texinfo (ovar, dvar): Add @c.
382 Based on patch by Ralf Wildenhues to Autoconf manual.
384 2008-06-23 Eric Blake <ebb9@byu.net>
386 Adjust to new gnulib-tool layout.
387 * ltdl/m4/gnulib-cache.m4: Reformat.
389 Fix bootstrap comment.
390 * bootstrap: DOWNLOAD_PO was previously removed.
392 2008-06-19 Eric Blake <ebb9@byu.net>
394 Revert speed regression from 2008-06-16.
395 * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
396 * modules/m4.c (numb_obstack): Likewise.
397 * m4/input.c (MATCH): Use fewer conditionals, and factor
399 (match_input): ...here for smaller code size.
400 * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
401 Supply trailing NUL to delimiters, to meet contract of faster
404 2008-06-18 Eric Blake <ebb9@byu.net>
407 * m4/m4module.h: Use consistent spacing for pointer parameters.
408 * m4/m4private.h: Likewise.
410 Stage 25b: Handle embedded NUL in changesyntax and friends.
411 Track quote and comment delimiters by length, to allow embedded
412 NUL. Improve changesyntax to support assigning syntax to NUL.
414 Speed impact: none noticed.
415 * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
417 (m4_reset_syntax): New prototype.
418 * m4/syntax.c (add_syntax_set, subtract_syntax_set)
419 (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
421 (m4_set_syntax): Likewise. Also, split code to reset the table...
422 (m4_reset_syntax): ...into a new function.
423 (m4_syntax_create): Adjust callers.
424 * m4/input.c (match_input, MATCH): Add parameter.
425 (m4__next_token, m4__next_token_is_open): Adjust callers.
426 * modules/m4.h (m4_expand_ranges_func): Add parameter.
427 * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
428 (changequote, changecom, translit, m4_expand_ranges): Track
430 * modules/gnu.c (changesyntax): Handle embedded NUL.
431 * src/freeze.c (reload_frozen_state): Adjust callers.
432 * tests/freeze.at (reloading nul): Enhance test.
433 * tests/null.m4: Likewise.
434 * tests/null.out: Update expected output.
435 * tests/null.err: Likewise.
437 2008-06-16 Eric Blake <ebb9@byu.net>
439 Stage 25a: Use obstack_printf for easier output.
440 Convert macro tracing and other locations to use obstack_printf
441 rather than hand-rolled equivalents. Ensure that embedded NUL in
442 trace output does not truncate the trace string.
444 Speed impact: noticeable penalty, from obstack_printf overhead.
445 * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
446 * m4/macro.c (trace_format): Delete; use obstack_printf instead.
447 (trace_header, trace_pre, trace_post): All callers updated.
448 * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
449 (m4_divert_text): Speed up syncline output.
450 * modules/m4.c (dumpdef): Handle embedded NUL.
451 (numb_obstack): Speed up eval output.
452 (maketemp): Use obstack_printf.
453 * modules/format.c (format): Likewise.
455 Add missing const qualifications.
456 * m4/resyntax.c (m4_resyntax_map): Declare array elements as
458 * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
459 * modules/import.c (m4_builtin_table): Likewise.
460 * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
461 * modules/m4.c (m4_builtin_table): Likewise.
462 * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
463 * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
464 * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
465 * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
466 * modules/stdlib.c (m4_builtin_table): Likewise.
467 * modules/time.c (m4_builtin_table): Likewise.
468 * modules/traditional.c (m4_macro_table): Likewise.
470 2008-06-10 Eric Blake <ebb9@byu.net>
472 Avoid corrupted frozen file if NUL appears on block boundary.
473 * m4/output.c (insert_file): Separate consecutive quotearg blocks
474 with \<newline>, in case last byte of first block was NUL.
476 2008-06-03 Eric Blake <ebb9@byu.net>
478 Fix printf type mismatches.
479 * m4/m4module.h (m4_bad_argc): Alter parameter type.
480 * m4/m4private.h (struct m4_call_info): Alter call_id type.
481 * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
483 * m4/utility.c (m4_bad_argc): Likewise.
485 Borrow bootstrap ideas from gnulib.
486 * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
487 advertized subset of languages didn't work. Use --skip-po
488 instead, for consistency with gnulib bootstrap.
489 (func_get_translations): Use rsync, not wget.
490 (func_update_po): Use a reference directory, to avoid changing
491 timestamps on unchanged .po files.
492 * TODO: Update accordingly.
494 Fix fallout from previous patch.
495 * doc/m4.texinfo (Builtin): Adjust expected output.
497 2008-06-02 Eric Blake <ebb9@byu.net>
499 Stage 24c: Improve display of macro names with embedded NUL.
500 Quote instances of problematic characters in macro names when
501 presented to user. Track location via call_info rather than
502 munging context for every expansion.
504 Speed impact: slight penalty, due to more bookkeeping.
505 * m4/m4module.h (m4_push_string_init): Add parameters.
506 * m4/m4private.h (struct m4_macro_args): Remove argv0 and
507 argv0_len, now redundant with info.
508 (m4__push_wrapup_init): Add parameter.
509 * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
510 location from caller, rather than context.
511 (composite_peek, composite_read, match_input): Adjust callers.
512 * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
513 (m4_verror_at_line): Allow NUL in macro name.
514 * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
516 (expand_macro): No longer munge context location.
517 (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
518 (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
519 * modules/gnu.c (builtin, indir): Likewise.
520 * tests/null.m4: Enhance test.
521 * tests/null.err: Adjust expected output.
522 * tests/null.out: Likewise.
524 Stage 24b: Allow embedded NUL in macro names.
525 Use length rather than NUL-termination when tracking macro names.
526 All APIs dealing with symbol table changed.
528 Speed impact: slight penalty, due to more bookkeeping.
529 * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
530 (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
531 (m4_symbol_rename, m4_symbol_delete): Add length parameter.
532 (m4_string): New type.
533 * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
534 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
536 * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
537 (m4__symtab_remove_module_references, symbol_destroy_CB)
538 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
539 (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
540 (m4_symbol_delete): Likewise.
541 * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
543 * m4/macro.c (expand_token): Adjust all callers.
544 * m4/module.c (install_builtin_table, install_macro_table):
546 * m4/utility.c (m4_symbol_value_lookup): Likewise.
547 * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
548 * modules/m4.c (define, undefine, pushdef, popdef)
549 (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
550 (traceon, traceoff): Likewise.
551 * src/main.c (main): Likewise.
552 * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
553 * tests/freeze.at (reloading nul): Augment test.
554 * tests/null.out: Adjust expected output.
556 Stage 24a: Use full call context in error reporting.
557 Replace const char *macro_name with const m4_call_info *call, so
558 that the next patch can pass the length of macro_name with
559 embedded NUL. Simplifies handling of global state.
561 Speed impact: none noticed.
562 * m4/m4module.h (m4_error, m4_warn): Change parameter type.
563 (m4_error_at_line, m4_warn_at_line): Delete.
564 (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
565 (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
566 * m4/m4private.h (m4__next_token): Likewise.
567 * m4/utility.c (m4_verror_at_line): Alter parameter, and use
568 caller's location if caller is provided.
569 (m4_error, m4_warn): Change parameter type.
570 (m4_error_at_line, m4_warn_at_line): Delete.
571 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
572 (m4_symbol_value_lookup): Adjust all callers.
573 * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
574 * m4/input.c (m4_skip_line, m4__next_token): Likewise.
575 * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
576 (process_macro): Likewise.
577 * modules/m4.h (m4_make_temp_func): Likewise.
578 * modules/evalparse.c (m4_evaluate): Likewise.
579 * modules/format.c (arg_int, arg_long, arg_double, format):
581 * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
582 (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
583 (renamesyms, syncoutput, regexp_compile, substitute)
584 (regexp_substitute, m4_resyntax_encode_safe): Likewise.
585 * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
586 (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
587 (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
589 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
590 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
592 * tests/options.at (--syncoutput): Add test for invalid
593 command-line argument. Split xfailed portion...
594 (--syncoutput and diversions): ...into new test.
595 (unknown option): New test.
596 * tests/freeze.at (reloading unknown builtin): Update expected
599 Adjust to recent gnulib change.
600 * configure.ac (AB_INIT): Delete, now that gnulib does this.
602 2008-05-28 Eric Blake <ebb9@byu.net>
604 Improve frozen debugmode behavior.
605 * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
606 * src/main.c (main): Interleave -d with files.
607 * tests/options.at (--debugmode): Update test.
608 * tests/freeze.at (reloading debugmode): New test.
609 * doc/m4.texinfo (Debugging options, Debugmode): Document the
613 2008-05-27 Eric Blake <ebb9@byu.net>
615 Fix some testsuite failures on Solaris 8.
616 * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
618 * tests/others.at (stderr closed): Likewise. Also support Solaris
620 (stdin closed): Skip test if closed stdin gets reopened.
621 (stdout closed): Support Solaris wording for EBADF.
622 * tests/testsuite.at (AT_CHECK_M4): Likewise.
624 Fix configure message nesting, broken since 2001-09-20.
625 * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
626 not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
628 Support 'make dist' with BSD make.
629 * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
630 of the generated file tests/generated.at.
631 (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
632 * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
634 2008-05-24 Eric Blake <ebb9@byu.net>
636 Test NUL in frozen files.
637 * tests/testsuite.at (AT_CHECK_M4): Add parameter.
638 * tests/freeze.at (reloading nul): New test.
639 (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
640 (reloading unknown builtin): Likewise.
642 2008-05-23 Eric Blake <ebb9@byu.net>
644 Improve handling of frozen file errors.
645 * src/freeze.c (produce_frozen_state): Detect write failures.
646 (reload_frozen_state): Use close_stream.
647 * tests/freeze.at (freezing failure): New test.
649 Reported by Jean-Charles Longuet.
651 2008-05-19 Eric Blake <ebb9@byu.net>
653 In frozen file, split consecutive strings with newline.
654 * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
655 (produce_frozen_state): Likewise for 'Q', 'C'.
656 (reload_frozen_state): Parse the new layout.
657 [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
658 * tests/freeze.at (loading format 2): Rewrite to new format.
659 (reloading unknown builtin): Likewise.
660 (loading format 1): Make sure backslash-newline is not
662 * doc/m4.texinfo (Frozen file format 2): Document the format.
663 * NEWS: Document this change.
665 Fix xgettext options.
666 * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
669 Fix spelling of René Seindal's name in --version output.
670 * ltdl/m4/gnulib-cache.m4: Import propername module.
671 * src/main.c (AUTHORS): Rewrite in terms of proper_name.
672 * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
673 * HACKING: Mention new prerequisite of gperf.
675 2008-05-18 Eric Blake <ebb9@byu.net>
677 Allow freezing the trace status of macros.
678 * src/freeze.c (produce_symbol_dump): Let undefined traced macros
680 (dump_symbol_CB): Also freeze trace state.
681 * tests/freeze.at (reloading traced macros): New test.
682 * doc/m4.texinfo (Using frozen files): Update documentation to
684 (Frozen file format 1): Improve synchronization with branch.
685 (Frozen file format 2): Reorder directives, and add `d', `t'.
686 * NEWS: Document this change.
688 2008-05-15 Eric Blake <ebb9@byu.net>
690 Fix frozen file regression in pushdef stacks from 2001-09-01.
691 * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
692 just the current definition.
693 (reverse_symbol_value_stack): New helper method.
694 * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
695 (reloading pushdef stack): New test.
696 (reloading unknown builtin): Enhance test.
698 2008-05-13 Eric Blake <ebb9@byu.net>
700 Fix frozen file regression in diversions from 2007-01-21.
701 * m4/output.c (insert_diversion_helper): Add parameter.
702 (m4_insert_file): Move contents...
703 (insert_file): ...to this new helper, with added parameter.
704 (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
706 * src/freeze.c (produce_mem_dump): Simplify.
707 * tests/freeze.at (large diversion): Test for this.
709 Improve error message when frozen file is invalid.
710 * src/freeze.c (decode_char): Add parameter. Allow \<newline>
712 (reload_frozen_state): Track current line.
713 * tests/freeze.at (loading format 1, loading format 2): Update to
716 2008-05-10 Eric Blake <ebb9@byu.net>
718 Detect integer overflow when loading frozen file.
719 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
720 immediately on overflow.
721 * tests/freeze.at (loading format 2): Test this.
722 Reported by Jim Meyering.
724 2008-05-08 Eric Blake <ebb9@byu.net>
726 Stage 23: allow tracing of indirect macro calls.
727 Track all trace information as part of the argv struct, rather
728 than temporarily resetting global state. Teach indir to trace
729 macros that it invokes.
730 Memory impact: slight penalty, due to larger argv struct.
731 Speed impact: none noticed.
732 * m4/m4module.h (m4_input_block): Remove.
733 (m4_call_info): New opaque type.
734 (m4_trace_prepare, m4_arg_info): New prototypes.
735 (m4_macro_call, m4_push_string_finish, m4_input_print): Change
737 * m4/m4private.h (struct m4_macro_args): Add info field.
738 (struct m4_call_info): New structure.
739 (m4_arg_info): New accessor.
740 * m4/input.c (m4_input_block): Make typedef local.
741 (m4_push_string_init): Initialize length.
742 (m4_push_string_finish, m4_input_print): Change signature, so that
743 printing can be done before finalization.
744 (struct input_funcs): Add parameter to print_func.
745 (file_print, string_print, composite_print): Adjust accordingly.
746 * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
747 Change signatures for stacked trace messages, and for using call
749 (trace_prepre): Export and rename...
750 (m4_trace_prepare): ...to this, for use by indir. Alter signature
752 (collect_arguments): Alter signature, to manage new field.
753 (expand_macro): Change call context management. Move tracing...
754 (m4_macro_call): ...here. Remove redundant parameter.
755 (m4_arg_argc): New function.
756 (m4_make_argv_ref): Replace unused skip parameter with new trace
757 parameter; manage new field.
758 * modules/gnu.c (builtin, indir): Adjust callers.
759 * src/main.c (usage): Update debugmode flag summary.
760 * tests/null.m4: Enhance test.
761 * tests/null.err: Update expected output.
762 * tests/macros.at (Tracing Hanoi Towers): Likewise.
763 * doc/m4.texinfo (Trace): Mention more about trace formatting.
764 (Debugmode): Enhance description of 'c' and 'x'. Enhance test to
765 cover line numbering details in traces.
766 (Debuglen): Enhance test to cover indir tracing.
767 * NEWS: Mention these changes.
768 Reported by Akim Demaille in the autoconf TODO file in 2000.
770 2008-05-07 Eric Blake <ebb9@byu.net>
772 Test for traceon regression just fixed in branch-1.6.
773 * doc/m4.texinfo (Trace): Enhance test.
774 * NEWS: Port news item from branch.
776 2008-05-05 Eric Blake <ebb9@byu.net>
778 Stage 22: allow builtin token concatenation outside $@.
779 Adjust the input and argument parsing engines to append builtins
780 alongside text. Make define warn when builtins must be
782 Memory impact: slight penalty, with fewer builtins flattened.
783 Speed impact: slight penalty, from more bookkeeping.
784 * m4/m4module.h (m4_is_arg_composite): New prototype.
785 (m4_symbol_value_copy): Change return type.
786 (m4_arg_text): Add parameter.
787 (M4ARG): Adjust callers.
788 * m4/m4private.h: Adjust comments.
789 * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
791 * m4/input.c (init_builtin_token): Add parameter, and allow
792 concatenating builtins.
793 (m4__next_token): Adjust caller.
794 * m4/macro.c (m4_is_arg_composite): New function.
795 (expand_argument): Allow builtin concatenation.
796 (m4_arg_text): Add parameter.
797 (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
798 (m4_arg_equal): Fix comparison of builtin tokens.
799 * modules/m4.c (define, pushdef): Warn when flattening builtins.
800 * doc/m4.texinfo (Define): Remove dead comment.
801 (Defn): Update to reflect code changes.
802 * tests/builtins.at (defn): Remove xfail.
803 * NEWS: Document this change.
805 2008-05-03 Eric Blake <ebb9@byu.net>
807 Document define_blind.
808 * doc/m4.texinfo (Ifelse): Add a new composite macro.
812 2008-05-01 Eric Blake <ebb9@byu.net>
814 Avoid -Wshadow compiler warnings.
815 * m4/output.c (threshold_diversion_CB): s/div/diversion/.
816 * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
817 (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
818 (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
819 (m4_push_arg, m4__push_arg_quote): s/index/arg/.
820 * modules/format.c (format): Likewise.
821 * modules/m4.c (ifelse): Likewise.
823 Improve debugmode testing, based on recent branch-1.6 regressions.
824 * doc/m4.texinfo (Debugmode): Enhance tests.
825 * tests/generate.awk: Run tests from stdin, not input.m4. Support
826 stderr munging when using -I examples.
828 Fix regression in define from 2008-02-22.
829 * m4/m4module.h (m4_symbol_value_copy): Add parameter.
830 * m4/symtab.c (m4_symbol_value_copy): Support copying $@
832 * m4/macro.c (expand_argument): Update callers.
833 * modules/m4.c (define, pushdef): Likewise.
834 * tests/builtins.at (define): Enhance test to catch this.
836 2008-04-21 Eric Blake <ebb9@byu.net>
838 Simplify previous patch.
839 * tests/m4.in: Compress assignment.
840 Suggested by Gary V. Vaughan.
842 Fix --disable-shared testsuite regression from previous patch.
843 * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
846 Fix spelling of attribution to Christopher Strachey.
847 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
849 Reported by Fernando Carrijo.
851 2008-04-17 Eric Blake <ebb9@byu.net>
853 Fix testsuite bug when SIGPIPE is ignored.
854 * tests/builtins.at (divert): Consume all of m4's output, to avoid
855 spurious write failure.
856 * src/main.c (main): In batch mode, restore default handling of
858 * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
860 Reported by Bob Proulx, via his autobuilder.
862 2008-04-15 Eric Blake <ebb9@byu.net>
864 Fix 'make installcheck' after './configure --prefix-progname'.
865 * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
867 (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
868 * tests/builtins.at (patsubst): Avoid space-tab.
869 (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
870 * tests/options.at (--debugfile): Likewise.
871 * tests/others.at (stdin seekable): Likewise.
872 (fstab): Avoid space-tab.
873 * Makefile.am (installcheck-local): Accomodate transformed name.
874 (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
875 during 'make distcheck'.
876 * cfg.mk: New file, borrowed from branch.
878 Update prerequisite tools to match recent releases.
879 * configure.ac (AC_PREREQ): Rely on released autoconf.
880 (LT_PREREQ): Rely on released libtool.
881 * tests/testsuite.at (m4_version_prereq): Update dependence.
882 * bootstrap: Mention prerequisites.
884 Work around OS/2 limitation of printf(1).
885 * tests/null.m4: Use m4, not printf, to generate NUL byte.
886 * tests/null.out: Check for esyscmd failure.
887 Reported by Elbert Pol.
889 2008-04-14 Eric Blake <ebb9@byu.net>
891 Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
892 Improve arg_print to handle builtin tokens when printing to a
893 known chain, rather than always flattening builtins. This allows
894 m4wrap and $@ back-references to handle embedded builtin tokens.
896 Speed impact: slight penalty, from more bookkeeping.
897 * m4/m4module.h (m4_push_builtin): Add parameter.
898 (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
899 (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
900 * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
901 (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
902 ...to these, in some cases adding a parameter.
903 (m4__append_builtin): New prototype.
904 * m4/builtin.c (m4_builtin_print): Alter signature to print
905 builtin to a growing symbol chain.
906 * m4/symtab.c (m4__symbol_value_print): Alter signature.
907 (m4_symbol_print, dump_symbol_CB): Adjust callers.
908 * m4/input.c (builtin_peek, builtin_read, builtin_unget)
909 (builtin_print, builtin_funcs): Delete, handled via composite
911 (struct m4_input_block): Delete u.builtin member.
912 (init_builtin_token): Only use composite block.
913 (m4__append_builtin): New function.
914 (m4_push_builtin, m4__push_wrapup_init): Alter signature.
915 (m4__push_symbol): Allow builtin tokens.
916 (m4__push_wrapup_finish): Rename.
917 (composite_print, m4_print_token): Adjust callers.
918 * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
920 (m4__arg_print): Alter signature.
921 (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
923 * modules/m4.c (m4wrap): Allow builtin tokens.
924 (defn, errprint): Adjust callers.
925 * modules/gnu.c (builtin): Likewise.
926 * doc/m4.texinfo (M4wrap): New test.
927 (Debuglen): Adjust expected output.
929 Stage 21a: Optimize checks for end of input.
930 Create a new polymorphic input block type, which always fails with
931 CHAR_EOF, so that remaining input routines no longer have to check
932 for NULL input block.
934 Speed impact: noticeable improvement, from fewer conditionals.
935 * m4/input.c (eof_funcs, input_eof): New objects.
936 (eof_peek, eof_read, eof_unget): New functions.
937 (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
938 (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
939 (m4_input_exit): Use placeholder to guarantee non-NULL isp and
941 (next_char): Rename retry to allow_unget, and change sense for
942 easier manipulation. All callers changed.
944 Improve OS/2 detection.
945 * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
946 are defined, not just the first. The testsuite ensures that
947 exactly one gets defined.
948 * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
949 what other pre-defined macros it has.
951 Reported by Elbert Pol.
953 Ensure __m4_version__ is unquoted.
954 * tests/builtins.at (__m4_@&t@version__): Augment test.
956 Avoid GNU make failure on tarball.
957 * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
959 2008-04-10 Eric Blake <ebb9@byu.net>
961 Allow back-referenced macro names; fixes 2008-03-13 regression.
962 * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
963 * m4/utility.c (m4_symbol_value_lookup): Change signature.
964 * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
966 * tests/others.at (ifndef): New test.
968 Be namespace clean for M4 version; fixes 2008-04-08 regression.
969 * configure.ac (version): Rename...
970 (M4_VERSION): ...to this, since using 'version' broke po.m4.
972 2008-04-09 Eric Blake <ebb9@byu.net>
974 Mention 1.4.11 release.
975 * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
976 (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
977 (Format): Add test of C99 hex-float parsing.
978 * NEWS: Mention 1.4.11 release.
979 * tests/builtins.at (divert): Add additional test.
981 2008-04-08 Eric Blake <ebb9@byu.net>
983 Overhaul inter-version releases to work with git.
984 * configure.ac (version): New variable, which has nicer version
985 contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
986 (TIMESTAMP): Delete, since CVS id expansion died with transition
988 (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
989 * build-aux/mkstamp: Delete, no longer used.
990 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
991 rebuilds when timestamps don't matter.
992 (MKSTAMP): Delete, no longer used.
993 (EXTRA_DIST): No longer worry about mkstamp.
994 (.version): New rule and distributed file.
995 (doc/m4.1, tests/package.m4): Depend on .version, not
996 configure.ac, for timestamp.
997 * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
998 * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
999 * src/main.c (main): Likewise.
1001 2008-03-28 Eric Blake <ebb9@byu.net>
1003 Use GNUmakefile module.
1004 * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1005 * Makefile.am: Split off maintainer rules...
1006 * maint.mk: ...into this new file.
1008 2008-03-18 Eric Blake <ebb9@byu.net>
1010 Stage 20b: make m4wrap obey POSIX fifo ordering.
1011 Improve input engine to support location changes within symbol
1012 chains, then convert m4wrap to always build symbol chain.
1013 Memory impact: none.
1014 Speed impact: slight penalty, from more m4wrap bookkeeping.
1015 * m4/m4module.h (m4_wrap_args): Add prototype.
1016 * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1017 (struct m4__symbol_chain): Add struct u_l.
1018 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1020 (composite_peek, composite_read, composite_clean): Handle location
1022 * m4/macro.c (m4_wrap_args): New function.
1023 * modules/m4.c (m4wrap): Use it.
1024 * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1025 (Extensions): Document extension of multiple arguments.
1026 (Location, Improved m4wrap): Adjust example to match FIFO order.
1027 * tests/builtins.at (wrap): Likewise.
1028 * NEWS: Document this change.
1030 2008-03-17 Eric Blake <ebb9@byu.net>
1032 Stage 20a: reduce unget's in input engine.
1033 Now that out-of-range input placeholders like CHAR_BUILTIN are
1034 consumed outside of next_char, next_token should always consume
1035 rather than peek at the first character. Fewer peeks results in
1036 less ungetc overhead.
1037 Memory impact: none.
1038 Speed impact: noticeable improvement, from fewer function calls.
1039 * m4/input.c (struct input_funcs): Alter read_func prototype.
1040 (next_char, file_read, buildin_read, string_read, composite_read):
1041 Add allow_argv parameter.
1042 (init_builtin_token, init_argv_symbol): Require all prior input to
1044 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1045 (m4__next_token): Consume first byte without peek.
1047 Update for fresh bootstrap.
1048 * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1050 2008-03-15 Eric Blake <ebb9@byu.net>
1052 Document join, in order to fix bug in m4wrap example.
1053 * examples/join.m4: New file.
1054 * examples/wraplifo2.m4: Likewise.
1055 * Makefile.am (EXTRA_DIST): Add new files.
1056 * doc/m4.texinfo (Improved m4wrap): New node.
1057 (Defn, Location): Enhance tests.
1058 (Shift): Document the composite macro join.
1059 (Incompatibilities): Move documentation of LIFO vs. FIFO...
1060 (M4wrap): ...here, to match improved example.
1062 2008-03-13 Eric Blake <ebb9@byu.net>
1064 Stage 19c: allow builtin tokens in more macros.
1065 Allow builtin tokens inside symbol chains, although for now, they
1066 are not allowed inside comments or quotes. Enable builtin token
1067 handling in more macros, if only to consistently diagnose invalid
1069 Memory impact: none.
1070 Speed impact: slight impact, due to more bookkeeping.
1071 * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1073 * m4/m4private.h (enum m4__symbol_chain_type): Add
1075 (struct m4__symbol_chain): Add builtin member.
1076 * m4/utility.c (m4_symbol_value_lookup): New method.
1077 * m4/builtin.c (m4_builtin_print): New function.
1078 * m4/symtab.c (m4_symbol_value_print): Use it.
1079 * m4/input.c (builtin_print): Likewise.
1080 (m4__push_symbol): Allow pushing builtin tokens.
1081 (composite_peek, composite_read, composite_unget, composite_clean)
1082 (composite_print): Handle builtin tokens.
1083 (init_builtin_token): Allow builtin tokens from composite input.
1084 (m4__next_token): Flatten builtins inside comment or string.
1085 * m4/macro.c (expand_argument): Strengthen assertion.
1086 (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1087 Handle builtin tokens.
1088 (arg_symbol): Add parameter, and allow NULL level.
1089 (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1090 (m4_arg_text): Ensure all builtins have been flattened.
1091 * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1092 (undefine, m4_dump_symbols): Warn on invalid macro names.
1093 (ifdef, ifelse, shift): Handle builtin tokens.
1094 * modules/gnu.c (m4symbols): Likewise.
1095 * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1097 (Debuglen): Likewise, and remove xfail.
1098 * NEWS: Mention the change.
1100 Stage 19b: invert sense of bit for handling builtin tokens.
1101 Pass builtin tokens by default, rather than as the exception, so
1102 that the logic can consistently refer to flattening arguments.
1103 Memory impact: none.
1105 * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1106 (M4_BUILTIN_GROKS_MACRO): Rename...
1107 (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1108 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1109 (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1111 * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1112 (m4_symbol_value_groks_macro): Likewise...
1113 (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1115 * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1116 (m4_symbol_value_flatten_args): ...to this.
1117 * m4/macro.c (collect_arguments): Accomodate changed sense.
1118 * m4/module.c (m4__module_open): Require arguments if flattening
1120 * m4/input.c (m4_push_string_finish): For now, flatten all
1121 builtins pushed as back-references.
1122 * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1123 * modules/import.c (m4_builtin_table): Likewise.
1124 * modules/load.c (m4_builtin_table): Likewise.
1125 * modules/modtest.c (m4_builtin_table): Likewise.
1126 * modules/mpeval.c (m4_builtin_table): Likewise.
1127 * modules/perl.c (m4_builtin_table): Likewise.
1128 * modules/shadow.c (m4_builtin_table): Likewise.
1129 * modules/stdlib.c (m4_builtin_table): Likewise.
1130 * modules/time.c (m4_builtin_table): Likewise.
1131 * modules/m4.c (m4_builtin_table): Likewise.
1132 (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1133 are stringized without preprocessor expansion.
1134 * doc/m4.texinfo (Defn): Update comments to match reality.
1135 (Debuglen): Update test now that user macros pass builtin tokens.
1137 Stage 19a: sort and cache builtins loaded by a module.
1138 Rather than repeatedly using dlsym to browse the builtin table,
1139 copy off the table at module load time. Then, the input engine
1140 merely refers to the copy instead of duplicating information.
1141 Memory impact: slight penalty, due to more memory per module, but
1142 offset by less memory in input engine.
1143 Speed impact: slight improvement, due to faster builtin lookups.
1144 * m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
1145 m4_builtin_find_by_* instead.
1146 (m4_builtin_find_by_func): Change return type.
1147 * m4/m4private.h (m4__builtin): New struct.
1148 (m4_module): Add sorted list of loaded builtins.
1149 (struct m4_symbol_value): Change type of builtin value.
1150 (m4__set_symbol_value_builtin): New prototype and fast accessor.
1151 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1153 * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1154 (m4__set_symbol_value_builtin): ...and populate additional fields,
1156 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1158 * m4/module.c (install_builtin_table): Use cached table.
1159 (compare_builtin_CB): New helper function.
1160 (m4__module_open): Populate table.
1161 (module_remove): Free table.
1162 * m4/builtin.c (compare_builtin_name_CB): New helper function.
1163 (m4_builtin_find_by_name): Rewrite to use sorted table.
1164 (m4_builtin_find_by_func): Change return type.
1165 * m4/input.c (struct m4_input_block): Simplify u_b, since most
1166 fields can be determined from builtin.
1167 (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1168 (m4__next_token): Alter parsing so that only init_builtin_token
1170 (builtin_print, m4_push_builtin): Adjust all users.
1171 * tests/macros.at (Arity, defn, and freeze): Fix typo.
1173 Consistently cast malloc results, for C++ compilation.
1174 * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1175 * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1176 (m4_hash_resize, maybe_grow): Likewise.
1177 * m4/m4.c (m4_create): Likewise.
1178 * m4/macro.c (expand_macro): Likewise.
1179 * m4/output.c (m4_tmpname): Likewise.
1180 * m4/path.c (search_path_add): Likewise.
1181 * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1182 (symtab_fetch): Likewise.
1183 * m4/syntax.c (m4_syntax_create): Likewise.
1184 * modules/gnu.c (regexp_compile): Likewise.
1185 * src/main.c (main): Likewise.
1186 * src/freeze.c (reload_frozen_state): Likewise.
1188 2008-03-06 Eric Blake <ebb9@byu.net>
1190 Fix nested builtin(`shift',$@) regression from 2008-02-23.
1191 * m4/macro.c (make_argv_ref): Don't output expansion text when
1192 making wrapper for builtin or indir.
1193 * tests/builtins.at (builtin): New test.
1194 * NEWS: Document the fix.
1195 Reported by Andreas Schwab.
1197 2008-03-04 Eric Blake <ebb9@byu.net>
1199 The gnulib module free was deprecated.
1200 * ltdl/m4/gnulib-cache.m4: Remove free module.
1202 2008-02-29 Eric Blake <ebb9@byu.net>
1204 Import news from 1.4.10b.
1205 * NEWS: Update from branch.
1207 2008-02-23 Eric Blake <ebb9@byu.net>
1209 Stage 18: try harder to reuse argv in recursion.
1210 When pushing arguments that contain an existing $@ ref, reuse the
1211 ref rather than creating another layer of wrappers.
1212 Memory impact: noticeable improvement, due to better $@ reuse.
1213 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1214 reduction in unboxed recursion.
1215 * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1216 (m4_push_args): Let make_argv_ref take care of pending data.
1217 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1218 performance capability.
1219 * tests/others.at (recursion): Add tests to avoid performance
1222 2008-02-22 Eric Blake <ebb9@byu.net>
1225 * NEWS: Document change to __gnu__ on 2008-02-11.
1227 Stage 17: pass argv through quoted strings.
1228 Allow the concatenation of $@ references with other text input
1229 inside quoted contexts, which requires distinguishing between a
1230 wrapper around many arguments vs. a reference serving as part of a
1231 single argument. Also optimize based on whether argv contains
1232 builtin tokens that might need flattening to the empty string.
1233 Memory impact: noticeable improvement, due to O(n^2) to O(n)
1234 reduction from total reuse of $@ references.
1235 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1236 reduction in boxed recursion.
1237 * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1238 (M4ARGLEN): Adjust definition.
1239 * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1240 (struct m4_symbol_value): Add wrapper and has_func members.
1241 (struct m4_macro_args): Add flatten and has_func members.
1242 * m4/input.c (append_quote_token): Return argv refs inside quoted
1244 (init_argv_symbol): Populate new fields.
1245 * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1246 (m4_make_argv_ref): Likewise.
1247 (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1249 (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1251 * modules/m4.c (ifelse): Adjust caller.
1253 2008-02-22 Gary V. Vaughan <gary@gnu.org>
1255 Fix regression in argument collection, from 2008-01-21.
1256 * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1257 undo argument collection optimisation for strings, so that
1258 m4_print_token doesn't abort when it otherwise receives an
1259 unprintable M4_SYMBOL_VOID type token.
1261 2008-02-20 Eric Blake <ebb9@byu.net>
1263 Stage 16: cache quotes and improve m4_arg_print.
1264 Cache rather than always copying quotes when pushing $@ refs; in
1265 particular, reconstruct single-byte quotes on the fly. Allow NUL
1266 through m4wrap. Improve sharing of code that prints arguments.
1267 Memory impact: slight improvement, due to cached quotes.
1268 Speed impact: slight improvement, due to less copying.
1269 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
1270 (m4_arg_print): Adjust prototypes.
1271 (m4_dump_args): Delete.
1272 (m4_push_wrapup): Split...
1273 (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
1275 * m4/m4private.h (struct m4_syntax_table): Add cached_quote
1277 (m4__quote_cache, m4__quote_uncache): New prototypes.
1278 * m4/syntax.c (m4_syntax_create): Initialize the cache.
1279 (m4__quote_cache): New function.
1280 (m4_set_syntax): Update caller.
1281 * m4/symtab.c (m4_symbol_value_print): Add parameter.
1282 (m4_symbol_print, dump_symbol_CB): Adjust all callers.
1283 * m4/utility.c (m4_dump_args): Delete; callers should use
1284 m4_arg_print instead.
1285 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
1286 implementation, and allow embedded NUL.
1287 (m4_print_token, pop_input, composite_print, composite_peek):
1288 (composite_read, append_quote_token): Adjust all callers.
1289 * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
1291 (m4_arg_print): Add parameters.
1292 (trace_pre): Rewrite in terms of m4_arg_print.
1293 * modules/m4.c (errprint): Likewise.
1294 (m4wrap): Rewrite to allow embedded NUL.
1295 (dumpdef): Adjust caller.
1296 * doc/m4.texinfo (Debuglen): Enhance debuglen test.
1297 * tests/null.m4: Test for NUL in m4wrap.
1298 * tests/null.out: Update expected output.
1300 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
1301 * m4/utility.c (m4_verror_at_line): Properly terminate the string.
1302 Reported by Ralf Wildenhues.
1304 * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
1306 2008-02-19 Eric Blake <ebb9@byu.net>
1308 Clean up example on filtering defined symbols.
1309 * doc/m4.texinfo (Foreach, Improved foreach): Document another
1310 shortcoming in foreach.m4, and improve filter example by using
1313 * src/main.c (usage): Fix typo.
1315 2008-02-18 Eric Blake <ebb9@byu.net>
1317 Avoid some magic numbers.
1318 * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
1319 (CHAR_RETRY): Define in terms of UCHAR_MAX.
1320 * m4/syntax.c (m4_syntax_create, set_syntax_set)
1321 (reset_syntax_set, check_is_single_quotes)
1322 (check_is_single_comments, check_is_macro_escaped)
1323 (m4_set_quotes, m4_set_comment): Likewise.
1324 * modules/gnu.c (regexp_compile): Likewise.
1325 * modules/m4.c (translit): Likewise.
1326 * src/freeze.c (produce_syntax_dump): Likewise.
1327 Reported by Ralf Wildenhues.
1329 2008-02-16 Eric Blake <ebb9@byu.net>
1331 Add regression test for multi-character quote recursion.
1332 * examples/foreach2.m4: Use $0 rather than spelling out name.
1333 * examples/foreachq2.m4: Likewise.
1334 * examples/forloop2.m4: Likewise.
1335 * examples/hanoi.m4: Likewise.
1336 * examples/trace.m4: Likewise.
1337 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1338 (Improved foreach): Adjust dump from file.
1340 Stage 15: return argv refs back to collect_arguments.
1341 Collect an entire $@ reference at once rather than one argument at
1342 a time, outside of quotes (but inside quotes, $@ is still
1343 flattened for now). The skip_last field allows concatenation of
1344 $@ with other text when collecting arguments.
1345 Memory impact: noticeable improvement, due to better reuse of $@.
1346 Speed impact: noticeable improvement, due to less parsing.
1347 * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
1348 (enum m4__token_type): Add M4_TOKEN_ARGV.
1349 (struct m4__symbol_chain): Add skip_last member to argv link.
1350 (m4__next_token): Add parameter.
1351 * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
1352 (composite_peek, m4__next_token): Add new parameter.
1353 (composite_read, append_quote_token): Support argv in quotes.
1354 (init_argv_symbol): New function.
1355 (m4__push_symbol, match_input, consume_syntax)
1356 (m4__next_token_is_open, m4_print_token): Adjust callers.
1357 * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
1358 (arg_mark, m4_arg_text, make_argv_ref): Likewise.
1359 (expand_argument, collect_arguments): Handle new token.
1360 (arg_symbol): Drill through $@ reference.
1361 * m4/syntax.c (set_quote_age): Detect disabled comments.
1362 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
1364 2008-02-15 Eric Blake <ebb9@byu.net>
1366 * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
1368 2008-02-13 Eric Blake <ebb9@byu.net>
1370 Fix texinfo grammar.
1371 * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
1372 (History): Use @: after abbreviations.
1373 (M4exit): Use correct Latin abbreviation.
1374 (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
1377 2008-02-11 Eric Blake <ebb9@byu.net>
1379 Allow builtin text macros to specify number of arguments.
1380 * m4/m4module.h (struct m4_macro): Add argument limits to builtin
1382 * m4/module.c (install_macro_table): Allow text macros to warn on
1384 * modules/gnu.c (m4_macro_table): Update all clients.
1385 * modules/load.c (m4_macro_table): Likewise.
1386 * modules/mpeval.c (m4_macro_table): Likewise.
1387 * modules/perl.c (m4_macro_table): Likewise.
1388 * modules/shadow.c (m4_macro_table): Likewise.
1389 * modules/traditional.c (m4_macro_table): Likewise.
1390 * modules/modtest.c (m4_macro_table): Likewise. Also add text
1391 macros, for testing this.
1392 * doc/m4.texinfo (Standard Modules): Update text, and enhance
1394 * tests/modules.at (modules: text): New test.
1396 Fix regression in command line -D option, from 2006-08-25.
1397 * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
1398 * m4/m4module.h: Fix typo.
1399 * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
1401 * tests/macros.at (Command line define): Enhance test.
1402 * tests/others.at (nul character): Enhance test.
1403 * tests/null.m4: Likewise.
1404 * tests/null.out: Likewise.
1406 Use gnulib's git-merge-changelog driver when available.
1407 * .gitattributes: Add merge attributes for ChangeLog.
1408 * bootstrap: Install driver, if not already present.
1410 2008-02-06 Eric Blake <ebb9@byu.net>
1412 Fix security hole introduced 2007-11-23.
1413 * m4/utility.c (m4_verror_at_line): Properly escape macro names.
1414 * src/main.c (main): Manage quoteargs defaults.
1415 * doc/m4.texinfo (Indir): Document and test this.
1417 Using raw strtod is not portable.
1418 * ltdl/m4/gnulib-cache.m4: Import the strtod module.
1420 2008-02-02 Eric Blake <ebb9@byu.net>
1422 Consistently use size_t for number of arguments.
1423 * m4/m4module.h (m4_builtin_func): Alter prototype.
1424 (struct m4_builtin): Adjust type of min_args, max_args.
1425 (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
1426 (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
1427 (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
1428 (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
1429 (m4_arg_print, m4_push_arg): Adjust all clients.
1430 * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
1431 (m4_macro_args): Adjust type of various fields.
1432 (m4__push_arg_quote): Adjust all clients.
1433 * m4/input.c (m4_pop_wrapup): Likewise.
1434 * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
1435 (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
1436 (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
1437 (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
1438 (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
1439 * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
1440 * modules/evalparse.c (m4_evaluate): Likewise.
1441 * modules/gnu.c (changesyntax): Likewise.
1442 * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
1443 (undivert, traceon, traceoff): Likewise.
1444 * modules/m4.h (m4_dump_symbols_func): Likewise.
1445 * modules/perl.c (perleval): Likewise.
1447 Stage 14b: allow pushing argv references.
1448 Push a $@ reference to the input engine in one go, rather than
1449 pushing each element. For now, argument collection still gets one
1450 argument of a $@ at a time; but the penalties of this patch make
1451 it easier to manage $@ efficiently in future patches.
1452 Memory impact: noticeable penalty, due to larger struct and O(n)
1453 to O(n^2) on unboxed recursion.
1454 Speed impact: noticeable penalty, due to more bookkeeping.
1455 * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
1457 (struct m4_macro_args): Add level field.
1458 (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
1459 * m4/input.c (m4__push_symbol, composite_peek, composite_read)
1460 (composite_unget, composite_clean, composite_print): Support $@
1462 * m4/macro.c (collect_arguments): Populate new field.
1463 (expand_macro): Move argv cleanup...
1464 (m4__arg_adjust_refcount): ...to this new function.
1465 (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
1466 (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
1467 helper functions, to add parameters.
1468 (m4_push_args): Adjust caller.
1469 * m4/symtab.c (m4_symbol_value_print): Likewise.
1471 Stage 14a: allow printing argv references.
1472 Refactor symbol-value printing code for better sharing, and to
1473 allow printing a contiguous text representation of a $@ ref.
1474 Memory impact: none.
1476 * m4/m4module.h (m4_arg_print): New prototype.
1477 (m4_symbol_value_print): Alter prototype.
1478 * m4/input.c (struct input_funcs): Add parameter to peek_func.
1479 (file_peek, builtin_peek, string_peek): Ignore new parameter.
1480 (composite_peek): Ignore new parameter, for now.
1481 (composite_clean, pop_input): Rework to minimize indirection, and
1482 to avoid infinite recursion in next patch.
1483 * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
1484 (m4_arg_print): New function.
1485 * m4/symtab.c (m4_symbol_value_print): Update signature.
1486 (m4_symbol_print): Update caller.
1487 * m4/output.c (m4_shipout_string_trunc): Update comments.
1488 * m4/syntax.c (set_quote_age): Require comma as argument separator
1489 when dealing with $@ as a unit.
1490 * tests/builtins.at (ifelse): Augment test.
1491 * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
1493 2008-01-31 Eric Blake <ebb9@byu.net>
1495 Kill hack for M4 1.4.4.
1496 * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
1497 we require new enough autoconf which in turn requires M4 1.4.5.
1499 2008-01-31 Gary V. Vaughan <gary@gnu.org>
1500 and Eric Blake <ebb9@byu.net>
1502 Depend on new libtool to use non-recursive build.
1503 * configure.ac (LT_PREREQ): Bump to alpha release version.
1504 (LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
1505 installed libtool has correct symbols.
1506 * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
1508 (AM_CPPFLAGS): Drop directories covered by libtool.
1509 (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
1510 (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
1511 macros, used by libtool.
1512 (lib_LTLIBRARIES): Also used by libtool.
1513 (ltdl/libltdlc.la): Delete, now that libtool does this.
1514 * bootstrap: Mention new requirements.
1515 (LIBTOOLIZE): Provide default program, and run libtoolize prior to
1517 (autoreconf): Also neutralize libtoolize, since it is run early.
1518 * HACKING: Mention updated prerequisites.
1520 2008-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1522 Fix build failure if installed libltdl is used.
1523 * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
1525 2008-01-28 Eric Blake <ebb9@byu.net>
1527 Depend on newer autoconf, for testsuite -C dir.
1528 * Makefile.am (CD_TESTDIR): Delete, no longer required.
1529 (check-local, installcheck-local, clean-local-tests): Use new -C
1530 option from autotest.
1531 * configure.ac (AC_PREREQ): Bump to 2.61a.347.
1532 * bootstrap: Mention new dependency.
1533 * HACKING: Likewise.
1535 2008-01-27 Eric Blake <ebb9@byu.net>
1537 Stage 13: push composite text tokens.
1538 Support pushing composite tokens, allowing back-references to be
1539 reused through multiple macro expansions. Add hueristic that
1540 avoids creating new reference when pushing existing references.
1541 Memory impact: noticeable improvement due to better reference
1542 reuse, except for O(n) to O(n^2) copying in boxed recursion.
1543 Speed impact: slight penalty, due to more bookkeeping.
1544 * m4/m4private.h (m4__push_symbol): Adjust prototype.
1545 * m4/input.c (m4__push_symbol): Add parameter, and support
1547 (append_quote_token): Add parameter, and support inlining of short
1549 (m4__next_token): Adjust caller.
1550 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1552 2008-01-26 Eric Blake <ebb9@byu.net>
1554 Stage 12c: add macro for m4_arg_len.
1555 Make a common action easier to type.
1556 Memory impact: none.
1558 * m4/m4module.h (M4ARGLEN): New macro.
1559 * m4/macro.c (process_macro): Adjust all callers.
1560 * m4/utility.c (m4_dump_args): Likewise.
1561 * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1563 * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1564 (renamesyms): Likewise.
1565 * modules/stdlib.c (setenv): Likewise.
1567 Stage 12b: add m4_string_pair.
1568 Make passing quote delimiters around more efficient.
1569 Memory impact: none.
1570 Speed impact: slight penalty, due to more bookkeeping.
1571 * m4/m4module.h (m4_string_pair): New type.
1572 (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1573 (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1575 * m4/m4private.h (struct m4_string): Delete.
1576 (struct m4_syntax_table): Combine quote and comment members.
1577 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1578 (m4_get_syntax_ecomm): Adjust accessors.
1579 (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1581 * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
1583 * m4/input.c (string_print, composite_print, m4_input_print):
1584 All callers updated.
1585 * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
1586 (check_is_single_quotes, m4_set_quotes, set_quote_age)
1587 (m4_get_syntax_lquote, m4_get_syntax_rquote)
1588 (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
1589 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1590 (m4_get_syntax_comments): Likewise.
1591 * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
1592 * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
1594 * modules/m4.c (dumpdef, m4_make_temp): Likewise.
1595 * src/freeze.c (produce_frozen_state): Likewise.
1596 * tests/freeze.at (reloading unknown builtin): Update test.
1598 Stage 12a: make m4_symbol_chain a union.
1599 Shrink size of symbol chains by using a union.
1600 Memory impact: slight improvement, due to smaller struct.
1601 Speed impact: slight improvement, due to less bookkeeping.
1602 * m4/m4private.h (enum m4__symbol_chain_type): New enum.
1603 (struct m4_symbol_chain): Rename...
1604 (struct m4__symbol_chain): ...to this, since it is internal.
1605 * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
1607 * m4/input.c (struct m4_input_block, m4__push_symbol)
1608 (composite_peek, composite_read, composite_unget)
1609 (composite_clean, composite_print, m4__make_text_link)
1610 (append_quote_token): Likewise.
1611 * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
1612 (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
1613 (m4_push_args): Likewise.
1615 2008-01-23 Eric Blake <ebb9@byu.net>
1617 Adjust to recent libtool interface change.
1618 * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
1619 (LT_WITH_LTDL): Delete, now that it is obsolete.
1620 (LTDL_INIT): Use new libtool macro.
1622 2008-01-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1623 and Eric Blake <ebb9@byu.net>
1625 Rely on newer automake.
1626 * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
1628 * bootstrap: Update automake requirement.
1629 (func_version): Fix --version output, broken since 2007-08-06.
1630 * HACKING: Likewise. Add lzma requirement.
1631 * Makefile.am (clean-local-src): Not needed any more with newest
1633 (clean-local): Adjust.
1634 * TODO: Remove completed item.
1636 2008-01-22 Eric Blake <ebb9@byu.net>
1639 * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
1642 2008-01-21 Eric Blake <ebb9@byu.net>
1644 Stage 11: full circle for single argument references.
1645 Pass quoted strings through to argument collection in a single
1646 action, so that an argument can be reused throughout macro
1647 recursion if it remains unchanged.
1648 Memory impact: noticeable improvement, due to more reuse in
1649 argument collection stacks; O(n^2) to O(n) on boxed recursion.
1650 Speed impact: noticeable improvement, due to less copying.
1651 * m4/m4module.h (m4_arg_text): Add parameter.
1653 * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
1654 (m4__make_text_link): New prototype.
1655 (struct m4_symbol_chain): Add quote_age member.
1656 (struct m4_symbol_value): Add end member to chained symbol.
1657 (struct m4_macro_args): Add wrapper member.
1658 * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
1659 (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
1661 * m4/input.c (make_text_link): Rename...
1662 (m4__make_text_link): ...to this, and export.
1663 (m4_push_string_finish): Adjust caller.
1664 (make_text_link, m4__push_symbol): Update new field.
1665 (file_read, builtin_read, string_read, composite_read, next_char):
1667 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1668 (append_quote_token): New function.
1669 (m4__next_token): Pass quoted strings onto argument collection.
1670 (m4_print_token) [DEBUG_INPUT]: Update.
1671 * m4/macro.c (expand_argument): Collect composite arguments.
1672 (collect_arguments): Update new field.
1673 (expand_macro): Reduce ref-count of back-references after use.
1674 (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
1676 (m4_is_arg_text): Also recognize composite symbols as text.
1677 (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
1678 (m4_arg_equal): Compare composite symbols.
1679 (m4_push_arg, m4_push_args): Handle composite symbols.
1680 (m4_arg_symbol): Relax assertion.
1681 (process_macro): Use single-argument references.
1682 * m4/output.c (m4_shipout_string_trunc): Update comment.
1683 * tests/macros.at (Rescanning macros): Augment test.
1685 2008-01-16 Eric Blake <ebb9@byu.net>
1687 Stage 10: avoid extra copying of strings and comments.
1688 When collecting tokens that are immune to further expansion, avoid
1689 copying data from one obstack to another by outputting it into the
1690 destination obstack to begin with. Also reduce copying done in
1692 Memory impact: slight improvement, due to better obstack usage.
1693 Speed impact: noticeable improvement, due less data copying.
1694 * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
1696 * m4/m4private.h (m4__token_type): Adjust prototype.
1697 * m4/input.c (m4__next_token): Support new parameter.
1698 * m4/macro.c (m4_macro_expand_input, expand_token)
1699 (expand_argument, collect_arguments): Adjust callers.
1700 * modules/m4.c (ntoa): Tighten buffer size.
1701 * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
1702 * modules/format.c (arg_int, arg_long, arg_double): New helper
1703 functions, to detect overflow or unparsed characters.
1704 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
1705 missing or excess arguments.
1706 (format): Likewise, and also output directly into obstack if there
1708 * doc/m4.texinfo (History): Update for new year.
1709 (Format): Test for new warnings.
1711 2008-01-15 Eric Blake <ebb9@byu.net>
1713 * TODO: Update with some newer URLs.
1715 Verify linear `index'.
1716 * tests/builtins.at (index): New test.
1717 (translit): Make test take longer, to make quadratic algorithms
1720 2007-12-20 Eric Blake <ebb9@byu.net>
1722 Stage 9: share rather than copy single-arg refs.
1723 Use hooks of previous patch to create back-references to arguments
1724 in the input engine, and inline short text rather than always
1725 creating a FIFO link. Also start testing embedded NUL behavior.
1726 Until the argument collection engine also shares references, the
1727 memory usage increases.
1728 Memory impact: noticeable penalty, due to longer life of argv
1729 changing O(n) to O(n^2) on boxed recursion.
1730 Speed impact: slight improvement, due less data copying.
1731 * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
1732 * m4/m4module.h (m4_arg_scratch): New prototype.
1733 * m4/m4private.h (m4__push_symbol): Add parameter.
1734 (m4_arg_scratch): Add fast accessor.
1735 (struct m4): Add expansion_level member, taken...
1736 * m4/macro.c (expansion_level): ...from here. Adjust all users.
1737 (expand_argument): Minor cleanup.
1738 (expand_macro): Track scratch space per macro call.
1739 (m4_arg_scratch): New function.
1740 (m4_make_argv_ref): Call new function.
1741 (m4_push_arg): Push reference to $0.
1742 (m4_push_args): Rework separator usage, since separators will
1744 (process_macro): Allow embedded NUL.
1745 * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
1746 (m4__push_symbol): Add parameter. Inline short strings, and save
1747 references through rescanning.
1748 * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
1749 * modules/m4.c (errprint, index): Handle NUL transparently.
1750 (dumpdef, translit): Use scratch space, rather than expansion
1752 * modules/gnu.c (renamesyms, m4symbols): Likewise.
1753 * tests/others.at (nul character): New test.
1754 (iso8859): Quote absolute file name, remove XFAIL.
1755 * tests/iso8859.m4: Avoid raw NUL in output.
1756 * tests/null.m4: New file.
1757 * tests/null.out: Likewise.
1758 * tests/null.err: Likewise.
1759 * Makefile.am (OTHER_FILES): Distribute new files.
1760 * .gitattributes: Treat new files as text.
1762 2007-12-17 Eric Blake <ebb9@byu.net>
1764 Stage 8: extend life of references into argv.
1765 Add hooks to lengthen the lifetime of arguments reused in a macro
1766 expansion, rather than always discarding arguments at the end of
1767 expand_macro. Rework the expand_macro obstacks to handle longer
1768 lifetimes. For now, the hooks remain unused.
1769 Memory impact: slight penalty, due to larger structs.
1770 Speed impact: slight penalty, due to more bookkeeping.
1771 * m4/system_.h (obstack_regrow): Delete.
1772 * m4/m4private.h (struct m4_symbol_chain): Add level field.
1773 (m4__push_symbol): Adjust prototype.
1774 (m4__adjust_refcount): New prototype.
1775 (DEBUG_MACRO) [DEBUG]: New debug control.
1776 (struct m4__macro_arg_stacks): New structure.
1777 (struct m4): Add arg_stacks, stacks_count fields.
1778 * m4/m4module.h (m4_make_argv_ref): Add parameter.
1779 * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
1780 context->arg_stacks.
1781 (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
1782 conditional on M4_DEBUG_MACRO envvar.
1783 (collect_arguments): Adjust signature.
1784 (expand_macro): Rework obstack handling.
1785 (m4__adjust_refcount, arg_mark): New functions.
1786 (m4_make_argv_ref): Populate new field.
1787 (m4_push_arg, m4_push_args): Track inuse.
1788 (process_macro): One less cast.
1789 * m4/m4.c (m4_delete): Clean up arg_stacks.
1790 * m4/input.c (make_text_link): Use new field.
1791 (m4__push_symbol, file_clean): Update signature.
1792 (composite_read): Bump refcount when done with reference.
1793 (composite_clean): New function.
1794 (pop_input): Adjust caller.
1795 * m4/debug.c (m4_debug_message): Make assertion match comment.
1796 * modules/gnu.c (builtin, indir): Adjust callers.
1797 * tests/builtins.at (ifelse): New test.
1798 (exp): Move and rename...
1799 * tests/others.at (countdown): ...to this.
1800 * doc/m4.texinfo (Improved foreach): Fix tracing usage in
1803 2007-12-13 Eric Blake <ebb9@byu.net>
1806 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
1811 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1813 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
1815 Reported by Giovanni Toffetti.
1817 2007-12-11 Eric Blake <ebb9@byu.net>
1819 Stage 7: use chained input support in input parser.
1820 Allow the LIFO input engine to rescan a macro expansion composed
1821 of smaller chunks of FIFO data, rather than the old approach of a
1822 monolithic string. For now, all chunks are still copied.
1823 Memory impact: slight penalty, due to FIFO chain overhead.
1824 Speed impact: slight penalty, due to extra bookkeeping.
1825 * m4/m4private.h (m4__push_symbol): New prototype.
1826 (struct m4_symbol_chain): Add const-safety.
1827 * m4/symtab.c (m4_symbol_value_print): Simplify.
1828 (dump_symbol_CB): Update caller.
1829 * m4/input.c (struct m4_input_block): Alter u_c member, first
1830 introduced 2006-10-25, but unused until now.
1831 (composite_peek, composite_read, composite_unget)
1832 (composite_print, init_builtin_token): Rewrite accordingly.
1833 (m4_push_wrapup): No longer need trailing NUL.
1834 (m4__push_symbol, make_text_link): New functions.
1835 (m4_push_string_finish): Use them.
1836 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1837 (expand_macro): Simplify logic of nesting_limit.
1838 * src/main.c (main): Likewise.
1839 * doc/m4.texinfo (Dumpdef): Augment test.
1841 2007-12-08 Eric Blake <ebb9@byu.net>
1843 Stage 6: convert builtins to push arg at a time.
1844 Add new methods to factor all builtins whose expansion includes an
1845 argument, making back-reference creation easier in future patches.
1846 Factor out length-limited printing to obstacks, and use -1 rather
1847 than 0 for unlimited length.
1848 Memory impact: none.
1849 Speed impact: slight improvement, due to better code sharing.
1850 * m4/m4module.h (m4_shipout_text): Rename...
1851 (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
1852 that does not worry about sync lines.
1853 (m4_shipout_string_trunc): New prototype.
1854 * m4/output.c (m4_shipout_text): Rename...
1855 (m4_divert_text): ...to this.
1856 (m4_shipout_string): Move guts...
1857 (m4_shipout_string_trunc): ...to this new function.
1858 * m4/macro.c (m4_push_arg, m4_push_args): New functions.
1859 (expand_token, process_macro): Update callers.
1860 * m4/input.c (string_print): Likewise.
1861 * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
1863 * modules/gnu.c (patsubst): Likewise.
1864 (debuglen): Use SIZE_MAX for unlimited debug length.
1865 * src/main.c (main): Likewise.
1866 * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
1869 2007-12-07 Eric Blake <ebb9@byu.net>
1871 Minor security fix: Quote output of mkstemp.
1872 * modules/m4.c (m4_make_temp): Produce quoted output.
1873 * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
1876 Stage 5: add notion of quote age.
1877 Cache the quoting rules that were in effect when a string was
1878 parsed, to avoid reparsing that string if no changequote or other
1879 quote age change took place in the meantime. A quote_age of 0 is
1880 always safe, but does not benefit from caching.
1881 Memory impact: slight improvement, due to smaller struct in input
1883 Speed impact: slight penalty, due to more bookkeeping.
1884 * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
1885 (m4_set_symbol_value_text): Adjust prototype.
1886 (m4_has_syntax): Factor out the unsigned char cast.
1887 * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
1889 (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
1890 functions at this point.
1891 (struct m4_symbol_value, struct m4_macro_args): Add quote_age
1893 (m4_set_symbol_value_text): Adjust fast accessor.
1894 (m4_get_symbol_value_quote_age): New fast accessor.
1895 * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
1896 (m4_get_symbol_value_quote_age): New function.
1897 (m4_symbol_value_copy): Adjust callers.
1898 * m4/macro.c (expand_token): Add parameter, and track quote age.
1899 (expand_argument, collect_arguments): Track quote age.
1900 (m4_macro_expand_input, process_macro, m4_make_argv_ref)
1901 (m4_macro_expand_input): Update callers.
1902 (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
1903 * m4/input.c: Comment cleanups.
1904 (struct m4_input_block): Reduce size.
1905 (m4__next_token): Report quote age.
1906 (m4_push_builtin, init_builtin_token): Update callers.
1907 * m4/utility.c (skip_space): Adjust callers.
1908 * m4/module.c (install_macro_table): Likewise.
1909 * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
1910 (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
1912 (set_quote_age): New helper function.
1913 (check_is_single_quotes, check_is_single_comments): Adjust
1915 * src/freeze.c (reload_frozen_state): Likewise.
1916 * src/main.c (main): Likewise.
1917 * modules/m4.c (define, pushdef): No need to set macro text.
1918 * tests/builtins.at (changequote, defn): New tests.
1919 * examples/wrapfifo.m4: New file.
1920 * examples/wraplifo.m4: New file.
1921 * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
1923 2007-12-04 Eric Blake <ebb9@byu.net>
1925 Fix builds with OpenBSD make.
1926 * Makefile.am (HELP2MAN): New macro.
1927 (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
1929 * README: Update copyright.
1930 * HACKING: Mention help2man and makeinfo dependencies.
1932 2007-11-29 Eric Blake <ebb9@byu.net>
1934 Stage 4: route indir, builtin through ref; make argv opaque.
1935 Finish making struct opaque to all but the input engine, by
1936 reworking obstack usage in expand_macro to better support creation
1937 of a $@ reference. Canonicalize the empty argument, to allow
1938 pointer comparison optimizations.
1939 Memory impact: slight penalty, due to larger struct.
1940 Speed impact: slight improvement, due to fewer function calls.
1941 * m4/system_.h (obstack_regrow): Fix precedence.
1942 * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
1944 (struct m4_macro_args): Move...
1945 * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
1946 to modules. Add has_ref member.
1947 (bool_bitfield): New helper typedef.
1948 (struct m4_symbol_chain): Add flatten and len members.
1949 * m4/macro.c (empty_symbol): New placeholder, for optimizing
1950 comparison with empty string.
1951 (m4_macro_expand_input): Initialize it.
1952 (collect_arguments): Alter signature, and populate new fields.
1953 (trace_pre, trace_post): Remove redundant parameter.
1954 (expand_macro): Alter handling of obstacks.
1955 (m4_arg_symbol): Account for wrapped argv.
1956 (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
1957 (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
1958 * modules/m4.c (ifelse, syscmd): Likewise.
1959 * modules/evalparse.c (m4_evaluate): Likewise.
1960 (undefine, popdef, m4_dump_symbols): Optimize.
1961 * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
1963 (changesyntax, regexp): Optimize.
1964 * m4/output.c (diversion_storage): Use typedef.
1966 Stage 3b: cache length, rather than computing it, in modules.
1967 Use cached token length in builtins and output engine.
1968 Memory impact: none.
1969 Speed impact: noticeable improvement, due to fewer function calls.
1970 * m4/hash.c (m4_hash_remove): Avoid double free on remove
1972 * m4/output.c (m4_shipout_string): Change semantics of len param.
1973 (m4_shipout_int): Use cached length.
1974 * m4/input.c (m4_push_string_finish): Likewise.
1975 * modules/m4.h (m4_make_temp_func): Add parameter.
1976 * m4/macro.c (expand_token, m4_arg_len): Use cached length.
1977 (collect_arguments, expand_macro): Alter signature.
1978 (trace_format): Don't use out-of-scope buffer.
1979 (process_macro): All callers changed.
1980 * m4/utility.c (m4_dump_args): Likewise.
1981 * m4/symtab.c (m4_symbol_value_print): Likewise.
1982 * modules/gnu.c (__file__, __program__, builtin, indir)
1983 (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
1984 renamesyms, patsubst, regexp, regexp_compile): Likewise.
1985 * modules/load.c (m4modules): Likewise.
1986 * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
1987 (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
1988 * modules/perl.c (perleval): Likewise.
1989 * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
1990 (hostname, uname, setenv): Likewise.
1991 * modules/mpeval.c (numb_obstack): Likewise.
1992 * src/freeze.c (dump_symbol_CB): Likewise.
1993 * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
1994 * tests/builtins.at (mkstemp): Likewise.
1995 * tests/others.at (iso8859): XFAIL this test, now that
1996 length-based handling allows NUL through part but not all of M4.
1998 2007-11-28 Eric Blake <ebb9@byu.net>
2000 Stage 3a: cache length, rather than computing it, in libm4.
2001 Cache the length of a token in the input engine and symbol table,
2002 to avoid repeating lots of strlen calls. Additionally, by using
2003 obstack length rather than strlen, the input engine can now
2004 support embedded NUL.
2005 Memory impact: slight penalty, due to larger struct.
2006 Speed impact: slight improvement, due to fewer function calls.
2007 * m4/m4module.h (struct m4_macro_args): Cache length.
2008 (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2009 (m4_set_symbol_value_text): Change signature.
2010 * m4/m4private.h (struct m4_symbol_value): Store string length.
2011 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2012 (m4_set_symbol_value_placeholder): Update accordingly.
2013 (m4_set_symbol_value_text): Change signature.
2014 (m4_get_symbol_value_len): New accessor.
2015 * m4/input.c (struct m4_input_block, string_peek, string_read)
2016 (string_unget, string_print, m4_push_string_finish)
2017 (m4_push_wrapup): Track length of string input.
2018 (m4__next_token): Adjust all users of symbol text to track length,
2020 * m4/macro.c (expand_argument, collect_arguments): Likewise.
2021 * m4/module.c (install_macro_table): Likewise.
2022 * modules/gnu.c (builtin, indir): Likewise.
2023 * modules/m4.c (define, pushdef): Likewise.
2024 * src/main.c (main): Likewise.
2025 * src/freeze.c (reload_frozen_state): Likewise.
2026 * m4/symtab.c (m4_symbol_value_copy): Likewise.
2027 (m4_get_symbol_value_len): New function.
2028 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2029 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2030 Adjust implementation.
2032 2007-11-27 Eric Blake <ebb9@byu.net>
2034 Stage 2: use accessors, not direct reference, into argv.
2035 Outside of macro.c, use accessor methods rather than direct access
2036 into the argv struct.
2037 Memory impact: none.
2038 Speed impact: slight penalty, due to increased function calls.
2039 * m4/m4private.h (m4_arg_argc): New fast accessor.
2040 * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2041 (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2043 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2044 (m4_macro_call): Make argc unsigned.
2045 (M4ARG): Use new accessors.
2046 * modules/m4.c (define, pushdef): Likewise.
2047 (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2048 (traceon, traceoff): Make argc unsigned.
2049 * modules/m4.h (m4_dump_symbols_func): Likewise.
2050 * modules/evalparse.c (m4_evaluate): Likewise.
2051 * modules/gnu.c (builtin, indir): Use new accessors.
2052 (changesyntax): Make argc unsigned.
2053 * modules/perl.c (perleval): Likewise.
2054 * m4/utility.c (m4_dump_args): Use new accessors.
2055 * m4/macro.c (trace_pre): Likewise.
2056 (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2057 (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2058 (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2061 2007-11-24 Eric Blake <ebb9@byu.net>
2063 Stage 1: convert m4_symbol_value** into new object.
2064 Pass a variable-size wrapper structure instead of an array to
2065 builtins, so that subsequent optimizations in the structure need
2066 not impact every builtin client.
2067 Memory impact: slight penalty, since struct is larger than array.
2068 Speed impact: slight penalty, due to increased bookkeeping.
2069 * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2070 * m4/m4module.h (m4_macro_args): New type, will be opaque to
2072 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2073 (m4_macro_call): Alter signature to use m4_macro_args object.
2074 (M4ARG): Redefine to access new struct.
2075 * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2076 (struct m4_symbol_chain): New type.
2077 (struct m4_symbol_value): Add chain alternative.
2078 * m4/macro.c (collect_arguments): Build new struct.
2079 (expand_macro, m4_macro_call, process_macro, trace_pre)
2080 (trace_post): Adjust implementation to use it.
2081 * m4/utility.c (m4_dump_args): Likewise.
2082 * modules/gnu.c (builtin, indir): Likewise.
2083 * modules/format.c (format): Likewise.
2084 * modules/m4.h (m4_dump_symbols_func): Likewise.
2085 * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2086 (shift, include, errprint, m4wrap): Likewise.
2087 * modules/evalparse.c (m4_evaluate): Likewise.
2089 Pass only macro name to utility functions.
2090 * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2091 * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2093 * m4/macro.c (m4_macro_call): Adjust callers.
2094 * modules/gnu.c (builtin, debuglen): Likewise.
2095 * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2097 * modules/evalparse.c (m4_evaluate): Likewise.
2098 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2099 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2102 2007-11-23 Eric Blake <ebb9@byu.net>
2104 Add macro name to debugfile messages.
2105 * m4/m4module.h (m4_debug_set_output): Add parameter.
2106 * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2108 * modules/gnu.c (debugfile): Adjust caller.
2109 * modules/m4.c (m4exit): Likewise.
2110 * src/main.c (main): Likewise.
2112 Factor out handling of macro name in error messages.
2113 * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2114 (m4_warn_at_line): Add new parameter.
2115 * m4/utility.c (m4_verror_at_line): New helper method.
2116 (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2118 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2120 * m4/debug.c: Likewise.
2121 * m4/input.c: Likewise.
2122 * m4/macro.c: Likewise.
2123 * m4/module.c: Likewise.
2124 * m4/output.c: Likewise.
2125 * m4/path.c: Likewise.
2126 * modules/evalparse.c: Likewise.
2127 * modules/format.c: Likewise.
2128 * modules/gnu.c: Likewise.
2129 * modules/load.c: Likewise.
2130 * modules/m4.c: Likewise.
2131 * modules/mpeval.c: Likewise.
2132 * src/freeze.c: Likewise.
2133 * src/main.c: Likewise.
2135 2007-11-14 Eric Blake <ebb9@byu.net>
2137 Handle some defn corner cases differently.
2138 * doc/m4.texinfo (Defn): Update documentation; although this still
2139 doesn't match the branch, since it may be changed before 2.0.
2140 * m4/macro.c (expand_argument): Consistently ignore builtins in
2141 concatenation contexts.
2142 * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2144 2007-11-13 Eric Blake <ebb9@byu.net>
2146 Note: Patches titled Stage 0 through N form a series of patches
2147 which decreases the algorithmic complexity of tail recursion in
2148 macro expansions from O(n^2) to O(n) in both time and memory, then
2149 performs cleanups, such as handling of embedded NUL, made easier
2150 by the code refactoring.
2152 Stage 0: Fix memory leak in tail recursion.
2153 Free expansion text in the input engine as soon as it is parsed,
2154 rather than when the recursive expansion completes.
2155 Memory impact: noticeable improvement, due to reduction from
2156 O(n^2) to O(n) on recursion.
2157 Speed impact: minor improvement, due to better memory usage.
2158 * m4/input.c (pop_input): Add flag parameter and return type.
2159 (next_char): Adjust caller.
2160 (m4_push_string_init): Let go of memory earlier.
2162 2007-11-07 Eric Blake <ebb9@byu.net>
2164 * tests/macros.at (Rescanning macros): Test more corner cases.
2166 2007-11-06 Eric Blake <ebb9@byu.net>
2168 * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2170 * Makefile.am (tests/package.m4): Work around bash bug.
2171 Reported by Ralf Wildenhues.
2173 2007-11-05 Eric Blake <ebb9@byu.net>
2175 For consistency with other GNU projects, use build-aux directory.
2176 * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2178 * bootstrap (config_aux_dir): Likewise.
2179 * Makefile.am (config_aux_dir): Likewise.
2180 * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2182 2007-11-02 Eric Blake <ebb9@byu.net>
2184 Update some documentation about version control.
2185 * NEWS: M4 is now stored in git.
2186 * HACKING: Likewise.
2188 * bootstrap: Likewise.
2189 * commit: Delete, now that CVS commits are no longer necessary.
2190 * ltdl/config/mailnotify: No longer necessary; git's patch
2191 generation and mail capability is more powerful.
2193 Update to recent gnulib changes.
2194 * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2195 xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2197 2007-11-01 Eric Blake <ebb9@byu.net>
2199 Improve error message when early end of file occurs.
2200 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2201 (M4wrap): Adjust to new messages.
2202 (Improved capitalize): Enhance test.
2203 * m4/m4private.h (m4__next_token): Adjust prototype.
2204 * m4/input.c (m4__next_token): Add new parameter, and improve
2206 * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2208 (expand_argument): Likewise, and add parameter.
2210 2007-10-31 Eric Blake <ebb9@byu.net>
2212 Test more corner cases.
2213 * tests/macros.at (Rescanning macros): Beef up test.
2214 * doc/m4.texinfo (Changecom): Beef up test.
2215 (Improved foreach): Document alternate foreachq style.
2216 * examples/foreachq3.m4: New file.
2217 * examples/loop.m4: New file.
2218 * Makefile.am (dist_pkgdata_DATA): Distribute them.
2220 2007-10-28 Eric Blake <ebb9@byu.net>
2222 More test coverage for autoconf usage patterns.
2223 * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2224 * tests/macros.at (Rescanning macros): New test.
2225 * tests/builtins.at (include): Augment test.
2227 2007-10-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2229 * Makefile.am: Adjust getopt handling to latest gnulib layout.
2231 2007-10-27 Eric Blake <ebb9@byu.net>
2233 Document one use of changequote(`(',`)').
2234 * doc/m4.texinfo (Changequote): Add new test, based on recent
2235 autoconf addition of m4_expand.
2237 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2239 * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2241 2007-10-22 Eric Blake <ebb9@byu.net>
2243 Never let printf failures go undetected.
2244 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2246 * m4/system_.h: Include xprintf.h.
2247 * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2248 use of printf, xprintf.
2249 * m4/input.c [DEBUG_INPUT]: Likewise.
2250 * m4/module.c [DEBUG_MODULES]: Likewise.
2251 * m4/output.c (m4_shipout_text, m4_shipout_int)
2252 (m4_freeze_diversions): Likewise.
2253 * m4/path.c [DEBUG_INCL]: Likewise.
2254 * m4/symtab.c [DEBUG_SYM]: Likewise.
2255 * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2256 * modules/modtest.c (export_test): Likewise.
2257 * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2258 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2260 * src/main.c (usage): Likewise.
2261 * po/POTFILES.in: Adjust to new file.
2262 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2264 2007-10-18 Eric Blake <ebb9@byu.net>
2266 Fix 'm4 -F file -t undefined'.
2267 * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
2268 * src/freeze.c (dump_symbol_CB): Also skip void symbols.
2269 * tests/freeze.at (reloading unknown builtin): Test for this bug.
2270 * m4/m4module.h (m4_symtab_apply): Add parameter.
2271 * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
2273 (m4_symtab_delete, symtab_dump): Adjust callers.
2274 * modules/m4.c (m4_dump_symbols): Likewise.
2276 2007-10-09 Eric Blake <ebb9@byu.net>
2278 Fix regexp regression of 2007-09-29.
2279 * modules/gnu.c (substitute): Allow NULL buf when no
2280 subexpressions were present.
2281 (regexp): Handle \ escapes even with empty regex.
2282 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
2284 Cache regex compilation for another autoconf speedup.
2285 * modules/gnu.c (gnu_buf): Replace...
2286 (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
2287 (m4_pattern_buffer): Add fields.
2288 (m4_regexp_compile): Rename...
2289 (regexp_compile): ...to this, and drop no_sub parameter.
2291 (M4FINISH_HANDLER): Clean up entire cache.
2292 (m4_regexp_search): Rename...
2293 (regex_search): ...to this, adjust to new struct contents, and add
2295 (m4_regexp_substitute): Rename...
2296 (regexp_substitute): ...to this.
2297 (substitute, patsubst, regexp, renamesyms): Adjust callers.
2299 2007-10-02 Eric Blake <ebb9@byu.net>
2301 Document quoting pitfalls in capitalize.
2302 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
2304 (Improved capitalize): New node.
2305 * examples/capitalize.m4: Update to match manual.
2306 * examples/capitalize2.m4: New file.
2308 2007-10-01 Eric Blake <ebb9@byu.net>
2310 Another Autoconf usage pattern optimization.
2311 * modules/m4.c (m4_index): Optimize search for one byte.
2312 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
2315 2007-09-29 Eric Blake <ebb9@byu.net>
2317 Optimize for Autoconf usage pattern.
2318 * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
2320 * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
2322 2007-09-24 Eric Blake <ebb9@byu.net>
2324 Create .gitignore alongside .cvsignore.
2325 * bootstrap (version control): Update to reflect git usage.
2327 2007-09-13 Eric Blake <ebb9@byu.net>
2329 * AUTHORS: Fix typo.
2331 2007-09-12 Gary V. Vaughan <gary@gnu.org>
2333 Be consistent about using 'module' for m4_module types and
2334 'handle' for lt_dlhandle types:
2336 * m4/m4private.h (m4_symbol_value): Rename handle element to
2337 method. Changed all references.
2338 (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
2339 SYMBOL_HANDLE respectively. Changed all references.
2340 * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
2341 * m4/builtin.c (m4_builtin_find_by_name)
2342 (m4_builtin_find_by_func): Use module as the parameter name for
2343 pointers of type 'm4_module'.
2344 * m4/module.c (module_remove, m4_get_module_name)
2345 (install_builtin_table, install_macro_table)
2346 (m4_module_make_resident, m4__module_next, m4_module_refcount):
2348 * src/freeze.c (produce_module_dump): Ditto.
2349 * m4/input.c (m4_input_block): Rename handle element to method.
2350 Changed all references.
2351 * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
2352 * modules/load.c: Use module as the variable name for pointers
2353 of type 'm4_module'.
2354 * modules/m4.c: Ditto.
2355 * modules/perl.c: Ditto.
2356 * modules/shadow.c: Ditto.
2358 2007-09-07 Eric Blake <ebb9@byu.net>
2360 Add refcount builtin.
2361 * modules/load.c (refcount): New builtin.
2362 (m4modules): Use correct type.
2363 * doc/m4.texinfo (Refcount): New section.
2364 * m4/m4private.h (struct m4_module): Add refcount member.
2365 (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
2366 * m4/module.c (m4_module_load): Add symbols to table on first
2367 load by m4, regardless of other libltdl loads of same module.
2368 (m4_module_refcount): Use new struct member, rather than relying
2369 on libltdl count which might be inflated by unrelated loads.
2370 (m4__module_interface): Optimize.
2371 (m4__module_next, m4__module_find): Avoid assertions that could
2372 trigger with unrelated libltdl loads.
2373 (m4__module_open): Track m4 load count.
2374 (m4__module_exit): Only unload what m4 loaded.
2375 (module_remove): Track m4 unloads.
2376 * NEWS: Document new builtin.
2378 More conversion to m4_module*.
2379 * src/freeze.c (produce_module_dump, dump_symbol_CB)
2380 (reload_frozen_state): Use correct type.
2381 * m4/input.c (struct m4_input_block): Likewise.
2382 * m4/symtab.c (dump_symbol_CB): Likewise.
2384 * AUTHORS: Simplify, to match libtool and autoconf layout.
2385 * THANKS: Sync with branch.
2387 2007-09-06 Eric Blake <ebb9@byu.net>
2389 Wrap lt_dlhandle in struct m4_module.
2390 * m4/m4module.h (includes): No longer require clients to know
2392 (m4_module): New opaque declaration.
2393 (m4_export): Delete unused type.
2394 (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
2395 (m4_module_finish_func, m4_module_load, m4_get_module_name)
2396 (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
2398 (m4_module_makeresident, m4_module_refcount): New declarations.
2399 * m4/m4private.h (includes): Move <ltdl.h> here.
2400 (m4_module): New declaration. Simple for now, but intended for
2402 (m4__module_open, m4__module_next, m4__module_find)
2403 (m4__symtab_remove_module_references): Use new wrapper.
2404 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2406 * m4/module.c (m4_get_module_name, m4_module_import)
2407 (m4_module_load): Likewise.
2408 (install_builtin_table, install_macro_table): Likewise. Also,
2409 change return type since these always returned NULL and no one
2411 (m4_module_makeresident, m4_module_refcount): New functions.
2412 (m4_module_unload, m4__module_next, m4__module_find): Use new
2414 (m4__module_open): Populate new wrapper, and associate it with the
2416 (m4__module_exit): Use new wrapper.
2417 (module_remove): Likewise. Reclaim storage on last use.
2418 (module_close): Delete, and inline into module_remove.
2419 * m4/symtab.c (m4__symtab_remove_module_references): Use new
2421 * modules/load.c (load_init): Use new API.
2422 * modules/m4.c (m4_export_table): Kill unused declaration.
2423 (m4_init): Use new API.
2424 * modules/shadow.c (shadow_init): Use new API.
2425 * src/main.c (main): Adjust callers.
2426 * src/freeze.c (reload_frozen_state): Likewise.
2427 * tests/modules.at (unload load module): New test.
2429 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2431 * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
2432 * src/m4/.cvsignore: Add xstrtol module sources.
2434 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2436 Work around a bug in darwin's awk:
2438 * bootstrap (func_get_translations): Use $AWK instead of raw
2439 `awk' so that the user can use an alternative implementation
2440 if the first awk in PATH doesn't behave as expected.
2441 (func_get_translations): The first awk script mangles the last
2442 entry passed to it for at least the awk implementation shipped
2443 with Darwin 8.10.1. Capture $3 into a variable too to work-
2444 around that problem.
2446 2007-08-29 Gary V. Vaughan <gary@gnu.org>
2448 As gnulib xstrtol is only used by main, and unconditionally pulls
2449 in a copy of getopt, undo bootstrap change from 2007-08-11 below,
2450 and copy the xstrtol code into src/ so that main() can use it
2451 without pushing the extra code into libm4:
2453 * bootstrap (src_modules): Add getopt and xstrtol modules.
2454 * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
2455 * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
2457 2007-08-11 Eric Blake <ebb9@byu.net>
2459 Another upstream xstrtol change.
2460 * po/POTFILES.in: Track changes in files containing messages.
2461 * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
2462 need to grab it separately.
2463 * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2465 (size_opt): Adjust to latest xstrtol interface.
2467 2007-08-10 Eric Blake <ebb9@byu.net>
2469 Documentation improvements.
2470 * doc/m4.texinfo (Defn): Resync with branch.
2471 (Compatibility, Extensions): Sync with branch.
2473 2007-08-07 Eric Blake <ebb9@byu.net>
2475 Adjust to gnulib xstrtol changes.
2476 * src/main.c (size_opt): Adjust signature, so that error strings
2477 are easier to translate.
2478 (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
2479 for tracking long options.
2480 (main): Track which long option was used.
2481 * tests/options.at (--debuglen, --nesting-limit): Adjust to change
2483 (deprecated options): Test that --arglength spelling shows up in
2486 2007-08-06 Eric Blake <ebb9@byu.net>
2488 Normalize all GPL license notices.
2489 * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
2491 * Makefile.am: Update license wording.
2492 * bootstrap: Likewise.
2494 * configure.ac: Likewise.
2495 * ltdl/config/mailnotify: Likewise.
2496 * ltdl/config/mkstamp: Likewise.
2497 * ltdl/m4/debug.m4: Likewise.
2498 * ltdl/m4/gmp.m4: Likewise.
2499 * ltdl/m4/m4-error.m4: Likewise.
2500 * ltdl/m4/m4-getopt.m4: Likewise.
2501 * ltdl/m4/m4-gettext.m4: Likewise.
2502 * ltdl/m4/m4-obstack.m4: Likewise.
2503 * ltdl/m4/m4-regex.m4: Likewise.
2504 * ltdl/m4/stackovf.m4: Likewise.
2505 * m4/builtin.c: Likewise.
2506 * m4/debug.c: Likewise.
2507 * m4/hash.c: Likewise.
2508 * m4/hash.h: Likewise.
2509 * m4/input.c: Likewise.
2510 * m4/m4.c: Likewise.
2511 * m4/m4module.h: Likewise.
2512 * m4/m4private.h: Likewise.
2513 * m4/macro.c: Likewise.
2514 * m4/module.c: Likewise.
2515 * m4/output.c: Likewise.
2516 * m4/path.c: Likewise.
2517 * m4/resyntax.c: Likewise.
2518 * m4/symtab.c: Likewise.
2519 * m4/syntax.c: Likewise.
2520 * m4/system_.h: Likewise.
2521 * m4/utility.c: Likewise.
2522 * modules/evalparse.c: Likewise.
2523 * modules/format.c: Likewise.
2524 * modules/gnu.c: Likewise.
2525 * modules/import.c: Likewise.
2526 * modules/load.c: Likewise.
2527 * modules/m4.c: Likewise.
2528 * modules/m4.h: Likewise.
2529 * modules/modtest.c: Likewise.
2530 * modules/mpeval.c: Likewise.
2531 * modules/perl.c: Likewise.
2532 * modules/shadow.c: Likewise.
2533 * modules/stdlib.c: Likewise.
2534 * modules/time.c: Likewise.
2535 * modules/traditional.c: Likewise.
2536 * po/Makevars: Likewise.
2537 * src/freeze.c: Likewise.
2538 * src/m4.h: Likewise.
2539 * src/main.c: Likewise.
2540 * src/stackovf.c: Likewise.
2541 * tests/builtins.at: Likewise.
2542 * tests/freeze.at: Likewise.
2543 * tests/generate.awk: Likewise.
2544 * tests/m4.in: Likewise.
2545 * tests/macros.at: Likewise.
2546 * tests/modules.at: Likewise.
2547 * tests/options.at: Likewise.
2548 * tests/others.at: Likewise.
2549 * tests/stackovf.test: Likewise.
2550 * tests/testsuite.at: Likewise.
2552 2007-07-22 Eric Blake <ebb9@byu.net>
2554 Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2555 * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2556 * tests/builtins.at (divert): Enhance test to cover this.
2558 Reported by Thomas Klausner.
2560 2007-07-20 Eric Blake <ebb9@byu.net>
2562 Fix 'make distcheck' issues.
2563 * bootstrap: Add more files that might be more up-to-date in
2565 * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2566 * config/m4/gnulib-cache.m4: Update to latest gnulib.
2568 2007-07-16 Eric Blake <ebb9@byu.net>
2570 * po/POTFILES.in: Track recent translation additions from gnulib
2573 2007-07-14 Eric Blake <ebb9@byu.net>
2575 Reflect upstream license .texi changes.
2576 * doc/m4.texinfo (Copying): Rename node...
2577 (GNU General Public License): ...to this.
2578 (GNU Free Documentation License): Adjust node location.
2579 * local/doc/gpl-3.0.texi.diff: Remove file.
2581 2007-07-10 Eric Blake <ebb9@byu.net>
2583 Upgrade to GPLv3, and document 1.4.10.
2584 * bootstrap: Adjust to GPLv3.
2585 (func_update): Port from branch.
2586 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2587 --local-dir=local --import gpl-3.0'.
2588 * doc/m4.texinfo (History): Mention 1.4.11.
2589 (Copying This Package): New appendix.
2590 * NEWS: Document 1.4.10.
2591 * local/doc/gpl-3.0.texi.diff: New file.
2592 * Makefile.am: Update license.
2593 (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
2594 * commit: Update license.
2595 * configure.ac: Likewise.
2596 * ltdl/config/mailnotify: Likewise.
2597 * ltdl/config/mkstamp: Likewise.
2598 * ltdl/m4/debug.m4: Likewise.
2599 * ltdl/m4/gmp.m4: Likewise.
2600 * ltdl/m4/m4-error.m4: Likewise.
2601 * ltdl/m4/m4-getopt.m4: Likewise.
2602 * ltdl/m4/m4-gettext.m4: Likewise.
2603 * ltdl/m4/m4-obstack.m4: Likewise.
2604 * ltdl/m4/m4-regex.m4: Likewise.
2605 * ltdl/m4/stackovf.m4: Likewise.
2606 * m4/builtin.c: Likewise.
2607 * m4/debug.c: Likewise.
2608 * m4/hash.c: Likewise.
2609 * m4/hash.h: Likewise.
2610 * m4/input.c: Likewise.
2611 * m4/m4.c: Likewise.
2612 * m4/m4module.h: Likewise.
2613 * m4/m4private.h: Likewise.
2614 * m4/macro.c: Likewise.
2615 * m4/module.c: Likewise.
2616 * m4/output.c: Likewise.
2617 * m4/path.c: Likewise.
2618 * m4/resyntax.c: Likewise.
2619 * m4/symtab.c: Likewise.
2620 * m4/syntax.c: Likewise.
2621 * m4/system_.h: Likewise.
2622 * m4/utility.c: Likewise.
2623 * modules/evalparse.c: Likewise.
2624 * modules/format.c: Likewise.
2625 * modules/gnu.c: Likewise.
2626 * modules/import.c: Likewise.
2627 * modules/load.c: Likewise.
2628 * modules/m4.c: Likewise.
2629 * modules/m4.h: Likewise.
2630 * modules/modtest.c: Likewise.
2631 * modules/mpeval.c: Likewise.
2632 * modules/perl.c: Likewise.
2633 * modules/shadow.c: Likewise.
2634 * modules/stdlib.c: Likewise.
2635 * modules/time.c: Likewise.
2636 * modules/traditional.c: Likewise.
2637 * po/Makevars: Likewise.
2638 * src/freeze.c: Likewise.
2639 * src/m4.h: Likewise.
2640 * src/main.c: Likewise.
2641 * src/stackovf.c: Likewise.
2642 * tests/builtins.at: Likewise.
2643 * tests/freeze.at: Likewise.
2644 * tests/generate.awk: Likewise.
2645 * tests/m4.in: Likewise.
2646 * tests/macros.at: Likewise.
2647 * tests/modules.at: Likewise.
2648 * tests/options.at: Likewise.
2649 * tests/others.at: Likewise.
2650 * tests/stackovf.test: Likewise.
2651 * tests/testsuite.at: Likewise.
2653 2007-07-09 Eric Blake <ebb9@byu.net>
2655 * modules/format.c (format): Avoid undefined behavior with %c.
2657 2007-07-01 Gary V. Vaughan <gary@gnu.org>
2659 The translation project has moved.
2660 * bootstrap (func_get_translations): Use the new translation
2664 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
2666 Match Free Software Directory categories.
2667 * doc/m4.texinfo (dircategory): Update.
2669 2007-05-31 Eric Blake <ebb9@byu.net>
2671 Add extension to divert builtin.
2672 * modules/m4.c (builtin_divert): Immediately divert second
2674 * m4/output.c (m4_output_text): Allow 0 length. Fixes regression
2676 (m4_shipout_text): Short-circuit on zero length.
2677 * tests/freeze.at (loading format 2): Expand test to catch
2678 regression. Also check out-of-range version.
2679 * tests/builtins.at (divert): Expand test to check corner cases
2681 * doc/m4.texinfo (Divert): Document the extension.
2683 Reported by Daniel Richard G.
2685 2007-05-30 Eric Blake <ebb9@byu.net>
2687 Port format improvements from branch.
2688 * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
2689 (Format): Enhance section.
2690 * modules/format.c (format): Accept %'hhd, and issue warnings on
2691 unrecognized specifiers.
2692 * modules/gnu.c (builtin_format): Adjust how format is called.
2694 2007-05-28 Eric Blake <ebb9@byu.net>
2696 * tests/options.at (--syncoutput): Add xfailed test.
2698 Fix sync line interaction with multiline comments.
2699 * doc/m4.texinfo (Preprocessor features): Improve documentation.
2700 (Syncoutput): Improve testsuite.
2701 (Incompatibilities): Add testcase, and document bug.
2702 * src/freeze.c (reload_frozen_state): Don't interfere with
2703 synclines when reloading state.
2704 * m4/input.c (m4__next_token): Report line where multiline tokens
2706 * m4/m4private.h (m4__token_type): Add parameter.
2707 * m4/m4module.h (m4_output_text): Export.
2708 (m4_shipout_text): Add parameter.
2709 * src/macro.c (m4_macro_expand_input, expand_token)
2710 (expand_argument): Adjust callers so that line is passed from
2712 * m4/output.c (output_text): Rename...
2713 (m4_output_text): ...to this, and export.
2714 (m4_insert_file, insert_diversion_helper): Update callers.
2715 (m4_shipout_text): Take new parameter for start line of token.
2716 Output at most one syncline per token.
2717 Reported by Sergey Poznyakoff.
2719 Fix large diversion corner cases.
2720 * tests/freeze.at (large diversion): New test.
2721 * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
2722 (make_room_for): Use NULL, not 0, for pointers.
2723 (m4_freeze_diversions): Allow freezing large diversions.
2724 (insert_diversion_helper): Avoid using rewind.
2726 Also run gnulib unit tests during make check.
2727 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2728 --tests-base=tests/gnu --with-tests'.
2729 * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
2730 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
2732 2007-05-25 Eric Blake <ebb9@byu.net>
2734 * m4/system_.h: Include <stdint.h>, for intmax_t.
2736 Reported by Daniel Richard G.
2738 2007-05-24 Eric Blake <ebb9@byu.net>
2740 Provide consistent shift semantics regardless of hardware.
2741 * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
2743 (number, unumber): Always use [u]intmax_t.
2744 Reported by Gary V. Vaughan.
2746 Support POSIX flush semantics on all platforms.
2747 * modules/m4.c (m4_sysval_flush): Rely on gnulib.
2748 * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
2750 Work around cygwin and mingw fseeko bugs.
2751 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2753 * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
2755 2007-04-25 Eric Blake <ebb9@byu.net>
2757 Test that regression in 1.4.9's eval doesn't recur.
2758 * doc/m4.texinfo (Eval): Check negative division.
2761 2007-04-12 Eric Blake <ebb9@byu.net>
2763 Allow for running test in sticky or setgid directory.
2764 * tests/builtins.at (mkdtemp): Adjust test.
2766 Don't test for broken sed too soon.
2767 * tests/others.at (stdin seekable): Rearrange subtests.
2769 Work around 'stdin seekable' shortcoming on glibc.
2770 * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
2771 * tests/others.at (stdin closed): Adjust to new output.
2772 * src/main.c (process_file): No need to return anything.
2773 (main): Use close_stdin instead of close_stdout.
2774 Reported by Ralf Wildenhues.
2776 Enable autobuild usage.
2777 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2779 * configure.ac (AB_INIT): Output autobuild information.
2781 2007-04-11 Eric Blake <ebb9@byu.net>
2783 Address testsuite shortcoming in 'stdout full' on glibc.
2784 * tests/others.at (stdout full): Adjust expected output when more
2785 than 1k text is printed to /dev/full.
2786 Reported by Ralf Wildenhues.
2788 2007-04-10 Eric Blake <ebb9@byu.net>
2790 * tests/macros.at (Arity and defn): Fix quoting.
2792 2007-04-09 Eric Blake <ebb9@byu.net>
2794 Address failure of 'seekable stdin' on Mac OS X.
2795 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2798 2007-04-07 Eric Blake <ebb9@byu.net>
2800 Include <config.h> first in all C files, and not in headers.
2801 Fixes regression for --disable-assert builds from 2007-04-02.
2802 * src/m4.h (includes): Don't include config.h here.
2803 * m4/m4private.h (includes): Likewise.
2804 * m4/builtin.c: Include config.h before anything else.
2805 * m4/debug.c: Likewise.
2806 * m4/hash.c: Likewise.
2807 * m4/input.c: Likewise.
2808 * m4/m4.c: Likewise.
2809 * m4/macro.c: Likewise.
2810 * m4/module.c: Likewise.
2811 * m4/symtab.c: Likewise.
2812 * m4/syntax.c: Likewise.
2813 * m4/utility.c: Likewise.
2814 * src/freeze.c: Likewise.
2815 * src/stackovf.c: Likewise.
2817 2007-04-03 Eric Blake <ebb9@byu.net>
2819 * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
2820 SIGFPE on x86 architectures.
2821 Reported by Ralf Wildenhues.
2823 2007-04-02 Eric Blake <ebb9@byu.net>
2825 Fix warnings from last commit.
2826 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2827 fprintf-posix sprintf-posix'.
2828 * m4/macro.c (expand_macro, trace_format): Use correct specifier
2830 (process_macro): Avoid negative array index.
2831 * src/freeze.c (produce_resyntax_dump, produce_module_dump)
2832 (dump_symbol_CB, produce_frozen_state): Use correct specifier for
2835 2007-04-02 Gary V. Vaughan <gary@gnu.org>
2837 Get rid of the last 'differs in signedness' compiler warnings:
2839 * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
2840 a regular 'char *', so variables to store the return address,
2841 and iterate through it should be regular 'char *' too.
2842 * m4/input.c (m4_input_block): The start and current members of
2843 the string part of this union store regular 'char *' types, so
2844 they should be regular 'char *' types too.
2846 2007-04-02 Gary V. Vaughan <gary@gnu.org>
2848 M4 was designed to have a small number of header files defining
2849 the interfaces to several source files each. Keeping this in
2850 mind allows us to tidy things up considerably. Having done this,
2851 it becomes clear that some of the installed headers reference
2852 other headers which are not installed (but that's another patch):
2854 * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
2856 * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
2857 ...to here, so client modules can benefit too.
2858 (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
2859 lowest level to save doing it multiple times elsewhere.
2860 * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
2861 is already included via m4private.h.
2862 * modules/time.c (stdio.h): Ditto.
2863 * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
2864 * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
2865 and <gnu/unistd--.h>,
2866 * m4/m4private.h (m4module.h): Use angle brackets for an installed
2868 * m4/hash.h (system.h): Ditto.
2869 * modules/gnu.c (progname.h): Removed.
2870 * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
2871 * m4/m4private.h (assert.h, errno.h): Already included via
2873 * m4/input.c (ctype.h): Ditto.
2874 * m4/module.c (ltdl.h): Ditto.
2875 * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
2877 * m4/path.c (config.h, stdlib.h): Ditto.
2878 * m4/utility.c (config.h): Ditto.
2879 * modules/evalparse.c (assert.h, ctype.h): Ditto.
2880 * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
2881 * modules/import.c (assert.h): Ditto.
2882 * modules/m4.c (assert.h, errno.h): Ditto.
2883 * modules/modtest.c (assert.h): Ditto.
2884 * modules/stdlib.c (sys/types.h): DittAo.
2885 * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
2887 * src/stackovf.c (assert.h): Ditto.
2888 * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
2889 private interfaces when NDEBUG is defined.
2890 * modules/import.c (m4/m4module.h, m4private.h): Ditto.
2891 * modules/load.c (m4/m4module.h, m4private.h): Ditto.
2892 * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
2893 * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
2894 * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
2895 * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
2896 * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
2897 * modules/time.c (m4/m4module.h, m4private.h): Ditto.
2898 * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
2899 * src/m4.h (locale.h): Moved from here...
2900 * src/main.h: ...to here.
2901 (m4private.h): Already included via m4.h.
2902 * src/stackovf.c (m4private.h): Ditto.
2904 2007-03-28 Gary V. Vaughan <gary@gnu.org>
2906 * Makefile.am (stamp-vcl): Removed.
2907 (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
2909 2007-03-28 Eric Blake <ebb9@byu.net>
2911 * src/main.c (usage): Improve note to TRANSLATORS.
2912 * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
2914 * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
2917 2007-03-24 Eric Blake <ebb9@byu.net>
2919 * m4/output.c (m4_output_init): Update to latest gnulib.
2920 * bootstrap (ltdl/m4/.cvsignore): No longer track generated
2922 * NEWS: Reflect release of 1.4.9.
2925 2007-03-07 Eric Blake <ebb9@byu.net>
2929 Exercise gnulib's new POSIX *printf modules.
2930 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2932 * modules/format.c (format): Support %a and %A.
2933 * doc/m4.texinfo (Format): Test this addition.
2934 * NEWS: Document this addition.
2936 2007-03-03 Eric Blake <ebb9@byu.net>
2938 * m4/input.c (m4__next_token): Fix synclines when in batch mode.
2939 * doc/m4.texinfo (M4exit): Synch another section.
2940 (Syncoutput): Make similar to other sections.
2942 2007-03-01 Eric Blake <ebb9@byu.net>
2944 * doc/m4.texinfo: Improve the indices.
2945 (Concept index): Rearrange to be last.
2946 (Sysval): Merge from branch.
2948 * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
2950 2007-02-28 Eric Blake <ebb9@byu.net>
2952 POSIX XCU ERN 137 was approved.
2953 * modules/mpeval.c (numb_extension): Delete.
2954 * modules/m4.c (numb_extension): Likewise.
2955 * modules/evalparse.c (comma_term, condition_term): Always
2956 implement ?: and , operators.
2957 * m4/symtab.c: Update comment to match reality.
2958 * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
2959 dereferencing context directly when accessor exists.
2960 * src/main.c (usage): Prefer GNU_M4 over EMACS.
2961 (struct macro_definition): Rename...
2962 (struct deferred): ...to match usage. All uses changed.
2963 * doc/m4.texinfo (Eval): Document this change.
2964 (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
2966 (Preprocessor features, Changesyntax): Fix inaccuracies.
2967 * NEWS: Import branch NEWS items for 1.4.x series. Document
2970 POSIX XCU ERN 118 was approved.
2971 * modules/m4.c (define): Kill posixly_correct distinction in
2972 define behavior, since POSIX says GNU behavior complies.
2973 * tests/builtins.at (define): Restore original semantics.
2974 * doc/m4.texinfo (Pushdef): Document portability issues with
2976 (Incompatibilities): Clean up wording of what POSIX requires.
2977 * NEWS: Document this.
2979 2007-02-26 Eric Blake <ebb9@byu.net>
2981 Re-enable clean bootstrap on cygwin.
2982 * Makefile.am (AM_LDFLAGS): For now, export all symbols from
2983 modules, since otherwise we run afoul of current libtool
2984 limitations on cygwin and mingw.
2986 2007-02-25 M. Levinson <levinsm@users.sourceforge.net> (tiny change)
2988 * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
2989 memory. Fixes regression introduced 2007-01-20.
2991 2007-02-25 Eric Blake <ebb9@byu.net>
2993 * tests/freeze.at (loading format 2): Augment test to catch
2994 regression introduced on 2007-01-20.
2996 Reported by M. Levinson.
2998 * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3001 2007-02-05 Eric Blake <ebb9@byu.net>
3003 * tests/options.at (--fatal-warnings): New test.
3004 * tests/others.at (stdin seekable): Exit on error.
3005 * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3006 (m4_get_warnings_exit_opt): Access it.
3007 * m4/m4module.h (m4_context_opt_bit_table): Access it.
3008 * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3010 (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3012 * src/m4.c (usage): Document new -E behavior.
3013 (main): Make -E an additive option.
3014 * doc/m4.texinfo (Operation modes): Document the change.
3015 Reported by Ralf Wildenhues.
3017 * tests/others.at (stdin seekable): Fix bug in test.
3018 * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3020 * m4/input.c (struct m4_input_block): Remove unused field traced.
3022 2007-02-03 Eric Blake <ebb9@byu.net>
3023 and Bruno Haible <bruno@clisp.org> (tiny change)
3025 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3027 Reported by Bruno Haible.
3029 2007-01-31 Eric Blake <ebb9@byu.net>
3031 * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3034 2007-01-26 Eric Blake <ebb9@byu.net>
3036 * m4/symtab.c (includes): Adjust to latest gnulib.
3037 * modules/m4.c (includes): Likewise.
3039 2007-01-23 Eric Blake <ebb9@byu.net>
3041 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3042 extension to make enough room.
3043 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3044 code in input.c special cases this category.
3045 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3046 for define(eleventh,${11}) extension.
3047 * m4/syntax.c: Update comments accordingly.
3048 (m4_syntax_create, m4_syntax_code): Handle { and }.
3049 * m4/input.c (m4__next_token): Likewise.
3050 * src/freeze.c (produce_frozen_state): Support new categories.
3051 (reload_frozen_state): When loading version 1, disable syntax
3052 features not present in 1.4.x.
3053 * tests/freeze.at: Sort and rename existing tests.
3054 (loading format 1): Ensure we don't break v1 frozen files that
3056 (loading format 2, reloading changecom, reloading changesyntax):
3058 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3059 the new syntax categories.
3060 (Arguments): Update the FIXME comment.
3061 (M4wrap): Merge examples from branch, before worrying about fixing
3062 m4wrap to obey POSIX.
3063 (Using frozen files): Start merging from branch.
3066 2007-01-20 Eric Blake <ebb9@byu.net>
3068 * src/freeze.c (produce_char_dump): Delete. Replace with...
3069 (produce_mem_dump): ...this new function, to encode more strings.
3070 Also make the coding easier to read and slightly more compact.
3071 (produce_syntax_dump): Only dump non-default syntax codes.
3072 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3073 Encode non-ASCII characters in user-supplied strings.
3074 (GET_STRING): Accept escape sequences in version 2.
3075 * NEWS: Document this change.
3078 2007-01-16 Eric Blake <ebb9@byu.net>
3080 Port patch from branch for stack overflow detection on BSD/OS.
3081 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3082 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3083 ! HAVE_STACK_T_SS_SP]: Use this check.
3084 Reported by Chris McGuire.
3086 2007-01-15 Eric Blake <ebb9@byu.net>
3088 * tests/builtins.at (__m4_version__): New test.
3089 * modules/traditional.c (m4_macro_table): Provide windows and os2
3090 macros, as appropriate. Add __traditional__ macro.
3091 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3092 not __gmp__, to match module name.
3093 * modules/load.c (m4_macro_table): Name the macro __load__, not
3094 __modules__, to match module name.
3095 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3097 (Standard Modules): Improve wording.
3098 (Incompatibilities): Move platform macros into their own node.
3099 (Load, Unload): Use actual examples.
3100 * NEWS: Document this change.
3103 2007-01-13 Eric Blake <ebb9@byu.net>
3105 * doc/m4.texinfo (Mpeval): Add tests.
3106 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3107 * tests/builtins.at (gmp): ...here. Rename test to...
3109 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3111 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3112 no_gnu_extensions with posixly_correct_opt, since they were set in
3114 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3115 * src/main.c (main): Update caller.
3116 * src/freeze.c (reload_frozen_state): Likewise.
3117 * modules/m4.c (m4wrap): Likewise.
3119 2007-01-12 Eric Blake <ebb9@byu.net>
3121 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3122 POSIX, so update the comment.
3123 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3124 approved by POSIX, so we can always have blind macros, even when
3126 (Ifelse): Mention the term `blind builtin'.
3128 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3130 * doc/m4.texinfo: Fix a couple of typos.
3132 2007-01-08 Eric Blake <ebb9@byu.net>
3134 * ltdl/m4/gnulib-cache.m4: Update for new year.
3135 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3136 Reported by Ralf Wildenhues.
3138 2007-01-06 Eric Blake <ebb9@byu.net>
3140 * m4/m4private.h (to_uchar): Move...
3141 * m4/m4module.h: here, so modules can use it.
3142 * src/main.c (usage, long_options): Support --posix as a synonym
3144 * modules/m4.c (numb_invert): Detect unsupported x**-y.
3145 (numb_incr, numb_urshift, numb_extension): New macros.
3146 (numb_obstack): Port patch from branch to support radix 1 output.
3147 * modules/mpeval.c (numb_obstack): Use \ for ratios.
3148 (numb_incr, numb_urshift, numb_extension): New macros.
3149 (mpq2mpz): Warn rather than error.
3150 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3152 (eval_error): Rearrange, so that all ignorable errors are less
3154 (eval_text, last_text): Obey C++ type safety rules.
3155 (numb_pow): Change return type.
3156 (exp_term): Adjust caller.
3157 (m4_evaluate): Fail on bad exponent.
3158 (logical_or_term, logical_and_term): Ignore failed ** in short
3160 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
3161 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
3162 to parse radix 1 numbers.
3163 (condition_term, comma_term): New parse functions.
3164 (shift_term): Support >>>.
3165 (m4_evaluate): Port patch from branch to output radix 1 numbers.
3166 Warn instead of error for most parse problems.
3167 * doc/m4.texinfo (Limits control, Eval): Document these changes.
3168 * NEWS: Document new operators and new command line option.
3170 2007-01-04 Eric Blake <ebb9@byu.net>
3172 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3174 2007-01-03 Eric Blake <ebb9@byu.net>
3176 * doc/m4.texinfo (Format, Incr): More merges.
3177 (Eval): Ensure C precedence rules are met.
3178 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3179 (not_term, logical_not_term): Delete; these are same precedence
3180 as other unary operators.
3181 (equality_term): New; these are lower precedence than relational
3183 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3184 operators for better error messages.
3185 (logical_or_term, logical_and_term): Short-circuit out the error
3186 of division by zero.
3187 (unary_term): Allow consecutive unary operators.
3188 * modules/m4.c (int2numb, numb2int): Delete; these potentially
3190 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3191 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3192 * NEWS: Document this change.
3194 2006-12-27 Eric Blake <ebb9@byu.net>
3196 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3198 * modules/m4.c (substr): Merge from branch.
3200 2006-12-26 Eric Blake <ebb9@byu.net>
3202 * doc/m4.texinfo (Changesyntax): Check for regressions with
3203 changesyntax(W=...).
3205 2006-12-22 Eric Blake <ebb9@byu.net>
3207 * m4/m4module.h (m4_set_syntax): Change signature.
3208 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3210 (changesyntax): Likewise, and update caller.
3211 * m4/m4private.h (m4_syntax_table): Add orig member.
3212 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3213 Don't set is_single_quotes and is_single_comments when the begin
3214 character is shadowed by another syntax type.
3215 (m4_syntax_create): Populate default syntax table.
3216 (add_syntax_attribute): Don't lose quote assignment.
3217 (remove_syntax_attribute): Only allow removing rquote or ecomm.
3218 (add_syntax_set, subtract_syntax_set, set_syntax_set)
3219 (reset_syntax_set): New helper routines.
3220 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3221 to default, and empty chars reverts that key to default.
3222 (check_is_single_quotes, check_is_single_comments): New helper
3224 * modules/m4.c (changecom): Merge from branch.
3225 * m4/input.c (m4__next_token): Rearrange token recognition order
3226 to macro, quote, comment, in order to match traditional
3228 * src/freeze.c (reload_frozen_state): Update caller.
3229 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3231 (Changeresyntax): Revise to match style of surrounding sections
3232 and add more examples.
3233 (Changesyntax): Likewise, and update to new semantics.
3234 * NEWS: Document this change.
3236 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3237 (M4wrap, Eval, Errprint): Fix typos.
3238 (Divnum): Not necessary to redivert in example.
3240 2006-12-21 Eric Blake <ebb9@byu.net>
3242 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3245 2006-12-19 Eric Blake <ebb9@byu.net>
3247 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3248 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3249 can track write errors without all other callers warning multiple
3251 (sysval_flush_helper): New function.
3252 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3253 * modules/gnu.c (esyscmd): Likewise.
3254 * tests/others.at (stdout closed, stdout full): Error message
3257 2006-12-16 Eric Blake <ebb9@byu.net>
3259 * src/main.c: Fix missing include.
3261 * src/main.c (main): Check for errors when closing stdin.
3262 * modules/m4.c (m4exit): Missed part of previous patch: flush
3263 stdin before a successful exit.
3264 Reported by Ralf Wildenhues.
3266 2006-12-14 Eric Blake <ebb9@byu.net>
3268 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
3270 * tests/others.at (stdin seekable): New test.
3272 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3274 * doc/m4.texinfo: Fix some typos.
3276 2006-12-04 Eric Blake <ebb9@byu.net>
3278 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
3280 (Modules): Make style consistent.
3282 2006-11-16 Eric Blake <ebb9@byu.net>
3284 * bootstrap: Relax m4 requirement, thanks to...
3285 * configure.ac (Gettext support): ...this workaround to the 1.4.4
3286 bug. Undoes restriction added on 2006-11-09.
3288 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
3289 diversions are now closed when not active.
3290 (divert): Remove check now in the manual.
3291 * tests/others.at (stderr closed): Likewise.
3292 (stdout closed): Add a check.
3293 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
3294 more docs with branch.
3296 2006-11-14 Eric Blake <ebb9@byu.net>
3298 Remerge sparse diversion handling from branch.
3299 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
3301 * m4/output.c (diversion_table): Change type to gl_oset_t.
3302 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
3303 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
3304 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
3305 (div0, diversion_storage): New variables.
3306 (diversions, equal_diversion_CB): Deleted.
3307 (threshold_diversion_CB): New callback.
3308 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
3310 (m4_tmpfile): Move cloexec action here.
3312 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
3315 2006-11-13 Eric Blake <ebb9@byu.net>
3317 Add several new command line options.
3318 * src/main.c (usage): Update.
3319 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
3320 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
3321 Make --regexp-syntax argument optional.
3322 (main): Support new options. Fix regression in interactive
3323 behavior from Nov 8.
3324 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
3325 M4_OPT_SYNC_OUTPUT_BIT.
3326 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
3327 syncoutput, to match option.
3328 (m4_parse_truth_arg): New prototype.
3329 * m4/utility.c (m4_parse_truth_arg): Implement it.
3330 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
3331 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
3333 * doc/m4.texinfo (Operation modes, Dynamic loading features)
3334 (Preprocessor features, Limits control, Debugging options)
3335 (Command line files): Update documentation.
3336 * tests/builtins.at (mkstemp): Simplify.
3337 * tests/macros.at (Command line pushdef): New test.
3338 (Command line define): Improve.
3339 * tests/options.at (--traceon and --traceoff, --syncoutput): New
3341 (POSIXLY_CORRECT): Likewise.
3342 (deprecated options): Augment.
3343 (--regexp-syntax): Update, now that -r takes optional arg.
3344 * NEWS: Reformat. Document new options.
3346 2006-11-11 Eric Blake <ebb9@byu.net>
3348 One step closer to allowing C++ compilation - don't blindly
3349 convert between char* and unsigned char*.
3350 * m4/m4module.h (m4_set_syntax): Change signature.
3351 * m4/m4private.h (m4_string): Use signed char.
3352 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
3353 (m4_get_syntax_ecomm): No longer a need to cast.
3354 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
3355 Reflect this change.
3356 * m4/macro.c (expand_argument): Simplify.
3357 (expand_token): Use proper type.
3358 * src/freeze.c (reload_frozen_state): Likewise.
3359 * m4/input.c (MATCH, match_input): Likewise.
3360 * modules/m4.c (translit): Likewise.
3361 * modules/gnu.c (substitute): Simplify.
3363 * m4/macro.c (trace_format): Use canonical type name.
3364 * m4/output.c (m4_freeze_diversions): Likewise.
3365 * src/freeze.c (produce_module_dump, dump_symbol_CB)
3366 (produce_frozen_state): Likewise.
3367 * m4/m4private.h (to_uchar): Grab from branch.
3368 * m4/input.c (string_peek, string_read): Use it.
3369 * m4/utility.c (skip_space): Likewise.
3370 * src/main.c (main): Likewise.
3371 * doc/m4.texinfo (Translit): Remerge from branch.
3372 * tests/builtins.at (translit): Test 8-bit range.
3373 * modules/m4.c (m4_expand_ranges): Merge from branch.
3375 2006-11-09 Eric Blake <ebb9@byu.net>
3377 * bootstrap: Validate that installed M4 is powerful enough.
3378 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
3380 2006-11-08 Eric Blake <ebb9@byu.net>
3382 Merge deferred handling of -D option from branch.
3383 * doc/m4.texinfo (Debugging options, Preprocessor features)
3384 (Dynamic loading features, Operation modes, Invoking m4):
3385 Document this change.
3386 * src/main.c (OPTSTRING): Specify in-order processing.
3387 (process_file): New function.
3388 (main): Use it to interleave files and deferred options.
3389 * tests/macros.at (Command line define): New test.
3390 * tests/generate.awk: Allow '@comment file' as first example
3392 * tests/options.at (option grouping): Update to reflect actual
3394 (file names): New test.
3396 2006-11-07 Eric Blake <ebb9@byu.net>
3398 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
3401 * tests/builtins.at (m4exit): New test; failed on cygwin before
3403 * m4/output.c (cleanup_tmpfile): Close files before removing
3405 (make_room_for, m4_output_exit): Ensure that atexit handler
3406 invoked from m4_error sees consistent state.
3408 * doc/m4.texinfo (Errprint): Merge another doc node.
3409 * tests/builtins.at (dumpdef, errprint): New tests.
3410 * modules/m4.c (errprint): Merge from branch: flush before
3413 2006-11-02 Eric Blake <ebb9@byu.net>
3415 * bootstrap: Update bootstrap requirement wording.
3416 Reported by Bruno Haible.
3418 2006-10-31 Eric Blake <ebb9@byu.net>
3420 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3422 * doc/m4.texinfo (Translit): Merge from branch.
3423 * modules/m4.c (divert, substr): Ignore excess arguments.
3424 (index, translit): Merge from branch.
3425 * tests/builtins.at (translit): Add a test.
3427 2006-10-30 Eric Blake <ebb9@byu.net>
3429 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
3431 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
3433 * modules/m4.c (m4_make_temp): Make safe across libtool.
3434 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
3435 * configure.ac (--with-modules): Accomodate changed module
3436 location when doing './configure --enable-debug'.
3438 2006-10-28 Eric Blake <ebb9@byu.net>
3440 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3443 2006-10-27 Eric Blake <ebb9@byu.net>
3445 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
3447 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3448 0.16, since 0.15 is incompatible with our automake requirement.
3450 * m4/macro.c (expand_argument): Fix missing initialization.
3451 * m4/m4private.h (struct m4_symbol_value): Store entire
3452 m4_builtin, not just the func.
3453 (m4_get_symbol_value_func): Update.
3454 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
3456 * m4/m4module.h (m4_get_symbol_value_builtin)
3457 (m4_get_symbol_builtin): New prototypes.
3458 (m4_set_symbol_value_func): Delete, replace with...
3459 (m4_set_symbol_value_builtin): New function.
3460 (m4_builtin_find_by_name): Change signature.
3461 * m4/symtab.c (m4_symbol_value_print): Simplify.
3462 (m4_get_symbol_value_func): Update.
3463 (m4_get_symbol_value_builtin): New function.
3464 (m4_set_symbol_value_func): Delete, replace with...
3465 (m4_set_symbol_value_builtin): New function.
3466 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
3467 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
3468 * m4/input.c (struct m4_input_block): Remove unused trace member.
3469 (m4_push_builtin, builtin_print, init_builtin_token): Update
3471 * m4/module.c (install_builtin_table): Likewise.
3472 * src/freeze.c (reload_frozen_state): Likewise.
3473 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
3474 token, even after the builtin has been undefined.
3475 * doc/m4.texinfo (Builtin): Document new capability.
3478 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3480 * modules/m4.c (m4_make_temp): Use it.
3481 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
3483 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3485 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
3488 2006-10-26 Eric Blake <ebb9@byu.net>
3490 Silence -O2 -Wall -Wwrite-strings warnings.
3491 * m4/m4private.h (m4_symbol_value): Const-ify text.
3492 * m4/m4module.h (m4_get_symbol_value_text)
3493 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
3494 (m4_set_symbol_value_placeholder): Likewise.
3495 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
3497 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
3498 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
3499 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
3501 * modules/format.c (format): Likewise.
3502 * src/main.c (main): Likewise.
3503 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
3504 * modules/shadow.c (shadow, test): Likewise.
3505 * m4/output.c (m4_make_diversion): Don't hold on to empty
3507 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
3508 (m4_freeze_diversions): Likewise. Don't use uninitialized
3511 Convert diversions to list instead of sparse array, part 2.
3512 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3514 * m4/output.c (m4_diversion): Add next pointer and divnum members.
3515 (diversion_table): Convert to a list instead of a sparse array.
3516 (free_list): Maintain free list of reclaimed diversions.
3517 (equal_diversion_CB, cmp_diversion_CB): New functions.
3518 (m4_output_init): Set up list.
3519 (m4_output_exit): Tear down list.
3520 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
3522 (m4_make_diversion): Change creation of new diversions.
3523 (m4_insert_diversion_helper): New function, to avoid list
3525 * tests/builtins.at (divert): The test now passes.
3526 * NEWS: Document this improvement.
3528 Convert diversions to list instead of sparse array, part 1.
3529 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
3531 * m4/output.c (diversion, total_buffer_size, output_unused):
3532 Track size in size_t. All users changed.
3533 (struct diversion): Reduce size now, to compensate for part 2.
3534 (m4_make_diversion, make_room_for): Avoid malloc overflow.
3535 (m4_output_exit): Fix typo in assert.
3536 (m4_output_init, make_room_for, m4_make_diversion)
3537 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
3538 struct m4_diversion to disambiguate the new union.
3539 * tests/builtins.at (divert): Detect this failure.
3541 2006-10-25 Eric Blake <ebb9@byu.net>
3543 * m4/m4module.h (m4_push_builtin): Add parameter.
3544 * modules/m4.c (defn): Update caller.
3545 * m4/input.c (file_read_init, string_read_init): No longer
3547 (input_funcs): Change signature of read_func, all callers
3549 (composite_peek, composite_read, composite_unget),
3550 (composite_print, composite_funcs): New input type. Not yet
3551 fully utilized, but one step closer to fixing defn.
3552 (m4_input_block): Make every input block track current file and
3553 line. Rename some members. Remove unused out_line. Add support
3554 for composite input block.
3555 (input_change): New flag.
3556 (file_peek, file_read, file_clean, file_unget, file_print):
3558 (m4_push_file, m4_push_builtin, m4_push_string_init)
3559 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3560 (m4_skip_line, pop_input): Track input block changes.
3561 (m4_pop_wrapup): Avoid overflow.
3562 (init_builtin_token): Handle composite input.
3563 (next_char): Handle input block changes.
3564 * doc/m4.texinfo (Location): Remerge from branch.
3566 * src/m4.h (includes): Need <locale.h> after all; fixes
3567 regression from yesterday.
3569 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
3571 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3572 Handle nesting the argc obstack.
3573 (expand_token): Avoid unnecessary malloc.
3574 (collect_arguments): Copy name before invalidating it.
3575 (argc_stack, argv_stack): New variables.
3576 (m4_macro_expand_input): Initialize argc and argv stacks once per
3577 file, instead of once per macro.
3579 2006-10-24 Eric Blake <ebb9@byu.net>
3581 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
3583 2006-10-23 Eric Blake <ebb9@byu.net>
3585 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
3586 from branch regarding stripped leading whitespace.
3588 * modules/m4.c (includes): Use safe headers even when configured
3589 with --enable-assert.
3590 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
3591 #defined as mkstemp_safer.
3593 2006-10-21 Eric Blake <ebb9@byu.net>
3595 * modules/m4.c (m4_make_temp): Change signature.
3596 (maketemp, mkstemp): Update callers.
3597 * modules/m4.h (m4_make_temp_func): New export.
3598 * modules/gnu.c (mkdtemp): New macro.
3599 * doc/m4.texinfo (Operation modes): Document interaction with
3601 (Mkdtemp): New node.
3602 * tests/builtins.at (mkdtemp): New test.
3603 (mkstemp): Check for umask effect.
3604 * NEWS: Document new builtin.
3606 * tests/generate.awk (normalize): Update recognition of trailing
3608 * doc/m4.texinfo: Minor formatting fixes from branch.
3609 (Foreach, Improved foreach): Merge from branch.
3610 * examples/foreach.m4: Merge from branch.
3611 * examples/foreachq.m4: New file from branch.
3612 * examples/foreach2.m4: Likewise.
3613 * examples/foreachq2.m4: Likewise.
3615 * doc/m4.texinfo (titlepage): Add myself as author.
3616 * src/main.c (AUTHORS): Likewise.
3618 2006-10-19 Eric Blake <ebb9@byu.net>
3620 * modules/m4.c (m4_make_temp, mkstemp): New functions.
3621 (maketemp): Add POSIX behavior and a warning.
3622 * tests/others.at (maketemp): Move this test...
3623 * tests/builtins.at (mkstemp): ...to here, and beef up.
3624 * tests/options.at (--safer): Update to new warning message.
3625 * doc/m4.texinfo (Mkstemp): Sync from branch.
3626 (Extensions): Update maketemp behavior.
3627 * NEWS: Document that maketemp now always warns.
3629 * tests/generate.awk: For ease of doc-writing, simplify selection
3630 of '-Ipath/to/examples' to '@comment examples'.
3631 * examples/forloop.m4: Simplify.
3632 * examples/forloop2.m4: New file.
3633 * examples/quote.m4: New file.
3634 * doc/m4.texinfo (Improved forloop): New node.
3635 (Manual): Clarify use of examples directory.
3636 (Shift, Forloop): Resync from branch.
3637 (Include, Location): Update to new usage of examples directory.
3639 * m4/system_.h (includes): Pick up <unistd.h> before checking for
3641 (gettext_noop): Don't define here, let gettext.h do it instead.
3642 * po/POTFILES.in: Update entries to reflect gnulib imports.
3644 2006-10-16 Eric Blake <ebb9@byu.net>
3646 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3648 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
3649 pkglibexecdir support.
3650 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
3651 worry about pathconf.h, now that gnulib does it for us.
3652 (pkgmodincludedir): Simplify.
3653 (pkglibexecdir): Delete, now that automake does this.
3654 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
3655 * src/main.c (usage): Likewise.
3656 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
3658 * doc/m4.texinfo: Port some changes from the branch.
3659 (Invoking m4): Promote to a chapter, instead of a section of
3661 (Operation modes, Dynamic loading features, Preprocessor features)
3662 (Limits control Frozen state, Debugging options)
3663 (Command line files): Subdivide into new sections.
3664 (Cleardivert): Rename from cleardiv.
3666 2006-10-14 Eric Blake <ebb9@byu.net>
3668 * tests/others.at (stdin closed): Update to match previous patch.
3670 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
3672 Reported by Ralf Wildenhues.
3674 * modules/m4.c (undivert): Merge from branch.
3675 * doc/m4.texinfo (Improved fatal_error): Fix typo.
3676 (Improved exch): New node, copied from branch.
3677 (Improved cleardivert): Update from branch.
3680 2006-10-13 Eric Blake <ebb9@byu.net>
3682 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
3684 * modules/gnu.c (builtin, indir): Transparently handle builtin
3686 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
3687 * m4/input.c (m4_pop_wrapup): Display debug message when switching
3689 (m4_input_init): No need to use empty file any more.
3690 (file_print): Display correct file name.
3691 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
3692 dereference a NULL file name.
3693 * m4/m4module.h (m4_pop_wrapup): New parameter.
3694 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
3696 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
3697 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
3698 * src/main.c (main): Adjust caller.
3699 * tests/options.at (--debugmode): Test more output from -dV.
3701 2006-10-12 Eric Blake <ebb9@byu.net>
3703 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
3705 * m4/m4private.h (m4__next_token_is_open): New prototype.
3706 * m4/m4module.h (m4_push_single): Delete; push_string is an
3707 adequate interface, and removing support for this simplifies the
3709 (m4_push_wrapup): New parameter.
3710 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
3711 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
3712 start-quote and start-comment exclusive from other syntax
3714 * m4/syntax.c: Likewise.
3715 * m4/input.c (input_funcs): Make polymorphic without requiring
3716 clients to know whether they are located at isp. All users
3718 (file_names): New variable.
3719 (m4_input_init): Initialize it.
3720 (m4_push_file): Use it.
3721 (m4_input_exit): Free it after use.
3722 (m4__next_token): Simplify slightly.
3723 (m4__peek_token): Rename and simplify...
3724 (m4__next_token_is_open): ... to this. In particular, this
3725 allows us to avoid a double ungetc, which POSIX doesn't
3727 (struct m4_input_block, m4_push_single, single_peek, single_read):
3728 Remove support for single characters, as the input engine now
3729 guarantees we don't need it.
3730 (file_unget, string_unget, m4_input_print, unget_input):
3731 Strengthen assertions.
3732 (file_init_funcs, file_read_init): New for file reading.
3733 (string_init_funcs, string_read_init): New for wrapped text.
3734 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
3735 Support wrapped text with locations.
3736 (m4_skip_line): Support dnl across include file boundary.
3737 (peek_char): Don't pop input when peeking.
3738 (file_peek): Peek can be called at the end of the file.
3739 (string_read): Don't read beyond string bounds.
3740 * m4/macro.c (expand_token, collect_arguments): Update callers.
3741 (expand_macro): Report errors at location of open parenthesis.
3742 (expand_token, expand_argument, process_macro): Avoid negative
3743 array dereferences with m4_has_syntax.
3744 * m4/utility.c (skip_space): Likewise.
3745 * modules/m4.c (m4wrap): Update caller.
3746 * tests/builtins.at (__file__, __line__, dnl): New tests.
3747 * tests/options.at (--debugmode): Normalize the output.
3748 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
3749 Remerge recent changes from branch.
3750 (Improved fatal_error): New node from branch.
3752 2006-10-11 Eric Blake <ebb9@byu.net>
3754 * src/main.c (usage, long_options): Add --debugmode as an alias
3755 for --debug, to match macro name.
3756 * tests/options.at (--debugmode): Rename from --debug, and test
3758 (--discard-comments): Augment test.
3759 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
3762 2006-10-10 Eric Blake <ebb9@byu.net>
3764 Trace improvements: debugmode(c) was always printing the last two
3765 lines paired, combine them; and show non-text expansions.
3766 * m4/macro.c (trace_prepre): Update to show what the macro will
3768 (trace_pre): No need to special-case on debugmode(c).
3769 (trace_post): Likewise. Also, show non-text expansions.
3770 (expand_macro): Update caller. Collecting arguments can change
3771 debug mode, so cache values beforehand.
3772 (trace_format): Remove support for unused %l%S%r, and fix support
3773 for %z to match gcc's attribute((printf)).
3774 (trace_header): Update caller.
3775 * m4/input.c (struct m4_input_block): Rename from input_block.
3776 (struct input_funcs): Add print_func member.
3777 (file_print, builtin_unget, builtin_print, string_print)
3778 (m4_input_print): New functions.
3779 (m4_push_string_finish): Change return type.
3780 (m4_push_file): Fix missing use of close parameter.
3781 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
3782 * m4/m4module.h (m4_input_print): New prototype.
3783 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
3784 to match behavior change.
3785 * tests/options.at (--debug): Likewise.
3786 * tests/macros.at (Propagation of traceon)
3787 (Propagation of --trace): Likewise.
3788 * tests/others.at (stderr closed, stdout closed, stdin closed):
3790 * doc/m4.texinfo (Forloop): Simplify.
3791 (Trace): Update to changed behavior.
3792 (Debugmode): Document this change.
3793 * src/main.c (usage): Likewise.
3796 2006-10-09 Eric Blake <ebb9@byu.net>
3798 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
3799 Reported by Ralf Wildenhues.
3801 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
3803 2006-10-07 Eric Blake <ebb9@byu.net>
3805 * m4/m4module.h (m4_set_exit_failure): New prototype.
3806 * m4/utility.c (m4_set_exit_failure): New function.
3807 * modules/m4.c (m4exit): Use it to avoid yet another global
3808 variable export in libm4.
3810 2006-10-06 Eric Blake <ebb9@byu.net>
3812 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
3814 * tests/others.at (stdout closed): Fix final check.
3816 Replace uses of tmpfile with clean-temp, since tmpfile is
3817 incompatible with closeout.
3818 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
3820 * tests/others.at (stderr closed): Likewise.
3821 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
3822 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3824 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
3825 (m4_tmpfile, cleanup_tmpfile): New functions.
3826 (make_room_for, m4_insert_diversion): Use clean-temp module.
3827 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
3829 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
3831 * m4/utility.c (m4_numeric_arg): Merge from branch.
3832 * modules/gnu.c (debuglen): New builtin.
3833 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
3834 Rename --arglength to --debuglen.
3835 * tests/options.at (--arglength): Rename to --debuglen.
3836 (deprecated options): Augment test.
3837 * doc/m4.texinfo (Invoking m4): Document the name change.
3838 (Debugmode): Rename from Debug Levels.
3839 (Debugfile): Rename from Debug Output.
3840 (Debuglen): New node.
3841 * NEWS: Document these changes.
3843 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
3844 case closing a module exits.
3846 * modules/m4.c (m4exit): Merge from branch.
3847 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
3849 2006-10-05 Eric Blake <ebb9@byu.net>
3851 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3853 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
3854 * src/main.c (main): Close stdout on exit.
3855 * m4/debug.c (set_debug_file): Check for write failure.
3856 * m4/m4.c (m4_delete): Don't mask write failure.
3857 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
3858 macros before calling AT_CHECK.
3859 (M4_ONE_MEG_DEFN): New helper macro.
3860 * tests/others.at (stdout full): New test.
3861 (stderr closed, stdin closed, stdout closed): Augment.
3862 * tests/builtins.at (syscmd): New test.
3865 2006-10-04 Eric Blake <ebb9@byu.net>
3867 * tests/builtins.at: Alphabetize tests.
3868 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
3869 * tests/generate.awk (new_test): Fix underquoting.
3870 * tests/others.at (maketemp): Rename from misc.
3871 (stdin closed, stdout closed, stderr closed): New tests.
3873 2006-10-03 Eric Blake <ebb9@byu.net>
3875 Avoid all global variables in modules, so that --disable-static
3877 * examples/incl.m4: New file, from branch.
3878 * Makefile.am (dist_pkgdata_DATA): Distribute it.
3879 * doc/m4.texinfo (Location): Merge this section from branch.
3880 (Include): Update the test.
3881 * tests/generate.awk (new_test): Allow for VPATH build
3882 pre-processing of expected __program__ output.
3883 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
3884 Avoid global variables.
3885 (m4_context_field_table): Add current_diversion, output_line.
3886 (m4_output_init, m4_make_diversion): Add parameter.
3887 (m4_get_program_name, m4_set_program_name): New accessors.
3888 * m4/m4private.h (m4_get_current_diversion),
3889 (m4_set_current_diversion, m4_get_output_line)
3890 (m4_set_output_line): New accessors.
3891 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
3893 * modules/m4.c (divnum, divert): Adjust callers.
3894 * modules/gnu.c (__program__): Likewise.
3895 * m4/output.c (m4_output_init, m4_make_diversion)
3896 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
3897 (m4_insert_diversion): Likewise.
3898 * m4/input.c (file_clean, m4_push_file): Likewise.
3899 * src/freeze.c (reload_frozen_state): Likewise.
3900 * src/main.c (main, usage): Likewise.
3902 Partially plug memory leak when unloading gnu module.
3903 * tests/modules.at (unload gnu module): New test.
3904 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
3905 (m4_regexp_compile): Move static storage to module visibility.
3906 * tests/options.at (--debug): Adjust to new output.
3908 2006-09-29 Eric Blake <ebb9@byu.net>
3910 Even when not the first option, --help can't have side effects.
3911 * tests/options.at (--debugfile): Detect bugs in this area.
3912 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
3914 * src/main.c (main): Fix it by deferring debugfile change. Also,
3915 defer closing streams until after module tracing is done.
3916 * modules/gnu.c (debugfile): Make message consistent with command
3918 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
3919 * NEWS: Document this fix.
3921 * modules/m4.c (dnl): Include macro name in warning message.
3922 * m4/input.c (m4_skip_line): Add parameter.
3923 * m4/m4module.h (m4_skip_line): Likewise.
3924 * src/main.c (usage): Update wording.
3925 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
3926 issue of blind macros vs. POSIX is resolved.
3927 (Dnl): Merge another node from branch.
3929 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3931 * m4/system_.h (N_): Define.
3932 * src/main.c (main): Validate numeric arguments.
3933 (size_opt): New function, idea borrowed from coreutils.
3934 * m4/macro.c (expand_macro): -L0 implies no limit.
3935 * doc/m4.texinfo (Invoking m4): Document this change.
3937 * tests/options.at: (--arglength, --nesting-limit)
3938 (--regexp-syntax): New tests of argument validation.
3940 2006-09-28 Eric Blake <ebb9@byu.net>
3942 * tests/options.at: Alphabetize the tests.
3944 2006-09-27 Eric Blake <ebb9@byu.net>
3946 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
3947 another parameter to print module info.
3948 * m4/macro.c (trace_pre): Adjust caller.
3949 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
3950 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
3951 * NEWS: Document this.
3953 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
3955 * m4/symtab.c (symbol_value_print): Rename to...
3956 (m4_symbol_value_print): ...this, and...
3957 (m4_symbol_print): Update to allow -L length truncation. Now
3958 truncation also affects dumpdef output and builtin names.
3959 * m4/m4private.h (nesting_limit, max_debug_argument_length):
3961 * m4/m4module.h (m4_symbol_print): Add parameter.
3962 (m4_symbol_value_print): New function.
3963 * modules/m4.c (dumpdef): Allow length truncation.
3964 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
3966 * doc/m4.texinfo (Invoking m4): Document -l better.
3967 (Dumpdef, Debug Levels): Document the effect of -l.
3968 * NEWS: Document this change.
3970 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
3971 (m4_expand_ranges): Ensure we aren't picking up partial object on
3973 * modules/stdlib.c (setenv): Allow extra arguments.
3974 * modules/time.c (ctime): Avoid side effect in call to
3976 * modules/gnu.c (m4_regexp_substitute): Likewise.
3977 (renamesyms): Avoid extra obstack_init.
3978 * src/freeze.c (reload_frozen_state): Remove debug comment.
3979 (produce_frozen_state): Simplify fprintf to puts where possible.
3980 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
3981 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
3982 * m4/macro.c (trace_flush): Likewise.
3983 * m4/debug.c (m4_debug_message_prefix): Likewise.
3984 * m4/path.c (include_dump): Likewise.
3985 * m4/module.c (module_remove): Likewise.
3986 (install_builtin_table): Simplify malloc and string
3989 2006-09-26 Eric Blake <ebb9@byu.net>
3991 * m4/m4module.h (m4_symbol_print): New prototype.
3992 (M4_DEBUG_TRACE_STACK): New enumerator.
3993 (m4_is_debug_bit): Allow use without requiring m4private.h.
3994 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
3996 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
3998 (dumpdef): Allow printing pushdef'd stacks.
3999 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4000 * src/main.c (usage): Document it.
4001 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4004 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4006 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4007 of lines during make.
4008 (AM_CPPFLAGS): Remove unneeded include path.
4009 (src_m4_CPPFLAGS): Remove redundant include path.
4010 * m4/system_.h Make preprocessor indentation consistent.
4011 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4013 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4015 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4016 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4017 (bool, true, false): Don't undefine here; stdbool takes care of
4019 * src/m4.h (includes): Assume config.h, and several standard
4021 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4022 * m4/m4private.h: Assume config.h.
4023 * m4/output.c: Likewise.
4024 * m4/path.c: Likewise.
4025 * m4/resyntax.c: Likewise.
4026 * m4/utility.c: Likewise.
4027 * modules/gnu.c: Likewise.
4028 * modules/import.c: Likewise.
4029 * modules/load.c: Likewise.
4030 * modules/m4.c: Likewise.
4031 * modules/modtest.c: Likewise.
4032 * modules/mpeval.c: Likewise.
4033 * modules/perl.c: Likewise.
4034 * modules/shadow.c: Likewise.
4035 * modules/stdlib.c: Likewise.
4036 * modules/time.c: Likewise.
4037 * modules/traditional.c: Likewise.
4039 2006-09-21 Eric Blake <ebb9@byu.net>
4041 * doc/m4.texinfo (Invoking m4): Add clarification on option
4042 processing behavior.
4043 * tests/options.at (option grouping): Test this.
4045 Reported by Mikhail Teterin.
4047 * bootstrap: Add --force option, based on idea from coreutils.
4048 * README: Document that ./bootstrap and autoreconf are for
4049 developers, and not lightly done in tarballs.
4051 2006-09-20 Eric Blake <ebb9@byu.net>
4053 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
4054 warnings consistent.
4055 (long_options, HASHSIZE_OPTION): Warn on -H.
4056 * doc/m4.texinfo (Invoking m4): Document this.
4057 * tests/options.at (deprecated options): Update.
4059 Change the default of interactive sessions to match sh.
4060 * src/main.c (usage): Document this.
4061 (enum interactive_choice): New enum.
4062 (main): Use it to defer decision of interactive until after
4063 argument processing.
4064 * doc/m4.texinfo (Invoking m4): Document this.
4065 * NEWS: Likewise, plus add missing mention of -b.
4066 Reported by Stepan Kasal.
4068 2006-09-19 Eric Blake <ebb9@byu.net>
4070 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4071 well as --error-output; the goal is to add -o/--output in some
4072 future version with semantics like gcc or autom4te.
4073 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4074 (Extensions): Reflect this update.
4075 (Renamesyms): Add another test.
4076 (Defn): Xfail for now, so that `make check' is happy.
4077 * NEWS: Document this change.
4078 * tests/generate.awk: Mark dynamic loading tests as such. Allow
4080 * tests/macros.at (Renamesyms collisions): New test, exposing
4081 renamesyms' coredump.
4082 * tests/options.at (--debugfile, --safer): Update to match
4085 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4086 and stderr are same file, introduced 2003-07-23.
4087 * tests/options.at (--debugfile): New test, to catch the bug.
4088 (deprecated options): Test --error-output.
4089 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4090 Deprecate --error-output, and replace it with --debugfile.
4091 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4092 Document this change.
4095 2006-09-18 Eric Blake <ebb9@byu.net>
4097 * modules/load.c (modules): Rename to...
4098 (m4modules): ...this, since it is an English word with 0
4100 * modules/gnu.c (symbols, m4symbols): Likewise.
4101 * doc/m4.texinfo (Listing Modules): Rename to...
4102 (M4modules): ...this.
4103 (Symbols): Rename to...
4104 (M4symbols): ...this.
4105 (Load, Foreach, Trace, Answers): Update to new spellings.
4106 * NEWS: Document this.
4108 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4109 such that without arguments, the global trace flag is changed
4110 rather than walking the table of all currently-defined macros.
4111 (set_trace_CB): No longer needed.
4112 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4113 (m4_set_symbol_traced): Delete.
4114 (m4_symtab_create): Nuke the nuke parameter.
4115 * m4/m4private.h (m4_get_symbol_value): Delete.
4116 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4117 (m4_set_symbol_name_traced): Free undefined entries that are no
4119 (symbol_destroy_CB): Update caller.
4120 * m4/m4.c (m4_create): Update caller.
4121 * src/main.c (main): Likewise.
4122 (usage): Fix typo in last commit.
4123 * doc/m4.texinfo: Minor cleanups throughout.
4124 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4125 more nodes from branch.
4126 (Trace): Document new semantics, and how to simulate the old.
4127 * tests/builtins.at (multiquotes): Adjust to new semantics.
4128 * NEWS: Update somewhat.
4130 2006-09-14 Eric Blake <ebb9@byu.net>
4132 Add --safer option, per debian bug 5898.
4133 * src/main.c (usage): Document new option.
4134 (SAFER_OPTION): New enumerator.
4135 (main): Set the option bit.
4136 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4138 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4139 (m4_get_safer_opt): New accessor.
4140 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4141 * modules/m4.c (syscmd, maketemp): Likewise.
4142 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4143 (Sysval, Maketemp): Add tests of this.
4144 * tests/options.at (--safer): Likewise.
4146 2006-09-13 Eric Blake <ebb9@byu.net>
4148 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4150 Reported by Ralf Wildenhues.
4153 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4154 tests directory, so we can be sure an installed build is not
4155 picking up uninstalled non-test libraries.
4156 (check-local, installcheck-local): Depend on test libraries.
4157 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4158 after file name. Fix quoting. Remove skipping the test, now
4159 that makefile guarantees test modules will exist.
4160 (Freezing modules, modules: shadow, modules: unload)
4161 (modules: trace): Always put test modules in module path.
4162 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4164 * src/main.c (usage): Document default module search path.
4165 (import_environment, frozen_file_to_read, frozen_file_to_write):
4168 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4169 * tests/m4.in: ...not here.
4170 Reported by Ralf Wildenhues.
4172 2006-09-08 Eric Blake <ebb9@byu.net>
4174 * bootstrap: Kill unrelated copy-n-paste code from argument
4175 parsing. Let Makefile generate testsuite.
4176 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4178 2006-09-07 Eric Blake <ebb9@byu.net>
4180 * m4/m4module.h (m4_peek_input): No longer export.
4181 (m4_error_at_line, m4_warn_at_line): New prototypes.
4182 (m4_is_symbol_void): New macro.
4183 (m4_push_file): Update prototype.
4184 * m4/m4private.h (m4__peek_token): New prototype.
4185 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4186 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4187 * src/main.c (main): Allow reading from stdin twice.
4188 * modules/m4.c (include): Adjust to new prototype.
4189 * m4/input.c: General comment cleanup.
4190 (file_peek, file_read, file_unget, push_file): Set end flag on
4191 EOF, so that we don't call getc twice.
4192 (push_file, file_clean): Port fix from branch to avoid closing
4194 (pop_input): Port fix from branch to avoid reading free'd memory
4195 when input ends mid-string.
4196 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4197 (string_peek, string_read): Always use unsigned char.
4198 (m4_skip_line): Warn when dnl cut short by EOF.
4199 (peek_input): Rename from m4_peek_input.
4200 (match_input): Update signature, to distinguish between `(' token
4201 and multi-char quote or comment beginning with `('.
4202 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4203 (m4__peek_token): New function, ported from branch.
4204 (m4__next_token): Update to new token types.
4205 * m4/macro.c (expand_token, expand_argument): Use peek_token.
4206 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4207 (Invoking m4): Remerge from branch.
4209 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4210 (check-local): and put dependency here.
4211 Reported by Ralf Wildenhues.
4213 2006-09-05 Eric Blake <ebb9@byu.net>
4215 * m4/m4module.h (m4_debug_message): New prototype.
4216 (M4_DEBUG_TRACE_MODULE): New debug bit.
4217 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4218 (M4_DEBUG_MESSAGE2): Delete these macros.
4219 * m4/debug.c (m4_debug_message): New method.
4220 (m4_debug_decode): Add module tracing as flag `m'.
4221 * m4/input.c (m4_push_file, file_clean): Use new method.
4222 * m4/path.c (m4_path_search): Likewise.
4223 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4224 * m4/module.c (install_builtin_table, install_macro_table)
4225 (m4__module_open, module_close, module_remove): Promote several
4226 module debug messages outside of DEBUG_MODULES.
4227 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4228 DEBUG_MODULES with normal trace output.
4229 * src/main.c (usage): Document new flag.
4230 * doc/m4.texinfo (Debug Levels): Likewise.
4231 * Makefile.am ($(TESTSUITE)): Add missing dependency.
4232 * tests/m4.in: Neutralize platform-dependent module filenames.
4233 * tests/options.at (--debug): Update expected output.
4235 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4237 * doc/m4.texinfo: Fix some typos.
4238 * tests/others.at: Likewise.
4240 2006-09-05 Eric Blake <ebb9@byu.net>
4242 * m4/input.c (lex_debug): Remove dead code that broke compilation
4243 with --enable-debug.
4244 * m4/module.c (install_builtin_table, install_macro_table)
4245 (m4__module_init, m4__module_open, module_close)
4246 (module_remove): Fix compilation when --enable-debug.
4247 * m4/output.c (m4_shipout_text): Likewise.
4248 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4249 libraries when --enable-debug.
4250 * configure.ac (DYNAMIC_MODULES): New variable, to pass
4251 information to testsuite.
4252 (modules to preload): Determine modules after we know whether
4253 shared libraries are supported.
4254 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4256 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4257 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4258 (modules: shadow, modules: unload, modules: importing)
4259 (modules: trace): Use new macro.
4260 * tests/builtins.at (gmp): Likewise.
4262 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
4264 (expand_token): Avoid assertion just added to docs.
4265 (expand_macro): Track pending expansions, for when a symbol's
4266 definition changes during argument collection.
4267 (m4_macro_call, process_macro): Operate on symbol value, not
4268 symbol, since symbol may have changed during argument collection.
4269 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
4270 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
4271 (m4_get_symbol_value): Add fast macro version.
4272 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
4273 (m4_macro_call): Adjust prototype.
4274 * m4/module.c (install_builtin_table): Check that flags are valid
4275 when creating builtin.
4276 * m4/symtab.c (m4__symtab_remove_module_references): Use
4277 m4_symbol_value_delete, rather than inlining it.
4278 (m4_symbol_value_copy): Copy placeholder text.
4279 (symbol_popval): Use m4_symbol_value_delete.
4280 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
4281 Handle pending expansions.
4282 * modules/gnu.c (indir): Update to new prototype.
4283 * doc/m4.texinfo: Fix menus to be consistent with section names.
4284 (Defn): Add test that macro tokens flatten to empty string;
4285 triggered an assert before this patch.
4286 (Ifelse): Merge another node.
4287 (Loops): Split into...
4288 (Forloop, Foreach): New nodes; work is still underway on them.
4289 (Answers): Add more info on foreach macro; work is still underway.
4290 (Indir): Add test that indir collects arguments before looking up
4292 * TODO: Update based on this patch.
4294 2006-09-01 Eric Blake <ebb9@byu.net>
4296 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
4297 * m4/hash.h (m4_free_hash_iterator): New prototype.
4298 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
4299 ensure we don't do unsafe things while iterating.
4300 (HASH_ITER, ITER_CHAIN): New accessor macros.
4301 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
4302 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
4303 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
4304 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
4305 to catch unsafe actions.
4306 (m4_free_hash_iterator): New function, to avoid memory leaks, and
4307 when debugging, to track safe actions.
4308 (m4_hash_apply): Avoid memory leak.
4309 * m4/symtab.c (m4_symtab_apply): Likewise.
4310 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
4311 in manually to src/ for now.
4312 * tests/builtins.at (gmp): Add keyword module.
4313 * tests/modules.at (Freezing modules, modules: shadow)
4314 (modules: unload, modules: importing, modules: trace): Likewise.
4316 2006-08-30 Eric Blake <ebb9@byu.net>
4318 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
4320 (m4_bad_argc, m4_numeric_arg): Update all callers.
4321 * m4/macro.c (m4_macro_call): Likewise.
4322 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
4323 (Indir, Builtin, Ifdef): More doc merges.
4324 (Loops): Mention that documenting foreach would be nice.
4325 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
4326 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
4327 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
4328 (substitute, syncoutput): Update all m4_warn callers.
4329 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
4330 (traceon, traceoff): Make warning message consistent.
4331 (define, pushdef): Update all m4_warn callers.
4332 * tests/generate.awk: Choose file name so that documentation can
4333 show command-line behavior.
4334 * tests/builtins.at (define): Update to new wording.
4335 * tests/macros.at (pushdef/popdef): Likewise.
4336 * tests/freeze.at (loading format 1): Likewise.
4337 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4339 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
4341 (Defn): Add failing test case for mixing text and builtin.
4342 (Renamesyms): Improve wording, and identify core dump that needs
4345 2006-08-29 Eric Blake <ebb9@byu.net>
4347 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
4348 (Arguments, Pseudo Arguments): More doc merges from the branch.
4349 (Macro expansion): Turn example into test.
4350 (Pseudo Arguments): Add example of avoiding argument.
4351 * modules/m4.c (undefine, popdef): Accept multiple arguments.
4352 (define, pushdef): Warn on non-text macro name.
4353 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
4354 warning/error messages.
4355 (ifdef): Ignore extra arguments.
4356 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
4357 (m4__symtab_remove_module_references): Check that there is no leak.
4358 * tests/macros.at (pushdef/popdef): Update to new message.
4359 * tests/builtins.at (define): Likewise.
4360 * tests/freeze.at (loading format 1): Likewise.
4361 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4363 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
4364 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
4365 as accessor function, to avoid compiler warning.
4366 * m4/module.c (m4__module_open): Move declaration of variable to
4367 avoid compiler warning.
4368 * src/main.c (main): Avoid shadowing a global variable.
4369 * src/freeze.c (produce_symbol_dump): Avoid unused variable
4370 warning when NDEBUG.
4371 * tests/options.at (--discard-comments, --import-environment)
4372 (--debug, --prepend-include, --help and --version): Rename tests
4373 to name option tested.
4375 2006-08-28 Eric Blake <ebb9@byu.net>
4377 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
4378 * m4/module.c (install_builtin_table): ...to here, and add
4379 assertion that blind macros require arguments.
4380 * m4/m4module.h (struct m4_builtin): Document restrictions that
4381 must be met during module loading.
4382 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
4383 so require an argument to avoid triggering assertion.
4384 (debugfile): Tweak error message.
4386 2006-08-25 Eric Blake <ebb9@byu.net>
4388 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
4389 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
4390 (struct m4_builtin): New member flags replaces groks_macro_args,
4391 blind_if_no_args. min_args and max_args are now 0-based.
4392 Rearrange members to reduce size on platforms where function
4393 pointers are 64 bits but regular pointers are 32.
4394 (m4_bad_argc): Add argument.
4395 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
4396 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
4397 effect into account.
4398 * m4/module.c (install_builtin_table): Adjust all users affected
4400 * m4/macro.c (m4_macro_call): Likewise.
4401 * src/freeze.c (reload_frozen_state): Likewise.
4402 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
4403 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
4404 * modules/import.c (builtin_functions): Likewise.
4405 * modules/load.c (builtin_functions): Likewise.
4406 * modules/modtest.c (builtin_functions): Likewise.
4407 * modules/mpeval.c (builtin_functions): Likewise.
4408 * modules/perl.c (builtin_functions): Likewise.
4409 * modules/shadow.c (builtin_functions): Likewise.
4410 * modules/stdlib.c (builtin_functions): Likewise.
4411 * modules/time.c (builtin_functions, mktime_functions)
4412 (strftime_functions): Likewise.
4413 * doc/m4.texinfo (Loops): Update test now that shift is blind.
4414 (Macro Arguments): Fix typo in test.
4415 (Patsubst): Fix typo in test.
4416 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
4417 end of string. Fix return value when ignore_duplicates.
4418 * tests/builtins.at (patsubst): Fix typo in test.
4420 * tests/options.at (debug-flags): Update to reflect new message.
4421 (deprecated options, prepend-include, help and version): New
4423 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
4424 test omits an input file name.
4425 * src/main.c (long_options, main): Add -B/--prepend-include.
4426 (usage): Document it.
4427 (main): `m4 --help --version' now displays help, not version.
4428 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4429 dirname filenamecat.
4430 * m4/m4module.h (m4_add_include_directory): Add parameter.
4431 * m4/m4private.h (m4__include_init): New prototype.
4432 * m4/m4.c (m4_create): Put `.' on path before options are
4434 * m4/path.c (includes): Assume C89. Use gnulib for file name
4436 (m4__include_init): New function.
4437 (search_path_add): Allow prepending.
4438 (m4_add_include_directory, search_path_env_init): Adjust callers.
4439 (m4_path_search): Relative names now invoke path search, since
4440 `.' might not be first.
4441 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
4443 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
4444 and Eric Blake <ebb9@byu.net>
4446 * bootstrap: Run autopoint before gnulib-tool, since autopoint
4447 0.15 installs macros obsoleted by current gnulib.
4449 2006-08-25 Eric Blake <ebb9@byu.net>
4451 * doc/m4.texinfo (Macro Arguments): Another section merged;
4452 testsuite failures now exposed.
4454 2006-08-23 Eric Blake <ebb9@byu.net>
4456 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
4457 (Input processing): More doc merges from the branch.
4458 (Regular expression syntax): Add introductory text.
4459 (Inhibiting Invocation): More doc merges from the branch.
4460 (Other tokens): Reorder after comments.
4461 * tests/generate.awk: Allow passing options to doc examples.
4463 2006-08-22 Eric Blake <ebb9@byu.net>
4465 * tests/options.at (debug-flags): New test.
4466 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
4467 not negative, to distinguish failure in m4_debug_decode.
4468 (m4_debug_decode): Add new parameter.
4469 * modules/gnu.c (regexp): Slight cleanup.
4470 (renamesyms): Ignore excess arguments.
4471 (syncoutput): Make case-insensitive, warn on bad argument.
4472 (debugmode): Factor -+ handling out to...
4473 * m4/debug.c (m4_debug_decode): ...here.
4474 (m4_debug_message_prefix): Fix spacing.
4475 * src/main.c (main): Let -d option adjust flags.
4476 * m4/input.c (file_clean): Avoid printing empty file name.
4477 * doc/m4.texinfo (Syncoutput): Document new range of input.
4478 (Invoking m4): Document use of multiple -d flags.
4480 Start porting various fixes from the branch that use gnulib.
4481 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4482 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
4483 regexprops-generic stdlib-safer unlocked-io.
4484 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
4485 * m4/path.c (m4_path_search): Close input file on exec, reject
4486 empty file name, fix parameter naming.
4487 * m4/output.c (make_room_for): Close diversion file on exec.
4488 (includes): Assume C89 headers.
4489 (tmpfile): For now, we don't want tmpfile-safer, because we want
4491 * m4/m4private.h (includes): Use various gnulib headers.
4492 * doc/regexprops-generic.texi: Use gnulib's copy.
4494 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
4495 * AUTHORS: Add copyright.
4496 * ChangeLog: Likewise.
4497 * README: Likewise. Require automake 1.9b or later.
4498 * HACKING: New file.
4499 * README-alpha: Add copyright.
4500 * THANKS: Likewise. Update.
4501 * doc/STYLE: Add copyright, and tweak for changed directories.
4502 * modules/README: Add copyright, and tweak for libtool version.
4503 * examples/COPYING: New file.
4504 * examples/WWW/COPYING: Likewise.
4505 * examples/WWW/m4lib/COPYING: Likewise.
4506 * modules/shadow.m4: Add copyright.
4507 * modules/perl.m4: Likewise.
4508 * modules/modtest.m4: Likewise.
4509 * modules/stdlib.m4: Likewise.
4510 * modules/time.m4: Likewise.
4511 * modules/time2.m4: Likewise.
4512 * po/Makevars: Likewise.
4513 * tests/iso8859.m4: Likewise.
4514 * tests/m4.in: Likewise.
4515 * NEWS: Add (C) to copyright.
4517 * m4/system_.h: Likewise.
4518 * tests/atlocal.in: Likewise.
4519 * tests/builtins.at: Likewise.
4520 * tests/freeze.at: Likewise.
4521 * tests/generate.awk: Likewise.
4522 * tests/macros.at: Likewise.
4523 * tests/modules.at: Likewise.
4524 * tests/options.at: Likewise.
4525 * tests/others.at: Likewise.
4526 * tests/testsuite.at: Likewise.
4527 * m4/utility.c: Spell out copyright years.
4528 * src/main.c: Likewise.
4530 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
4532 2006-08-21 Eric Blake <ebb9@byu.net>
4534 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
4535 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
4536 when no arguments are given, but without losing warning about 0
4538 * modules/m4.c (syscmd): Likewise.
4539 (includes): Assume C89.
4540 (m4_sysval): Make static.
4541 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
4542 (sysval): Port calculation from branch.
4544 2006-08-20 Eric Blake <ebb9@byu.net>
4546 * m4/macro.c (expand_macro): Move argument check...
4547 (m4_macro_call): ...to here, so indir will warn.
4548 * modules/gnu.c (__program__): New macro, ported from branch.
4549 (builtin): Perform argument check.
4550 (changesyntax): Avoid out-of-bounds read.
4552 * modules/gnu.c (includes): Assume stdlib.h, errno.
4553 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4554 (substitute): Add caller parameter, avoid out-of-bounds memory
4556 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4559 2006-08-16 Eric Blake <ebb9@byu.net>
4561 * po/POTFILES.in: Add more files that contain translatable
4563 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4564 information to translators.
4565 (USE_MSGCTXT): New var for gettext 0.15.
4566 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4567 debug/trace messages in lower case.
4568 * m4/macro.c (expand_argument): Likewise.
4569 * m4/path.c (m4_path_search): Likewise.
4570 * src/main.c (main): Likewise.
4572 2006-08-14 Eric Blake <ebb9@byu.net>
4574 * src/main.c (usage): Document --import-environment.
4575 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4577 2006-08-11 Eric Blake <ebb9@byu.net>
4579 * bootstrap (func_get_translations): Only remove files when doing
4581 (func_update_po): Avoid CDPATH problems.
4583 2006-08-10 Eric Blake <ebb9@byu.net>
4585 * bootstrap (func_get_translations): New function.
4586 (func_update_po): Borrow ideas from tar to correctly pull in
4587 translations from newer location.
4589 2006-08-09 Eric Blake <ebb9@byu.net>
4591 * bootstrap: Recent gnulib no longer has jm_* macros to worry
4593 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4595 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
4596 (m4_error, m4_warn): ... these new prototypes.
4597 (m4_current_file, m4_current_line): Move into context, rather
4598 than leaving as globals.
4599 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
4600 (m4_undivert_all, m4_input_init): Now takes context.
4601 * m4/utility.c (m4_error, m4_warn): New functions.
4602 * m4/m4private.h: Assume errno exists.
4603 (struct m4): Move warning_status to a bit flag,
4604 and add exit_status. Adjust accessors accordingly.
4605 * src/main.c (print_program_name_CB): No longer needed.
4606 (main): Use new m4_get_fatal_warnings_opt.
4607 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
4608 instead of issuing "INTERNAL ERROR". Pass context when needed,
4609 and use new accessors.
4610 * m4/input.c: Likewise.
4611 * m4/macro.c: Likewise.
4612 * m4/output.c: Likewise.
4613 * m4/utility.c: Likewise.
4614 * modules/evalparse.c: Likewise.
4615 * modules/gnu.c: Likewise.
4616 * modules/load.c: Likewise.
4617 * modules/m4.c: Likewise.
4618 * modules/mpeval.c: Likewise.
4619 * src/freeze.c: Likewise.
4620 * src/main.c: Likewise.
4621 * tests/macros.at: Adjust to new message format.
4622 * tests/builtins.at: Likewise.
4623 * tests/freeze.at: Likewise.
4624 * tests/modules.at: Likewise.
4625 * doc/m4.texinfo: Likewise.
4627 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
4630 2006-08-03 Eric Blake <ebb9@byu.net>
4632 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
4633 gracefully handle ENOSYS.
4637 2006-07-28 Eric Blake <ebb9@byu.net>
4639 * src/freeze.c (reload_frozen_state): Copy string when creating
4640 placeholder, to avoid memory corruption.
4641 * m4/symtab.c (symbol_popval): Avoid memory leak.
4642 (m4_symbol_rename): Avoid shadowing rename function.
4643 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
4644 * tests/freeze.at (reloading unknown builtin): Add test.
4645 * tests/generate.awk: Capture m4.texinfo line number in
4646 testsuite.log, not just generated.at.
4648 Port idea from branch that a frozen file can request an unknown
4649 builtin without producing a warning unless the builtin is
4651 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
4652 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
4653 (m4_set_symbol_value_placeholder): New accessors.
4654 * m4/m4module.h (m4_is_symbol_placeholder),
4655 (m4_get_symbol_value_placeholder),
4656 (m4_set_symbol_value_placeholder),
4657 (m4_get_symbol_placeholder): Likewise.
4658 * m4/symtab.c (m4_is_symbol_value_placeholder),
4659 (m4_get_symbol_value_placeholder),
4660 (m4_set_symbol_value_placeholder): Likewise.
4661 (dump_symbol_CB): Handle new symbol type.
4662 * m4/macro.c (trace_pre): Likewise.
4663 (m4_macro_call): Warn when invoking a placeholder.
4664 * modules/m4.c (dumpdef): Handle dumping a placeholder.
4665 (defn): Warn when referencing a placeholder.
4666 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
4668 (reload_frozen_state): When reloading unknown builtin, install a
4669 placeholder instead of warning.
4670 * tests/freeze.at (loading format 1): Allow warning when
4671 popdef'ing undefined function.
4673 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
4675 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
4676 function. Shift by 7, not 3, for consistency with
4677 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
4679 2006-07-27 Eric Blake <ebb9@byu.net>
4681 * src/main.c (usage): Update to match branch.
4682 (main): Update --version info to distinguish between program name
4683 `m4' and package name `GNU M4'.
4684 (AUTHORS): Translate René Seindal's name.
4685 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
4686 * Makefile.am (doc/m4.1): Update to match branch.
4687 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
4690 * m4/system_.h (EXIT_MISMATCH): Define.
4691 * src/main.c (main): Don't clear syntax table for version 1.
4692 (usage): Document exit status.
4693 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
4694 branch, and require V directive to appear first in file. Fix
4695 broken logic for detecting F and T in version 1 files.
4697 2006-07-22 Eric Blake <ebb9@byu.net>
4699 * src/main.c (stackovf_handler): Document the problems in our
4701 * src/stackovf.c: Forward port changes in branch to use POSIX
4702 sa_sigaction when available.
4703 (process_sigsegv): Avoid buffer overrun when error string is
4704 translated, although the fact that we translate in a signal
4705 handler is still a bug.
4706 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
4707 from branch to modernize checks.
4709 * modules/format.c (format): Avoid compiler warning that str may
4710 be used uninitialized.
4712 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
4714 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
4715 (DEBUG_MACRO): Remove unused macro.
4716 * src/stackovf.c: Avoid compiler warnings.
4717 * m4/input.c: Likewise.
4718 * m4/module.c: Likewise.
4719 * m4/output.c: Likewise.
4720 * m4/path.c: Likewise.
4721 * m4/symtab.c: Likewise.
4722 * m4/syntax.c: Likewise.
4724 2006-07-20 Eric Blake <ebb9@byu.net>
4726 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
4727 Regenerate to explicitly ask for --assume-autoconf=2.60.
4729 2006-07-19 Eric Blake <ebb9@byu.net>
4731 * po/ChangeLog: Merge into main ChangeLog, then delete file.
4734 * doc/m4.texinfo (copying): Relax restriction on front-cover and
4737 2006-07-17 Eric Blake <ebb9@byu.net>
4739 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
4742 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
4744 * modules/format.c (includes): Use xvasprintf.h.
4745 (format): Make static. Avoid buffer overflow, that can lead to
4746 arbitrary code execution exploit. Only pass unsigned char to
4747 is*(). Support F, g, and G specifiers.
4748 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
4751 2006-07-17 Gary V. Vaughan <gary@gnu.org>
4753 Ensure M4 compiles correctly with -DDEBUG, and use a single
4754 consistent definition of various /DEBUG_[A-Z]+/ symbols:
4756 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
4757 (m4_print_token): Use m4_get_symbol_value_text and
4758 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
4759 and VALUE_FUNC respectively.
4760 (m4__next_token): Use m4_print_token call instead of obsolescent
4762 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
4763 * m4/output.c: Similarly for DEBUG_OUTPUT.
4764 * m4/path.c: Similarly for DEBUG_INCL.
4765 * m4/symtax.c: Similarly for DEBUG_SYM.
4766 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
4767 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
4768 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
4769 preprocessor macros defined with -DDEBUG compiles.
4771 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
4773 * bootstrap: Correct typo in --download-po argument parsing.
4775 2006-07-15 Eric Blake <ebb9@byu.net>
4777 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
4779 * tests/generate.awk (normalize): Recognize @tabchar.
4780 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
4781 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
4783 (Index macro, Shell commands, Incompatiblities): Rename nodes
4784 from Index, UNIX commands, Other incompat.
4785 (Platform macros, Using frozen files, Frozen file format 1)
4786 (Frozen file format 2, Copying This Manual, Indices): New nodes.
4787 * Makefile.am (EXTRA_DIST): Distribute gendocs.
4788 (MAINTAINERCLEANFILES): Clean up files from gnulib.
4789 (doc_m4_TEXINFOS): Depend on fdl.texi.
4790 (web-manual): New maintainer target.
4792 2006-07-14 Gary V. Vaughan <gary@gnu.org>
4794 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
4795 the modular architecture of M4. The result is paraphrased here
4796 for the benefit of future readers of the manual.
4798 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
4800 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
4802 2006-07-14 Eric Blake <ebb9@byu.net>
4804 * src/main.c (main): Avoid compiler warning.
4805 * modules/gnu.c (renamesyms): Remove unused variable.
4807 2006-07-14 Gary V. Vaughan <gary@gnu.org>
4809 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
4810 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
4811 new functions for managing regexp syntax options.
4812 * m4/m4private.h (m4): Add regexp_syntax field.
4813 * m4/resyntax.c: New file implements the above.
4814 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
4815 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
4816 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
4817 (m4_patsubst_do, m4_renamesyms_do): Removed.
4818 (builtin_changeresyntax): New builtin to change regular expression
4820 (m4_resyntax_encode_safe): Factor out diagnostics code.
4821 * src/freeze.c (produce_resyntax_dump): New function to dump
4822 default regexp syntax specifier to frozen file.
4823 (reload_frozen_state): Updated to action 'R' directive.
4824 * src/main.c (usage): Describe new -r option.
4825 (long_options, OPTSTRING): Declare it.
4826 (main): Encode and store cli regexp syntax option argument.
4827 * tests/freeze.at (regexp syntax): New test that regexp syntax
4829 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
4830 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
4831 (Epatsubst and Patsubst): Renamed to...
4832 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
4833 documentation and added new examples.
4834 (Changeresyntax): New section describing changeresyntax builtin,
4835 and regexp syntax names.
4836 (Regular expression syntax): New section describing differences
4837 between various regular expression syntaxes.
4838 (Frozen files): Document 'R' directive.
4841 2006-07-13 Gary V. Vaughan <gary@gnu.org>
4843 * bootstrap: Enhanced to work more like our other scripts:
4844 Add a copyright statement; support --version and --help; accept a
4845 --download-po option with argument as a substitute for DOWNLOAD_PO
4848 2006-07-11 Eric Blake <ebb9@byu.net>
4850 * Makefile.am (doc/m4.1): Port patch from branch that avoids
4852 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
4855 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
4857 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
4858 that `\0' is no longer accepted.
4860 * src/main.c (usage): Alphabetize options within their sections.
4862 * modules/gnu.c (m4_regexp_search, regsub, substitute)
4863 (esyscmd): Improve comments.
4865 * modules/gnu.c (substitute): Remove old warning for \0.
4866 (substitute_warned): No longer required. Removed.
4868 * modules/gnu.c: Put macro definitions into alphabetical order.
4870 2006-07-07 Eric Blake <ebb9@byu.net>
4872 * tests/freeze.at (loading format 1): New file, with new test.
4873 * tests/testsuite.at: Include it.
4874 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
4875 * tests/modules.at (Freezing modules): Likewise.
4877 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
4878 (AC_CHECK_HEADERS): Assume signal.h.
4879 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
4880 (AC_CHECK_FUNCS_ONCE): Likewise.
4881 * src/m4.h (includes): Assume signal.h.
4883 2006-07-05 Eric Blake <ebb9@byu.net>
4885 Fix all testsuite failures on cygwin.
4886 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
4887 branch-1_4. Solves testsuite failure when uninstalled m4 is
4888 shadowed by redefinition of PATH in libtool wrapper.
4889 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
4890 contains the -no-undefined required by cygwin.
4891 (TESTS_ENVIRONMENT): Export abs_top_builddir.
4892 * tests/others.at (misc): Port to platforms where /etc/passwd
4893 does not exist or does not contain user named root.
4894 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
4896 * tests/builtins.at (define, divert): Avoid overquoting.
4897 * tests/generate.awk (new_group): Likewise.
4899 2006-07-05 Gary V. Vaughan <gary@gnu.org>
4901 The regs_allocated field in a struct re_pattern_buffer refers
4902 to the state of a particular re_registers struct when used in
4903 successive matches using the same compiled pattern. Avoid a
4904 SEGV in `renamesyms' resulting from using a new re_registers
4905 with an existing re_pattern_buffer:
4907 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
4908 pattern buffer and registers.
4909 (m4_regexp_search): New function to call re_regexp_search with
4910 correctly matched pattern buffer and register instantiations.
4911 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
4914 2006-07-04 Gary V. Vaughan <gary@gnu.org>
4916 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
4917 changes to gnulib getopt.m4 since last build.
4918 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
4919 if the system getopt fails M4_GETOPT tests.
4921 2006-06-22 Eric Blake <ebb9@byu.net>
4923 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
4924 Reported by Bruno Haible.
4926 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4928 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
4930 2006-06-19 Eric Blake <ebb9@byu.net>
4934 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4936 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
4937 (clean-local): Split into and depend upon...
4938 (clean-local-tests, clean-local-src): ...these two. The latter
4939 removes the libtool object directory below `src', to work around
4940 a buglet in Automake, failing to list it.
4941 (EXTRA_DIST): Distribute modules/perl.c.
4943 2006-06-19 Eric Blake <ebb9@byu.net>
4945 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
4946 right side of dependency; VPATH does that.
4947 (stamp-vcl): Update to use libtool's algorithm.
4948 (EXTRA_DIST): Distribute stamp-vcl.
4949 Reported by Ralf Wildenhues.
4950 (TESTSUITE): Revert earlier change that used absolute path, as
4951 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
4952 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
4953 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
4954 atlocal takes care of it instead.
4955 (check-local, installcheck-local, clean-local): Inline absolute
4956 path to testsuite here, rather than relative path to testsuite
4959 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4961 * m4/m4private.h (DELETE): Cast away const here...
4962 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
4963 * src/freeze.c (reload_frozen_state): Avoid uninitialized
4966 2006-06-19 Eric Blake <ebb9@byu.net>
4968 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
4969 .info pages are built.
4970 Reported by Ralf Wildenhues.
4971 (EXTRA_DIST): Inline definition of testsuite, so that make dist
4974 2006-06-16 Eric Blake <ebb9@byu.net>
4976 Follow recommendations from autoconf manual for autotest.
4977 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
4978 turn it into an absolute path until autotest provides an option
4979 that allows us to avoid changing directories. Properly quote
4981 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
4982 (check-recursive): Delete unused target.
4983 ($(TESTSUITE)): Atomically update testsuite.
4984 (CD_TESTDIR): Simplify.
4985 (m4__cd): Delete unused macro.
4986 (check-local): Let TESTSUITEFLAGS influence the run.
4987 (installcheck-local): Let TESTSUITEFLAGS override
4988 AUTOTEST_PATH. Add dependencies.
4989 (clean-local): Clean up.
4990 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
4991 * README: Document how to use the testsuite.
4993 2006-06-15 Eric Blake <ebb9@byu.net>
4995 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
4997 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
4998 clashes with m4sugar.
4999 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5000 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5001 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5002 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5003 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5004 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5005 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5006 * configure.ac: Likewise.
5007 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5008 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5010 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5012 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
5013 const mpq_t is not assignable from plain mpq_t. Avoid
5014 type-punning warnings caused trying to mix these types.
5015 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5016 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5017 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5018 (mult_term, exp_term): Remove type-punning casts.
5019 (numb_pow): Remove const qualifier.
5020 * src/freeze.c (reload_frozen_state): Fix typo in messages.
5021 Fix variables that can be used uninitialized, which fixes
5022 security hole where malicious frozen file can execute arbitrary
5025 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5027 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5029 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5030 and Eric Blake <ebb9@byu.net>
5032 Allow `make dist' to work again.
5033 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5034 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5035 (cvs-dist): Fix typo.
5036 * NEWS: Match current version number.
5038 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5040 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
5043 * bootstrap: Do not run libtoolize manually, this is done
5044 correctly by autoreconf. Invoke autoreconf with --no-recursive
5045 to avoid unnecessary rerunning of autotools for libltdl.
5047 2006-06-13 Eric Blake <ebb9@byu.net>
5051 2006-06-12 Eric Blake <ebb9@byu.net>
5053 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5055 * src/m4.h: Don't declare mktemp.
5056 * m4/input.c (m4__next_token): Avoid bzero.
5057 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5058 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5059 than distributing outdated helptoman.pl.
5060 * doc/helptoman.pl: Delete.
5062 2006-06-10 Eric Blake <ebb9@byu.net>
5064 * README (Patches): Document the current dependence on CVS
5065 builds of autotools.
5066 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5067 * configure.ac: Use consistent quoting throughout.
5068 (AC_PREREQ): Bump to 2.59d.
5069 (AC_INIT): Package name begins with uppercase.
5070 (AC_ARG_WITH): Use AS_HELP_STRING.
5071 (AM_INIT_AUTOMAKE): Enable gnits mode.
5072 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5073 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5074 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5075 done by gnulib or automake, or which autoconf has declared
5077 * m4/m4private.h (Includes): Assume C89 or better, and use errno
5079 * m4/output.c (Includes): Likewise.
5080 * modules/gnu.c (Includes): Likewise.
5081 * modules/m4.c (Includes): Likewise.
5082 * src/m4.h (Includes): Likewise.
5084 * README-alpha: Update web address.
5085 * README: Likewise. Change encoding to ASCII. Remove old advice
5086 about cygwin. Document bootstrapping dependency.
5087 * AUTHORS: Update from branch-1_4.
5088 * THANKS: Likewise. Change encoding to UTF-8.
5089 * BACKLOG: Delete. This file is too old and unmaintained to be
5091 * ChangeLog: Change encoding to UTF-8.
5093 Avoid compiler warnings.
5094 * m4/macro.c (trace_format): Don't mark this as a printf format,
5095 since we don't accept the same set of modifiers as printf. It
5096 would be nice if gcc let us specify a custom format archetype.
5097 * src/main.c (main): Cast away const.
5099 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
5100 Eric Blake <ebb9@byu.net>
5102 * modules/time.c (ctime): Pass correctly typed variable to
5105 (localtime): Likewise.
5106 (strftime): Likewise.
5107 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5108 limit inherent in this interface.
5110 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
5112 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5113 (sysval): Use WEXITSTATUS.
5114 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5115 big-endian and little-endian wait status definitions.
5117 2006-05-06 Eric Blake <ebb9@byu.net>
5119 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5120 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5123 2006-05-06 Eric Blake <ebb9@byu.net>
5125 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5126 subdirectory to use.
5127 (support for -pipe): Move after LT_INIT, since it relies on
5130 2006-05-05 Eric Blake <ebb9@byu.net>
5132 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5136 2006-05-05 Bruno Haible <bruno@clisp.org>
5137 and Eric Blake <ebb9@byu.net>
5139 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5140 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5142 * bootstrap: Update usage of gnulib-tool.
5144 2006-05-04 Eric Blake <ebb9@byu.net>
5146 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5149 2005-12-05 Gary V. Vaughan <gary@gnu.org>
5151 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
5152 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5153 Reported by Eric Blake <ebb9@byu.net>
5155 2005-12-04 Gary V. Vaughan <gary@gnu.org>
5157 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5158 http caching as -C is no longer supported by wget 1.10.x.
5159 Reported by Eric Blake <ebb9@byu.net>
5161 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5163 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5165 (iface_id): ...an lt_dlinterface_id type.
5166 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
5167 throughout, instead of calling obsolete lt_dlhandle_find directly.
5168 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
5169 throughout, instead of calling obsolete lt_dlhandle_next.
5170 * m4/m4private.h (m4__module_find): Declare it.
5171 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5172 Use m4__module_next instead of obsolete lt_dlhandle_next.
5174 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5176 * bootstrap (func_update_po): Update pofiles directly from the
5177 translation project.
5178 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5179 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5180 these files under source control anymore.
5181 Suggested by Eric Blake <ebb9@byu.net>
5183 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5185 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
5186 file escaped the address updates on 2005-05-01.
5188 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5190 * bootstrap: Allow user overriding of gnulib-tool location, and
5191 correctly determine module source directories whether gnulib-tool
5192 is given as a relative or absolute path, or is found by searching
5194 Reported by Eric Blake <ebb9@byu.net>
5196 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5198 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5199 and $RM are defined for various versions of
5200 AC_LIBTOOL_COMPILER_OPTION.
5202 * bootstrap (AUTORECONF): New variable to allow user overriding of
5205 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5207 * doc/m4.texinfo (History): Add better notes on the ancestory of
5208 GNU m4, and other historical interest.
5210 2005-05-08 Gary V. Vaughan <gary@gnu.org>
5212 * m4/symtab.c (m4_symbol_rename): New function that performs a low
5213 level symbol rename.
5214 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5215 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5216 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5218 (erenamesyms, renamesyms): ...builtins that use these to implement
5219 macro renaming by regular expression.
5220 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5221 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5222 to stop the new generated tests from choking.
5224 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5226 Since most of the build is handled from a single Makefile.am now,
5227 we can teach make about the dependencies between the m4 binary and
5228 the preopened modules it is built against:
5230 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5232 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5233 of the preopened modules have changed.
5235 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5237 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5238 have a native implementation.
5240 2005-05-06 Gary V. Vaughan <gary@gnu.org>
5242 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
5243 handled already by gnu/exit.h.
5245 * configure.ac (gl_MODULES): Add assert to support a
5246 --disable-assert configure time option for NDEBUG setting.
5248 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5249 * bootstrap (src_modules): Add version-etc-fsf.
5250 * src/main.c (version_etc_copyright): Removed.
5252 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5254 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5256 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5258 * src/freeze.c (produce_frozen_state): Use \n line-endings even
5259 on Windows, so that the frozen file reader will work.
5260 Reported by Josef T. Burger <bolo@bolo.com>
5262 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
5264 Forward port of a patch that allowed m4-1.4.2 to compile on
5267 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
5269 * src/m4.h: And include them as appropriate.
5270 * src/main.c, src/stackovf.h: Don't include signal.h literally;
5271 m4.h will include the correct file.
5273 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5275 * m4/m4private.h: Make errno visible for the sources patched
5278 2005-05-04 Paul Eggert <eggert@twinsun.com>
5280 * src/main.c (print_program_name_CB): Preserve errno, since
5281 M4ERROR relies on this.
5282 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
5283 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
5284 * m4/path.c (m4_path_search): Don't let "free" trash errno when
5287 * m4/output.c (m4_insert_file): Don't assume errno has a valid
5288 value simply because fread returns zero. This fixes a
5289 portability bug reported by Marion Hakanson in
5290 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
5292 2005-05-04 Santiago Vila <sanvila@debian.org>
5294 * tests/stackovf.test: Use tempfile if available.
5296 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
5298 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
5299 * m4/output.c (m4_insert_file): Do not mix buffered and
5300 unbuffered I/O, as this breaks on the Hurd.
5302 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5304 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
5305 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
5306 and libtoolize does a better job of ltdl importing now too, so
5307 take advantage of that while updating the tree:
5309 * acm4, config: Moved from here...
5310 * ltdl/m4, ltdl/config: ...to here.
5311 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
5312 src/Makefile.am, tests/Makefile.am: Removed...
5313 * Makefile.am: ...and migrated to here, with adjustments to
5314 compensate for relative path differences.
5315 * commit: Adjust relative paths.
5316 * configure.ac: Adjust relative paths.
5317 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
5319 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
5320 the meanwhile, CVS HEAD libtool is needed.
5321 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
5322 stricly new enough, we also need a patch.
5323 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
5324 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
5325 (gl_MODULES): Don't list getopt and version-etc, as they don't
5327 * bootstrap: After running gnulib-tool to import the listed
5328 modules, fetch getopt and version-etc into src manually.
5329 (ltdldir): Change to ltdl.
5330 * src/main.c: Adjust for changes in version-etc API.
5331 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
5332 but works when the getopt module isn't to be included in the lib.
5333 * README: Add note about patching autoconf and automake to
5336 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
5338 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
5339 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
5340 empty file rather than to a nonexistent file. This closes a
5341 common security hole.
5342 * modules/m4.c (m4_maketemp): Implement the above, by using
5343 mkstemp rather than mktemp.
5345 2005-05-01 Gary V. Vaughan <gary@gnu.org>
5347 The FSF are moving offices today. Changed their contact address
5348 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
5349 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
5351 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5353 * tests/Makefile (clean-local): Ignore testsuite cleanup
5356 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
5358 * tests/Makefile (clean-local): Only run the testsuite cleanup
5359 if the testsuite has been generated.
5361 2005-02-11 Stepan Kasal <kasal@ucw.cz>
5363 * TODO: slight clarification of the example of qindir usage.
5365 2005-02-08 Gary V. Vaughan <gary@gnu.org>
5367 * TODO: Add qindir requirement, and defn bug.
5368 From Stepan Kasal <kasal@ucw.cz>
5370 2005-02-08 Stepan Kasal <kasal@ucw.cz>
5372 * TODO: Add ``execution stack'', fix a typo.
5373 * doc/m4.texinfo: Typos.
5375 2004-12-24 Eric Blake <ebb9@byu.net>
5377 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
5378 to the gnu subdirectory.
5379 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
5380 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
5381 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
5382 * m4/system_.h: Likewise, in non-configured includes.
5384 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
5385 Gary V. Vaughan <gary@gnu.org>
5387 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
5388 Protect definitions from macro expansion under -DNDEBUG by
5389 parenthesising the expanded function names.
5390 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5391 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5392 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5393 (m4_is_syntax_macro_escaped): Similarly protect function
5394 definitions from macro expansion under -DNDEBUG by #undefing the
5395 matching macro names before each definition. Also, move all the
5396 function definitions to the end of the file so that any
5397 invocations in the rest of the file pick up the fast macro
5399 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
5400 (m4_set_debug_file, m4_set_trace_messages)
5401 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5402 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5403 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
5404 option setter functions.
5406 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5408 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
5411 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5413 * src/main.c: Include gnulib files from the correct directory.
5415 * gnulib/*: Don't store any of the gnulib files in arch, as they
5416 generate spurious changes.
5417 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
5418 gnulib macros now share our macro directory.
5419 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
5420 * bootstrap: Call gnulib-tool to import from the gnulib tree.
5421 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
5422 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
5423 the gettext macros from autopoint that overwrite the gnulib-tool
5424 imported versions. Import sources and Makefile.am into the `gnu'
5425 directory. Changed all callers.
5426 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
5427 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
5428 for imported modules.
5429 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
5430 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
5431 hardcoding the gnulib macros they wrap.
5433 2004-07-15 Gary V. Vaughan <gary@gnu.org>
5435 Latest CVS libtool can preload modules in libraries, including
5436 its own module loaders! Tweak m4 so that it doesn't try to treat
5437 libltdl's module loaders as m4 modules when freezing and on exit:
5439 * gnulib/acm4/*.m4: Don't store these files in arch since they
5440 generate spurious changes.
5441 * bootstrap: Simplify initial libtoolize call, since CVS
5442 libtoolize is smarter these days.
5443 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
5445 * m4/module.h (m4__module_exit): Missing declaration.
5446 * m4/m4private.h (m4__module_next): New function declaration.
5447 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
5448 encapsulation. Changed all callers.
5449 (m4__module_interface): New function to verify m4 loadable module
5451 (m4__module_init): Register the interface validator.
5452 (m4__module_exit): Only close my own modules.
5453 * modules/m4.c (unistd.h): Provide missing declaration.
5454 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
5455 (m4_expand_ranges): More missing declarations.
5456 * modules/modtest.c (export_test): Ditto.
5457 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
5458 * src/main.c (main): Bump copyright year.
5459 * tests/modules.at: Fix sed syntax error.
5462 2004-06-17 Gary V. Vaughan <gary@gnu.org>
5464 Tweaking to enable compilation with latest CVS libtool and
5465 libltdl. We can't just dump the library files directly into the
5466 m4 directory anymore now that libltdl is built from pieces itself:
5468 * bootstrap: Rewritten to use latest libtoolize sanely, and to
5469 set up libltdl subdirectory.
5470 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
5471 gnulib subdirectory's config.
5472 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
5473 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
5475 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
5476 configure.ac, so use AC_WITH_LTDL instead.
5477 * Makefile.am (SUBDIRS): Add libltdl.
5478 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
5480 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
5481 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
5482 (libm4_la_LIBADD): Add LIBLTDL.
5483 * m4/ltdl.c, m4/ltdl.h: Removed.
5484 * m4/m4module.h: Include canonical ltdl.h.
5487 2004-06-14 Gary V. Vaughan <gary@gnu.org>
5489 * gnulib/import: Now updates makefile fragments, and configure.ac.
5490 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
5491 * gnulib/m4/Makefile.am: include it.
5492 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
5493 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
5494 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
5495 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
5496 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
5497 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
5498 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
5499 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
5500 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5501 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5502 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5503 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
5504 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
5506 * gnulib/m4/getopt_int.h: New source file from latest gnulib
5508 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
5509 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
5510 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
5511 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
5512 Updated source files from latest gnulib.
5514 2004-02-29 Gary V. Vaughan <gary@gnu.org>
5516 * config/mailnotify: New file for mailing commit notifications,
5517 imported from cvs-utils.
5518 * commit: Updated from cvs-utils and tweaked for m4.
5520 2003-12-01 Gary V. Vaughan <gary@gnu.org>
5522 * config/mkstamp: Updated from CVS libtool.
5523 * configure.ac: Generate a gnu coding standards compliant version
5524 number, and use it for the banner.
5525 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
5526 mhen the TIMESTAMP changes in ChangeLog, but the file modification
5527 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
5528 contain the previous version number.
5529 * src/main.c: Make --version output conform to the GNU standard.
5531 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
5532 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
5533 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
5534 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
5535 time_la_SOURCES): ...so that these are defaulted correctly, and
5536 can be removed from this file.
5537 (AM_LDFLAGS): Add -module...
5538 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
5539 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
5540 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
5541 the individual settings can be removed.
5542 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
5543 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
5544 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
5545 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
5546 time_la_LIBADD): ...so that these are picked up as a deplib of
5547 libm4 and don't need to be set explicitly.
5549 2003-11-18 Gary V. Vaughan <gary@gnu.org>
5551 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
5552 from the standard build. It is too fragile.
5554 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5555 CVS libtool after merging m4 changes across to libtool.
5557 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5558 * m4/path.c (search_path_add): Ditto.
5560 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5562 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5563 libtool tags we don't use in configure. This reduces the size
5564 of the script from over 1Mb to under 700Kb.
5566 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5568 The import script was not written properly, and the last gnulib
5569 import was incomplete. Fixed that problem, and reimport our
5570 gnulib dependencies, which picks up the address calculation
5571 overflow checks described by Paul below. Also tweak the clients
5572 of the gnulib xalloc module not to use deprecated macros:
5574 * gnulib/import: Recurse through module dependencies rather than
5575 naively descending only one level.
5576 * configure.ac: Add calls to gnulib's strnlen and extension module
5578 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5580 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5581 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5582 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
5583 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
5585 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
5586 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
5587 place of `xcalloc (1, S)'.
5588 * m4/m4.c (m4_create): Likewise.
5589 * m4/m4private.h (m4_symbol_value_create): Likewise.
5590 * m4/symtab.c (symtab_fetch): Likewise.
5591 * m4/syntax.c (m4_syntax_create): Likewise.
5592 * src/freeze.c (reload_frozen_state): Likewise.
5593 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
5595 * m4/symtab.c (m4_symtab_create): Likewise.
5597 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5599 * tests/module.at: Comment typo.
5601 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5603 * tests/modules.at (modules: importing): Apply some lateral
5604 thinking, and use AT_CHECK to compare the output of a sed pass
5605 over stderr against the canonical strerror string.
5607 * tests/modules.at (modules: importing): Edit the generated stderr
5608 output to canonicalize strerror output, before a comparison.
5610 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5612 Tru64UNIX perl is sloppy with namespace pollution. This patch is
5613 careful not to trip over the mess:
5615 * modules/perl.c: Some builds of perl install headers that contain
5616 `#define try __builtin_try'. Be sure to undefine that macro
5617 before `m4/hash.h' gets included, which uses the `try' symbol.
5618 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
5619 `false' before including `stdbool.h'.
5620 (DELETE): This symbol is not in m4's namespace, and is in any
5621 case only used internally...
5622 * m4/m4private.h (DELETE): ...so move it to here.
5623 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
5625 2003-10-08 Paul Eggert <eggert@twinsun.com>
5627 Don't use XMALLOC and XCALLOC. Once we install the
5628 corresponding patch into gnulib, this will fix some
5629 address-calculation overflow bugs on hosts where calloc (A, B)
5630 returns garbage when A*B overflows.
5632 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
5633 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
5634 xmalloc, XCALLOC with xcalloc.
5635 * m4/m4.c (m4_create): Likewise.
5636 * m4/m4private.h (m4_symbol_value_create): Likewise.
5637 * m4/output.c (m4_output_init): Likewise.
5638 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
5639 * m4/syntax.c (remove_syntax_attribute): Likewise.
5640 * src/freeze.c (reload_frozen_state): Likewise.
5641 * src/main.c (main): Likewise.
5643 2003-10-07 Gary V. Vaughan <gary@gnu.org>
5645 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
5646 gnulib/acm4 directories for aclocal m4 macros.
5647 * gnulib/Makefile.am (EXTRA_DIST): Removed.
5648 (MAINTAINERCLEANFILES): Add Makefile.in.
5649 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
5651 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
5652 * gnulib/import: New file. Temporary script for updating gnulib
5653 imported files, until gnulib-tool is working.
5654 * gnulib/config/codeset.m4, gnulib/config/error.m4,
5655 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
5656 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
5657 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5658 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
5659 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5660 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5661 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5662 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
5663 gnulib/config/nls.m4, gnulib/config/obstack.m4,
5664 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
5665 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
5666 gnulib/config/regex.m4, gnulib/config/restrict.m4.
5667 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
5668 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
5669 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
5670 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
5671 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
5672 gnulib/config/xstrndup.m4: Removed.
5673 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
5674 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
5675 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
5676 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
5677 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
5678 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
5679 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
5680 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
5681 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
5682 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
5683 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
5684 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
5685 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
5686 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
5687 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5688 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
5689 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
5690 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5691 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5692 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
5693 gnulib/import script.
5694 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
5695 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
5696 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5697 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
5698 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
5699 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
5700 gnulib with gnulib/import script.
5701 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
5702 guards ready for gnulib-tool to autoupdate on import.
5703 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
5704 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
5705 config/stackovf.m4: Moved from here...
5706 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
5707 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
5708 acm4/stackovf.m4: ...to here, to separate aclocal macros from
5709 configure time helper scripts.
5710 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
5711 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
5712 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
5713 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
5715 * src/main.c (version_etc_copyright): Only output the current
5717 (version_etc): Call with new variadic API.
5719 2003-09-16 Gary V. Vaughan <gary@gnu.org>
5721 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
5722 version-etc module from CVS gnulib.
5723 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
5724 * src/Makefile.am: Build it.
5725 * src/main.c: Use it.
5727 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
5728 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
5729 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
5732 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
5733 Gary V. Vaughan <gary@gnu.org>
5735 * bootstrap: Separate options.
5736 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
5737 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
5739 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
5740 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
5741 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
5742 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
5743 $(LTLIBINTL) for gettext support on cygwin.
5744 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
5745 have $(LTLIBINTL) from the preloaded module la files.
5746 * README: Remove the warning about using --disable-nls on Windows
5749 2003-09-15 Gary V. Vaughan <gary@gnu.org>
5751 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
5752 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
5755 2003-09-12 Gary V. Vaughan <gary@gnu.org>
5757 * doc/STYLE: Document the gnulib header naming conventions, and
5759 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
5760 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
5761 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
5763 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
5765 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
5766 module from CVS gnulib.
5767 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
5768 (gl_FUNC_STRTOL): In favour of the module macro.
5770 2003-09-12 Gary V. Vaughan <gary@gnu.org>
5772 Replace the getopt code with CVS gnulib getopt. The source files
5773 detect whether they are in a glibc environment and preprocess away
5774 all of the code if there is a system getopt, so we can compile
5775 them into the m4 executable unconditionally:
5777 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
5778 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
5779 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
5781 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
5783 * src/Makefile.am: Adjust.
5784 * src/main.c: Always include our shipped getopt.h.
5785 * po/POTFILES.in: Use new location of getopt.c.
5787 2003-09-12 Gary V. Vaughan <gary@gnu.org>
5789 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
5790 * config/Makefile.am: Removed. Automake 1.8 distributes the files
5791 in this directory automatically.
5792 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
5794 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
5796 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
5798 * modules/Makefile.am (pkglibexecdir): Set it here.
5799 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
5801 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
5802 Import regex module from CVS gnulib.
5803 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
5804 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
5805 do extra substitutions for Makefile.
5806 * configure.ac: Use it.
5807 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
5808 from regex_.h if necessary.
5809 * m4/system_.h: Include the correct version of regex.h.
5810 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
5812 * po/POTFILES.in: Use new location of regex.c.
5814 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
5815 realloc.c: automake distributes these files already.
5817 2003-09-12 Gary V. Vaughan <gary@gnu.org>
5819 Replace the xstrzdup code by importing the xstrndup module from
5820 CVS gnulib, along with its dependencies: strndup and strnlen:
5822 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
5823 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
5825 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
5826 gnulib/config/strndup.m4: Ditto wrt strndup.
5827 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
5829 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
5830 However, contrary to gnulib, we install xstrndup.h.
5831 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
5832 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
5833 is an artifact of the old m4 portability layer.
5834 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
5835 * m4/system_.h: Include xstrndup.h.
5836 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
5838 2003-09-11 Gary V. Vaughan <gary@gnu.org>
5840 Reimport the latest xalloc module from CVS gnulib, and adjust the
5841 m4 sources to take advantage of xalloc xfree. Also create a new
5842 macro DELETE with the same semantics as the old m4 XFREE macro,
5843 and carefully tweak callers:
5845 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
5847 * m4/utility.c (xfree): Removed. This function is now supplied by
5849 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
5850 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
5851 * m4/symtab.c (m4_symtab_create): Ditto.
5852 * m4/system_.h: Removed XFREE redefine.
5853 (DELETE): New macro with same functionality as the original m4
5854 XFREE macro, but based on xalloc.h now. Changed all callers.
5855 * src/main.c (main): Use XMALLOC macro.
5856 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
5858 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
5860 2003-09-10 Gary V. Vaughan <gary@gnu.org>
5862 Import the xalloc module from CVS gnulib, along with its
5863 dependencies: exitfail, malloc and realloc. We had different
5864 semantics for our XFREE and a function xfree() not supplied by
5865 gnulib, so also a bit of work to keep everything running
5868 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
5869 (gl_XALLOC): Use gnulib equivalents.
5870 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
5871 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
5872 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
5873 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
5875 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
5876 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
5877 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
5879 (pkgincdir): Removed. Use pkgincludedir instead.
5880 * m4/m4private.h (XFREE): xfree already checks for NULL.
5881 * m4/system_.h: Use xalloc module, and remove macros already
5882 supplied by xalloc.h.
5883 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
5884 moved the old definition from m4/xmalloc.c to here for now.
5886 2003-09-09 Gary V. Vaughan <gary@gnu.org>
5888 Import the error and progname modules from CVS gnulib. Our old
5889 error.c subsumed the functionality of both, so a little adjustment
5890 was required to accomodate the split in sources. Also added more
5891 wrapper macros to choose between a system installed error.h or our
5892 shipped gnulib error module:
5894 * m4/error.c, m4/error.h: Removed.
5895 * m4/Makefile.am: Adjust.
5896 (pkgincdir): Removed. Use pkgincludedir instead.
5897 * m4/module.h, src/main.c: Don't include `m4/error.h'.
5898 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
5900 * gnulib/m4/progname.c: Imported from CVS gnulib.
5901 * gnulib/m4/progname.h: Ditto.
5902 * src/main.c: Adjust to use progname module.
5903 * gnulib/m4/error.c: Imported from CVS gnulib.
5904 * gnulib/m4/error_.h: Ditto.
5905 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
5906 if appropriate, and link a local error.h if the system version is
5908 (libgnu_la_SOURCES) Add progname module sources.
5909 * gnulib/config/error.m4: Imported from CVS gnulib.
5910 * gnulib/config/strerror_r.m4: Ditto.
5911 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
5912 to have ERROR_H for Makefile substitutions and tell system.h
5913 whether the system error.h should be used, or a locally installed
5915 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
5917 2003-09-09 Gary V. Vaughan <gary@gnu.org>
5919 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
5920 s/gettext_.h/gettext.h/.
5922 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
5923 automake have been fixed.
5925 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
5926 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
5927 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
5928 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
5930 2003-09-09 Gary V. Vaughan <gary@gnu.org>
5932 The gnulib obstack module requires the gnulib gettext module for
5933 systems that do not have GNU gettext installed. Because we use
5934 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
5935 that directory incase it clashes with the system gettext.h. This
5936 delta uses gettext_.h and extra rules in the Makefile to make a
5937 link to gettext.h when needed:
5939 * Makefile.am (auxdir): Removed. No longer used.
5940 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
5941 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
5943 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
5944 Makefile based build.
5945 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
5946 of the macros are kept.
5947 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
5948 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
5949 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
5950 distributes these automatically.
5951 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
5952 warning from automake-1.7a.
5953 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
5954 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
5956 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
5957 wrt. m4_FUNC_OBSTACK.
5958 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
5959 wrt. m4_sys_STACKOVF.
5960 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
5961 wrt. _m4_LIB_GMP, m4_LIB_GMP.
5962 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
5963 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
5965 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
5966 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
5967 gettext.h link on deficient systems.
5968 (pkginc_HEADERS): Mention $(GETTEXT_H).
5969 (EXTRA_HEADERS): Mention gettext.h.
5970 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
5971 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
5972 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5973 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
5974 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5975 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5976 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5977 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
5978 gnulib/config/po.m4, gnulib/config/progtest.m4,
5979 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
5980 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
5982 2003-09-05 Gary V. Vaughan <gary@gnu.org>
5984 We can't mirror the gnulib directory structure here, since we need
5985 to be able to eg. `#include <m4/obstack.h>' from our source files,
5986 which is much easier if the local obstack.h is created in a
5987 directory named m4. Rather than trying to symlink everything into
5988 the m4 directory, now we build a libtool convenience library from
5989 the sources we get from gnulib and link that with libm4.la:
5991 * gnulib/config/extensions.m4: Imported from CVS gnulib.
5992 * gnulib/config/unlocked-io.m4: Ditto.
5993 * gnulib/m4/unlocked-io.h: Ditto.
5994 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
5995 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
5996 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
5997 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
5998 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
5999 * m4/Makefile.am: Adjust.
6000 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6001 macros we redistribute.
6002 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
6003 library among others.
6004 (GNULIB_SRCS, GNULIB_MACROS): Removed.
6005 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6006 * config/m4-obstack.m4: Adjust.
6007 * po/POTFILES.in: Adjust.
6008 * configure.ac: Reformatting. Call newly imported gnulib macros.
6009 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6010 bogus calls of `#include "m4.h"'.
6011 * Makefile.am: INCLUDES has been deprecated in favour of
6013 * m4/Makefile.am: Ditto.
6014 * modules/Makefile.am: Ditto.
6015 * src/Makefile.am: Ditto.
6017 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6019 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6021 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6023 Migrate the obstack support into the gnulib directories for easy
6024 synchronisation with upstream files in gnulib:
6026 * config/gnu-obstack.m4: Moved from here...
6027 * config/m4-obstack.m4: ...to here.
6028 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6029 * m4/obstack.c, m4/obstack_.h: Moved from here...
6030 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6031 * po/POTFILES.in: Adjust.
6032 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6033 * m4/Makefile.am: Add a whole new section to link the obstack
6034 sources from the gnulib tree if necessary.
6035 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6037 * config/m4-obstack.m4: Rewrite as a wrapper for
6038 gnulib/m4/obstack.m4.
6040 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6042 GNU M4 currently builds with a number of files adapted from
6043 upstream sources. Recently the gnulib project on savannah.gnu.org
6044 has pulled together a great many of these externally maintained
6045 files. This delta is the beginnings of isolating those files
6046 maintained in gnulib to make it easy to synchronise M4 with the
6047 upstream files prior to releases.
6049 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6051 (SUBDIRS): Added new gnulib subdirectory.
6052 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6053 * config/stdbool.m4: Moved from here...
6054 * gnulib/m4/stdbool.m4: ...to here.
6055 * m4/stdbool_.h: Moved from here...
6056 * gnulib/lib/stdbool_.h: ...to here.
6057 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
6059 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6060 code to work with new stdbool_.h location.
6061 (gnulib_srcdir): New.
6063 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6065 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6066 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6068 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
6069 (EXTRA_DIST): Use it.
6071 * bootstrap: CVS autoreconf leaves file droppings. Remove
6072 aclocal.m4t incase autoreconf doesn't.
6074 2003-08-29 Gary V. Vaughan <gary@gnu.org>
6076 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
6077 the other gnulib imports, renamed to m4/obstack_.h.
6078 * m4/obstack.c: Updated from CVS gnulib.
6079 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6080 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6081 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
6082 about vpath already, and $top_srcdir upsets CVS Automake, so the
6083 $top_srcdir reference was removed.
6085 * m4/system-h.in: For consistency with the gnulib imports, renamed
6087 * m4/Makefile (EXTRA_HEADERS): Adjust.
6088 * configure.ac (AC_CONFIG_FILES): Adjust.
6090 * m4/stdbool_.h: New file from gnulib for systems without their
6092 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6093 * config/stdbool.m4: New file. Macros from gnulib for same.
6094 * configure.ac: Use it.
6096 2003-08-27 Gary V. Vaughan <gary@gnu.org>
6098 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6099 * config/gmp.m4: Ditto.
6100 * config/gnu-obstack.m4: Ditto.
6101 * config/stackovf.m4: Ditto.
6102 * m4/builtin.c: Ditto.
6103 * m4/debug.c: Ditto.
6104 * m4/error.c: Ditto.
6105 * m4/error.h: Ditto.
6106 * m4/gnu-obstack.h: Ditto.
6109 * m4/input.c: Ditto.
6111 * m4/m4module.h: Ditto.
6112 * m4/m4private.h: Ditto.
6113 * m4/macro.c: Ditto.
6114 * m4/module.c: Ditto.
6115 * m4/obstack.c: Ditto.
6116 * m4/output.c: Ditto.
6118 * m4/regex.c: Ditto.
6119 * m4/regex.h: Ditto.
6120 * m4/strtol.c: Ditto.
6121 * m4/symtab.c: Ditto.
6122 * m4/syntax.c: Ditto.
6123 * m4/utility.c: Ditto.
6124 * m4/xmalloc.c: Ditto.
6125 * m4/xstrdup.c: Ditto.
6126 * m4/xstrzdup.c: Ditto.
6127 * modules/evalparse.c: Ditto.
6128 * modules/format.c: Ditto.
6129 * modules/gnu.c: Ditto.
6130 * modules/import.c: Ditto.
6131 * modules/load.c: Ditto.
6132 * modules/m4.c: Ditto.
6133 * modules/m4.h: Ditto.
6134 * modules/modtest.c: Ditto.
6135 * modules/mpeval.c: Ditto.
6136 * modules/perl.c: Ditto.
6137 * modules/shadow.c: Ditto.
6138 * modules/stdlib.c: Ditto.
6139 * modules/time.c: Ditto.
6140 * modules/traditional.c: Ditto.
6141 * src/freeze.c: Ditto.
6142 * src/getopt.c: Ditto.
6143 * src/getopt1.c: Ditto.
6145 * src/main.c: Ditto.
6146 * src/stackovf.c: Ditto.
6148 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6149 ac_default_headers is an autoconf internal variable.
6150 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6151 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6153 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6154 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6157 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6159 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6161 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6162 possible or faking one with a typedef. Changed all callers.
6164 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6166 Still cleaning up the users' module API, by taking out the stuff
6167 that isn't used by any existing modules, and moving specialised
6168 functions out of libm4 and into the module they are used by.
6170 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
6171 * m4/utility.c (m4_skip_space): ...to here the home of its only
6172 use, made static and renamed to `skip_space'. Changed all
6174 * m4/m4module.h (m4_expand_ranges): Removed prototype.
6175 * m4/utility.c (m4_expand_ranges): Moved definition from here...
6176 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6178 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6180 * modules/gnu.c (builtin_syntax): Import and use in this
6181 builtin implementation.
6182 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6184 * m4/macro.c (trace_flush): Except here where the macro is now
6186 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6187 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6189 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6190 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6192 2003-08-14 Gary V. Vaughan <gary@gnu.org>
6194 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6195 compiler based AC_CHECK_HEADER that was introduced in
6197 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6198 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6199 * configure.ac: Use renamed M4_AC_LIB_GMP.
6201 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6202 macro that requires arguments! This stops the shell's bad
6203 substitution error at configure time.
6205 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6206 variables to the testsuite shell. Set the value of USE_GMP so
6207 that the gmp test will run!
6208 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6210 2003-08-11 Gary V. Vaughan <gary@gnu.org>
6212 Libltdl already has an excellent mechanism for accessing C symbols
6213 in modules. Lets use that! Remove all the exporting cruft and
6214 just use lt_dlsym in conjunction with a few conventions to
6215 simplify module writers' jobs. Also removed the table address
6216 caching code and otherwise simplified the module loader quite a
6217 bit. To access exported symbols in other modules, first the
6218 exporting module must name the symbols <modname>_LTX_<symname>,
6219 and the importing module must define a function type called
6220 <symname>_func. The importer then adds
6221 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6222 that wishes to call out to the exported functions. Care must be
6223 taken that <symname> is non-NULL in the importing module incase
6224 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6225 definition was in the importers source. Study
6226 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
6227 m4_module_import will attempt to automatically load a module
6228 required for symbol access if it is not loaded already.
6230 * TODO: Removed the items fixed in this delta.
6231 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6233 * m4/ltdl.h (lt_dlhandle_find): Declare it.
6234 * m4/module.c (m4_module_unload): Use it.
6235 * src/freeze.c (reload_frozen_state): Ditto.
6236 * m4/m4module.h (m4_export): Deleted. Removed all references.
6237 (M4_MODULE_IMPORT): New user convenience macro for importing
6238 arbitrary symbols from other modules.
6239 * m4/module.c (m4_module_import): New function to service
6240 M4_MODULE_IMPORT macro.
6241 (module_data): Removed. Looking up the tables on demand with
6242 lt_dlsym, rather than caching their addresses here simplifies the
6244 (m4_get_module_builtin_table, m4_get_module_macro_table):
6245 Removed. Changed all callers.
6246 (set_module_macro_table, set_module_builtin_table): Renamed to
6247 install_macro_table and install_builtin_table respectively, and
6248 simplified now that the cache is no more.
6249 * modules/gnu.c (builtin_symbols): Use this new mechanism to
6250 import m4_dump_symbols from the m4 module.
6251 (builtin_esyscmd): Likewise for m4_set_sysval and
6253 * modules/m4.c (m4_export_table): Removed. Functions are
6254 addressed with the new mechanism which doesn't need this.
6255 (m4_set_sysval): New exported accessor function to prevent
6256 problems with variable access on inferior architectures.
6257 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6258 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6259 that we can have some type safety.
6260 * modules/modtest.c (export_test): C level exported function for
6261 testing the new import mechanism.
6262 * modules/import.c: New file for the import end of the test.
6263 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
6264 * tests/modules.at: New test cases for intermodule symbol
6267 2003-08-07 Gary V. Vaughan <gary@gnu.org>
6269 * m4/m4module.c (m4_string): Moved from here...
6270 * m4/m4private.c (m4_string): ...to here.
6272 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
6274 2003-07-29 Gary V. Vaughan <gary@gnu.org>
6276 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
6277 already available to module writers through
6278 m4_{get,set}_nesting_limit_opt(), so moved from here...
6279 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
6280 (m4_create): Use it.
6282 2003-07-28 Gary V. Vaughan <gary@gnu.org>
6284 Aside from auditing path.c for m4module.h api obfuscation, this
6285 delta introduces the concept of private struct members in opaque
6286 data types to GNU m4: See the STYLE file for details.
6288 * TODO: Remind ourselves that a rewrite of path.c is needed.
6289 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
6291 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
6292 here and renamed. These type definitions are for internal api use
6293 only. Changed all callers.
6294 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
6296 * m4/path.c (search_path_env_init, search_path_add): ...to here
6297 and renamed. These calls were never used outside this file.
6298 Changed all callers.
6299 (dirpath): Moved functionality of this static declaration...
6300 * m4/m4private.h (struct m4): ...to this new internal only
6301 search_path field. Changed all callers.
6302 (m4__get_search_path): Added new internal api accessor.
6303 * m4/path.c (m4_search_path_info_new): Removed. Not used.
6304 (m4_include_init): Removed...
6305 * m4/m4.c (m4_create): ...because the new m4 field is now
6307 (m4_delete): Recycle search_path memory.
6308 * src/main.c (main): Don't call m4_include_init now that it's
6310 * doc/STYLE: Document convention for private fields in opaque
6313 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6315 Sometimes exporting the address of a symbol from a module isn't
6316 enough for other modules to call that symbol correctly. If
6317 custom data types are used for function parameters, they need to
6318 be known to the caller. This change introduces the concept of
6319 $(prefix)/include/modules/$(modulename).h to declare those
6320 structures. Also we move m4_dump_symbols from libm4 to the m4
6321 module to show this concept in action.
6323 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
6324 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
6325 exporting data structures from modules/m4.c.
6326 * modules/m4.c, modules/gnu.c: Include it.
6327 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
6328 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
6330 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
6332 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
6333 ...to here, with slight renaming.
6334 (m4_export_table): Prototype and add m4_dump_symbols.
6335 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
6336 definition of m4_dump_symbols.
6337 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
6338 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
6340 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6342 Create an export table in modules/m4.c in readiness for beefing up
6343 the module loader to track module exports and imports.
6345 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
6346 * m4/debug.c (m4_debug_flush_files): Moved...
6347 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
6348 * modules/gnu.c (builtin_esysval): Use it.
6349 * m4/m4module.h (m4_export): New type for declaring module symbols
6351 * modules/m4.c (m4_export_table): List symbols exported from this
6352 module for use by other modules.
6354 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6356 An experiment: There is loads of code in libm4 which should be in
6357 the m4 module, but is also used by another module. Just because
6358 some linkers won't cope with calls across dynamic runtime loaded
6359 objects I initially left the code in libm4. It will tidy the
6360 module api immensely if this code moves to the right place, I just
6361 need to remember to invent a suitable calling mechanism at some
6362 point. For now, only modules that are statically linked and
6363 preloaded will get this treatment, so the only platforms that will
6364 break are those that require all symbols to be resolved at link
6367 * TODO: Reminder that what I am doing could reduce portability
6368 unless I do something more robust later.
6369 * m4/m4module.h (m4_sysval): No longer exported from libm4.
6370 * m4/utility.c (m4_sysval): No longer declared in libm4.
6371 * modules/Makefile.am: Reformatting.
6372 * modules/m4.c (m4_sysval): Declare it at place of use.
6373 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
6375 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6377 * m4/m4module.h: Reformatting and rearranging lines a bit.
6378 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
6380 (m4_call_macro, m4_expand_input): Renamed...
6381 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
6383 (m4_expansion_level, m4_process_macro): Moved...
6384 * m4/macro.c (expansion_level, process_macro): ...to here, and
6387 * m4/m4module.h (program_name): Not used by modules at all, so
6389 * src/main.c (program_name): ...to here.
6390 (print_program_name): Renamed...
6391 (print_program_name_CB): ...to conform to the STYLE guide.
6393 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6395 More refactoring of the m4module.h API. Replace #defines with an
6396 enum, and move non-public functions out of the public API.
6398 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
6400 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
6401 * m4/debug.c (m4_debug, trace): Moved...
6402 * m4/m4private.h (struct m4): ...to fields of this struct.
6403 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
6405 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
6406 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
6407 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
6408 * m4/m4module.h (m4_context_field_table): Add entries for new
6409 debug_file and trace_messages fields.
6410 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
6411 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
6412 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
6413 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
6414 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
6415 (m4_is_debug_bit): New macro to simplfy checks against the debug
6417 (m4_trace_format, m4_trace_header, m4_trace_flush)
6418 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
6420 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
6421 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
6422 * m4/macro.c (trace_format, trace_header, trace_flush)
6423 (trace_prepre, trace_pre, trace_post): ...to these newly static
6424 functions, since they are only ever used from this file. Changed
6427 2003-07-17 Gary V. Vaughan <gary@gnu.org>
6429 Change the macros for checking syntax so that matching against
6430 multiple possible syntax classes can be done with a single
6431 comparison some of the time. The various classes are now bits of
6432 an int that can be checked with bitwise logic operators.
6434 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
6435 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
6436 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
6437 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
6438 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
6439 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
6440 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
6441 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
6442 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
6443 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
6444 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
6445 Replace all calls with invocations of these...
6446 (m4_is_syntax, m4_has_syntax): ...New macros.
6447 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
6448 is no longer required with new macros. Changed all callers.
6450 2003-07-15 Gary V. Vaughan <gary@gnu.org>
6452 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
6453 values are returned as part of the internal interface, so they
6455 * m4/private.h: ...to here.
6456 * m4/macro.c (expand_token): Check for out of range
6457 m4_peek_input() results before looking up in the syntax table.
6458 (collect_arguments): Ditto.
6460 * NEWS: Note `$' syntax class.
6462 2003-07-08 Paul Eggert <eggert@twinsun.com> and
6463 Gary V. Vaughan <gary@gnu.org>
6465 Conform to POSIX if the POSIXLY_CORRECT environment is set.
6466 --traditional `define' now smashes all the definitions.
6468 * NEWS: Explain this.
6469 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
6470 (Extensions): Explain that extensions that are incompatible with
6471 POSIX are disabled if POSIXLY_CORRECT is set.
6472 (Incompatibilities): Remove.
6473 (Define, Other Incompat): Explain difference
6474 between GNU and POSIX behavior of define, pushdef, popdef.
6475 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
6476 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
6477 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
6478 (m4_get_posixly_correct_opt): New macro.
6479 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
6481 * modules/m4.c (builtin_functions): defn now takes any number of args.
6482 (builtin_define): Smash all the definitions if
6484 (builtin_defn)): Allow any number of arguments.
6485 (builtin_undivert): Do not allow nonnumeric arguments
6487 * src/main.c (main): Set posixly-correct behavior if either
6488 POSIXLY_CORRECT is set, or if -G is given.
6489 * tests/builtins.at: New test for smashed definitions.
6491 2003-06-27 Gary V. Vaughan <gary@gnu.org>
6493 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
6494 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
6495 not to slow the parser down.
6496 (M4__IS_STRING): New macro to test string syntax class membership.
6497 * m4/syntax.c: Adjust docucomment.
6498 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
6499 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
6500 * m4/input.c (init_builtin_token): Comment typo.
6501 (m4__next_token): Comment typo.
6502 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
6503 by using the new M4__IS_STRING macro.
6504 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
6505 variable references in macro expansions.
6507 * doc/m4.texinfo (Eregexp and Regexp): Typo.
6508 (Epatsubst and Patsubst): Typo.
6511 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6513 Move the global variables that pertain to syntax to a new `struct
6514 m4_syntax_table', and then add one of these to `struct m4'. The
6515 ripple effect through the code to both change formerly global
6516 references, and make sure a suitable context is available in
6517 lexical scope is disproportionately large compared to the size of
6518 the change proper. This change is a large part of decoupling
6519 syntax.c from the rest of the code that uses it.
6521 * m4/m4private.h (struct m4): Add a syntax field.
6522 * m4/m4.c (m4_create): Initialise it,
6523 (m4_delete): Recycle it.
6524 (m4_get_symtab): Remove hand coded version...
6525 (m4_get_symbol_table): ...and generate this with cpp. Changed all
6527 * m4/m4module.h (m4_context_field_table): Add an extra field so we
6528 can generate m4_get_symbol_table. Add a new row for
6529 m4_get_syntax_table.
6530 (M4SYNTAX): Syntactic sugar for module writers.
6531 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
6532 (m4_syntax_table): New home for syntax related formerly global
6534 * m4/m4private.h (struct m4_syntax_table): Define it.
6535 * m4/input.c (m4_input_init): Initialisation of these formerly
6536 global variables moved...
6537 * m4/syntax.c (m4_syntax_create): ...to here.
6538 * m4/input.c (m4_input_exit): And similarly, recycling of the
6539 memory used by those values moved...
6540 * m4/syntax.c (m4_syntax_delete): ...to here.
6541 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
6542 Moved to m4/m4private.h.
6543 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6544 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6545 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6546 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
6547 objects. Changed all callers that used to directly access the
6549 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
6550 Removed and incorporated into m4_syntax_table structure.
6551 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
6552 * m4/syntax.c (m4_set_syntax): Now returns an error status,
6553 instead of requiring a `struct m4' to generate its own errors.
6554 Changed all callers.
6555 * src/main.c (main): Now that the syntax table is initialised as
6556 part of m4_create, we have to manually wipe the syntax entries if
6557 we are about to read a frozen file.
6559 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6561 * doc/STYLE: Added notes on callback naming schemes.
6563 * m4/module.c (m4_set_module_macro_table)
6564 (m4_set_module_builtin_table): Declarations weren't changed when
6565 definitions were renamed on 2003-06-19.
6567 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
6568 neither used nor particularly appropriate since it exposes the
6569 internal workings of the hash module. I haven't yet decided
6570 whether to remove it entirely.
6572 2003-06-20 Gary V. Vaughan <gary@gnu.org>
6574 Two related changes, and a huge knockon effect throughout the
6575 source: Moved the option variables out of global space and into
6576 `struct m4'; made `m4_symtab' a real datatype, so that its api
6577 is not marred passing `struct m4' around just so it can decide
6578 whether to keep traced symbol names or not. Added setters and
6579 getters for the formerly global option variables, and obviously
6580 changed a vast number of functions to take a `struct m4' and use
6581 the getter funcs to find option values.
6583 * m4/utility.c (interactive, sync_output, debug_level)
6584 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
6585 (max_debug_argument_length, warning_status, nesting_limit)
6586 (discard_comments): Removed.
6587 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
6588 (debug_level, max_debug_argument_length, prefix_all_builtins)
6589 (suppress_warnings, discard_comments, interactive, sync_output):
6590 Removed from here...
6591 * m4/m4private.h (struct m4): ...and equivalent fields added to
6593 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6594 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6595 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6596 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6597 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
6598 macros for the new fields.
6599 * m4/m4module.h (m4_context_field_table)
6600 (m4_context_opt_bit_table): Helper macros used to generate
6601 prototypes, setters and getters for new option fields
6603 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6604 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6605 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6606 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6607 (m4_get_interactive_opt, m4_get_sync_output_opt)
6608 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6609 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6610 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
6611 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
6612 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
6613 setter and getter functions generated by cpp from
6614 m4_context_field_table and m4_context_opt_bit_table, exported as
6615 part of the module api. Changed all callers.
6616 * m4/symtab (struct m4_symtab): Used as the concrete type for
6618 (m4_symtab_create): Allocate and initialise a new struct.
6619 (m4_symtab_apply): New function that works like m4_hash_apply, but
6620 with different callbacks specific to symbol tables. Changed all
6622 (symbol_destroy, arg_destroy, arg_copy): Renamed
6623 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
6624 they have unused parameters for a reason!
6625 (dump_symbol_CB): New callback to dump the contents of a single
6627 (symtob_dump): Rewritten in terms of dump_symbol_CB.
6628 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
6629 Changed all callers.
6630 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
6631 of the contained `m4_symtab' at the `no_gnu_extensions' field.
6632 Although I'm not convinced these semantics are correct, they are
6633 at least consistent with how things were before this delta. Also
6634 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
6636 2003-06-19 Gary V. Vaughan <gary@gnu.org>
6638 Tie down the interface to libm4 some more. Make more structures
6639 opaque to modules by moving them to m4private.h, and writing
6640 setters and getters. To win back the speed penalty for doing this
6641 also wrote macroized versions that do know about structure layout
6642 in m4private.h and #include that file into modules when NDEBUG is
6643 defined at compile time. There are still some accessor macros in
6644 m4private.h that need to go, but that is not necessary to clean
6647 * m4/m4module.h (m4_symbol_type): Moved...
6648 * m4/m4private.h (m4__symbol_type): ...to here.
6649 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
6650 (m4_set_symbol_traced, m4_set_symbol_name_traced)
6651 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6652 (m4_get_symbol_func, m4_symbol_value_create)
6653 (m4_symbol_value_delete, m4_set_symbol_value_text)
6654 (m4_set_symbol_value_func): New exported api to symbols.
6655 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
6656 and m4_is_symbol_value_func.
6657 * m4/m4module.h: Prototype these guys.
6658 * m4/module.c (m4_set_module_macro_table)
6659 (m4_set_module_builtin_table): Make these static, there is no
6660 reason to pollute the api with them.
6661 * m4/m4private.h: Reformatting.
6662 (m4_get_symtab): Only define when NDEBUG is defined.
6663 (m4_get_symbol_value, m4_get_symbol_traced)
6664 (m4_set_symbol_traced, m4_set_symbol_name_traced)
6665 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6666 (m4_get_symbol_func, m4_symbol_value_create)
6667 (m4_symbol_value_delete, m4_set_symbol_value_text)
6668 (m4_set_symbol_value_func): Macro implementations of the new
6669 functions when NDEBUG is defined.
6670 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
6671 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
6672 Superceded by the above. All callers changed.
6673 (M4ARG): Removed. This is no longer different to the
6674 m4/m4module.h definition.
6675 * modules/gnu.c, modules/m4.c: Only include m4private.h when
6676 NDEBUG is defined. That way we exercise the same (albeit slower)
6677 api that external modules must use.
6679 2003-06-18 Gary V. Vaughan <gary@gnu.org>
6681 Renamed some of the types and their accessors to make more sense.
6682 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
6683 has a stack of SYMBOL_VALUEs.
6685 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
6686 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
6687 m4_get_symbol_value_type, m4_get_symbol_value_text,
6688 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
6689 Changed all callers.
6690 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
6691 (m4_get_token_type): Renamed
6692 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
6693 to the internal api.
6694 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
6696 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
6697 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
6698 (m4__token_type): Moved here from m4module.h.
6699 (m4__next_token): Renamed from m4_next_token.
6700 * m4/symtab.c: Removed some of the parameterised macro support
6701 functions for modularisation later.
6702 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
6703 m4_hash_dup to perform a true deep copy of the SRC.
6704 (arg_copy): Callback for m4_symbol_value_copy.
6705 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
6706 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
6707 m4_get_symbol_value_func. Changed all callers.
6709 2003-06-18 Gary V. Vaughan <gary@gnu.org>
6711 Tidy up style of hash.[ch] in accordance with doc/STYLE.
6713 * m4/hash.c: Internal symbol renaming and formatting.
6714 (m4_hash_dup): New function to facilitate deep copies of hash
6716 (m4_hash_apply_func): Returns a void* now, which is a richer type
6717 for returning exceptions (NULL means keep going).
6718 (m4_hash_apply): Ditto.
6719 * m4/hash.h: Declare exported symbols with an explicit extern.
6722 2003-06-17 Gary V. Vaughan <gary@gnu.org>
6724 Still refactoring furiously. This delta represents a change in
6725 semantics to symtab.c. Instead of building temporary m4_tokens
6726 in the caller, and copying fields in the methods, we now create
6727 the actual m4_token for hashing in the caller so the methods just
6728 slot them in directly. Also, this means that we don't lookup a
6729 symbol and get back an allocated but VOID token to copy fields
6730 into, we create the token we want to push and pass that to
6731 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
6732 a few other small changes to stop knowledge of the implementation
6733 of symtab.c leaking out into other files.
6735 * m4/macro.c (expand_argument): Comment typo corrected.
6736 * m4/symtab.c (symtab_fetch): New function to fetch the address of
6738 (m4_symbol_pushdef): Take an extra value parameter and use this
6739 directly as the new top of the value stack. All callers changed
6740 to build a token and pass responsibility for memory in, rather
6741 than copying as we used to.
6742 (m4_symbol_define): Also use the new value parameter directly as a
6743 replacement for the top of the value stack. All callers changed
6744 to build a token as above.
6745 (m4_set_symbol_traced): New function to set the traced bit on the
6746 named symbol, creating it if necessary.
6747 (symbol_popval): The guts of the old m4_symbol_popdef.
6748 (m4_symbol_popdef): Use it.
6749 * m4/builtin.c (m4_symbol_set_token): Removed,
6750 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
6752 * m4/module.c (m4_set_module_builtin_table)
6753 (m4_set_module_macro_table): ...with these more orthogonal
6755 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
6756 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
6758 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
6759 (m4_arg_signature_parse): Moved...
6760 * m4/symtab.c: ...to here.
6761 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
6762 screw something up. Moved...
6763 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
6764 actually does a proper deep copy of source to dest.
6766 2003-06-16 Gary V. Vaughan <gary@gnu.org>
6768 Further refactoring to stabilise the module API. Renaming some
6769 functions for orthogonality, and judicious definition migration to
6770 move things out of the set of exported symbols.
6772 * doc/STYLE: New file. Notes on coding style.
6773 * m4/m4module.c: Updated bitrotted docucomment at the top of the
6775 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
6776 m4_get_module_name, m4_get_module_builtin_table,
6777 m4_get_module_macro_table which are verb phrases. Changed all
6779 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
6781 * m4/module.c (m4_set_module_builtin_table)
6782 (m4_set_module_macro_table): ...here, and renamed. Changed all
6784 * m4/m4module.c (m4_module_data): This...
6785 * m4/m4private.c (struct m4_module_data): ...and this...
6786 * m4/module.c (module_data) ...consolidated here and no longer
6787 exported. Changed all callers.
6789 2003-06-16 Gary V. Vaughan <gary@gnu.org>
6791 Begin work on lifting the curse of the global variables. To start
6792 with create a `struct m4' context container, and replace
6793 `m4__symtab' with `context->symtab' throughout. This means
6794 initialising a context container in main, and adjusting many
6795 functions between main and the module entry points so that the
6796 container gets passed through. It would have been nice to
6797 defer this until after 1.5, but it has a major effect on the
6798 user's module writing ABI, so it needs to be addressed now - at
6799 least in the areas that impact the ABI. An interrelated change
6800 in the symtab API removes the dependency on a global symbol table,
6801 and instead focuses on a passed table (from the context
6804 * TODO: Reminders for finishing context functionality.
6805 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
6806 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
6807 global variables and eventually allow m4 to be reentrant.
6808 * m4/m4private.h (m4): Define the new structure here...
6809 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
6810 don't carry the overhead of a function call.
6811 * m4/m4module.h: Prototype extern functions from m4/m4.c.
6812 (m4): Declare type for new struct m4 objects.
6813 (M4SYMTAB): User macro to ease finding the symbol table for the
6814 current context for module developers.
6815 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
6817 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
6818 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
6819 (m4_call_macro, m4_dump_symbols, m4_expand_input)
6820 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
6821 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
6822 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
6823 m4* context parameter. Changed definitions and all callers.
6824 (m4_symtab): Alias for m4_hash to decouple the
6825 m4_symtab api from m4_hash.
6826 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
6828 (m4_symtab_create): New function to return an initialised
6830 (m4_symtab_delete): New function to delete an m4_symtab's memory.
6831 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
6832 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
6833 instead of simply using the global m4__symtab. Changed
6834 definitions and all callers.
6835 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
6836 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
6837 * src/main.c (main): Create a context and use that instead of the
6838 former global m4__symtab.
6840 2003-06-13 Gary V. Vaughan <gary@gnu.org>
6842 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
6843 to the callback. Callbacks should not need to hardcode the
6844 hashtable they are working from, nor should we have to waste the
6845 userdata parameter to pass the table in.
6846 * m4/hash.h (m4_hash_apply_func): Require the initial table
6848 * m4/symtab.c (symtab_destroy): Use the passed table instead
6849 of hardcoding m4__symtab.
6850 (m4_symbol_popdef): Don't use the userdata parameter to pass the
6851 table to arg_destroy.
6852 (arg_destroy): Use the hash parameter, ignore userdata.
6853 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
6855 (traceon, traceoff): Call set_trace with the extra initial
6858 2003-06-13 Gary V. Vaughan <gary@gnu.org>
6860 More refactoring to stabilise the module api, this time for
6861 symtab.c. Additionally, start to pay attention to function names
6862 that don't contain a verb like they should.
6864 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
6865 wrapper for m4_hash_apply to decouple the symtab module from the
6867 (m4_symbol_builtin, m4_symbol_macro): Renamed to
6868 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
6870 (m4_symbol_delete): Create a macro version to save a function
6872 (m4_token_t, m4_data_t): These violate the POSIX reserved
6873 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
6875 (m4_token_type): Renamed to m4_token_get_type.
6876 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
6877 (m4_symtab_exit): Removed from the exported module
6879 * m4/m4private.h (m4__symtab, m4__symtab_init)
6880 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
6881 renamed and added to the internal api. Changed all callers.
6882 (m4_symtab_apply): A faster macro version of the function for
6883 users of the internal api.
6884 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
6885 symbol_destroy and arg_destroy.
6886 (symtab_debug): Added a prototype.
6887 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
6888 so that callers in this file get the faster macro versions from
6891 2003-06-12 Gary V. Vaughan <gary@gnu.org>
6893 Refactoring modules to rationalise the API into an external
6894 documented (eventually!) API for use by modules in the `m4_'
6895 namespace declared in m4/m4module.h, an internal API between the
6896 source files we ship (including our shipped modules) in the `m4__'
6897 namespace declared in m4/m4private.h and making the rest as
6898 cohesive as possible with liberal use of the `static' keyword.
6899 This change represents an audit to m4/module.c along these
6902 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
6903 Removed. No longer used.
6904 (m4_module_close): Removed prototypes.
6905 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
6906 from the exported module api...
6907 * m4/m4private.h (m4__module_init, m4__module_open)
6908 (m4__module_exit): ...and renamed and added to the internal api.
6909 Changed all callers.
6910 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
6911 Centralised definitions after renaming...
6912 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
6913 (M4_FINISH_SYMBOL): ...and removing from here.
6914 (m4_module_dlerror, m4_module_remove, m4_module_close)
6915 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
6916 module_remove, module_close and caller_id.
6917 (MODULE_SELF_NAME): New macro to make reporting self errors
6919 (m4_module_load, module_close, module_remove): Use it.
6920 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
6922 * src/main.c (main): Use it.
6924 2003-06-12 Gary V. Vaughan <gary@gnu.org>
6926 * README: Remove references to --enable-changeword, which has been
6927 removed from the code.
6929 2003-06-11 Gary V. Vaughan <gary@gnu.org>
6931 Getting rid of the annoying bug with configure --enable-debug,
6932 which spewed -e: command not found errors. This was an interaction
6933 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
6934 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
6935 branch-1-5) to get the full fix.
6937 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
6938 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
6939 and then use the probed value of $SED.
6940 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
6941 this, it messes up the AC_REQUIRE stack.
6943 2003-06-10 Gary V. Vaughan <gary@gnu.org>
6945 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
6946 the destroy callback.
6947 (m4_arg_destroy): Use the hash address to free the hash node key
6950 2003-06-06 Gary V. Vaughan <gary@gnu.org>
6952 First cut at formal parameters in macros.
6954 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
6955 * m4/xstrzdup.c: New file.
6956 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
6957 associative array of parameter names to details.
6958 (m4_symbol_token): Capture macro names with parameter lists.
6959 (m4_arg_signature_parse): And build an associative array to hang
6960 from the symbol structure to map names to details.
6961 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
6962 m4_hash_resize idiom. Now that we potentially add a little hash
6963 table to many of the entries in the symbol table, added an extra
6964 arg to set the initial size. Changed all callers.
6965 (m4_hash_apply): New function that is basically a generalised
6967 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
6968 all callers to call m4_hash_apply instead.
6969 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
6970 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
6971 m4_arg_signature association that might be attached to the symbol,
6972 * m4/hash.h (m4_hash_apply_func): Replacement type for...
6973 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
6974 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
6976 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
6977 (M4_IS_IDENT): Detect characters that can be safely used in
6979 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
6980 * m4/macro.c: Corrected grammar in some comments. Use `token'
6981 rather than `td' for m4_token variables.
6982 (m4_process_macro): If we find a dollar followed by some
6983 M4_IS_IDENT characters, replace that with the contents of the argv
6984 entry with offset stored in the m4_token_arg associated with the
6985 collected identifier.
6987 2003-06-05 Gary V. Vaughan <gary@gnu.org>
6989 Begin preparations for supporting formal parameters in m4 macros.
6991 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
6992 the details of a formal parameter.
6993 (m4_token): Add an arg_signature member to hold a hash table for
6994 looking up formal parameters.
6995 * m4/input.c: Update more bitrotted comments.
6996 (m4_push_builtin): Initialise arg_signature member.
6997 (init_builtin_token): Copy arg_signature member.
6998 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
6999 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7001 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7002 (m4_macro_pushdef, m4_macro_define): ...these, And...
7003 (m4_symbol_token): ...wrapped around this new function, which
7004 vastly simplifies the arguments required by the functions it
7006 Changed all callers.
7008 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7010 * m4/macro.c: Format changes.
7012 2003-06-04 Gary V. Vaughan <gary@gnu.org>
7014 * m4/input.c: Updated various bitrotted comments.
7015 (m4_push_builtin): Just pass the whole m4_token, rather than
7016 extracting all the fields in the caller. This also allows us to
7017 check the token type for consistency.
7018 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7019 Renamed to builtin_funcs, builtin_peek, builtin_read,
7020 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7021 the code. Changed all callers.
7022 (struct input_block): Similarly renamed u_m member to u_b, and
7023 changed all callers.
7024 (m4_next_token): Use bzero to initialise the data fields.
7025 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7027 2003-05-29 Gary V. Vaughan <gary@gnu.org>
7029 These changes were necessary to get m4 to build on my iBook
7030 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7031 (GCC) 3.1 20020420 (prerelease)":
7033 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7034 inclusion of module loader headers.
7035 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7036 * m4/Makefile.am: Ditto.
7037 (libm4_la_LIBADD): Added $(LTLIBINTL).
7038 * m4/utility.c (program_name): Removed declaration in favour of
7039 the one already in error.c!
7040 * m4/m4module.h (program_name): Define to program_invocation_name
7041 when using GNU C library. Use an explicit extern declaration.
7042 (interactive, sync_output, debug_level, hash_table_size)
7043 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7044 (suppress_warnings, warning_status, nesting_limit, discard_comments)
7045 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7046 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7047 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7048 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7049 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7050 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7051 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7052 (m4_current_line, m4_current_diversion, m4_output_current_line):
7053 Don't rely on default, use an explicit extern.
7054 * m4/error.h (error, error_at_line, error_print_progname)
7055 (error_message_count, error_one_per_line): Ditto.
7056 * m4/ltdl.c: Update from CVS libtool.
7058 * commit: Update from CVS cvs-utils.
7060 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
7062 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7063 * po/boldquot.sed: New file, from gettext-0.11.5.
7064 * po/en@boldquot.header: New file, from gettext-0.11.5.
7065 * po/en@quot.header: New file, from gettext-0.11.5.
7066 * po/insert-header.sin: New file, from gettext-0.11.5.
7067 * po/quot.sed: New file, from gettext-0.11.5.
7068 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7069 * po/Rules-quot: New file, from gettext-0.11.5.
7071 2002-11-04 Akim Demaille <akim@epita.fr>
7073 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7075 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7077 2002-11-04 Akim Demaille <akim@epita.fr>
7079 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7081 2002-11-04 Akim Demaille <akim@epita.fr>
7083 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7084 used as `external', and Libtool 1.4.3.
7086 (LTLIBOBJS): Don't play with it.
7088 * Makefile.am (SUBDIRS): Remove intl.
7089 (ACLOCAL_AMFLAGS): Add -I config.
7090 (EXTRA_DIST): Add config/config.rpath.
7093 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7095 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7097 Preparations for refactoring syntax tables to allow reverse
7098 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7099 speed of normal lookups in an array of unsigned short.
7101 * m4/input.c (single_quotes, single_comments, use_macro_escape):
7103 * m4/m4private.h (m4__single_quotes, m4__single_comments,
7104 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
7105 is for internal symbols which unavoidably pollute the global
7106 namespace, but are not published APIs.
7107 Adjusted all callers.
7108 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7109 m4_set_comment, m4_set_syntax, set_syntax_internal,
7110 unset_syntax_attribute): Moved from this file...
7111 * m4/syntax.c: New. ...to this file.
7112 Also added an m4_syntax_exit stub for orthogonality.
7113 * src/main.c (main): Use it.
7114 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7115 * m4/m4module.h: Reformatting. New prototypes.
7117 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7119 * bootstrap (aclocal_apiversion): The aclocal apiversion is
7120 distinct from the automake release number (in that the apiversion
7121 apparently has no micro-version-component).
7122 (aclocal_apilibdir): Use it.
7124 2002-05-28 Gary V. Vaughan <gary@gnu.org>
7126 * m4/hash.c (m4_hash_resize): New function.
7127 * m4/hash.h: Add prototype.
7128 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
7129 benchmarking to find a good value for, say, autoconf. This is
7130 already a little quicker than before for me.
7132 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7133 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7135 * m4/hash.h: Adjust prototypes.
7137 2002-01-22 Akim Demaille <akim@epita.fr>
7139 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7141 * tests/Makefile.am (package.m4): New.
7142 * tests/atlocal.in: Adjust to CVS Autotest.
7143 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7144 * configure.ac: LIBOBJ is a forbidden string.
7145 Simplify AM_INIT_AUTOMAKE invocation.
7146 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7149 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
7151 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7153 2001-10-19 Akim Demaille <akim@epita.fr>
7155 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7157 2001-10-19 Akim Demaille <akim@epita.fr>
7159 * m4/input.c (m4_next_token): Display where was opened what is
7162 2001-10-19 Akim Demaille <akim@epita.fr>
7164 * m4/macro.c (expand_argument): Display where was opened what is
7167 2001-10-18 Akim Demaille <akim@epita.fr>
7169 * m4/input.c, modules/m4.c: Formatting changes.
7171 2001-10-17 Gary V. Vaughan <gary@gnu.org>
7173 * bootstrap: s/configure.in/configure.ac/
7175 2001-10-16 Gary V. Vaughan <gary@gnu.org>
7177 * m4/symtab.c (m4_symbol_destroy): This function calls
7178 m4_symbol_popdef, which recycles a symbols memory when the last
7179 definition is popped. Since we were passing the address of the
7180 symbol name found in the symbol table, and it was being removed
7181 partway through m4_symbol_destroy() we were referencing freed
7182 memory for the balance of the function. Now we take a copy of the
7183 symbol name tring and use that as a key into the symbol
7184 table... that way if the original symbol name is freed, the copy
7187 2001-10-13 Akim Demaille <akim@epita.fr>
7189 * m4/ltdl.c: Update.
7191 2001-10-13 Akim Demaille <akim@epita.fr>
7193 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7194 Don't gettextize internal error messages.
7196 2001-10-13 Akim Demaille <akim@epita.fr>
7198 * tests/macros.at (Arity and defn): New failing test.
7199 (Arity, defn, and freeze): New.
7201 Fix `Arity and defn'.
7203 * m4/input.c (m4_push_macro): Don't forget the arity.
7204 * modules/m4.c (defn): Likewise.
7206 2001-10-13 Akim Demaille <akim@epita.fr>
7208 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7210 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7211 (Propagation of traceon, Propagation of --trace): this new file.
7213 2001-10-13 Akim Demaille <akim@epita.fr>
7215 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7216 interface instead of (name, argc...).
7217 Upon failure, specify which argument was guilty.
7220 2001-10-13 Akim Demaille <akim@epita.fr>
7222 * modules/evalparse.c: Save translators' time: don't translate
7223 internal error messages.
7224 (m4_evaluate): Simplify/normalize error messages.
7225 * doc/m4.texinfo (Eval): Adjust.
7227 2001-10-13 Akim Demaille <akim@epita.fr>
7229 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7230 where no checking is needed.
7231 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7232 interface instead of (name, argc...).
7234 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7237 2001-10-13 Akim Demaille <akim@epita.fr>
7239 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7240 exclude the builtin name from the count.
7241 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7242 calling ifelse with a single argument is valid.
7243 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7244 with 1 and 2 args, mostly to strengthen the test suite.
7246 2001-10-13 Akim Demaille <akim@epita.fr>
7248 * m4/output.c (m4_make_diversion, m4_insert_file)
7249 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7251 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7253 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
7254 since we call these things builtins in the rest of the code!
7256 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7258 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7260 Rather than forcing each builtin definition to manage its own
7261 argument range checking, tabulate the maxima and minima for all
7262 builtins in each module. This forces us to consider what the
7263 valid ranges for each builtin should be, and moves the checking
7264 code out of each builtin implementation and into the builtin
7265 caller infrastructure.
7267 * m4/m4module.h (struct m4_builtin): Add argument minima and
7269 * m4/m4private.h (struct m4_token): Reflect them here too.
7270 * m4/input.c (struct input_block): ...and here.
7271 (m4_token_copy): New function for token copying.
7272 (init_macro_token): Copy them from a token to the input stack.
7273 (m4_next_token): Don't forget to initialise them for text
7275 * m4/macro.c (expand_argument): Use m4_token_copy, and also
7276 check argument counts before calling the builtin handler.
7277 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
7278 (m4_symbol_macro): Likewise.
7279 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
7280 parameters. Updated all callers.
7281 (m4_builtin_define): Ditto.
7282 (m4_macro_pushdef, m4_macro_define): Ditto.
7283 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
7284 * modules/evalparse.c: Declare argument counts for defined
7285 builtins and remove explicit calls to m4_bad_argc().
7286 * modules/gnu.c: Ditto.
7287 * modules/load.c: Ditto.
7288 * modules/m4.c: Ditto.
7289 * modules/modtest.c: Ditto.
7290 * modules/mpeval.c: Ditto.
7291 * modules/perl.c: Ditto.
7292 * modules/shadow.c: Ditto.
7293 * modules/stdlib.c: Ditto.
7294 * modules/time.c: Ditto.
7297 2001-10-10 Gary V. Vaughan <gary@gnu.org>
7299 The trace semantics now attach the trace bit to a symbol name.
7300 For as long as a traceon(`foo') is active, calls to foo will be
7301 traced regardless of intervening undefines or module unloads.
7302 Fixed the flag propogation issues differently to the fixes
7303 reverted with the last attempt at nailing down trace:
7305 * m4/m4private.h: This file is not visible outside of the m4
7306 source tree, so I removed all the `M4_' and `m4_' prefixes to save
7307 on typing. Updated all clients.
7308 (m4_token): New typedef contains the fields that need to be passed
7309 around with the low level tokeniser.
7310 (m4_token_data): Removed.
7311 (m4_symbol): Now contains the traced flag again.
7312 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
7313 the trace bit set. This change is contained entirely within this
7314 module and doesn't leak out into the callers. Updated all
7316 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
7317 new fields in m4_token. Updated all clients.
7318 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
7319 that `groks_macro_args' and `blind_if_no_args' flags are retained
7320 when defn() results are passed around in m4 code. Updated all
7322 (m4_builtin_define): Ditto.
7323 (m4_macro_pushdef, m4_macro_define): Ditto.
7324 * m4/input.c (struct input_block): Add a flags field to facilitate
7326 (m4_push_macro): ...use it.
7327 (init_macro_token): Retrieve it.
7328 (m4_next_token): Initialise it.
7329 * m4/macro.c (expand_argument): Copy it.
7330 * m4/m4module.h: Adjust.
7331 * tests/builtins.at: Adjust the expected output of the trace
7332 tests to reflect the change in semantics.
7333 * tests/modules.at (modules: trace): Check that unloading a
7334 module which supplies a traced symbol definition doesn't lose te
7337 2001-10-07 Gary V. Vaughan <gary@gnu.org>
7339 * modules/gnu.c (m4_macro_table): Display the timetamp when
7340 expanding __m4_version__.
7342 * configure.ac (--with-modules): Forgot a comma in the
7343 AC_HELP_STRING parameter list.
7345 2001-10-05 Gary V. Vaughan <gary@gnu.org>
7347 * bootstrap: Remove aclocal.m4t when it is no longer required.
7349 2001-10-05 Akim Demaille <akim@epita.fr>
7351 * tests/Makefile.am: Adjust for gnuprog2.
7352 * tests/m4.in: There can be a leading path.
7353 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
7354 * tests/testsuite.at: Adjust to the most recent Autotest.
7355 (AT_CHECK_M4_FILTER): Fix and rename as...
7357 * tests/others.at: Use it.
7359 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
7360 variable in shell scripts, one uses `$'...
7362 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7364 * configure.ac: `rm -f $m4_getopt_h' was lost.
7366 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7368 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
7369 time. Define it for config.h in order to...
7370 * src/main.c (main): ...display the timestamp for --version.
7372 2001-10-04 Akim Demaille <akim@epita.fr>
7374 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
7375 previous builtins `regexp' and `patsubst'.
7376 (regexp, patsubst): Use them.
7377 (eregexp, epatsubst): New builtins.
7378 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
7379 (Epatsubst and Patsubst, Eregexp and Regexp): these.
7380 (Extensions): More info on REs.
7382 2001-10-04 Akim Demaille <akim@epita.fr>
7384 * modules/modtest.c (init_handler): Consistently output to stderr.
7385 (finish_handler): New.
7386 (test): The `if' is an `assert'.
7387 * tests/modules.at: Adjust.
7389 2001-10-04 Akim Demaille <akim@epita.fr>
7391 * m4/utility.c (m4_bad_argc): Detail the mismatches.
7393 2001-10-01 Akim Demaille <akim@epita.fr>
7395 * tests/generate.awk: Tag the tests with `documentation'.
7396 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
7397 Use the make the existing modtest tests more uniform, and complete
7398 the set of possibilities.
7400 2001-10-01 Akim Demaille <akim@epita.fr>
7402 * config/gmp.m4: Consult the user before using GMP: use
7404 * configure.ac: Adjust.
7405 * modules/gmp.c: No protection needed as the module is not built
7408 2001-10-01 Akim Demaille <akim@epita.fr>
7410 * tests/generate.awk: Remove debugging code.
7411 (fatal): Specify the current location.
7413 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
7414 * modules/gnu.c, modules/m4.c: Use M4ARG.
7416 2001-10-01 Akim Demaille <akim@epita.fr>
7418 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
7419 (m4_regexp_compile): New.
7420 (regexp, patsubst): Use it.
7422 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7424 Reinstate the memory handling improvements from the patch I just
7425 reverted. Relevant ChangeLog entries repeated here:
7427 * m4/module.c (m4_module_remove): New function that holds the core
7428 of the old m4_module_unload.
7429 (m4_module_unload): Use it.
7430 (m4_module_unload_all): When we know the modules will never be
7431 used again (i.e. on exit), free up as much module memory as
7432 possible. There are still some artifacts from resident modules
7433 living inside ltdl.c, but everything else is freed.
7434 * m4/debug.c (m4_debug_exit): Free memory allocated in
7436 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7437 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7438 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7439 * m4/m4module.h: Updated prototypes.
7440 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7441 * m4/hash.h: Updated prototypes.
7442 * src/main.c (main): Use all these new functions to clean up as
7443 much memory as possible before exit.
7445 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7447 Reverted my large patch for removing the old m4_symbol
7448 structure on 2001-09-20. We are still not happy about the way
7449 trace works in conjunction with defn and undefine, and leaving
7450 the reverted patch active prevents us from moving the traced
7451 bit from the definition back to the symbol.
7453 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7455 * configure.in: Moved to...
7456 * configure.ac: ...here. Added a libtool like timestamped
7457 banner, and tidied up the libltdl cruft.
7458 * config/mkstamp: Script to extract a timestamp from ChangeLog.
7459 * modules/Makefile.am (INCLTDL): Removed. This is required
7460 only when libltdl is configured in a subdirectory.
7461 * src/Makefile.am: Ditto.
7462 (LIBADD_DL): No need to add this again, libtool already knows
7463 that libm4.la depends on it.
7464 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
7467 * TODO: stackovf.c is basically broken.
7468 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
7470 2001-09-28 Akim Demaille <akim@epita.fr>
7472 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
7474 2001-09-27 Akim Demaille <akim@epita.fr>
7476 * tests/m4.in: Don't use short options.
7477 Simplify the stderr signature normalization.
7479 2001-09-27 Akim Demaille <akim@epita.fr>
7481 tests/m4 shall be position independent.
7485 * tests/testsuite.at: No args to AT_INIT.
7486 * configure.in, tests/Makefile.am: Adjust.
7488 2001-09-22 Akim Demaille <akim@epita.fr>
7490 Autotest has changed again.
7492 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
7493 (package.m4): Remove.
7494 * configure.in: Adjust to LIBADD_GMP.
7496 2001-09-21 Gary V. Vaughan <gary@gnu.org>
7498 * config/gmp.m4 (AC_ARG_WITH): Removed.
7499 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
7500 (AC_LIB_GMP): When performing a test compile against libgmp,
7501 include the header gmp.h if possible, and link against -lgmp. If
7502 they both work define USE_GMP.
7503 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
7504 (mpeval_LTX_init_func): Complain on load that there was no libgmp
7507 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7509 * m4/evalparse.c: Moved to...
7510 * modules/evalparse.c: ...here. This code is shared between
7511 modules/mpeval.c and modules/m4.c, so there is no need to pollute
7512 the libm4 API with its details. Moderately rewritten to interface
7513 into its clients more simply.
7514 * m4/eval.c: Deleted. Migrated functionality to...
7515 * modules/m4.c: ...here.
7516 (builtin_eval): Implemented in terms of the new interface style.
7517 * modules/mpeval.c (builtin_mpeval): Ditto.
7518 * m4/m4module.h: Removed references to the former m4/eval.c.
7519 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
7520 (EXTRA_libm4_la_SOURCES): Deleted.
7521 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
7522 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
7524 2001-09-20 Akim Demaille <akim@epita.fr>
7526 * config/gmp.m4 (AM_WITH_GMP): Rename as...
7528 By default, use gmp.
7530 * configure.in: Adjust.
7531 Use Automake conditionals for USE_GMP.
7532 Always compute sizeof (long long int).
7533 This was a bug BTW, as `eval' (not `mpeval') depends on it:
7534 before, it was used _only_ if mpeval was not activated.
7535 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
7536 (mpeval_la_LIBADD): New macros.
7537 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
7539 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
7540 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
7543 2001-09-20 Akim Demaille <akim@epita.fr>
7545 * tests/Makefile.am (package.m4): New.
7546 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
7548 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7550 More cleanup. After the last patch, m4_symbol holds nothing but
7551 the head of a chain of m4_token_data. So I have removed the old
7552 m4_symbol, so that m4_token_data chains are stored directly in the
7553 value cell of a hash table node. But there's more... m4_symbol
7554 was a more natural name for the symbol value cell, and now that it
7555 is gone I have renamed the former m4_token_data structure to
7556 m4_symbol. This change turned out to be a pig to get right, since
7557 the original code didn't need to modify the value cell itself,
7558 since changing the chain happened inside the m4_symbol that used
7559 to be returned -- I had to pass the address of the value cell
7560 across various function calls, incase the head value changed. I
7561 also tightened up the memory management to help me find a nasty
7562 memory corruption bug that took me all night to track down...
7564 * m4/m4private.h (struct m4_symbol): Removed.
7565 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
7567 * m4/hash.c (m4_hash_iterator_value): Return the address of the
7568 value cell. Updated all callers.
7569 * m4/symtab.c: Took advantage of the simplification in the data
7570 structures to rewrite a lot of this file more simply. There is
7571 still some room for optimisation here, but we should tackle that
7572 systematically closer to the release.
7574 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7575 revealed. This version is ahead of CVS libtool until I get chance
7576 to flush my changes.
7577 * m4/module.c (m4_module_remove): New function that holds the core
7578 of the old m4_module_unload.
7579 (m4_module_unload): Use it.
7580 (m4_module_unload_all): When we know the modules will never be
7581 used again (i.e. on exit), free up as much module memory as
7582 possible. There are still some artifacts from resident modules
7583 living inside ltdl.c, but everything else is freed.
7584 * m4/debug.c (m4_debug_exit): Free memory allocated in
7586 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7587 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7588 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7589 * m4/m4module.h: Updated prototypes.
7590 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7591 * m4/hash.h: Updated prototypes.
7592 * src/main.c (main): Use all these new functions to clean up as
7593 much memory as possible before exit.
7595 2001-09-18 Gary V. Vaughan <gary@gnu.org>
7597 The `traced' flag needs to be attached to the definition of a
7598 symbol rather than the current symbol containing the definition.
7599 Implementing this showed up some long standing post 1.4 bugs in
7600 flag propogation which I also fixed.
7602 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
7603 (struct m4_token_data): And add it back in here.
7604 * m4/input.c (init_macro_token): Propogate the traced flag
7606 * m4/macro.c (expand_argument): Ditto.
7607 * tests/builtins.at (trace2, trace3): New tests based on Akim's
7610 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7612 * m4/m4private.h (struct m4_token_data): Simplified by removing
7613 the redundant `traced' flag, and one level of structure nesting.
7614 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
7615 * m4/input.c (init_macro_token): No need to initialise removed
7617 * m4/macro.c (expand_argument): No need to copy it either.
7618 * m4/utility.c (m4_token_data_func_traced): Or provide an access
7621 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
7622 dependant on multiple symbols with the same key, so preserving
7623 relative symbol order in each bucket during resizing is no longer
7624 required. The resize function is considerably faster as a result.
7626 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
7627 s/m4_symbol_insert/m4_symbol_define/g;
7628 s/m4_builtin_insert/m4_builtin_define/g;
7629 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
7631 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7633 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
7634 commits, the m4_lookup_symbol dispatch function is split into
7635 specialised functions that must be called directly.
7637 * m4/m4module.h (m4_symbol_lookup_t): Removed.
7638 * m4/symtab.c (m4_lookup_symbol): Removed.
7639 (m4_symbol_builtin, m4_symbol_macro): New functions.
7640 * m4/builtin.c (m4_builtin_define): Split into...
7641 (m4_builtin_pushdef, m4_builtin_insert): ...these.
7642 (m4_macro_define): Split into...
7643 (m4_macro_pushdef, m4_macro_insert): ...these.
7644 * src/main.c (main): Set command line macros from `-D' parameters
7645 using `m4_macro_define'.
7647 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7649 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
7650 this from m4_remove_table_reference_symbols().
7651 * m4/m4module.h, m4/module.c: Updated all references.
7653 2001-09-07 Akim Demaille <akim@epita.fr>
7655 * modules/stdlib.c, modules/times.c: Misc cleanups.
7657 2001-09-07 Akim Demaille <akim@epita.fr>
7659 * configure.in: We now need Autoconf 2.52e.
7660 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
7661 and `M4_SYMBOL_DELETE'.
7662 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
7663 * src/main.c (main): Adjust.
7665 2001-09-06 Gary V. Vaughan <gary@gnu.org>
7667 Fix the obstack.h problem once and for all! At configure time we
7668 can test for a system supplied obstack.h: depending on the
7669 result, we now generate system.h with an #include of the correct
7670 header. As a bonus, I've also added a --with-included-obstack,
7671 incase the user doesn't like the system obstack for some
7672 reason... and also we can test the shipped obstack on a system
7673 that has oe of its own. We also now need to be careful to add
7674 build directories to the include search path, since the generated
7675 system.h will be in the build tree.
7677 * configure.in (AC_CONFIG_FILES): Generate system.h from
7679 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
7680 include the system obstack header or the copy shipped with M4.
7681 Allow the user to override configure and force the build to use
7682 the shipped version.
7683 * m4/system-h.in: New file, template for...
7684 * m4/system.h: ...this. Now deleted.
7685 * m4/m4module.h: Include system.h before everything else.
7686 * src/freeze.c: Ditto.
7687 * m4/Makefile.am (dist-hook): Remove generated system.h.
7688 (INCLUDES): Check builddir for generated headers before checking
7690 * modules/Makefile.am (INCLUDES): Ditto.
7691 * src/Makefile.am (INCLUDES): Ditto.
7693 2001-09-05 Gary V. Vaughan <gary@gnu.org>
7695 * TODO: Remove the items that have been addressed already.
7697 2001-09-05 Akim Demaille <akim@epita.fr>
7699 * src/main.c (main): Standardize --version.
7701 2001-09-05 Akim Demaille <akim@epita.fr>
7703 * modules/format.c (format): Have a bigger `str'.
7705 2001-09-05 Akim Demaille <akim@epita.fr>
7707 Rationalize warnings, reporting the macro name as if it were a
7708 program name, and assertions.
7710 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
7712 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
7714 Use assert for internal errors.
7715 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
7717 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
7719 * tests/builtins.at (pushpop): Adjust.
7721 2001-09-05 Akim Demaille <akim@epita.fr>
7723 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
7726 2001-09-05 Akim Demaille <akim@epita.fr>
7728 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
7729 * m4/macro.c, m4/symtab.c: Adjust.
7731 2001-09-05 Akim Demaille <akim@epita.fr>
7733 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
7734 (m4_symbol_pop, m4_symbol_del): this.
7735 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
7736 (m4_symbol_popdef, m4_symbol_delete): New.
7737 (m4_lookup_symbol): Adjust.
7738 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
7740 2001-09-05 Akim Demaille <akim@epita.fr>
7742 * m4/m4module.h (m4_symbol_lookup): Rename as...
7743 (m4_symbol_lookup_t): this.
7745 2001-09-05 Akim Demaille <akim@epita.fr>
7747 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
7749 * m4/symtab.c (m4_lookup_symbol): Adjust.
7751 2001-09-03 Gary V. Vaughan <gary@gnu.org>
7753 Bootstrap will now work with Libtool 1.4.1 or higher:
7754 * bootstrap: Remove stale autom4te.cache files when
7756 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
7758 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
7759 libtool.m4 directly.
7760 Run libtoolize to refresh ltmain.sh.
7761 * config/ltmain.sh: Deleted.
7762 * acinclude.m4: Deleted.
7763 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
7765 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
7766 implementation for the cvs impaired libtool user.
7768 2001-09-03 Akim Demaille <akim@epita.fr>
7770 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
7772 Avoid using `default' in switch, as it hides useful compiler
7773 warnings when a case is forgotten.
7775 2001-09-03 Akim Demaille <akim@epita.fr>
7777 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
7778 is no such thing as `WITH_MODULES'.
7780 2001-09-03 Akim Demaille <akim@epita.fr>
7782 Improve the test suite's selfcontainedness.
7784 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
7785 (Include, Undivert): Tag the other input files.
7786 * tests/generate.awk: Catch `@comment file:'.
7787 `-I $src' is no longer needed.
7788 `next' is really like `return': the rest is skipped.
7789 Adjust to `input.m4'.
7790 (fatal): New function.
7791 * tests/foo, tests/incl.m4: Remove.
7793 2001-09-01 Gary V. Vaughan <gary@gnu.org>
7795 The shadowing mechanism and, infact, the whole symbol table
7796 implementation was creaking under the weight of the features piled
7797 on top of it. We now have a separate hash table module which will
7798 dynamically resize to keep symbol density withing good performace
7799 limits, and a new symtab module layered above it. Symbol lookups
7800 are now marginally more efficient (since the shadowed flag is no
7801 longer required) and symbol removal, such as on module unload, is
7802 considerably faster due to a reorganisation of the data structures
7805 * src/main.c (main): Don't mention `-H'.
7806 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
7809 * m4/hash.c: New generalised dynamic hash table data structure
7811 * m4/hash.h: Public interface.
7812 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
7813 (libm4_la_SOURCES): Add hash.c.
7814 * m4/symtab.c: More or less rewritten from scratch, within the
7815 bounds of the previous API.
7816 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
7817 call. Updated all callers.
7818 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
7819 declarations to reflect API changes.
7820 (M4INIT): Generate a declaration too, to avoid the warning with
7821 --enable-debug builds.
7824 * m4/utility.c (hash_table_size): Removed.
7825 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
7826 names, which are then looked up by builtin_dumpdef() as necessary.
7827 This implies a small speedup in builtin_symbols(), which discarded
7828 all of the symbol info under the old call.
7829 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
7830 shadowing is implicit in respect to the new data structures.
7831 symbol names are no longer duplicated here, they are stored in the
7832 key field of the hash table.
7833 Moved macro_args and blind_no_args...
7834 (m4_token_data): ...to here.
7835 m4/macro.c (expand_macro): Added a name argument since the symbol
7836 name is no longer copied into each struct m4_symbol. Modified all
7838 (collect_arguments): Ditto.
7839 * modules/m4.c (set_trace): Ditto.
7840 * modules/gnu.c (builtin_symbols): Updated.
7841 * src/freeze.c (produce_symbol_dump): Much improved in light of
7842 the improved symbol table layout.
7844 2001-09-01 Gary V. Vaughan <gary@gnu.org>
7846 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
7848 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
7849 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
7850 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
7851 SYMBOL_HANDLE): Ditto.
7852 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
7853 modules/gnu.c, modules/m4.c, src/freeze.c,
7854 src/main.c: Updated all references.
7856 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
7857 Automake 1.5 chokes on dynamic source file lists, Besides, it is
7858 already listed in m4_LDADD... how did that ever used to work?
7859 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
7861 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
7862 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
7864 * tests/m4: Don't call the m4 wrapper script with libtool, it
7865 works fine all by itself.
7867 2001-08-30 Gary V. Vaughan <gary@gnu.org>
7869 The experimental `changeword' feature never took off, and has
7870 no obvious advantages over `changesyntax' to compensate the
7871 enormous speed penalty it carries:
7872 * configure.in (ENABLE_CHANGEWORD): Removed.
7873 * m4/m4module.h (m4_set_word_regexp): Removed.
7874 * m4/m4private.h (m4_token_data): Removed original_text field.
7875 * m4/utility.c (m4_token_data_orig_text): Removed.
7876 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
7877 * m4/macro.c: Ditto.
7878 * src/main.c: Ditto.
7879 * modules/Makefile.am (changeword.la): Removed.
7880 * modules/changeword.c: File removed.
7881 * doc/m4.texinfo: References to changeword and --word-regexp
7883 * po/POTFILES.in: modules/changeword.c removed.
7884 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
7885 * tests/builtins.at (changeword): Test removed.
7887 2001-08-30 Akim Demaille <akim@epita.fr>
7889 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
7890 This also help having a single list of m4 files: in
7892 * config/Makefile.am (STANDARD_MACROS): Rename as...
7893 (ACLOCAL_MACROS): this.
7894 (list-standard-macros): Remove.
7897 2001-08-29 Gary V. Vaughan <gary@gnu.org>
7899 In an attempt to moderate my egomania...
7900 * tests/modules.at: Remove attributions.
7902 * tests/generate.awk: When making substitutions to "@&t@", either
7903 "&" or "\&" in the substitution string argument to gsub refer back
7904 to the matched text. "@\\&t@" seems to work though, Tests 43 and
7907 2001-08-29 Akim Demaille <akim@epita.fr>
7909 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
7910 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
7911 (sync-lines, trace, translit, undivert, wrap): Move to...
7912 * tests/builtins.at: this new file.
7913 * tests/others.at (Discard comments, import-environment): Move to...
7914 * tests/options.at: this new file.
7916 2001-08-29 Akim Demaille <akim@epita.fr>
7918 * tests/others.at (Freezing modules)
7919 (--module-directory: absolute path, modpath2, modpath3)
7920 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
7921 * tests/modules.at: here, new file.
7922 * tests/others.at, tests/generate.awk: Add a banner.
7923 * tests/testsuite.at: Adjust.
7924 (AT_CHECK_M4_FILTER): New, but unused.
7926 2001-08-29 Akim Demaille <akim@epita.fr>
7928 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
7930 * tests/others.at (wrap): Inline wrap.m4.
7931 (shadow): Inline shadow.m4.
7932 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
7933 * tests/m4: Simplify.
7935 2001-08-29 Akim Demaille <akim@epita.fr>
7937 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
7940 2001-08-29 Akim Demaille <akim@epita.fr>
7942 * tests/generate.awk (normalize): s/@__@/@&t@/.
7944 2001-08-28 Akim Demaille <akim@epita.fr>
7946 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
7948 2001-08-28 Gary V. Vaughan <gary@gnu.org>
7950 * bootstrap (generate.awk): Generate test cases with new script.
7952 2001-08-27 Akim Demaille <akim@epita.fr>
7954 * tests/Makefile.am (installcheck-local): Don't use
7955 `dc_install_base' which is not visible here, but `exec_prefix'
7956 which is clearly the RT anyway.
7957 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
7958 related to testing a now installed m4.
7959 * tests/m4: Do it here.
7961 2001-08-27 Akim Demaille <akim@epita.fr>
7963 * tests/others.at (indir): Formatting change.
7965 2001-08-27 Akim Demaille <akim@epita.fr>
7967 * tests/Makefile.am (installcheck-local): New.
7968 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
7970 Prefer options over envvars.
7971 * src/main.c (main): First bug caught by the test suite (yeah!):
7972 --batch lacked a `break' which resulted in an accidental
7973 invocation of --discard-comments.
7975 2001-08-27 Akim Demaille <akim@epita.fr>
7977 * tests/others.at (capitalize, changeword, comments, ddivert)
7978 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
7979 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
7980 (sysv-args, trace, translit, undivert): Don't rely on files in
7981 examples/: AT_DATA them.
7983 2001-08-27 Akim Demaille <akim@epita.fr>
7985 Let the test suite use a wrapper around the not installed m4 to
7986 pretend it is (installed).
7988 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
7989 such a way that m4 does not process them.
7990 * configure.in: The package name seems to be `m4', not `M4'.
7992 * tests/atlocal.in (at_package, M4): Remove.
7993 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
7995 2001-08-27 Akim Demaille <akim@epita.fr>
7997 * tests/Makefile.am (CLEANFILES): Remove.
7998 (DISTCLEANFILES, clean-local): New.
7999 * examples/mktests.sh: Remove.
8001 2001-08-27 Akim Demaille <akim@epita.fr>
8003 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8004 Don't use aclocal: it's written by hand.
8005 * aclocal.m4: m4_include all the files instead of being built by
8007 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8008 until it reads the traces by itself.
8009 * configure.in: Require Autoconf 2.42c as we are now using
8010 AC_CONFIG_TESTDIR instead of AT_CONFIG.
8011 Catch unexpanded `jm_' macros.
8012 * config/atconfig.m4: Remove.
8013 * config/error.m4: new.
8014 * config/Makefile.am: Ship the files included by aclocal.m4.
8015 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8016 (TESTSUITE_AT): this, to please Automake.
8017 (TESTSUITE): This target uses autotest/autotest.m4, not
8018 autotest/general.m4.
8019 * tests/testsuite.at: Prereq Autotest 2.52c.
8020 * examples/Makefile.am (pkgdata_DATA): Rename as...
8021 (dist_pkgdata_DATA): this.
8022 * doc/Makefile.am (man_MANS): Rename as...
8023 (dist_man_mans): this.
8025 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8027 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
8028 Robert Collins, building on Cygwin no longer requires Windows
8029 import and export symbol decorations.
8030 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
8031 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8032 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8033 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8034 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8035 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8036 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8037 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8038 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8039 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
8041 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8042 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8044 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8046 Ansify the source. Previously we had a mix, where my code was
8047 in a K&R compatible style, and the preexisting code was in ANSI
8048 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
8049 and now the code base is much cleaner.
8051 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
8052 VOID macro and all users.
8053 * m4/m4module.h: Ansify function prototypes and headers.
8054 * m4/builtin.c: Ditto.
8055 * m4/evalparse.c: Ditto.
8056 * m4/input.c: Ditto.
8057 * m4/macro.c: Ditto.
8058 * m4/module.c: Ditto.
8059 * m4/output.c: Ditto.
8061 * m4/symtab.c: Ditto.
8062 * m4/utility.c: Ditto.
8063 * modules/format.c: Ditto.
8064 * modules/gnu.c: Ditto.
8065 * modules/m4.c: Ditto.
8066 * modules/mpeval.c: Ditto.
8067 * src/freeze.c: Ditto.
8069 * src/main.c: Ditto.
8071 2001-08-20 Akim Demaille <akim@epita.fr>
8073 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8074 generated with stock 2.52.
8076 2001-08-20 Akim Demaille <akim@epita.fr>
8078 * config/atconfig.m4: New, until part of Autoconf per se.
8079 * configure.in (AT_CONFIG): Use it.
8081 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8082 * tests/atlocal.in: New.
8083 * tests/generate.awk: For the time being, the empty quadrigraph is
8085 * tests/others.at (changeword, gmp): Check the configuration
8086 variable against `yes'.
8087 * tests/testsuite.at (dnl): Allow it, as it's used all over the
8090 2001-08-20 Akim Demaille <akim@epita.fr>
8092 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8093 * modules/m4.c (undivert): Disable the possibility of undiverting
8094 several files at once: it is not documented, it is inconsistent
8095 with the other macros, it can be straightforwardly mocked by
8096 several invocations, and most importantly, it prevents the
8097 possibility of other kinds of extension.
8098 Use `m4_numeric_arg'.
8100 2001-08-20 Akim Demaille <akim@epita.fr>
8102 * examples/include.m4: Typo.
8103 * tests/generate.awk: Really add it.
8104 * tests/Makefile.am: Adjust.
8105 * tests/others.at (Discard comments): It sure fails without `-c'.
8106 (include, undivert): Add -I examples/.
8108 2001-08-20 Akim Demaille <akim@epita.fr>
8110 Use sprintf, not ecft and friends since it is standard, portable,
8111 simplifies the code, and since the latter is even deprecated
8112 according to the GNU libc documentation.
8114 * modules/format.c: Drop evct support.
8116 2001-08-19 Gary V. Vaughan <gary@gnu.org>
8118 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
8120 * configure.in: ...do it here instead.
8122 * c-boxes.el: Deleted.
8123 * m4/builtin.c: Reformat box comments to be closer to GNU
8125 * m4/debug.c: Ditto.
8127 * m4/evalparse.c: Ditto.
8128 * m4/input.c: Ditto.
8129 * m4/m4module.h: Ditto.
8130 * m4/macro.c: Ditto.
8131 * m4/output.c: Ditto.
8132 * m4/symtab.c: Ditto.
8133 * m4/utility.c: Ditto.
8134 * modules/changeword.c: Ditto.
8135 * modules/format.c: Ditto.
8136 * modules/gnu.c: Ditto.
8137 * modules/load.c: Ditto.
8138 * modules/m4.c: Ditto.
8139 * modules/modtest.c: Ditto.
8140 * modules/mpeval.c: Ditto.
8141 * modules/perl.c: Ditto.
8142 * modules/shadow.c: Ditto.
8143 * modules/stdlib.c: Ditto.
8144 * modules/time.c: Ditto.
8145 * src/freeze.c: Ditto.
8146 * src/main.c: Ditto.
8148 2001-08-17 Gary V. Vaughan <gary@gnu.org>
8150 * m4/module.c: Fixup some errors in the description comment.
8152 2001-08-17 Akim Demaille <akim@epita.fr>
8154 * tests/others.at (iso8859): Specify the path to the M4 test file.
8155 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8156 files in error messages.
8158 2001-08-17 Akim Demaille <akim@epita.fr>
8160 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8161 * tests/others.at: Adjust input files paths.
8162 * tests/atconfig.in: Set top_builddir.
8163 * tests/Makefile.am: Adjust.
8164 `testsuite' is in src, not build.
8166 2001-08-17 Akim Demaille <akim@epita.fr>
8168 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8169 (generate.at): Install a temporary hack until the actual
8170 generate.awk is added to the repository.
8171 * tests/atconfig.in: New.
8173 2001-08-17 Akim Demaille <akim@epita.fr>
8175 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8177 2001-08-17 Akim Demaille <akim@epita.fr>
8179 * doc/m4.texinfo: Promote proper quotation.
8181 2001-08-17 Akim Demaille <akim@epita.fr>
8183 Remove the non Autotest tests.
8185 * tests/other-tests/capitalize.test,
8186 * tests/other-tests/changeword.test,
8187 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8188 * tests/other-tests/debug.test,
8189 * tests/other-tests/discard-comments.m4,
8190 * tests/other-tests/discard-comments.test,
8191 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8192 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8193 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8194 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8195 * tests/other-tests/hanoi.test,
8196 * tests/other-tests/import-environment.m4,
8197 * tests/other-tests/import-environment.test,
8198 * tests/other-tests/include.test, tests/other-tests/indir.test,
8199 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8200 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8201 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8202 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8203 * tests/other-tests/modtest.test,
8204 * tests/other-tests/multiquotes.test,
8205 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8206 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8207 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8208 * tests/other-tests/sync-lines.m4,
8209 * tests/other-tests/sync-lines.test,
8210 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8211 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8212 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8213 * tests/other-tests/wrap.test: Remove.
8215 * tests/run-test, tests/get-them: Remove.
8216 * tests/Makefile.am: Adjust.
8218 2001-08-17 Akim Demaille <akim@epita.fr>
8220 others.at no longer depends on other-tests/.
8222 * tests/others.at (stackovf): You're actually...
8224 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8225 (unload.test): Keep their authorship.
8226 (discard-comments, gmp, import-environment, modfreeze)
8227 (sync-lines): Embed the input files.
8228 * tests/stackovf.test: Copy from other-tests/stackovf.test.
8229 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8231 2001-08-17 Akim Demaille <akim@epita.fr>
8233 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8234 (M4exit): Tag the exit status of the example.
8235 * tests/get-them: Adjust.
8236 * tests/generate.awk: New, based on get-them.
8237 * tests/Makefile.am: Adjust to generate `generated.at'.
8238 * tests/testsuite.at: Adjust.
8239 (AT_CHECK_M4): Don't overquote. Blush...
8241 2001-08-17 Akim Demaille <akim@epita.fr>
8243 Start using Autotest. atconfig creation is still lacking.
8245 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8246 * examples/reverse.m4, tests/other-tests/import-environment.m4,
8247 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8248 * tests/other-tests/import-environment.test: Don't check LANGUAGE
8249 as it might be `unset', or set to `C'.
8250 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
8251 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8252 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8253 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
8254 * tests/other-tests/shadow.test: Adjust.
8255 * tests/testsuite.at, tests/others.at: New.
8256 * tests/Makefile.am: Adjust.
8258 2001-08-17 Akim Demaille <akim@epita.fr>
8260 Drop Autoconf 2.13 compatibility.
8262 * configure.in (changeword): No need to undefine it, as anyway if
8263 it's defined, M4sugar moved it as m4_changeword.
8264 And anyway, proper quotation is enough.
8265 (m4_pattern_allow): As it exists in 2.50, just use it.
8266 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
8267 Don't handle Gettext's duties, let it handle them.
8268 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
8270 2001-08-17 Akim Demaille <akim@epita.fr>
8272 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
8273 (m4_errprint): Use fputs.
8274 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
8275 dumpdef are not concerned.
8276 (Dumpdef, Errprint): Emphasize their insensitivity to
8278 * doc/Makefile.am: Add `TAGS' support.
8279 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
8281 * config/Makefile.am (MAINTAINERCLEANFILES): New.
8283 2001-08-17 Akim Demaille <akim@epita.fr>
8285 * modules/Makefile.am (ETAGS_ARGS): New.
8287 2001-08-17 Akim Demaille <akim@epita.fr>
8289 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
8292 2001-08-17 Akim Demaille <akim@epita.fr>
8294 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
8296 2001-08-17 Akim Demaille <akim@epita.fr>
8298 * m4/m4module.h (m4/list.h): Don't include it.
8300 2001-08-16 Gary V. Vaughan <gary@gnu.org>
8302 m4_modules are no more, we use lt_dlhandles directly and let
8303 latest libltdl features manage the list of loaded modules.
8304 * acinclude.m4: Regenerated.
8305 * m4/ltdl.c: Updated from master copy.
8306 * m4/module.c: Reimplemented to take advantage of advances in
8308 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
8309 list with lt_dlhandle_next.
8310 (m4_builtin_find_by_func): Ditto.
8311 (m4_builtin_table_install): Use lt_dlhandle.
8312 (m4_macro_define): Ditto.
8313 (m4_macro_table_install): Ditto.
8314 m4/module.h: Prototype new module management API.
8315 (m4_modules): No longer required.
8316 (m4_module_init_t, m4_module_finish_t): POSIX namespace
8317 violations, renamed to...
8318 (m4_module_init_func, m4_module_finish_func): ...these,
8320 (M4INIT_HANDLER): Clean way to declare init functions in modules.
8321 (M4FINISH_HANDLER): And similarly for finish functions.
8322 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
8323 -- Add indirection to the CONC macro so that arguments are
8325 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
8326 * modules/shadow.c (m4_init_module): Ditto.
8327 Due to new init function semantics, be careful to perform the
8328 initialisation only on first load.
8329 * modules/perl.c (m4_init_module): Ditto. And Ditto.
8330 (m4_finish_module): Replaced with M4FINISH_HANDLER.
8331 Due to new finish function semantics, be careful to perform the
8332 finalisation only on first load.
8333 * m4/m4private.h (m4_module): Removed in favour of...
8334 (m4_module_data): ...structure without all the wrapper fields.
8335 Instances of this new structure are stored associated lt_dlhandles
8336 with lt_dlcaller_data_set().
8337 * m4/builtin.c (m4_builtin_define): Takes a handle argument
8338 instead of the old module argument.
8339 (m4_builtin_table_install): Ditto.
8340 * modules/load.c (m4_resident_module): Removed. This is no
8341 longer implemented as a magic symbol...
8342 * modules/m4.c (m4_resident_module): Ditto.
8343 * modules/load.c (M4INIT_HANDLER): ...the module init function now
8344 uses the ltdl api to make the module resident.
8345 * modules/m4.c (M4INIT_HANDLER): Ditto.
8346 * modules/load.c (builtin_modules): Traverse the loaded module
8347 list with lt_dlhandle_next.
8348 (builtin_load): Much simplified in light of the reimplemented
8350 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
8351 light of the m4/module.c rewrite.
8352 (produce_symbol_dump): Ditto.
8353 (reload_frozen_state): Ditto.
8354 * m4/list.c, m4/list.h: Files deleted. No longer required.
8355 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
8356 (libm4_la_SOURCES): Delete list.c reference.
8357 * m4/m4private.h (m4_token_data): Add a handle field. This
8358 eliminates many of the searches to find the handle associated with
8359 various tokens that are passed between functions.
8360 (struct m4_symbol): Removed the module field. The
8361 module association does not belong with the symbol...
8362 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
8363 that the module implementation code is from. Added a handle
8365 (m4_push_macro): Add a `handle' argument. Changed all callers.
8366 (init_macro_token): Set the `handle' field for the
8368 * m4/macro.c (expand_argument): Copy the new handle field during
8370 * modules/m4.c (macro_install): Use the new handle field to
8371 optimise the search for the correct builtin structure, and pass
8372 the handle details to m4_builtin_define.
8374 2001-08-15 Akim Demaille <akim@epita.fr>
8376 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
8377 when creating `m4/obstack.h'.
8378 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
8380 * tests/defs: Make them absolute.
8381 (CDPATH) Neutralize.
8382 * tests/gethem: Use them.
8384 2001-08-14 Gary V. Vaughan <gary@gnu.org>
8386 * config/ltmain.sh: Doh! Import again for a quoting fix that
8387 prevented any regression test from passing.
8389 * m4/m4module.h (obstack.h): Choose between installed version
8390 and shipped version based on configure tests.
8391 * src/freeze.c (obstack.h): Ditto.
8393 * acconfig.h: Removed. No longer required.
8395 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
8396 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
8397 them to AC_INIT and AM_INIT_AUTOMAKE.
8398 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
8399 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
8400 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
8401 shell variable m4_cv_func_obstack_h.
8402 * tests/defs (M4): Be more careful about relative path to libtool
8403 script and m4 binary by using $srcdir.
8405 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
8406 optargs to the existing libltdl search path.
8407 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
8408 * m4/ltdl.c: Updated.
8410 * config/ltmain.sh: Ditto.
8412 2001-08-11 Gary V. Vaughan <gary@gnu.org>
8414 * src/main.c (main): Add `-b' (for `batch') mode switch to force
8415 interactive mode off.
8417 2001-08-10 Akim Demaille <akim@epita.fr>
8419 * configure.in: Require Autoconf 2.52.
8420 (AC_ARG_PROGRAM): Remove, handled by Automake.
8421 (m4_getopt): Rename as...
8422 (m4_getopt_h): this.
8423 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
8424 Undefine `changeword' only if defined.
8425 * config/gnu-obstack.m4: Require Autoconf 2.52.
8426 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
8429 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
8431 * doc/m4.texinfo: Fix some typos, and apply some small
8434 2001-08-09 Andreas Schwab <schwab@suse.de>
8436 * src/main.c (main): Fix improper uses of error (missing format
8439 2001-08-07 Akim Demaille <akim@epita.fr>
8441 Improve `make distcheck'.
8443 * configure.in: Be sure to be able to run `mkconfig.sh' when src
8445 * Makefile.am (dist-hook): Remove, as it is no longer needed.
8446 * doc/m4.texinfo (Include): Add missing blank.
8447 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
8450 2001-08-07 Akim Demaille <akim@epita.fr>
8452 * m4/evalparse.c: A better introductory comment.
8453 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
8454 * m4/macro.c: Adjust old comments.
8455 * modules/README: Typo.
8457 2001-08-07 Akim Demaille <akim@epita.fr>
8459 * config/gnu-obstack.m4: New.
8461 2001-08-07 Akim Demaille <akim@epita.fr>
8463 * config/Makefile.am, config/stackovf.m4: New.
8464 * configure.in, Makefile.am: Adjust.
8466 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
8468 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
8469 * po/cat-id-tbl.c: Remove file.
8470 * po/stamp-cat-id: Remove file.
8472 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
8474 * modules/format.c (format): Formatting for %f was not
8475 interpreting the position of the decimal point correctly for
8478 2000-12-01 Gary V. Vaughan <gary@gnu.org>
8480 * TODO: Removed m4exit bug.
8481 * modules/load.c (m4_resident_module): Make this module resident.
8482 * module/m4.c (m4_resident_module): Ditto.
8483 * m4/modules.c (m4_module_load): Use new ltdl resident modules
8484 feature to mark modules as resident if they export
8485 `m4_resident_module' as TRUE.
8486 (m4_module_unload): Do not remove resident modules, and take care
8487 with symbol insertion and deletion with resident modules.
8488 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
8489 use resident modules feature.
8491 2000-11-30 Gary V. Vaughan <gary@gnu.org>
8493 * TODO: Updated. Removed some cruft that has since been fixed
8494 or implemented. Added some more entries.
8497 * modules/README: Updated.
8498 * doc/m4.texinfo: Updated.
8500 * modules/gnu.c (builtin_functions): Make indir orthogonal to
8501 builtin, in that each is recognised as a macro only with parameters
8502 (builtin_indir): Passing 0 arguments is now an error, as with
8505 * src/main.c (usage): Added missing description of `-c' option.
8507 2000-11-29 Gary V. Vaughan <gary@gnu.org>
8509 Consolidate the myriad of dispersed test scripts into the
8510 tests subdirectory. I think I now have all the file where I
8511 want them, so there shouldn't be anymore upheaval =)O|
8513 * tests/Makefile.am: Updated to run the new tests added below.
8514 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
8515 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
8516 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8517 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8518 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8519 tests/other-tests/hanoi.test, tests/other-tests/include.test,
8520 tests/other-tests/indir.test, tests/other-tests/misc.test,
8521 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
8522 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8523 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8524 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
8525 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
8526 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
8527 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8528 tests/other-tests/translit.test, tests/other-tests/undivert.test,
8529 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8530 tests/other-tests/wrap.test: New tests based on the contents
8531 of the tests removed below.
8532 * examples/Makefile.am, modules/Makefile.am: Updated to
8533 reflect removed tests.
8534 * examples/defs,modules/defs: Removed.
8535 * examples/capitalize.test, examples/comments.test,
8536 examples/ddivert.test, examples/debug.test,
8537 examples/esyscmd.test, examples/exp.test,
8538 examples/foreach.test, examples/forloop.test,
8539 examples/fstab.test, examples/hanoi.test,
8540 examples/include.test, examples/indir.test,
8541 examples/misc.test, examples/multiquotes.test,
8542 examples/patsubst.test, examples/pushpop.test,
8543 examples/regexp.test, examples/reverse.test,
8544 examples/sysv-args.test, examples/trace.test,
8545 examples/translit.test, examples/undivert.test,
8546 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
8547 modules/modpath1.test, modules/modpath2.test,
8548 modules/modpath3.test, modules/modpath4.test,
8549 modules/modtest.test, modules/shadow.test,
8550 modules/unfrozen.m4, modules/unload.test: Removed.
8552 Move the implementation of GMP support for the mpeval() builtin
8553 into a loadable module that depends on libgmp. mpeval() and
8554 eval() share a common parser, now in m4/evalparser.c; the code
8555 in m4/numb.c and m4/numb.h is now physically split between
8556 m4/eval.c (the eval() backend) and modules/mpeval.c (the
8557 mpeval() backend), rather than being differentiated by cpp
8558 macros and multiple inclusion. The mpeval module is always
8559 built but will generate an diagnostic if it is used from an
8560 installation that didn't link in the gmp library.
8561 * modules/Makefile.am: build and install the new mpeval module.
8562 * modules/mpeval.c: Now contains the former parts of m4/numb.c
8563 and m4/numb.h that are required for gmp support in mpeval().
8564 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8565 * m4/evalmp.c: Removed.
8566 * m4/m4module.h: Removed conditional prototype for
8568 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
8569 and m4/numb.h that do not rely on gmp.
8570 * m4/evalparse.c: New file, contains the shared parts of the
8571 eval() and evalmp() parser implementations, and is no longer
8572 unencumbered by cpp magic to uncover the right parts.
8573 * m4/numb.h: Removed. It's former contents are split between
8574 m4/eval.c and modules/mpeval.c.
8577 * tests/other-tests/changeword.test: New test. Rudimentary
8578 testing of changeword builtin runs only if --wnable-changeword
8579 was used at configure time.
8580 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8581 alternation correctly. Split into two expressions to compensate.
8582 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
8583 * modules/Makefile.am: Build changeword module.
8584 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
8585 only when --enable-changeword was passed to configure.
8586 (builtin_changeword): If --enable-changeword was not used, then
8587 report that changeword() builtin has no support in m4 binary.
8589 2000-11-28 Gary V. Vaughan <gary@gnu.org>
8591 * src/main.c (main): Fixed a particularly nasty bug is
8592 user_search_path setting -- the -M flag processing must be
8593 extremely careful with search path ordering, or else the default
8594 installed module directory (possibly containing modules from a
8595 previous release) is placed earlier in the search path than any -M
8596 arguments (which are relied upon to load uninstalled modules with
8597 most of the tests in the regresion suite).
8599 * modules/load.c (builtin_load): Nasty hack to prevent adding
8600 symbols to symtab again if a module is loaded more than once.
8601 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
8603 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
8604 possible NULL pointer dereference.
8606 * m4/module.c (m4_module_find_by_modname): Renamed from
8607 m4_module_modname_find. Fixed all references.
8608 (m4_module_find_by_builtin): New function.
8610 * modules/modfreeze.test: load the `load' module with each
8612 * src/freeze.c (produce_frozen_state): Simplified in light of
8613 module field in m4_symbol. Allow a third argument for text macros
8614 to name the originating module.
8615 (reload_frozen_state): ditto.
8616 * m4/m4module.h: Fixup prototypes.
8617 * m4/builtin.h (m4_builtin_define): Add a module argument so
8618 that symbols can be registered against the defining module.
8619 (m4_macro_define): ditto.
8620 * m4/m4private.h (m4_symbol): Make the module field const to save
8621 on casting in the rest of the code.
8622 (SYMBOL_MODULE): New macro.
8624 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
8625 symbol reference maintenance bugs when removing a symbol from the
8628 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
8630 2000-11-27 Gary V. Vaughan <gary@gnu.org>
8632 * configure.in (m4_cv_func_obstack): A better check for whether
8633 libc has an obstack implementation.
8634 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
8636 * configure.in (--with-modules): Changed semantics. This
8637 option is now used to list modules to be preopened.
8638 * src/m4.h: #include "ltdl.h" unconditionally.
8639 * src/main.c: Removed all dependencies on WITH_MODULES.
8640 * src/freeze.c: ditto.
8641 * modules/Makefile.am: ditto.
8642 * m4/m4.c (builtin_m4exit): ditto.
8643 * modules/modpath1.test: ditto.
8644 * modules/modpath2.test: ditto.
8645 * modules/modpath3.test: ditto.
8646 * modules/modpath4.test: ditto.
8647 * modules/modtest.test: ditto.
8648 * modules/shadow.test: ditto.
8649 * modules/unload.test: ditto.
8651 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
8652 comes up on demand in LTLIBOBJS now.
8653 * configure.in (getopt_long): Creating and relying on a link for
8654 getopt.h on hosts with no getopt_long() of thier own works
8655 correctly now. This is necessary so that callers of getopt_long()
8656 can simply `#include <getopt.h>': the naive way of doing this
8657 would end up using our own getopt.h and the installed
8658 getopt_long(), which is asking for trouble!
8659 (obstack_init): A similar argument applies to obstack.h and
8662 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
8663 On Solaris-2.5 (at least) the native dlopen implementation
8664 gets confused about m4.o when looking for module "m4". This
8665 version always looks for .la an .$lib_ext suffixed names first
8666 to work around the problem. Sigh.
8668 * po/POTFILES.in: Take account of these file movements.
8669 * src/Makefile.am (m4_SOURCES): removed eval.c.
8670 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
8671 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
8672 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
8673 * modules/m4.c (builtin_eval): Use m4_evaluate().
8674 * m4/eval.c: Moved here from src/eval.c to facilitate
8675 implementation of eval() builtin as part of the `m4' loadable
8677 (m4_evaluate): renamed from evaluate for namespace cleanliness.
8678 * m4/numb.c: Moved here from src/numb.c, since it is #included
8679 into eval.c at compile time.
8680 * m4/m4module.h (m4_evaluate): Added prototype.
8681 * src/m4.h (evaluate): Removed prototype.
8683 2000-11-25 Gary V. Vaughan <gary@gnu.org>
8685 * modules/perl.c (builtin_perleval): Use PL_na for
8686 compatibility with perl-5.6.
8688 * src/main.c (main): It is now safe to
8689 ``m4_module_install("m4")'', without tripping over the m4
8691 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
8692 versions having fixed the insidious module search order bug.
8694 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
8695 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
8697 * configure.in: Figure out whether to use the installed
8698 getopt.h or the supplied one.
8699 * src/Makefile.am: ditto.
8701 * po/POTFILES.in: List files in their new positions.
8703 * config/ltmain.sh: This needs to be checked in to match the
8704 libtool macros copied to acinclude.m4 (until a released
8705 libtool copes with m4's needs).
8706 * bootstrap: Run gettextize.
8708 2000-11-24 Gary V. Vaughan <gary@gnu.org>
8710 * AUTHORS: Added my details.
8713 * bootstrap: temporary update until released libtool catches up.
8715 * All files: Use new GNU GPL copyright blurb with current contact
8718 * configure.in (LTLIBOBJS): Use canonical code for calculation of
8721 * config: renamed acm4 directory to config to be more like
8722 other autoconfiscated packages.
8724 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
8725 * config/debug.m4: New file implementing configure macros to add
8726 suitable debug flags to the compiler invocation.
8728 * modules/load.c: New file implementing the ``load'' and
8729 ``unload'' builtins.
8730 * tests/get-them: Set the module search directory to the modules
8731 build directory in generated tests.
8732 * modules/shadow.test: ditto.
8733 * modules/modtest.test: ditto.
8734 * modules/modpath1.test: ditto.
8735 * modules/modpath2.test: ditto.
8736 * modules/modpath3.test: ditto.
8737 * modules/modpath4.test: ditto.
8738 * modules/modtest.test: ditto.
8739 * modules/modfreeze.test: ditto.
8740 * modules/unload.test: ditto.
8742 * modules/changeword.c: New file implementing the ``changeword''
8743 builtin as a loadable module.
8744 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
8745 as a loadable module.
8747 * src/main.c (main): Load the gnu module if m4 was started
8748 normally -- i.e. without the -G option.
8749 * modules/gnu.c: New file implementing a new loadable module wuth
8750 definitions for all the gnu extension builtins.
8751 * modules/format.c: Moved here from src/format.c. Now included
8754 * src/main.c (main): Load the traditional module if m4 was
8755 started in `no_gnu_extensions' mode.
8756 * modules/traditional.c: New file implementing the ``unix'' macro,
8757 required when m4 is executed in traditional mode, as a loadable
8760 * src/main.c: Renamed from m4.c to avoid confusion with
8762 (main): Always load the m4 module.
8763 * modules/m4.c: New file implementing a new loadable module with
8764 definitions for all m4 builtins that are not gnu extensions.
8766 * m4/Makefile.am: Adjusted to take new files below into account.
8767 * m4/m4module.h: Prototypes for exported functions and types moved
8768 to this directory from the src directory.
8769 * m4/m4private.h: Moved here from src/m4private.h to facilitate
8770 the migration of all builtin implementations to loadable modules.
8771 * m4/macro.c: Moved this file here from the src directory,
8772 renaming all exported symbols to use the prefix ``m4_''.
8773 * m4/builtin.c: ditto.
8774 * m4/module.c: ditto.
8775 * m4/symtab.c: ditto.
8776 * m4/debug.c: ditto.
8777 * m4/input.c: ditto.
8778 * m4/output.c: ditto.
8780 * m4/ltdl.h, m4/ltdl.c: ditto.
8781 * m4/utility.c: Odd functions moved here from files in the src
8782 directory to facilitate builtin migration.
8784 2000-08-12 Gary V. Vaughan <gary@gnu.org>
8786 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
8787 error message, to make translators' jobs a little easier.
8788 (builtin_builtin): ditto.
8789 (builtin_traceon): ditto.
8790 (builtin_traceoff): ditto.
8791 Reported by Akim Demaille <akim@epita.fr>
8793 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
8794 pkgincludedir instead.
8796 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
8797 it is exported globally. Fixed all references.
8801 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
8802 globally. Fixed all references.
8803 (DEF_LQUOTE): ditto.
8807 2000-07-28 Gary V. Vaughan <gary@gnu.org>
8812 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
8813 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
8815 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
8816 Removed `Prev', `Next' and `Up' fields of all @nodes now that
8817 makeinfo calculates them for us, and to make any future
8818 reorganisation easier.
8819 (Frozen files): Document format version 2.
8820 `V' now takes argument `2'.
8821 `F' can take a single argument if symbol and builtin names
8822 are the same, or 3 arguments if the builtin is from a module.
8823 New `S' specification for saving syntax table contents.
8824 New `M' specification for saving loaded module names.
8825 * src/freeze.c: Implement them.
8826 * src/input.c (syntax_code): For interpreting frozen syntax
8829 * examples/Makefile.am: Add the contents of the WWW directory to
8831 * examples/WWW/Makefile: ditto,
8832 (%.htm): Compares file contents (not just sizes) to determine
8833 whether a change has occured.
8834 * examples/WWW/_header.htm: Bumped version number.
8835 * examples/WWW: Regenerated content.
8837 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
8838 compilers comes much easier without ansi2knr.
8839 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
8841 * m4/list.c: New generic list container type.
8842 * m4/list.h: Interface to new container type.
8843 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
8844 (libm4_la_SOURCES): compile and link list.c.
8845 * src/builtin.c (builtin_tables): Use list container.
8846 * src/module.c (symtab): ditto.
8847 * src/symtab.c (symtab): ditto.
8849 * m4/system.h: New file for common preprocessor definitions.
8850 * m4/Makefile.am (pkginc_HEADERS): install system.h.
8851 * m4/error.c: Use system.h in place of inline preprocessor.
8852 * m4/error.h: ditto.
8853 * m4/module.c: ditto.
8854 * m4/module.h: ditto.
8855 * m4/xmalloc.c: ditto.
8857 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
8859 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
8861 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
8862 it is exported globally. Fixed all references.
8864 (module_init_t): ditto.
8865 (module_finish_t): ditto.
8866 (token_data): ditto.
8867 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
8868 it is exported globally. Fixed all references.
8869 (SYNTAX_IGNORE): ditto.
8870 (SYNTAX_SPACE): ditto.
8871 (SYNTAX_OPEN): ditto.
8872 (SYNTAX_CLOSE): ditto.
8873 (SYNTAX_COMMA): ditto.
8874 (SYNTAX_DOLLAR): ditto.
8875 (SYNTAX_ACTIVE): ditto.
8876 (SYNTAX_ESCAPE): ditto.
8877 (SYNTAX_ALPHA): ditto.
8878 (SYNTAX_NUM): ditto.
8879 (SYNTAX_ALNUM): ditto.
8880 (SYNTAX_LQUOTE): ditto.
8881 (SYNTAX_RQUOTE): ditto.
8882 (SYNTAX_BCOMM): ditto.
8883 (SYNTAX_ECOMM): ditto.
8884 (SYNTAX_VALUE): ditto.
8885 (SYNTAX_MASKS): ditto.
8903 (TOKEN_NONE): ditto.
8904 (TOKEN_STRING): ditto.
8905 (TOKEN_SPACE): ditto.
8906 (TOKEN_WORD): ditto.
8907 (TOKEN_SIMPLE): ditto.
8908 (TOKEN_MACDEF): ditto.
8910 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
8911 consistency. Fixed all references.
8912 (STRING): Renamed to `m4_string' for consistency, and because if
8913 is exported globally. Fixed all references.
8914 (token_type): Renamed to `m4_token_t' for the same reasons.
8915 (token_data_type): Renamed to `m4_token_data_t' for the same
8918 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
8922 (XFREE): Wrapper macro which avoids freeing NULL pointers.
8924 * m4/m4module.h (m4_macro): New type for module defined user
8926 * modules/modtest.c (m4_macro_table): Define module user macros.
8927 * modules/shadow.c (m4_macro_table): ditto.
8929 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
8930 declared with M4BUILTIN.
8932 * m4/xmalloc.c: Use memset if bzero is not available when
8933 emulating calloc with malloc.
8934 (xcalloc): Fallback to malloc/bzero if calloc is not available.
8935 (xfree): Added for consistency. Will not try to free NULL
8937 * src/m4.c (xfree): Deleted in favour of the above.
8938 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
8939 linking with libdmalloc.
8940 * m4/xstrdup.c (WITH_DMALLOC): ditto.
8942 * modules/frozen.m4: New test case.
8943 * modules/unfrozen.m4: ditto.
8944 * modules/modfreeze.test: New test.
8945 * modules/unload.test: ditto.
8946 * modules/Makefile.am (EXTRA_DIST): Distribute them.
8948 * modules/modpath1.test: Don't try this test if module support is
8950 * modules/modpath2.test: ditto.
8951 * modules/modpath3.test: ditto.
8952 * modules/modpath4.test: ditto.
8953 * modules/modtest.test: ditto.
8954 * modules/shadow.test: ditto.
8956 * modules/perl.c: New module.
8957 * modules/perl.m4: Example of using it.
8958 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
8960 * src/m4.c (main): Assume interactive mode if STDIN is connected
8962 Changed startup sequence slightly so that syntax is not
8963 initialised from here when loading a frozen file.
8965 * src/builtin.c: Much improved macro definition style.
8966 * src/m4private.h: Internal structures for m4_builtin and
8967 m4_macro instances. These are not exposed to module writers.
8968 * src/module.c (module_modname_find): Find a module structure
8970 (make_macro_table): Build an internal macro table from a external
8972 (make_builtin_table): Build an internal builtin table from an
8973 external definition.
8975 * src/module.c (module_unload): Be extremely careful to remove
8976 builtins and macros that match the module being unloaded -- no
8977 longer assume that the top element can be removed incase another
8978 odule defines an identical name.
8979 * src/symtab.c (remove_table_reference_symbols): remove all symbol
8980 table entries which refer to a given builtin table.
8981 * src/builtin.c (remove_tables): Use it!
8983 2000-07-13 Thomas Tanner <tanner@ffii.org>
8985 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
8986 * acm4/modules.m4: deleted
8987 * bootstrap: don't libtoolize libltdl!
8988 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
8989 if set, enable WITH_MODULES and add modules to DLPREOPEN
8990 * examples/misc.test: redirect standard output
8991 * lib/Makefile.am: don't use DLLDFLAGS
8992 * lib/m4module.c: include necessary headers to silence GCC -Wall
8993 * lib/m4regex.c: fixes to silence GCC -Wall
8994 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
8995 build modules conditionally
8996 * modules/shadow.c: define symbol aliases before using them
8997 * modules/test.c: define symbol aliases before using them
8998 * po/de.po: update translation
8999 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9000 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9002 * src/m4.c: initialize libltdl's preloaded symbols via
9003 LTDL_SET_PRELOADED_SYMBOLS
9004 * src/module.c: libltdl's memory management must be initialized
9005 before calling lt_dlinit!, fix warnings
9007 2000-01-18 Gary V. Vaughan <gary@gnu.org>
9009 * README: Caveat about nls not supported by dll architecture on
9012 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9014 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
9015 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
9016 * modules/Makefile.am (LIBS): ditto.
9017 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9018 $(top_srcdir)/m4 (for only <m4module.h>).
9019 * modules/shadow.test: fixed for VPATH.
9020 * modules/modtest.test: ditto.
9021 * modules/modpath4.test: ditto.
9022 * modules/modpath3.test: ditto.
9023 * modules/modpath2.test: ditto.
9024 * modules/modpath1.test: ditto.
9026 * modules/time.test: Removed due to timezone dependence,
9027 * modules/Makefile.am (TESTS): Removed time.test.
9029 * configure.in: Use $3 of AC_DEFINE so that we can,,,
9030 * acconfig.h: Remove everything except the gettext parameters.
9031 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9033 * acm4/ltdl.m4: Updated to latest from libtool cvs.
9034 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
9035 increment serial number.
9037 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9038 src dir and immediately after libm4 is built for confidence that
9039 it doesn't rely on the src directory.
9040 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9041 makeinfo stop the build on cygwin (because they don't work).
9043 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9045 * m4/m4private.h: ...is not a public header, so moved to src.
9046 Add `#include <config.h>', `#define _COMPILING_M4' and
9048 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9049 * src/Makefile.am (noinst_HEADERS): add m4private.h.
9050 * src/builtin.c: `#include "m4private.h"' now takes care of the
9051 above. Duplicates removed.
9052 * src/debug.c: ditto.
9053 * src/eval.c: ditto.
9054 * src/evalmp.c: ditto.
9055 * src/format.c: ditto.
9056 * src/freeze.c: ditto.
9057 * src/input.c: ditto.
9059 * src/macro.c: ditto.
9060 * src/module.c: ditto.
9061 * src/numb.h: ditto.
9062 * src/output.c: ditto.
9063 * src/path.c: ditto.
9064 * stackovf.c: ditto.
9067 * po/POTFILES.in: compensate for renaming of lib/*.
9068 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9069 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9070 and then in $(top_srcdir)/lib (for eg. "m4private.h").
9071 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9073 * m4/m4error.h: Renamed error.h, for installation to
9074 $prefix/include/m4..
9075 * m4/m4obstack.h: Renamed obstack.h, for same reason.
9076 * m4/m4regex.h: Renamed regex.h, for same reason.
9077 * m4/m4error.c: Renamed error.c, and use #include "error.h".
9078 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9079 * m4/m4regex.c: Renamed regex.c, and fix #includes.
9081 * lib: moved to m4 to easily support header installation to
9083 * Makefile.am (SUBDIRS): renamed lib dir to m4.
9084 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9085 * acm4/regex.m4: Point to m4/regex.c.
9087 * examples/foreach.m4: Sanitise quoting.
9088 * examples/foreach.test: New torture test.
9089 From Akim Demaille <akim@epita.fr>
9091 2000-01-17 Gary V. Vaughan <gary@gnu.org>
9093 * src/ltdl.c: Use access() to abort doomed module load attempts
9094 if module file does not exist.
9096 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9097 getopt1.o will already be used if appropriate, so I moved getopt.c
9098 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9100 * modules/modpath1.test: Use correct filename in header line.
9101 * modules/modpath2.test: ditto.
9102 * modules/modpath3.test: ditto.
9103 * modules/modpath4.test: ditto.
9105 Without these changes lt_dlopen("test") attempts to
9106 LoadLibrary("/bin/test") on Windows, which although harmless
9107 generates a spurious error message which spoils most of the tests:
9108 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9109 (TESTS): s/test.test /modtest.test /
9110 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9111 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9112 * modules/modpath1.test: s/test.m4 /modtest.m4 /
9113 * modules/modpath2.test: ditto.
9114 * modules/modpath4.test: ditto.
9115 * modules/modpath3.test: s/-m test /-m modtest /
9116 * modules/shadow.m4: use {un,}loadmodule(`modtest').
9118 2000-01-16 Gary V. Vaughan <gary@gnu.org>
9120 * src/ltdl.c (find_file): Updated to new version with fixed memory
9121 allocation bug in `next'.
9122 * src/ltdl.h: updated to match.
9124 * modules/Makefile.am: Cleaned up and reordered.
9126 2000-01-16 René Seindal <rene@seindal.dk>
9128 * modules/Makefile.am (TESTS): New tests for the module system.
9130 * modules/*.test: New files.
9132 * src/m4.c (main): Added call to module_init().
9133 Treats -M and -m as the arguments -D -U and -t, ie deferred.
9135 * src/m4.h: Added declaration of module_init().
9137 * src/module.c (module_init): No longer static
9139 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9140 Added to shut up automake about non standard libtool library
9143 * src/module.c: Disabled DEBUG by default.
9145 * modules/README: Changed example from unload.m4 to shadow.m4
9147 * modules/shadow.m4: Renamed from unload.m4
9149 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9151 * src/m4.c (main): Functionality for -m and -M were reversed.
9154 2000-01-12 Gary V. Vaughan <gary@gnu.org>
9156 * doc/help2man.pl: updated to version 1.020.
9158 * lib/COPYING.LIB: updated to version 2.1.
9160 * lib/m4module.h: restructure the M4_SCOPE code to work when
9161 creating a dll which links with libm4.la and both DLL_EXPORT
9162 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9165 2000-01-11 Gary V. Vaughan <gary@gnu.org>
9167 Merged the following changes from my tree:
9169 1999-06-15 Gary V. Vaughan <gary@gnu.org>
9171 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9172 ported to compile shared libs.
9174 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9175 use `__declspec(dllimport)' when linking libm4.la on win32.
9176 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9178 * configure.in (M4OBJS): Discover whether we need the shipped
9179 implementation of getopt_long.
9180 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9181 main binary here, as opposed to the module library in lib/libm4.la.
9183 1999-06-14 Gary V. Vaughan <gary@gnu.org>
9185 * modules/README: Updated to describe the improved libltdl based
9187 * README (cygwin): Added some compilation notes for building m4
9188 correctly under cygwin.
9189 * TODO: Cleaned out the entries for the module system since they
9190 are now implemented.
9192 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9193 all instances of __P with M4_PARAMS.
9195 * lib/getdate.h: removed unreferenced file.
9197 * lib/m4private.h: New file to define the private interface to the
9198 token_data struct, which must be shared between m4module.c, and
9199 builtin.c but not exported to modules built from the installed
9200 m4module.h since it's size changes depending on compile time
9203 * src/m4.h: Lots of stuff moved to lib/m4module.h.
9205 * lib/m4module.h: New file to define the interface available when
9206 compiling m4 modules.
9207 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9208 necessary for module compilation into this new file.
9210 * lib/Makefile.am (include_HEADERS): install headers (renamed to
9211 avoid nameclash with other system headers) necessary for compiling
9213 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9214 so that modules can include the (renamed) installed headers and
9215 be guaranteed a matching implementation.
9216 * lib/m4error.h: renamed from error.h.
9217 * lib/m4obstack.h: renamed from obstack.h.
9218 * lib/m4regex.h: renamed from regex.h.
9219 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
9220 implementation, simply include the shipped version
9221 unconditionally, otherwise it is hard for a module to know
9222 whether the m4obstack.h header it is using matches the
9223 implementation it ends up linking against.
9224 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
9227 1999-05-18 Gary V. Vaughan <gary@gnu.org>
9229 * examples/misc.test: Don't run this test on machines which don't
9230 have a root user in /etc/passwd (e.g. cygwin).
9232 * tests/get-them (/^@example$/): Error messages might have a
9233 ``.exe'' suffix to the program name, or else use the libtool
9234 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
9235 of these cases are now catered for when comparing error messages
9237 * tests/other-tests/*.test: ditto.
9238 * examples/*.test: ditto.
9240 * tests/defs (M4): use libtool execute mode.
9241 * examples/defs (M4): ditto.
9243 * tests/get-them (END): explicitly close any open file.
9244 (printthem): In a regular expression, '{' is the start of a repeat
9245 count! Use `[{]' for a literal open brace.
9246 (/^@node /): Don't use substr on a string shorter than the trim
9249 1999-05-17 Gary V. Vaughan <gary@gnu.org>
9251 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9253 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9255 2000-01-10 Andreas Schwab <schwab@suse.de>
9257 * tests/other-tests/gmp.test: Find config.sh in build directory.
9259 * configure.in: Find tests/mkconfig.sh in $srcdir.
9261 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9262 <signal.h> (for SUS2 compliant systems).
9264 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
9267 2000-01-10 René Seindal <rene@seindal.dk>
9271 * TODO, NEWS: Cleaned up and updated.
9273 * src/m4.c (main): New variable exit_status for exit status in
9274 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
9275 file cannot be read instead of EXIT_SUCCESS.
9277 * src/builtin.c (m4_indir): Changed error message to help
9278 translators (from Akim Demaille <demaille@inf.enst.fr>).
9280 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
9283 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
9286 * src/input.c (match_input): Reordering of code, to avoid multiple
9287 calls to push_string_init() from obstack_grow(), which can happen
9288 with some compilers (found and fixed by James Bonfield
9289 <jkb@mrc-lmb.cam.ac.uk>).
9291 * src/stackovf.c: Added prototypes for ultrix.
9292 (setup_stackovf_trap): Added __P to cast.
9293 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
9295 2000-01-09 René Seindal <rene@seindal.dk>
9297 * doc/m4.texinfo (Changequote): Added comment about changing
9298 quotes when the old quote is a part of the new.
9300 * src/builtin.c (expand_ranges): Added break after trailing dash.
9301 This caused misbehavious on some systems (found and fixed by Akim
9302 Demaille <demaille@inf.enst.fr>).
9304 * AUTHORS: Thomas Tanner included
9306 * acconfig.h: Added entry for ss_sp (see below).
9308 * configure.in (use_stackovf): Added check for stack_t with member
9309 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
9310 <eggert@twinsun.com>).
9312 * doc/m4.texinfo (Frozen files): Added a simpler example for
9313 generating frozen files from several input files.
9315 1999-11-14 Paul Eggert <eggert@twinsun.com>
9317 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
9318 lib/regex.c, lib/xmalloc.c.
9320 1999-11-10 René Seindal <rene@seindal.dk>
9322 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
9324 * src/module.c: reindented.
9325 (module_load): return if this is a repeated load of same module.
9326 (module_init): slight change of logic to avoid repeated
9327 initialisation debug messages.
9329 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
9330 in the distribution.
9332 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
9333 automake warnings about missing lib prefix.
9334 (time_la_LDFLAGS): ditto
9335 (stdlib_la_LDFLAGS): ditto
9337 1999-11-10 Paul Eggert <eggert@twinsun.com>
9339 * src/m4.h: Include error.h, since our macros use error.
9340 * src/m4.c: Don't need to include error.h.
9342 1999-11-09 Paul Eggert <eggert@twinsun.com>
9344 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
9345 and zero, as Solaris 7 cc does.
9346 (bcopy): Remove macro; no longer needed with new obstack.h.
9348 * src/output.c (freeze_diversions): Don't assume that a
9349 diversion size can fit in `int'. Check for diversion file
9350 size too large to be printed with `unsigned long'.
9352 * src/Makefile.am (CFLAGS): Omit -Wall.
9354 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
9356 * src/debug.c (trace_format):
9357 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
9359 * src/freeze.c (produce_frozen_state):
9360 Don't assume string lengths fit in int.
9362 1999-10-13 René Seindal <rene@seindal.dk>
9364 * po/cs.po: Czech translation added.
9366 * po/sv.po: Updated Swedish translation.
9368 * po/ru.po: Updated Russian translation.
9370 * po/pl.po: Updated Polish translation.
9372 * po/el.po: Greek translation added.
9374 1999-10-13 René Seindal <rene@seindal.dk>
9376 * configure.in (ALL_LINGUAS): Added Greek translation (el).
9377 (ALL_LINGUAS): Added Czech translation (cs).
9379 1999-03-30 Gary V. Vaughan <gary@gnu.org>
9381 * src/builtin.c: moved module loading functions into...
9382 * src/module.c: entirely new implementation using libltdl.
9383 * po/POTFILES.in: added src/module.c.
9384 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
9385 are modules, not linktime libraries.
9386 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
9387 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
9388 avoidance on exported symbols.
9389 * modules/test.c (m4_macro_table, m4_init_module,
9390 m4_finish_module): ditto.
9391 * modules/time.c (m4_macro_table): ditto.
9393 * modules/time2.m4: new file which requires command line loading
9395 * src/m4.c (--load-module): dynamically load named runtime module
9396 into running executable before reading the source.
9397 (--module-directory): prepend a directory to the module search
9399 (module_init()): Do this the first time we load a module instead;
9400 if the module subsystem is broken normal m4 scripts can still run.
9401 * src/m4.h (install_builtin_table): is now exported.
9403 1999-03-26 Gary V. Vaughan <gary@gnu.org>
9405 * src/module.c: removed. No longer required.
9406 * po/POTFILES.in: removed src/module.c.
9408 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
9409 the bootstrap script can recreate.
9410 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
9411 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
9412 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
9413 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
9414 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
9415 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
9416 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
9417 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
9419 * acinclude.m4: removed. `aclocal -I acm4' handles this much
9421 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
9422 * acm4/gettext.m4: removed. It causes a multiple definition vs.
9423 the installed gettext.m4 file when running aclocal.
9425 1999-03-25 Gary V. Vaughan <gary@gnu.org>
9427 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
9428 distinguish this from the last prerelease.
9429 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
9430 in its own subdirectory.
9432 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
9433 lib prefix on a module" feature.
9434 (LDFLAGS): Added `-module -avoid-version' flags to build
9435 versionless module libraries.
9436 * src/builtin.c (m4_load_module): use libltdl.
9437 (module_unload_all): use libltdl.
9438 * src/m4.c (module_init): initialise module loading on demand for
9439 better diagnostics, and so that m4 will still work even if
9440 the module code is broken.
9441 * src/m4.h (module_init): removed. No longer relevant.
9442 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
9443 exported symbols for compatibility with dlpreopening.
9444 * modules/test.c (m4_macro_table, m4_init_module,
9445 m4_finish_module): ditto.
9446 * modules/time.c (m4_macro_table): ditto.
9448 * bootstrap: New file. Runs all the autoutils in the right order
9449 after a fresh checkout, or a make maintainer-clean.
9451 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
9453 * src/builtin.c (dump_symbols): New function, factoring common
9454 content of m4_dumpdef and m4_symbols.
9455 (m4_dumpdef): Use it.
9456 (m4_symbols): New function, implementing `symbols'. Use it.
9457 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
9458 file compile with modern makeinfo.
9459 (Symbols): New node, documenting symbols.
9460 (direntry): Modernize.
9462 1998-12-11 René Seindal <rene@seindal.dk>
9464 * src/builtin.c (predefined_tab): New predefined macros
9465 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
9466 configure time options.
9468 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
9470 * src/module.c (module_try_load): Don't try to be clever and
9471 overwrite argument string. Instead allocate all constructed
9472 strings locally, since they can have arbitrary lengths. Make
9473 arguments pointers to const.
9474 (module_search): Simplify due to above change.
9476 1998-11-29 René Seindal <rene@seindal.dk>
9480 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
9482 * tests/other-tests/import-environment.{m4,test}: New test.
9484 * tests/other-tests/discard-comments.{m4,test}: New test.
9486 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
9488 * src/m4.c (main): New option -c --discard-comments.
9489 New global variable discard_comments.
9491 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
9492 discarded, ie never returned from next_token().
9493 Added declaration of discard_comments.
9495 * src/input.c (next_token): Now loops until token type is not
9496 TOKEN_NONE. Comments are now given this type when comments should
9499 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
9502 1998-11-28 René Seindal <rene@seindal.dk>
9504 * src/m4.c (main): New option --import-environment (no single
9507 * When configured with --with-gmp both the normal (fast) eval()
9508 and the gmp aware mpeval() are defined. To restore previous
9509 bahaviour use "define(`eval', defn(`mpeval'))".
9511 * tests/other-tests/gmp.m4: Changed to use mpeval().
9513 * src/evalmp.c: New file for compiling eval.c as gmp aware.
9514 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
9516 * src/eval.c: Now includes "numb.c" directly. Everything in this
9517 file must by static, except evaluate(), which is changed to
9518 mp_evaluate() if USE_GMP in force.
9520 * src/numb.c: Changed to be included by eval.c instead of being
9521 compiled separately. Everything is declared static.
9523 * src/numb.h: Removed declarations of functions, as numb.c is now
9526 * src/builtin.c: Declaration of m4_mpeval() added.
9527 Inserted `mpeval' in builtin table.
9528 (do_eval): New function with common code for m4_eval and m4_mpeval.
9529 (m4_mpeval): New function for gmp version of eval.
9531 * src/m4.h: Declaration of mp_evaluate().
9533 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
9534 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
9536 * src/m4.c (main): m4 --version also shows which options were used
9537 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
9539 1998-11-27 René Seindal <rene@seindal.dk>
9541 * Error messages now always print program name before input file
9542 name as specified by GNU coding standards. Reported by Akim
9543 Demaille <demaille@inf.enst.fr>.
9545 * doc/m4.texinfo (Include): Change due to changed error message
9549 * tests/get-them: Minor change to sed script due to changed error
9552 * src/m4.c (print_program_name): New func used to print program
9553 name, input file and line number in error (). Used as an
9554 error_print_progname handler.
9555 (reference_error): Removed.
9556 (main): Assigns error_print_progname.
9558 * src/m4.h (M4ERROR): Removed reference_error ().
9560 1998-11-25 René Seindal <rene@seindal.dk>
9562 * Updated to libtool 1.2b.
9564 * src/builtin.c (install_builtin_table): Added braces to avoid
9565 warning of ambiguous 'else'.
9567 * src/module.c: Inserted search path code from path.c modified to
9569 (module_init): Configured default path used only if M4MODPATH is
9571 (module_try_load): Now reads libMODULE.la as generated by libtool
9572 for actual module name.
9573 (module_load): Gives better error messages on failure.
9575 * src/m4.h: Added declarations of structures and functions for
9576 generic search path handling.
9578 * src/path.c: Removed all module specific code and introduced new
9579 functions of more generic search path handling.
9581 1998-11-24 René Seindal <rene@seindal.dk>
9583 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
9584 included gettext, as <libintl.h> might not be found
9585 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
9587 1998-11-22 René Seindal <rene@seindal.dk>
9589 * src/output.c (insert_diversion): Fixed bug that might cause m4
9590 to read from standard output! Triggered by input
9591 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
9592 so now 'undivert(0)' does nothing.
9594 1998-11-18 René Seindal <rene@seindal.dk>
9598 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
9599 could be changed when compiling a illegal regexp, causing later
9600 use of the regexp to dump core.
9602 * src/module.c (module_load): Changed error message to conform to
9605 * src/m4.c (usage): Added message about reporting bugs.
9607 * doc/m4.texinfo (Changeword): Corrected a wrong example.
9608 (Changeword): Added note about the type of regexps used.
9610 * ltconfig, ltmain.sh: New files from Libtool 1.2.
9612 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
9613 and AM_PROG_LIBTOOL.
9615 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
9618 * modules/Makefile.am: Changed completely to compile modules using
9619 libtool. The modules are compiled as shared libraries, and are
9620 renamed when installed.
9622 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
9623 USE_SHL_LOAD to HAVE_SHL_LOAD
9625 * src/builtin.c (shipout_string): Now tests for a NULL string.
9627 * src/module.c: New level of indirection around non-portable
9628 functions to load shared objects. Intended to encapsulate the non
9629 portable parts better and to reduce the number of #ifdefs in the
9632 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
9633 directory modules/ to the distribution.
9635 1998-11-15 René Seindal <rene@seindal.dk>
9639 * modules/stdlib.c: New module `stdlib' defining some standard
9640 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
9641 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
9643 * src/builtin.c (shipout_string): New convenience function for
9644 builtins and modules.
9646 * src/module.c (module_load): Tentative support for
9647 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
9649 * Makefile.am (SUBDIRS): Directory modules added if configured.
9651 * modules/Makefile.am: Now correctly compiles and installs
9652 modules in pkglibexecdir.
9654 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
9655 These two are now initialised by autoconf macros.
9657 * src/path.c (module_env_init): MODULE_PATH is always on the
9660 * src/Makefile.am: Now generated pathconf.h which defined the
9661 default MODULE_PATH.
9663 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
9664 where modules are installed.
9666 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
9667 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
9668 build and install automatically, and it is prepared for other
9669 interfacec than dlopen().
9671 * src/builtin.c (predefined_tab): Added __m4_version__ for the
9672 current version of GNU m4. It is a GNU extension.
9674 1998-11-14 René Seindal <rene@seindal.dk>
9676 * tests/Makefile.am (GENERATED_TESTS): Added new
9677 generated-tests/changesy.8.test
9679 * doc/m4.texinfo (Changesyntax): Documentation for escape
9682 * src/macro.c (expand_token): Check for escaped macro call before
9683 symbol table lookup.
9685 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
9688 * src/input.c: New static variable use_macro_escape, which is TRUE
9689 iff some character has code SYNTAX_ESCAPE
9690 (input_init): Added initialisation of use_macro_escape.
9691 (check_use_macro_escape): New function to synchronise
9692 use_macro_escape with the syntax table.
9693 (set_quotes): Added call to check_use_macro_escape()
9696 (next_token): Added new case for IS_ESCAPE.
9698 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
9700 1998-10-13 René Seindal <rene@seindal.dk>
9704 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
9707 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
9708 maintained tests in tests/other-tests. These currently tests for
9709 8-bit transparency, multiple precision arithmetic and sync-line
9710 output. Test for stackoverflow detection does not work.
9712 * examples/Makefile.am (TESTS): Added tests for all example files.
9714 * examples/mktests.sh: New file. Help program for creating test
9717 * tests/mkconfig.sh: New file to generate tests/config.m4 and
9718 tests/config.sh. This is for tests of configure selectable
9719 features. Picks up all set WITH_ and ENABLE_ veriables from
9722 * src/path.c (path_search): Added argument 'char **expanded_name'
9723 to return the expanded name.
9725 * src/m4.h: Added 2nd argument to declaration of path_search().
9727 * src/m4.c (main): Added 2nd argument to path_search().
9729 * src/freeze.c (reload_frozen_state): Do.
9731 * src/builtin.c (m4_undivert): Do.
9734 1998-10-11 René Seindal <rene@seindal.dk>
9736 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
9738 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
9740 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
9742 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
9744 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
9746 * intl/: Updated to GNU gettext 0.10.35.
9748 * doc/m4.texinfo (Format): Documented that format is blind.
9750 * src/builtin.c (builtin_tab): Builtin format marked as blind.
9752 1998-10-07 René Seindal <rene@seindal.dk>
9756 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
9757 .test, as the files are no longer just m4 input.
9759 * tests/get-them (FILE): Changed .m4 extension to .test.
9761 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
9762 Otherwise quoted strings with leading whitespace first in a macro
9763 argument would be eliminated.
9765 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
9766 (expand_argument): Do.
9768 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
9769 grouped together iff both quote and comment strings are single
9770 character. Otherwise they might include a comment/quote leader.
9771 (next_token): Returns new token type TOKEN_SPACE.
9773 * src/builtin.c (push_builtin_table): New function to push a
9774 builtin_table on the stack without installing its contents.
9775 (find_builtin_by_name): Added call to push_builtin_table() if
9776 reading frozen files. Otherwise the builtins named in the frozen
9777 files could not be found.
9778 (install_builtin_table): Changed to use push_builtin_table()
9780 1998-10-04 René Seindal <rene@seindal.dk>
9782 * po/pl.po: Polish translation added.
9784 * po/POTFILES.in: src/module.c added.
9786 1998-10-04 René Seindal <rene@seindal.dk>
9790 * configure.in (ALL_LINGUAS): Added Polish pl.po
9792 1998-10-03 René Seindal <rene@seindal.dk>
9794 * Many files: Incorporated changes to implement dynamic modules.
9795 Detailed comments in src/modules.c and modules/README
9797 * src/module.c: New file, implements the OS dependant parts of
9798 dynamic module loading.
9800 * src/Makefile.am (m4_SOURCES): Added module.c
9802 * src/builtin.h: New file, declares some functions from builtin.c
9803 that are of use for other modules (shipout_int, numeric_arg,
9804 skip_space, bad_argc), and the macros ARG() and DECLARE().
9806 * src/builtin.c (install_builtin_table): New function. Each
9807 module brings in a builtin_table, which is pushed on a stack.
9808 (struct builtin_table): New struct for list of builtin_tables.
9809 (m4_loadmodule): New function to implement builtin "loadmodule".
9810 (shipout_int): No longer static, to be used by modules.
9814 (builtin_init): changed to call install_builtin_table()
9815 (find_builtin_by_name): Now searches all builtin_tables
9816 (find_builtin_by_addr): do.
9818 * src/path.c: Reorganised to allow for two search paths, one for
9819 include files and one for modules.
9821 * src/m4.h: Added declarations for new functions in module.c and
9824 * src/m4.c (main): Added call to module_init().
9826 * modules: New directory with a few demo modules.
9828 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
9831 * configure.in: Added modules/Makefile to AC_OUTPUT.
9833 * configure.in: Added code to implement --with-modules. Tests for
9836 * acconfig.h: Added WITH_MODULES
9838 1998-10-02 René Seindal <rene@seindal.dk>
9840 * examples/Makefile.am (pkgdata_DATA): Removed special target for
9841 check and variables TESTS. These tests are now run from the
9844 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
9845 directory. The files stay there but the tests are run from the
9848 * tests/Makefile.am (EXTRA_DIST): Added run-test.
9850 * tests/run-test: New file. Run a test manually
9852 * tests/Makefile.am, tests/get_them: Moved automatically generated
9853 tests (from the manual) to sub directory tests/gentest/. The
9854 tests/ directory had gotten a bit messy.
9856 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9858 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
9859 wrap}.test: Added a few testcases.
9861 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9865 * lib/Makefile.am (noinst_HEADERS): regex.h added
9867 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
9868 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
9870 * acm4/Makefile.am: created providing rules to create
9871 $(top_srcdir)/acinclude.m4 to be used by aclocal.
9873 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
9874 `C'. Reported by Ulrich Drepper.
9876 * Makefile.am (SUBDIRS): Removed checks directory
9877 * configure.in (AC_OUTPUT): Removed checks/Makefile
9879 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
9880 the space when m4.texinfo is edited and whitespace.el is active.
9881 (Defn,example): idem.
9883 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9885 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
9886 ../COPYING. ../Makefile is a file which is certainly present when
9887 test is executed in testSubDir. One can't be sure that the COPYING
9888 file is in .. or ../.. in all situations, the ../Makefile is
9891 * doc/m4.texinfo (Include): adjusted expected test output
9892 according to new tests, i.e. the input will always come from the
9893 file `in' created by the test.
9895 * tests/Makefile.am: Added three lines at the top to get
9896 esyscmd.1.test working.
9898 * tests/get-them: modified to generate clearer tests who will need
9899 less maintenance when new test examples are created in
9900 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
9901 need the generic file `defs') shell scripts creating `in', `ok',
9902 `out' and when apropriate `okerr' and `err' in the directory
9903 `testSubDir' when executed. The compare of `ok' and `out'
9904 (and of `okerr' and `err') will be the exit status of the test.
9905 `out' must match `ok' (and `okerr' must match `err') for the test
9908 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
9909 the tests generated by tests/get-them getting it input normally
9910 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
9911 (dot) before the numeric part) is reserved for all other (hand
9912 written) tests. The `+' means one or more times.
9914 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9916 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
9917 supported short man page to refer to info documentation
9918 * helptoman.pl: added
9919 * configure.in: AC_PATH_PROG(PERL,perl)
9920 * Makefile.am (SUBDIRS): doc after src
9922 * libitized with libit 0.5 from
9923 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
9925 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
9926 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
9927 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
9928 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
9930 * configure.in (AC_CHECK_FUNC): getopt_long
9932 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
9934 * TODO: added entry about dependencies
9936 1998-08-10 René Seindal <rene@seindal.dk>
9940 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
9943 * src/builtin.c (m4_changesyntax): Added builtin macro
9944 "changesyntax" to modify the syntax table.
9946 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
9947 table. All categories are assigned a syntax code and tokens are
9948 read according to this table.
9950 1998-08-09 René Seindal <rene@seindal.dk>
9952 * src/numb.{c,h}: New files, implements multiple precision eval
9953 using GNU gmp. Originally submitted by John Gerard Makecki
9954 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
9956 * doc/m4.texinfo (Eval): Added documentation for multiple
9957 precision arithmetic library support.
9959 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
9960 to accommodate multiple precision eval.
9962 1998-08-07 René Seindal <rene@seindal.dk>
9964 * src/input.c (MATCH, match_input), src/m4.h: changed definition
9965 of comment and quote strings to `unsigned int' to allow eight bit
9966 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
9968 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
9969 patch from Mike Howard <mike@clove.com>
9971 1998-08-06 René Seindal <rene@seindal.dk>
9973 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
9976 1998-08-03 René Seindal <rene@seindal.dk>
9980 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
9981 and _ macro. M4 now builds with --disable-nls.
9983 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
9984 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
9986 * configure.in (ALL_LINGUAS): Added complete list of translations:
9987 de fr it ja nl ru sv.
9989 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
9991 * po/nl.po: Dutch translation by Erick Branderhorst.
9993 * po/fr.po: French translation by Erick Branderhorst, based on the
9994 translations by François Pinard in fr.msg and m4.cod.
9996 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10000 * src/m4.c: #include <signal.h> not <sys/signal.h>.
10002 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10004 * checks/Makefile.am: explicit list tests in CHECKS.
10006 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10007 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10008 mkinstalldirs, install-sh: Added automake (1.3) support.
10010 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10011 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10012 Used libitize (0.4) to update.
10014 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10015 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10016 README accordingly.
10018 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10019 stack overflow functionality.
10021 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
10023 * Prerelease 1.4.1.
10025 * Makefile.in (realclean-local): Delete stamp-h.in.
10027 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10028 Localize, adapting from how it is done in sharutils.
10030 * fr.tt: New file, for French.
10032 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10033 src/freeze.c: Rename PRODUCT to PACKAGE.
10035 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
10037 * configure.in: Check for <libintl.h> and <locale.h>.
10038 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10039 src/stackovf.c: Rename _ to __P.
10040 * src/m4.h: Declare _ as a macro returning its argument, or else,
10041 include <libintl.h> and declare _ as gettext.
10042 * src/m4.c: Possibly include <locale.h> and call setlocale.
10043 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10044 src/input.c, src/macro.c, src/output.c, src/path.c,
10045 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10048 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
10050 * doc/Makefile.in (stamp-vti): Use new -r option to date.
10052 * configure.in: Put --with-gmp in place, in prevision for John
10054 * acconfig.h: Document WITH_GMP.
10056 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
10060 * doc/Makefile.in (realclean): Also remove stamp-vti.
10061 Reported by Eric Backus.
10063 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
10065 * src/freeze.c (produce_frozen_state): If the frozen file cannot
10066 be opened, return immediately after producing the error message.
10067 Reported by Andreas Schwab.
10069 * configure.in: Check for const only after having found possible
10070 ANSIfying compiler flags, this is of no use to check it before.
10071 Reported by Alexander Lehmann.
10073 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
10075 * src/macro.c (collect_arguments): Cast obstack arguments to
10076 (voidstar), so avoiding compiler warnings.
10077 Reported by Joseph E. Sacco.
10079 * src/freeze.c (produce_frozen_state): Cast printed lengths to
10080 (int) so they correspond to %d format items.
10081 Reported by Joseph E. Sacco.
10083 * src/m4.c (main): Cast the argument to xfree to (voidstar).
10084 * src/symtab.c (free_symbol): Idem.
10085 Reported by Karl Vogel.
10087 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
10089 * Makefile.in (DISTFILES): Distribute BACKLOG.
10091 * configure.in: Define PRODUCT and VERSION.
10092 * acconfig.h: Document PRODUCT and VERSION.
10093 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10094 constant string m4 and variable or parameter named version.
10096 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
10098 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10099 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10100 defines __STDC__ to 0, for indicating it is *not* ANSI!
10101 Reported by Kaveh R. Ghazi.
10103 * configure.in: Added obsolescent tests for AIX and Minix.
10105 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10106 which texclean does not exist anymore.
10107 Reported by Eric Backus, Jim Meyering, John David Anglin and
10110 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
10112 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10113 Reported by John David Anglin.
10115 * src/ansi2knr.c: New version, sent by Peter Deutsch.
10116 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10117 ANSI2KNR, depending on the fact the compiler is ANSI or not.
10118 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10119 Remove the sed filter after ansi2knr for debug.c. Use $O instead
10120 of $U, put underline in extensions rather than in basenames. Use
10121 implicit rules, now that regularity makes this possible.
10122 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10123 of ansi2knr whenever it is needed.
10124 * configure.in: Adjusted for correct STACKOVF substitution.
10125 * src/debug.c (trace_format): When not __STDC__, use (...) as a
10126 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10127 Reported by David MacKenzie.
10129 * Makefile.in: Remove binprefix. Use transform_name instead.
10130 Reported by David MacKenzie.
10132 * doc/Makefile.in: Create version.texi, use it, clean it.
10133 Reported by Jim Meyering.
10135 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
10137 * Makefile.in (all, install, uninstall): Depend on Makefile.
10139 * Makefile.in: For actions invoking $(MAKE) from within compound
10140 sh statements, exit non-zero if the sub-make fails. Otherwise,
10141 the top-level make may exit successfully when it should fail.
10142 Reported by Jim Kingdon.
10144 * {,/*}Makefile.in: Use && after all cd, in case they fail.
10146 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10147 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10148 * configure.in: Substitute PRODUCT and VERSION.
10150 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10152 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
10154 * Makefile.in (mostlyclean-local): Do not remove *~.
10155 * */Makefile.in (mostlyclean): Idem.
10156 Reported by Robert E. Brown and Richard Stallman.
10158 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
10160 * src/m4.h: Get rid of CONFIG_BROKETS.
10162 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
10164 * configure.in: Use AC_ARG_PROGRAM.
10165 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10166 Reported by David MacKenzie.
10168 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
10170 * configure.in: Do not add -O to CFLAGS for GNU C, now that
10171 configure does it automatically.
10172 Reported by Jim Meyering.
10174 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
10176 * src/stackovf.c: Declare the handler_t typedef earlier in the
10177 code, use it for stackovf_handler.
10178 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10179 casting sigsegv_handler.
10180 Reported by Robert Bernstein.
10182 * src/m4.c (main): Initialize program_name to argv[0] without
10184 Reported by Karl Berry.
10186 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
10188 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10189 Reported by Karl Berry.
10191 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
10193 * lib/Makefile.in (mostlyclean): Added.
10194 (TAGS): Make in $(srcdir).
10196 * configure.in: Use `choke me' in test, like everywhere!
10198 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10199 unreacheable and useless.
10201 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10203 * lib/Makefile.in (DISTFILES): Distribute TAGS.
10204 (distclean): Do not remove TAGS.
10205 (realclean): Remove it.
10206 * Makefile.in: Make TAGS in lib also, not just in src.
10207 Reported by Karl Berry.
10209 * Makefile.in (distclean, realclean): Instead of recursively
10210 calling $(MAKE) for the -local part, allow parallel execution of
10211 -recursive and -local, only delay the removal of config.status,
10212 which is repeated in both goals.
10214 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
10218 * Makefile.in: Group all *clean-recursive goals in one, using sed
10219 to remove `-recursive' while calling make recursively. Also, use
10220 a subshell for each recursive $(MAKE).
10221 Reported by Jim Meyering.
10223 * src/m4.h (memcpy): Define with bcopy for BSD systems.
10224 Reported by Kaveh R. Ghazi.
10226 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10227 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10230 * configure.in: Use date instead of touch for stamp-h.
10231 * Makefile.in (stamp-h.in): Idem.
10233 * Makefile.in (distclean, realclean): Force serial execution of
10234 both goals, in case parallel makes are being used.
10235 Reported by Jim Meyering.
10237 * src/Makefile.in (DISTFILES): Distribute TAGS.
10238 (distclean): Do not remove TAGS.
10239 (realclean): Remove it.
10240 Reported by Karl Berry.
10242 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
10244 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
10245 to old names, for following Autoconf.
10247 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
10249 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10250 ./install.sh will not be correctly referred to in sub-Makefiles.
10251 Reported by John David Anglin.
10253 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10254 Reported by Eric Backus.
10256 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10257 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10258 config.status into remaking this directory's Makefile only.
10259 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10260 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10261 Reported by Jim Meyering.
10263 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
10265 * configure.in: Correct stack overflow detection logic, taking
10266 care of systems having only incomplete implementations (like for
10267 Pyramid 9820 OSx 5.0d).
10268 Reported by Kaveh R. Ghazi.
10270 * src/Makefile.in (TAGS): Remote -t from etags call.
10272 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
10274 * lib/Makefile.in (install): Depend on all.
10276 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
10278 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
10279 Reported by Jim Meyering and John David Anglin.
10281 * Makefile.in (distclean-local): Delete config.log.
10282 Reported by Jim Meyering.
10284 Solidify frozen files with respect to -P:
10285 * src/m4.c: Have -P set prefix_all_buitins variable instead of
10286 calling a function by that name. Declare the variable.
10287 * src/m4.h: Adjust declaration for prefix_all_buitins.
10288 * src/builtin.c (builtin_init): Merge in functionality from
10289 previous prefix_all_buitins function, while making entries in the
10290 symbol table, but not modifying the builtin description itself.
10292 * src/freeze.c (reload_frozen_state): Add a useless `break;',
10293 because *many* compilers do not accept an empty `default:'.
10294 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
10295 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
10297 * configure.in: Use AC_TYPE_SIGNAL.
10298 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
10299 Reported by Robert Bernstein.
10301 * checks/Makefile.in (check): Modify PATH so check-them will find
10302 m4 in the src directory.
10303 * Makefile.in (check): Don't.
10304 Reported by Akiko Matsushita and Jim Meyering.
10306 * src/output.c (make_room_for, output_character_helper): New
10307 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
10308 a per buffer MAXIMUM_BUFFER_SIZE.
10310 * src/output.c (output_text): New function, for optimizing the
10311 output of strings of characters. Use it.
10313 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
10315 * doc, src: New directories reorganizing the distribution.
10316 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
10318 * Makefile.in: Adjusted.
10319 * configure.in: Configure new Makefiles.
10321 * m4.h: Declare STRING typedef. Use it for comment and quote
10322 strings, adjusting all references. (This is the rudiments of a
10323 beginning for the eventual withdrawal of NUL terminated strings.)
10324 * output.c (shipout_text): Accept a length parameter, and use it.
10325 All callers adjusted.
10327 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
10329 * m4.h: Include <unistd.h> if it exists.
10330 * stackovf.c: Don't.
10332 Clean up for current_diversion variable:
10333 * output.c: Move current_diversion from builtin.c.
10334 * m4.h: Declare current_diversion so builtin.c can access it.
10335 * output.c (output_init, make_diversion): Initialize or update
10337 * builtin.c (builtin_init, m4_divert): Leave current_diversion
10340 Remove limit on number of diversions:
10341 * output.c: Replace ndiversion by diversions, declare it.
10342 (output_init): Allocate only diversion 0.
10343 (make_diversion): Allocate new diversions as needed.
10344 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
10345 * m4.c: Still accept -N, but do nothing with it.
10346 Reported by David MacKenzie.
10349 * output.c (freeze_diversions): New function.
10350 * m4.h: Declare freeze_diversions.
10351 * freeze.c: Document frozen file format, revise it, call
10352 freeze_diversions to add diversions to frozen format, and code to
10353 reload them properly.
10354 * m4.c: Do not undivert automatically at end when status being
10355 frozen. Do not call builtin_init when reloading frozen state.
10357 Speed up diversion processing:
10358 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
10359 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
10360 structure and variables, cached variables out of output_diversion,
10361 reallocate_diversion_for and OUTPUT_CHARACTER.
10362 (shipout_text, make_diversion, insert_diversion): Adapted to new
10364 (insert_file): Use better buffering.
10365 Reported by David MacKenzie.
10367 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
10369 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
10370 dist works from another build directory.
10372 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
10374 * symtab.c (hack_all_symbols): Use hash_table_size instead of
10375 constant HASHMAX, for -H option to work better.
10377 * builtin.c (DECLARE): Simplify by using _ ().
10379 * freeze.c: New file.
10380 * Makefile.in: Compile it, distribute it.
10381 * m4.c: Recognize, document and process --freeze-state (-F) and
10382 --reload-state (-R) options. Pass a true flag to builtin_init
10383 only if no reloading some state.
10384 * builtin.c (define_builtin): Remove static specifier.
10385 (find_builtin_by_name): Remove static specifier.
10386 (builtin_init): Accept and obey a flag argument.
10387 * m4.h: Add declarations for freeze.c, changes for builtin.c.
10389 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
10391 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
10394 * configure.in: Implement --with-dmalloc.
10395 * acconfig.h: Document WITH_DMALLOC.
10396 * m4.h: Add code for when WITH_DMALLOC.
10398 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
10400 * m4.c (long_options): Use "error-output", the dash was missing.
10401 Reported by Akiko Matsushita.
10403 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
10405 * m4.h: Include <sys/types.h>.
10406 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
10407 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
10409 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
10410 as size_t, not int.
10411 * builtin.c (dump_args): Declare len as size_t, not int.
10413 * debug.c: Prototype the forward declaration of debug_set_file.
10415 * builtin.c (m4_undivert): Replace div by file, for avoiding the
10416 shadowing of this variable.
10417 * output.c (insert_diversion): Idem.
10419 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
10420 (input_init): Duplicate default quote and comment strings.
10421 (set_quotes): Free previous quote strings in all cases. Duplicate
10422 even default quote strings.
10423 (set_comment): Free previous comment strings in all cases.
10424 Duplicate even default comment strings.
10426 * configure.in: Updated for Autoconf 2.0.
10427 * Makefile.in (distclean-local): Also delete config.cache.
10429 * m4.c (usage): Reorganize the --help output by topic. Include a
10430 description for debugging flags.
10432 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
10434 * configure.in: If sigaction is available and SA_ONSTACK defined,
10435 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
10436 defined, use sigvec. Else don't compile stackovf.c.
10437 * stackovf.c (setup_stackovf_trap): Idem.
10438 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
10441 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
10443 * m4.c (usage): Replace printf par fputs.
10445 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
10449 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
10451 * configure.in: Check for sigaction and sigvec. Add a new delayed
10452 check for RLIMIT_STACK, combine in the checking for getrlimit.
10453 All those things are not universally available.
10454 * stackovf.c: Split setting up the trap handler and catching
10455 signals, for better taking care of various configure outcomes.
10456 * examples/stackovf.sh: Correct a typo.
10457 Reported by Eric Backus, Jim Avera and Jim Meyering.
10459 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
10461 * ansi2knr.c: New version sent by its author, Peter Deutsch.
10463 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
10465 * Makefile.in: Modify so parallel make will not try making
10466 lib/libm4.a twice simultaneously.
10467 Reported by Jim Meyering.
10469 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
10471 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
10472 error message, for when no code possibility exists. Even if this
10473 line is completely #ifdef'ed out, it brings a syntax error.
10474 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
10476 * Makefile.in (install): Have install depend on all too, for lib
10477 to be remade as needed.
10479 * examples/stackovf.sh: Try ksh, bsh and bash for shells
10480 providing ulimit, instead of using only ksh.
10481 Reported by Jim Avera and Joseph E. Sacco.
10483 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
10485 * Makefile.in (check): Have it depend on all instead of m4. In
10486 this way, a change in lib will be detected and processed.
10488 * builtin.c (numeric_arg): Use strtol and verify the conversion,
10489 instead of using sscanf which stops as soon as there is a
10490 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
10491 and divert(1xyzzy) were all accepted without any warning or error
10493 * m4.h: Declare strtol as long if not including stdlib.h.
10494 * configure.in: Check for limits.h, and replace strtol if missing.
10495 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
10496 * lib/strtol.c: New file, from elsewhere.
10497 Reported by Andreas Schwab.
10499 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
10501 * macro.c (expand_macro): Cast value to (boolean) prior to
10502 assigning it to traced.
10503 Reported by Tom McConnell.
10505 * Makefile.in (m4): Always make all in lib first.
10506 Reported by Jim Meyering.
10508 1994-07-06 Jim Avera <jima@netcom.com>
10510 * stackovf.c: Isolated OS-dependent sections; Improved portability,
10511 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
10512 handlers), and a default error message if the fault address is not
10513 available (when neither siginfo.h nor BSD sigcontext are supported).
10514 * configure.in: Changes for stackovf.h: Check for sigcontext,
10515 sigaction, sigstack, and define rlim_t as int if necessary.
10516 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
10517 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
10518 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
10520 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
10522 * configure.in: Use AC_SET_MAKE.
10523 * Makefile.in: Use @SET_MAKE@.
10524 Reported by Jim Meyering.
10526 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
10527 Reported by Ian Taylor.
10529 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
10531 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
10532 because siginfo.h is unrelated to standard headers, and siginfo.h
10533 is already checked for.
10534 Reported by Joseph E. Sacco.
10536 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
10538 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
10541 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
10543 * builtin.c (substitute): Use \& to represent this part of the
10544 string which was matched by the whole regexp, instead of
10545 representing the whole string. Any usage of \0 issues a warning
10546 and acts like \&, it will disappear in some subsequent release.
10548 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
10550 * m4.c: Complete prototype for forwarded declaration of usage.
10552 * input.c (init_macro_token): Correct own reference in error
10553 message. Previous name get_macro_func was referred to instead.
10554 (next_char): Correct own reference in error message. Previous
10555 name advance_input was referred to instead.
10557 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10558 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10559 and_term, not_term, logical_not_term, cmp_term, shift_term,
10560 add_term, mult_term, exp_term, unary_term, simple_term): Add
10561 prototype to forwarded declarations. Declare parameter v1 as
10562 eval_t * instead of int *. Same for local variable v2 in dyadic
10563 functions. Same for result in exp_term.
10564 * builtin.c (m4_eval): Declare value as eval_t instead of int.
10565 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
10566 unsigned_eval_t instead of unsigned int. Change casts accordingly.
10567 (shipout_int): Cast first argument of ntoa to eval_t.
10568 Reported by Thorsten Ohl.
10570 * macro.c: Complete the prototypes of forwarded expand_macro and
10572 Reported by Thorsten Ohl.
10574 * m4.h: Define voidstar as void * or char * depending on __STDC__.
10575 The Ultrix 3.1 compiler cannot do much with void pointers.
10577 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10578 * m4.c (xfree): Replace void * by voidstar.
10579 Reported by Tom McConnell.
10581 * ansi2knr.1: New, from elsewhere.
10582 * Makefile.in (DISTFILES): Distribute ansi2knr.1
10584 * Makefile.in (stamp-h.in): Avoid running ./config.status if
10585 stamp-h does not exist yet. This avoids running it a second time
10586 just after the initial ./configure.
10587 Reported by David MacKenzie and Tom McConnell.
10589 * m4.h: Replace the enum debug_info declaration with a series of
10590 #define's. The Ultrix 3.1 compiler would otherwise need casting
10591 (int) to most references, when used in expressions.
10592 Reported by Tom McConnell.
10594 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
10596 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
10597 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
10598 calls the compiler. Previously, FP_PROTOTYPES was only calling
10599 the preprocessor; by not being subject to CFLAGS, this was
10600 discouraging those flags asking for ANSI compilation.
10601 * acconfig.h: Document HAVE_PROTOTYPES.
10602 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
10603 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
10604 Reported by Eric Backus.
10606 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
10607 from the environment. Default CFLAGS to -g if not set.
10608 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
10609 * lib/Makefile.in: Have CFLAGS substituted from configure.
10610 Reported by Eric Backus and Tom McConnell.
10612 * configure.in: m4_undefine changeword before using AC_ENABLE.
10614 * m4.h: Declare prototypes for error (for ANSI compilers only),
10615 prefix_all_builtins and reference_error.
10616 Reported by Tom McConnell.
10618 * input.c (set_word_regexp): Do not try to initialize the array
10619 test from a string, this does not work with non-ANSI compilers.
10620 Reported by Eric Backus.
10622 * Makefile.in (dist): Clean examples/ before saving it.
10623 (distclean-local): Also remove stamp-h.
10624 Reported by Eric Backus.
10626 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
10627 non ANSI compilers.
10628 Reported by Tom McConnell.
10630 * checks/Makefile.in (clean): Depends on mostlyclean.
10631 (mostlyclean): New goal.
10633 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
10635 * Makefile.in (DISTFILES): Distribute install.sh.
10636 * install.sh: New file, copied from elsewhere.
10637 Reported by Assar Westerlund and Kaveh R. Ghazi.
10639 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
10641 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
10642 * acconfig.h: Explain ENABLE_CHANGEWORD.
10644 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
10645 from code provided by Pete Chown]
10646 * m4.h: Add original_text field to u_t variant of union u.
10647 Declare TOKEN_DATA_FUNC macro.
10648 * builtin.c: Declare changeword.
10649 (m4_changeword): New function.
10650 * input.c: Include "regex.h", define variables with word regexps.
10651 (input_init): Initialize the word regexp.
10652 (set_word_regexp): New.
10653 (next_token): Declare local variables, use the previous code if
10654 default_word_regexp is true. Else, match using a new code. Save
10656 * macro.c (expand_token): Ship out original text if not a macro
10658 Reported by Krste Asanovic and Pete Chown.
10660 [These modifs all depend upon ENABLE_CHANGEWORD]
10661 * m4.h: Declare external user_word_regexp.
10662 * m4.c: Declare user_word_regexp, and initialize it from
10663 --word-regexp or -W, or NULL if not specified.
10664 * input.c: Use user_word_regexp if specified, instead of
10665 DEFAULT_WORD_REGEXP.
10667 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
10670 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
10671 * checks/Makefile.in: Empty the suffix list.
10672 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
10674 * m4.c: Declare nesting_limit and initialize it to 250.
10675 Implement -LNUMBER or --nesting-limit=NUMBER to change its
10677 * m4.h: Declare nesting_limit as external.
10678 * macro.c (expand_macro): Stop execution whenever nesting limit
10680 Reported by Bengt Mertensson.
10682 * eval.c (evaluate): Diagnose excess characters in eval input.
10683 Things like `eval(08)' used to return 0 with no diagnostic.
10685 * m4.h: Capitalize first letter of all macro arguments in
10688 * m4.c: Declare warning_status, initialize it to 0. Add new
10689 option -E, or --fatal-warnings, which sets warning_status to
10690 EXIT_FAILURE instead.
10691 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
10692 EXIT_FAILURE if not otherwise done by header files.
10693 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
10694 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
10695 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
10696 argument of all M4ERROR calls.
10697 Reported by Noah Friedman.
10699 * examples/incl-test.m4: Renamed from incl_test.m4.
10700 * examples/include.m4: Include incl-test.m4 instead of
10702 * examples/multiquotes.m4: Renamed from multi-quotes.m.
10704 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
10706 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
10707 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
10708 also tested it on a Sun Sparc workstation running SunOS 4.x.
10710 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
10711 49.format check, abusing a `union values' argument with sprintf
10712 without selecting the proper field. Now, save the formatting type
10713 first, delaying the fetch of the corresponding argument.
10714 Reported by Joseph E. Sacco and Tom Quinn.
10716 * format.c (format): Remove const from char *fmt declaration when
10717 not HAVE_EFGCVT, because a NUL may be forced into it.
10719 * m4.h: Declare atof() when not STDC_HEADERS.
10720 Reported by Joseph E. Sacco.
10722 * Regenerate configure using Autoconf 1.11, this corrects a
10723 problem about an incorrect cpp seting on NeXT 3.1.
10724 Reported by Alexander Lehmann.
10726 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
10728 * m4.h (_): Change argument from `x' to `Args'.
10730 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
10732 * m4.h: Rename Args() to _().
10733 * m4.h: Remove extern specifier from all function declarations.
10735 1994-04-22 Jim Avera <jima@netcom.com>
10737 * stackovf.c: New file implementing stack-overflow detection.
10738 * configure.in: Check for getrlimit, sigaction. If all of
10739 standard headers, getrlimit and sigaction, define USE_STACKOVF and
10740 substitute ${U}stackovf.o for STACKOVF.
10741 * acconfig.h: Declare USE_STACKOVF.
10742 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
10743 * m4.h: Declare setup_stackovf_trap().
10744 * m4.c: Call setup_stackovf_trap().
10745 * tests/stackovf_test.sh: New file.
10747 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
10749 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
10751 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
10753 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
10755 * m4.h: Remove definition of volatile, not used anymore.
10756 Reported by Jim Meyering and Joseph E. Sacco.
10758 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
10759 of `if ... else /* nothing */' for if macros.
10760 Reported by Jim Meyering.
10762 * builtin.c (m4_regexp): Reorganize the code for avoiding a
10763 warning from gcc about `repl' possibly used before defined.
10764 Reported by Jim Meyering.
10766 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
10767 Reported by Jim Meyering.
10769 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
10771 * m4.h: Move the conditional definition of volatile after the
10772 inclusion of system files, because they may define it first.
10774 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
10776 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
10777 get around a problem with Alpha make seeing a syntax error, there.
10778 Reported by Vern Paxson.
10780 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
10782 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
10783 Reported by Richard Stallman.
10785 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
10787 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
10788 instead of AC_HAVE_FUNCS.
10789 Reported by Noah Friedman.
10791 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
10793 * m4.c: Initialize show_help and show_version to zero.
10795 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
10796 Use them in exit() and usage() calls.
10798 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
10800 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
10801 syserr() macro. Delete errref, add reference_error and M4ERROR.
10802 * m4.c: Replace errref, which was returning an input reference
10803 string, with reference_error, which prints it on standard error.
10804 * builtin.c, output.c: Use errno as second parameter to error,
10805 instead of using syserr() with %s.
10806 * *.c: Use M4ERROR instead of error: no more errref() with %s.
10807 Doing so, the program name appears after the input reference
10808 instead of before, which eases M-x next-error processing.
10810 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
10812 * checks/get-them: Escape braces with backslashes in patterns,
10813 because HPUX-9.01 awk needs this.
10814 Reported by Jim Meyering.
10816 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
10818 * builtin.c: Declare "FILE *popen ();".
10820 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
10821 macros, replace error_message_prefix() declaration by errref()'s.
10822 Declare xrealloc, for use in errref().
10823 * m4.c: Delete error_message_prefix() function, add errref().
10824 * *.c: Use error() systematically in place of all error macros,
10825 now that error() flushes stdout first. Make needed adjustments.
10827 * m4.h: Remove const in sys_errlist[] declaration, it creates
10828 conflicts on SGI and Alpha.
10829 Reported by Kaveh R. Ghazi.
10831 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
10833 * m4.c: Include <getopt.h> instead of "getopt.h".
10835 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
10836 * acconfig.h: New, for documenting HAVE_EFGCVT.
10837 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
10838 use them wherever appropriate. Also use -I. for compilations.
10839 * lib/Makefile.in: Use -I.. for compilations.
10840 * *.c: Include <config.h> or "config.h".
10842 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
10843 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
10845 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
10847 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
10849 * input.c (input_init): Initialize quote and comment strings
10850 explicitely instead of calling set_quotes and set_comment: by
10851 doing so, we ensure we do not free uninitialized variables.
10853 * checks/check-them: Reverse arguments to both diff, so the
10854 expected is on the left and the obtained on the right.
10856 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
10857 macros. Delete declarations for m4error, warning, fatal and
10858 internal_error, add declaration for error_message_prefix.
10859 * m4.c: Delete m4error, warning, fatal and internal_error
10860 routines, add error_message_prefix routine.
10861 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
10862 warning with WARNING*, fatal with FATAL* and internal_error with
10864 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
10865 this is not needed anymore.
10867 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
10868 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
10869 and debug_message, add declaration for debug_message_prefix.
10870 * debug.c: Remove static specifier for FILE *debug declaration.
10871 Delete debug_print and debug_message routines, add
10872 debug_message_prefix routine.
10873 * builtin.c, debug.c: Replace debug_print routine calls with
10874 DEBUG_PRINT* macro calls.
10875 * input.c, path.c: Replace debug_message routine calls with
10876 DEBUG_MESSAGE* macro calls.
10878 * m4.h: Remove inclusion of <varargs.h>.
10879 * debug.c: Include <stdarg.h> or <varargs.h>.
10880 (trace_format): Use stdarg instead of varargs if __STDC__.
10882 * configure.in: Remove checks for vfprintf and _doprnt. These
10883 implementations use varargs tricks which are not portable enough.
10884 * lib/vfprintf.c: Deleted.
10885 * lib/_doprnt.c: Deleted.
10886 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
10887 Reported by Joel Sherrill.
10889 * path.c (add_include_directory): Use xstrdup.
10891 * builtin.c (find_builtin_by_name): Declare static.
10893 * *.[ch]: Add const to a few "char *" declarations.
10895 * configure.in: Remove commented tests for fileno() and fstat().
10896 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
10898 * debug.c (debug_flush_files): New.
10899 * m4.h: Declares it.
10900 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
10901 Reported by Nicolas Pioch.
10903 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
10905 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
10906 Reported by Joel Sherrill.
10908 * builtin.c (prefix_all_builtins): Instead of the table size, use
10909 the null entry at end for stopping the loop. It was overwritten.
10910 Reported by Andreas Schwab and Jim Meyering.
10912 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
10913 Reported by Kaveh R. Ghazi.
10915 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
10916 Reported by Karl Vogel.
10918 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
10920 * m4.h: Do not define volatile if already defined.
10921 Reported by René Seindal.
10923 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
10925 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
10926 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
10928 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
10930 * m4.h: Define strchr and strrchr in terms of index and rindex,
10931 instead of the other way around.
10932 * builtin.c, m4.c, path.c: Use strchr instead of index.
10934 * input.c (next_char): Remove a "break;" after a "return ...;".
10935 Reported by Tom McConnell.
10937 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
10941 * configure.in: Do not copy check files in the build hierarchy.
10942 * checks/check-them: Identify the m4 version being checked. For
10943 finding m4, look in $PATH instead of in the parent directory.
10944 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
10945 * checks/Makefile.in (.all-stamp): Always create check files in
10946 the source hierarchy, not anymore in the build hierarchy.
10947 (check): cd to the source hierarchy before performing checks.
10948 Do not copy nor clean COPYING anymore, take it from `..'.
10949 Reported by Tom McConnell.
10951 * Makefile.in (Makefile): Use $(SHELL).
10952 (config.status): Use $(SHELL). Use "config.status --recheck"
10953 instead of "configure --no-create", which is obsolete.
10954 Reported by Tom McConnell.
10956 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
10958 * m4.c (usage): Use "%s" instead of "m4" in format string.
10959 Reported by Jim Meyering.
10961 * Makefile.in: Distribute mkinstalldirs.
10962 Reported by Pierre Gaumond.
10963 Reported by Jim Meyering.
10964 Reported by Tom McConnell.
10965 Reported by Andreas Gustafsson.
10967 * checks/check-them: Renamed from checks/check_them.
10968 * checks/get-them: Renamed from checks/get_them.
10969 * checks/.all-stamp: Renamed from checks/.all_stamp.
10970 * checks/Makefile.in: Changed accordingly.
10971 Reported by Jim Meyering.
10973 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
10975 * lib/Makefile.in (dist): Correct permissions on files.
10977 * output.c: Declare tmpfile, some systems don't.
10979 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
10981 * checks/Makefile.in (dist): Correct permissions on files.
10983 * Makefile.in (dist): Ensure recursive linking for subdirectory
10984 `examples', also set read/write permissions on all its files.
10986 * mkinstalldirs: New, from elsewhere.
10987 * Makefile.in: Use it.
10989 * debug.c: Synchronize debug messages and regular output when
10990 the debug file and stdout are redirected to the same file.
10991 * configure.in: Add (commented) checks for fileno and fstat.
10992 Reported by Jim Avera.
10994 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
10995 etc., arguments, then ignore the superfluous one. m4 used to
10996 diagnose missing arguments and return the empty string.
10997 Reported by Nick S. Kanakakorn.
10999 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
11001 * m4.c (main): At end of all input, ensure all undiverted text
11002 goes to the main output stream.
11003 Reported by Andreas Gustafsson.
11005 * m4.c (main): exit (0), instead of return 0.
11007 * m4.c: Implement -P and --prefix-builtins.
11008 * builtin.c: Delete const specifier on builtin_tab.
11009 (prefix_all_builtins): New.
11010 Reported by Noah Friedman.
11011 Reported by Scott Bartram.
11013 * c-boxes.el: New, from elsewhere.
11014 * Makefile.in: Distribute it.
11016 * m4.h: Do not define bcopy if <string.h> defines it.
11017 Reported by Stephen Perkins.
11019 * builtin.c (define_macro): Allow a missing second argument, in
11020 which case it is implied empty. Affects define and pushdef.
11021 Reported by Eric Allman.
11023 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
11025 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11026 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11027 * builtin.c: Initialize all the blindness fields in builtin_tab.
11028 (define_builtin): Copy the blindness of a builtin into its symbol.
11029 * macro.c (expand_token): Avoid processing a blind builtin if the
11030 next character is not an opening parenthesis.
11031 Reported by David MacKenzie.
11032 Reported by Noah Friedman.
11034 * configure.in: Ensure an exit status of 0 on completion.
11035 Reported by Vivek P. Singhal.
11037 * eval.c (eval_lex): Admit both lower and upper case letters for
11038 bases greater than 10. Only lower case letters were accepted.
11040 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11041 Reported by Krste Asanovic.
11043 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
11044 * eval.c (logical_not_term): New name for not_term.
11045 * eval.c (xor_term): New, between or_term and and_term.
11046 * eval.c (not_term): New, between and_term and logical_not_term.
11047 * eval.c (shift_term): New, between cmp_term and add_term.
11048 Reported by Krste Asanovic: ~, ^, <<, >>.
11049 Reported by Ben A. Mesander: ** vs ^.
11051 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11052 * m4.h: Delete xrealloc.c.
11053 * lib/xmalloc.c: New, from elsewhere.
11054 * lib/xstrdup.c: New, from elsewhere.
11055 * lib/Makefile.in: Distribute and compile them.
11057 * m4.c: Change progname to program_name.
11058 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11059 * lib/error.c: New, from elsewhere.
11060 * lib/Makefile.in: Distribute and compile error.c.
11061 * configure.in: Check AC_VPRINTF and for strerror.
11062 * m4.c: Delete cmd_error. Use error instead.
11063 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11065 * m4.h: Delete #define const, let Autoconf takes care of this.
11067 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11068 Merge parse_args into main. Declare argv to be `char *const *',
11069 then remove superfluous casts.
11071 * m4.c: Rename --no-gnu-extensions to --traditional.
11072 Reported by Ben A. Mesander.
11074 * m4.c (usage): Add a status parameter. Supply one in various
11075 calls. Add --help processing. Remove -V for --version.
11077 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11079 * lib/Makefile.in: Have an AR=ar declaration.
11080 Reported by Eric Backus.
11081 Reported by Bjorn R. Bjornsson.
11082 Reported by Tom Tromey.
11083 Reported by Kristine Lund.
11084 Reported by Marion Hakanson.
11086 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
11088 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11089 Reported by Noah Friedman.
11091 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
11093 * Makefile.in: Remove MDEFINES and cleanup.
11095 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
11097 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11098 Create a gzip file.
11100 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
11102 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11103 ensure 777 mode for directories, so older tar's will restore file
11106 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
11108 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11109 so the installer can override automatically configured choices.
11110 Reported by Karl Berry.
11112 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
11114 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
11115 previous version was not working properly on m68k-hp-bsd4.3.
11116 Reported by Roland McGrath.
11118 * lib/_doprnt.c: Stolen from Oleo distribution.
11119 * configure.in: Check for _doprnt.c if vfprintf.c selected.
11120 * lib/Makefile.in: Distribute _doprnt.c.
11121 Do not distribute regex.[ch].old anymore.
11123 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
11125 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11126 Richard wants it there.
11128 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
11130 * Makefile.in: Add DEFS to MDEFINES.
11131 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11132 (libm4.a): Remove the library before creating it.
11133 (distclean): Remove tags and TAGS too.
11135 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
11137 * Makefile.in (dvi, m4.dvi): New goals.
11139 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11140 macro.c, output.c, path.c, symtab.c: Change Copyright from
11141 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11143 * examples/divert.m4: Deleted, this bug has been corrected.
11145 * Makefile.in (texclean, mostlyclean): New goals.
11147 * Makefile.in (clean): Remove clutter from ansi2knr.
11148 Reported by Pierre Gaumond.
11150 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
11152 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
11153 might well use CFLAGS is s/he needs it.
11155 * Makefile.in: Allow installation of info files from a separate
11157 Reported by Jason Merrill.
11158 Reported by David MacKenzie.
11159 Reported by Skip Montanaro.
11160 Reported by Erez Zadok.
11161 Reported by Assar Westerlund.
11163 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
11166 This is still a beta release for the future GNU m4 version 1.1.
11168 * lib/alloca.c: New, from elsewhere.
11169 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
11171 * m4.h: Do not define index/rindex if already defined. If
11172 FALSE/TRUE are already defined, do not redefine them, but merely
11173 define boolean typedef to int.
11175 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11176 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11177 because some C compilers do not like connectives with #ifdef.
11178 * m4.h: Define `volatile' only if __GNUC__, instead of once for
11179 __GNUC__ and once for __STDC__.
11180 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11182 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11183 Makefile dependencies. Without it, make keeps destroying and
11184 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
11186 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11187 to diversion/DIVERSION, this was a spelling error.
11189 * m4.c: Declare version[], remove #include "version.h".
11190 * version.h: Deleted.
11191 * Makefile.in: Remove references to version.h.
11193 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11194 production, by using a simpler and more robust algorithm. This
11195 solves the problem of synclines sometimes written in the middle of
11196 an output line. Delete sync_line() and output_lines variable.
11197 * m4.h: Remove sync_line prototype and output_lines declaration.
11198 * input.c (next_char), output.c (shipout_text): Remove references
11200 * input.c (push_file, pop_file): Merely put the value -1 in
11201 output_current_line instead of calling sync_line, for delaying a
11202 single `#line NUM FILE' before next output line. Do not test
11203 for sync_output, because this is unnecessary clutter.
11204 * output.c (make_divertion, insert_divertion): Idem.
11205 * input.c: Rename must_advance_line to start_of_input_line, for
11208 * debug.c (trace_header): Select a new debug line format, which
11209 better complies with GNU standards for formatting error messages.
11210 With option `-dfl', M-x next-error might be used on the output.
11211 * m4.c (vmesg): Adjust format of error output to GNU standards.
11212 * m4.texinfo: Adjust examples for `make check' to work.
11214 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11215 case for enum debug_info constants, which were all lower case.
11217 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11219 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11220 collected patches. I tried a few times using newer regex.[ch], it
11221 mysteriously stopped aborting with this one. Insecure feeling...
11222 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11224 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
11226 * m4.c: Change `--no-warnings' to `--silent'.
11227 Reported by David MacKenzie.
11229 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11230 leave it off for now. See comment in m4.c for justification.
11231 Reported by David MacKenzie.
11233 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11234 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11236 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
11238 * Makefile.in: Ensure recursive cleaning is done before local
11239 cleaning for all clean goals.
11241 * builtin.c (ntoa): Ensure the value is always interpreted as a
11242 signed quantity, whatever the radix is.
11244 1992-11-18 Jim Meyering <meyering@idefix>
11246 * builtin.c, format.c, input.c: Split long lines.
11247 * m4.c: Use typedef macro_definition instead of struct
11249 * symtab.c: Use typedef symbol instead of struct symbol.
11251 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
11253 * *.[ch]: Remove all trailing whitespace, in code and comments.
11255 * configure.in: Find some awk.
11256 * Makefile.in: Add $(AWK) to MDEFINES.
11257 * checks/Makefile.in: Transmit $(AWK) to get_them.
11258 * checks/get_them: Use $AWK instead of gawk. Add a close in the
11259 awk script when switching files, because without this, mawk runs
11260 out of file descriptors.
11262 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
11264 * Makefile.in (realclean): Delete m4.info*.
11265 Reported by Jim Meyering.
11267 * Makefile.in: Adjust and link with checks/Makefile.
11268 * checks/Makefile.in: New.
11269 * configure.in: Output checks/Makefile.
11271 * checks/get_them: Have the dnl header of each test more
11272 recognizable by next-error, also use a better message.
11274 1992-11-16 Jim Meyering <meyering@idefix>
11276 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
11277 And use that only if __GNUC__ since we're using it's GCC-specific
11278 semantics that tell the compiler the associated function doesn't
11281 * builtin.c (substitute): Don't use character as an array index.
11282 (dumpdef_cmp): Make formal arguments `const void *' to avoid
11283 warnings with gcc -W -Wall on systems with qsort prototype.
11284 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
11287 * eval.c (most functions): Add parentheses to assignments used
11288 as truth values go avoid warnings from gcc -Wall.
11290 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
11291 any functions that don't need external scope.
11293 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
11294 (many functions and arrays): Declare `const'.
11296 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
11298 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
11299 removing the declaration from m4.h. Also rename false to FALSE
11302 * lib/Makefile.in (Makefile): New goal.
11304 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
11305 so heavily loaded. It gets more easily overridable, calling make.
11306 Reported by Jim Meyering.
11308 * Makefile.in (dist): Get .fname from the current directory name,
11309 instead of from version.h. I need updating many files manually,
11310 when the version changes, version.h is just one of them.
11312 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
11314 * m4.h: Remove the tag `boolean' on the enum introducing typedef
11315 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
11316 Reported by Tom McConnell.
11318 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
11320 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
11321 39.cleardiv, which were describing missing or spurious newlines.
11322 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
11323 do not depend on machine word size, `/bin/false' implementation,
11324 or `wc' output format. `make check' is more dependable, now.
11326 * checks/check_them: Summarize the failed tests by listing their
11327 name, at end. If none, issue `All checks successful'. Output
11328 `Checking' instead of `Input file:'.
11330 * checks/get_them, checks/check_them: Reindented.
11332 * Makefile.in (dist): chmod a+r before making the tar file.
11334 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
11336 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
11338 * input.c (next_token): Reinitialize token_buttom just after using
11339 it as a watermark with obstack_free. Or else, a future token, big
11340 enough for triggering reallocation of the obstack chunk, could
11341 void the initialized value of token_buttom, later causing panic in
11342 obstack_free. Rename token_buttom to token_bottom everywhere.
11344 * m4.h: Before declaring errno, first include <errno.h> and
11345 ensure that it does not define errno.
11346 Reported by Richard Stallman.
11348 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
11350 * builtin.c: Define and use DECLARE macro for builtins.
11352 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
11353 argument, this is a common idiom for introducing long comments.
11355 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
11356 arguments. The last argument was silently ignored.
11358 * m4.c (cmd_error): Add a missing semicolon before va_end().
11360 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
11362 * Makefile.in: Now handle protoized sources. Define and use U.
11363 Compile and use ansi2knr with old compilers. Update DISTFILES.
11364 Add `aclocal.m4' to `configure' dependencies.
11365 * ansi2knr.c: New, from Ghostscript distribution.
11366 * configure.in: Define U through FP_PROTOTYPES for old compilers.
11367 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
11368 * aclocal.m4: New, provide FP_PROTOTYPES.
11369 * m4.h: Conditionnaly protoized through Args, save for varags.
11370 * builtin.c: Protoized. Then:
11371 Include <sys/types.h> if size_t is not defined, before "regex.h".
11372 (m4_ifelse): Fetch built-in name properly for diagnostic.
11373 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
11374 (m4_regexp): Add const to `msg' declaration.
11375 (m4_patsubst): Add const to `msg' declaration.
11376 * debug.c: Protoized, save for varargs.
11377 * eval.c: Protoized.
11378 * format.c: Protoized.
11379 * input.c: Protoized.
11380 * m4.c: Protoized, save for varargs. Then:
11381 (xfree): Accept void * instead of char *.
11382 (xmalloc): Return void * instead of char *.
11383 (xrealloc): Accept and return void * instead of char *.
11384 * macro.c: Protoized.
11385 * output.c: Protoized.
11386 * path.c: Protoized. Then cast some (char *) over xmalloc's.
11387 * symtab.c: Protoized.
11389 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
11391 * m4.texinfo: Remove directory from diagnostics in 30.include,
11392 51.eval, 56.errprint and 57.m4exit tests.
11394 * m4.h: Remove declarations for int or void system functions, they
11395 cause more conflicting trouble than they make good.
11397 * configure.in: Avoid configuration header file. Add some tests.
11398 * m4.h: Remove #include "config.h".
11399 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
11400 Then, rewritten for better compliance with GNU standards.
11402 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
11404 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
11405 because of a misplaced #endif.
11407 * Many *.[hc] files: Correct intra-line spacing here and there,
11408 according to GNU indent 1.6 advice.
11410 * configure.in: New, using Autoconf 1.2.
11411 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
11412 * Delete old configure.in, configure, etc/configure.in,
11413 etc/configure, lib/configure.in, lib/configure and config/*.
11414 Reported by Jason Merrill.
11416 * symtab.c (hash): Change (char) NULL to '\0'.
11417 Reported by Jason Merrill.
11419 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
11420 etc/nextvers.sh. Release numbers will be edited `by hand'.
11421 * version.h: De-automatize, force value in.
11423 * m4.c: Changes in order to use a newer getopt.h.
11424 Reported by David MacKenzie.
11426 * checks/: New name for examples/.
11427 * checks/get_them: New location for etc/get_examples.
11428 * checks/check_them: New location for etc/check_examples.
11429 * Makefile.in, checks/get_them, checks/check_them: Adjust.
11430 * lib/vfprintf.c: New location for etc/vfprintf.c.
11431 * Delete empty etc/.
11432 * examples/: New name for test/.
11434 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
11436 * Makefile.in (check): Add m4 as dependency.
11438 * m4.c: Accept --no-warnings instead of --no_warnings, and
11439 --no-gnu-extensions instead of --no_gnu_extensions. Make the
11440 usage message more informative.
11441 Reported by David MacKenzie.
11443 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
11445 * etc/check_examples: New name for check_examples.sh.
11446 * etc/get_examples: New name for get_examples.sh.
11447 * Makefile.in, etc/Makefile.in: Use new names.
11449 * Makefile.in: Transmit $(CC) while making in lib.
11451 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
11452 code disposition by hand.
11454 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
11456 * m4.h: Delete definitions for abort() and exit().
11457 Reported by Richard Stallman.
11459 * config/hmake-unicos, config/s-unicos.h: New files.
11460 Reported by Hal Peterson.
11462 * eval.c (exp_term): Have N^0 return 1.
11463 Reported by Michael Fetterman.
11465 * eval.c, input.c, m4.h: Remove last comma in enums.
11466 Reported by Mike Lijewski.
11468 * Transfer of maintenance duties from René to François.
11470 1991-10-24 René Seindal <seindal@diku.dk>
11472 * Release 1.0. Many thanks to those, who provided me with bug
11473 reports and feedback.
11475 * Uses GNU configure, taken from the gdb distribution.
11477 * Uses GNU getopt(), with long option names.
11479 * The -Q/+quiet option is added, which suppresses warnings about
11480 missing or superflous arguments to built-in macros.
11482 * Added default options via the M4OPTS environment variable.
11484 * The built-in format can now be configured to use sprintf as
11485 the formatting engine, for systems without [efg]cvt(3).
11487 * GNU library code is moved to the ./lib subdirectory; other
11488 utility files are now in ./etc.
11490 * Several minor bugs have been fixed.
11492 1991-07-26 René Seindal <seindal@diku.dk>
11494 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
11495 François Pinard and Roland H. Pesch for providing me with reports.
11497 * The builtins incr and decr are now implemented without use of
11500 * The builtin indir is added, to allow for indirect macro calls
11501 (allows use of "illegal" macro names).
11503 * The debugging and tracing facilities has been enhanced
11504 considerably. See the manual for details.
11506 * The -tMACRO option is added, marks MACRO for tracing as soon
11509 * Builtins are traced after renaming iff they were before.
11511 * Named files can now be undiverted.
11513 * The -Nnum option can be used to increase the number of
11514 divertions available.
11516 * Calling changecom without arguments now disables all comment
11519 * The function m4_patsubst() is now consistently declared
11522 * A bug in dnl is fixed.
11524 * A bug in the multi-character quoting code is fixed.
11526 * Several typos in the manual has been corrected. More probably
11529 * The m4.info file is now installed along with the program.
11531 1990-11-15 René Seindal <seindal@diku.dk>
11533 * Updated and enhanced version. Release 0.75, manual 0.07.
11535 * Implemented search path for include files (-I option and
11536 M4PATH envronment variable).
11538 * Implemented builtin "format" for printf-like formatting.
11540 * Implemented builtin "regexp" for searching for regular
11543 * Implemented builtin "patsubst" for substitution with regular
11546 * Implemented builtin "esyscmd", which expands to a shell
11549 * Implemented "__file__" and "__line__" for use in error
11552 * Implemented character ranges in "translit".
11554 * Implemented control over debugging output.
11556 * Implemented multi-character quotes.
11558 * Implemented multi-character comment delimiters.
11560 * Changed predefined macro "gnu" to "__gnu__".
11562 * Changed predefined macro "unix" to "__unix__", when the -G
11563 option is not used. With -G, "unix" is still defined.
11565 * Changed "shift", "$@" and "$*" to not insert spaces afters
11568 * Added program name to error messages.
11570 * Fixed two missing null bytes bugs.
11572 1990-01-22 René Seindal <seindal@diku.dk>
11574 * Initial beta release. Release 0.50, manual 0.05.
11583 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
11584 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
11586 Copying and distribution of this file, with or without
11587 modification, are permitted provided the copyright notice
11588 and this notice are preserved.