1 2009-03-13 Eric Blake <ebb9@byu.net>
3 Use gnulib pipe module instead of popen(3).
4 * ltdl/m4/gnulib-cache.m4: Import pipe and wait-process modules.
5 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS):
7 (esyscmd): Rewrite with pipe module.
8 Resolves a failure on AIX, reported by Gary V. Vaughan.
10 Use gnulib execute module instead of system(3).
11 * ltdl/m4/gnulib-cache.m4: Import execute module.
12 * m4/utility.c (m4_info_name): New function.
13 * m4/m4module.h (m4_info_name): New prototype.
14 * modules/m4.c (syscmd): Rewrite with execute module.
15 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS, m4_sysval): Move
17 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS)
19 Resolves a failure on AIX, reported by Gary V. Vaughan.
21 2009-03-05 Eric Blake <ebb9@byu.net>
23 Improve web-manual maintainer rule.
24 * maint.mk (web-manual): Factor package-specific detail...
25 * cfg.mk (manual_title): ...to new variable.
27 2009-02-23 Eric Blake <ebb9@byu.net>
29 Speed up translit when from argument is short.
30 * modules/m4.c (translit): Use memchr2 when possible.
31 * tests/builtins.at (translit): Add tests.
32 * NEWS: Document this.
34 2009-02-18 Eric Blake <ebb9@byu.net>
36 Prefer buffer over byte operations.
37 * modules/format.c (format): Use memchr for speed.
38 * modules/gnu.c (substitute): Likewise.
39 * m4/macro.c (locate_dollar): Inline into only caller...
40 (process_macro): ...and rearrange for readability.
41 * m4/input.c (consume_buffer): Allow C++ compilation.
42 * doc/m4.texinfo (Changesyntax): Enhance test.
44 Speed up esyscmd with buffer reads.
45 * modules/gnu.c (esyscmd): Read blocks directly into obstack,
46 rather than repeatedly reading bytes. Detect read errors.
48 Avoid risk of stack overflow.
49 * m4/output.c (insert_file): Avoid stack allocation of large
52 Synchronize THANKS with branch.
53 * THANKS: Import more names.
55 Improve handling of $ in syntax table.
56 * m4/m4module.h (m4_is_syntax_single_dollar): New function.
57 (M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
58 be context rather than basic syntax categories.
59 (M4_SYNTAX_MASKS): Adjust macro.
60 * m4/m4private.h (struct m4_syntax_table): Add dollar and
61 is_single_dollar members.
62 (m4_is_syntax_single_dollar): Add fast alternative.
63 * m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
64 account for change to context categories.
65 (m4_set_syntax): Manage is_single_dollar.
66 (m4_is_syntax_single_dollar): New function.
67 * m4/macro.c (locate_dollar): New helper function.
68 (process_macro): Use it to speed up macro expansion.
69 * m4/input.c (m4__next_token): Adjust client.
70 * doc/m4.texinfo (Changesyntax): Document this.
72 2009-02-17 Eric Blake <ebb9@byu.net>
74 Sync changecom documentation with branch.
75 * doc/m4.texinfo (Changecom): Tweak wording.
76 * NEWS: Import changes from the branch.
78 Stage 29b: Process quotes and comments by buffer, not bytes.
79 Search for quote and comment delimiters by buffer when possible.
81 Speed impact: noticeable improvement, from fewer function calls.
82 * ltdl/m4/gnulib-cache.m4: Import memchr2 module.
83 * m4/input.c (m4__next_token): Add buffer reads to quote and
85 * NEWS: Document this.
87 2009-02-16 Eric Blake <ebb9@byu.net>
89 Stage 29a: Process dnl and macro names by buffer, not bytes.
90 Enhance input engine to provide lookahead buffer, rather than
91 forcing clients to call next_char for every byte. Utilize this
92 for the simplest clients.
94 Speed impact: noticeable improvement, from fewer function calls.
95 * ltdl/m4/gnulib-cache.m4: Import freadptr and freadseek modules.
96 * m4/input.c (struct input_funcs): Add virtual functions
97 buffer_func and consume_func.
98 (file_buffer, file_consume, string_buffer, string_consume)
99 (composite_buffer, composite_consume, eof_buffer): Implement
101 (file_funcs, string_funcs, composite_funcs, eof_funcs): Update
103 (buffer_retry): New sentinel.
104 (next_buffer, consume_buffer): New functions.
105 (m4_skip_line, match_input, consume_syntax): Use them for faster
107 Suggested by Bruno Haible.
109 Unify single and multi-character delimiter handling.
110 * m4/input.c (MATCH): Add a parameter.
111 (m4__next_token): Simplify logic and reduce redundancy.
112 (m4__next_token_is_open): Adjust caller.
113 * m4/syntax.c (m4_set_comment, m4_set_quotes): Handle delimiters
114 of differing lengths.
115 (m4_set_syntax): Recognize restoration of single delimiters.
117 Revamp changesyntax vs. changequote interactions.
118 * m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
119 (M4_SYNTAX_SUSPECT): New macro.
120 * m4/m4private.h (struct m4_syntax_table): Add suspect field.
121 * m4/syntax.c (check_is_single_quotes, check_is_single_comments)
122 (check_is_macro_escaped): Delete, by inlining body...
123 (m4_set_syntax): ...into here. Improves handling between
124 changesyntax and changequote/changecom.
125 (add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
126 and let suspect field track needed cleanup.
127 (m4_set_quotes, m4_set_comment): Adjust meaning of
128 is_single_quotes and is_single_comment flags to always be true if
129 only one delimiter exists, regardless of its length. Ensure that
130 the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
131 only used on 1-byte delimiters.
132 (add_syntax_attribute, remove_syntax_attribute): Change signature
133 to allow the use of fewer casts. Adjust the suspect field when
135 (m4_reset_syntax, set_quote_age): Adjust callers.
136 * m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
138 * doc/m4.texinfo (Changesyntax): Update documentation and tests.
140 Improve changesyntax documentation.
141 * doc/m4.texinfo (Changesyntax): Merge two tables into one
144 Fix regression in multicharacter quotes, from 2008-01-26.
145 * m4/input.c (m4__next_token): Fix typo.
146 * tests/builtins.at (changequote): Enhance test.
148 2009-02-13 Eric Blake <ebb9@byu.net>
150 Speed up parsing when detecting input file change.
151 * m4/input.c (next_char): Clear input_change flag. Bug introduced
154 2009-02-12 Eric Blake <ebb9@byu.net>
156 Avoid quadratic code when walking definition stack.
157 * examples/stack_sep.m4: Use linear, not quadratic
159 * doc/m4.texinfo (Improved copy): Fix documentation, based on
160 recent autoconf bug fix.
161 * tests/others.at (recursion): Enhance test.
163 2009-02-11 Eric Blake <ebb9@byu.net>
165 Stage 28c: Warn on embedded NUL in remaining cases.
166 Ensure all remaining warnings can handle embedded NUL.
168 Speed impact: none noticed.
169 * m4/m4module.h (m4_debug_decode, m4_parse_truth_arg): Add
171 * m4/macro.c (m4_macro_call): Improve diagnostic.
172 * modules/m4.c (defn): Likewise.
173 * m4/debug.c (m4_debug_decode): Handle embedded NUL.
174 * m4/utility.c (m4_parse_truth_arg): Likewise.
175 * modules/format.c (arg_int, arg_long, arg_double): Likewise.
176 (arg_string): New function.
177 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Update callers.
178 * src/main.c (main): Likewise.
179 * src/freeze.c (reload_frozen_state): Likewise.
180 * modules/gnu.c (debugmode, syncoutput): Likewise.
181 * tests/options.at (--regexp-syntax): Adjust test.
182 * tests/freeze.at (reloading nul): Likewise.
183 * tests/null.m4: Likewise.
184 * tests/null.out: Likewise.
185 * tests/null.err: Likewise.
187 Stage 28b: Warn on embedded NUL in file arguments.
188 Quote warning messages related to file and other NUL-terminated
191 Speed impact: none noticed.
192 * m4/path.c (m4_path_search): Quote file names in message.
193 * modules/m4.c (syscmd, include, m4_make_temp): Handle embedded
195 * modules/gnu.c (debugfile, esyscmd): Likewise.
196 * tests/others.at (nul character): Adjust test.
197 * tests/builtins.at (mkdtemp, mkstemp): Likewise.
198 * tests/null.m4: Likewise.
199 * tests/null.out: Likewise.
200 * tests/null.err: Likewise.
202 Stage 28a: Warn on embedded NUL in numeric arguments.
203 Quote warning messages related to numeric parsing in order to
206 Speed impact: none noticed.
207 * m4/m4module.h (m4_numeric_arg): Adjust prototype.
208 * m4/utility.c (m4_numeric_arg): Add parameter.
209 * modules/gnu.c (debuglen): Adjust callers.
210 * modules/m4.c (incr, decr, divert, undivert, m4exit, substr)
212 * modules/evalparse.c (m4_evaluate): Likewise.
213 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
214 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
216 * doc/m4.texinfo (Changesyntax): Fix typo.
217 * tests/others.at (nul character): Adjust test.
218 * tests/null.m4: Likewise.
219 * tests/null.out: Likewise.
220 * tests/null.err: Likewise.
222 2009-02-11 Eric Blake <ebb9@byu.net>
224 Avoid regression in popdef(undef).
225 * doc/m4.texinfo (Trace): Enhance test, to cover regression
226 recently fixed on the branch.
228 2009-02-09 Eric Blake <ebb9@byu.net>
230 Enhance index to support starting offset.
231 * modules/m4.c (index): Add optional third argument.
232 * NEWS: Document this.
233 * doc/m4.texinfo (Index macro): Likewise.
234 (Macro Arguments): Adjust tests.
236 2009-01-24 Eric Blake <ebb9@byu.net>
238 Add URLs to --help output.
239 * src/main.c (usage): Use enhanced version-etc features.
241 2009-01-07 Eric Blake <ebb9@byu.net>
243 Enhance substr to support replacement text.
244 * doc/m4.texinfo (Substr): Document new semantics.
245 * modules/m4.c (substr): Support optional fourth argument.
246 * NEWS: Document this.
248 Enhance substr to support negative values.
249 * doc/m4.texinfo (Substr): Document new semantics, and how to
251 * modules/m4.c (substr): Support negative values.
252 * NEWS: Document this.
254 2009-01-05 Eric Blake <ebb9@byu.net>
257 * HACKING: Remove mention of xdelta.
258 * Makefile.am (EXTRA_DIST, MAINTAINERCLEANFILES): Let gnulib take
259 care of distributing gendocs.sh.
260 * maint.mk (web-manual): Use new feature of gendocs.
261 * ltdl/m4/gnulib-cache.m4: Regenerate.
263 2008-12-24 Eric Blake <ebb9@byu.net>
265 Relax eval as allowed by POSIX 2008.
266 * modules/evalparse.c (m4_evaluate): Warn, not error, on invalid
267 operator. Quote expression in warning.
268 * modules/mpeval.c (includes): Add quotearg.h.
269 * doc/m4.texinfo (Eval, Improved forloop): Update tests.
270 * NEWS: Update to reflect 1.6 support for `?:'.
272 2008-12-23 Eric Blake <ebb9@byu.net>
274 Add debugmode(o) to control dumpdef output location.
275 * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
276 (M4_DEBUG_TRACE_VERBOSE): Update.
277 * m4/debug.c (m4_debug_decode): Support new debug option.
278 * src/freeze.c (produce_debugmode_state): Likewise.
279 * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
281 * src/main.c (usage): Document it.
282 * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
283 (Debugfile): Likewise.
285 Based on an autoconf bug report by Paolo Bonzini.
287 Make --debugfile argument optional.
288 * src/main.c (long_options): Make the argument optional, to allow
289 setting debug file back to stderr.
290 (main): Make --debugfile order-dependent.
291 (usage): Document this.
292 * doc/m4.texinfo (Debugging options): Likewise.
294 * tests/options.at (--debugfile): Enhance test.
295 (--safer): Adjust to new semantics.
297 2008-12-22 Eric Blake <ebb9@byu.net>
300 * doc/m4.texinfo (Operation modes, Preprocessor features)
301 (Limits control, Frozen state, Debugging options)
302 (Dynamic loading features): Use lower case names in @var.
303 (Improved copy): Use @code, not @var, as appropriate.
305 2008-12-18 Eric Blake <ebb9@byu.net>
307 Deal with M4 1.4.x limitation on builtin tokens.
308 * doc/m4.texinfo (Composition): Mention limitation on curry.
309 (Improved copy): New node.
311 * examples/stack.m4: Likewise.
312 * examples/stack_sep.m4: New file.
313 * Makefile.am (dist_pkgdata_DATA): Distribute it.
315 2008-12-15 Eric Blake <ebb9@byu.net>
317 Double size of temp file cache.
318 * m4/output.c (tmp_file, tmp_file_owner): Split...
319 (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
321 (tmp_file2_recent): New variable.
322 (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
323 (m4_output_exit): Adjust callers.
325 Use fewer seeks on cached files.
326 * m4/output.c (m4_tmpfile): Use write, not append mode.
327 (m4_tmpopen): Add parameter to decide when to skip seeks.
328 (m4_tmprename, m4_make_diversion, insert_diversion_helper)
329 (m4_freeze_diversions): Adjust callers.
331 Cache most recently spilled diversion.
332 * m4/output.c (tmp_file, tmp_file_owner): New variables, for
333 1-deep cache of spilled diversions.
334 (m4_tmpfile): Open in append mode, since we might revisit
335 diversion without closing it now.
336 (m4_tmpopen): Check cache first.
337 (m4_tmpclose): Update cache, rather than closing. Add parameter.
338 (m4_tmpremove): Close cache before removing.
339 (m4_tmprename): Deal with open files when renaming.
340 (m4_output_exit): Close cache before exiting.
341 (make_room_for, m4_make_diversion, insert_diversion_helper):
343 * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
344 * configure.ac (M4_RENAME): Invoke it.
346 Correctly track size of in-memory diversions.
347 * m4/output.c (insert_diversion_helper): Correctly track total
348 in-memory diversion size after undivert.
350 Avoid quadratic behavior for some cases of divert/undivert.
351 * m4/output.c (struct m4_diversion): Improve comments.
352 (m4_tmpname, m4_make_diversion): Strengthen preconditions.
353 (m4_tmprename): New function.
354 (m4_output_init, m4_output_exit): Move after internal functions.
355 (make_room_for): Don't bother copying uninitialized bytes.
356 (insert_diversion_helper): Transfer metadata, rather than copying
357 contents, when undiverting into a previously unused diversion.
358 * tests/builtins.at (divert): Add a check to the test.
359 * doc/m4.texinfo (Undivert): Enhance test.
360 * NEWS: Document the speedup.
362 2008-12-02 Eric Blake <ebb9@byu.net>
364 Stage 27: Allow embedded NUL in text processing macros.
365 Pass NUL through regular expressions, format, and translit, and
366 diagnose it in eval and changeresyntax. Improve warning
367 capabilities of format.
369 Speed impact: none noticed.
370 * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
371 (translit): Manage NUL bytes.
372 * modules/format.c (format): Likewise.
373 * modules/gnu.c (substitute, regexp_substitute): Likewise.
374 (m4_resyntax_encode_safe): Add parameter.
375 (regexp, patsubst, renamesyms): Update callers.
376 (regexp_compile): Adjust error message.
377 * modules/evalparse.c (m4_evaluate): Use consistent message.
378 (end_text): New variable.
379 (eval_init_lex): Add parameter.
380 (eval_lex): Detect embedded NUL.
381 * src/freeze.c (reload_frozen_state): Likewise.
382 * doc/m4.texinfo (Format): Update to cover new behavior.
383 (Eval): Mention that result is unquoted.
384 * tests/freeze.at (reloading nul): Enhance test.
385 * tests/null.m4: Likewise.
386 * tests/null.err: Update expected output.
387 * tests/null.out: Likewise.
388 * tests/options.at (--regexp-syntax): Likewise.
390 2008-11-28 Eric Blake <ebb9@byu.net>
392 Resync NEWS with branches.
393 * NEWS: Mention 1.4.12, update state of 1.6.
395 2008-11-26 Eric Blake <ebb9@byu.net>
397 Keep COPYING in repository.
398 * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
399 * .cvsignore: Don't ignore it.
400 * .gitignore: Likewise.
401 * COPYING: Store in repository, per automake 1.10.2
404 2008-11-26 Eric Blake <ebb9@byu.net>
406 Document optimized forloop.
407 * doc/m4.texinfo (Improved forloop): Mention alternate style that
408 avoids define overhead.
409 * examples/forloop3.m4: New file.
410 * Makefile.am (dist_pkgdata_DATA): Distribute it.
412 Document copy composite using stack_foreach and curry.
413 * doc/m4.texinfo (Stacks): New node, to document pushdef stack
415 (Ifelse): Move define_blind...
416 (Composition): ...to this new node. Document currying, then use
417 it to implement copy and rename.
418 * examples/curry.m4: New file.
419 * examples/stack.m4: Likewise.
420 * Makefile.am (dist_pkgdata_DATA): Distribute them.
422 2008-11-04 Eric Blake <ebb9@byu.net>
425 * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
426 * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
428 * doc/m4.texinfo (GNU Free Documentation License): Likewise.
430 2008-10-22 Eric Blake <ebb9@byu.net>
432 Give nicer error if user modifies testsuite but lacks autoconf.
433 * Makefile.am (AUTOM4TE): Use missing in the definition.
435 2008-10-09 Eric Blake <ebb9@byu.net>
437 Allow user to choose which sed to use in testsuite.
438 * tests/atlocal.in (SED): Inherit from configure results.
439 * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
440 (mkstemp, syscmd): Use $SED.
441 * tests/generate.awk (new_test): Likewise.
442 * tests/options.at (deprecated options, unknown option)
443 (--debugmode, --help and --version): Likewise.
444 * tests/testsuite.at (AT_CHECK_M4): Likewise.
445 * tests/others.at (directory, stderr closed, stdin seekable)
446 (stdout closed): Likewise.
447 (nul character): Likewise. Also, skip test if sed can't handle
450 Clean up testsuite invocation.
451 * tests/atlocal.in: Fix copyright notice.
452 * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
453 (check-local, installcheck-local): Adjust clients. Add missing
456 2008-09-25 Eric Blake <ebb9@byu.net>
458 Tweak error message on command line failure.
459 * m4/m4private.h (includes): Use "quotearg.h".
460 * src/main.c (process_file, main): Use nicer quotes for file name
462 * m4/input.c (file_clean, m4_push_file): Likewise.
463 * m4/module.c (m4__module_open): Likewise.
464 * src/freeze.c (produce_frozen_state, reload_frozen_state):
466 * modules/gnu.c (debugfile): Likewise.
467 * modules/m4.c (undivert, include): Likewise.
468 * tests/others.at (directory, stdin closed): Update tests.
469 * tests/options.at (file names, --debugmode): Likewise.
470 * doc/m4.texinfo (Debugmode): Likewise.
472 Unify error handling for reading directories.
473 * m4/path.c (m4_path_search): Factor open attempts...
474 (m4_fopen): ...into new function, to reject directories.
475 * tests/others.at (directory): Enhance test.
476 * doc/m4.texinfo (Include): Document that directories cannot be
479 Avoid bugs on platforms that mishandle trailing /.
480 * ltdl/m4/gnulib-cache.m4: Import fopen module.
481 * tests/others.at (directory): New test.
483 2008-09-16 Eric Blake <ebb9@byu.net>
485 Fix bootstrap for Solaris /bin/sh.
486 * bootstrap: Avoid shell quoting pitfall.
488 2008-09-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
490 Typos in source code comments.
491 * modules/m4.c: Fix typos in comments.
492 * m4/input.c: Likewise.
493 * src/main.c: Likewise.
495 2008-08-29 Eric Blake <ebb9@byu.net>
497 Fix manual date information.
498 * doc/m4.texinfo: UPDATED refers to the day the manual was built,
499 not the release date of M4.
500 Based on a bison patch by Akim Demaille.
502 2008-08-27 Eric Blake <ebb9@byu.net>
505 * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
509 2008-08-23 Eric Blake <ebb9@byu.net>
511 Allow debugmode control over whether defn(undef) warns.
512 * ltdl/m4/gnulib-cache.m4: Import verify module.
513 * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
515 (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
516 * m4/m4.c (m4_create): Start with debugmode = d.
517 * src/main.c (usage): Mention this.
518 (main): Let -E impact debug mode.
519 * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
521 * modules/gnu.c (builtin, inder): Likewise.
522 * m4/debug.c (m4_debug_decode): Parse new mode.
523 * src/freeze.c (produce_debugmode_state): Accomodate new mode.
524 * doc/m4.texinfo (Debugging options): Mention change in the
526 (Debugmode): Mention new flag d.
527 (Operation modes): Mention interaction with -E.
528 (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
530 * tests/options.at (--debugmode): Update tests.
531 * tests/freeze.at (reloading debugmode): Likewise.
532 * NEWS: Document this.
533 Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
534 incompatible with Autoconf 2.62.
536 2008-08-22 Eric Blake <ebb9@byu.net>
538 Improve --debugmode behavior.
539 * m4/m4module.h (m4_debug_decode): Simplify interface.
540 * m4/debug.c (m4_debug_decode): Remove parameter, and handle
541 setting the new value.
542 * modules/gnu.c (debugmode): Adjust caller.
543 * src/freeze.c (reload_frozen_state): Likewise.
544 * src/main.c (main): Likewise.
545 (usage): Fix default for --debug.
546 * doc/m4.texinfo (Debugging options): Add an example.
548 2008-08-21 Eric Blake <ebb9@byu.net>
550 Avoid regression in defn(undef).
551 * doc/m4.texinfo (Trace): Enhance test, to cover regression
552 recently fixed on the branch.
554 2008-08-18 Eric Blake <ebb9@byu.net>
556 Remove deprecated -N option; fixes a regression from 2006-09-14.
557 * src/main.c (DIVERSIONS_OPTION): Delete.
558 (long_options, OPTSTRING, main): Remove -N/--diversions option.
559 * doc/m4.texinfo (Limits control): Remove it from the manual.
560 * NEWS: Mention that it is gone.
561 * tests/options.at (deprecated options): Update test.
563 Improve 'git diff' of manual source.
564 * .gitattributes (*.texi*): Add diff attribute.
565 * bootstrap: Tell git how to use it.
566 Inspired by Jim Meyering's similar patch for coreutils.
568 2008-08-07 Bruno Haible <bruno@clisp.org> (tiny change)
570 Run m4 tests prior to gnulib unit tests.
571 * Makefile.am (SUBDIRS): Swap order of directories.
573 2008-08-03 Eric Blake <ebb9@byu.net>
575 Stage 26: Allow embedded NUL in macro definitions.
576 Clean up final few locations that did not track macro definitions
577 by length, to allow embedded NUL. Make m4_arg_len callers aware
578 of issue of flattening builtins when determining length.
580 Speed impact: none noticed.
581 * m4/m4module.h (m4_arg_len): Add parameter.
582 (M4ARGLEN): Provide default for the parameter.
583 * m4/m4private.h (includes): Share xmemdup0.h among all libm4
585 * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
586 * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
587 * m4/symtab.c (includes): Likewise.
588 (m4_symbol_value_copy): Use xmemdup0.
589 * m4/module.c (install_macro_table): Likewise.
590 * src/freeze.c (reload_frozen_state): Likewise.
591 * tests/freeze.at (reloading nul): Enhance test.
592 * tests/null.m4: Likewise.
593 * tests/null.err: Update expected output.
594 * tests/null.out: Likewise.
596 Fix regression in commenting unbalanced quotes, from 2008-02-16.
597 * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
598 * m4/input.c (m4__next_token, m4_print_token): Supply new token
600 * m4/macro.c (expand_token): Penalize comments, as they can
601 contain unbalanced quotes; latent bug since 2007-12-07, exposed by
602 passing $@ references built from comments.
603 (expand_argument): Adjust caller.
604 * tests/others.at (Comments): Enhance test to catch it.
605 * NEWS: Mention the fix.
607 2008-07-30 Eric Blake <ebb9@byu.net>
609 Fix regression in trace output, introduced 2008-05-08.
610 * m4/input.c (m4__push_symbol): When cloning chains, break pointer
611 back to original chain; latent bug from 2008-02-02 that did not
612 cause misbehavior until trace output read unfinished chain.
613 * tests/builtins.at (debug): Add test for this.
615 2008-07-28 Eric Blake <ebb9@byu.net>
617 Optimize iteration examples.
618 * examples/forloop2.m4: Avoid excess indir, by passing current
619 counter value as parameter.
620 * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
622 * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
623 documentation to match.
625 2008-07-26 Eric Blake <ebb9@byu.net>
627 Give example for O(n) foreach on m4 1.4.x.
628 * examples/foreachq4.m4: New file.
629 * Makefile.am (dist_pkgdata_DATA): Distribute it.
630 * tests/others.at (recursion): Test it.
631 * doc/m4.texinfo (Improved foreach): Document linear foreach with
632 m4 1.4.5 and greater.
634 2008-07-19 Eric Blake <ebb9@byu.net>
636 Resynchronize docs from branch.
637 * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
638 name, particularly since the old documentation didn't match code.
639 (Standard Modules): Add caveat about using __m4_version__.
641 2008-07-11 Eric Blake <ebb9@byu.net>
643 Bump required automake to 1.10a; regression introduced 2008-01-22.
644 * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
645 1.10.1, since we also rely on pkglibexecdir.
646 * HACKING: Fix minimum requirement.
647 * bootstrap: Likewise.
649 Reported by Joel E. Denny.
651 Avoid bogus whitespace in @ovar, @dvar.
652 * doc/m4.texinfo (ovar, dvar): Add @c.
653 Based on patch by Ralf Wildenhues to Autoconf manual.
655 2008-06-23 Eric Blake <ebb9@byu.net>
657 Adjust to new gnulib-tool layout.
658 * ltdl/m4/gnulib-cache.m4: Reformat.
660 Fix bootstrap comment.
661 * bootstrap: DOWNLOAD_PO was previously removed.
663 2008-06-19 Eric Blake <ebb9@byu.net>
665 Revert speed regression from 2008-06-16.
666 * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
667 * modules/m4.c (numb_obstack): Likewise.
668 * m4/input.c (MATCH): Use fewer conditionals, and factor
670 (match_input): ...here for smaller code size.
671 * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
672 Supply trailing NUL to delimiters, to meet contract of faster
675 2008-06-18 Eric Blake <ebb9@byu.net>
678 * m4/m4module.h: Use consistent spacing for pointer parameters.
679 * m4/m4private.h: Likewise.
681 Stage 25b: Handle embedded NUL in changesyntax and friends.
682 Track quote and comment delimiters by length, to allow embedded
683 NUL. Improve changesyntax to support assigning syntax to NUL.
685 Speed impact: none noticed.
686 * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
688 (m4_reset_syntax): New prototype.
689 * m4/syntax.c (add_syntax_set, subtract_syntax_set)
690 (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
692 (m4_set_syntax): Likewise. Also, split code to reset the table...
693 (m4_reset_syntax): ...into a new function.
694 (m4_syntax_create): Adjust callers.
695 * m4/input.c (match_input, MATCH): Add parameter.
696 (m4__next_token, m4__next_token_is_open): Adjust callers.
697 * modules/m4.h (m4_expand_ranges_func): Add parameter.
698 * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
699 (changequote, changecom, translit, m4_expand_ranges): Track
701 * modules/gnu.c (changesyntax): Handle embedded NUL.
702 * src/freeze.c (reload_frozen_state): Adjust callers.
703 * tests/freeze.at (reloading nul): Enhance test.
704 * tests/null.m4: Likewise.
705 * tests/null.out: Update expected output.
706 * tests/null.err: Likewise.
708 2008-06-16 Eric Blake <ebb9@byu.net>
710 Stage 25a: Use obstack_printf for easier output.
711 Convert macro tracing and other locations to use obstack_printf
712 rather than hand-rolled equivalents. Ensure that embedded NUL in
713 trace output does not truncate the trace string.
715 Speed impact: noticeable penalty, from obstack_printf overhead.
716 * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
717 * m4/macro.c (trace_format): Delete; use obstack_printf instead.
718 (trace_header, trace_pre, trace_post): All callers updated.
719 * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
720 (m4_divert_text): Speed up syncline output.
721 * modules/m4.c (dumpdef): Handle embedded NUL.
722 (numb_obstack): Speed up eval output.
723 (maketemp): Use obstack_printf.
724 * modules/format.c (format): Likewise.
726 Add missing const qualifications.
727 * m4/resyntax.c (m4_resyntax_map): Declare array elements as
729 * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
730 * modules/import.c (m4_builtin_table): Likewise.
731 * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
732 * modules/m4.c (m4_builtin_table): Likewise.
733 * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
734 * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
735 * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
736 * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
737 * modules/stdlib.c (m4_builtin_table): Likewise.
738 * modules/time.c (m4_builtin_table): Likewise.
739 * modules/traditional.c (m4_macro_table): Likewise.
741 2008-06-10 Eric Blake <ebb9@byu.net>
743 Avoid corrupted frozen file if NUL appears on block boundary.
744 * m4/output.c (insert_file): Separate consecutive quotearg blocks
745 with \<newline>, in case last byte of first block was NUL.
747 2008-06-03 Eric Blake <ebb9@byu.net>
749 Fix printf type mismatches.
750 * m4/m4module.h (m4_bad_argc): Alter parameter type.
751 * m4/m4private.h (struct m4_call_info): Alter call_id type.
752 * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
754 * m4/utility.c (m4_bad_argc): Likewise.
756 Borrow bootstrap ideas from gnulib.
757 * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
758 advertized subset of languages didn't work. Use --skip-po
759 instead, for consistency with gnulib bootstrap.
760 (func_get_translations): Use rsync, not wget.
761 (func_update_po): Use a reference directory, to avoid changing
762 timestamps on unchanged .po files.
763 * TODO: Update accordingly.
765 Fix fallout from previous patch.
766 * doc/m4.texinfo (Builtin): Adjust expected output.
768 2008-06-02 Eric Blake <ebb9@byu.net>
770 Stage 24c: Improve display of macro names with embedded NUL.
771 Quote instances of problematic characters in macro names when
772 presented to user. Track location via call_info rather than
773 munging context for every expansion.
775 Speed impact: slight penalty, due to more bookkeeping.
776 * m4/m4module.h (m4_push_string_init): Add parameters.
777 * m4/m4private.h (struct m4_macro_args): Remove argv0 and
778 argv0_len, now redundant with info.
779 (m4__push_wrapup_init): Add parameter.
780 * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
781 location from caller, rather than context.
782 (composite_peek, composite_read, match_input): Adjust callers.
783 * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
784 (m4_verror_at_line): Allow NUL in macro name.
785 * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
787 (expand_macro): No longer munge context location.
788 (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
789 (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
790 * modules/gnu.c (builtin, indir): Likewise.
791 * tests/null.m4: Enhance test.
792 * tests/null.err: Adjust expected output.
793 * tests/null.out: Likewise.
795 Stage 24b: Allow embedded NUL in macro names.
796 Use length rather than NUL-termination when tracking macro names.
797 All APIs dealing with symbol table changed.
799 Speed impact: slight penalty, due to more bookkeeping.
800 * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
801 (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
802 (m4_symbol_rename, m4_symbol_delete): Add length parameter.
803 (m4_string): New type.
804 * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
805 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
807 * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
808 (m4__symtab_remove_module_references, symbol_destroy_CB)
809 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
810 (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
811 (m4_symbol_delete): Likewise.
812 * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
814 * m4/macro.c (expand_token): Adjust all callers.
815 * m4/module.c (install_builtin_table, install_macro_table):
817 * m4/utility.c (m4_symbol_value_lookup): Likewise.
818 * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
819 * modules/m4.c (define, undefine, pushdef, popdef)
820 (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
821 (traceon, traceoff): Likewise.
822 * src/main.c (main): Likewise.
823 * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
824 * tests/freeze.at (reloading nul): Augment test.
825 * tests/null.out: Adjust expected output.
827 Stage 24a: Use full call context in error reporting.
828 Replace const char *macro_name with const m4_call_info *call, so
829 that the next patch can pass the length of macro_name with
830 embedded NUL. Simplifies handling of global state.
832 Speed impact: none noticed.
833 * m4/m4module.h (m4_error, m4_warn): Change parameter type.
834 (m4_error_at_line, m4_warn_at_line): Delete.
835 (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
836 (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
837 * m4/m4private.h (m4__next_token): Likewise.
838 * m4/utility.c (m4_verror_at_line): Alter parameter, and use
839 caller's location if caller is provided.
840 (m4_error, m4_warn): Change parameter type.
841 (m4_error_at_line, m4_warn_at_line): Delete.
842 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
843 (m4_symbol_value_lookup): Adjust all callers.
844 * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
845 * m4/input.c (m4_skip_line, m4__next_token): Likewise.
846 * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
847 (process_macro): Likewise.
848 * modules/m4.h (m4_make_temp_func): Likewise.
849 * modules/evalparse.c (m4_evaluate): Likewise.
850 * modules/format.c (arg_int, arg_long, arg_double, format):
852 * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
853 (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
854 (renamesyms, syncoutput, regexp_compile, substitute)
855 (regexp_substitute, m4_resyntax_encode_safe): Likewise.
856 * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
857 (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
858 (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
860 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
861 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
863 * tests/options.at (--syncoutput): Add test for invalid
864 command-line argument. Split xfailed portion...
865 (--syncoutput and diversions): ...into new test.
866 (unknown option): New test.
867 * tests/freeze.at (reloading unknown builtin): Update expected
870 Adjust to recent gnulib change.
871 * configure.ac (AB_INIT): Delete, now that gnulib does this.
873 2008-05-28 Eric Blake <ebb9@byu.net>
875 Improve frozen debugmode behavior.
876 * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
877 * src/main.c (main): Interleave -d with files.
878 * tests/options.at (--debugmode): Update test.
879 * tests/freeze.at (reloading debugmode): New test.
880 * doc/m4.texinfo (Debugging options, Debugmode): Document the
884 2008-05-27 Eric Blake <ebb9@byu.net>
886 Fix some testsuite failures on Solaris 8.
887 * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
889 * tests/others.at (stderr closed): Likewise. Also support Solaris
891 (stdin closed): Skip test if closed stdin gets reopened.
892 (stdout closed): Support Solaris wording for EBADF.
893 * tests/testsuite.at (AT_CHECK_M4): Likewise.
895 Fix configure message nesting, broken since 2001-09-20.
896 * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
897 not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
899 Support 'make dist' with BSD make.
900 * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
901 of the generated file tests/generated.at.
902 (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
903 * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
905 2008-05-24 Eric Blake <ebb9@byu.net>
907 Test NUL in frozen files.
908 * tests/testsuite.at (AT_CHECK_M4): Add parameter.
909 * tests/freeze.at (reloading nul): New test.
910 (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
911 (reloading unknown builtin): Likewise.
913 2008-05-23 Eric Blake <ebb9@byu.net>
915 Improve handling of frozen file errors.
916 * src/freeze.c (produce_frozen_state): Detect write failures.
917 (reload_frozen_state): Use close_stream.
918 * tests/freeze.at (freezing failure): New test.
920 Reported by Jean-Charles Longuet.
922 2008-05-19 Eric Blake <ebb9@byu.net>
924 In frozen file, split consecutive strings with newline.
925 * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
926 (produce_frozen_state): Likewise for 'Q', 'C'.
927 (reload_frozen_state): Parse the new layout.
928 [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
929 * tests/freeze.at (loading format 2): Rewrite to new format.
930 (reloading unknown builtin): Likewise.
931 (loading format 1): Make sure backslash-newline is not
933 * doc/m4.texinfo (Frozen file format 2): Document the format.
934 * NEWS: Document this change.
936 Fix xgettext options.
937 * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
940 Fix spelling of René Seindal's name in --version output.
941 * ltdl/m4/gnulib-cache.m4: Import propername module.
942 * src/main.c (AUTHORS): Rewrite in terms of proper_name.
943 * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
944 * HACKING: Mention new prerequisite of gperf.
946 2008-05-18 Eric Blake <ebb9@byu.net>
948 Allow freezing the trace status of macros.
949 * src/freeze.c (produce_symbol_dump): Let undefined traced macros
951 (dump_symbol_CB): Also freeze trace state.
952 * tests/freeze.at (reloading traced macros): New test.
953 * doc/m4.texinfo (Using frozen files): Update documentation to
955 (Frozen file format 1): Improve synchronization with branch.
956 (Frozen file format 2): Reorder directives, and add `d', `t'.
957 * NEWS: Document this change.
959 2008-05-15 Eric Blake <ebb9@byu.net>
961 Fix frozen file regression in pushdef stacks from 2001-09-01.
962 * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
963 just the current definition.
964 (reverse_symbol_value_stack): New helper method.
965 * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
966 (reloading pushdef stack): New test.
967 (reloading unknown builtin): Enhance test.
969 2008-05-13 Eric Blake <ebb9@byu.net>
971 Fix frozen file regression in diversions from 2007-01-21.
972 * m4/output.c (insert_diversion_helper): Add parameter.
973 (m4_insert_file): Move contents...
974 (insert_file): ...to this new helper, with added parameter.
975 (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
977 * src/freeze.c (produce_mem_dump): Simplify.
978 * tests/freeze.at (large diversion): Test for this.
980 Improve error message when frozen file is invalid.
981 * src/freeze.c (decode_char): Add parameter. Allow \<newline>
983 (reload_frozen_state): Track current line.
984 * tests/freeze.at (loading format 1, loading format 2): Update to
987 2008-05-10 Eric Blake <ebb9@byu.net>
989 Detect integer overflow when loading frozen file.
990 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
991 immediately on overflow.
992 * tests/freeze.at (loading format 2): Test this.
993 Reported by Jim Meyering.
995 2008-05-08 Eric Blake <ebb9@byu.net>
997 Stage 23: allow tracing of indirect macro calls.
998 Track all trace information as part of the argv struct, rather
999 than temporarily resetting global state. Teach indir to trace
1000 macros that it invokes.
1001 Memory impact: slight penalty, due to larger argv struct.
1002 Speed impact: none noticed.
1003 * m4/m4module.h (m4_input_block): Remove.
1004 (m4_call_info): New opaque type.
1005 (m4_trace_prepare, m4_arg_info): New prototypes.
1006 (m4_macro_call, m4_push_string_finish, m4_input_print): Change
1008 * m4/m4private.h (struct m4_macro_args): Add info field.
1009 (struct m4_call_info): New structure.
1010 (m4_arg_info): New accessor.
1011 * m4/input.c (m4_input_block): Make typedef local.
1012 (m4_push_string_init): Initialize length.
1013 (m4_push_string_finish, m4_input_print): Change signature, so that
1014 printing can be done before finalization.
1015 (struct input_funcs): Add parameter to print_func.
1016 (file_print, string_print, composite_print): Adjust accordingly.
1017 * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
1018 Change signatures for stacked trace messages, and for using call
1020 (trace_prepre): Export and rename...
1021 (m4_trace_prepare): ...to this, for use by indir. Alter signature
1022 to use call context.
1023 (collect_arguments): Alter signature, to manage new field.
1024 (expand_macro): Change call context management. Move tracing...
1025 (m4_macro_call): ...here. Remove redundant parameter.
1026 (m4_arg_argc): New function.
1027 (m4_make_argv_ref): Replace unused skip parameter with new trace
1028 parameter; manage new field.
1029 * modules/gnu.c (builtin, indir): Adjust callers.
1030 * src/main.c (usage): Update debugmode flag summary.
1031 * tests/null.m4: Enhance test.
1032 * tests/null.err: Update expected output.
1033 * tests/macros.at (Tracing Hanoi Towers): Likewise.
1034 * doc/m4.texinfo (Trace): Mention more about trace formatting.
1035 (Debugmode): Enhance description of 'c' and 'x'. Enhance test to
1036 cover line numbering details in traces.
1037 (Debuglen): Enhance test to cover indir tracing.
1038 * NEWS: Mention these changes.
1039 Reported by Akim Demaille in the autoconf TODO file in 2000.
1041 2008-05-07 Eric Blake <ebb9@byu.net>
1043 Test for traceon regression just fixed in branch-1.6.
1044 * doc/m4.texinfo (Trace): Enhance test.
1045 * NEWS: Port news item from branch.
1047 2008-05-05 Eric Blake <ebb9@byu.net>
1049 Stage 22: allow builtin token concatenation outside $@.
1050 Adjust the input and argument parsing engines to append builtins
1051 alongside text. Make define warn when builtins must be
1053 Memory impact: slight penalty, with fewer builtins flattened.
1054 Speed impact: slight penalty, from more bookkeeping.
1055 * m4/m4module.h (m4_is_arg_composite): New prototype.
1056 (m4_symbol_value_copy): Change return type.
1057 (m4_arg_text): Add parameter.
1058 (M4ARG): Adjust callers.
1059 * m4/m4private.h: Adjust comments.
1060 * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
1062 * m4/input.c (init_builtin_token): Add parameter, and allow
1063 concatenating builtins.
1064 (m4__next_token): Adjust caller.
1065 * m4/macro.c (m4_is_arg_composite): New function.
1066 (expand_argument): Allow builtin concatenation.
1067 (m4_arg_text): Add parameter.
1068 (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
1069 (m4_arg_equal): Fix comparison of builtin tokens.
1070 * modules/m4.c (define, pushdef): Warn when flattening builtins.
1071 * doc/m4.texinfo (Define): Remove dead comment.
1072 (Defn): Update to reflect code changes.
1073 * tests/builtins.at (defn): Remove xfail.
1074 * NEWS: Document this change.
1076 2008-05-03 Eric Blake <ebb9@byu.net>
1078 Document define_blind.
1079 * doc/m4.texinfo (Ifelse): Add a new composite macro.
1081 Suggested by Mike R.
1083 2008-05-01 Eric Blake <ebb9@byu.net>
1085 Avoid -Wshadow compiler warnings.
1086 * m4/output.c (threshold_diversion_CB): s/div/diversion/.
1087 * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
1088 (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
1089 (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
1090 (m4_push_arg, m4__push_arg_quote): s/index/arg/.
1091 * modules/format.c (format): Likewise.
1092 * modules/m4.c (ifelse): Likewise.
1094 Improve debugmode testing, based on recent branch-1.6 regressions.
1095 * doc/m4.texinfo (Debugmode): Enhance tests.
1096 * tests/generate.awk: Run tests from stdin, not input.m4. Support
1097 stderr munging when using -I examples.
1099 Fix regression in define from 2008-02-22.
1100 * m4/m4module.h (m4_symbol_value_copy): Add parameter.
1101 * m4/symtab.c (m4_symbol_value_copy): Support copying $@
1103 * m4/macro.c (expand_argument): Update callers.
1104 * modules/m4.c (define, pushdef): Likewise.
1105 * tests/builtins.at (define): Enhance test to catch this.
1107 2008-04-21 Eric Blake <ebb9@byu.net>
1109 Simplify previous patch.
1110 * tests/m4.in: Compress assignment.
1111 Suggested by Gary V. Vaughan.
1113 Fix --disable-shared testsuite regression from previous patch.
1114 * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
1117 Fix spelling of attribution to Christopher Strachey.
1118 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
1120 Reported by Fernando Carrijo.
1122 2008-04-17 Eric Blake <ebb9@byu.net>
1124 Fix testsuite bug when SIGPIPE is ignored.
1125 * tests/builtins.at (divert): Consume all of m4's output, to avoid
1126 spurious write failure.
1127 * src/main.c (main): In batch mode, restore default handling of
1129 * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
1131 Reported by Bob Proulx, via his autobuilder.
1133 2008-04-15 Eric Blake <ebb9@byu.net>
1135 Fix 'make installcheck' after './configure --prefix-progname'.
1136 * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
1138 (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
1139 * tests/builtins.at (patsubst): Avoid space-tab.
1140 (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
1141 * tests/options.at (--debugfile): Likewise.
1142 * tests/others.at (stdin seekable): Likewise.
1143 (fstab): Avoid space-tab.
1144 * Makefile.am (installcheck-local): Accomodate transformed name.
1145 (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
1146 during 'make distcheck'.
1147 * cfg.mk: New file, borrowed from branch.
1149 Update prerequisite tools to match recent releases.
1150 * configure.ac (AC_PREREQ): Rely on released autoconf.
1151 (LT_PREREQ): Rely on released libtool.
1152 * tests/testsuite.at (m4_version_prereq): Update dependence.
1153 * bootstrap: Mention prerequisites.
1155 Work around OS/2 limitation of printf(1).
1156 * tests/null.m4: Use m4, not printf, to generate NUL byte.
1157 * tests/null.out: Check for esyscmd failure.
1158 Reported by Elbert Pol.
1160 2008-04-14 Eric Blake <ebb9@byu.net>
1162 Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
1163 Improve arg_print to handle builtin tokens when printing to a
1164 known chain, rather than always flattening builtins. This allows
1165 m4wrap and $@ back-references to handle embedded builtin tokens.
1166 Memory impact: none.
1167 Speed impact: slight penalty, from more bookkeeping.
1168 * m4/m4module.h (m4_push_builtin): Add parameter.
1169 (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
1170 (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
1171 * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
1172 (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
1173 ...to these, in some cases adding a parameter.
1174 (m4__append_builtin): New prototype.
1175 * m4/builtin.c (m4_builtin_print): Alter signature to print
1176 builtin to a growing symbol chain.
1177 * m4/symtab.c (m4__symbol_value_print): Alter signature.
1178 (m4_symbol_print, dump_symbol_CB): Adjust callers.
1179 * m4/input.c (builtin_peek, builtin_read, builtin_unget)
1180 (builtin_print, builtin_funcs): Delete, handled via composite
1182 (struct m4_input_block): Delete u.builtin member.
1183 (init_builtin_token): Only use composite block.
1184 (m4__append_builtin): New function.
1185 (m4_push_builtin, m4__push_wrapup_init): Alter signature.
1186 (m4__push_symbol): Allow builtin tokens.
1187 (m4__push_wrapup_finish): Rename.
1188 (composite_print, m4_print_token): Adjust callers.
1189 * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
1191 (m4__arg_print): Alter signature.
1192 (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
1194 * modules/m4.c (m4wrap): Allow builtin tokens.
1195 (defn, errprint): Adjust callers.
1196 * modules/gnu.c (builtin): Likewise.
1197 * doc/m4.texinfo (M4wrap): New test.
1198 (Debuglen): Adjust expected output.
1200 Stage 21a: Optimize checks for end of input.
1201 Create a new polymorphic input block type, which always fails with
1202 CHAR_EOF, so that remaining input routines no longer have to check
1203 for NULL input block.
1204 Memory impact: none.
1205 Speed impact: noticeable improvement, from fewer conditionals.
1206 * m4/input.c (eof_funcs, input_eof): New objects.
1207 (eof_peek, eof_read, eof_unget): New functions.
1208 (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
1209 (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
1210 (m4_input_exit): Use placeholder to guarantee non-NULL isp and
1212 (next_char): Rename retry to allow_unget, and change sense for
1213 easier manipulation. All callers changed.
1215 Improve OS/2 detection.
1216 * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
1217 are defined, not just the first. The testsuite ensures that
1218 exactly one gets defined.
1219 * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
1220 what other pre-defined macros it has.
1222 Reported by Elbert Pol.
1224 Ensure __m4_version__ is unquoted.
1225 * tests/builtins.at (__m4_@&t@version__): Augment test.
1227 Avoid GNU make failure on tarball.
1228 * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
1230 2008-04-10 Eric Blake <ebb9@byu.net>
1232 Allow back-referenced macro names; fixes 2008-03-13 regression.
1233 * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
1234 * m4/utility.c (m4_symbol_value_lookup): Change signature.
1235 * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
1237 * tests/others.at (ifndef): New test.
1239 Be namespace clean for M4 version; fixes 2008-04-08 regression.
1240 * configure.ac (version): Rename...
1241 (M4_VERSION): ...to this, since using 'version' broke po.m4.
1243 2008-04-09 Eric Blake <ebb9@byu.net>
1245 Mention 1.4.11 release.
1246 * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
1247 (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
1248 (Format): Add test of C99 hex-float parsing.
1249 * NEWS: Mention 1.4.11 release.
1250 * tests/builtins.at (divert): Add additional test.
1252 2008-04-08 Eric Blake <ebb9@byu.net>
1254 Overhaul inter-version releases to work with git.
1255 * configure.ac (version): New variable, which has nicer version
1256 contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
1257 (TIMESTAMP): Delete, since CVS id expansion died with transition
1259 (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
1260 * build-aux/mkstamp: Delete, no longer used.
1261 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
1262 rebuilds when timestamps don't matter.
1263 (MKSTAMP): Delete, no longer used.
1264 (EXTRA_DIST): No longer worry about mkstamp.
1265 (.version): New rule and distributed file.
1266 (doc/m4.1, tests/package.m4): Depend on .version, not
1267 configure.ac, for timestamp.
1268 * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
1269 * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
1270 * src/main.c (main): Likewise.
1272 2008-03-28 Eric Blake <ebb9@byu.net>
1274 Use GNUmakefile module.
1275 * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1276 * Makefile.am: Split off maintainer rules...
1277 * maint.mk: ...into this new file.
1279 2008-03-18 Eric Blake <ebb9@byu.net>
1281 Stage 20b: make m4wrap obey POSIX fifo ordering.
1282 Improve input engine to support location changes within symbol
1283 chains, then convert m4wrap to always build symbol chain.
1284 Memory impact: none.
1285 Speed impact: slight penalty, from more m4wrap bookkeeping.
1286 * m4/m4module.h (m4_wrap_args): Add prototype.
1287 * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1288 (struct m4__symbol_chain): Add struct u_l.
1289 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1291 (composite_peek, composite_read, composite_clean): Handle location
1293 * m4/macro.c (m4_wrap_args): New function.
1294 * modules/m4.c (m4wrap): Use it.
1295 * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1296 (Extensions): Document extension of multiple arguments.
1297 (Location, Improved m4wrap): Adjust example to match FIFO order.
1298 * tests/builtins.at (wrap): Likewise.
1299 * NEWS: Document this change.
1301 2008-03-17 Eric Blake <ebb9@byu.net>
1303 Stage 20a: reduce unget's in input engine.
1304 Now that out-of-range input placeholders like CHAR_BUILTIN are
1305 consumed outside of next_char, next_token should always consume
1306 rather than peek at the first character. Fewer peeks results in
1307 less ungetc overhead.
1308 Memory impact: none.
1309 Speed impact: noticeable improvement, from fewer function calls.
1310 * m4/input.c (struct input_funcs): Alter read_func prototype.
1311 (next_char, file_read, buildin_read, string_read, composite_read):
1312 Add allow_argv parameter.
1313 (init_builtin_token, init_argv_symbol): Require all prior input to
1315 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1316 (m4__next_token): Consume first byte without peek.
1318 Update for fresh bootstrap.
1319 * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1321 2008-03-15 Eric Blake <ebb9@byu.net>
1323 Document join, in order to fix bug in m4wrap example.
1324 * examples/join.m4: New file.
1325 * examples/wraplifo2.m4: Likewise.
1326 * Makefile.am (EXTRA_DIST): Add new files.
1327 * doc/m4.texinfo (Improved m4wrap): New node.
1328 (Defn, Location): Enhance tests.
1329 (Shift): Document the composite macro join.
1330 (Incompatibilities): Move documentation of LIFO vs. FIFO...
1331 (M4wrap): ...here, to match improved example.
1333 2008-03-13 Eric Blake <ebb9@byu.net>
1335 Stage 19c: allow builtin tokens in more macros.
1336 Allow builtin tokens inside symbol chains, although for now, they
1337 are not allowed inside comments or quotes. Enable builtin token
1338 handling in more macros, if only to consistently diagnose invalid
1340 Memory impact: none.
1341 Speed impact: slight impact, due to more bookkeeping.
1342 * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1344 * m4/m4private.h (enum m4__symbol_chain_type): Add
1346 (struct m4__symbol_chain): Add builtin member.
1347 * m4/utility.c (m4_symbol_value_lookup): New method.
1348 * m4/builtin.c (m4_builtin_print): New function.
1349 * m4/symtab.c (m4_symbol_value_print): Use it.
1350 * m4/input.c (builtin_print): Likewise.
1351 (m4__push_symbol): Allow pushing builtin tokens.
1352 (composite_peek, composite_read, composite_unget, composite_clean)
1353 (composite_print): Handle builtin tokens.
1354 (init_builtin_token): Allow builtin tokens from composite input.
1355 (m4__next_token): Flatten builtins inside comment or string.
1356 * m4/macro.c (expand_argument): Strengthen assertion.
1357 (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1358 Handle builtin tokens.
1359 (arg_symbol): Add parameter, and allow NULL level.
1360 (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1361 (m4_arg_text): Ensure all builtins have been flattened.
1362 * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1363 (undefine, m4_dump_symbols): Warn on invalid macro names.
1364 (ifdef, ifelse, shift): Handle builtin tokens.
1365 * modules/gnu.c (m4symbols): Likewise.
1366 * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1368 (Debuglen): Likewise, and remove xfail.
1369 * NEWS: Mention the change.
1371 Stage 19b: invert sense of bit for handling builtin tokens.
1372 Pass builtin tokens by default, rather than as the exception, so
1373 that the logic can consistently refer to flattening arguments.
1374 Memory impact: none.
1376 * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1377 (M4_BUILTIN_GROKS_MACRO): Rename...
1378 (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1379 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1380 (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1382 * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1383 (m4_symbol_value_groks_macro): Likewise...
1384 (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1386 * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1387 (m4_symbol_value_flatten_args): ...to this.
1388 * m4/macro.c (collect_arguments): Accomodate changed sense.
1389 * m4/module.c (m4__module_open): Require arguments if flattening
1391 * m4/input.c (m4_push_string_finish): For now, flatten all
1392 builtins pushed as back-references.
1393 * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1394 * modules/import.c (m4_builtin_table): Likewise.
1395 * modules/load.c (m4_builtin_table): Likewise.
1396 * modules/modtest.c (m4_builtin_table): Likewise.
1397 * modules/mpeval.c (m4_builtin_table): Likewise.
1398 * modules/perl.c (m4_builtin_table): Likewise.
1399 * modules/shadow.c (m4_builtin_table): Likewise.
1400 * modules/stdlib.c (m4_builtin_table): Likewise.
1401 * modules/time.c (m4_builtin_table): Likewise.
1402 * modules/m4.c (m4_builtin_table): Likewise.
1403 (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1404 are stringized without preprocessor expansion.
1405 * doc/m4.texinfo (Defn): Update comments to match reality.
1406 (Debuglen): Update test now that user macros pass builtin tokens.
1408 Stage 19a: sort and cache builtins loaded by a module.
1409 Rather than repeatedly using dlsym to browse the builtin table,
1410 copy off the table at module load time. Then, the input engine
1411 merely refers to the copy instead of duplicating information.
1412 Memory impact: slight penalty, due to more memory per module, but
1413 offset by less memory in input engine.
1414 Speed impact: slight improvement, due to faster builtin lookups.
1415 * m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
1416 m4_builtin_find_by_* instead.
1417 (m4_builtin_find_by_func): Change return type.
1418 * m4/m4private.h (m4__builtin): New struct.
1419 (m4_module): Add sorted list of loaded builtins.
1420 (struct m4_symbol_value): Change type of builtin value.
1421 (m4__set_symbol_value_builtin): New prototype and fast accessor.
1422 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1424 * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1425 (m4__set_symbol_value_builtin): ...and populate additional fields,
1427 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1429 * m4/module.c (install_builtin_table): Use cached table.
1430 (compare_builtin_CB): New helper function.
1431 (m4__module_open): Populate table.
1432 (module_remove): Free table.
1433 * m4/builtin.c (compare_builtin_name_CB): New helper function.
1434 (m4_builtin_find_by_name): Rewrite to use sorted table.
1435 (m4_builtin_find_by_func): Change return type.
1436 * m4/input.c (struct m4_input_block): Simplify u_b, since most
1437 fields can be determined from builtin.
1438 (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1439 (m4__next_token): Alter parsing so that only init_builtin_token
1441 (builtin_print, m4_push_builtin): Adjust all users.
1442 * tests/macros.at (Arity, defn, and freeze): Fix typo.
1444 Consistently cast malloc results, for C++ compilation.
1445 * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1446 * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1447 (m4_hash_resize, maybe_grow): Likewise.
1448 * m4/m4.c (m4_create): Likewise.
1449 * m4/macro.c (expand_macro): Likewise.
1450 * m4/output.c (m4_tmpname): Likewise.
1451 * m4/path.c (search_path_add): Likewise.
1452 * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1453 (symtab_fetch): Likewise.
1454 * m4/syntax.c (m4_syntax_create): Likewise.
1455 * modules/gnu.c (regexp_compile): Likewise.
1456 * src/main.c (main): Likewise.
1457 * src/freeze.c (reload_frozen_state): Likewise.
1459 2008-03-06 Eric Blake <ebb9@byu.net>
1461 Fix nested builtin(`shift',$@) regression from 2008-02-23.
1462 * m4/macro.c (make_argv_ref): Don't output expansion text when
1463 making wrapper for builtin or indir.
1464 * tests/builtins.at (builtin): New test.
1465 * NEWS: Document the fix.
1466 Reported by Andreas Schwab.
1468 2008-03-04 Eric Blake <ebb9@byu.net>
1470 The gnulib module free was deprecated.
1471 * ltdl/m4/gnulib-cache.m4: Remove free module.
1473 2008-02-29 Eric Blake <ebb9@byu.net>
1475 Import news from 1.4.10b.
1476 * NEWS: Update from branch.
1478 2008-02-23 Eric Blake <ebb9@byu.net>
1480 Stage 18: try harder to reuse argv in recursion.
1481 When pushing arguments that contain an existing $@ ref, reuse the
1482 ref rather than creating another layer of wrappers.
1483 Memory impact: noticeable improvement, due to better $@ reuse.
1484 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1485 reduction in unboxed recursion.
1486 * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1487 (m4_push_args): Let make_argv_ref take care of pending data.
1488 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1489 performance capability.
1490 * tests/others.at (recursion): Add tests to avoid performance
1493 2008-02-22 Eric Blake <ebb9@byu.net>
1496 * NEWS: Document change to __gnu__ on 2008-02-11.
1498 Stage 17: pass argv through quoted strings.
1499 Allow the concatenation of $@ references with other text input
1500 inside quoted contexts, which requires distinguishing between a
1501 wrapper around many arguments vs. a reference serving as part of a
1502 single argument. Also optimize based on whether argv contains
1503 builtin tokens that might need flattening to the empty string.
1504 Memory impact: noticeable improvement, due to O(n^2) to O(n)
1505 reduction from total reuse of $@ references.
1506 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1507 reduction in boxed recursion.
1508 * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1509 (M4ARGLEN): Adjust definition.
1510 * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1511 (struct m4_symbol_value): Add wrapper and has_func members.
1512 (struct m4_macro_args): Add flatten and has_func members.
1513 * m4/input.c (append_quote_token): Return argv refs inside quoted
1515 (init_argv_symbol): Populate new fields.
1516 * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1517 (m4_make_argv_ref): Likewise.
1518 (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1520 (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1522 * modules/m4.c (ifelse): Adjust caller.
1524 2008-02-22 Gary V. Vaughan <gary@gnu.org>
1526 Fix regression in argument collection, from 2008-01-21.
1527 * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1528 undo argument collection optimisation for strings, so that
1529 m4_print_token doesn't abort when it otherwise receives an
1530 unprintable M4_SYMBOL_VOID type token.
1532 2008-02-20 Eric Blake <ebb9@byu.net>
1534 Stage 16: cache quotes and improve m4_arg_print.
1535 Cache rather than always copying quotes when pushing $@ refs; in
1536 particular, reconstruct single-byte quotes on the fly. Allow NUL
1537 through m4wrap. Improve sharing of code that prints arguments.
1538 Memory impact: slight improvement, due to cached quotes.
1539 Speed impact: slight improvement, due to less copying.
1540 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
1541 (m4_arg_print): Adjust prototypes.
1542 (m4_dump_args): Delete.
1543 (m4_push_wrapup): Split...
1544 (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
1546 * m4/m4private.h (struct m4_syntax_table): Add cached_quote
1548 (m4__quote_cache, m4__quote_uncache): New prototypes.
1549 * m4/syntax.c (m4_syntax_create): Initialize the cache.
1550 (m4__quote_cache): New function.
1551 (m4_set_syntax): Update caller.
1552 * m4/symtab.c (m4_symbol_value_print): Add parameter.
1553 (m4_symbol_print, dump_symbol_CB): Adjust all callers.
1554 * m4/utility.c (m4_dump_args): Delete; callers should use
1555 m4_arg_print instead.
1556 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
1557 implementation, and allow embedded NUL.
1558 (m4_print_token, pop_input, composite_print, composite_peek):
1559 (composite_read, append_quote_token): Adjust all callers.
1560 * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
1562 (m4_arg_print): Add parameters.
1563 (trace_pre): Rewrite in terms of m4_arg_print.
1564 * modules/m4.c (errprint): Likewise.
1565 (m4wrap): Rewrite to allow embedded NUL.
1566 (dumpdef): Adjust caller.
1567 * doc/m4.texinfo (Debuglen): Enhance debuglen test.
1568 * tests/null.m4: Test for NUL in m4wrap.
1569 * tests/null.out: Update expected output.
1571 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
1572 * m4/utility.c (m4_verror_at_line): Properly terminate the string.
1573 Reported by Ralf Wildenhues.
1575 * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
1577 2008-02-19 Eric Blake <ebb9@byu.net>
1579 Clean up example on filtering defined symbols.
1580 * doc/m4.texinfo (Foreach, Improved foreach): Document another
1581 shortcoming in foreach.m4, and improve filter example by using
1584 * src/main.c (usage): Fix typo.
1586 2008-02-18 Eric Blake <ebb9@byu.net>
1588 Avoid some magic numbers.
1589 * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
1590 (CHAR_RETRY): Define in terms of UCHAR_MAX.
1591 * m4/syntax.c (m4_syntax_create, set_syntax_set)
1592 (reset_syntax_set, check_is_single_quotes)
1593 (check_is_single_comments, check_is_macro_escaped)
1594 (m4_set_quotes, m4_set_comment): Likewise.
1595 * modules/gnu.c (regexp_compile): Likewise.
1596 * modules/m4.c (translit): Likewise.
1597 * src/freeze.c (produce_syntax_dump): Likewise.
1598 Reported by Ralf Wildenhues.
1600 2008-02-16 Eric Blake <ebb9@byu.net>
1602 Add regression test for multi-character quote recursion.
1603 * examples/foreach2.m4: Use $0 rather than spelling out name.
1604 * examples/foreachq2.m4: Likewise.
1605 * examples/forloop2.m4: Likewise.
1606 * examples/hanoi.m4: Likewise.
1607 * examples/trace.m4: Likewise.
1608 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1609 (Improved foreach): Adjust dump from file.
1611 Stage 15: return argv refs back to collect_arguments.
1612 Collect an entire $@ reference at once rather than one argument at
1613 a time, outside of quotes (but inside quotes, $@ is still
1614 flattened for now). The skip_last field allows concatenation of
1615 $@ with other text when collecting arguments.
1616 Memory impact: noticeable improvement, due to better reuse of $@.
1617 Speed impact: noticeable improvement, due to less parsing.
1618 * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
1619 (enum m4__token_type): Add M4_TOKEN_ARGV.
1620 (struct m4__symbol_chain): Add skip_last member to argv link.
1621 (m4__next_token): Add parameter.
1622 * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
1623 (composite_peek, m4__next_token): Add new parameter.
1624 (composite_read, append_quote_token): Support argv in quotes.
1625 (init_argv_symbol): New function.
1626 (m4__push_symbol, match_input, consume_syntax)
1627 (m4__next_token_is_open, m4_print_token): Adjust callers.
1628 * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
1629 (arg_mark, m4_arg_text, make_argv_ref): Likewise.
1630 (expand_argument, collect_arguments): Handle new token.
1631 (arg_symbol): Drill through $@ reference.
1632 * m4/syntax.c (set_quote_age): Detect disabled comments.
1633 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
1635 2008-02-15 Eric Blake <ebb9@byu.net>
1637 * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
1639 2008-02-13 Eric Blake <ebb9@byu.net>
1641 Fix texinfo grammar.
1642 * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
1643 (History): Use @: after abbreviations.
1644 (M4exit): Use correct Latin abbreviation.
1645 (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
1648 2008-02-11 Eric Blake <ebb9@byu.net>
1650 Allow builtin text macros to specify number of arguments.
1651 * m4/m4module.h (struct m4_macro): Add argument limits to builtin
1653 * m4/module.c (install_macro_table): Allow text macros to warn on
1655 * modules/gnu.c (m4_macro_table): Update all clients.
1656 * modules/load.c (m4_macro_table): Likewise.
1657 * modules/mpeval.c (m4_macro_table): Likewise.
1658 * modules/perl.c (m4_macro_table): Likewise.
1659 * modules/shadow.c (m4_macro_table): Likewise.
1660 * modules/traditional.c (m4_macro_table): Likewise.
1661 * modules/modtest.c (m4_macro_table): Likewise. Also add text
1662 macros, for testing this.
1663 * doc/m4.texinfo (Standard Modules): Update text, and enhance
1665 * tests/modules.at (modules: text): New test.
1667 Fix regression in command line -D option, from 2006-08-25.
1668 * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
1669 * m4/m4module.h: Fix typo.
1670 * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
1672 * tests/macros.at (Command line define): Enhance test.
1673 * tests/others.at (nul character): Enhance test.
1674 * tests/null.m4: Likewise.
1675 * tests/null.out: Likewise.
1677 Use gnulib's git-merge-changelog driver when available.
1678 * .gitattributes: Add merge attributes for ChangeLog.
1679 * bootstrap: Install driver, if not already present.
1681 2008-02-06 Eric Blake <ebb9@byu.net>
1683 Fix security hole introduced 2007-11-23.
1684 * m4/utility.c (m4_verror_at_line): Properly escape macro names.
1685 * src/main.c (main): Manage quoteargs defaults.
1686 * doc/m4.texinfo (Indir): Document and test this.
1688 Using raw strtod is not portable.
1689 * ltdl/m4/gnulib-cache.m4: Import the strtod module.
1691 2008-02-02 Eric Blake <ebb9@byu.net>
1693 Consistently use size_t for number of arguments.
1694 * m4/m4module.h (m4_builtin_func): Alter prototype.
1695 (struct m4_builtin): Adjust type of min_args, max_args.
1696 (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
1697 (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
1698 (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
1699 (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
1700 (m4_arg_print, m4_push_arg): Adjust all clients.
1701 * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
1702 (m4_macro_args): Adjust type of various fields.
1703 (m4__push_arg_quote): Adjust all clients.
1704 * m4/input.c (m4_pop_wrapup): Likewise.
1705 * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
1706 (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
1707 (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
1708 (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
1709 (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
1710 * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
1711 * modules/evalparse.c (m4_evaluate): Likewise.
1712 * modules/gnu.c (changesyntax): Likewise.
1713 * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
1714 (undivert, traceon, traceoff): Likewise.
1715 * modules/m4.h (m4_dump_symbols_func): Likewise.
1716 * modules/perl.c (perleval): Likewise.
1718 Stage 14b: allow pushing argv references.
1719 Push a $@ reference to the input engine in one go, rather than
1720 pushing each element. For now, argument collection still gets one
1721 argument of a $@ at a time; but the penalties of this patch make
1722 it easier to manage $@ efficiently in future patches.
1723 Memory impact: noticeable penalty, due to larger struct and O(n)
1724 to O(n^2) on unboxed recursion.
1725 Speed impact: noticeable penalty, due to more bookkeeping.
1726 * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
1728 (struct m4_macro_args): Add level field.
1729 (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
1730 * m4/input.c (m4__push_symbol, composite_peek, composite_read)
1731 (composite_unget, composite_clean, composite_print): Support $@
1733 * m4/macro.c (collect_arguments): Populate new field.
1734 (expand_macro): Move argv cleanup...
1735 (m4__arg_adjust_refcount): ...to this new function.
1736 (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
1737 (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
1738 helper functions, to add parameters.
1739 (m4_push_args): Adjust caller.
1740 * m4/symtab.c (m4_symbol_value_print): Likewise.
1742 Stage 14a: allow printing argv references.
1743 Refactor symbol-value printing code for better sharing, and to
1744 allow printing a contiguous text representation of a $@ ref.
1745 Memory impact: none.
1747 * m4/m4module.h (m4_arg_print): New prototype.
1748 (m4_symbol_value_print): Alter prototype.
1749 * m4/input.c (struct input_funcs): Add parameter to peek_func.
1750 (file_peek, builtin_peek, string_peek): Ignore new parameter.
1751 (composite_peek): Ignore new parameter, for now.
1752 (composite_clean, pop_input): Rework to minimize indirection, and
1753 to avoid infinite recursion in next patch.
1754 * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
1755 (m4_arg_print): New function.
1756 * m4/symtab.c (m4_symbol_value_print): Update signature.
1757 (m4_symbol_print): Update caller.
1758 * m4/output.c (m4_shipout_string_trunc): Update comments.
1759 * m4/syntax.c (set_quote_age): Require comma as argument separator
1760 when dealing with $@ as a unit.
1761 * tests/builtins.at (ifelse): Augment test.
1762 * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
1764 2008-01-31 Eric Blake <ebb9@byu.net>
1766 Kill hack for M4 1.4.4.
1767 * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
1768 we require new enough autoconf which in turn requires M4 1.4.5.
1770 2008-01-31 Gary V. Vaughan <gary@gnu.org>
1771 and Eric Blake <ebb9@byu.net>
1773 Depend on new libtool to use non-recursive build.
1774 * configure.ac (LT_PREREQ): Bump to alpha release version.
1775 (LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
1776 installed libtool has correct symbols.
1777 * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
1779 (AM_CPPFLAGS): Drop directories covered by libtool.
1780 (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
1781 (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
1782 macros, used by libtool.
1783 (lib_LTLIBRARIES): Also used by libtool.
1784 (ltdl/libltdlc.la): Delete, now that libtool does this.
1785 * bootstrap: Mention new requirements.
1786 (LIBTOOLIZE): Provide default program, and run libtoolize prior to
1788 (autoreconf): Also neutralize libtoolize, since it is run early.
1789 * HACKING: Mention updated prerequisites.
1791 2008-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1793 Fix build failure if installed libltdl is used.
1794 * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
1796 2008-01-28 Eric Blake <ebb9@byu.net>
1798 Depend on newer autoconf, for testsuite -C dir.
1799 * Makefile.am (CD_TESTDIR): Delete, no longer required.
1800 (check-local, installcheck-local, clean-local-tests): Use new -C
1801 option from autotest.
1802 * configure.ac (AC_PREREQ): Bump to 2.61a.347.
1803 * bootstrap: Mention new dependency.
1804 * HACKING: Likewise.
1806 2008-01-27 Eric Blake <ebb9@byu.net>
1808 Stage 13: push composite text tokens.
1809 Support pushing composite tokens, allowing back-references to be
1810 reused through multiple macro expansions. Add hueristic that
1811 avoids creating new reference when pushing existing references.
1812 Memory impact: noticeable improvement due to better reference
1813 reuse, except for O(n) to O(n^2) copying in boxed recursion.
1814 Speed impact: slight penalty, due to more bookkeeping.
1815 * m4/m4private.h (m4__push_symbol): Adjust prototype.
1816 * m4/input.c (m4__push_symbol): Add parameter, and support
1818 (append_quote_token): Add parameter, and support inlining of short
1820 (m4__next_token): Adjust caller.
1821 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1823 2008-01-26 Eric Blake <ebb9@byu.net>
1825 Stage 12c: add macro for m4_arg_len.
1826 Make a common action easier to type.
1827 Memory impact: none.
1829 * m4/m4module.h (M4ARGLEN): New macro.
1830 * m4/macro.c (process_macro): Adjust all callers.
1831 * m4/utility.c (m4_dump_args): Likewise.
1832 * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1834 * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1835 (renamesyms): Likewise.
1836 * modules/stdlib.c (setenv): Likewise.
1838 Stage 12b: add m4_string_pair.
1839 Make passing quote delimiters around more efficient.
1840 Memory impact: none.
1841 Speed impact: slight penalty, due to more bookkeeping.
1842 * m4/m4module.h (m4_string_pair): New type.
1843 (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1844 (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1846 * m4/m4private.h (struct m4_string): Delete.
1847 (struct m4_syntax_table): Combine quote and comment members.
1848 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1849 (m4_get_syntax_ecomm): Adjust accessors.
1850 (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1852 * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
1854 * m4/input.c (string_print, composite_print, m4_input_print):
1855 All callers updated.
1856 * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
1857 (check_is_single_quotes, m4_set_quotes, set_quote_age)
1858 (m4_get_syntax_lquote, m4_get_syntax_rquote)
1859 (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
1860 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1861 (m4_get_syntax_comments): Likewise.
1862 * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
1863 * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
1865 * modules/m4.c (dumpdef, m4_make_temp): Likewise.
1866 * src/freeze.c (produce_frozen_state): Likewise.
1867 * tests/freeze.at (reloading unknown builtin): Update test.
1869 Stage 12a: make m4_symbol_chain a union.
1870 Shrink size of symbol chains by using a union.
1871 Memory impact: slight improvement, due to smaller struct.
1872 Speed impact: slight improvement, due to less bookkeeping.
1873 * m4/m4private.h (enum m4__symbol_chain_type): New enum.
1874 (struct m4_symbol_chain): Rename...
1875 (struct m4__symbol_chain): ...to this, since it is internal.
1876 * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
1878 * m4/input.c (struct m4_input_block, m4__push_symbol)
1879 (composite_peek, composite_read, composite_unget)
1880 (composite_clean, composite_print, m4__make_text_link)
1881 (append_quote_token): Likewise.
1882 * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
1883 (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
1884 (m4_push_args): Likewise.
1886 2008-01-23 Eric Blake <ebb9@byu.net>
1888 Adjust to recent libtool interface change.
1889 * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
1890 (LT_WITH_LTDL): Delete, now that it is obsolete.
1891 (LTDL_INIT): Use new libtool macro.
1893 2008-01-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1894 and Eric Blake <ebb9@byu.net>
1896 Rely on newer automake.
1897 * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
1899 * bootstrap: Update automake requirement.
1900 (func_version): Fix --version output, broken since 2007-08-06.
1901 * HACKING: Likewise. Add lzma requirement.
1902 * Makefile.am (clean-local-src): Not needed any more with newest
1904 (clean-local): Adjust.
1905 * TODO: Remove completed item.
1907 2008-01-22 Eric Blake <ebb9@byu.net>
1910 * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
1913 2008-01-21 Eric Blake <ebb9@byu.net>
1915 Stage 11: full circle for single argument references.
1916 Pass quoted strings through to argument collection in a single
1917 action, so that an argument can be reused throughout macro
1918 recursion if it remains unchanged.
1919 Memory impact: noticeable improvement, due to more reuse in
1920 argument collection stacks; O(n^2) to O(n) on boxed recursion.
1921 Speed impact: noticeable improvement, due to less copying.
1922 * m4/m4module.h (m4_arg_text): Add parameter.
1924 * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
1925 (m4__make_text_link): New prototype.
1926 (struct m4_symbol_chain): Add quote_age member.
1927 (struct m4_symbol_value): Add end member to chained symbol.
1928 (struct m4_macro_args): Add wrapper member.
1929 * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
1930 (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
1932 * m4/input.c (make_text_link): Rename...
1933 (m4__make_text_link): ...to this, and export.
1934 (m4_push_string_finish): Adjust caller.
1935 (make_text_link, m4__push_symbol): Update new field.
1936 (file_read, builtin_read, string_read, composite_read, next_char):
1938 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1939 (append_quote_token): New function.
1940 (m4__next_token): Pass quoted strings onto argument collection.
1941 (m4_print_token) [DEBUG_INPUT]: Update.
1942 * m4/macro.c (expand_argument): Collect composite arguments.
1943 (collect_arguments): Update new field.
1944 (expand_macro): Reduce ref-count of back-references after use.
1945 (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
1947 (m4_is_arg_text): Also recognize composite symbols as text.
1948 (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
1949 (m4_arg_equal): Compare composite symbols.
1950 (m4_push_arg, m4_push_args): Handle composite symbols.
1951 (m4_arg_symbol): Relax assertion.
1952 (process_macro): Use single-argument references.
1953 * m4/output.c (m4_shipout_string_trunc): Update comment.
1954 * tests/macros.at (Rescanning macros): Augment test.
1956 2008-01-16 Eric Blake <ebb9@byu.net>
1958 Stage 10: avoid extra copying of strings and comments.
1959 When collecting tokens that are immune to further expansion, avoid
1960 copying data from one obstack to another by outputting it into the
1961 destination obstack to begin with. Also reduce copying done in
1963 Memory impact: slight improvement, due to better obstack usage.
1964 Speed impact: noticeable improvement, due less data copying.
1965 * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
1967 * m4/m4private.h (m4__token_type): Adjust prototype.
1968 * m4/input.c (m4__next_token): Support new parameter.
1969 * m4/macro.c (m4_macro_expand_input, expand_token)
1970 (expand_argument, collect_arguments): Adjust callers.
1971 * modules/m4.c (ntoa): Tighten buffer size.
1972 * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
1973 * modules/format.c (arg_int, arg_long, arg_double): New helper
1974 functions, to detect overflow or unparsed characters.
1975 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
1976 missing or excess arguments.
1977 (format): Likewise, and also output directly into obstack if there
1979 * doc/m4.texinfo (History): Update for new year.
1980 (Format): Test for new warnings.
1982 2008-01-15 Eric Blake <ebb9@byu.net>
1984 * TODO: Update with some newer URLs.
1986 Verify linear `index'.
1987 * tests/builtins.at (index): New test.
1988 (translit): Make test take longer, to make quadratic algorithms
1991 2007-12-20 Eric Blake <ebb9@byu.net>
1993 Stage 9: share rather than copy single-arg refs.
1994 Use hooks of previous patch to create back-references to arguments
1995 in the input engine, and inline short text rather than always
1996 creating a FIFO link. Also start testing embedded NUL behavior.
1997 Until the argument collection engine also shares references, the
1998 memory usage increases.
1999 Memory impact: noticeable penalty, due to longer life of argv
2000 changing O(n) to O(n^2) on boxed recursion.
2001 Speed impact: slight improvement, due less data copying.
2002 * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
2003 * m4/m4module.h (m4_arg_scratch): New prototype.
2004 * m4/m4private.h (m4__push_symbol): Add parameter.
2005 (m4_arg_scratch): Add fast accessor.
2006 (struct m4): Add expansion_level member, taken...
2007 * m4/macro.c (expansion_level): ...from here. Adjust all users.
2008 (expand_argument): Minor cleanup.
2009 (expand_macro): Track scratch space per macro call.
2010 (m4_arg_scratch): New function.
2011 (m4_make_argv_ref): Call new function.
2012 (m4_push_arg): Push reference to $0.
2013 (m4_push_args): Rework separator usage, since separators will
2015 (process_macro): Allow embedded NUL.
2016 * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
2017 (m4__push_symbol): Add parameter. Inline short strings, and save
2018 references through rescanning.
2019 * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
2020 * modules/m4.c (errprint, index): Handle NUL transparently.
2021 (dumpdef, translit): Use scratch space, rather than expansion
2023 * modules/gnu.c (renamesyms, m4symbols): Likewise.
2024 * tests/others.at (nul character): New test.
2025 (iso8859): Quote absolute file name, remove XFAIL.
2026 * tests/iso8859.m4: Avoid raw NUL in output.
2027 * tests/null.m4: New file.
2028 * tests/null.out: Likewise.
2029 * tests/null.err: Likewise.
2030 * Makefile.am (OTHER_FILES): Distribute new files.
2031 * .gitattributes: Treat new files as text.
2033 2007-12-17 Eric Blake <ebb9@byu.net>
2035 Stage 8: extend life of references into argv.
2036 Add hooks to lengthen the lifetime of arguments reused in a macro
2037 expansion, rather than always discarding arguments at the end of
2038 expand_macro. Rework the expand_macro obstacks to handle longer
2039 lifetimes. For now, the hooks remain unused.
2040 Memory impact: slight penalty, due to larger structs.
2041 Speed impact: slight penalty, due to more bookkeeping.
2042 * m4/system_.h (obstack_regrow): Delete.
2043 * m4/m4private.h (struct m4_symbol_chain): Add level field.
2044 (m4__push_symbol): Adjust prototype.
2045 (m4__adjust_refcount): New prototype.
2046 (DEBUG_MACRO) [DEBUG]: New debug control.
2047 (struct m4__macro_arg_stacks): New structure.
2048 (struct m4): Add arg_stacks, stacks_count fields.
2049 * m4/m4module.h (m4_make_argv_ref): Add parameter.
2050 * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
2051 context->arg_stacks.
2052 (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
2053 conditional on M4_DEBUG_MACRO envvar.
2054 (collect_arguments): Adjust signature.
2055 (expand_macro): Rework obstack handling.
2056 (m4__adjust_refcount, arg_mark): New functions.
2057 (m4_make_argv_ref): Populate new field.
2058 (m4_push_arg, m4_push_args): Track inuse.
2059 (process_macro): One less cast.
2060 * m4/m4.c (m4_delete): Clean up arg_stacks.
2061 * m4/input.c (make_text_link): Use new field.
2062 (m4__push_symbol, file_clean): Update signature.
2063 (composite_read): Bump refcount when done with reference.
2064 (composite_clean): New function.
2065 (pop_input): Adjust caller.
2066 * m4/debug.c (m4_debug_message): Make assertion match comment.
2067 * modules/gnu.c (builtin, indir): Adjust callers.
2068 * tests/builtins.at (ifelse): New test.
2069 (exp): Move and rename...
2070 * tests/others.at (countdown): ...to this.
2071 * doc/m4.texinfo (Improved foreach): Fix tracing usage in
2074 2007-12-13 Eric Blake <ebb9@byu.net>
2077 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
2082 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2084 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
2086 Reported by Giovanni Toffetti.
2088 2007-12-11 Eric Blake <ebb9@byu.net>
2090 Stage 7: use chained input support in input parser.
2091 Allow the LIFO input engine to rescan a macro expansion composed
2092 of smaller chunks of FIFO data, rather than the old approach of a
2093 monolithic string. For now, all chunks are still copied.
2094 Memory impact: slight penalty, due to FIFO chain overhead.
2095 Speed impact: slight penalty, due to extra bookkeeping.
2096 * m4/m4private.h (m4__push_symbol): New prototype.
2097 (struct m4_symbol_chain): Add const-safety.
2098 * m4/symtab.c (m4_symbol_value_print): Simplify.
2099 (dump_symbol_CB): Update caller.
2100 * m4/input.c (struct m4_input_block): Alter u_c member, first
2101 introduced 2006-10-25, but unused until now.
2102 (composite_peek, composite_read, composite_unget)
2103 (composite_print, init_builtin_token): Rewrite accordingly.
2104 (m4_push_wrapup): No longer need trailing NUL.
2105 (m4__push_symbol, make_text_link): New functions.
2106 (m4_push_string_finish): Use them.
2107 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2108 (expand_macro): Simplify logic of nesting_limit.
2109 * src/main.c (main): Likewise.
2110 * doc/m4.texinfo (Dumpdef): Augment test.
2112 2007-12-08 Eric Blake <ebb9@byu.net>
2114 Stage 6: convert builtins to push arg at a time.
2115 Add new methods to factor all builtins whose expansion includes an
2116 argument, making back-reference creation easier in future patches.
2117 Factor out length-limited printing to obstacks, and use -1 rather
2118 than 0 for unlimited length.
2119 Memory impact: none.
2120 Speed impact: slight improvement, due to better code sharing.
2121 * m4/m4module.h (m4_shipout_text): Rename...
2122 (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
2123 that does not worry about sync lines.
2124 (m4_shipout_string_trunc): New prototype.
2125 * m4/output.c (m4_shipout_text): Rename...
2126 (m4_divert_text): ...to this.
2127 (m4_shipout_string): Move guts...
2128 (m4_shipout_string_trunc): ...to this new function.
2129 * m4/macro.c (m4_push_arg, m4_push_args): New functions.
2130 (expand_token, process_macro): Update callers.
2131 * m4/input.c (string_print): Likewise.
2132 * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
2134 * modules/gnu.c (patsubst): Likewise.
2135 (debuglen): Use SIZE_MAX for unlimited debug length.
2136 * src/main.c (main): Likewise.
2137 * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
2140 2007-12-07 Eric Blake <ebb9@byu.net>
2142 Minor security fix: Quote output of mkstemp.
2143 * modules/m4.c (m4_make_temp): Produce quoted output.
2144 * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
2147 Stage 5: add notion of quote age.
2148 Cache the quoting rules that were in effect when a string was
2149 parsed, to avoid reparsing that string if no changequote or other
2150 quote age change took place in the meantime. A quote_age of 0 is
2151 always safe, but does not benefit from caching.
2152 Memory impact: slight improvement, due to smaller struct in input
2154 Speed impact: slight penalty, due to more bookkeeping.
2155 * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
2156 (m4_set_symbol_value_text): Adjust prototype.
2157 (m4_has_syntax): Factor out the unsigned char cast.
2158 * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
2160 (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
2161 functions at this point.
2162 (struct m4_symbol_value, struct m4_macro_args): Add quote_age
2164 (m4_set_symbol_value_text): Adjust fast accessor.
2165 (m4_get_symbol_value_quote_age): New fast accessor.
2166 * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
2167 (m4_get_symbol_value_quote_age): New function.
2168 (m4_symbol_value_copy): Adjust callers.
2169 * m4/macro.c (expand_token): Add parameter, and track quote age.
2170 (expand_argument, collect_arguments): Track quote age.
2171 (m4_macro_expand_input, process_macro, m4_make_argv_ref)
2172 (m4_macro_expand_input): Update callers.
2173 (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
2174 * m4/input.c: Comment cleanups.
2175 (struct m4_input_block): Reduce size.
2176 (m4__next_token): Report quote age.
2177 (m4_push_builtin, init_builtin_token): Update callers.
2178 * m4/utility.c (skip_space): Adjust callers.
2179 * m4/module.c (install_macro_table): Likewise.
2180 * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
2181 (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
2183 (set_quote_age): New helper function.
2184 (check_is_single_quotes, check_is_single_comments): Adjust
2186 * src/freeze.c (reload_frozen_state): Likewise.
2187 * src/main.c (main): Likewise.
2188 * modules/m4.c (define, pushdef): No need to set macro text.
2189 * tests/builtins.at (changequote, defn): New tests.
2190 * examples/wrapfifo.m4: New file.
2191 * examples/wraplifo.m4: New file.
2192 * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
2194 2007-12-04 Eric Blake <ebb9@byu.net>
2196 Fix builds with OpenBSD make.
2197 * Makefile.am (HELP2MAN): New macro.
2198 (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
2200 * README: Update copyright.
2201 * HACKING: Mention help2man and makeinfo dependencies.
2203 2007-11-29 Eric Blake <ebb9@byu.net>
2205 Stage 4: route indir, builtin through ref; make argv opaque.
2206 Finish making struct opaque to all but the input engine, by
2207 reworking obstack usage in expand_macro to better support creation
2208 of a $@ reference. Canonicalize the empty argument, to allow
2209 pointer comparison optimizations.
2210 Memory impact: slight penalty, due to larger struct.
2211 Speed impact: slight improvement, due to fewer function calls.
2212 * m4/system_.h (obstack_regrow): Fix precedence.
2213 * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
2215 (struct m4_macro_args): Move...
2216 * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
2217 to modules. Add has_ref member.
2218 (bool_bitfield): New helper typedef.
2219 (struct m4_symbol_chain): Add flatten and len members.
2220 * m4/macro.c (empty_symbol): New placeholder, for optimizing
2221 comparison with empty string.
2222 (m4_macro_expand_input): Initialize it.
2223 (collect_arguments): Alter signature, and populate new fields.
2224 (trace_pre, trace_post): Remove redundant parameter.
2225 (expand_macro): Alter handling of obstacks.
2226 (m4_arg_symbol): Account for wrapped argv.
2227 (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
2228 (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
2229 * modules/m4.c (ifelse, syscmd): Likewise.
2230 * modules/evalparse.c (m4_evaluate): Likewise.
2231 (undefine, popdef, m4_dump_symbols): Optimize.
2232 * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
2234 (changesyntax, regexp): Optimize.
2235 * m4/output.c (diversion_storage): Use typedef.
2237 Stage 3b: cache length, rather than computing it, in modules.
2238 Use cached token length in builtins and output engine.
2239 Memory impact: none.
2240 Speed impact: noticeable improvement, due to fewer function calls.
2241 * m4/hash.c (m4_hash_remove): Avoid double free on remove
2243 * m4/output.c (m4_shipout_string): Change semantics of len param.
2244 (m4_shipout_int): Use cached length.
2245 * m4/input.c (m4_push_string_finish): Likewise.
2246 * modules/m4.h (m4_make_temp_func): Add parameter.
2247 * m4/macro.c (expand_token, m4_arg_len): Use cached length.
2248 (collect_arguments, expand_macro): Alter signature.
2249 (trace_format): Don't use out-of-scope buffer.
2250 (process_macro): All callers changed.
2251 * m4/utility.c (m4_dump_args): Likewise.
2252 * m4/symtab.c (m4_symbol_value_print): Likewise.
2253 * modules/gnu.c (__file__, __program__, builtin, indir)
2254 (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
2255 renamesyms, patsubst, regexp, regexp_compile): Likewise.
2256 * modules/load.c (m4modules): Likewise.
2257 * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
2258 (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
2259 * modules/perl.c (perleval): Likewise.
2260 * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
2261 (hostname, uname, setenv): Likewise.
2262 * modules/mpeval.c (numb_obstack): Likewise.
2263 * src/freeze.c (dump_symbol_CB): Likewise.
2264 * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
2265 * tests/builtins.at (mkstemp): Likewise.
2266 * tests/others.at (iso8859): XFAIL this test, now that
2267 length-based handling allows NUL through part but not all of M4.
2269 2007-11-28 Eric Blake <ebb9@byu.net>
2271 Stage 3a: cache length, rather than computing it, in libm4.
2272 Cache the length of a token in the input engine and symbol table,
2273 to avoid repeating lots of strlen calls. Additionally, by using
2274 obstack length rather than strlen, the input engine can now
2275 support embedded NUL.
2276 Memory impact: slight penalty, due to larger struct.
2277 Speed impact: slight improvement, due to fewer function calls.
2278 * m4/m4module.h (struct m4_macro_args): Cache length.
2279 (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2280 (m4_set_symbol_value_text): Change signature.
2281 * m4/m4private.h (struct m4_symbol_value): Store string length.
2282 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2283 (m4_set_symbol_value_placeholder): Update accordingly.
2284 (m4_set_symbol_value_text): Change signature.
2285 (m4_get_symbol_value_len): New accessor.
2286 * m4/input.c (struct m4_input_block, string_peek, string_read)
2287 (string_unget, string_print, m4_push_string_finish)
2288 (m4_push_wrapup): Track length of string input.
2289 (m4__next_token): Adjust all users of symbol text to track length,
2291 * m4/macro.c (expand_argument, collect_arguments): Likewise.
2292 * m4/module.c (install_macro_table): Likewise.
2293 * modules/gnu.c (builtin, indir): Likewise.
2294 * modules/m4.c (define, pushdef): Likewise.
2295 * src/main.c (main): Likewise.
2296 * src/freeze.c (reload_frozen_state): Likewise.
2297 * m4/symtab.c (m4_symbol_value_copy): Likewise.
2298 (m4_get_symbol_value_len): New function.
2299 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2300 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2301 Adjust implementation.
2303 2007-11-27 Eric Blake <ebb9@byu.net>
2305 Stage 2: use accessors, not direct reference, into argv.
2306 Outside of macro.c, use accessor methods rather than direct access
2307 into the argv struct.
2308 Memory impact: none.
2309 Speed impact: slight penalty, due to increased function calls.
2310 * m4/m4private.h (m4_arg_argc): New fast accessor.
2311 * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2312 (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2314 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2315 (m4_macro_call): Make argc unsigned.
2316 (M4ARG): Use new accessors.
2317 * modules/m4.c (define, pushdef): Likewise.
2318 (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2319 (traceon, traceoff): Make argc unsigned.
2320 * modules/m4.h (m4_dump_symbols_func): Likewise.
2321 * modules/evalparse.c (m4_evaluate): Likewise.
2322 * modules/gnu.c (builtin, indir): Use new accessors.
2323 (changesyntax): Make argc unsigned.
2324 * modules/perl.c (perleval): Likewise.
2325 * m4/utility.c (m4_dump_args): Use new accessors.
2326 * m4/macro.c (trace_pre): Likewise.
2327 (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2328 (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2329 (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2332 2007-11-24 Eric Blake <ebb9@byu.net>
2334 Stage 1: convert m4_symbol_value** into new object.
2335 Pass a variable-size wrapper structure instead of an array to
2336 builtins, so that subsequent optimizations in the structure need
2337 not impact every builtin client.
2338 Memory impact: slight penalty, since struct is larger than array.
2339 Speed impact: slight penalty, due to increased bookkeeping.
2340 * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2341 * m4/m4module.h (m4_macro_args): New type, will be opaque to
2343 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2344 (m4_macro_call): Alter signature to use m4_macro_args object.
2345 (M4ARG): Redefine to access new struct.
2346 * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2347 (struct m4_symbol_chain): New type.
2348 (struct m4_symbol_value): Add chain alternative.
2349 * m4/macro.c (collect_arguments): Build new struct.
2350 (expand_macro, m4_macro_call, process_macro, trace_pre)
2351 (trace_post): Adjust implementation to use it.
2352 * m4/utility.c (m4_dump_args): Likewise.
2353 * modules/gnu.c (builtin, indir): Likewise.
2354 * modules/format.c (format): Likewise.
2355 * modules/m4.h (m4_dump_symbols_func): Likewise.
2356 * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2357 (shift, include, errprint, m4wrap): Likewise.
2358 * modules/evalparse.c (m4_evaluate): Likewise.
2360 Pass only macro name to utility functions.
2361 * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2362 * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2364 * m4/macro.c (m4_macro_call): Adjust callers.
2365 * modules/gnu.c (builtin, debuglen): Likewise.
2366 * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2368 * modules/evalparse.c (m4_evaluate): Likewise.
2369 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2370 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2373 2007-11-23 Eric Blake <ebb9@byu.net>
2375 Add macro name to debugfile messages.
2376 * m4/m4module.h (m4_debug_set_output): Add parameter.
2377 * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2379 * modules/gnu.c (debugfile): Adjust caller.
2380 * modules/m4.c (m4exit): Likewise.
2381 * src/main.c (main): Likewise.
2383 Factor out handling of macro name in error messages.
2384 * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2385 (m4_warn_at_line): Add new parameter.
2386 * m4/utility.c (m4_verror_at_line): New helper method.
2387 (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2389 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2391 * m4/debug.c: Likewise.
2392 * m4/input.c: Likewise.
2393 * m4/macro.c: Likewise.
2394 * m4/module.c: Likewise.
2395 * m4/output.c: Likewise.
2396 * m4/path.c: Likewise.
2397 * modules/evalparse.c: Likewise.
2398 * modules/format.c: Likewise.
2399 * modules/gnu.c: Likewise.
2400 * modules/load.c: Likewise.
2401 * modules/m4.c: Likewise.
2402 * modules/mpeval.c: Likewise.
2403 * src/freeze.c: Likewise.
2404 * src/main.c: Likewise.
2406 2007-11-14 Eric Blake <ebb9@byu.net>
2408 Handle some defn corner cases differently.
2409 * doc/m4.texinfo (Defn): Update documentation; although this still
2410 doesn't match the branch, since it may be changed before 2.0.
2411 * m4/macro.c (expand_argument): Consistently ignore builtins in
2412 concatenation contexts.
2413 * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2415 2007-11-13 Eric Blake <ebb9@byu.net>
2417 Note: Patches titled Stage 0 through N form a series of patches
2418 which decreases the algorithmic complexity of tail recursion in
2419 macro expansions from O(n^2) to O(n) in both time and memory, then
2420 performs cleanups, such as handling of embedded NUL, made easier
2421 by the code refactoring.
2423 Stage 0: Fix memory leak in tail recursion.
2424 Free expansion text in the input engine as soon as it is parsed,
2425 rather than when the recursive expansion completes.
2426 Memory impact: noticeable improvement, due to reduction from
2427 O(n^2) to O(n) on recursion.
2428 Speed impact: minor improvement, due to better memory usage.
2429 * m4/input.c (pop_input): Add flag parameter and return type.
2430 (next_char): Adjust caller.
2431 (m4_push_string_init): Let go of memory earlier.
2433 2007-11-07 Eric Blake <ebb9@byu.net>
2435 * tests/macros.at (Rescanning macros): Test more corner cases.
2437 2007-11-06 Eric Blake <ebb9@byu.net>
2439 * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2441 * Makefile.am (tests/package.m4): Work around bash bug.
2442 Reported by Ralf Wildenhues.
2444 2007-11-05 Eric Blake <ebb9@byu.net>
2446 For consistency with other GNU projects, use build-aux directory.
2447 * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2449 * bootstrap (config_aux_dir): Likewise.
2450 * Makefile.am (config_aux_dir): Likewise.
2451 * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2453 2007-11-02 Eric Blake <ebb9@byu.net>
2455 Update some documentation about version control.
2456 * NEWS: M4 is now stored in git.
2457 * HACKING: Likewise.
2459 * bootstrap: Likewise.
2460 * commit: Delete, now that CVS commits are no longer necessary.
2461 * ltdl/config/mailnotify: No longer necessary; git's patch
2462 generation and mail capability is more powerful.
2464 Update to recent gnulib changes.
2465 * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2466 xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2468 2007-11-01 Eric Blake <ebb9@byu.net>
2470 Improve error message when early end of file occurs.
2471 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2472 (M4wrap): Adjust to new messages.
2473 (Improved capitalize): Enhance test.
2474 * m4/m4private.h (m4__next_token): Adjust prototype.
2475 * m4/input.c (m4__next_token): Add new parameter, and improve
2477 * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2479 (expand_argument): Likewise, and add parameter.
2481 2007-10-31 Eric Blake <ebb9@byu.net>
2483 Test more corner cases.
2484 * tests/macros.at (Rescanning macros): Beef up test.
2485 * doc/m4.texinfo (Changecom): Beef up test.
2486 (Improved foreach): Document alternate foreachq style.
2487 * examples/foreachq3.m4: New file.
2488 * examples/loop.m4: New file.
2489 * Makefile.am (dist_pkgdata_DATA): Distribute them.
2491 2007-10-28 Eric Blake <ebb9@byu.net>
2493 More test coverage for autoconf usage patterns.
2494 * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2495 * tests/macros.at (Rescanning macros): New test.
2496 * tests/builtins.at (include): Augment test.
2498 2007-10-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2500 * Makefile.am: Adjust getopt handling to latest gnulib layout.
2502 2007-10-27 Eric Blake <ebb9@byu.net>
2504 Document one use of changequote(`(',`)').
2505 * doc/m4.texinfo (Changequote): Add new test, based on recent
2506 autoconf addition of m4_expand.
2508 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2510 * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2512 2007-10-22 Eric Blake <ebb9@byu.net>
2514 Never let printf failures go undetected.
2515 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2517 * m4/system_.h: Include xprintf.h.
2518 * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2519 use of printf, xprintf.
2520 * m4/input.c [DEBUG_INPUT]: Likewise.
2521 * m4/module.c [DEBUG_MODULES]: Likewise.
2522 * m4/output.c (m4_shipout_text, m4_shipout_int)
2523 (m4_freeze_diversions): Likewise.
2524 * m4/path.c [DEBUG_INCL]: Likewise.
2525 * m4/symtab.c [DEBUG_SYM]: Likewise.
2526 * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2527 * modules/modtest.c (export_test): Likewise.
2528 * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2529 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2531 * src/main.c (usage): Likewise.
2532 * po/POTFILES.in: Adjust to new file.
2533 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2535 2007-10-18 Eric Blake <ebb9@byu.net>
2537 Fix 'm4 -F file -t undefined'.
2538 * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
2539 * src/freeze.c (dump_symbol_CB): Also skip void symbols.
2540 * tests/freeze.at (reloading unknown builtin): Test for this bug.
2541 * m4/m4module.h (m4_symtab_apply): Add parameter.
2542 * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
2544 (m4_symtab_delete, symtab_dump): Adjust callers.
2545 * modules/m4.c (m4_dump_symbols): Likewise.
2547 2007-10-09 Eric Blake <ebb9@byu.net>
2549 Fix regexp regression of 2007-09-29.
2550 * modules/gnu.c (substitute): Allow NULL buf when no
2551 subexpressions were present.
2552 (regexp): Handle \ escapes even with empty regex.
2553 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
2555 Cache regex compilation for another autoconf speedup.
2556 * modules/gnu.c (gnu_buf): Replace...
2557 (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
2558 (m4_pattern_buffer): Add fields.
2559 (m4_regexp_compile): Rename...
2560 (regexp_compile): ...to this, and drop no_sub parameter.
2562 (M4FINISH_HANDLER): Clean up entire cache.
2563 (m4_regexp_search): Rename...
2564 (regex_search): ...to this, adjust to new struct contents, and add
2566 (m4_regexp_substitute): Rename...
2567 (regexp_substitute): ...to this.
2568 (substitute, patsubst, regexp, renamesyms): Adjust callers.
2570 2007-10-02 Eric Blake <ebb9@byu.net>
2572 Document quoting pitfalls in capitalize.
2573 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
2575 (Improved capitalize): New node.
2576 * examples/capitalize.m4: Update to match manual.
2577 * examples/capitalize2.m4: New file.
2579 2007-10-01 Eric Blake <ebb9@byu.net>
2581 Another Autoconf usage pattern optimization.
2582 * modules/m4.c (m4_index): Optimize search for one byte.
2583 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
2586 2007-09-29 Eric Blake <ebb9@byu.net>
2588 Optimize for Autoconf usage pattern.
2589 * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
2591 * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
2593 2007-09-24 Eric Blake <ebb9@byu.net>
2595 Create .gitignore alongside .cvsignore.
2596 * bootstrap (version control): Update to reflect git usage.
2598 2007-09-13 Eric Blake <ebb9@byu.net>
2600 * AUTHORS: Fix typo.
2602 2007-09-12 Gary V. Vaughan <gary@gnu.org>
2604 Be consistent about using 'module' for m4_module types and
2605 'handle' for lt_dlhandle types:
2607 * m4/m4private.h (m4_symbol_value): Rename handle element to
2608 method. Changed all references.
2609 (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
2610 SYMBOL_HANDLE respectively. Changed all references.
2611 * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
2612 * m4/builtin.c (m4_builtin_find_by_name)
2613 (m4_builtin_find_by_func): Use module as the parameter name for
2614 pointers of type 'm4_module'.
2615 * m4/module.c (module_remove, m4_get_module_name)
2616 (install_builtin_table, install_macro_table)
2617 (m4_module_make_resident, m4__module_next, m4_module_refcount):
2619 * src/freeze.c (produce_module_dump): Ditto.
2620 * m4/input.c (m4_input_block): Rename handle element to method.
2621 Changed all references.
2622 * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
2623 * modules/load.c: Use module as the variable name for pointers
2624 of type 'm4_module'.
2625 * modules/m4.c: Ditto.
2626 * modules/perl.c: Ditto.
2627 * modules/shadow.c: Ditto.
2629 2007-09-07 Eric Blake <ebb9@byu.net>
2631 Add refcount builtin.
2632 * modules/load.c (refcount): New builtin.
2633 (m4modules): Use correct type.
2634 * doc/m4.texinfo (Refcount): New section.
2635 * m4/m4private.h (struct m4_module): Add refcount member.
2636 (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
2637 * m4/module.c (m4_module_load): Add symbols to table on first
2638 load by m4, regardless of other libltdl loads of same module.
2639 (m4_module_refcount): Use new struct member, rather than relying
2640 on libltdl count which might be inflated by unrelated loads.
2641 (m4__module_interface): Optimize.
2642 (m4__module_next, m4__module_find): Avoid assertions that could
2643 trigger with unrelated libltdl loads.
2644 (m4__module_open): Track m4 load count.
2645 (m4__module_exit): Only unload what m4 loaded.
2646 (module_remove): Track m4 unloads.
2647 * NEWS: Document new builtin.
2649 More conversion to m4_module*.
2650 * src/freeze.c (produce_module_dump, dump_symbol_CB)
2651 (reload_frozen_state): Use correct type.
2652 * m4/input.c (struct m4_input_block): Likewise.
2653 * m4/symtab.c (dump_symbol_CB): Likewise.
2655 * AUTHORS: Simplify, to match libtool and autoconf layout.
2656 * THANKS: Sync with branch.
2658 2007-09-06 Eric Blake <ebb9@byu.net>
2660 Wrap lt_dlhandle in struct m4_module.
2661 * m4/m4module.h (includes): No longer require clients to know
2663 (m4_module): New opaque declaration.
2664 (m4_export): Delete unused type.
2665 (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
2666 (m4_module_finish_func, m4_module_load, m4_get_module_name)
2667 (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
2669 (m4_module_makeresident, m4_module_refcount): New declarations.
2670 * m4/m4private.h (includes): Move <ltdl.h> here.
2671 (m4_module): New declaration. Simple for now, but intended for
2673 (m4__module_open, m4__module_next, m4__module_find)
2674 (m4__symtab_remove_module_references): Use new wrapper.
2675 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2677 * m4/module.c (m4_get_module_name, m4_module_import)
2678 (m4_module_load): Likewise.
2679 (install_builtin_table, install_macro_table): Likewise. Also,
2680 change return type since these always returned NULL and no one
2682 (m4_module_makeresident, m4_module_refcount): New functions.
2683 (m4_module_unload, m4__module_next, m4__module_find): Use new
2685 (m4__module_open): Populate new wrapper, and associate it with the
2687 (m4__module_exit): Use new wrapper.
2688 (module_remove): Likewise. Reclaim storage on last use.
2689 (module_close): Delete, and inline into module_remove.
2690 * m4/symtab.c (m4__symtab_remove_module_references): Use new
2692 * modules/load.c (load_init): Use new API.
2693 * modules/m4.c (m4_export_table): Kill unused declaration.
2694 (m4_init): Use new API.
2695 * modules/shadow.c (shadow_init): Use new API.
2696 * src/main.c (main): Adjust callers.
2697 * src/freeze.c (reload_frozen_state): Likewise.
2698 * tests/modules.at (unload load module): New test.
2700 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2702 * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
2703 * src/m4/.cvsignore: Add xstrtol module sources.
2705 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2707 Work around a bug in darwin's awk:
2709 * bootstrap (func_get_translations): Use $AWK instead of raw
2710 `awk' so that the user can use an alternative implementation
2711 if the first awk in PATH doesn't behave as expected.
2712 (func_get_translations): The first awk script mangles the last
2713 entry passed to it for at least the awk implementation shipped
2714 with Darwin 8.10.1. Capture $3 into a variable too to work-
2715 around that problem.
2717 2007-08-29 Gary V. Vaughan <gary@gnu.org>
2719 As gnulib xstrtol is only used by main, and unconditionally pulls
2720 in a copy of getopt, undo bootstrap change from 2007-08-11 below,
2721 and copy the xstrtol code into src/ so that main() can use it
2722 without pushing the extra code into libm4:
2724 * bootstrap (src_modules): Add getopt and xstrtol modules.
2725 * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
2726 * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
2728 2007-08-11 Eric Blake <ebb9@byu.net>
2730 Another upstream xstrtol change.
2731 * po/POTFILES.in: Track changes in files containing messages.
2732 * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
2733 need to grab it separately.
2734 * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2736 (size_opt): Adjust to latest xstrtol interface.
2738 2007-08-10 Eric Blake <ebb9@byu.net>
2740 Documentation improvements.
2741 * doc/m4.texinfo (Defn): Resync with branch.
2742 (Compatibility, Extensions): Sync with branch.
2744 2007-08-07 Eric Blake <ebb9@byu.net>
2746 Adjust to gnulib xstrtol changes.
2747 * src/main.c (size_opt): Adjust signature, so that error strings
2748 are easier to translate.
2749 (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
2750 for tracking long options.
2751 (main): Track which long option was used.
2752 * tests/options.at (--debuglen, --nesting-limit): Adjust to change
2754 (deprecated options): Test that --arglength spelling shows up in
2757 2007-08-06 Eric Blake <ebb9@byu.net>
2759 Normalize all GPL license notices.
2760 * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
2762 * Makefile.am: Update license wording.
2763 * bootstrap: Likewise.
2765 * configure.ac: Likewise.
2766 * ltdl/config/mailnotify: Likewise.
2767 * ltdl/config/mkstamp: Likewise.
2768 * ltdl/m4/debug.m4: Likewise.
2769 * ltdl/m4/gmp.m4: Likewise.
2770 * ltdl/m4/m4-error.m4: Likewise.
2771 * ltdl/m4/m4-getopt.m4: Likewise.
2772 * ltdl/m4/m4-gettext.m4: Likewise.
2773 * ltdl/m4/m4-obstack.m4: Likewise.
2774 * ltdl/m4/m4-regex.m4: Likewise.
2775 * ltdl/m4/stackovf.m4: Likewise.
2776 * m4/builtin.c: Likewise.
2777 * m4/debug.c: Likewise.
2778 * m4/hash.c: Likewise.
2779 * m4/hash.h: Likewise.
2780 * m4/input.c: Likewise.
2781 * m4/m4.c: Likewise.
2782 * m4/m4module.h: Likewise.
2783 * m4/m4private.h: Likewise.
2784 * m4/macro.c: Likewise.
2785 * m4/module.c: Likewise.
2786 * m4/output.c: Likewise.
2787 * m4/path.c: Likewise.
2788 * m4/resyntax.c: Likewise.
2789 * m4/symtab.c: Likewise.
2790 * m4/syntax.c: Likewise.
2791 * m4/system_.h: Likewise.
2792 * m4/utility.c: Likewise.
2793 * modules/evalparse.c: Likewise.
2794 * modules/format.c: Likewise.
2795 * modules/gnu.c: Likewise.
2796 * modules/import.c: Likewise.
2797 * modules/load.c: Likewise.
2798 * modules/m4.c: Likewise.
2799 * modules/m4.h: Likewise.
2800 * modules/modtest.c: Likewise.
2801 * modules/mpeval.c: Likewise.
2802 * modules/perl.c: Likewise.
2803 * modules/shadow.c: Likewise.
2804 * modules/stdlib.c: Likewise.
2805 * modules/time.c: Likewise.
2806 * modules/traditional.c: Likewise.
2807 * po/Makevars: Likewise.
2808 * src/freeze.c: Likewise.
2809 * src/m4.h: Likewise.
2810 * src/main.c: Likewise.
2811 * src/stackovf.c: Likewise.
2812 * tests/builtins.at: Likewise.
2813 * tests/freeze.at: Likewise.
2814 * tests/generate.awk: Likewise.
2815 * tests/m4.in: Likewise.
2816 * tests/macros.at: Likewise.
2817 * tests/modules.at: Likewise.
2818 * tests/options.at: Likewise.
2819 * tests/others.at: Likewise.
2820 * tests/stackovf.test: Likewise.
2821 * tests/testsuite.at: Likewise.
2823 2007-07-22 Eric Blake <ebb9@byu.net>
2825 Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2826 * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2827 * tests/builtins.at (divert): Enhance test to cover this.
2829 Reported by Thomas Klausner.
2831 2007-07-20 Eric Blake <ebb9@byu.net>
2833 Fix 'make distcheck' issues.
2834 * bootstrap: Add more files that might be more up-to-date in
2836 * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2837 * config/m4/gnulib-cache.m4: Update to latest gnulib.
2839 2007-07-16 Eric Blake <ebb9@byu.net>
2841 * po/POTFILES.in: Track recent translation additions from gnulib
2844 2007-07-14 Eric Blake <ebb9@byu.net>
2846 Reflect upstream license .texi changes.
2847 * doc/m4.texinfo (Copying): Rename node...
2848 (GNU General Public License): ...to this.
2849 (GNU Free Documentation License): Adjust node location.
2850 * local/doc/gpl-3.0.texi.diff: Remove file.
2852 2007-07-10 Eric Blake <ebb9@byu.net>
2854 Upgrade to GPLv3, and document 1.4.10.
2855 * bootstrap: Adjust to GPLv3.
2856 (func_update): Port from branch.
2857 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2858 --local-dir=local --import gpl-3.0'.
2859 * doc/m4.texinfo (History): Mention 1.4.11.
2860 (Copying This Package): New appendix.
2861 * NEWS: Document 1.4.10.
2862 * local/doc/gpl-3.0.texi.diff: New file.
2863 * Makefile.am: Update license.
2864 (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
2865 * commit: Update license.
2866 * configure.ac: Likewise.
2867 * ltdl/config/mailnotify: Likewise.
2868 * ltdl/config/mkstamp: Likewise.
2869 * ltdl/m4/debug.m4: Likewise.
2870 * ltdl/m4/gmp.m4: Likewise.
2871 * ltdl/m4/m4-error.m4: Likewise.
2872 * ltdl/m4/m4-getopt.m4: Likewise.
2873 * ltdl/m4/m4-gettext.m4: Likewise.
2874 * ltdl/m4/m4-obstack.m4: Likewise.
2875 * ltdl/m4/m4-regex.m4: Likewise.
2876 * ltdl/m4/stackovf.m4: Likewise.
2877 * m4/builtin.c: Likewise.
2878 * m4/debug.c: Likewise.
2879 * m4/hash.c: Likewise.
2880 * m4/hash.h: Likewise.
2881 * m4/input.c: Likewise.
2882 * m4/m4.c: Likewise.
2883 * m4/m4module.h: Likewise.
2884 * m4/m4private.h: Likewise.
2885 * m4/macro.c: Likewise.
2886 * m4/module.c: Likewise.
2887 * m4/output.c: Likewise.
2888 * m4/path.c: Likewise.
2889 * m4/resyntax.c: Likewise.
2890 * m4/symtab.c: Likewise.
2891 * m4/syntax.c: Likewise.
2892 * m4/system_.h: Likewise.
2893 * m4/utility.c: Likewise.
2894 * modules/evalparse.c: Likewise.
2895 * modules/format.c: Likewise.
2896 * modules/gnu.c: Likewise.
2897 * modules/import.c: Likewise.
2898 * modules/load.c: Likewise.
2899 * modules/m4.c: Likewise.
2900 * modules/m4.h: Likewise.
2901 * modules/modtest.c: Likewise.
2902 * modules/mpeval.c: Likewise.
2903 * modules/perl.c: Likewise.
2904 * modules/shadow.c: Likewise.
2905 * modules/stdlib.c: Likewise.
2906 * modules/time.c: Likewise.
2907 * modules/traditional.c: Likewise.
2908 * po/Makevars: Likewise.
2909 * src/freeze.c: Likewise.
2910 * src/m4.h: Likewise.
2911 * src/main.c: Likewise.
2912 * src/stackovf.c: Likewise.
2913 * tests/builtins.at: Likewise.
2914 * tests/freeze.at: Likewise.
2915 * tests/generate.awk: Likewise.
2916 * tests/m4.in: Likewise.
2917 * tests/macros.at: Likewise.
2918 * tests/modules.at: Likewise.
2919 * tests/options.at: Likewise.
2920 * tests/others.at: Likewise.
2921 * tests/stackovf.test: Likewise.
2922 * tests/testsuite.at: Likewise.
2924 2007-07-09 Eric Blake <ebb9@byu.net>
2926 * modules/format.c (format): Avoid undefined behavior with %c.
2928 2007-07-01 Gary V. Vaughan <gary@gnu.org>
2930 The translation project has moved.
2931 * bootstrap (func_get_translations): Use the new translation
2935 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
2937 Match Free Software Directory categories.
2938 * doc/m4.texinfo (dircategory): Update.
2940 2007-05-31 Eric Blake <ebb9@byu.net>
2942 Add extension to divert builtin.
2943 * modules/m4.c (builtin_divert): Immediately divert second
2945 * m4/output.c (m4_output_text): Allow 0 length. Fixes regression
2947 (m4_shipout_text): Short-circuit on zero length.
2948 * tests/freeze.at (loading format 2): Expand test to catch
2949 regression. Also check out-of-range version.
2950 * tests/builtins.at (divert): Expand test to check corner cases
2952 * doc/m4.texinfo (Divert): Document the extension.
2954 Reported by Daniel Richard G.
2956 2007-05-30 Eric Blake <ebb9@byu.net>
2958 Port format improvements from branch.
2959 * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
2960 (Format): Enhance section.
2961 * modules/format.c (format): Accept %'hhd, and issue warnings on
2962 unrecognized specifiers.
2963 * modules/gnu.c (builtin_format): Adjust how format is called.
2965 2007-05-28 Eric Blake <ebb9@byu.net>
2967 * tests/options.at (--syncoutput): Add xfailed test.
2969 Fix sync line interaction with multiline comments.
2970 * doc/m4.texinfo (Preprocessor features): Improve documentation.
2971 (Syncoutput): Improve testsuite.
2972 (Incompatibilities): Add testcase, and document bug.
2973 * src/freeze.c (reload_frozen_state): Don't interfere with
2974 synclines when reloading state.
2975 * m4/input.c (m4__next_token): Report line where multiline tokens
2977 * m4/m4private.h (m4__token_type): Add parameter.
2978 * m4/m4module.h (m4_output_text): Export.
2979 (m4_shipout_text): Add parameter.
2980 * src/macro.c (m4_macro_expand_input, expand_token)
2981 (expand_argument): Adjust callers so that line is passed from
2983 * m4/output.c (output_text): Rename...
2984 (m4_output_text): ...to this, and export.
2985 (m4_insert_file, insert_diversion_helper): Update callers.
2986 (m4_shipout_text): Take new parameter for start line of token.
2987 Output at most one syncline per token.
2988 Reported by Sergey Poznyakoff.
2990 Fix large diversion corner cases.
2991 * tests/freeze.at (large diversion): New test.
2992 * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
2993 (make_room_for): Use NULL, not 0, for pointers.
2994 (m4_freeze_diversions): Allow freezing large diversions.
2995 (insert_diversion_helper): Avoid using rewind.
2997 Also run gnulib unit tests during make check.
2998 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2999 --tests-base=tests/gnu --with-tests'.
3000 * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
3001 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
3003 2007-05-25 Eric Blake <ebb9@byu.net>
3005 * m4/system_.h: Include <stdint.h>, for intmax_t.
3007 Reported by Daniel Richard G.
3009 2007-05-24 Eric Blake <ebb9@byu.net>
3011 Provide consistent shift semantics regardless of hardware.
3012 * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
3014 (number, unumber): Always use [u]intmax_t.
3015 Reported by Gary V. Vaughan.
3017 Support POSIX flush semantics on all platforms.
3018 * modules/m4.c (m4_sysval_flush): Rely on gnulib.
3019 * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
3021 Work around cygwin and mingw fseeko bugs.
3022 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3024 * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
3026 2007-04-25 Eric Blake <ebb9@byu.net>
3028 Test that regression in 1.4.9's eval doesn't recur.
3029 * doc/m4.texinfo (Eval): Check negative division.
3032 2007-04-12 Eric Blake <ebb9@byu.net>
3034 Allow for running test in sticky or setgid directory.
3035 * tests/builtins.at (mkdtemp): Adjust test.
3037 Don't test for broken sed too soon.
3038 * tests/others.at (stdin seekable): Rearrange subtests.
3040 Work around 'stdin seekable' shortcoming on glibc.
3041 * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
3042 * tests/others.at (stdin closed): Adjust to new output.
3043 * src/main.c (process_file): No need to return anything.
3044 (main): Use close_stdin instead of close_stdout.
3045 Reported by Ralf Wildenhues.
3047 Enable autobuild usage.
3048 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3050 * configure.ac (AB_INIT): Output autobuild information.
3052 2007-04-11 Eric Blake <ebb9@byu.net>
3054 Address testsuite shortcoming in 'stdout full' on glibc.
3055 * tests/others.at (stdout full): Adjust expected output when more
3056 than 1k text is printed to /dev/full.
3057 Reported by Ralf Wildenhues.
3059 2007-04-10 Eric Blake <ebb9@byu.net>
3061 * tests/macros.at (Arity and defn): Fix quoting.
3063 2007-04-09 Eric Blake <ebb9@byu.net>
3065 Address failure of 'seekable stdin' on Mac OS X.
3066 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3069 2007-04-07 Eric Blake <ebb9@byu.net>
3071 Include <config.h> first in all C files, and not in headers.
3072 Fixes regression for --disable-assert builds from 2007-04-02.
3073 * src/m4.h (includes): Don't include config.h here.
3074 * m4/m4private.h (includes): Likewise.
3075 * m4/builtin.c: Include config.h before anything else.
3076 * m4/debug.c: Likewise.
3077 * m4/hash.c: Likewise.
3078 * m4/input.c: Likewise.
3079 * m4/m4.c: Likewise.
3080 * m4/macro.c: Likewise.
3081 * m4/module.c: Likewise.
3082 * m4/symtab.c: Likewise.
3083 * m4/syntax.c: Likewise.
3084 * m4/utility.c: Likewise.
3085 * src/freeze.c: Likewise.
3086 * src/stackovf.c: Likewise.
3088 2007-04-03 Eric Blake <ebb9@byu.net>
3090 * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
3091 SIGFPE on x86 architectures.
3092 Reported by Ralf Wildenhues.
3094 2007-04-02 Eric Blake <ebb9@byu.net>
3096 Fix warnings from last commit.
3097 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3098 fprintf-posix sprintf-posix'.
3099 * m4/macro.c (expand_macro, trace_format): Use correct specifier
3101 (process_macro): Avoid negative array index.
3102 * src/freeze.c (produce_resyntax_dump, produce_module_dump)
3103 (dump_symbol_CB, produce_frozen_state): Use correct specifier for
3106 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3108 Get rid of the last 'differs in signedness' compiler warnings:
3110 * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
3111 a regular 'char *', so variables to store the return address,
3112 and iterate through it should be regular 'char *' too.
3113 * m4/input.c (m4_input_block): The start and current members of
3114 the string part of this union store regular 'char *' types, so
3115 they should be regular 'char *' types too.
3117 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3119 M4 was designed to have a small number of header files defining
3120 the interfaces to several source files each. Keeping this in
3121 mind allows us to tidy things up considerably. Having done this,
3122 it becomes clear that some of the installed headers reference
3123 other headers which are not installed (but that's another patch):
3125 * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
3127 * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
3128 ...to here, so client modules can benefit too.
3129 (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
3130 lowest level to save doing it multiple times elsewhere.
3131 * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
3132 is already included via m4private.h.
3133 * modules/time.c (stdio.h): Ditto.
3134 * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
3135 * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
3136 and <gnu/unistd--.h>,
3137 * m4/m4private.h (m4module.h): Use angle brackets for an installed
3139 * m4/hash.h (system.h): Ditto.
3140 * modules/gnu.c (progname.h): Removed.
3141 * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
3142 * m4/m4private.h (assert.h, errno.h): Already included via
3144 * m4/input.c (ctype.h): Ditto.
3145 * m4/module.c (ltdl.h): Ditto.
3146 * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
3148 * m4/path.c (config.h, stdlib.h): Ditto.
3149 * m4/utility.c (config.h): Ditto.
3150 * modules/evalparse.c (assert.h, ctype.h): Ditto.
3151 * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
3152 * modules/import.c (assert.h): Ditto.
3153 * modules/m4.c (assert.h, errno.h): Ditto.
3154 * modules/modtest.c (assert.h): Ditto.
3155 * modules/stdlib.c (sys/types.h): DittAo.
3156 * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
3158 * src/stackovf.c (assert.h): Ditto.
3159 * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
3160 private interfaces when NDEBUG is defined.
3161 * modules/import.c (m4/m4module.h, m4private.h): Ditto.
3162 * modules/load.c (m4/m4module.h, m4private.h): Ditto.
3163 * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
3164 * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
3165 * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
3166 * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
3167 * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
3168 * modules/time.c (m4/m4module.h, m4private.h): Ditto.
3169 * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
3170 * src/m4.h (locale.h): Moved from here...
3171 * src/main.h: ...to here.
3172 (m4private.h): Already included via m4.h.
3173 * src/stackovf.c (m4private.h): Ditto.
3175 2007-03-28 Gary V. Vaughan <gary@gnu.org>
3177 * Makefile.am (stamp-vcl): Removed.
3178 (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
3180 2007-03-28 Eric Blake <ebb9@byu.net>
3182 * src/main.c (usage): Improve note to TRANSLATORS.
3183 * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
3185 * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
3188 2007-03-24 Eric Blake <ebb9@byu.net>
3190 * m4/output.c (m4_output_init): Update to latest gnulib.
3191 * bootstrap (ltdl/m4/.cvsignore): No longer track generated
3193 * NEWS: Reflect release of 1.4.9.
3196 2007-03-07 Eric Blake <ebb9@byu.net>
3200 Exercise gnulib's new POSIX *printf modules.
3201 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3203 * modules/format.c (format): Support %a and %A.
3204 * doc/m4.texinfo (Format): Test this addition.
3205 * NEWS: Document this addition.
3207 2007-03-03 Eric Blake <ebb9@byu.net>
3209 * m4/input.c (m4__next_token): Fix synclines when in batch mode.
3210 * doc/m4.texinfo (M4exit): Synch another section.
3211 (Syncoutput): Make similar to other sections.
3213 2007-03-01 Eric Blake <ebb9@byu.net>
3215 * doc/m4.texinfo: Improve the indices.
3216 (Concept index): Rearrange to be last.
3217 (Sysval): Merge from branch.
3219 * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
3221 2007-02-28 Eric Blake <ebb9@byu.net>
3223 POSIX XCU ERN 137 was approved.
3224 * modules/mpeval.c (numb_extension): Delete.
3225 * modules/m4.c (numb_extension): Likewise.
3226 * modules/evalparse.c (comma_term, condition_term): Always
3227 implement ?: and , operators.
3228 * m4/symtab.c: Update comment to match reality.
3229 * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
3230 dereferencing context directly when accessor exists.
3231 * src/main.c (usage): Prefer GNU_M4 over EMACS.
3232 (struct macro_definition): Rename...
3233 (struct deferred): ...to match usage. All uses changed.
3234 * doc/m4.texinfo (Eval): Document this change.
3235 (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
3237 (Preprocessor features, Changesyntax): Fix inaccuracies.
3238 * NEWS: Import branch NEWS items for 1.4.x series. Document
3241 POSIX XCU ERN 118 was approved.
3242 * modules/m4.c (define): Kill posixly_correct distinction in
3243 define behavior, since POSIX says GNU behavior complies.
3244 * tests/builtins.at (define): Restore original semantics.
3245 * doc/m4.texinfo (Pushdef): Document portability issues with
3247 (Incompatibilities): Clean up wording of what POSIX requires.
3248 * NEWS: Document this.
3250 2007-02-26 Eric Blake <ebb9@byu.net>
3252 Re-enable clean bootstrap on cygwin.
3253 * Makefile.am (AM_LDFLAGS): For now, export all symbols from
3254 modules, since otherwise we run afoul of current libtool
3255 limitations on cygwin and mingw.
3257 2007-02-25 M. Levinson <levinsm@users.sourceforge.net> (tiny change)
3259 * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
3260 memory. Fixes regression introduced 2007-01-20.
3262 2007-02-25 Eric Blake <ebb9@byu.net>
3264 * tests/freeze.at (loading format 2): Augment test to catch
3265 regression introduced on 2007-01-20.
3267 Reported by M. Levinson.
3269 * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3272 2007-02-05 Eric Blake <ebb9@byu.net>
3274 * tests/options.at (--fatal-warnings): New test.
3275 * tests/others.at (stdin seekable): Exit on error.
3276 * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3277 (m4_get_warnings_exit_opt): Access it.
3278 * m4/m4module.h (m4_context_opt_bit_table): Access it.
3279 * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3281 (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3283 * src/m4.c (usage): Document new -E behavior.
3284 (main): Make -E an additive option.
3285 * doc/m4.texinfo (Operation modes): Document the change.
3286 Reported by Ralf Wildenhues.
3288 * tests/others.at (stdin seekable): Fix bug in test.
3289 * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3291 * m4/input.c (struct m4_input_block): Remove unused field traced.
3293 2007-02-03 Eric Blake <ebb9@byu.net>
3294 and Bruno Haible <bruno@clisp.org> (tiny change)
3296 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3298 Reported by Bruno Haible.
3300 2007-01-31 Eric Blake <ebb9@byu.net>
3302 * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3305 2007-01-26 Eric Blake <ebb9@byu.net>
3307 * m4/symtab.c (includes): Adjust to latest gnulib.
3308 * modules/m4.c (includes): Likewise.
3310 2007-01-23 Eric Blake <ebb9@byu.net>
3312 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3313 extension to make enough room.
3314 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3315 code in input.c special cases this category.
3316 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3317 for define(eleventh,${11}) extension.
3318 * m4/syntax.c: Update comments accordingly.
3319 (m4_syntax_create, m4_syntax_code): Handle { and }.
3320 * m4/input.c (m4__next_token): Likewise.
3321 * src/freeze.c (produce_frozen_state): Support new categories.
3322 (reload_frozen_state): When loading version 1, disable syntax
3323 features not present in 1.4.x.
3324 * tests/freeze.at: Sort and rename existing tests.
3325 (loading format 1): Ensure we don't break v1 frozen files that
3327 (loading format 2, reloading changecom, reloading changesyntax):
3329 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3330 the new syntax categories.
3331 (Arguments): Update the FIXME comment.
3332 (M4wrap): Merge examples from branch, before worrying about fixing
3333 m4wrap to obey POSIX.
3334 (Using frozen files): Start merging from branch.
3337 2007-01-20 Eric Blake <ebb9@byu.net>
3339 * src/freeze.c (produce_char_dump): Delete. Replace with...
3340 (produce_mem_dump): ...this new function, to encode more strings.
3341 Also make the coding easier to read and slightly more compact.
3342 (produce_syntax_dump): Only dump non-default syntax codes.
3343 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3344 Encode non-ASCII characters in user-supplied strings.
3345 (GET_STRING): Accept escape sequences in version 2.
3346 * NEWS: Document this change.
3349 2007-01-16 Eric Blake <ebb9@byu.net>
3351 Port patch from branch for stack overflow detection on BSD/OS.
3352 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3353 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3354 ! HAVE_STACK_T_SS_SP]: Use this check.
3355 Reported by Chris McGuire.
3357 2007-01-15 Eric Blake <ebb9@byu.net>
3359 * tests/builtins.at (__m4_version__): New test.
3360 * modules/traditional.c (m4_macro_table): Provide windows and os2
3361 macros, as appropriate. Add __traditional__ macro.
3362 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3363 not __gmp__, to match module name.
3364 * modules/load.c (m4_macro_table): Name the macro __load__, not
3365 __modules__, to match module name.
3366 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3368 (Standard Modules): Improve wording.
3369 (Incompatibilities): Move platform macros into their own node.
3370 (Load, Unload): Use actual examples.
3371 * NEWS: Document this change.
3374 2007-01-13 Eric Blake <ebb9@byu.net>
3376 * doc/m4.texinfo (Mpeval): Add tests.
3377 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3378 * tests/builtins.at (gmp): ...here. Rename test to...
3380 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3382 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3383 no_gnu_extensions with posixly_correct_opt, since they were set in
3385 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3386 * src/main.c (main): Update caller.
3387 * src/freeze.c (reload_frozen_state): Likewise.
3388 * modules/m4.c (m4wrap): Likewise.
3390 2007-01-12 Eric Blake <ebb9@byu.net>
3392 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3393 POSIX, so update the comment.
3394 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3395 approved by POSIX, so we can always have blind macros, even when
3397 (Ifelse): Mention the term `blind builtin'.
3399 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3401 * doc/m4.texinfo: Fix a couple of typos.
3403 2007-01-08 Eric Blake <ebb9@byu.net>
3405 * ltdl/m4/gnulib-cache.m4: Update for new year.
3406 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3407 Reported by Ralf Wildenhues.
3409 2007-01-06 Eric Blake <ebb9@byu.net>
3411 * m4/m4private.h (to_uchar): Move...
3412 * m4/m4module.h: here, so modules can use it.
3413 * src/main.c (usage, long_options): Support --posix as a synonym
3415 * modules/m4.c (numb_invert): Detect unsupported x**-y.
3416 (numb_incr, numb_urshift, numb_extension): New macros.
3417 (numb_obstack): Port patch from branch to support radix 1 output.
3418 * modules/mpeval.c (numb_obstack): Use \ for ratios.
3419 (numb_incr, numb_urshift, numb_extension): New macros.
3420 (mpq2mpz): Warn rather than error.
3421 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3423 (eval_error): Rearrange, so that all ignorable errors are less
3425 (eval_text, last_text): Obey C++ type safety rules.
3426 (numb_pow): Change return type.
3427 (exp_term): Adjust caller.
3428 (m4_evaluate): Fail on bad exponent.
3429 (logical_or_term, logical_and_term): Ignore failed ** in short
3431 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
3432 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
3433 to parse radix 1 numbers.
3434 (condition_term, comma_term): New parse functions.
3435 (shift_term): Support >>>.
3436 (m4_evaluate): Port patch from branch to output radix 1 numbers.
3437 Warn instead of error for most parse problems.
3438 * doc/m4.texinfo (Limits control, Eval): Document these changes.
3439 * NEWS: Document new operators and new command line option.
3441 2007-01-04 Eric Blake <ebb9@byu.net>
3443 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3445 2007-01-03 Eric Blake <ebb9@byu.net>
3447 * doc/m4.texinfo (Format, Incr): More merges.
3448 (Eval): Ensure C precedence rules are met.
3449 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3450 (not_term, logical_not_term): Delete; these are same precedence
3451 as other unary operators.
3452 (equality_term): New; these are lower precedence than relational
3454 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3455 operators for better error messages.
3456 (logical_or_term, logical_and_term): Short-circuit out the error
3457 of division by zero.
3458 (unary_term): Allow consecutive unary operators.
3459 * modules/m4.c (int2numb, numb2int): Delete; these potentially
3461 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3462 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3463 * NEWS: Document this change.
3465 2006-12-27 Eric Blake <ebb9@byu.net>
3467 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3469 * modules/m4.c (substr): Merge from branch.
3471 2006-12-26 Eric Blake <ebb9@byu.net>
3473 * doc/m4.texinfo (Changesyntax): Check for regressions with
3474 changesyntax(W=...).
3476 2006-12-22 Eric Blake <ebb9@byu.net>
3478 * m4/m4module.h (m4_set_syntax): Change signature.
3479 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3481 (changesyntax): Likewise, and update caller.
3482 * m4/m4private.h (m4_syntax_table): Add orig member.
3483 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3484 Don't set is_single_quotes and is_single_comments when the begin
3485 character is shadowed by another syntax type.
3486 (m4_syntax_create): Populate default syntax table.
3487 (add_syntax_attribute): Don't lose quote assignment.
3488 (remove_syntax_attribute): Only allow removing rquote or ecomm.
3489 (add_syntax_set, subtract_syntax_set, set_syntax_set)
3490 (reset_syntax_set): New helper routines.
3491 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3492 to default, and empty chars reverts that key to default.
3493 (check_is_single_quotes, check_is_single_comments): New helper
3495 * modules/m4.c (changecom): Merge from branch.
3496 * m4/input.c (m4__next_token): Rearrange token recognition order
3497 to macro, quote, comment, in order to match traditional
3499 * src/freeze.c (reload_frozen_state): Update caller.
3500 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3502 (Changeresyntax): Revise to match style of surrounding sections
3503 and add more examples.
3504 (Changesyntax): Likewise, and update to new semantics.
3505 * NEWS: Document this change.
3507 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3508 (M4wrap, Eval, Errprint): Fix typos.
3509 (Divnum): Not necessary to redivert in example.
3511 2006-12-21 Eric Blake <ebb9@byu.net>
3513 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3516 2006-12-19 Eric Blake <ebb9@byu.net>
3518 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3519 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3520 can track write errors without all other callers warning multiple
3522 (sysval_flush_helper): New function.
3523 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3524 * modules/gnu.c (esyscmd): Likewise.
3525 * tests/others.at (stdout closed, stdout full): Error message
3528 2006-12-16 Eric Blake <ebb9@byu.net>
3530 * src/main.c: Fix missing include.
3532 * src/main.c (main): Check for errors when closing stdin.
3533 * modules/m4.c (m4exit): Missed part of previous patch: flush
3534 stdin before a successful exit.
3535 Reported by Ralf Wildenhues.
3537 2006-12-14 Eric Blake <ebb9@byu.net>
3539 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
3541 * tests/others.at (stdin seekable): New test.
3543 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3545 * doc/m4.texinfo: Fix some typos.
3547 2006-12-04 Eric Blake <ebb9@byu.net>
3549 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
3551 (Modules): Make style consistent.
3553 2006-11-16 Eric Blake <ebb9@byu.net>
3555 * bootstrap: Relax m4 requirement, thanks to...
3556 * configure.ac (Gettext support): ...this workaround to the 1.4.4
3557 bug. Undoes restriction added on 2006-11-09.
3559 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
3560 diversions are now closed when not active.
3561 (divert): Remove check now in the manual.
3562 * tests/others.at (stderr closed): Likewise.
3563 (stdout closed): Add a check.
3564 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
3565 more docs with branch.
3567 2006-11-14 Eric Blake <ebb9@byu.net>
3569 Remerge sparse diversion handling from branch.
3570 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
3572 * m4/output.c (diversion_table): Change type to gl_oset_t.
3573 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
3574 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
3575 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
3576 (div0, diversion_storage): New variables.
3577 (diversions, equal_diversion_CB): Deleted.
3578 (threshold_diversion_CB): New callback.
3579 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
3581 (m4_tmpfile): Move cloexec action here.
3583 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
3586 2006-11-13 Eric Blake <ebb9@byu.net>
3588 Add several new command line options.
3589 * src/main.c (usage): Update.
3590 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
3591 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
3592 Make --regexp-syntax argument optional.
3593 (main): Support new options. Fix regression in interactive
3594 behavior from Nov 8.
3595 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
3596 M4_OPT_SYNC_OUTPUT_BIT.
3597 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
3598 syncoutput, to match option.
3599 (m4_parse_truth_arg): New prototype.
3600 * m4/utility.c (m4_parse_truth_arg): Implement it.
3601 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
3602 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
3604 * doc/m4.texinfo (Operation modes, Dynamic loading features)
3605 (Preprocessor features, Limits control, Debugging options)
3606 (Command line files): Update documentation.
3607 * tests/builtins.at (mkstemp): Simplify.
3608 * tests/macros.at (Command line pushdef): New test.
3609 (Command line define): Improve.
3610 * tests/options.at (--traceon and --traceoff, --syncoutput): New
3612 (POSIXLY_CORRECT): Likewise.
3613 (deprecated options): Augment.
3614 (--regexp-syntax): Update, now that -r takes optional arg.
3615 * NEWS: Reformat. Document new options.
3617 2006-11-11 Eric Blake <ebb9@byu.net>
3619 One step closer to allowing C++ compilation - don't blindly
3620 convert between char* and unsigned char*.
3621 * m4/m4module.h (m4_set_syntax): Change signature.
3622 * m4/m4private.h (m4_string): Use signed char.
3623 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
3624 (m4_get_syntax_ecomm): No longer a need to cast.
3625 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
3626 Reflect this change.
3627 * m4/macro.c (expand_argument): Simplify.
3628 (expand_token): Use proper type.
3629 * src/freeze.c (reload_frozen_state): Likewise.
3630 * m4/input.c (MATCH, match_input): Likewise.
3631 * modules/m4.c (translit): Likewise.
3632 * modules/gnu.c (substitute): Simplify.
3634 * m4/macro.c (trace_format): Use canonical type name.
3635 * m4/output.c (m4_freeze_diversions): Likewise.
3636 * src/freeze.c (produce_module_dump, dump_symbol_CB)
3637 (produce_frozen_state): Likewise.
3638 * m4/m4private.h (to_uchar): Grab from branch.
3639 * m4/input.c (string_peek, string_read): Use it.
3640 * m4/utility.c (skip_space): Likewise.
3641 * src/main.c (main): Likewise.
3642 * doc/m4.texinfo (Translit): Remerge from branch.
3643 * tests/builtins.at (translit): Test 8-bit range.
3644 * modules/m4.c (m4_expand_ranges): Merge from branch.
3646 2006-11-09 Eric Blake <ebb9@byu.net>
3648 * bootstrap: Validate that installed M4 is powerful enough.
3649 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
3651 2006-11-08 Eric Blake <ebb9@byu.net>
3653 Merge deferred handling of -D option from branch.
3654 * doc/m4.texinfo (Debugging options, Preprocessor features)
3655 (Dynamic loading features, Operation modes, Invoking m4):
3656 Document this change.
3657 * src/main.c (OPTSTRING): Specify in-order processing.
3658 (process_file): New function.
3659 (main): Use it to interleave files and deferred options.
3660 * tests/macros.at (Command line define): New test.
3661 * tests/generate.awk: Allow '@comment file' as first example
3663 * tests/options.at (option grouping): Update to reflect actual
3665 (file names): New test.
3667 2006-11-07 Eric Blake <ebb9@byu.net>
3669 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
3672 * tests/builtins.at (m4exit): New test; failed on cygwin before
3674 * m4/output.c (cleanup_tmpfile): Close files before removing
3676 (make_room_for, m4_output_exit): Ensure that atexit handler
3677 invoked from m4_error sees consistent state.
3679 * doc/m4.texinfo (Errprint): Merge another doc node.
3680 * tests/builtins.at (dumpdef, errprint): New tests.
3681 * modules/m4.c (errprint): Merge from branch: flush before
3684 2006-11-02 Eric Blake <ebb9@byu.net>
3686 * bootstrap: Update bootstrap requirement wording.
3687 Reported by Bruno Haible.
3689 2006-10-31 Eric Blake <ebb9@byu.net>
3691 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3693 * doc/m4.texinfo (Translit): Merge from branch.
3694 * modules/m4.c (divert, substr): Ignore excess arguments.
3695 (index, translit): Merge from branch.
3696 * tests/builtins.at (translit): Add a test.
3698 2006-10-30 Eric Blake <ebb9@byu.net>
3700 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
3702 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
3704 * modules/m4.c (m4_make_temp): Make safe across libtool.
3705 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
3706 * configure.ac (--with-modules): Accomodate changed module
3707 location when doing './configure --enable-debug'.
3709 2006-10-28 Eric Blake <ebb9@byu.net>
3711 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3714 2006-10-27 Eric Blake <ebb9@byu.net>
3716 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
3718 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3719 0.16, since 0.15 is incompatible with our automake requirement.
3721 * m4/macro.c (expand_argument): Fix missing initialization.
3722 * m4/m4private.h (struct m4_symbol_value): Store entire
3723 m4_builtin, not just the func.
3724 (m4_get_symbol_value_func): Update.
3725 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
3727 * m4/m4module.h (m4_get_symbol_value_builtin)
3728 (m4_get_symbol_builtin): New prototypes.
3729 (m4_set_symbol_value_func): Delete, replace with...
3730 (m4_set_symbol_value_builtin): New function.
3731 (m4_builtin_find_by_name): Change signature.
3732 * m4/symtab.c (m4_symbol_value_print): Simplify.
3733 (m4_get_symbol_value_func): Update.
3734 (m4_get_symbol_value_builtin): New function.
3735 (m4_set_symbol_value_func): Delete, replace with...
3736 (m4_set_symbol_value_builtin): New function.
3737 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
3738 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
3739 * m4/input.c (struct m4_input_block): Remove unused trace member.
3740 (m4_push_builtin, builtin_print, init_builtin_token): Update
3742 * m4/module.c (install_builtin_table): Likewise.
3743 * src/freeze.c (reload_frozen_state): Likewise.
3744 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
3745 token, even after the builtin has been undefined.
3746 * doc/m4.texinfo (Builtin): Document new capability.
3749 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3751 * modules/m4.c (m4_make_temp): Use it.
3752 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
3754 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3756 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
3759 2006-10-26 Eric Blake <ebb9@byu.net>
3761 Silence -O2 -Wall -Wwrite-strings warnings.
3762 * m4/m4private.h (m4_symbol_value): Const-ify text.
3763 * m4/m4module.h (m4_get_symbol_value_text)
3764 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
3765 (m4_set_symbol_value_placeholder): Likewise.
3766 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
3768 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
3769 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
3770 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
3772 * modules/format.c (format): Likewise.
3773 * src/main.c (main): Likewise.
3774 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
3775 * modules/shadow.c (shadow, test): Likewise.
3776 * m4/output.c (m4_make_diversion): Don't hold on to empty
3778 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
3779 (m4_freeze_diversions): Likewise. Don't use uninitialized
3782 Convert diversions to list instead of sparse array, part 2.
3783 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3785 * m4/output.c (m4_diversion): Add next pointer and divnum members.
3786 (diversion_table): Convert to a list instead of a sparse array.
3787 (free_list): Maintain free list of reclaimed diversions.
3788 (equal_diversion_CB, cmp_diversion_CB): New functions.
3789 (m4_output_init): Set up list.
3790 (m4_output_exit): Tear down list.
3791 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
3793 (m4_make_diversion): Change creation of new diversions.
3794 (m4_insert_diversion_helper): New function, to avoid list
3796 * tests/builtins.at (divert): The test now passes.
3797 * NEWS: Document this improvement.
3799 Convert diversions to list instead of sparse array, part 1.
3800 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
3802 * m4/output.c (diversion, total_buffer_size, output_unused):
3803 Track size in size_t. All users changed.
3804 (struct diversion): Reduce size now, to compensate for part 2.
3805 (m4_make_diversion, make_room_for): Avoid malloc overflow.
3806 (m4_output_exit): Fix typo in assert.
3807 (m4_output_init, make_room_for, m4_make_diversion)
3808 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
3809 struct m4_diversion to disambiguate the new union.
3810 * tests/builtins.at (divert): Detect this failure.
3812 2006-10-25 Eric Blake <ebb9@byu.net>
3814 * m4/m4module.h (m4_push_builtin): Add parameter.
3815 * modules/m4.c (defn): Update caller.
3816 * m4/input.c (file_read_init, string_read_init): No longer
3818 (input_funcs): Change signature of read_func, all callers
3820 (composite_peek, composite_read, composite_unget),
3821 (composite_print, composite_funcs): New input type. Not yet
3822 fully utilized, but one step closer to fixing defn.
3823 (m4_input_block): Make every input block track current file and
3824 line. Rename some members. Remove unused out_line. Add support
3825 for composite input block.
3826 (input_change): New flag.
3827 (file_peek, file_read, file_clean, file_unget, file_print):
3829 (m4_push_file, m4_push_builtin, m4_push_string_init)
3830 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3831 (m4_skip_line, pop_input): Track input block changes.
3832 (m4_pop_wrapup): Avoid overflow.
3833 (init_builtin_token): Handle composite input.
3834 (next_char): Handle input block changes.
3835 * doc/m4.texinfo (Location): Remerge from branch.
3837 * src/m4.h (includes): Need <locale.h> after all; fixes
3838 regression from yesterday.
3840 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
3842 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3843 Handle nesting the argc obstack.
3844 (expand_token): Avoid unnecessary malloc.
3845 (collect_arguments): Copy name before invalidating it.
3846 (argc_stack, argv_stack): New variables.
3847 (m4_macro_expand_input): Initialize argc and argv stacks once per
3848 file, instead of once per macro.
3850 2006-10-24 Eric Blake <ebb9@byu.net>
3852 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
3854 2006-10-23 Eric Blake <ebb9@byu.net>
3856 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
3857 from branch regarding stripped leading whitespace.
3859 * modules/m4.c (includes): Use safe headers even when configured
3860 with --enable-assert.
3861 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
3862 #defined as mkstemp_safer.
3864 2006-10-21 Eric Blake <ebb9@byu.net>
3866 * modules/m4.c (m4_make_temp): Change signature.
3867 (maketemp, mkstemp): Update callers.
3868 * modules/m4.h (m4_make_temp_func): New export.
3869 * modules/gnu.c (mkdtemp): New macro.
3870 * doc/m4.texinfo (Operation modes): Document interaction with
3872 (Mkdtemp): New node.
3873 * tests/builtins.at (mkdtemp): New test.
3874 (mkstemp): Check for umask effect.
3875 * NEWS: Document new builtin.
3877 * tests/generate.awk (normalize): Update recognition of trailing
3879 * doc/m4.texinfo: Minor formatting fixes from branch.
3880 (Foreach, Improved foreach): Merge from branch.
3881 * examples/foreach.m4: Merge from branch.
3882 * examples/foreachq.m4: New file from branch.
3883 * examples/foreach2.m4: Likewise.
3884 * examples/foreachq2.m4: Likewise.
3886 * doc/m4.texinfo (titlepage): Add myself as author.
3887 * src/main.c (AUTHORS): Likewise.
3889 2006-10-19 Eric Blake <ebb9@byu.net>
3891 * modules/m4.c (m4_make_temp, mkstemp): New functions.
3892 (maketemp): Add POSIX behavior and a warning.
3893 * tests/others.at (maketemp): Move this test...
3894 * tests/builtins.at (mkstemp): ...to here, and beef up.
3895 * tests/options.at (--safer): Update to new warning message.
3896 * doc/m4.texinfo (Mkstemp): Sync from branch.
3897 (Extensions): Update maketemp behavior.
3898 * NEWS: Document that maketemp now always warns.
3900 * tests/generate.awk: For ease of doc-writing, simplify selection
3901 of '-Ipath/to/examples' to '@comment examples'.
3902 * examples/forloop.m4: Simplify.
3903 * examples/forloop2.m4: New file.
3904 * examples/quote.m4: New file.
3905 * doc/m4.texinfo (Improved forloop): New node.
3906 (Manual): Clarify use of examples directory.
3907 (Shift, Forloop): Resync from branch.
3908 (Include, Location): Update to new usage of examples directory.
3910 * m4/system_.h (includes): Pick up <unistd.h> before checking for
3912 (gettext_noop): Don't define here, let gettext.h do it instead.
3913 * po/POTFILES.in: Update entries to reflect gnulib imports.
3915 2006-10-16 Eric Blake <ebb9@byu.net>
3917 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3919 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
3920 pkglibexecdir support.
3921 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
3922 worry about pathconf.h, now that gnulib does it for us.
3923 (pkgmodincludedir): Simplify.
3924 (pkglibexecdir): Delete, now that automake does this.
3925 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
3926 * src/main.c (usage): Likewise.
3927 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
3929 * doc/m4.texinfo: Port some changes from the branch.
3930 (Invoking m4): Promote to a chapter, instead of a section of
3932 (Operation modes, Dynamic loading features, Preprocessor features)
3933 (Limits control Frozen state, Debugging options)
3934 (Command line files): Subdivide into new sections.
3935 (Cleardivert): Rename from cleardiv.
3937 2006-10-14 Eric Blake <ebb9@byu.net>
3939 * tests/others.at (stdin closed): Update to match previous patch.
3941 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
3943 Reported by Ralf Wildenhues.
3945 * modules/m4.c (undivert): Merge from branch.
3946 * doc/m4.texinfo (Improved fatal_error): Fix typo.
3947 (Improved exch): New node, copied from branch.
3948 (Improved cleardivert): Update from branch.
3951 2006-10-13 Eric Blake <ebb9@byu.net>
3953 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
3955 * modules/gnu.c (builtin, indir): Transparently handle builtin
3957 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
3958 * m4/input.c (m4_pop_wrapup): Display debug message when switching
3960 (m4_input_init): No need to use empty file any more.
3961 (file_print): Display correct file name.
3962 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
3963 dereference a NULL file name.
3964 * m4/m4module.h (m4_pop_wrapup): New parameter.
3965 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
3967 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
3968 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
3969 * src/main.c (main): Adjust caller.
3970 * tests/options.at (--debugmode): Test more output from -dV.
3972 2006-10-12 Eric Blake <ebb9@byu.net>
3974 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
3976 * m4/m4private.h (m4__next_token_is_open): New prototype.
3977 * m4/m4module.h (m4_push_single): Delete; push_string is an
3978 adequate interface, and removing support for this simplifies the
3980 (m4_push_wrapup): New parameter.
3981 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
3982 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
3983 start-quote and start-comment exclusive from other syntax
3985 * m4/syntax.c: Likewise.
3986 * m4/input.c (input_funcs): Make polymorphic without requiring
3987 clients to know whether they are located at isp. All users
3989 (file_names): New variable.
3990 (m4_input_init): Initialize it.
3991 (m4_push_file): Use it.
3992 (m4_input_exit): Free it after use.
3993 (m4__next_token): Simplify slightly.
3994 (m4__peek_token): Rename and simplify...
3995 (m4__next_token_is_open): ... to this. In particular, this
3996 allows us to avoid a double ungetc, which POSIX doesn't
3998 (struct m4_input_block, m4_push_single, single_peek, single_read):
3999 Remove support for single characters, as the input engine now
4000 guarantees we don't need it.
4001 (file_unget, string_unget, m4_input_print, unget_input):
4002 Strengthen assertions.
4003 (file_init_funcs, file_read_init): New for file reading.
4004 (string_init_funcs, string_read_init): New for wrapped text.
4005 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
4006 Support wrapped text with locations.
4007 (m4_skip_line): Support dnl across include file boundary.
4008 (peek_char): Don't pop input when peeking.
4009 (file_peek): Peek can be called at the end of the file.
4010 (string_read): Don't read beyond string bounds.
4011 * m4/macro.c (expand_token, collect_arguments): Update callers.
4012 (expand_macro): Report errors at location of open parenthesis.
4013 (expand_token, expand_argument, process_macro): Avoid negative
4014 array dereferences with m4_has_syntax.
4015 * m4/utility.c (skip_space): Likewise.
4016 * modules/m4.c (m4wrap): Update caller.
4017 * tests/builtins.at (__file__, __line__, dnl): New tests.
4018 * tests/options.at (--debugmode): Normalize the output.
4019 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
4020 Remerge recent changes from branch.
4021 (Improved fatal_error): New node from branch.
4023 2006-10-11 Eric Blake <ebb9@byu.net>
4025 * src/main.c (usage, long_options): Add --debugmode as an alias
4026 for --debug, to match macro name.
4027 * tests/options.at (--debugmode): Rename from --debug, and test
4029 (--discard-comments): Augment test.
4030 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
4033 2006-10-10 Eric Blake <ebb9@byu.net>
4035 Trace improvements: debugmode(c) was always printing the last two
4036 lines paired, combine them; and show non-text expansions.
4037 * m4/macro.c (trace_prepre): Update to show what the macro will
4039 (trace_pre): No need to special-case on debugmode(c).
4040 (trace_post): Likewise. Also, show non-text expansions.
4041 (expand_macro): Update caller. Collecting arguments can change
4042 debug mode, so cache values beforehand.
4043 (trace_format): Remove support for unused %l%S%r, and fix support
4044 for %z to match gcc's attribute((printf)).
4045 (trace_header): Update caller.
4046 * m4/input.c (struct m4_input_block): Rename from input_block.
4047 (struct input_funcs): Add print_func member.
4048 (file_print, builtin_unget, builtin_print, string_print)
4049 (m4_input_print): New functions.
4050 (m4_push_string_finish): Change return type.
4051 (m4_push_file): Fix missing use of close parameter.
4052 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
4053 * m4/m4module.h (m4_input_print): New prototype.
4054 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
4055 to match behavior change.
4056 * tests/options.at (--debug): Likewise.
4057 * tests/macros.at (Propagation of traceon)
4058 (Propagation of --trace): Likewise.
4059 * tests/others.at (stderr closed, stdout closed, stdin closed):
4061 * doc/m4.texinfo (Forloop): Simplify.
4062 (Trace): Update to changed behavior.
4063 (Debugmode): Document this change.
4064 * src/main.c (usage): Likewise.
4067 2006-10-09 Eric Blake <ebb9@byu.net>
4069 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
4070 Reported by Ralf Wildenhues.
4072 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
4074 2006-10-07 Eric Blake <ebb9@byu.net>
4076 * m4/m4module.h (m4_set_exit_failure): New prototype.
4077 * m4/utility.c (m4_set_exit_failure): New function.
4078 * modules/m4.c (m4exit): Use it to avoid yet another global
4079 variable export in libm4.
4081 2006-10-06 Eric Blake <ebb9@byu.net>
4083 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
4085 * tests/others.at (stdout closed): Fix final check.
4087 Replace uses of tmpfile with clean-temp, since tmpfile is
4088 incompatible with closeout.
4089 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
4091 * tests/others.at (stderr closed): Likewise.
4092 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
4093 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4095 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
4096 (m4_tmpfile, cleanup_tmpfile): New functions.
4097 (make_room_for, m4_insert_diversion): Use clean-temp module.
4098 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
4100 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
4102 * m4/utility.c (m4_numeric_arg): Merge from branch.
4103 * modules/gnu.c (debuglen): New builtin.
4104 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
4105 Rename --arglength to --debuglen.
4106 * tests/options.at (--arglength): Rename to --debuglen.
4107 (deprecated options): Augment test.
4108 * doc/m4.texinfo (Invoking m4): Document the name change.
4109 (Debugmode): Rename from Debug Levels.
4110 (Debugfile): Rename from Debug Output.
4111 (Debuglen): New node.
4112 * NEWS: Document these changes.
4114 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
4115 case closing a module exits.
4117 * modules/m4.c (m4exit): Merge from branch.
4118 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
4120 2006-10-05 Eric Blake <ebb9@byu.net>
4122 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4124 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
4125 * src/main.c (main): Close stdout on exit.
4126 * m4/debug.c (set_debug_file): Check for write failure.
4127 * m4/m4.c (m4_delete): Don't mask write failure.
4128 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
4129 macros before calling AT_CHECK.
4130 (M4_ONE_MEG_DEFN): New helper macro.
4131 * tests/others.at (stdout full): New test.
4132 (stderr closed, stdin closed, stdout closed): Augment.
4133 * tests/builtins.at (syscmd): New test.
4136 2006-10-04 Eric Blake <ebb9@byu.net>
4138 * tests/builtins.at: Alphabetize tests.
4139 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
4140 * tests/generate.awk (new_test): Fix underquoting.
4141 * tests/others.at (maketemp): Rename from misc.
4142 (stdin closed, stdout closed, stderr closed): New tests.
4144 2006-10-03 Eric Blake <ebb9@byu.net>
4146 Avoid all global variables in modules, so that --disable-static
4148 * examples/incl.m4: New file, from branch.
4149 * Makefile.am (dist_pkgdata_DATA): Distribute it.
4150 * doc/m4.texinfo (Location): Merge this section from branch.
4151 (Include): Update the test.
4152 * tests/generate.awk (new_test): Allow for VPATH build
4153 pre-processing of expected __program__ output.
4154 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
4155 Avoid global variables.
4156 (m4_context_field_table): Add current_diversion, output_line.
4157 (m4_output_init, m4_make_diversion): Add parameter.
4158 (m4_get_program_name, m4_set_program_name): New accessors.
4159 * m4/m4private.h (m4_get_current_diversion),
4160 (m4_set_current_diversion, m4_get_output_line)
4161 (m4_set_output_line): New accessors.
4162 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
4164 * modules/m4.c (divnum, divert): Adjust callers.
4165 * modules/gnu.c (__program__): Likewise.
4166 * m4/output.c (m4_output_init, m4_make_diversion)
4167 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
4168 (m4_insert_diversion): Likewise.
4169 * m4/input.c (file_clean, m4_push_file): Likewise.
4170 * src/freeze.c (reload_frozen_state): Likewise.
4171 * src/main.c (main, usage): Likewise.
4173 Partially plug memory leak when unloading gnu module.
4174 * tests/modules.at (unload gnu module): New test.
4175 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
4176 (m4_regexp_compile): Move static storage to module visibility.
4177 * tests/options.at (--debug): Adjust to new output.
4179 2006-09-29 Eric Blake <ebb9@byu.net>
4181 Even when not the first option, --help can't have side effects.
4182 * tests/options.at (--debugfile): Detect bugs in this area.
4183 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
4185 * src/main.c (main): Fix it by deferring debugfile change. Also,
4186 defer closing streams until after module tracing is done.
4187 * modules/gnu.c (debugfile): Make message consistent with command
4189 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
4190 * NEWS: Document this fix.
4192 * modules/m4.c (dnl): Include macro name in warning message.
4193 * m4/input.c (m4_skip_line): Add parameter.
4194 * m4/m4module.h (m4_skip_line): Likewise.
4195 * src/main.c (usage): Update wording.
4196 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
4197 issue of blind macros vs. POSIX is resolved.
4198 (Dnl): Merge another node from branch.
4200 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4202 * m4/system_.h (N_): Define.
4203 * src/main.c (main): Validate numeric arguments.
4204 (size_opt): New function, idea borrowed from coreutils.
4205 * m4/macro.c (expand_macro): -L0 implies no limit.
4206 * doc/m4.texinfo (Invoking m4): Document this change.
4208 * tests/options.at: (--arglength, --nesting-limit)
4209 (--regexp-syntax): New tests of argument validation.
4211 2006-09-28 Eric Blake <ebb9@byu.net>
4213 * tests/options.at: Alphabetize the tests.
4215 2006-09-27 Eric Blake <ebb9@byu.net>
4217 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
4218 another parameter to print module info.
4219 * m4/macro.c (trace_pre): Adjust caller.
4220 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
4221 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
4222 * NEWS: Document this.
4224 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4226 * m4/symtab.c (symbol_value_print): Rename to...
4227 (m4_symbol_value_print): ...this, and...
4228 (m4_symbol_print): Update to allow -L length truncation. Now
4229 truncation also affects dumpdef output and builtin names.
4230 * m4/m4private.h (nesting_limit, max_debug_argument_length):
4232 * m4/m4module.h (m4_symbol_print): Add parameter.
4233 (m4_symbol_value_print): New function.
4234 * modules/m4.c (dumpdef): Allow length truncation.
4235 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
4237 * doc/m4.texinfo (Invoking m4): Document -l better.
4238 (Dumpdef, Debug Levels): Document the effect of -l.
4239 * NEWS: Document this change.
4241 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
4242 (m4_expand_ranges): Ensure we aren't picking up partial object on
4244 * modules/stdlib.c (setenv): Allow extra arguments.
4245 * modules/time.c (ctime): Avoid side effect in call to
4247 * modules/gnu.c (m4_regexp_substitute): Likewise.
4248 (renamesyms): Avoid extra obstack_init.
4249 * src/freeze.c (reload_frozen_state): Remove debug comment.
4250 (produce_frozen_state): Simplify fprintf to puts where possible.
4251 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
4252 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
4253 * m4/macro.c (trace_flush): Likewise.
4254 * m4/debug.c (m4_debug_message_prefix): Likewise.
4255 * m4/path.c (include_dump): Likewise.
4256 * m4/module.c (module_remove): Likewise.
4257 (install_builtin_table): Simplify malloc and string
4260 2006-09-26 Eric Blake <ebb9@byu.net>
4262 * m4/m4module.h (m4_symbol_print): New prototype.
4263 (M4_DEBUG_TRACE_STACK): New enumerator.
4264 (m4_is_debug_bit): Allow use without requiring m4private.h.
4265 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
4267 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
4269 (dumpdef): Allow printing pushdef'd stacks.
4270 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4271 * src/main.c (usage): Document it.
4272 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4275 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4277 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4278 of lines during make.
4279 (AM_CPPFLAGS): Remove unneeded include path.
4280 (src_m4_CPPFLAGS): Remove redundant include path.
4281 * m4/system_.h Make preprocessor indentation consistent.
4282 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4284 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4286 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4287 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4288 (bool, true, false): Don't undefine here; stdbool takes care of
4290 * src/m4.h (includes): Assume config.h, and several standard
4292 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4293 * m4/m4private.h: Assume config.h.
4294 * m4/output.c: Likewise.
4295 * m4/path.c: Likewise.
4296 * m4/resyntax.c: Likewise.
4297 * m4/utility.c: Likewise.
4298 * modules/gnu.c: Likewise.
4299 * modules/import.c: Likewise.
4300 * modules/load.c: Likewise.
4301 * modules/m4.c: Likewise.
4302 * modules/modtest.c: Likewise.
4303 * modules/mpeval.c: Likewise.
4304 * modules/perl.c: Likewise.
4305 * modules/shadow.c: Likewise.
4306 * modules/stdlib.c: Likewise.
4307 * modules/time.c: Likewise.
4308 * modules/traditional.c: Likewise.
4310 2006-09-21 Eric Blake <ebb9@byu.net>
4312 * doc/m4.texinfo (Invoking m4): Add clarification on option
4313 processing behavior.
4314 * tests/options.at (option grouping): Test this.
4316 Reported by Mikhail Teterin.
4318 * bootstrap: Add --force option, based on idea from coreutils.
4319 * README: Document that ./bootstrap and autoreconf are for
4320 developers, and not lightly done in tarballs.
4322 2006-09-20 Eric Blake <ebb9@byu.net>
4324 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
4325 warnings consistent.
4326 (long_options, HASHSIZE_OPTION): Warn on -H.
4327 * doc/m4.texinfo (Invoking m4): Document this.
4328 * tests/options.at (deprecated options): Update.
4330 Change the default of interactive sessions to match sh.
4331 * src/main.c (usage): Document this.
4332 (enum interactive_choice): New enum.
4333 (main): Use it to defer decision of interactive until after
4334 argument processing.
4335 * doc/m4.texinfo (Invoking m4): Document this.
4336 * NEWS: Likewise, plus add missing mention of -b.
4337 Reported by Stepan Kasal.
4339 2006-09-19 Eric Blake <ebb9@byu.net>
4341 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4342 well as --error-output; the goal is to add -o/--output in some
4343 future version with semantics like gcc or autom4te.
4344 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4345 (Extensions): Reflect this update.
4346 (Renamesyms): Add another test.
4347 (Defn): Xfail for now, so that `make check' is happy.
4348 * NEWS: Document this change.
4349 * tests/generate.awk: Mark dynamic loading tests as such. Allow
4351 * tests/macros.at (Renamesyms collisions): New test, exposing
4352 renamesyms' coredump.
4353 * tests/options.at (--debugfile, --safer): Update to match
4356 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4357 and stderr are same file, introduced 2003-07-23.
4358 * tests/options.at (--debugfile): New test, to catch the bug.
4359 (deprecated options): Test --error-output.
4360 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4361 Deprecate --error-output, and replace it with --debugfile.
4362 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4363 Document this change.
4366 2006-09-18 Eric Blake <ebb9@byu.net>
4368 * modules/load.c (modules): Rename to...
4369 (m4modules): ...this, since it is an English word with 0
4371 * modules/gnu.c (symbols, m4symbols): Likewise.
4372 * doc/m4.texinfo (Listing Modules): Rename to...
4373 (M4modules): ...this.
4374 (Symbols): Rename to...
4375 (M4symbols): ...this.
4376 (Load, Foreach, Trace, Answers): Update to new spellings.
4377 * NEWS: Document this.
4379 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4380 such that without arguments, the global trace flag is changed
4381 rather than walking the table of all currently-defined macros.
4382 (set_trace_CB): No longer needed.
4383 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4384 (m4_set_symbol_traced): Delete.
4385 (m4_symtab_create): Nuke the nuke parameter.
4386 * m4/m4private.h (m4_get_symbol_value): Delete.
4387 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4388 (m4_set_symbol_name_traced): Free undefined entries that are no
4390 (symbol_destroy_CB): Update caller.
4391 * m4/m4.c (m4_create): Update caller.
4392 * src/main.c (main): Likewise.
4393 (usage): Fix typo in last commit.
4394 * doc/m4.texinfo: Minor cleanups throughout.
4395 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4396 more nodes from branch.
4397 (Trace): Document new semantics, and how to simulate the old.
4398 * tests/builtins.at (multiquotes): Adjust to new semantics.
4399 * NEWS: Update somewhat.
4401 2006-09-14 Eric Blake <ebb9@byu.net>
4403 Add --safer option, per debian bug 5898.
4404 * src/main.c (usage): Document new option.
4405 (SAFER_OPTION): New enumerator.
4406 (main): Set the option bit.
4407 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4409 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4410 (m4_get_safer_opt): New accessor.
4411 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4412 * modules/m4.c (syscmd, maketemp): Likewise.
4413 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4414 (Sysval, Maketemp): Add tests of this.
4415 * tests/options.at (--safer): Likewise.
4417 2006-09-13 Eric Blake <ebb9@byu.net>
4419 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4421 Reported by Ralf Wildenhues.
4424 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4425 tests directory, so we can be sure an installed build is not
4426 picking up uninstalled non-test libraries.
4427 (check-local, installcheck-local): Depend on test libraries.
4428 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4429 after file name. Fix quoting. Remove skipping the test, now
4430 that makefile guarantees test modules will exist.
4431 (Freezing modules, modules: shadow, modules: unload)
4432 (modules: trace): Always put test modules in module path.
4433 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4435 * src/main.c (usage): Document default module search path.
4436 (import_environment, frozen_file_to_read, frozen_file_to_write):
4439 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4440 * tests/m4.in: ...not here.
4441 Reported by Ralf Wildenhues.
4443 2006-09-08 Eric Blake <ebb9@byu.net>
4445 * bootstrap: Kill unrelated copy-n-paste code from argument
4446 parsing. Let Makefile generate testsuite.
4447 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4449 2006-09-07 Eric Blake <ebb9@byu.net>
4451 * m4/m4module.h (m4_peek_input): No longer export.
4452 (m4_error_at_line, m4_warn_at_line): New prototypes.
4453 (m4_is_symbol_void): New macro.
4454 (m4_push_file): Update prototype.
4455 * m4/m4private.h (m4__peek_token): New prototype.
4456 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4457 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4458 * src/main.c (main): Allow reading from stdin twice.
4459 * modules/m4.c (include): Adjust to new prototype.
4460 * m4/input.c: General comment cleanup.
4461 (file_peek, file_read, file_unget, push_file): Set end flag on
4462 EOF, so that we don't call getc twice.
4463 (push_file, file_clean): Port fix from branch to avoid closing
4465 (pop_input): Port fix from branch to avoid reading free'd memory
4466 when input ends mid-string.
4467 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4468 (string_peek, string_read): Always use unsigned char.
4469 (m4_skip_line): Warn when dnl cut short by EOF.
4470 (peek_input): Rename from m4_peek_input.
4471 (match_input): Update signature, to distinguish between `(' token
4472 and multi-char quote or comment beginning with `('.
4473 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4474 (m4__peek_token): New function, ported from branch.
4475 (m4__next_token): Update to new token types.
4476 * m4/macro.c (expand_token, expand_argument): Use peek_token.
4477 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4478 (Invoking m4): Remerge from branch.
4480 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4481 (check-local): and put dependency here.
4482 Reported by Ralf Wildenhues.
4484 2006-09-05 Eric Blake <ebb9@byu.net>
4486 * m4/m4module.h (m4_debug_message): New prototype.
4487 (M4_DEBUG_TRACE_MODULE): New debug bit.
4488 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4489 (M4_DEBUG_MESSAGE2): Delete these macros.
4490 * m4/debug.c (m4_debug_message): New method.
4491 (m4_debug_decode): Add module tracing as flag `m'.
4492 * m4/input.c (m4_push_file, file_clean): Use new method.
4493 * m4/path.c (m4_path_search): Likewise.
4494 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4495 * m4/module.c (install_builtin_table, install_macro_table)
4496 (m4__module_open, module_close, module_remove): Promote several
4497 module debug messages outside of DEBUG_MODULES.
4498 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4499 DEBUG_MODULES with normal trace output.
4500 * src/main.c (usage): Document new flag.
4501 * doc/m4.texinfo (Debug Levels): Likewise.
4502 * Makefile.am ($(TESTSUITE)): Add missing dependency.
4503 * tests/m4.in: Neutralize platform-dependent module filenames.
4504 * tests/options.at (--debug): Update expected output.
4506 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4508 * doc/m4.texinfo: Fix some typos.
4509 * tests/others.at: Likewise.
4511 2006-09-05 Eric Blake <ebb9@byu.net>
4513 * m4/input.c (lex_debug): Remove dead code that broke compilation
4514 with --enable-debug.
4515 * m4/module.c (install_builtin_table, install_macro_table)
4516 (m4__module_init, m4__module_open, module_close)
4517 (module_remove): Fix compilation when --enable-debug.
4518 * m4/output.c (m4_shipout_text): Likewise.
4519 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4520 libraries when --enable-debug.
4521 * configure.ac (DYNAMIC_MODULES): New variable, to pass
4522 information to testsuite.
4523 (modules to preload): Determine modules after we know whether
4524 shared libraries are supported.
4525 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4527 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4528 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4529 (modules: shadow, modules: unload, modules: importing)
4530 (modules: trace): Use new macro.
4531 * tests/builtins.at (gmp): Likewise.
4533 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
4535 (expand_token): Avoid assertion just added to docs.
4536 (expand_macro): Track pending expansions, for when a symbol's
4537 definition changes during argument collection.
4538 (m4_macro_call, process_macro): Operate on symbol value, not
4539 symbol, since symbol may have changed during argument collection.
4540 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
4541 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
4542 (m4_get_symbol_value): Add fast macro version.
4543 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
4544 (m4_macro_call): Adjust prototype.
4545 * m4/module.c (install_builtin_table): Check that flags are valid
4546 when creating builtin.
4547 * m4/symtab.c (m4__symtab_remove_module_references): Use
4548 m4_symbol_value_delete, rather than inlining it.
4549 (m4_symbol_value_copy): Copy placeholder text.
4550 (symbol_popval): Use m4_symbol_value_delete.
4551 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
4552 Handle pending expansions.
4553 * modules/gnu.c (indir): Update to new prototype.
4554 * doc/m4.texinfo: Fix menus to be consistent with section names.
4555 (Defn): Add test that macro tokens flatten to empty string;
4556 triggered an assert before this patch.
4557 (Ifelse): Merge another node.
4558 (Loops): Split into...
4559 (Forloop, Foreach): New nodes; work is still underway on them.
4560 (Answers): Add more info on foreach macro; work is still underway.
4561 (Indir): Add test that indir collects arguments before looking up
4563 * TODO: Update based on this patch.
4565 2006-09-01 Eric Blake <ebb9@byu.net>
4567 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
4568 * m4/hash.h (m4_free_hash_iterator): New prototype.
4569 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
4570 ensure we don't do unsafe things while iterating.
4571 (HASH_ITER, ITER_CHAIN): New accessor macros.
4572 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
4573 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
4574 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
4575 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
4576 to catch unsafe actions.
4577 (m4_free_hash_iterator): New function, to avoid memory leaks, and
4578 when debugging, to track safe actions.
4579 (m4_hash_apply): Avoid memory leak.
4580 * m4/symtab.c (m4_symtab_apply): Likewise.
4581 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
4582 in manually to src/ for now.
4583 * tests/builtins.at (gmp): Add keyword module.
4584 * tests/modules.at (Freezing modules, modules: shadow)
4585 (modules: unload, modules: importing, modules: trace): Likewise.
4587 2006-08-30 Eric Blake <ebb9@byu.net>
4589 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
4591 (m4_bad_argc, m4_numeric_arg): Update all callers.
4592 * m4/macro.c (m4_macro_call): Likewise.
4593 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
4594 (Indir, Builtin, Ifdef): More doc merges.
4595 (Loops): Mention that documenting foreach would be nice.
4596 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
4597 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
4598 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
4599 (substitute, syncoutput): Update all m4_warn callers.
4600 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
4601 (traceon, traceoff): Make warning message consistent.
4602 (define, pushdef): Update all m4_warn callers.
4603 * tests/generate.awk: Choose file name so that documentation can
4604 show command-line behavior.
4605 * tests/builtins.at (define): Update to new wording.
4606 * tests/macros.at (pushdef/popdef): Likewise.
4607 * tests/freeze.at (loading format 1): Likewise.
4608 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4610 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
4612 (Defn): Add failing test case for mixing text and builtin.
4613 (Renamesyms): Improve wording, and identify core dump that needs
4616 2006-08-29 Eric Blake <ebb9@byu.net>
4618 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
4619 (Arguments, Pseudo Arguments): More doc merges from the branch.
4620 (Macro expansion): Turn example into test.
4621 (Pseudo Arguments): Add example of avoiding argument.
4622 * modules/m4.c (undefine, popdef): Accept multiple arguments.
4623 (define, pushdef): Warn on non-text macro name.
4624 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
4625 warning/error messages.
4626 (ifdef): Ignore extra arguments.
4627 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
4628 (m4__symtab_remove_module_references): Check that there is no leak.
4629 * tests/macros.at (pushdef/popdef): Update to new message.
4630 * tests/builtins.at (define): Likewise.
4631 * tests/freeze.at (loading format 1): Likewise.
4632 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4634 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
4635 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
4636 as accessor function, to avoid compiler warning.
4637 * m4/module.c (m4__module_open): Move declaration of variable to
4638 avoid compiler warning.
4639 * src/main.c (main): Avoid shadowing a global variable.
4640 * src/freeze.c (produce_symbol_dump): Avoid unused variable
4641 warning when NDEBUG.
4642 * tests/options.at (--discard-comments, --import-environment)
4643 (--debug, --prepend-include, --help and --version): Rename tests
4644 to name option tested.
4646 2006-08-28 Eric Blake <ebb9@byu.net>
4648 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
4649 * m4/module.c (install_builtin_table): ...to here, and add
4650 assertion that blind macros require arguments.
4651 * m4/m4module.h (struct m4_builtin): Document restrictions that
4652 must be met during module loading.
4653 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
4654 so require an argument to avoid triggering assertion.
4655 (debugfile): Tweak error message.
4657 2006-08-25 Eric Blake <ebb9@byu.net>
4659 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
4660 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
4661 (struct m4_builtin): New member flags replaces groks_macro_args,
4662 blind_if_no_args. min_args and max_args are now 0-based.
4663 Rearrange members to reduce size on platforms where function
4664 pointers are 64 bits but regular pointers are 32.
4665 (m4_bad_argc): Add argument.
4666 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
4667 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
4668 effect into account.
4669 * m4/module.c (install_builtin_table): Adjust all users affected
4671 * m4/macro.c (m4_macro_call): Likewise.
4672 * src/freeze.c (reload_frozen_state): Likewise.
4673 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
4674 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
4675 * modules/import.c (builtin_functions): Likewise.
4676 * modules/load.c (builtin_functions): Likewise.
4677 * modules/modtest.c (builtin_functions): Likewise.
4678 * modules/mpeval.c (builtin_functions): Likewise.
4679 * modules/perl.c (builtin_functions): Likewise.
4680 * modules/shadow.c (builtin_functions): Likewise.
4681 * modules/stdlib.c (builtin_functions): Likewise.
4682 * modules/time.c (builtin_functions, mktime_functions)
4683 (strftime_functions): Likewise.
4684 * doc/m4.texinfo (Loops): Update test now that shift is blind.
4685 (Macro Arguments): Fix typo in test.
4686 (Patsubst): Fix typo in test.
4687 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
4688 end of string. Fix return value when ignore_duplicates.
4689 * tests/builtins.at (patsubst): Fix typo in test.
4691 * tests/options.at (debug-flags): Update to reflect new message.
4692 (deprecated options, prepend-include, help and version): New
4694 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
4695 test omits an input file name.
4696 * src/main.c (long_options, main): Add -B/--prepend-include.
4697 (usage): Document it.
4698 (main): `m4 --help --version' now displays help, not version.
4699 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4700 dirname filenamecat.
4701 * m4/m4module.h (m4_add_include_directory): Add parameter.
4702 * m4/m4private.h (m4__include_init): New prototype.
4703 * m4/m4.c (m4_create): Put `.' on path before options are
4705 * m4/path.c (includes): Assume C89. Use gnulib for file name
4707 (m4__include_init): New function.
4708 (search_path_add): Allow prepending.
4709 (m4_add_include_directory, search_path_env_init): Adjust callers.
4710 (m4_path_search): Relative names now invoke path search, since
4711 `.' might not be first.
4712 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
4714 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
4715 and Eric Blake <ebb9@byu.net>
4717 * bootstrap: Run autopoint before gnulib-tool, since autopoint
4718 0.15 installs macros obsoleted by current gnulib.
4720 2006-08-25 Eric Blake <ebb9@byu.net>
4722 * doc/m4.texinfo (Macro Arguments): Another section merged;
4723 testsuite failures now exposed.
4725 2006-08-23 Eric Blake <ebb9@byu.net>
4727 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
4728 (Input processing): More doc merges from the branch.
4729 (Regular expression syntax): Add introductory text.
4730 (Inhibiting Invocation): More doc merges from the branch.
4731 (Other tokens): Reorder after comments.
4732 * tests/generate.awk: Allow passing options to doc examples.
4734 2006-08-22 Eric Blake <ebb9@byu.net>
4736 * tests/options.at (debug-flags): New test.
4737 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
4738 not negative, to distinguish failure in m4_debug_decode.
4739 (m4_debug_decode): Add new parameter.
4740 * modules/gnu.c (regexp): Slight cleanup.
4741 (renamesyms): Ignore excess arguments.
4742 (syncoutput): Make case-insensitive, warn on bad argument.
4743 (debugmode): Factor -+ handling out to...
4744 * m4/debug.c (m4_debug_decode): ...here.
4745 (m4_debug_message_prefix): Fix spacing.
4746 * src/main.c (main): Let -d option adjust flags.
4747 * m4/input.c (file_clean): Avoid printing empty file name.
4748 * doc/m4.texinfo (Syncoutput): Document new range of input.
4749 (Invoking m4): Document use of multiple -d flags.
4751 Start porting various fixes from the branch that use gnulib.
4752 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4753 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
4754 regexprops-generic stdlib-safer unlocked-io.
4755 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
4756 * m4/path.c (m4_path_search): Close input file on exec, reject
4757 empty file name, fix parameter naming.
4758 * m4/output.c (make_room_for): Close diversion file on exec.
4759 (includes): Assume C89 headers.
4760 (tmpfile): For now, we don't want tmpfile-safer, because we want
4762 * m4/m4private.h (includes): Use various gnulib headers.
4763 * doc/regexprops-generic.texi: Use gnulib's copy.
4765 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
4766 * AUTHORS: Add copyright.
4767 * ChangeLog: Likewise.
4768 * README: Likewise. Require automake 1.9b or later.
4769 * HACKING: New file.
4770 * README-alpha: Add copyright.
4771 * THANKS: Likewise. Update.
4772 * doc/STYLE: Add copyright, and tweak for changed directories.
4773 * modules/README: Add copyright, and tweak for libtool version.
4774 * examples/COPYING: New file.
4775 * examples/WWW/COPYING: Likewise.
4776 * examples/WWW/m4lib/COPYING: Likewise.
4777 * modules/shadow.m4: Add copyright.
4778 * modules/perl.m4: Likewise.
4779 * modules/modtest.m4: Likewise.
4780 * modules/stdlib.m4: Likewise.
4781 * modules/time.m4: Likewise.
4782 * modules/time2.m4: Likewise.
4783 * po/Makevars: Likewise.
4784 * tests/iso8859.m4: Likewise.
4785 * tests/m4.in: Likewise.
4786 * NEWS: Add (C) to copyright.
4788 * m4/system_.h: Likewise.
4789 * tests/atlocal.in: Likewise.
4790 * tests/builtins.at: Likewise.
4791 * tests/freeze.at: Likewise.
4792 * tests/generate.awk: Likewise.
4793 * tests/macros.at: Likewise.
4794 * tests/modules.at: Likewise.
4795 * tests/options.at: Likewise.
4796 * tests/others.at: Likewise.
4797 * tests/testsuite.at: Likewise.
4798 * m4/utility.c: Spell out copyright years.
4799 * src/main.c: Likewise.
4801 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
4803 2006-08-21 Eric Blake <ebb9@byu.net>
4805 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
4806 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
4807 when no arguments are given, but without losing warning about 0
4809 * modules/m4.c (syscmd): Likewise.
4810 (includes): Assume C89.
4811 (m4_sysval): Make static.
4812 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
4813 (sysval): Port calculation from branch.
4815 2006-08-20 Eric Blake <ebb9@byu.net>
4817 * m4/macro.c (expand_macro): Move argument check...
4818 (m4_macro_call): ...to here, so indir will warn.
4819 * modules/gnu.c (__program__): New macro, ported from branch.
4820 (builtin): Perform argument check.
4821 (changesyntax): Avoid out-of-bounds read.
4823 * modules/gnu.c (includes): Assume stdlib.h, errno.
4824 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4825 (substitute): Add caller parameter, avoid out-of-bounds memory
4827 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4830 2006-08-16 Eric Blake <ebb9@byu.net>
4832 * po/POTFILES.in: Add more files that contain translatable
4834 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4835 information to translators.
4836 (USE_MSGCTXT): New var for gettext 0.15.
4837 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4838 debug/trace messages in lower case.
4839 * m4/macro.c (expand_argument): Likewise.
4840 * m4/path.c (m4_path_search): Likewise.
4841 * src/main.c (main): Likewise.
4843 2006-08-14 Eric Blake <ebb9@byu.net>
4845 * src/main.c (usage): Document --import-environment.
4846 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4848 2006-08-11 Eric Blake <ebb9@byu.net>
4850 * bootstrap (func_get_translations): Only remove files when doing
4852 (func_update_po): Avoid CDPATH problems.
4854 2006-08-10 Eric Blake <ebb9@byu.net>
4856 * bootstrap (func_get_translations): New function.
4857 (func_update_po): Borrow ideas from tar to correctly pull in
4858 translations from newer location.
4860 2006-08-09 Eric Blake <ebb9@byu.net>
4862 * bootstrap: Recent gnulib no longer has jm_* macros to worry
4864 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4866 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
4867 (m4_error, m4_warn): ... these new prototypes.
4868 (m4_current_file, m4_current_line): Move into context, rather
4869 than leaving as globals.
4870 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
4871 (m4_undivert_all, m4_input_init): Now takes context.
4872 * m4/utility.c (m4_error, m4_warn): New functions.
4873 * m4/m4private.h: Assume errno exists.
4874 (struct m4): Move warning_status to a bit flag,
4875 and add exit_status. Adjust accessors accordingly.
4876 * src/main.c (print_program_name_CB): No longer needed.
4877 (main): Use new m4_get_fatal_warnings_opt.
4878 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
4879 instead of issuing "INTERNAL ERROR". Pass context when needed,
4880 and use new accessors.
4881 * m4/input.c: Likewise.
4882 * m4/macro.c: Likewise.
4883 * m4/output.c: Likewise.
4884 * m4/utility.c: Likewise.
4885 * modules/evalparse.c: Likewise.
4886 * modules/gnu.c: Likewise.
4887 * modules/load.c: Likewise.
4888 * modules/m4.c: Likewise.
4889 * modules/mpeval.c: Likewise.
4890 * src/freeze.c: Likewise.
4891 * src/main.c: Likewise.
4892 * tests/macros.at: Adjust to new message format.
4893 * tests/builtins.at: Likewise.
4894 * tests/freeze.at: Likewise.
4895 * tests/modules.at: Likewise.
4896 * doc/m4.texinfo: Likewise.
4898 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
4901 2006-08-03 Eric Blake <ebb9@byu.net>
4903 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
4904 gracefully handle ENOSYS.
4908 2006-07-28 Eric Blake <ebb9@byu.net>
4910 * src/freeze.c (reload_frozen_state): Copy string when creating
4911 placeholder, to avoid memory corruption.
4912 * m4/symtab.c (symbol_popval): Avoid memory leak.
4913 (m4_symbol_rename): Avoid shadowing rename function.
4914 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
4915 * tests/freeze.at (reloading unknown builtin): Add test.
4916 * tests/generate.awk: Capture m4.texinfo line number in
4917 testsuite.log, not just generated.at.
4919 Port idea from branch that a frozen file can request an unknown
4920 builtin without producing a warning unless the builtin is
4922 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
4923 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
4924 (m4_set_symbol_value_placeholder): New accessors.
4925 * m4/m4module.h (m4_is_symbol_placeholder),
4926 (m4_get_symbol_value_placeholder),
4927 (m4_set_symbol_value_placeholder),
4928 (m4_get_symbol_placeholder): Likewise.
4929 * m4/symtab.c (m4_is_symbol_value_placeholder),
4930 (m4_get_symbol_value_placeholder),
4931 (m4_set_symbol_value_placeholder): Likewise.
4932 (dump_symbol_CB): Handle new symbol type.
4933 * m4/macro.c (trace_pre): Likewise.
4934 (m4_macro_call): Warn when invoking a placeholder.
4935 * modules/m4.c (dumpdef): Handle dumping a placeholder.
4936 (defn): Warn when referencing a placeholder.
4937 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
4939 (reload_frozen_state): When reloading unknown builtin, install a
4940 placeholder instead of warning.
4941 * tests/freeze.at (loading format 1): Allow warning when
4942 popdef'ing undefined function.
4944 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
4946 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
4947 function. Shift by 7, not 3, for consistency with
4948 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
4950 2006-07-27 Eric Blake <ebb9@byu.net>
4952 * src/main.c (usage): Update to match branch.
4953 (main): Update --version info to distinguish between program name
4954 `m4' and package name `GNU M4'.
4955 (AUTHORS): Translate René Seindal's name.
4956 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
4957 * Makefile.am (doc/m4.1): Update to match branch.
4958 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
4961 * m4/system_.h (EXIT_MISMATCH): Define.
4962 * src/main.c (main): Don't clear syntax table for version 1.
4963 (usage): Document exit status.
4964 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
4965 branch, and require V directive to appear first in file. Fix
4966 broken logic for detecting F and T in version 1 files.
4968 2006-07-22 Eric Blake <ebb9@byu.net>
4970 * src/main.c (stackovf_handler): Document the problems in our
4972 * src/stackovf.c: Forward port changes in branch to use POSIX
4973 sa_sigaction when available.
4974 (process_sigsegv): Avoid buffer overrun when error string is
4975 translated, although the fact that we translate in a signal
4976 handler is still a bug.
4977 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
4978 from branch to modernize checks.
4980 * modules/format.c (format): Avoid compiler warning that str may
4981 be used uninitialized.
4983 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
4985 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
4986 (DEBUG_MACRO): Remove unused macro.
4987 * src/stackovf.c: Avoid compiler warnings.
4988 * m4/input.c: Likewise.
4989 * m4/module.c: Likewise.
4990 * m4/output.c: Likewise.
4991 * m4/path.c: Likewise.
4992 * m4/symtab.c: Likewise.
4993 * m4/syntax.c: Likewise.
4995 2006-07-20 Eric Blake <ebb9@byu.net>
4997 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
4998 Regenerate to explicitly ask for --assume-autoconf=2.60.
5000 2006-07-19 Eric Blake <ebb9@byu.net>
5002 * po/ChangeLog: Merge into main ChangeLog, then delete file.
5005 * doc/m4.texinfo (copying): Relax restriction on front-cover and
5008 2006-07-17 Eric Blake <ebb9@byu.net>
5010 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
5013 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5015 * modules/format.c (includes): Use xvasprintf.h.
5016 (format): Make static. Avoid buffer overflow, that can lead to
5017 arbitrary code execution exploit. Only pass unsigned char to
5018 is*(). Support F, g, and G specifiers.
5019 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
5022 2006-07-17 Gary V. Vaughan <gary@gnu.org>
5024 Ensure M4 compiles correctly with -DDEBUG, and use a single
5025 consistent definition of various /DEBUG_[A-Z]+/ symbols:
5027 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
5028 (m4_print_token): Use m4_get_symbol_value_text and
5029 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
5030 and VALUE_FUNC respectively.
5031 (m4__next_token): Use m4_print_token call instead of obsolescent
5033 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
5034 * m4/output.c: Similarly for DEBUG_OUTPUT.
5035 * m4/path.c: Similarly for DEBUG_INCL.
5036 * m4/symtax.c: Similarly for DEBUG_SYM.
5037 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
5038 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
5039 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
5040 preprocessor macros defined with -DDEBUG compiles.
5042 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
5044 * bootstrap: Correct typo in --download-po argument parsing.
5046 2006-07-15 Eric Blake <ebb9@byu.net>
5048 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5050 * tests/generate.awk (normalize): Recognize @tabchar.
5051 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
5052 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
5054 (Index macro, Shell commands, Incompatiblities): Rename nodes
5055 from Index, UNIX commands, Other incompat.
5056 (Platform macros, Using frozen files, Frozen file format 1)
5057 (Frozen file format 2, Copying This Manual, Indices): New nodes.
5058 * Makefile.am (EXTRA_DIST): Distribute gendocs.
5059 (MAINTAINERCLEANFILES): Clean up files from gnulib.
5060 (doc_m4_TEXINFOS): Depend on fdl.texi.
5061 (web-manual): New maintainer target.
5063 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5065 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
5066 the modular architecture of M4. The result is paraphrased here
5067 for the benefit of future readers of the manual.
5069 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
5071 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5073 2006-07-14 Eric Blake <ebb9@byu.net>
5075 * src/main.c (main): Avoid compiler warning.
5076 * modules/gnu.c (renamesyms): Remove unused variable.
5078 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5080 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
5081 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
5082 new functions for managing regexp syntax options.
5083 * m4/m4private.h (m4): Add regexp_syntax field.
5084 * m4/resyntax.c: New file implements the above.
5085 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
5086 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
5087 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
5088 (m4_patsubst_do, m4_renamesyms_do): Removed.
5089 (builtin_changeresyntax): New builtin to change regular expression
5091 (m4_resyntax_encode_safe): Factor out diagnostics code.
5092 * src/freeze.c (produce_resyntax_dump): New function to dump
5093 default regexp syntax specifier to frozen file.
5094 (reload_frozen_state): Updated to action 'R' directive.
5095 * src/main.c (usage): Describe new -r option.
5096 (long_options, OPTSTRING): Declare it.
5097 (main): Encode and store cli regexp syntax option argument.
5098 * tests/freeze.at (regexp syntax): New test that regexp syntax
5100 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
5101 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
5102 (Epatsubst and Patsubst): Renamed to...
5103 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
5104 documentation and added new examples.
5105 (Changeresyntax): New section describing changeresyntax builtin,
5106 and regexp syntax names.
5107 (Regular expression syntax): New section describing differences
5108 between various regular expression syntaxes.
5109 (Frozen files): Document 'R' directive.
5112 2006-07-13 Gary V. Vaughan <gary@gnu.org>
5114 * bootstrap: Enhanced to work more like our other scripts:
5115 Add a copyright statement; support --version and --help; accept a
5116 --download-po option with argument as a substitute for DOWNLOAD_PO
5119 2006-07-11 Eric Blake <ebb9@byu.net>
5121 * Makefile.am (doc/m4.1): Port patch from branch that avoids
5123 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
5126 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
5128 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
5129 that `\0' is no longer accepted.
5131 * src/main.c (usage): Alphabetize options within their sections.
5133 * modules/gnu.c (m4_regexp_search, regsub, substitute)
5134 (esyscmd): Improve comments.
5136 * modules/gnu.c (substitute): Remove old warning for \0.
5137 (substitute_warned): No longer required. Removed.
5139 * modules/gnu.c: Put macro definitions into alphabetical order.
5141 2006-07-07 Eric Blake <ebb9@byu.net>
5143 * tests/freeze.at (loading format 1): New file, with new test.
5144 * tests/testsuite.at: Include it.
5145 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
5146 * tests/modules.at (Freezing modules): Likewise.
5148 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
5149 (AC_CHECK_HEADERS): Assume signal.h.
5150 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
5151 (AC_CHECK_FUNCS_ONCE): Likewise.
5152 * src/m4.h (includes): Assume signal.h.
5154 2006-07-05 Eric Blake <ebb9@byu.net>
5156 Fix all testsuite failures on cygwin.
5157 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
5158 branch-1_4. Solves testsuite failure when uninstalled m4 is
5159 shadowed by redefinition of PATH in libtool wrapper.
5160 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
5161 contains the -no-undefined required by cygwin.
5162 (TESTS_ENVIRONMENT): Export abs_top_builddir.
5163 * tests/others.at (misc): Port to platforms where /etc/passwd
5164 does not exist or does not contain user named root.
5165 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
5167 * tests/builtins.at (define, divert): Avoid overquoting.
5168 * tests/generate.awk (new_group): Likewise.
5170 2006-07-05 Gary V. Vaughan <gary@gnu.org>
5172 The regs_allocated field in a struct re_pattern_buffer refers
5173 to the state of a particular re_registers struct when used in
5174 successive matches using the same compiled pattern. Avoid a
5175 SEGV in `renamesyms' resulting from using a new re_registers
5176 with an existing re_pattern_buffer:
5178 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
5179 pattern buffer and registers.
5180 (m4_regexp_search): New function to call re_regexp_search with
5181 correctly matched pattern buffer and register instantiations.
5182 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
5185 2006-07-04 Gary V. Vaughan <gary@gnu.org>
5187 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
5188 changes to gnulib getopt.m4 since last build.
5189 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
5190 if the system getopt fails M4_GETOPT tests.
5192 2006-06-22 Eric Blake <ebb9@byu.net>
5194 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
5195 Reported by Bruno Haible.
5197 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5199 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
5201 2006-06-19 Eric Blake <ebb9@byu.net>
5205 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5207 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
5208 (clean-local): Split into and depend upon...
5209 (clean-local-tests, clean-local-src): ...these two. The latter
5210 removes the libtool object directory below `src', to work around
5211 a buglet in Automake, failing to list it.
5212 (EXTRA_DIST): Distribute modules/perl.c.
5214 2006-06-19 Eric Blake <ebb9@byu.net>
5216 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
5217 right side of dependency; VPATH does that.
5218 (stamp-vcl): Update to use libtool's algorithm.
5219 (EXTRA_DIST): Distribute stamp-vcl.
5220 Reported by Ralf Wildenhues.
5221 (TESTSUITE): Revert earlier change that used absolute path, as
5222 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
5223 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
5224 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
5225 atlocal takes care of it instead.
5226 (check-local, installcheck-local, clean-local): Inline absolute
5227 path to testsuite here, rather than relative path to testsuite
5230 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5232 * m4/m4private.h (DELETE): Cast away const here...
5233 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
5234 * src/freeze.c (reload_frozen_state): Avoid uninitialized
5237 2006-06-19 Eric Blake <ebb9@byu.net>
5239 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
5240 .info pages are built.
5241 Reported by Ralf Wildenhues.
5242 (EXTRA_DIST): Inline definition of testsuite, so that make dist
5245 2006-06-16 Eric Blake <ebb9@byu.net>
5247 Follow recommendations from autoconf manual for autotest.
5248 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
5249 turn it into an absolute path until autotest provides an option
5250 that allows us to avoid changing directories. Properly quote
5252 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
5253 (check-recursive): Delete unused target.
5254 ($(TESTSUITE)): Atomically update testsuite.
5255 (CD_TESTDIR): Simplify.
5256 (m4__cd): Delete unused macro.
5257 (check-local): Let TESTSUITEFLAGS influence the run.
5258 (installcheck-local): Let TESTSUITEFLAGS override
5259 AUTOTEST_PATH. Add dependencies.
5260 (clean-local): Clean up.
5261 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
5262 * README: Document how to use the testsuite.
5264 2006-06-15 Eric Blake <ebb9@byu.net>
5266 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
5268 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
5269 clashes with m4sugar.
5270 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5271 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5272 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5273 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5274 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5275 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5276 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5277 * configure.ac: Likewise.
5278 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5279 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5281 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5283 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
5284 const mpq_t is not assignable from plain mpq_t. Avoid
5285 type-punning warnings caused trying to mix these types.
5286 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5287 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5288 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5289 (mult_term, exp_term): Remove type-punning casts.
5290 (numb_pow): Remove const qualifier.
5291 * src/freeze.c (reload_frozen_state): Fix typo in messages.
5292 Fix variables that can be used uninitialized, which fixes
5293 security hole where malicious frozen file can execute arbitrary
5296 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5298 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5300 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5301 and Eric Blake <ebb9@byu.net>
5303 Allow `make dist' to work again.
5304 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5305 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5306 (cvs-dist): Fix typo.
5307 * NEWS: Match current version number.
5309 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5311 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
5314 * bootstrap: Do not run libtoolize manually, this is done
5315 correctly by autoreconf. Invoke autoreconf with --no-recursive
5316 to avoid unnecessary rerunning of autotools for libltdl.
5318 2006-06-13 Eric Blake <ebb9@byu.net>
5322 2006-06-12 Eric Blake <ebb9@byu.net>
5324 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5326 * src/m4.h: Don't declare mktemp.
5327 * m4/input.c (m4__next_token): Avoid bzero.
5328 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5329 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5330 than distributing outdated helptoman.pl.
5331 * doc/helptoman.pl: Delete.
5333 2006-06-10 Eric Blake <ebb9@byu.net>
5335 * README (Patches): Document the current dependence on CVS
5336 builds of autotools.
5337 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5338 * configure.ac: Use consistent quoting throughout.
5339 (AC_PREREQ): Bump to 2.59d.
5340 (AC_INIT): Package name begins with uppercase.
5341 (AC_ARG_WITH): Use AS_HELP_STRING.
5342 (AM_INIT_AUTOMAKE): Enable gnits mode.
5343 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5344 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5345 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5346 done by gnulib or automake, or which autoconf has declared
5348 * m4/m4private.h (Includes): Assume C89 or better, and use errno
5350 * m4/output.c (Includes): Likewise.
5351 * modules/gnu.c (Includes): Likewise.
5352 * modules/m4.c (Includes): Likewise.
5353 * src/m4.h (Includes): Likewise.
5355 * README-alpha: Update web address.
5356 * README: Likewise. Change encoding to ASCII. Remove old advice
5357 about cygwin. Document bootstrapping dependency.
5358 * AUTHORS: Update from branch-1_4.
5359 * THANKS: Likewise. Change encoding to UTF-8.
5360 * BACKLOG: Delete. This file is too old and unmaintained to be
5362 * ChangeLog: Change encoding to UTF-8.
5364 Avoid compiler warnings.
5365 * m4/macro.c (trace_format): Don't mark this as a printf format,
5366 since we don't accept the same set of modifiers as printf. It
5367 would be nice if gcc let us specify a custom format archetype.
5368 * src/main.c (main): Cast away const.
5370 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
5371 Eric Blake <ebb9@byu.net>
5373 * modules/time.c (ctime): Pass correctly typed variable to
5376 (localtime): Likewise.
5377 (strftime): Likewise.
5378 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5379 limit inherent in this interface.
5381 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
5383 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5384 (sysval): Use WEXITSTATUS.
5385 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5386 big-endian and little-endian wait status definitions.
5388 2006-05-06 Eric Blake <ebb9@byu.net>
5390 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5391 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5394 2006-05-06 Eric Blake <ebb9@byu.net>
5396 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5397 subdirectory to use.
5398 (support for -pipe): Move after LT_INIT, since it relies on
5401 2006-05-05 Eric Blake <ebb9@byu.net>
5403 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5407 2006-05-05 Bruno Haible <bruno@clisp.org>
5408 and Eric Blake <ebb9@byu.net>
5410 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5411 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5413 * bootstrap: Update usage of gnulib-tool.
5415 2006-05-04 Eric Blake <ebb9@byu.net>
5417 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5420 2005-12-05 Gary V. Vaughan <gary@gnu.org>
5422 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
5423 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5424 Reported by Eric Blake <ebb9@byu.net>
5426 2005-12-04 Gary V. Vaughan <gary@gnu.org>
5428 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5429 http caching as -C is no longer supported by wget 1.10.x.
5430 Reported by Eric Blake <ebb9@byu.net>
5432 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5434 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5436 (iface_id): ...an lt_dlinterface_id type.
5437 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
5438 throughout, instead of calling obsolete lt_dlhandle_find directly.
5439 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
5440 throughout, instead of calling obsolete lt_dlhandle_next.
5441 * m4/m4private.h (m4__module_find): Declare it.
5442 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5443 Use m4__module_next instead of obsolete lt_dlhandle_next.
5445 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5447 * bootstrap (func_update_po): Update pofiles directly from the
5448 translation project.
5449 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5450 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5451 these files under source control anymore.
5452 Suggested by Eric Blake <ebb9@byu.net>
5454 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5456 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
5457 file escaped the address updates on 2005-05-01.
5459 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5461 * bootstrap: Allow user overriding of gnulib-tool location, and
5462 correctly determine module source directories whether gnulib-tool
5463 is given as a relative or absolute path, or is found by searching
5465 Reported by Eric Blake <ebb9@byu.net>
5467 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5469 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5470 and $RM are defined for various versions of
5471 AC_LIBTOOL_COMPILER_OPTION.
5473 * bootstrap (AUTORECONF): New variable to allow user overriding of
5476 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5478 * doc/m4.texinfo (History): Add better notes on the ancestory of
5479 GNU m4, and other historical interest.
5481 2005-05-08 Gary V. Vaughan <gary@gnu.org>
5483 * m4/symtab.c (m4_symbol_rename): New function that performs a low
5484 level symbol rename.
5485 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5486 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5487 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5489 (erenamesyms, renamesyms): ...builtins that use these to implement
5490 macro renaming by regular expression.
5491 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5492 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5493 to stop the new generated tests from choking.
5495 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5497 Since most of the build is handled from a single Makefile.am now,
5498 we can teach make about the dependencies between the m4 binary and
5499 the preopened modules it is built against:
5501 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5503 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5504 of the preopened modules have changed.
5506 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5508 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5509 have a native implementation.
5511 2005-05-06 Gary V. Vaughan <gary@gnu.org>
5513 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
5514 handled already by gnu/exit.h.
5516 * configure.ac (gl_MODULES): Add assert to support a
5517 --disable-assert configure time option for NDEBUG setting.
5519 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5520 * bootstrap (src_modules): Add version-etc-fsf.
5521 * src/main.c (version_etc_copyright): Removed.
5523 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5525 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5527 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5529 * src/freeze.c (produce_frozen_state): Use \n line-endings even
5530 on Windows, so that the frozen file reader will work.
5531 Reported by Josef T. Burger <bolo@bolo.com>
5533 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
5535 Forward port of a patch that allowed m4-1.4.2 to compile on
5538 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
5540 * src/m4.h: And include them as appropriate.
5541 * src/main.c, src/stackovf.h: Don't include signal.h literally;
5542 m4.h will include the correct file.
5544 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5546 * m4/m4private.h: Make errno visible for the sources patched
5549 2005-05-04 Paul Eggert <eggert@twinsun.com>
5551 * src/main.c (print_program_name_CB): Preserve errno, since
5552 M4ERROR relies on this.
5553 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
5554 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
5555 * m4/path.c (m4_path_search): Don't let "free" trash errno when
5558 * m4/output.c (m4_insert_file): Don't assume errno has a valid
5559 value simply because fread returns zero. This fixes a
5560 portability bug reported by Marion Hakanson in
5561 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
5563 2005-05-04 Santiago Vila <sanvila@debian.org>
5565 * tests/stackovf.test: Use tempfile if available.
5567 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
5569 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
5570 * m4/output.c (m4_insert_file): Do not mix buffered and
5571 unbuffered I/O, as this breaks on the Hurd.
5573 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5575 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
5576 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
5577 and libtoolize does a better job of ltdl importing now too, so
5578 take advantage of that while updating the tree:
5580 * acm4, config: Moved from here...
5581 * ltdl/m4, ltdl/config: ...to here.
5582 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
5583 src/Makefile.am, tests/Makefile.am: Removed...
5584 * Makefile.am: ...and migrated to here, with adjustments to
5585 compensate for relative path differences.
5586 * commit: Adjust relative paths.
5587 * configure.ac: Adjust relative paths.
5588 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
5590 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
5591 the meanwhile, CVS HEAD libtool is needed.
5592 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
5593 stricly new enough, we also need a patch.
5594 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
5595 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
5596 (gl_MODULES): Don't list getopt and version-etc, as they don't
5598 * bootstrap: After running gnulib-tool to import the listed
5599 modules, fetch getopt and version-etc into src manually.
5600 (ltdldir): Change to ltdl.
5601 * src/main.c: Adjust for changes in version-etc API.
5602 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
5603 but works when the getopt module isn't to be included in the lib.
5604 * README: Add note about patching autoconf and automake to
5607 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
5609 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
5610 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
5611 empty file rather than to a nonexistent file. This closes a
5612 common security hole.
5613 * modules/m4.c (m4_maketemp): Implement the above, by using
5614 mkstemp rather than mktemp.
5616 2005-05-01 Gary V. Vaughan <gary@gnu.org>
5618 The FSF are moving offices today. Changed their contact address
5619 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
5620 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
5622 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5624 * tests/Makefile (clean-local): Ignore testsuite cleanup
5627 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
5629 * tests/Makefile (clean-local): Only run the testsuite cleanup
5630 if the testsuite has been generated.
5632 2005-02-11 Stepan Kasal <kasal@ucw.cz>
5634 * TODO: slight clarification of the example of qindir usage.
5636 2005-02-08 Gary V. Vaughan <gary@gnu.org>
5638 * TODO: Add qindir requirement, and defn bug.
5639 From Stepan Kasal <kasal@ucw.cz>
5641 2005-02-08 Stepan Kasal <kasal@ucw.cz>
5643 * TODO: Add ``execution stack'', fix a typo.
5644 * doc/m4.texinfo: Typos.
5646 2004-12-24 Eric Blake <ebb9@byu.net>
5648 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
5649 to the gnu subdirectory.
5650 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
5651 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
5652 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
5653 * m4/system_.h: Likewise, in non-configured includes.
5655 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
5656 Gary V. Vaughan <gary@gnu.org>
5658 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
5659 Protect definitions from macro expansion under -DNDEBUG by
5660 parenthesising the expanded function names.
5661 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5662 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5663 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5664 (m4_is_syntax_macro_escaped): Similarly protect function
5665 definitions from macro expansion under -DNDEBUG by #undefing the
5666 matching macro names before each definition. Also, move all the
5667 function definitions to the end of the file so that any
5668 invocations in the rest of the file pick up the fast macro
5670 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
5671 (m4_set_debug_file, m4_set_trace_messages)
5672 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5673 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5674 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
5675 option setter functions.
5677 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5679 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
5682 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5684 * src/main.c: Include gnulib files from the correct directory.
5686 * gnulib/*: Don't store any of the gnulib files in arch, as they
5687 generate spurious changes.
5688 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
5689 gnulib macros now share our macro directory.
5690 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
5691 * bootstrap: Call gnulib-tool to import from the gnulib tree.
5692 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
5693 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
5694 the gettext macros from autopoint that overwrite the gnulib-tool
5695 imported versions. Import sources and Makefile.am into the `gnu'
5696 directory. Changed all callers.
5697 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
5698 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
5699 for imported modules.
5700 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
5701 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
5702 hardcoding the gnulib macros they wrap.
5704 2004-07-15 Gary V. Vaughan <gary@gnu.org>
5706 Latest CVS libtool can preload modules in libraries, including
5707 its own module loaders! Tweak m4 so that it doesn't try to treat
5708 libltdl's module loaders as m4 modules when freezing and on exit:
5710 * gnulib/acm4/*.m4: Don't store these files in arch since they
5711 generate spurious changes.
5712 * bootstrap: Simplify initial libtoolize call, since CVS
5713 libtoolize is smarter these days.
5714 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
5716 * m4/module.h (m4__module_exit): Missing declaration.
5717 * m4/m4private.h (m4__module_next): New function declaration.
5718 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
5719 encapsulation. Changed all callers.
5720 (m4__module_interface): New function to verify m4 loadable module
5722 (m4__module_init): Register the interface validator.
5723 (m4__module_exit): Only close my own modules.
5724 * modules/m4.c (unistd.h): Provide missing declaration.
5725 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
5726 (m4_expand_ranges): More missing declarations.
5727 * modules/modtest.c (export_test): Ditto.
5728 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
5729 * src/main.c (main): Bump copyright year.
5730 * tests/modules.at: Fix sed syntax error.
5733 2004-06-17 Gary V. Vaughan <gary@gnu.org>
5735 Tweaking to enable compilation with latest CVS libtool and
5736 libltdl. We can't just dump the library files directly into the
5737 m4 directory anymore now that libltdl is built from pieces itself:
5739 * bootstrap: Rewritten to use latest libtoolize sanely, and to
5740 set up libltdl subdirectory.
5741 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
5742 gnulib subdirectory's config.
5743 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
5744 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
5746 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
5747 configure.ac, so use AC_WITH_LTDL instead.
5748 * Makefile.am (SUBDIRS): Add libltdl.
5749 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
5751 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
5752 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
5753 (libm4_la_LIBADD): Add LIBLTDL.
5754 * m4/ltdl.c, m4/ltdl.h: Removed.
5755 * m4/m4module.h: Include canonical ltdl.h.
5758 2004-06-14 Gary V. Vaughan <gary@gnu.org>
5760 * gnulib/import: Now updates makefile fragments, and configure.ac.
5761 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
5762 * gnulib/m4/Makefile.am: include it.
5763 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
5764 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
5765 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
5766 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
5767 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
5768 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
5769 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
5770 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
5771 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5772 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5773 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5774 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
5775 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
5777 * gnulib/m4/getopt_int.h: New source file from latest gnulib
5779 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
5780 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
5781 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
5782 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
5783 Updated source files from latest gnulib.
5785 2004-02-29 Gary V. Vaughan <gary@gnu.org>
5787 * config/mailnotify: New file for mailing commit notifications,
5788 imported from cvs-utils.
5789 * commit: Updated from cvs-utils and tweaked for m4.
5791 2003-12-01 Gary V. Vaughan <gary@gnu.org>
5793 * config/mkstamp: Updated from CVS libtool.
5794 * configure.ac: Generate a gnu coding standards compliant version
5795 number, and use it for the banner.
5796 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
5797 mhen the TIMESTAMP changes in ChangeLog, but the file modification
5798 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
5799 contain the previous version number.
5800 * src/main.c: Make --version output conform to the GNU standard.
5802 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
5803 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
5804 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
5805 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
5806 time_la_SOURCES): ...so that these are defaulted correctly, and
5807 can be removed from this file.
5808 (AM_LDFLAGS): Add -module...
5809 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
5810 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
5811 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
5812 the individual settings can be removed.
5813 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
5814 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
5815 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
5816 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
5817 time_la_LIBADD): ...so that these are picked up as a deplib of
5818 libm4 and don't need to be set explicitly.
5820 2003-11-18 Gary V. Vaughan <gary@gnu.org>
5822 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
5823 from the standard build. It is too fragile.
5825 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5826 CVS libtool after merging m4 changes across to libtool.
5828 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5829 * m4/path.c (search_path_add): Ditto.
5831 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5833 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5834 libtool tags we don't use in configure. This reduces the size
5835 of the script from over 1Mb to under 700Kb.
5837 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5839 The import script was not written properly, and the last gnulib
5840 import was incomplete. Fixed that problem, and reimport our
5841 gnulib dependencies, which picks up the address calculation
5842 overflow checks described by Paul below. Also tweak the clients
5843 of the gnulib xalloc module not to use deprecated macros:
5845 * gnulib/import: Recurse through module dependencies rather than
5846 naively descending only one level.
5847 * configure.ac: Add calls to gnulib's strnlen and extension module
5849 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5851 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5852 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5853 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
5854 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
5856 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
5857 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
5858 place of `xcalloc (1, S)'.
5859 * m4/m4.c (m4_create): Likewise.
5860 * m4/m4private.h (m4_symbol_value_create): Likewise.
5861 * m4/symtab.c (symtab_fetch): Likewise.
5862 * m4/syntax.c (m4_syntax_create): Likewise.
5863 * src/freeze.c (reload_frozen_state): Likewise.
5864 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
5866 * m4/symtab.c (m4_symtab_create): Likewise.
5868 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5870 * tests/module.at: Comment typo.
5872 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5874 * tests/modules.at (modules: importing): Apply some lateral
5875 thinking, and use AT_CHECK to compare the output of a sed pass
5876 over stderr against the canonical strerror string.
5878 * tests/modules.at (modules: importing): Edit the generated stderr
5879 output to canonicalize strerror output, before a comparison.
5881 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5883 Tru64UNIX perl is sloppy with namespace pollution. This patch is
5884 careful not to trip over the mess:
5886 * modules/perl.c: Some builds of perl install headers that contain
5887 `#define try __builtin_try'. Be sure to undefine that macro
5888 before `m4/hash.h' gets included, which uses the `try' symbol.
5889 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
5890 `false' before including `stdbool.h'.
5891 (DELETE): This symbol is not in m4's namespace, and is in any
5892 case only used internally...
5893 * m4/m4private.h (DELETE): ...so move it to here.
5894 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
5896 2003-10-08 Paul Eggert <eggert@twinsun.com>
5898 Don't use XMALLOC and XCALLOC. Once we install the
5899 corresponding patch into gnulib, this will fix some
5900 address-calculation overflow bugs on hosts where calloc (A, B)
5901 returns garbage when A*B overflows.
5903 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
5904 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
5905 xmalloc, XCALLOC with xcalloc.
5906 * m4/m4.c (m4_create): Likewise.
5907 * m4/m4private.h (m4_symbol_value_create): Likewise.
5908 * m4/output.c (m4_output_init): Likewise.
5909 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
5910 * m4/syntax.c (remove_syntax_attribute): Likewise.
5911 * src/freeze.c (reload_frozen_state): Likewise.
5912 * src/main.c (main): Likewise.
5914 2003-10-07 Gary V. Vaughan <gary@gnu.org>
5916 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
5917 gnulib/acm4 directories for aclocal m4 macros.
5918 * gnulib/Makefile.am (EXTRA_DIST): Removed.
5919 (MAINTAINERCLEANFILES): Add Makefile.in.
5920 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
5922 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
5923 * gnulib/import: New file. Temporary script for updating gnulib
5924 imported files, until gnulib-tool is working.
5925 * gnulib/config/codeset.m4, gnulib/config/error.m4,
5926 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
5927 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
5928 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
5929 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
5930 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
5931 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
5932 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
5933 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
5934 gnulib/config/nls.m4, gnulib/config/obstack.m4,
5935 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
5936 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
5937 gnulib/config/regex.m4, gnulib/config/restrict.m4.
5938 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
5939 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
5940 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
5941 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
5942 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
5943 gnulib/config/xstrndup.m4: Removed.
5944 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
5945 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
5946 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
5947 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
5948 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
5949 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
5950 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
5951 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
5952 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
5953 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
5954 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
5955 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
5956 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
5957 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
5958 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5959 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
5960 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
5961 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5962 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5963 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
5964 gnulib/import script.
5965 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
5966 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
5967 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5968 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
5969 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
5970 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
5971 gnulib with gnulib/import script.
5972 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
5973 guards ready for gnulib-tool to autoupdate on import.
5974 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
5975 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
5976 config/stackovf.m4: Moved from here...
5977 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
5978 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
5979 acm4/stackovf.m4: ...to here, to separate aclocal macros from
5980 configure time helper scripts.
5981 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
5982 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
5983 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
5984 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
5986 * src/main.c (version_etc_copyright): Only output the current
5988 (version_etc): Call with new variadic API.
5990 2003-09-16 Gary V. Vaughan <gary@gnu.org>
5992 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
5993 version-etc module from CVS gnulib.
5994 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
5995 * src/Makefile.am: Build it.
5996 * src/main.c: Use it.
5998 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
5999 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
6000 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
6003 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
6004 Gary V. Vaughan <gary@gnu.org>
6006 * bootstrap: Separate options.
6007 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
6008 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
6010 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
6011 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
6012 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
6013 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
6014 $(LTLIBINTL) for gettext support on cygwin.
6015 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
6016 have $(LTLIBINTL) from the preloaded module la files.
6017 * README: Remove the warning about using --disable-nls on Windows
6020 2003-09-15 Gary V. Vaughan <gary@gnu.org>
6022 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
6023 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
6026 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6028 * doc/STYLE: Document the gnulib header naming conventions, and
6030 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
6031 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
6032 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
6034 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
6036 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
6037 module from CVS gnulib.
6038 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
6039 (gl_FUNC_STRTOL): In favour of the module macro.
6041 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6043 Replace the getopt code with CVS gnulib getopt. The source files
6044 detect whether they are in a glibc environment and preprocess away
6045 all of the code if there is a system getopt, so we can compile
6046 them into the m4 executable unconditionally:
6048 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
6049 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
6050 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
6052 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
6054 * src/Makefile.am: Adjust.
6055 * src/main.c: Always include our shipped getopt.h.
6056 * po/POTFILES.in: Use new location of getopt.c.
6058 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6060 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
6061 * config/Makefile.am: Removed. Automake 1.8 distributes the files
6062 in this directory automatically.
6063 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
6065 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
6067 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
6069 * modules/Makefile.am (pkglibexecdir): Set it here.
6070 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
6072 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
6073 Import regex module from CVS gnulib.
6074 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
6075 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
6076 do extra substitutions for Makefile.
6077 * configure.ac: Use it.
6078 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
6079 from regex_.h if necessary.
6080 * m4/system_.h: Include the correct version of regex.h.
6081 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
6083 * po/POTFILES.in: Use new location of regex.c.
6085 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
6086 realloc.c: automake distributes these files already.
6088 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6090 Replace the xstrzdup code by importing the xstrndup module from
6091 CVS gnulib, along with its dependencies: strndup and strnlen:
6093 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
6094 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
6096 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
6097 gnulib/config/strndup.m4: Ditto wrt strndup.
6098 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
6100 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
6101 However, contrary to gnulib, we install xstrndup.h.
6102 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
6103 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
6104 is an artifact of the old m4 portability layer.
6105 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
6106 * m4/system_.h: Include xstrndup.h.
6107 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
6109 2003-09-11 Gary V. Vaughan <gary@gnu.org>
6111 Reimport the latest xalloc module from CVS gnulib, and adjust the
6112 m4 sources to take advantage of xalloc xfree. Also create a new
6113 macro DELETE with the same semantics as the old m4 XFREE macro,
6114 and carefully tweak callers:
6116 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
6118 * m4/utility.c (xfree): Removed. This function is now supplied by
6120 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
6121 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
6122 * m4/symtab.c (m4_symtab_create): Ditto.
6123 * m4/system_.h: Removed XFREE redefine.
6124 (DELETE): New macro with same functionality as the original m4
6125 XFREE macro, but based on xalloc.h now. Changed all callers.
6126 * src/main.c (main): Use XMALLOC macro.
6127 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
6129 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
6131 2003-09-10 Gary V. Vaughan <gary@gnu.org>
6133 Import the xalloc module from CVS gnulib, along with its
6134 dependencies: exitfail, malloc and realloc. We had different
6135 semantics for our XFREE and a function xfree() not supplied by
6136 gnulib, so also a bit of work to keep everything running
6139 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
6140 (gl_XALLOC): Use gnulib equivalents.
6141 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
6142 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
6143 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
6144 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
6146 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
6147 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
6148 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
6150 (pkgincdir): Removed. Use pkgincludedir instead.
6151 * m4/m4private.h (XFREE): xfree already checks for NULL.
6152 * m4/system_.h: Use xalloc module, and remove macros already
6153 supplied by xalloc.h.
6154 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
6155 moved the old definition from m4/xmalloc.c to here for now.
6157 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6159 Import the error and progname modules from CVS gnulib. Our old
6160 error.c subsumed the functionality of both, so a little adjustment
6161 was required to accomodate the split in sources. Also added more
6162 wrapper macros to choose between a system installed error.h or our
6163 shipped gnulib error module:
6165 * m4/error.c, m4/error.h: Removed.
6166 * m4/Makefile.am: Adjust.
6167 (pkgincdir): Removed. Use pkgincludedir instead.
6168 * m4/module.h, src/main.c: Don't include `m4/error.h'.
6169 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
6171 * gnulib/m4/progname.c: Imported from CVS gnulib.
6172 * gnulib/m4/progname.h: Ditto.
6173 * src/main.c: Adjust to use progname module.
6174 * gnulib/m4/error.c: Imported from CVS gnulib.
6175 * gnulib/m4/error_.h: Ditto.
6176 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
6177 if appropriate, and link a local error.h if the system version is
6179 (libgnu_la_SOURCES) Add progname module sources.
6180 * gnulib/config/error.m4: Imported from CVS gnulib.
6181 * gnulib/config/strerror_r.m4: Ditto.
6182 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
6183 to have ERROR_H for Makefile substitutions and tell system.h
6184 whether the system error.h should be used, or a locally installed
6186 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
6188 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6190 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
6191 s/gettext_.h/gettext.h/.
6193 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
6194 automake have been fixed.
6196 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
6197 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
6198 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
6199 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
6201 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6203 The gnulib obstack module requires the gnulib gettext module for
6204 systems that do not have GNU gettext installed. Because we use
6205 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
6206 that directory incase it clashes with the system gettext.h. This
6207 delta uses gettext_.h and extra rules in the Makefile to make a
6208 link to gettext.h when needed:
6210 * Makefile.am (auxdir): Removed. No longer used.
6211 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
6212 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
6214 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
6215 Makefile based build.
6216 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
6217 of the macros are kept.
6218 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
6219 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
6220 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
6221 distributes these automatically.
6222 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
6223 warning from automake-1.7a.
6224 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
6225 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
6227 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
6228 wrt. m4_FUNC_OBSTACK.
6229 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
6230 wrt. m4_sys_STACKOVF.
6231 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
6232 wrt. _m4_LIB_GMP, m4_LIB_GMP.
6233 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
6234 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
6236 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
6237 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
6238 gettext.h link on deficient systems.
6239 (pkginc_HEADERS): Mention $(GETTEXT_H).
6240 (EXTRA_HEADERS): Mention gettext.h.
6241 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
6242 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
6243 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6244 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
6245 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6246 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6247 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6248 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
6249 gnulib/config/po.m4, gnulib/config/progtest.m4,
6250 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
6251 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
6253 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6255 We can't mirror the gnulib directory structure here, since we need
6256 to be able to eg. `#include <m4/obstack.h>' from our source files,
6257 which is much easier if the local obstack.h is created in a
6258 directory named m4. Rather than trying to symlink everything into
6259 the m4 directory, now we build a libtool convenience library from
6260 the sources we get from gnulib and link that with libm4.la:
6262 * gnulib/config/extensions.m4: Imported from CVS gnulib.
6263 * gnulib/config/unlocked-io.m4: Ditto.
6264 * gnulib/m4/unlocked-io.h: Ditto.
6265 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
6266 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
6267 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
6268 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
6269 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
6270 * m4/Makefile.am: Adjust.
6271 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6272 macros we redistribute.
6273 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
6274 library among others.
6275 (GNULIB_SRCS, GNULIB_MACROS): Removed.
6276 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6277 * config/m4-obstack.m4: Adjust.
6278 * po/POTFILES.in: Adjust.
6279 * configure.ac: Reformatting. Call newly imported gnulib macros.
6280 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6281 bogus calls of `#include "m4.h"'.
6282 * Makefile.am: INCLUDES has been deprecated in favour of
6284 * m4/Makefile.am: Ditto.
6285 * modules/Makefile.am: Ditto.
6286 * src/Makefile.am: Ditto.
6288 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6290 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6292 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6294 Migrate the obstack support into the gnulib directories for easy
6295 synchronisation with upstream files in gnulib:
6297 * config/gnu-obstack.m4: Moved from here...
6298 * config/m4-obstack.m4: ...to here.
6299 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6300 * m4/obstack.c, m4/obstack_.h: Moved from here...
6301 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6302 * po/POTFILES.in: Adjust.
6303 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6304 * m4/Makefile.am: Add a whole new section to link the obstack
6305 sources from the gnulib tree if necessary.
6306 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6308 * config/m4-obstack.m4: Rewrite as a wrapper for
6309 gnulib/m4/obstack.m4.
6311 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6313 GNU M4 currently builds with a number of files adapted from
6314 upstream sources. Recently the gnulib project on savannah.gnu.org
6315 has pulled together a great many of these externally maintained
6316 files. This delta is the beginnings of isolating those files
6317 maintained in gnulib to make it easy to synchronise M4 with the
6318 upstream files prior to releases.
6320 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6322 (SUBDIRS): Added new gnulib subdirectory.
6323 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6324 * config/stdbool.m4: Moved from here...
6325 * gnulib/m4/stdbool.m4: ...to here.
6326 * m4/stdbool_.h: Moved from here...
6327 * gnulib/lib/stdbool_.h: ...to here.
6328 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
6330 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6331 code to work with new stdbool_.h location.
6332 (gnulib_srcdir): New.
6334 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6336 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6337 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6339 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
6340 (EXTRA_DIST): Use it.
6342 * bootstrap: CVS autoreconf leaves file droppings. Remove
6343 aclocal.m4t incase autoreconf doesn't.
6345 2003-08-29 Gary V. Vaughan <gary@gnu.org>
6347 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
6348 the other gnulib imports, renamed to m4/obstack_.h.
6349 * m4/obstack.c: Updated from CVS gnulib.
6350 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6351 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6352 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
6353 about vpath already, and $top_srcdir upsets CVS Automake, so the
6354 $top_srcdir reference was removed.
6356 * m4/system-h.in: For consistency with the gnulib imports, renamed
6358 * m4/Makefile (EXTRA_HEADERS): Adjust.
6359 * configure.ac (AC_CONFIG_FILES): Adjust.
6361 * m4/stdbool_.h: New file from gnulib for systems without their
6363 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6364 * config/stdbool.m4: New file. Macros from gnulib for same.
6365 * configure.ac: Use it.
6367 2003-08-27 Gary V. Vaughan <gary@gnu.org>
6369 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6370 * config/gmp.m4: Ditto.
6371 * config/gnu-obstack.m4: Ditto.
6372 * config/stackovf.m4: Ditto.
6373 * m4/builtin.c: Ditto.
6374 * m4/debug.c: Ditto.
6375 * m4/error.c: Ditto.
6376 * m4/error.h: Ditto.
6377 * m4/gnu-obstack.h: Ditto.
6380 * m4/input.c: Ditto.
6382 * m4/m4module.h: Ditto.
6383 * m4/m4private.h: Ditto.
6384 * m4/macro.c: Ditto.
6385 * m4/module.c: Ditto.
6386 * m4/obstack.c: Ditto.
6387 * m4/output.c: Ditto.
6389 * m4/regex.c: Ditto.
6390 * m4/regex.h: Ditto.
6391 * m4/strtol.c: Ditto.
6392 * m4/symtab.c: Ditto.
6393 * m4/syntax.c: Ditto.
6394 * m4/utility.c: Ditto.
6395 * m4/xmalloc.c: Ditto.
6396 * m4/xstrdup.c: Ditto.
6397 * m4/xstrzdup.c: Ditto.
6398 * modules/evalparse.c: Ditto.
6399 * modules/format.c: Ditto.
6400 * modules/gnu.c: Ditto.
6401 * modules/import.c: Ditto.
6402 * modules/load.c: Ditto.
6403 * modules/m4.c: Ditto.
6404 * modules/m4.h: Ditto.
6405 * modules/modtest.c: Ditto.
6406 * modules/mpeval.c: Ditto.
6407 * modules/perl.c: Ditto.
6408 * modules/shadow.c: Ditto.
6409 * modules/stdlib.c: Ditto.
6410 * modules/time.c: Ditto.
6411 * modules/traditional.c: Ditto.
6412 * src/freeze.c: Ditto.
6413 * src/getopt.c: Ditto.
6414 * src/getopt1.c: Ditto.
6416 * src/main.c: Ditto.
6417 * src/stackovf.c: Ditto.
6419 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6420 ac_default_headers is an autoconf internal variable.
6421 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6422 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6424 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6425 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6428 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6430 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6432 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6433 possible or faking one with a typedef. Changed all callers.
6435 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6437 Still cleaning up the users' module API, by taking out the stuff
6438 that isn't used by any existing modules, and moving specialised
6439 functions out of libm4 and into the module they are used by.
6441 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
6442 * m4/utility.c (m4_skip_space): ...to here the home of its only
6443 use, made static and renamed to `skip_space'. Changed all
6445 * m4/m4module.h (m4_expand_ranges): Removed prototype.
6446 * m4/utility.c (m4_expand_ranges): Moved definition from here...
6447 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6449 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6451 * modules/gnu.c (builtin_syntax): Import and use in this
6452 builtin implementation.
6453 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6455 * m4/macro.c (trace_flush): Except here where the macro is now
6457 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6458 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6460 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6461 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6463 2003-08-14 Gary V. Vaughan <gary@gnu.org>
6465 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6466 compiler based AC_CHECK_HEADER that was introduced in
6468 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6469 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6470 * configure.ac: Use renamed M4_AC_LIB_GMP.
6472 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6473 macro that requires arguments! This stops the shell's bad
6474 substitution error at configure time.
6476 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6477 variables to the testsuite shell. Set the value of USE_GMP so
6478 that the gmp test will run!
6479 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6481 2003-08-11 Gary V. Vaughan <gary@gnu.org>
6483 Libltdl already has an excellent mechanism for accessing C symbols
6484 in modules. Lets use that! Remove all the exporting cruft and
6485 just use lt_dlsym in conjunction with a few conventions to
6486 simplify module writers' jobs. Also removed the table address
6487 caching code and otherwise simplified the module loader quite a
6488 bit. To access exported symbols in other modules, first the
6489 exporting module must name the symbols <modname>_LTX_<symname>,
6490 and the importing module must define a function type called
6491 <symname>_func. The importer then adds
6492 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6493 that wishes to call out to the exported functions. Care must be
6494 taken that <symname> is non-NULL in the importing module incase
6495 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6496 definition was in the importers source. Study
6497 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
6498 m4_module_import will attempt to automatically load a module
6499 required for symbol access if it is not loaded already.
6501 * TODO: Removed the items fixed in this delta.
6502 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6504 * m4/ltdl.h (lt_dlhandle_find): Declare it.
6505 * m4/module.c (m4_module_unload): Use it.
6506 * src/freeze.c (reload_frozen_state): Ditto.
6507 * m4/m4module.h (m4_export): Deleted. Removed all references.
6508 (M4_MODULE_IMPORT): New user convenience macro for importing
6509 arbitrary symbols from other modules.
6510 * m4/module.c (m4_module_import): New function to service
6511 M4_MODULE_IMPORT macro.
6512 (module_data): Removed. Looking up the tables on demand with
6513 lt_dlsym, rather than caching their addresses here simplifies the
6515 (m4_get_module_builtin_table, m4_get_module_macro_table):
6516 Removed. Changed all callers.
6517 (set_module_macro_table, set_module_builtin_table): Renamed to
6518 install_macro_table and install_builtin_table respectively, and
6519 simplified now that the cache is no more.
6520 * modules/gnu.c (builtin_symbols): Use this new mechanism to
6521 import m4_dump_symbols from the m4 module.
6522 (builtin_esyscmd): Likewise for m4_set_sysval and
6524 * modules/m4.c (m4_export_table): Removed. Functions are
6525 addressed with the new mechanism which doesn't need this.
6526 (m4_set_sysval): New exported accessor function to prevent
6527 problems with variable access on inferior architectures.
6528 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6529 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6530 that we can have some type safety.
6531 * modules/modtest.c (export_test): C level exported function for
6532 testing the new import mechanism.
6533 * modules/import.c: New file for the import end of the test.
6534 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
6535 * tests/modules.at: New test cases for intermodule symbol
6538 2003-08-07 Gary V. Vaughan <gary@gnu.org>
6540 * m4/m4module.c (m4_string): Moved from here...
6541 * m4/m4private.c (m4_string): ...to here.
6543 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
6545 2003-07-29 Gary V. Vaughan <gary@gnu.org>
6547 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
6548 already available to module writers through
6549 m4_{get,set}_nesting_limit_opt(), so moved from here...
6550 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
6551 (m4_create): Use it.
6553 2003-07-28 Gary V. Vaughan <gary@gnu.org>
6555 Aside from auditing path.c for m4module.h api obfuscation, this
6556 delta introduces the concept of private struct members in opaque
6557 data types to GNU m4: See the STYLE file for details.
6559 * TODO: Remind ourselves that a rewrite of path.c is needed.
6560 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
6562 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
6563 here and renamed. These type definitions are for internal api use
6564 only. Changed all callers.
6565 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
6567 * m4/path.c (search_path_env_init, search_path_add): ...to here
6568 and renamed. These calls were never used outside this file.
6569 Changed all callers.
6570 (dirpath): Moved functionality of this static declaration...
6571 * m4/m4private.h (struct m4): ...to this new internal only
6572 search_path field. Changed all callers.
6573 (m4__get_search_path): Added new internal api accessor.
6574 * m4/path.c (m4_search_path_info_new): Removed. Not used.
6575 (m4_include_init): Removed...
6576 * m4/m4.c (m4_create): ...because the new m4 field is now
6578 (m4_delete): Recycle search_path memory.
6579 * src/main.c (main): Don't call m4_include_init now that it's
6581 * doc/STYLE: Document convention for private fields in opaque
6584 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6586 Sometimes exporting the address of a symbol from a module isn't
6587 enough for other modules to call that symbol correctly. If
6588 custom data types are used for function parameters, they need to
6589 be known to the caller. This change introduces the concept of
6590 $(prefix)/include/modules/$(modulename).h to declare those
6591 structures. Also we move m4_dump_symbols from libm4 to the m4
6592 module to show this concept in action.
6594 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
6595 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
6596 exporting data structures from modules/m4.c.
6597 * modules/m4.c, modules/gnu.c: Include it.
6598 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
6599 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
6601 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
6603 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
6604 ...to here, with slight renaming.
6605 (m4_export_table): Prototype and add m4_dump_symbols.
6606 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
6607 definition of m4_dump_symbols.
6608 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
6609 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
6611 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6613 Create an export table in modules/m4.c in readiness for beefing up
6614 the module loader to track module exports and imports.
6616 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
6617 * m4/debug.c (m4_debug_flush_files): Moved...
6618 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
6619 * modules/gnu.c (builtin_esysval): Use it.
6620 * m4/m4module.h (m4_export): New type for declaring module symbols
6622 * modules/m4.c (m4_export_table): List symbols exported from this
6623 module for use by other modules.
6625 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6627 An experiment: There is loads of code in libm4 which should be in
6628 the m4 module, but is also used by another module. Just because
6629 some linkers won't cope with calls across dynamic runtime loaded
6630 objects I initially left the code in libm4. It will tidy the
6631 module api immensely if this code moves to the right place, I just
6632 need to remember to invent a suitable calling mechanism at some
6633 point. For now, only modules that are statically linked and
6634 preloaded will get this treatment, so the only platforms that will
6635 break are those that require all symbols to be resolved at link
6638 * TODO: Reminder that what I am doing could reduce portability
6639 unless I do something more robust later.
6640 * m4/m4module.h (m4_sysval): No longer exported from libm4.
6641 * m4/utility.c (m4_sysval): No longer declared in libm4.
6642 * modules/Makefile.am: Reformatting.
6643 * modules/m4.c (m4_sysval): Declare it at place of use.
6644 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
6646 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6648 * m4/m4module.h: Reformatting and rearranging lines a bit.
6649 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
6651 (m4_call_macro, m4_expand_input): Renamed...
6652 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
6654 (m4_expansion_level, m4_process_macro): Moved...
6655 * m4/macro.c (expansion_level, process_macro): ...to here, and
6658 * m4/m4module.h (program_name): Not used by modules at all, so
6660 * src/main.c (program_name): ...to here.
6661 (print_program_name): Renamed...
6662 (print_program_name_CB): ...to conform to the STYLE guide.
6664 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6666 More refactoring of the m4module.h API. Replace #defines with an
6667 enum, and move non-public functions out of the public API.
6669 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
6671 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
6672 * m4/debug.c (m4_debug, trace): Moved...
6673 * m4/m4private.h (struct m4): ...to fields of this struct.
6674 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
6676 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
6677 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
6678 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
6679 * m4/m4module.h (m4_context_field_table): Add entries for new
6680 debug_file and trace_messages fields.
6681 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
6682 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
6683 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
6684 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
6685 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
6686 (m4_is_debug_bit): New macro to simplfy checks against the debug
6688 (m4_trace_format, m4_trace_header, m4_trace_flush)
6689 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
6691 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
6692 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
6693 * m4/macro.c (trace_format, trace_header, trace_flush)
6694 (trace_prepre, trace_pre, trace_post): ...to these newly static
6695 functions, since they are only ever used from this file. Changed
6698 2003-07-17 Gary V. Vaughan <gary@gnu.org>
6700 Change the macros for checking syntax so that matching against
6701 multiple possible syntax classes can be done with a single
6702 comparison some of the time. The various classes are now bits of
6703 an int that can be checked with bitwise logic operators.
6705 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
6706 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
6707 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
6708 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
6709 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
6710 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
6711 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
6712 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
6713 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
6714 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
6715 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
6716 Replace all calls with invocations of these...
6717 (m4_is_syntax, m4_has_syntax): ...New macros.
6718 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
6719 is no longer required with new macros. Changed all callers.
6721 2003-07-15 Gary V. Vaughan <gary@gnu.org>
6723 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
6724 values are returned as part of the internal interface, so they
6726 * m4/private.h: ...to here.
6727 * m4/macro.c (expand_token): Check for out of range
6728 m4_peek_input() results before looking up in the syntax table.
6729 (collect_arguments): Ditto.
6731 * NEWS: Note `$' syntax class.
6733 2003-07-08 Paul Eggert <eggert@twinsun.com> and
6734 Gary V. Vaughan <gary@gnu.org>
6736 Conform to POSIX if the POSIXLY_CORRECT environment is set.
6737 --traditional `define' now smashes all the definitions.
6739 * NEWS: Explain this.
6740 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
6741 (Extensions): Explain that extensions that are incompatible with
6742 POSIX are disabled if POSIXLY_CORRECT is set.
6743 (Incompatibilities): Remove.
6744 (Define, Other Incompat): Explain difference
6745 between GNU and POSIX behavior of define, pushdef, popdef.
6746 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
6747 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
6748 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
6749 (m4_get_posixly_correct_opt): New macro.
6750 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
6752 * modules/m4.c (builtin_functions): defn now takes any number of args.
6753 (builtin_define): Smash all the definitions if
6755 (builtin_defn)): Allow any number of arguments.
6756 (builtin_undivert): Do not allow nonnumeric arguments
6758 * src/main.c (main): Set posixly-correct behavior if either
6759 POSIXLY_CORRECT is set, or if -G is given.
6760 * tests/builtins.at: New test for smashed definitions.
6762 2003-06-27 Gary V. Vaughan <gary@gnu.org>
6764 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
6765 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
6766 not to slow the parser down.
6767 (M4__IS_STRING): New macro to test string syntax class membership.
6768 * m4/syntax.c: Adjust docucomment.
6769 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
6770 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
6771 * m4/input.c (init_builtin_token): Comment typo.
6772 (m4__next_token): Comment typo.
6773 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
6774 by using the new M4__IS_STRING macro.
6775 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
6776 variable references in macro expansions.
6778 * doc/m4.texinfo (Eregexp and Regexp): Typo.
6779 (Epatsubst and Patsubst): Typo.
6782 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6784 Move the global variables that pertain to syntax to a new `struct
6785 m4_syntax_table', and then add one of these to `struct m4'. The
6786 ripple effect through the code to both change formerly global
6787 references, and make sure a suitable context is available in
6788 lexical scope is disproportionately large compared to the size of
6789 the change proper. This change is a large part of decoupling
6790 syntax.c from the rest of the code that uses it.
6792 * m4/m4private.h (struct m4): Add a syntax field.
6793 * m4/m4.c (m4_create): Initialise it,
6794 (m4_delete): Recycle it.
6795 (m4_get_symtab): Remove hand coded version...
6796 (m4_get_symbol_table): ...and generate this with cpp. Changed all
6798 * m4/m4module.h (m4_context_field_table): Add an extra field so we
6799 can generate m4_get_symbol_table. Add a new row for
6800 m4_get_syntax_table.
6801 (M4SYNTAX): Syntactic sugar for module writers.
6802 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
6803 (m4_syntax_table): New home for syntax related formerly global
6805 * m4/m4private.h (struct m4_syntax_table): Define it.
6806 * m4/input.c (m4_input_init): Initialisation of these formerly
6807 global variables moved...
6808 * m4/syntax.c (m4_syntax_create): ...to here.
6809 * m4/input.c (m4_input_exit): And similarly, recycling of the
6810 memory used by those values moved...
6811 * m4/syntax.c (m4_syntax_delete): ...to here.
6812 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
6813 Moved to m4/m4private.h.
6814 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6815 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6816 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6817 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
6818 objects. Changed all callers that used to directly access the
6820 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
6821 Removed and incorporated into m4_syntax_table structure.
6822 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
6823 * m4/syntax.c (m4_set_syntax): Now returns an error status,
6824 instead of requiring a `struct m4' to generate its own errors.
6825 Changed all callers.
6826 * src/main.c (main): Now that the syntax table is initialised as
6827 part of m4_create, we have to manually wipe the syntax entries if
6828 we are about to read a frozen file.
6830 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6832 * doc/STYLE: Added notes on callback naming schemes.
6834 * m4/module.c (m4_set_module_macro_table)
6835 (m4_set_module_builtin_table): Declarations weren't changed when
6836 definitions were renamed on 2003-06-19.
6838 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
6839 neither used nor particularly appropriate since it exposes the
6840 internal workings of the hash module. I haven't yet decided
6841 whether to remove it entirely.
6843 2003-06-20 Gary V. Vaughan <gary@gnu.org>
6845 Two related changes, and a huge knockon effect throughout the
6846 source: Moved the option variables out of global space and into
6847 `struct m4'; made `m4_symtab' a real datatype, so that its api
6848 is not marred passing `struct m4' around just so it can decide
6849 whether to keep traced symbol names or not. Added setters and
6850 getters for the formerly global option variables, and obviously
6851 changed a vast number of functions to take a `struct m4' and use
6852 the getter funcs to find option values.
6854 * m4/utility.c (interactive, sync_output, debug_level)
6855 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
6856 (max_debug_argument_length, warning_status, nesting_limit)
6857 (discard_comments): Removed.
6858 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
6859 (debug_level, max_debug_argument_length, prefix_all_builtins)
6860 (suppress_warnings, discard_comments, interactive, sync_output):
6861 Removed from here...
6862 * m4/m4private.h (struct m4): ...and equivalent fields added to
6864 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6865 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6866 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6867 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6868 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
6869 macros for the new fields.
6870 * m4/m4module.h (m4_context_field_table)
6871 (m4_context_opt_bit_table): Helper macros used to generate
6872 prototypes, setters and getters for new option fields
6874 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6875 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6876 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6877 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6878 (m4_get_interactive_opt, m4_get_sync_output_opt)
6879 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6880 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6881 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
6882 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
6883 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
6884 setter and getter functions generated by cpp from
6885 m4_context_field_table and m4_context_opt_bit_table, exported as
6886 part of the module api. Changed all callers.
6887 * m4/symtab (struct m4_symtab): Used as the concrete type for
6889 (m4_symtab_create): Allocate and initialise a new struct.
6890 (m4_symtab_apply): New function that works like m4_hash_apply, but
6891 with different callbacks specific to symbol tables. Changed all
6893 (symbol_destroy, arg_destroy, arg_copy): Renamed
6894 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
6895 they have unused parameters for a reason!
6896 (dump_symbol_CB): New callback to dump the contents of a single
6898 (symtob_dump): Rewritten in terms of dump_symbol_CB.
6899 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
6900 Changed all callers.
6901 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
6902 of the contained `m4_symtab' at the `no_gnu_extensions' field.
6903 Although I'm not convinced these semantics are correct, they are
6904 at least consistent with how things were before this delta. Also
6905 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
6907 2003-06-19 Gary V. Vaughan <gary@gnu.org>
6909 Tie down the interface to libm4 some more. Make more structures
6910 opaque to modules by moving them to m4private.h, and writing
6911 setters and getters. To win back the speed penalty for doing this
6912 also wrote macroized versions that do know about structure layout
6913 in m4private.h and #include that file into modules when NDEBUG is
6914 defined at compile time. There are still some accessor macros in
6915 m4private.h that need to go, but that is not necessary to clean
6918 * m4/m4module.h (m4_symbol_type): Moved...
6919 * m4/m4private.h (m4__symbol_type): ...to here.
6920 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
6921 (m4_set_symbol_traced, m4_set_symbol_name_traced)
6922 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6923 (m4_get_symbol_func, m4_symbol_value_create)
6924 (m4_symbol_value_delete, m4_set_symbol_value_text)
6925 (m4_set_symbol_value_func): New exported api to symbols.
6926 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
6927 and m4_is_symbol_value_func.
6928 * m4/m4module.h: Prototype these guys.
6929 * m4/module.c (m4_set_module_macro_table)
6930 (m4_set_module_builtin_table): Make these static, there is no
6931 reason to pollute the api with them.
6932 * m4/m4private.h: Reformatting.
6933 (m4_get_symtab): Only define when NDEBUG is defined.
6934 (m4_get_symbol_value, m4_get_symbol_traced)
6935 (m4_set_symbol_traced, m4_set_symbol_name_traced)
6936 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
6937 (m4_get_symbol_func, m4_symbol_value_create)
6938 (m4_symbol_value_delete, m4_set_symbol_value_text)
6939 (m4_set_symbol_value_func): Macro implementations of the new
6940 functions when NDEBUG is defined.
6941 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
6942 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
6943 Superceded by the above. All callers changed.
6944 (M4ARG): Removed. This is no longer different to the
6945 m4/m4module.h definition.
6946 * modules/gnu.c, modules/m4.c: Only include m4private.h when
6947 NDEBUG is defined. That way we exercise the same (albeit slower)
6948 api that external modules must use.
6950 2003-06-18 Gary V. Vaughan <gary@gnu.org>
6952 Renamed some of the types and their accessors to make more sense.
6953 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
6954 has a stack of SYMBOL_VALUEs.
6956 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
6957 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
6958 m4_get_symbol_value_type, m4_get_symbol_value_text,
6959 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
6960 Changed all callers.
6961 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
6962 (m4_get_token_type): Renamed
6963 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
6964 to the internal api.
6965 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
6967 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
6968 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
6969 (m4__token_type): Moved here from m4module.h.
6970 (m4__next_token): Renamed from m4_next_token.
6971 * m4/symtab.c: Removed some of the parameterised macro support
6972 functions for modularisation later.
6973 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
6974 m4_hash_dup to perform a true deep copy of the SRC.
6975 (arg_copy): Callback for m4_symbol_value_copy.
6976 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
6977 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
6978 m4_get_symbol_value_func. Changed all callers.
6980 2003-06-18 Gary V. Vaughan <gary@gnu.org>
6982 Tidy up style of hash.[ch] in accordance with doc/STYLE.
6984 * m4/hash.c: Internal symbol renaming and formatting.
6985 (m4_hash_dup): New function to facilitate deep copies of hash
6987 (m4_hash_apply_func): Returns a void* now, which is a richer type
6988 for returning exceptions (NULL means keep going).
6989 (m4_hash_apply): Ditto.
6990 * m4/hash.h: Declare exported symbols with an explicit extern.
6993 2003-06-17 Gary V. Vaughan <gary@gnu.org>
6995 Still refactoring furiously. This delta represents a change in
6996 semantics to symtab.c. Instead of building temporary m4_tokens
6997 in the caller, and copying fields in the methods, we now create
6998 the actual m4_token for hashing in the caller so the methods just
6999 slot them in directly. Also, this means that we don't lookup a
7000 symbol and get back an allocated but VOID token to copy fields
7001 into, we create the token we want to push and pass that to
7002 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
7003 a few other small changes to stop knowledge of the implementation
7004 of symtab.c leaking out into other files.
7006 * m4/macro.c (expand_argument): Comment typo corrected.
7007 * m4/symtab.c (symtab_fetch): New function to fetch the address of
7009 (m4_symbol_pushdef): Take an extra value parameter and use this
7010 directly as the new top of the value stack. All callers changed
7011 to build a token and pass responsibility for memory in, rather
7012 than copying as we used to.
7013 (m4_symbol_define): Also use the new value parameter directly as a
7014 replacement for the top of the value stack. All callers changed
7015 to build a token as above.
7016 (m4_set_symbol_traced): New function to set the traced bit on the
7017 named symbol, creating it if necessary.
7018 (symbol_popval): The guts of the old m4_symbol_popdef.
7019 (m4_symbol_popdef): Use it.
7020 * m4/builtin.c (m4_symbol_set_token): Removed,
7021 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
7023 * m4/module.c (m4_set_module_builtin_table)
7024 (m4_set_module_macro_table): ...with these more orthogonal
7026 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
7027 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
7029 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
7030 (m4_arg_signature_parse): Moved...
7031 * m4/symtab.c: ...to here.
7032 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
7033 screw something up. Moved...
7034 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
7035 actually does a proper deep copy of source to dest.
7037 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7039 Further refactoring to stabilise the module API. Renaming some
7040 functions for orthogonality, and judicious definition migration to
7041 move things out of the set of exported symbols.
7043 * doc/STYLE: New file. Notes on coding style.
7044 * m4/m4module.c: Updated bitrotted docucomment at the top of the
7046 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
7047 m4_get_module_name, m4_get_module_builtin_table,
7048 m4_get_module_macro_table which are verb phrases. Changed all
7050 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
7052 * m4/module.c (m4_set_module_builtin_table)
7053 (m4_set_module_macro_table): ...here, and renamed. Changed all
7055 * m4/m4module.c (m4_module_data): This...
7056 * m4/m4private.c (struct m4_module_data): ...and this...
7057 * m4/module.c (module_data) ...consolidated here and no longer
7058 exported. Changed all callers.
7060 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7062 Begin work on lifting the curse of the global variables. To start
7063 with create a `struct m4' context container, and replace
7064 `m4__symtab' with `context->symtab' throughout. This means
7065 initialising a context container in main, and adjusting many
7066 functions between main and the module entry points so that the
7067 container gets passed through. It would have been nice to
7068 defer this until after 1.5, but it has a major effect on the
7069 user's module writing ABI, so it needs to be addressed now - at
7070 least in the areas that impact the ABI. An interrelated change
7071 in the symtab API removes the dependency on a global symbol table,
7072 and instead focuses on a passed table (from the context
7075 * TODO: Reminders for finishing context functionality.
7076 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
7077 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
7078 global variables and eventually allow m4 to be reentrant.
7079 * m4/m4private.h (m4): Define the new structure here...
7080 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
7081 don't carry the overhead of a function call.
7082 * m4/m4module.h: Prototype extern functions from m4/m4.c.
7083 (m4): Declare type for new struct m4 objects.
7084 (M4SYMTAB): User macro to ease finding the symbol table for the
7085 current context for module developers.
7086 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
7088 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
7089 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
7090 (m4_call_macro, m4_dump_symbols, m4_expand_input)
7091 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
7092 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
7093 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
7094 m4* context parameter. Changed definitions and all callers.
7095 (m4_symtab): Alias for m4_hash to decouple the
7096 m4_symtab api from m4_hash.
7097 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
7099 (m4_symtab_create): New function to return an initialised
7101 (m4_symtab_delete): New function to delete an m4_symtab's memory.
7102 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
7103 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
7104 instead of simply using the global m4__symtab. Changed
7105 definitions and all callers.
7106 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
7107 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
7108 * src/main.c (main): Create a context and use that instead of the
7109 former global m4__symtab.
7111 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7113 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
7114 to the callback. Callbacks should not need to hardcode the
7115 hashtable they are working from, nor should we have to waste the
7116 userdata parameter to pass the table in.
7117 * m4/hash.h (m4_hash_apply_func): Require the initial table
7119 * m4/symtab.c (symtab_destroy): Use the passed table instead
7120 of hardcoding m4__symtab.
7121 (m4_symbol_popdef): Don't use the userdata parameter to pass the
7122 table to arg_destroy.
7123 (arg_destroy): Use the hash parameter, ignore userdata.
7124 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
7126 (traceon, traceoff): Call set_trace with the extra initial
7129 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7131 More refactoring to stabilise the module api, this time for
7132 symtab.c. Additionally, start to pay attention to function names
7133 that don't contain a verb like they should.
7135 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
7136 wrapper for m4_hash_apply to decouple the symtab module from the
7138 (m4_symbol_builtin, m4_symbol_macro): Renamed to
7139 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
7141 (m4_symbol_delete): Create a macro version to save a function
7143 (m4_token_t, m4_data_t): These violate the POSIX reserved
7144 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
7146 (m4_token_type): Renamed to m4_token_get_type.
7147 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
7148 (m4_symtab_exit): Removed from the exported module
7150 * m4/m4private.h (m4__symtab, m4__symtab_init)
7151 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
7152 renamed and added to the internal api. Changed all callers.
7153 (m4_symtab_apply): A faster macro version of the function for
7154 users of the internal api.
7155 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
7156 symbol_destroy and arg_destroy.
7157 (symtab_debug): Added a prototype.
7158 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
7159 so that callers in this file get the faster macro versions from
7162 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7164 Refactoring modules to rationalise the API into an external
7165 documented (eventually!) API for use by modules in the `m4_'
7166 namespace declared in m4/m4module.h, an internal API between the
7167 source files we ship (including our shipped modules) in the `m4__'
7168 namespace declared in m4/m4private.h and making the rest as
7169 cohesive as possible with liberal use of the `static' keyword.
7170 This change represents an audit to m4/module.c along these
7173 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
7174 Removed. No longer used.
7175 (m4_module_close): Removed prototypes.
7176 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
7177 from the exported module api...
7178 * m4/m4private.h (m4__module_init, m4__module_open)
7179 (m4__module_exit): ...and renamed and added to the internal api.
7180 Changed all callers.
7181 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
7182 Centralised definitions after renaming...
7183 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
7184 (M4_FINISH_SYMBOL): ...and removing from here.
7185 (m4_module_dlerror, m4_module_remove, m4_module_close)
7186 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
7187 module_remove, module_close and caller_id.
7188 (MODULE_SELF_NAME): New macro to make reporting self errors
7190 (m4_module_load, module_close, module_remove): Use it.
7191 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
7193 * src/main.c (main): Use it.
7195 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7197 * README: Remove references to --enable-changeword, which has been
7198 removed from the code.
7200 2003-06-11 Gary V. Vaughan <gary@gnu.org>
7202 Getting rid of the annoying bug with configure --enable-debug,
7203 which spewed -e: command not found errors. This was an interaction
7204 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
7205 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
7206 branch-1-5) to get the full fix.
7208 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
7209 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
7210 and then use the probed value of $SED.
7211 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
7212 this, it messes up the AC_REQUIRE stack.
7214 2003-06-10 Gary V. Vaughan <gary@gnu.org>
7216 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
7217 the destroy callback.
7218 (m4_arg_destroy): Use the hash address to free the hash node key
7221 2003-06-06 Gary V. Vaughan <gary@gnu.org>
7223 First cut at formal parameters in macros.
7225 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
7226 * m4/xstrzdup.c: New file.
7227 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
7228 associative array of parameter names to details.
7229 (m4_symbol_token): Capture macro names with parameter lists.
7230 (m4_arg_signature_parse): And build an associative array to hang
7231 from the symbol structure to map names to details.
7232 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
7233 m4_hash_resize idiom. Now that we potentially add a little hash
7234 table to many of the entries in the symbol table, added an extra
7235 arg to set the initial size. Changed all callers.
7236 (m4_hash_apply): New function that is basically a generalised
7238 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
7239 all callers to call m4_hash_apply instead.
7240 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
7241 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
7242 m4_arg_signature association that might be attached to the symbol,
7243 * m4/hash.h (m4_hash_apply_func): Replacement type for...
7244 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
7245 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
7247 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
7248 (M4_IS_IDENT): Detect characters that can be safely used in
7250 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
7251 * m4/macro.c: Corrected grammar in some comments. Use `token'
7252 rather than `td' for m4_token variables.
7253 (m4_process_macro): If we find a dollar followed by some
7254 M4_IS_IDENT characters, replace that with the contents of the argv
7255 entry with offset stored in the m4_token_arg associated with the
7256 collected identifier.
7258 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7260 Begin preparations for supporting formal parameters in m4 macros.
7262 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
7263 the details of a formal parameter.
7264 (m4_token): Add an arg_signature member to hold a hash table for
7265 looking up formal parameters.
7266 * m4/input.c: Update more bitrotted comments.
7267 (m4_push_builtin): Initialise arg_signature member.
7268 (init_builtin_token): Copy arg_signature member.
7269 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
7270 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7272 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7273 (m4_macro_pushdef, m4_macro_define): ...these, And...
7274 (m4_symbol_token): ...wrapped around this new function, which
7275 vastly simplifies the arguments required by the functions it
7277 Changed all callers.
7279 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7281 * m4/macro.c: Format changes.
7283 2003-06-04 Gary V. Vaughan <gary@gnu.org>
7285 * m4/input.c: Updated various bitrotted comments.
7286 (m4_push_builtin): Just pass the whole m4_token, rather than
7287 extracting all the fields in the caller. This also allows us to
7288 check the token type for consistency.
7289 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7290 Renamed to builtin_funcs, builtin_peek, builtin_read,
7291 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7292 the code. Changed all callers.
7293 (struct input_block): Similarly renamed u_m member to u_b, and
7294 changed all callers.
7295 (m4_next_token): Use bzero to initialise the data fields.
7296 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7298 2003-05-29 Gary V. Vaughan <gary@gnu.org>
7300 These changes were necessary to get m4 to build on my iBook
7301 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7302 (GCC) 3.1 20020420 (prerelease)":
7304 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7305 inclusion of module loader headers.
7306 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7307 * m4/Makefile.am: Ditto.
7308 (libm4_la_LIBADD): Added $(LTLIBINTL).
7309 * m4/utility.c (program_name): Removed declaration in favour of
7310 the one already in error.c!
7311 * m4/m4module.h (program_name): Define to program_invocation_name
7312 when using GNU C library. Use an explicit extern declaration.
7313 (interactive, sync_output, debug_level, hash_table_size)
7314 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7315 (suppress_warnings, warning_status, nesting_limit, discard_comments)
7316 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7317 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7318 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7319 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7320 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7321 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7322 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7323 (m4_current_line, m4_current_diversion, m4_output_current_line):
7324 Don't rely on default, use an explicit extern.
7325 * m4/error.h (error, error_at_line, error_print_progname)
7326 (error_message_count, error_one_per_line): Ditto.
7327 * m4/ltdl.c: Update from CVS libtool.
7329 * commit: Update from CVS cvs-utils.
7331 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
7333 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7334 * po/boldquot.sed: New file, from gettext-0.11.5.
7335 * po/en@boldquot.header: New file, from gettext-0.11.5.
7336 * po/en@quot.header: New file, from gettext-0.11.5.
7337 * po/insert-header.sin: New file, from gettext-0.11.5.
7338 * po/quot.sed: New file, from gettext-0.11.5.
7339 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7340 * po/Rules-quot: New file, from gettext-0.11.5.
7342 2002-11-04 Akim Demaille <akim@epita.fr>
7344 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7346 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7348 2002-11-04 Akim Demaille <akim@epita.fr>
7350 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7352 2002-11-04 Akim Demaille <akim@epita.fr>
7354 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7355 used as `external', and Libtool 1.4.3.
7357 (LTLIBOBJS): Don't play with it.
7359 * Makefile.am (SUBDIRS): Remove intl.
7360 (ACLOCAL_AMFLAGS): Add -I config.
7361 (EXTRA_DIST): Add config/config.rpath.
7364 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7366 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7368 Preparations for refactoring syntax tables to allow reverse
7369 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7370 speed of normal lookups in an array of unsigned short.
7372 * m4/input.c (single_quotes, single_comments, use_macro_escape):
7374 * m4/m4private.h (m4__single_quotes, m4__single_comments,
7375 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
7376 is for internal symbols which unavoidably pollute the global
7377 namespace, but are not published APIs.
7378 Adjusted all callers.
7379 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7380 m4_set_comment, m4_set_syntax, set_syntax_internal,
7381 unset_syntax_attribute): Moved from this file...
7382 * m4/syntax.c: New. ...to this file.
7383 Also added an m4_syntax_exit stub for orthogonality.
7384 * src/main.c (main): Use it.
7385 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7386 * m4/m4module.h: Reformatting. New prototypes.
7388 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7390 * bootstrap (aclocal_apiversion): The aclocal apiversion is
7391 distinct from the automake release number (in that the apiversion
7392 apparently has no micro-version-component).
7393 (aclocal_apilibdir): Use it.
7395 2002-05-28 Gary V. Vaughan <gary@gnu.org>
7397 * m4/hash.c (m4_hash_resize): New function.
7398 * m4/hash.h: Add prototype.
7399 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
7400 benchmarking to find a good value for, say, autoconf. This is
7401 already a little quicker than before for me.
7403 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7404 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7406 * m4/hash.h: Adjust prototypes.
7408 2002-01-22 Akim Demaille <akim@epita.fr>
7410 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7412 * tests/Makefile.am (package.m4): New.
7413 * tests/atlocal.in: Adjust to CVS Autotest.
7414 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7415 * configure.ac: LIBOBJ is a forbidden string.
7416 Simplify AM_INIT_AUTOMAKE invocation.
7417 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7420 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
7422 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7424 2001-10-19 Akim Demaille <akim@epita.fr>
7426 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7428 2001-10-19 Akim Demaille <akim@epita.fr>
7430 * m4/input.c (m4_next_token): Display where was opened what is
7433 2001-10-19 Akim Demaille <akim@epita.fr>
7435 * m4/macro.c (expand_argument): Display where was opened what is
7438 2001-10-18 Akim Demaille <akim@epita.fr>
7440 * m4/input.c, modules/m4.c: Formatting changes.
7442 2001-10-17 Gary V. Vaughan <gary@gnu.org>
7444 * bootstrap: s/configure.in/configure.ac/
7446 2001-10-16 Gary V. Vaughan <gary@gnu.org>
7448 * m4/symtab.c (m4_symbol_destroy): This function calls
7449 m4_symbol_popdef, which recycles a symbols memory when the last
7450 definition is popped. Since we were passing the address of the
7451 symbol name found in the symbol table, and it was being removed
7452 partway through m4_symbol_destroy() we were referencing freed
7453 memory for the balance of the function. Now we take a copy of the
7454 symbol name tring and use that as a key into the symbol
7455 table... that way if the original symbol name is freed, the copy
7458 2001-10-13 Akim Demaille <akim@epita.fr>
7460 * m4/ltdl.c: Update.
7462 2001-10-13 Akim Demaille <akim@epita.fr>
7464 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7465 Don't gettextize internal error messages.
7467 2001-10-13 Akim Demaille <akim@epita.fr>
7469 * tests/macros.at (Arity and defn): New failing test.
7470 (Arity, defn, and freeze): New.
7472 Fix `Arity and defn'.
7474 * m4/input.c (m4_push_macro): Don't forget the arity.
7475 * modules/m4.c (defn): Likewise.
7477 2001-10-13 Akim Demaille <akim@epita.fr>
7479 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7481 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7482 (Propagation of traceon, Propagation of --trace): this new file.
7484 2001-10-13 Akim Demaille <akim@epita.fr>
7486 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7487 interface instead of (name, argc...).
7488 Upon failure, specify which argument was guilty.
7491 2001-10-13 Akim Demaille <akim@epita.fr>
7493 * modules/evalparse.c: Save translators' time: don't translate
7494 internal error messages.
7495 (m4_evaluate): Simplify/normalize error messages.
7496 * doc/m4.texinfo (Eval): Adjust.
7498 2001-10-13 Akim Demaille <akim@epita.fr>
7500 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7501 where no checking is needed.
7502 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7503 interface instead of (name, argc...).
7505 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7508 2001-10-13 Akim Demaille <akim@epita.fr>
7510 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7511 exclude the builtin name from the count.
7512 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7513 calling ifelse with a single argument is valid.
7514 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7515 with 1 and 2 args, mostly to strengthen the test suite.
7517 2001-10-13 Akim Demaille <akim@epita.fr>
7519 * m4/output.c (m4_make_diversion, m4_insert_file)
7520 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7522 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7524 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
7525 since we call these things builtins in the rest of the code!
7527 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7529 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7531 Rather than forcing each builtin definition to manage its own
7532 argument range checking, tabulate the maxima and minima for all
7533 builtins in each module. This forces us to consider what the
7534 valid ranges for each builtin should be, and moves the checking
7535 code out of each builtin implementation and into the builtin
7536 caller infrastructure.
7538 * m4/m4module.h (struct m4_builtin): Add argument minima and
7540 * m4/m4private.h (struct m4_token): Reflect them here too.
7541 * m4/input.c (struct input_block): ...and here.
7542 (m4_token_copy): New function for token copying.
7543 (init_macro_token): Copy them from a token to the input stack.
7544 (m4_next_token): Don't forget to initialise them for text
7546 * m4/macro.c (expand_argument): Use m4_token_copy, and also
7547 check argument counts before calling the builtin handler.
7548 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
7549 (m4_symbol_macro): Likewise.
7550 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
7551 parameters. Updated all callers.
7552 (m4_builtin_define): Ditto.
7553 (m4_macro_pushdef, m4_macro_define): Ditto.
7554 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
7555 * modules/evalparse.c: Declare argument counts for defined
7556 builtins and remove explicit calls to m4_bad_argc().
7557 * modules/gnu.c: Ditto.
7558 * modules/load.c: Ditto.
7559 * modules/m4.c: Ditto.
7560 * modules/modtest.c: Ditto.
7561 * modules/mpeval.c: Ditto.
7562 * modules/perl.c: Ditto.
7563 * modules/shadow.c: Ditto.
7564 * modules/stdlib.c: Ditto.
7565 * modules/time.c: Ditto.
7568 2001-10-10 Gary V. Vaughan <gary@gnu.org>
7570 The trace semantics now attach the trace bit to a symbol name.
7571 For as long as a traceon(`foo') is active, calls to foo will be
7572 traced regardless of intervening undefines or module unloads.
7573 Fixed the flag propogation issues differently to the fixes
7574 reverted with the last attempt at nailing down trace:
7576 * m4/m4private.h: This file is not visible outside of the m4
7577 source tree, so I removed all the `M4_' and `m4_' prefixes to save
7578 on typing. Updated all clients.
7579 (m4_token): New typedef contains the fields that need to be passed
7580 around with the low level tokeniser.
7581 (m4_token_data): Removed.
7582 (m4_symbol): Now contains the traced flag again.
7583 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
7584 the trace bit set. This change is contained entirely within this
7585 module and doesn't leak out into the callers. Updated all
7587 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
7588 new fields in m4_token. Updated all clients.
7589 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
7590 that `groks_macro_args' and `blind_if_no_args' flags are retained
7591 when defn() results are passed around in m4 code. Updated all
7593 (m4_builtin_define): Ditto.
7594 (m4_macro_pushdef, m4_macro_define): Ditto.
7595 * m4/input.c (struct input_block): Add a flags field to facilitate
7597 (m4_push_macro): ...use it.
7598 (init_macro_token): Retrieve it.
7599 (m4_next_token): Initialise it.
7600 * m4/macro.c (expand_argument): Copy it.
7601 * m4/m4module.h: Adjust.
7602 * tests/builtins.at: Adjust the expected output of the trace
7603 tests to reflect the change in semantics.
7604 * tests/modules.at (modules: trace): Check that unloading a
7605 module which supplies a traced symbol definition doesn't lose te
7608 2001-10-07 Gary V. Vaughan <gary@gnu.org>
7610 * modules/gnu.c (m4_macro_table): Display the timetamp when
7611 expanding __m4_version__.
7613 * configure.ac (--with-modules): Forgot a comma in the
7614 AC_HELP_STRING parameter list.
7616 2001-10-05 Gary V. Vaughan <gary@gnu.org>
7618 * bootstrap: Remove aclocal.m4t when it is no longer required.
7620 2001-10-05 Akim Demaille <akim@epita.fr>
7622 * tests/Makefile.am: Adjust for gnuprog2.
7623 * tests/m4.in: There can be a leading path.
7624 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
7625 * tests/testsuite.at: Adjust to the most recent Autotest.
7626 (AT_CHECK_M4_FILTER): Fix and rename as...
7628 * tests/others.at: Use it.
7630 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
7631 variable in shell scripts, one uses `$'...
7633 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7635 * configure.ac: `rm -f $m4_getopt_h' was lost.
7637 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7639 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
7640 time. Define it for config.h in order to...
7641 * src/main.c (main): ...display the timestamp for --version.
7643 2001-10-04 Akim Demaille <akim@epita.fr>
7645 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
7646 previous builtins `regexp' and `patsubst'.
7647 (regexp, patsubst): Use them.
7648 (eregexp, epatsubst): New builtins.
7649 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
7650 (Epatsubst and Patsubst, Eregexp and Regexp): these.
7651 (Extensions): More info on REs.
7653 2001-10-04 Akim Demaille <akim@epita.fr>
7655 * modules/modtest.c (init_handler): Consistently output to stderr.
7656 (finish_handler): New.
7657 (test): The `if' is an `assert'.
7658 * tests/modules.at: Adjust.
7660 2001-10-04 Akim Demaille <akim@epita.fr>
7662 * m4/utility.c (m4_bad_argc): Detail the mismatches.
7664 2001-10-01 Akim Demaille <akim@epita.fr>
7666 * tests/generate.awk: Tag the tests with `documentation'.
7667 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
7668 Use the make the existing modtest tests more uniform, and complete
7669 the set of possibilities.
7671 2001-10-01 Akim Demaille <akim@epita.fr>
7673 * config/gmp.m4: Consult the user before using GMP: use
7675 * configure.ac: Adjust.
7676 * modules/gmp.c: No protection needed as the module is not built
7679 2001-10-01 Akim Demaille <akim@epita.fr>
7681 * tests/generate.awk: Remove debugging code.
7682 (fatal): Specify the current location.
7684 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
7685 * modules/gnu.c, modules/m4.c: Use M4ARG.
7687 2001-10-01 Akim Demaille <akim@epita.fr>
7689 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
7690 (m4_regexp_compile): New.
7691 (regexp, patsubst): Use it.
7693 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7695 Reinstate the memory handling improvements from the patch I just
7696 reverted. Relevant ChangeLog entries repeated here:
7698 * m4/module.c (m4_module_remove): New function that holds the core
7699 of the old m4_module_unload.
7700 (m4_module_unload): Use it.
7701 (m4_module_unload_all): When we know the modules will never be
7702 used again (i.e. on exit), free up as much module memory as
7703 possible. There are still some artifacts from resident modules
7704 living inside ltdl.c, but everything else is freed.
7705 * m4/debug.c (m4_debug_exit): Free memory allocated in
7707 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7708 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7709 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7710 * m4/m4module.h: Updated prototypes.
7711 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7712 * m4/hash.h: Updated prototypes.
7713 * src/main.c (main): Use all these new functions to clean up as
7714 much memory as possible before exit.
7716 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7718 Reverted my large patch for removing the old m4_symbol
7719 structure on 2001-09-20. We are still not happy about the way
7720 trace works in conjunction with defn and undefine, and leaving
7721 the reverted patch active prevents us from moving the traced
7722 bit from the definition back to the symbol.
7724 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7726 * configure.in: Moved to...
7727 * configure.ac: ...here. Added a libtool like timestamped
7728 banner, and tidied up the libltdl cruft.
7729 * config/mkstamp: Script to extract a timestamp from ChangeLog.
7730 * modules/Makefile.am (INCLTDL): Removed. This is required
7731 only when libltdl is configured in a subdirectory.
7732 * src/Makefile.am: Ditto.
7733 (LIBADD_DL): No need to add this again, libtool already knows
7734 that libm4.la depends on it.
7735 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
7738 * TODO: stackovf.c is basically broken.
7739 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
7741 2001-09-28 Akim Demaille <akim@epita.fr>
7743 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
7745 2001-09-27 Akim Demaille <akim@epita.fr>
7747 * tests/m4.in: Don't use short options.
7748 Simplify the stderr signature normalization.
7750 2001-09-27 Akim Demaille <akim@epita.fr>
7752 tests/m4 shall be position independent.
7756 * tests/testsuite.at: No args to AT_INIT.
7757 * configure.in, tests/Makefile.am: Adjust.
7759 2001-09-22 Akim Demaille <akim@epita.fr>
7761 Autotest has changed again.
7763 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
7764 (package.m4): Remove.
7765 * configure.in: Adjust to LIBADD_GMP.
7767 2001-09-21 Gary V. Vaughan <gary@gnu.org>
7769 * config/gmp.m4 (AC_ARG_WITH): Removed.
7770 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
7771 (AC_LIB_GMP): When performing a test compile against libgmp,
7772 include the header gmp.h if possible, and link against -lgmp. If
7773 they both work define USE_GMP.
7774 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
7775 (mpeval_LTX_init_func): Complain on load that there was no libgmp
7778 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7780 * m4/evalparse.c: Moved to...
7781 * modules/evalparse.c: ...here. This code is shared between
7782 modules/mpeval.c and modules/m4.c, so there is no need to pollute
7783 the libm4 API with its details. Moderately rewritten to interface
7784 into its clients more simply.
7785 * m4/eval.c: Deleted. Migrated functionality to...
7786 * modules/m4.c: ...here.
7787 (builtin_eval): Implemented in terms of the new interface style.
7788 * modules/mpeval.c (builtin_mpeval): Ditto.
7789 * m4/m4module.h: Removed references to the former m4/eval.c.
7790 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
7791 (EXTRA_libm4_la_SOURCES): Deleted.
7792 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
7793 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
7795 2001-09-20 Akim Demaille <akim@epita.fr>
7797 * config/gmp.m4 (AM_WITH_GMP): Rename as...
7799 By default, use gmp.
7801 * configure.in: Adjust.
7802 Use Automake conditionals for USE_GMP.
7803 Always compute sizeof (long long int).
7804 This was a bug BTW, as `eval' (not `mpeval') depends on it:
7805 before, it was used _only_ if mpeval was not activated.
7806 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
7807 (mpeval_la_LIBADD): New macros.
7808 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
7810 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
7811 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
7814 2001-09-20 Akim Demaille <akim@epita.fr>
7816 * tests/Makefile.am (package.m4): New.
7817 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
7819 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7821 More cleanup. After the last patch, m4_symbol holds nothing but
7822 the head of a chain of m4_token_data. So I have removed the old
7823 m4_symbol, so that m4_token_data chains are stored directly in the
7824 value cell of a hash table node. But there's more... m4_symbol
7825 was a more natural name for the symbol value cell, and now that it
7826 is gone I have renamed the former m4_token_data structure to
7827 m4_symbol. This change turned out to be a pig to get right, since
7828 the original code didn't need to modify the value cell itself,
7829 since changing the chain happened inside the m4_symbol that used
7830 to be returned -- I had to pass the address of the value cell
7831 across various function calls, incase the head value changed. I
7832 also tightened up the memory management to help me find a nasty
7833 memory corruption bug that took me all night to track down...
7835 * m4/m4private.h (struct m4_symbol): Removed.
7836 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
7838 * m4/hash.c (m4_hash_iterator_value): Return the address of the
7839 value cell. Updated all callers.
7840 * m4/symtab.c: Took advantage of the simplification in the data
7841 structures to rewrite a lot of this file more simply. There is
7842 still some room for optimisation here, but we should tackle that
7843 systematically closer to the release.
7845 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7846 revealed. This version is ahead of CVS libtool until I get chance
7847 to flush my changes.
7848 * m4/module.c (m4_module_remove): New function that holds the core
7849 of the old m4_module_unload.
7850 (m4_module_unload): Use it.
7851 (m4_module_unload_all): When we know the modules will never be
7852 used again (i.e. on exit), free up as much module memory as
7853 possible. There are still some artifacts from resident modules
7854 living inside ltdl.c, but everything else is freed.
7855 * m4/debug.c (m4_debug_exit): Free memory allocated in
7857 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7858 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7859 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7860 * m4/m4module.h: Updated prototypes.
7861 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7862 * m4/hash.h: Updated prototypes.
7863 * src/main.c (main): Use all these new functions to clean up as
7864 much memory as possible before exit.
7866 2001-09-18 Gary V. Vaughan <gary@gnu.org>
7868 The `traced' flag needs to be attached to the definition of a
7869 symbol rather than the current symbol containing the definition.
7870 Implementing this showed up some long standing post 1.4 bugs in
7871 flag propogation which I also fixed.
7873 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
7874 (struct m4_token_data): And add it back in here.
7875 * m4/input.c (init_macro_token): Propogate the traced flag
7877 * m4/macro.c (expand_argument): Ditto.
7878 * tests/builtins.at (trace2, trace3): New tests based on Akim's
7881 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7883 * m4/m4private.h (struct m4_token_data): Simplified by removing
7884 the redundant `traced' flag, and one level of structure nesting.
7885 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
7886 * m4/input.c (init_macro_token): No need to initialise removed
7888 * m4/macro.c (expand_argument): No need to copy it either.
7889 * m4/utility.c (m4_token_data_func_traced): Or provide an access
7892 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
7893 dependant on multiple symbols with the same key, so preserving
7894 relative symbol order in each bucket during resizing is no longer
7895 required. The resize function is considerably faster as a result.
7897 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
7898 s/m4_symbol_insert/m4_symbol_define/g;
7899 s/m4_builtin_insert/m4_builtin_define/g;
7900 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
7902 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7904 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
7905 commits, the m4_lookup_symbol dispatch function is split into
7906 specialised functions that must be called directly.
7908 * m4/m4module.h (m4_symbol_lookup_t): Removed.
7909 * m4/symtab.c (m4_lookup_symbol): Removed.
7910 (m4_symbol_builtin, m4_symbol_macro): New functions.
7911 * m4/builtin.c (m4_builtin_define): Split into...
7912 (m4_builtin_pushdef, m4_builtin_insert): ...these.
7913 (m4_macro_define): Split into...
7914 (m4_macro_pushdef, m4_macro_insert): ...these.
7915 * src/main.c (main): Set command line macros from `-D' parameters
7916 using `m4_macro_define'.
7918 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7920 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
7921 this from m4_remove_table_reference_symbols().
7922 * m4/m4module.h, m4/module.c: Updated all references.
7924 2001-09-07 Akim Demaille <akim@epita.fr>
7926 * modules/stdlib.c, modules/times.c: Misc cleanups.
7928 2001-09-07 Akim Demaille <akim@epita.fr>
7930 * configure.in: We now need Autoconf 2.52e.
7931 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
7932 and `M4_SYMBOL_DELETE'.
7933 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
7934 * src/main.c (main): Adjust.
7936 2001-09-06 Gary V. Vaughan <gary@gnu.org>
7938 Fix the obstack.h problem once and for all! At configure time we
7939 can test for a system supplied obstack.h: depending on the
7940 result, we now generate system.h with an #include of the correct
7941 header. As a bonus, I've also added a --with-included-obstack,
7942 incase the user doesn't like the system obstack for some
7943 reason... and also we can test the shipped obstack on a system
7944 that has oe of its own. We also now need to be careful to add
7945 build directories to the include search path, since the generated
7946 system.h will be in the build tree.
7948 * configure.in (AC_CONFIG_FILES): Generate system.h from
7950 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
7951 include the system obstack header or the copy shipped with M4.
7952 Allow the user to override configure and force the build to use
7953 the shipped version.
7954 * m4/system-h.in: New file, template for...
7955 * m4/system.h: ...this. Now deleted.
7956 * m4/m4module.h: Include system.h before everything else.
7957 * src/freeze.c: Ditto.
7958 * m4/Makefile.am (dist-hook): Remove generated system.h.
7959 (INCLUDES): Check builddir for generated headers before checking
7961 * modules/Makefile.am (INCLUDES): Ditto.
7962 * src/Makefile.am (INCLUDES): Ditto.
7964 2001-09-05 Gary V. Vaughan <gary@gnu.org>
7966 * TODO: Remove the items that have been addressed already.
7968 2001-09-05 Akim Demaille <akim@epita.fr>
7970 * src/main.c (main): Standardize --version.
7972 2001-09-05 Akim Demaille <akim@epita.fr>
7974 * modules/format.c (format): Have a bigger `str'.
7976 2001-09-05 Akim Demaille <akim@epita.fr>
7978 Rationalize warnings, reporting the macro name as if it were a
7979 program name, and assertions.
7981 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
7983 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
7985 Use assert for internal errors.
7986 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
7988 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
7990 * tests/builtins.at (pushpop): Adjust.
7992 2001-09-05 Akim Demaille <akim@epita.fr>
7994 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
7997 2001-09-05 Akim Demaille <akim@epita.fr>
7999 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
8000 * m4/macro.c, m4/symtab.c: Adjust.
8002 2001-09-05 Akim Demaille <akim@epita.fr>
8004 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
8005 (m4_symbol_pop, m4_symbol_del): this.
8006 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
8007 (m4_symbol_popdef, m4_symbol_delete): New.
8008 (m4_lookup_symbol): Adjust.
8009 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
8011 2001-09-05 Akim Demaille <akim@epita.fr>
8013 * m4/m4module.h (m4_symbol_lookup): Rename as...
8014 (m4_symbol_lookup_t): this.
8016 2001-09-05 Akim Demaille <akim@epita.fr>
8018 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
8020 * m4/symtab.c (m4_lookup_symbol): Adjust.
8022 2001-09-03 Gary V. Vaughan <gary@gnu.org>
8024 Bootstrap will now work with Libtool 1.4.1 or higher:
8025 * bootstrap: Remove stale autom4te.cache files when
8027 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
8029 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
8030 libtool.m4 directly.
8031 Run libtoolize to refresh ltmain.sh.
8032 * config/ltmain.sh: Deleted.
8033 * acinclude.m4: Deleted.
8034 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
8036 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
8037 implementation for the cvs impaired libtool user.
8039 2001-09-03 Akim Demaille <akim@epita.fr>
8041 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
8043 Avoid using `default' in switch, as it hides useful compiler
8044 warnings when a case is forgotten.
8046 2001-09-03 Akim Demaille <akim@epita.fr>
8048 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
8049 is no such thing as `WITH_MODULES'.
8051 2001-09-03 Akim Demaille <akim@epita.fr>
8053 Improve the test suite's selfcontainedness.
8055 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
8056 (Include, Undivert): Tag the other input files.
8057 * tests/generate.awk: Catch `@comment file:'.
8058 `-I $src' is no longer needed.
8059 `next' is really like `return': the rest is skipped.
8060 Adjust to `input.m4'.
8061 (fatal): New function.
8062 * tests/foo, tests/incl.m4: Remove.
8064 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8066 The shadowing mechanism and, infact, the whole symbol table
8067 implementation was creaking under the weight of the features piled
8068 on top of it. We now have a separate hash table module which will
8069 dynamically resize to keep symbol density withing good performace
8070 limits, and a new symtab module layered above it. Symbol lookups
8071 are now marginally more efficient (since the shadowed flag is no
8072 longer required) and symbol removal, such as on module unload, is
8073 considerably faster due to a reorganisation of the data structures
8076 * src/main.c (main): Don't mention `-H'.
8077 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
8080 * m4/hash.c: New generalised dynamic hash table data structure
8082 * m4/hash.h: Public interface.
8083 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
8084 (libm4_la_SOURCES): Add hash.c.
8085 * m4/symtab.c: More or less rewritten from scratch, within the
8086 bounds of the previous API.
8087 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
8088 call. Updated all callers.
8089 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
8090 declarations to reflect API changes.
8091 (M4INIT): Generate a declaration too, to avoid the warning with
8092 --enable-debug builds.
8095 * m4/utility.c (hash_table_size): Removed.
8096 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
8097 names, which are then looked up by builtin_dumpdef() as necessary.
8098 This implies a small speedup in builtin_symbols(), which discarded
8099 all of the symbol info under the old call.
8100 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
8101 shadowing is implicit in respect to the new data structures.
8102 symbol names are no longer duplicated here, they are stored in the
8103 key field of the hash table.
8104 Moved macro_args and blind_no_args...
8105 (m4_token_data): ...to here.
8106 m4/macro.c (expand_macro): Added a name argument since the symbol
8107 name is no longer copied into each struct m4_symbol. Modified all
8109 (collect_arguments): Ditto.
8110 * modules/m4.c (set_trace): Ditto.
8111 * modules/gnu.c (builtin_symbols): Updated.
8112 * src/freeze.c (produce_symbol_dump): Much improved in light of
8113 the improved symbol table layout.
8115 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8117 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
8119 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
8120 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
8121 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
8122 SYMBOL_HANDLE): Ditto.
8123 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
8124 modules/gnu.c, modules/m4.c, src/freeze.c,
8125 src/main.c: Updated all references.
8127 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
8128 Automake 1.5 chokes on dynamic source file lists, Besides, it is
8129 already listed in m4_LDADD... how did that ever used to work?
8130 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
8132 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
8133 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
8135 * tests/m4: Don't call the m4 wrapper script with libtool, it
8136 works fine all by itself.
8138 2001-08-30 Gary V. Vaughan <gary@gnu.org>
8140 The experimental `changeword' feature never took off, and has
8141 no obvious advantages over `changesyntax' to compensate the
8142 enormous speed penalty it carries:
8143 * configure.in (ENABLE_CHANGEWORD): Removed.
8144 * m4/m4module.h (m4_set_word_regexp): Removed.
8145 * m4/m4private.h (m4_token_data): Removed original_text field.
8146 * m4/utility.c (m4_token_data_orig_text): Removed.
8147 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
8148 * m4/macro.c: Ditto.
8149 * src/main.c: Ditto.
8150 * modules/Makefile.am (changeword.la): Removed.
8151 * modules/changeword.c: File removed.
8152 * doc/m4.texinfo: References to changeword and --word-regexp
8154 * po/POTFILES.in: modules/changeword.c removed.
8155 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
8156 * tests/builtins.at (changeword): Test removed.
8158 2001-08-30 Akim Demaille <akim@epita.fr>
8160 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
8161 This also help having a single list of m4 files: in
8163 * config/Makefile.am (STANDARD_MACROS): Rename as...
8164 (ACLOCAL_MACROS): this.
8165 (list-standard-macros): Remove.
8168 2001-08-29 Gary V. Vaughan <gary@gnu.org>
8170 In an attempt to moderate my egomania...
8171 * tests/modules.at: Remove attributions.
8173 * tests/generate.awk: When making substitutions to "@&t@", either
8174 "&" or "\&" in the substitution string argument to gsub refer back
8175 to the matched text. "@\\&t@" seems to work though, Tests 43 and
8178 2001-08-29 Akim Demaille <akim@epita.fr>
8180 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
8181 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
8182 (sync-lines, trace, translit, undivert, wrap): Move to...
8183 * tests/builtins.at: this new file.
8184 * tests/others.at (Discard comments, import-environment): Move to...
8185 * tests/options.at: this new file.
8187 2001-08-29 Akim Demaille <akim@epita.fr>
8189 * tests/others.at (Freezing modules)
8190 (--module-directory: absolute path, modpath2, modpath3)
8191 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
8192 * tests/modules.at: here, new file.
8193 * tests/others.at, tests/generate.awk: Add a banner.
8194 * tests/testsuite.at: Adjust.
8195 (AT_CHECK_M4_FILTER): New, but unused.
8197 2001-08-29 Akim Demaille <akim@epita.fr>
8199 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
8201 * tests/others.at (wrap): Inline wrap.m4.
8202 (shadow): Inline shadow.m4.
8203 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
8204 * tests/m4: Simplify.
8206 2001-08-29 Akim Demaille <akim@epita.fr>
8208 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
8211 2001-08-29 Akim Demaille <akim@epita.fr>
8213 * tests/generate.awk (normalize): s/@__@/@&t@/.
8215 2001-08-28 Akim Demaille <akim@epita.fr>
8217 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
8219 2001-08-28 Gary V. Vaughan <gary@gnu.org>
8221 * bootstrap (generate.awk): Generate test cases with new script.
8223 2001-08-27 Akim Demaille <akim@epita.fr>
8225 * tests/Makefile.am (installcheck-local): Don't use
8226 `dc_install_base' which is not visible here, but `exec_prefix'
8227 which is clearly the RT anyway.
8228 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
8229 related to testing a now installed m4.
8230 * tests/m4: Do it here.
8232 2001-08-27 Akim Demaille <akim@epita.fr>
8234 * tests/others.at (indir): Formatting change.
8236 2001-08-27 Akim Demaille <akim@epita.fr>
8238 * tests/Makefile.am (installcheck-local): New.
8239 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
8241 Prefer options over envvars.
8242 * src/main.c (main): First bug caught by the test suite (yeah!):
8243 --batch lacked a `break' which resulted in an accidental
8244 invocation of --discard-comments.
8246 2001-08-27 Akim Demaille <akim@epita.fr>
8248 * tests/others.at (capitalize, changeword, comments, ddivert)
8249 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
8250 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
8251 (sysv-args, trace, translit, undivert): Don't rely on files in
8252 examples/: AT_DATA them.
8254 2001-08-27 Akim Demaille <akim@epita.fr>
8256 Let the test suite use a wrapper around the not installed m4 to
8257 pretend it is (installed).
8259 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
8260 such a way that m4 does not process them.
8261 * configure.in: The package name seems to be `m4', not `M4'.
8263 * tests/atlocal.in (at_package, M4): Remove.
8264 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
8266 2001-08-27 Akim Demaille <akim@epita.fr>
8268 * tests/Makefile.am (CLEANFILES): Remove.
8269 (DISTCLEANFILES, clean-local): New.
8270 * examples/mktests.sh: Remove.
8272 2001-08-27 Akim Demaille <akim@epita.fr>
8274 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8275 Don't use aclocal: it's written by hand.
8276 * aclocal.m4: m4_include all the files instead of being built by
8278 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8279 until it reads the traces by itself.
8280 * configure.in: Require Autoconf 2.42c as we are now using
8281 AC_CONFIG_TESTDIR instead of AT_CONFIG.
8282 Catch unexpanded `jm_' macros.
8283 * config/atconfig.m4: Remove.
8284 * config/error.m4: new.
8285 * config/Makefile.am: Ship the files included by aclocal.m4.
8286 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8287 (TESTSUITE_AT): this, to please Automake.
8288 (TESTSUITE): This target uses autotest/autotest.m4, not
8289 autotest/general.m4.
8290 * tests/testsuite.at: Prereq Autotest 2.52c.
8291 * examples/Makefile.am (pkgdata_DATA): Rename as...
8292 (dist_pkgdata_DATA): this.
8293 * doc/Makefile.am (man_MANS): Rename as...
8294 (dist_man_mans): this.
8296 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8298 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
8299 Robert Collins, building on Cygwin no longer requires Windows
8300 import and export symbol decorations.
8301 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
8302 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8303 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8304 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8305 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8306 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8307 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8308 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8309 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8310 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
8312 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8313 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8315 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8317 Ansify the source. Previously we had a mix, where my code was
8318 in a K&R compatible style, and the preexisting code was in ANSI
8319 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
8320 and now the code base is much cleaner.
8322 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
8323 VOID macro and all users.
8324 * m4/m4module.h: Ansify function prototypes and headers.
8325 * m4/builtin.c: Ditto.
8326 * m4/evalparse.c: Ditto.
8327 * m4/input.c: Ditto.
8328 * m4/macro.c: Ditto.
8329 * m4/module.c: Ditto.
8330 * m4/output.c: Ditto.
8332 * m4/symtab.c: Ditto.
8333 * m4/utility.c: Ditto.
8334 * modules/format.c: Ditto.
8335 * modules/gnu.c: Ditto.
8336 * modules/m4.c: Ditto.
8337 * modules/mpeval.c: Ditto.
8338 * src/freeze.c: Ditto.
8340 * src/main.c: Ditto.
8342 2001-08-20 Akim Demaille <akim@epita.fr>
8344 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8345 generated with stock 2.52.
8347 2001-08-20 Akim Demaille <akim@epita.fr>
8349 * config/atconfig.m4: New, until part of Autoconf per se.
8350 * configure.in (AT_CONFIG): Use it.
8352 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8353 * tests/atlocal.in: New.
8354 * tests/generate.awk: For the time being, the empty quadrigraph is
8356 * tests/others.at (changeword, gmp): Check the configuration
8357 variable against `yes'.
8358 * tests/testsuite.at (dnl): Allow it, as it's used all over the
8361 2001-08-20 Akim Demaille <akim@epita.fr>
8363 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8364 * modules/m4.c (undivert): Disable the possibility of undiverting
8365 several files at once: it is not documented, it is inconsistent
8366 with the other macros, it can be straightforwardly mocked by
8367 several invocations, and most importantly, it prevents the
8368 possibility of other kinds of extension.
8369 Use `m4_numeric_arg'.
8371 2001-08-20 Akim Demaille <akim@epita.fr>
8373 * examples/include.m4: Typo.
8374 * tests/generate.awk: Really add it.
8375 * tests/Makefile.am: Adjust.
8376 * tests/others.at (Discard comments): It sure fails without `-c'.
8377 (include, undivert): Add -I examples/.
8379 2001-08-20 Akim Demaille <akim@epita.fr>
8381 Use sprintf, not ecft and friends since it is standard, portable,
8382 simplifies the code, and since the latter is even deprecated
8383 according to the GNU libc documentation.
8385 * modules/format.c: Drop evct support.
8387 2001-08-19 Gary V. Vaughan <gary@gnu.org>
8389 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
8391 * configure.in: ...do it here instead.
8393 * c-boxes.el: Deleted.
8394 * m4/builtin.c: Reformat box comments to be closer to GNU
8396 * m4/debug.c: Ditto.
8398 * m4/evalparse.c: Ditto.
8399 * m4/input.c: Ditto.
8400 * m4/m4module.h: Ditto.
8401 * m4/macro.c: Ditto.
8402 * m4/output.c: Ditto.
8403 * m4/symtab.c: Ditto.
8404 * m4/utility.c: Ditto.
8405 * modules/changeword.c: Ditto.
8406 * modules/format.c: Ditto.
8407 * modules/gnu.c: Ditto.
8408 * modules/load.c: Ditto.
8409 * modules/m4.c: Ditto.
8410 * modules/modtest.c: Ditto.
8411 * modules/mpeval.c: Ditto.
8412 * modules/perl.c: Ditto.
8413 * modules/shadow.c: Ditto.
8414 * modules/stdlib.c: Ditto.
8415 * modules/time.c: Ditto.
8416 * src/freeze.c: Ditto.
8417 * src/main.c: Ditto.
8419 2001-08-17 Gary V. Vaughan <gary@gnu.org>
8421 * m4/module.c: Fixup some errors in the description comment.
8423 2001-08-17 Akim Demaille <akim@epita.fr>
8425 * tests/others.at (iso8859): Specify the path to the M4 test file.
8426 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8427 files in error messages.
8429 2001-08-17 Akim Demaille <akim@epita.fr>
8431 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8432 * tests/others.at: Adjust input files paths.
8433 * tests/atconfig.in: Set top_builddir.
8434 * tests/Makefile.am: Adjust.
8435 `testsuite' is in src, not build.
8437 2001-08-17 Akim Demaille <akim@epita.fr>
8439 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8440 (generate.at): Install a temporary hack until the actual
8441 generate.awk is added to the repository.
8442 * tests/atconfig.in: New.
8444 2001-08-17 Akim Demaille <akim@epita.fr>
8446 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8448 2001-08-17 Akim Demaille <akim@epita.fr>
8450 * doc/m4.texinfo: Promote proper quotation.
8452 2001-08-17 Akim Demaille <akim@epita.fr>
8454 Remove the non Autotest tests.
8456 * tests/other-tests/capitalize.test,
8457 * tests/other-tests/changeword.test,
8458 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8459 * tests/other-tests/debug.test,
8460 * tests/other-tests/discard-comments.m4,
8461 * tests/other-tests/discard-comments.test,
8462 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8463 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8464 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8465 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8466 * tests/other-tests/hanoi.test,
8467 * tests/other-tests/import-environment.m4,
8468 * tests/other-tests/import-environment.test,
8469 * tests/other-tests/include.test, tests/other-tests/indir.test,
8470 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8471 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8472 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8473 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8474 * tests/other-tests/modtest.test,
8475 * tests/other-tests/multiquotes.test,
8476 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8477 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8478 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8479 * tests/other-tests/sync-lines.m4,
8480 * tests/other-tests/sync-lines.test,
8481 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8482 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8483 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8484 * tests/other-tests/wrap.test: Remove.
8486 * tests/run-test, tests/get-them: Remove.
8487 * tests/Makefile.am: Adjust.
8489 2001-08-17 Akim Demaille <akim@epita.fr>
8491 others.at no longer depends on other-tests/.
8493 * tests/others.at (stackovf): You're actually...
8495 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8496 (unload.test): Keep their authorship.
8497 (discard-comments, gmp, import-environment, modfreeze)
8498 (sync-lines): Embed the input files.
8499 * tests/stackovf.test: Copy from other-tests/stackovf.test.
8500 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8502 2001-08-17 Akim Demaille <akim@epita.fr>
8504 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8505 (M4exit): Tag the exit status of the example.
8506 * tests/get-them: Adjust.
8507 * tests/generate.awk: New, based on get-them.
8508 * tests/Makefile.am: Adjust to generate `generated.at'.
8509 * tests/testsuite.at: Adjust.
8510 (AT_CHECK_M4): Don't overquote. Blush...
8512 2001-08-17 Akim Demaille <akim@epita.fr>
8514 Start using Autotest. atconfig creation is still lacking.
8516 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8517 * examples/reverse.m4, tests/other-tests/import-environment.m4,
8518 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8519 * tests/other-tests/import-environment.test: Don't check LANGUAGE
8520 as it might be `unset', or set to `C'.
8521 * tests/other-tests/iso8859.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/patsubst.test, tests/other-tests/reverse.test,
8525 * tests/other-tests/shadow.test: Adjust.
8526 * tests/testsuite.at, tests/others.at: New.
8527 * tests/Makefile.am: Adjust.
8529 2001-08-17 Akim Demaille <akim@epita.fr>
8531 Drop Autoconf 2.13 compatibility.
8533 * configure.in (changeword): No need to undefine it, as anyway if
8534 it's defined, M4sugar moved it as m4_changeword.
8535 And anyway, proper quotation is enough.
8536 (m4_pattern_allow): As it exists in 2.50, just use it.
8537 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
8538 Don't handle Gettext's duties, let it handle them.
8539 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
8541 2001-08-17 Akim Demaille <akim@epita.fr>
8543 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
8544 (m4_errprint): Use fputs.
8545 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
8546 dumpdef are not concerned.
8547 (Dumpdef, Errprint): Emphasize their insensitivity to
8549 * doc/Makefile.am: Add `TAGS' support.
8550 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
8552 * config/Makefile.am (MAINTAINERCLEANFILES): New.
8554 2001-08-17 Akim Demaille <akim@epita.fr>
8556 * modules/Makefile.am (ETAGS_ARGS): New.
8558 2001-08-17 Akim Demaille <akim@epita.fr>
8560 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
8563 2001-08-17 Akim Demaille <akim@epita.fr>
8565 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
8567 2001-08-17 Akim Demaille <akim@epita.fr>
8569 * m4/m4module.h (m4/list.h): Don't include it.
8571 2001-08-16 Gary V. Vaughan <gary@gnu.org>
8573 m4_modules are no more, we use lt_dlhandles directly and let
8574 latest libltdl features manage the list of loaded modules.
8575 * acinclude.m4: Regenerated.
8576 * m4/ltdl.c: Updated from master copy.
8577 * m4/module.c: Reimplemented to take advantage of advances in
8579 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
8580 list with lt_dlhandle_next.
8581 (m4_builtin_find_by_func): Ditto.
8582 (m4_builtin_table_install): Use lt_dlhandle.
8583 (m4_macro_define): Ditto.
8584 (m4_macro_table_install): Ditto.
8585 m4/module.h: Prototype new module management API.
8586 (m4_modules): No longer required.
8587 (m4_module_init_t, m4_module_finish_t): POSIX namespace
8588 violations, renamed to...
8589 (m4_module_init_func, m4_module_finish_func): ...these,
8591 (M4INIT_HANDLER): Clean way to declare init functions in modules.
8592 (M4FINISH_HANDLER): And similarly for finish functions.
8593 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
8594 -- Add indirection to the CONC macro so that arguments are
8596 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
8597 * modules/shadow.c (m4_init_module): Ditto.
8598 Due to new init function semantics, be careful to perform the
8599 initialisation only on first load.
8600 * modules/perl.c (m4_init_module): Ditto. And Ditto.
8601 (m4_finish_module): Replaced with M4FINISH_HANDLER.
8602 Due to new finish function semantics, be careful to perform the
8603 finalisation only on first load.
8604 * m4/m4private.h (m4_module): Removed in favour of...
8605 (m4_module_data): ...structure without all the wrapper fields.
8606 Instances of this new structure are stored associated lt_dlhandles
8607 with lt_dlcaller_data_set().
8608 * m4/builtin.c (m4_builtin_define): Takes a handle argument
8609 instead of the old module argument.
8610 (m4_builtin_table_install): Ditto.
8611 * modules/load.c (m4_resident_module): Removed. This is no
8612 longer implemented as a magic symbol...
8613 * modules/m4.c (m4_resident_module): Ditto.
8614 * modules/load.c (M4INIT_HANDLER): ...the module init function now
8615 uses the ltdl api to make the module resident.
8616 * modules/m4.c (M4INIT_HANDLER): Ditto.
8617 * modules/load.c (builtin_modules): Traverse the loaded module
8618 list with lt_dlhandle_next.
8619 (builtin_load): Much simplified in light of the reimplemented
8621 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
8622 light of the m4/module.c rewrite.
8623 (produce_symbol_dump): Ditto.
8624 (reload_frozen_state): Ditto.
8625 * m4/list.c, m4/list.h: Files deleted. No longer required.
8626 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
8627 (libm4_la_SOURCES): Delete list.c reference.
8628 * m4/m4private.h (m4_token_data): Add a handle field. This
8629 eliminates many of the searches to find the handle associated with
8630 various tokens that are passed between functions.
8631 (struct m4_symbol): Removed the module field. The
8632 module association does not belong with the symbol...
8633 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
8634 that the module implementation code is from. Added a handle
8636 (m4_push_macro): Add a `handle' argument. Changed all callers.
8637 (init_macro_token): Set the `handle' field for the
8639 * m4/macro.c (expand_argument): Copy the new handle field during
8641 * modules/m4.c (macro_install): Use the new handle field to
8642 optimise the search for the correct builtin structure, and pass
8643 the handle details to m4_builtin_define.
8645 2001-08-15 Akim Demaille <akim@epita.fr>
8647 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
8648 when creating `m4/obstack.h'.
8649 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
8651 * tests/defs: Make them absolute.
8652 (CDPATH) Neutralize.
8653 * tests/gethem: Use them.
8655 2001-08-14 Gary V. Vaughan <gary@gnu.org>
8657 * config/ltmain.sh: Doh! Import again for a quoting fix that
8658 prevented any regression test from passing.
8660 * m4/m4module.h (obstack.h): Choose between installed version
8661 and shipped version based on configure tests.
8662 * src/freeze.c (obstack.h): Ditto.
8664 * acconfig.h: Removed. No longer required.
8666 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
8667 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
8668 them to AC_INIT and AM_INIT_AUTOMAKE.
8669 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
8670 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
8671 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
8672 shell variable m4_cv_func_obstack_h.
8673 * tests/defs (M4): Be more careful about relative path to libtool
8674 script and m4 binary by using $srcdir.
8676 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
8677 optargs to the existing libltdl search path.
8678 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
8679 * m4/ltdl.c: Updated.
8681 * config/ltmain.sh: Ditto.
8683 2001-08-11 Gary V. Vaughan <gary@gnu.org>
8685 * src/main.c (main): Add `-b' (for `batch') mode switch to force
8686 interactive mode off.
8688 2001-08-10 Akim Demaille <akim@epita.fr>
8690 * configure.in: Require Autoconf 2.52.
8691 (AC_ARG_PROGRAM): Remove, handled by Automake.
8692 (m4_getopt): Rename as...
8693 (m4_getopt_h): this.
8694 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
8695 Undefine `changeword' only if defined.
8696 * config/gnu-obstack.m4: Require Autoconf 2.52.
8697 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
8700 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
8702 * doc/m4.texinfo: Fix some typos, and apply some small
8705 2001-08-09 Andreas Schwab <schwab@suse.de>
8707 * src/main.c (main): Fix improper uses of error (missing format
8710 2001-08-07 Akim Demaille <akim@epita.fr>
8712 Improve `make distcheck'.
8714 * configure.in: Be sure to be able to run `mkconfig.sh' when src
8716 * Makefile.am (dist-hook): Remove, as it is no longer needed.
8717 * doc/m4.texinfo (Include): Add missing blank.
8718 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
8721 2001-08-07 Akim Demaille <akim@epita.fr>
8723 * m4/evalparse.c: A better introductory comment.
8724 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
8725 * m4/macro.c: Adjust old comments.
8726 * modules/README: Typo.
8728 2001-08-07 Akim Demaille <akim@epita.fr>
8730 * config/gnu-obstack.m4: New.
8732 2001-08-07 Akim Demaille <akim@epita.fr>
8734 * config/Makefile.am, config/stackovf.m4: New.
8735 * configure.in, Makefile.am: Adjust.
8737 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
8739 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
8740 * po/cat-id-tbl.c: Remove file.
8741 * po/stamp-cat-id: Remove file.
8743 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
8745 * modules/format.c (format): Formatting for %f was not
8746 interpreting the position of the decimal point correctly for
8749 2000-12-01 Gary V. Vaughan <gary@gnu.org>
8751 * TODO: Removed m4exit bug.
8752 * modules/load.c (m4_resident_module): Make this module resident.
8753 * module/m4.c (m4_resident_module): Ditto.
8754 * m4/modules.c (m4_module_load): Use new ltdl resident modules
8755 feature to mark modules as resident if they export
8756 `m4_resident_module' as TRUE.
8757 (m4_module_unload): Do not remove resident modules, and take care
8758 with symbol insertion and deletion with resident modules.
8759 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
8760 use resident modules feature.
8762 2000-11-30 Gary V. Vaughan <gary@gnu.org>
8764 * TODO: Updated. Removed some cruft that has since been fixed
8765 or implemented. Added some more entries.
8768 * modules/README: Updated.
8769 * doc/m4.texinfo: Updated.
8771 * modules/gnu.c (builtin_functions): Make indir orthogonal to
8772 builtin, in that each is recognised as a macro only with parameters
8773 (builtin_indir): Passing 0 arguments is now an error, as with
8776 * src/main.c (usage): Added missing description of `-c' option.
8778 2000-11-29 Gary V. Vaughan <gary@gnu.org>
8780 Consolidate the myriad of dispersed test scripts into the
8781 tests subdirectory. I think I now have all the file where I
8782 want them, so there shouldn't be anymore upheaval =)O|
8784 * tests/Makefile.am: Updated to run the new tests added below.
8785 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
8786 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
8787 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8788 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8789 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8790 tests/other-tests/hanoi.test, tests/other-tests/include.test,
8791 tests/other-tests/indir.test, tests/other-tests/misc.test,
8792 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
8793 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8794 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8795 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
8796 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
8797 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
8798 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8799 tests/other-tests/translit.test, tests/other-tests/undivert.test,
8800 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8801 tests/other-tests/wrap.test: New tests based on the contents
8802 of the tests removed below.
8803 * examples/Makefile.am, modules/Makefile.am: Updated to
8804 reflect removed tests.
8805 * examples/defs,modules/defs: Removed.
8806 * examples/capitalize.test, examples/comments.test,
8807 examples/ddivert.test, examples/debug.test,
8808 examples/esyscmd.test, examples/exp.test,
8809 examples/foreach.test, examples/forloop.test,
8810 examples/fstab.test, examples/hanoi.test,
8811 examples/include.test, examples/indir.test,
8812 examples/misc.test, examples/multiquotes.test,
8813 examples/patsubst.test, examples/pushpop.test,
8814 examples/regexp.test, examples/reverse.test,
8815 examples/sysv-args.test, examples/trace.test,
8816 examples/translit.test, examples/undivert.test,
8817 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
8818 modules/modpath1.test, modules/modpath2.test,
8819 modules/modpath3.test, modules/modpath4.test,
8820 modules/modtest.test, modules/shadow.test,
8821 modules/unfrozen.m4, modules/unload.test: Removed.
8823 Move the implementation of GMP support for the mpeval() builtin
8824 into a loadable module that depends on libgmp. mpeval() and
8825 eval() share a common parser, now in m4/evalparser.c; the code
8826 in m4/numb.c and m4/numb.h is now physically split between
8827 m4/eval.c (the eval() backend) and modules/mpeval.c (the
8828 mpeval() backend), rather than being differentiated by cpp
8829 macros and multiple inclusion. The mpeval module is always
8830 built but will generate an diagnostic if it is used from an
8831 installation that didn't link in the gmp library.
8832 * modules/Makefile.am: build and install the new mpeval module.
8833 * modules/mpeval.c: Now contains the former parts of m4/numb.c
8834 and m4/numb.h that are required for gmp support in mpeval().
8835 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8836 * m4/evalmp.c: Removed.
8837 * m4/m4module.h: Removed conditional prototype for
8839 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
8840 and m4/numb.h that do not rely on gmp.
8841 * m4/evalparse.c: New file, contains the shared parts of the
8842 eval() and evalmp() parser implementations, and is no longer
8843 unencumbered by cpp magic to uncover the right parts.
8844 * m4/numb.h: Removed. It's former contents are split between
8845 m4/eval.c and modules/mpeval.c.
8848 * tests/other-tests/changeword.test: New test. Rudimentary
8849 testing of changeword builtin runs only if --wnable-changeword
8850 was used at configure time.
8851 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8852 alternation correctly. Split into two expressions to compensate.
8853 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
8854 * modules/Makefile.am: Build changeword module.
8855 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
8856 only when --enable-changeword was passed to configure.
8857 (builtin_changeword): If --enable-changeword was not used, then
8858 report that changeword() builtin has no support in m4 binary.
8860 2000-11-28 Gary V. Vaughan <gary@gnu.org>
8862 * src/main.c (main): Fixed a particularly nasty bug is
8863 user_search_path setting -- the -M flag processing must be
8864 extremely careful with search path ordering, or else the default
8865 installed module directory (possibly containing modules from a
8866 previous release) is placed earlier in the search path than any -M
8867 arguments (which are relied upon to load uninstalled modules with
8868 most of the tests in the regresion suite).
8870 * modules/load.c (builtin_load): Nasty hack to prevent adding
8871 symbols to symtab again if a module is loaded more than once.
8872 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
8874 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
8875 possible NULL pointer dereference.
8877 * m4/module.c (m4_module_find_by_modname): Renamed from
8878 m4_module_modname_find. Fixed all references.
8879 (m4_module_find_by_builtin): New function.
8881 * modules/modfreeze.test: load the `load' module with each
8883 * src/freeze.c (produce_frozen_state): Simplified in light of
8884 module field in m4_symbol. Allow a third argument for text macros
8885 to name the originating module.
8886 (reload_frozen_state): ditto.
8887 * m4/m4module.h: Fixup prototypes.
8888 * m4/builtin.h (m4_builtin_define): Add a module argument so
8889 that symbols can be registered against the defining module.
8890 (m4_macro_define): ditto.
8891 * m4/m4private.h (m4_symbol): Make the module field const to save
8892 on casting in the rest of the code.
8893 (SYMBOL_MODULE): New macro.
8895 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
8896 symbol reference maintenance bugs when removing a symbol from the
8899 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
8901 2000-11-27 Gary V. Vaughan <gary@gnu.org>
8903 * configure.in (m4_cv_func_obstack): A better check for whether
8904 libc has an obstack implementation.
8905 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
8907 * configure.in (--with-modules): Changed semantics. This
8908 option is now used to list modules to be preopened.
8909 * src/m4.h: #include "ltdl.h" unconditionally.
8910 * src/main.c: Removed all dependencies on WITH_MODULES.
8911 * src/freeze.c: ditto.
8912 * modules/Makefile.am: ditto.
8913 * m4/m4.c (builtin_m4exit): ditto.
8914 * modules/modpath1.test: ditto.
8915 * modules/modpath2.test: ditto.
8916 * modules/modpath3.test: ditto.
8917 * modules/modpath4.test: ditto.
8918 * modules/modtest.test: ditto.
8919 * modules/shadow.test: ditto.
8920 * modules/unload.test: ditto.
8922 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
8923 comes up on demand in LTLIBOBJS now.
8924 * configure.in (getopt_long): Creating and relying on a link for
8925 getopt.h on hosts with no getopt_long() of thier own works
8926 correctly now. This is necessary so that callers of getopt_long()
8927 can simply `#include <getopt.h>': the naive way of doing this
8928 would end up using our own getopt.h and the installed
8929 getopt_long(), which is asking for trouble!
8930 (obstack_init): A similar argument applies to obstack.h and
8933 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
8934 On Solaris-2.5 (at least) the native dlopen implementation
8935 gets confused about m4.o when looking for module "m4". This
8936 version always looks for .la an .$lib_ext suffixed names first
8937 to work around the problem. Sigh.
8939 * po/POTFILES.in: Take account of these file movements.
8940 * src/Makefile.am (m4_SOURCES): removed eval.c.
8941 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
8942 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
8943 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
8944 * modules/m4.c (builtin_eval): Use m4_evaluate().
8945 * m4/eval.c: Moved here from src/eval.c to facilitate
8946 implementation of eval() builtin as part of the `m4' loadable
8948 (m4_evaluate): renamed from evaluate for namespace cleanliness.
8949 * m4/numb.c: Moved here from src/numb.c, since it is #included
8950 into eval.c at compile time.
8951 * m4/m4module.h (m4_evaluate): Added prototype.
8952 * src/m4.h (evaluate): Removed prototype.
8954 2000-11-25 Gary V. Vaughan <gary@gnu.org>
8956 * modules/perl.c (builtin_perleval): Use PL_na for
8957 compatibility with perl-5.6.
8959 * src/main.c (main): It is now safe to
8960 ``m4_module_install("m4")'', without tripping over the m4
8962 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
8963 versions having fixed the insidious module search order bug.
8965 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
8966 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
8968 * configure.in: Figure out whether to use the installed
8969 getopt.h or the supplied one.
8970 * src/Makefile.am: ditto.
8972 * po/POTFILES.in: List files in their new positions.
8974 * config/ltmain.sh: This needs to be checked in to match the
8975 libtool macros copied to acinclude.m4 (until a released
8976 libtool copes with m4's needs).
8977 * bootstrap: Run gettextize.
8979 2000-11-24 Gary V. Vaughan <gary@gnu.org>
8981 * AUTHORS: Added my details.
8984 * bootstrap: temporary update until released libtool catches up.
8986 * All files: Use new GNU GPL copyright blurb with current contact
8989 * configure.in (LTLIBOBJS): Use canonical code for calculation of
8992 * config: renamed acm4 directory to config to be more like
8993 other autoconfiscated packages.
8995 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
8996 * config/debug.m4: New file implementing configure macros to add
8997 suitable debug flags to the compiler invocation.
8999 * modules/load.c: New file implementing the ``load'' and
9000 ``unload'' builtins.
9001 * tests/get-them: Set the module search directory to the modules
9002 build directory in generated tests.
9003 * modules/shadow.test: ditto.
9004 * modules/modtest.test: ditto.
9005 * modules/modpath1.test: ditto.
9006 * modules/modpath2.test: ditto.
9007 * modules/modpath3.test: ditto.
9008 * modules/modpath4.test: ditto.
9009 * modules/modtest.test: ditto.
9010 * modules/modfreeze.test: ditto.
9011 * modules/unload.test: ditto.
9013 * modules/changeword.c: New file implementing the ``changeword''
9014 builtin as a loadable module.
9015 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
9016 as a loadable module.
9018 * src/main.c (main): Load the gnu module if m4 was started
9019 normally -- i.e. without the -G option.
9020 * modules/gnu.c: New file implementing a new loadable module wuth
9021 definitions for all the gnu extension builtins.
9022 * modules/format.c: Moved here from src/format.c. Now included
9025 * src/main.c (main): Load the traditional module if m4 was
9026 started in `no_gnu_extensions' mode.
9027 * modules/traditional.c: New file implementing the ``unix'' macro,
9028 required when m4 is executed in traditional mode, as a loadable
9031 * src/main.c: Renamed from m4.c to avoid confusion with
9033 (main): Always load the m4 module.
9034 * modules/m4.c: New file implementing a new loadable module with
9035 definitions for all m4 builtins that are not gnu extensions.
9037 * m4/Makefile.am: Adjusted to take new files below into account.
9038 * m4/m4module.h: Prototypes for exported functions and types moved
9039 to this directory from the src directory.
9040 * m4/m4private.h: Moved here from src/m4private.h to facilitate
9041 the migration of all builtin implementations to loadable modules.
9042 * m4/macro.c: Moved this file here from the src directory,
9043 renaming all exported symbols to use the prefix ``m4_''.
9044 * m4/builtin.c: ditto.
9045 * m4/module.c: ditto.
9046 * m4/symtab.c: ditto.
9047 * m4/debug.c: ditto.
9048 * m4/input.c: ditto.
9049 * m4/output.c: ditto.
9051 * m4/ltdl.h, m4/ltdl.c: ditto.
9052 * m4/utility.c: Odd functions moved here from files in the src
9053 directory to facilitate builtin migration.
9055 2000-08-12 Gary V. Vaughan <gary@gnu.org>
9057 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
9058 error message, to make translators' jobs a little easier.
9059 (builtin_builtin): ditto.
9060 (builtin_traceon): ditto.
9061 (builtin_traceoff): ditto.
9062 Reported by Akim Demaille <akim@epita.fr>
9064 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
9065 pkgincludedir instead.
9067 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
9068 it is exported globally. Fixed all references.
9072 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
9073 globally. Fixed all references.
9074 (DEF_LQUOTE): ditto.
9078 2000-07-28 Gary V. Vaughan <gary@gnu.org>
9083 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
9084 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
9086 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
9087 Removed `Prev', `Next' and `Up' fields of all @nodes now that
9088 makeinfo calculates them for us, and to make any future
9089 reorganisation easier.
9090 (Frozen files): Document format version 2.
9091 `V' now takes argument `2'.
9092 `F' can take a single argument if symbol and builtin names
9093 are the same, or 3 arguments if the builtin is from a module.
9094 New `S' specification for saving syntax table contents.
9095 New `M' specification for saving loaded module names.
9096 * src/freeze.c: Implement them.
9097 * src/input.c (syntax_code): For interpreting frozen syntax
9100 * examples/Makefile.am: Add the contents of the WWW directory to
9102 * examples/WWW/Makefile: ditto,
9103 (%.htm): Compares file contents (not just sizes) to determine
9104 whether a change has occured.
9105 * examples/WWW/_header.htm: Bumped version number.
9106 * examples/WWW: Regenerated content.
9108 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
9109 compilers comes much easier without ansi2knr.
9110 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
9112 * m4/list.c: New generic list container type.
9113 * m4/list.h: Interface to new container type.
9114 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
9115 (libm4_la_SOURCES): compile and link list.c.
9116 * src/builtin.c (builtin_tables): Use list container.
9117 * src/module.c (symtab): ditto.
9118 * src/symtab.c (symtab): ditto.
9120 * m4/system.h: New file for common preprocessor definitions.
9121 * m4/Makefile.am (pkginc_HEADERS): install system.h.
9122 * m4/error.c: Use system.h in place of inline preprocessor.
9123 * m4/error.h: ditto.
9124 * m4/module.c: ditto.
9125 * m4/module.h: ditto.
9126 * m4/xmalloc.c: ditto.
9128 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
9130 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
9132 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
9133 it is exported globally. Fixed all references.
9135 (module_init_t): ditto.
9136 (module_finish_t): ditto.
9137 (token_data): ditto.
9138 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
9139 it is exported globally. Fixed all references.
9140 (SYNTAX_IGNORE): ditto.
9141 (SYNTAX_SPACE): ditto.
9142 (SYNTAX_OPEN): ditto.
9143 (SYNTAX_CLOSE): ditto.
9144 (SYNTAX_COMMA): ditto.
9145 (SYNTAX_DOLLAR): ditto.
9146 (SYNTAX_ACTIVE): ditto.
9147 (SYNTAX_ESCAPE): ditto.
9148 (SYNTAX_ALPHA): ditto.
9149 (SYNTAX_NUM): ditto.
9150 (SYNTAX_ALNUM): ditto.
9151 (SYNTAX_LQUOTE): ditto.
9152 (SYNTAX_RQUOTE): ditto.
9153 (SYNTAX_BCOMM): ditto.
9154 (SYNTAX_ECOMM): ditto.
9155 (SYNTAX_VALUE): ditto.
9156 (SYNTAX_MASKS): ditto.
9174 (TOKEN_NONE): ditto.
9175 (TOKEN_STRING): ditto.
9176 (TOKEN_SPACE): ditto.
9177 (TOKEN_WORD): ditto.
9178 (TOKEN_SIMPLE): ditto.
9179 (TOKEN_MACDEF): ditto.
9181 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
9182 consistency. Fixed all references.
9183 (STRING): Renamed to `m4_string' for consistency, and because if
9184 is exported globally. Fixed all references.
9185 (token_type): Renamed to `m4_token_t' for the same reasons.
9186 (token_data_type): Renamed to `m4_token_data_t' for the same
9189 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
9193 (XFREE): Wrapper macro which avoids freeing NULL pointers.
9195 * m4/m4module.h (m4_macro): New type for module defined user
9197 * modules/modtest.c (m4_macro_table): Define module user macros.
9198 * modules/shadow.c (m4_macro_table): ditto.
9200 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
9201 declared with M4BUILTIN.
9203 * m4/xmalloc.c: Use memset if bzero is not available when
9204 emulating calloc with malloc.
9205 (xcalloc): Fallback to malloc/bzero if calloc is not available.
9206 (xfree): Added for consistency. Will not try to free NULL
9208 * src/m4.c (xfree): Deleted in favour of the above.
9209 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
9210 linking with libdmalloc.
9211 * m4/xstrdup.c (WITH_DMALLOC): ditto.
9213 * modules/frozen.m4: New test case.
9214 * modules/unfrozen.m4: ditto.
9215 * modules/modfreeze.test: New test.
9216 * modules/unload.test: ditto.
9217 * modules/Makefile.am (EXTRA_DIST): Distribute them.
9219 * modules/modpath1.test: Don't try this test if module support is
9221 * modules/modpath2.test: ditto.
9222 * modules/modpath3.test: ditto.
9223 * modules/modpath4.test: ditto.
9224 * modules/modtest.test: ditto.
9225 * modules/shadow.test: ditto.
9227 * modules/perl.c: New module.
9228 * modules/perl.m4: Example of using it.
9229 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
9231 * src/m4.c (main): Assume interactive mode if STDIN is connected
9233 Changed startup sequence slightly so that syntax is not
9234 initialised from here when loading a frozen file.
9236 * src/builtin.c: Much improved macro definition style.
9237 * src/m4private.h: Internal structures for m4_builtin and
9238 m4_macro instances. These are not exposed to module writers.
9239 * src/module.c (module_modname_find): Find a module structure
9241 (make_macro_table): Build an internal macro table from a external
9243 (make_builtin_table): Build an internal builtin table from an
9244 external definition.
9246 * src/module.c (module_unload): Be extremely careful to remove
9247 builtins and macros that match the module being unloaded -- no
9248 longer assume that the top element can be removed incase another
9249 odule defines an identical name.
9250 * src/symtab.c (remove_table_reference_symbols): remove all symbol
9251 table entries which refer to a given builtin table.
9252 * src/builtin.c (remove_tables): Use it!
9254 2000-07-13 Thomas Tanner <tanner@ffii.org>
9256 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
9257 * acm4/modules.m4: deleted
9258 * bootstrap: don't libtoolize libltdl!
9259 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
9260 if set, enable WITH_MODULES and add modules to DLPREOPEN
9261 * examples/misc.test: redirect standard output
9262 * lib/Makefile.am: don't use DLLDFLAGS
9263 * lib/m4module.c: include necessary headers to silence GCC -Wall
9264 * lib/m4regex.c: fixes to silence GCC -Wall
9265 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
9266 build modules conditionally
9267 * modules/shadow.c: define symbol aliases before using them
9268 * modules/test.c: define symbol aliases before using them
9269 * po/de.po: update translation
9270 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9271 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9273 * src/m4.c: initialize libltdl's preloaded symbols via
9274 LTDL_SET_PRELOADED_SYMBOLS
9275 * src/module.c: libltdl's memory management must be initialized
9276 before calling lt_dlinit!, fix warnings
9278 2000-01-18 Gary V. Vaughan <gary@gnu.org>
9280 * README: Caveat about nls not supported by dll architecture on
9283 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9285 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
9286 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
9287 * modules/Makefile.am (LIBS): ditto.
9288 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9289 $(top_srcdir)/m4 (for only <m4module.h>).
9290 * modules/shadow.test: fixed for VPATH.
9291 * modules/modtest.test: ditto.
9292 * modules/modpath4.test: ditto.
9293 * modules/modpath3.test: ditto.
9294 * modules/modpath2.test: ditto.
9295 * modules/modpath1.test: ditto.
9297 * modules/time.test: Removed due to timezone dependence,
9298 * modules/Makefile.am (TESTS): Removed time.test.
9300 * configure.in: Use $3 of AC_DEFINE so that we can,,,
9301 * acconfig.h: Remove everything except the gettext parameters.
9302 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9304 * acm4/ltdl.m4: Updated to latest from libtool cvs.
9305 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
9306 increment serial number.
9308 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9309 src dir and immediately after libm4 is built for confidence that
9310 it doesn't rely on the src directory.
9311 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9312 makeinfo stop the build on cygwin (because they don't work).
9314 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9316 * m4/m4private.h: ...is not a public header, so moved to src.
9317 Add `#include <config.h>', `#define _COMPILING_M4' and
9319 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9320 * src/Makefile.am (noinst_HEADERS): add m4private.h.
9321 * src/builtin.c: `#include "m4private.h"' now takes care of the
9322 above. Duplicates removed.
9323 * src/debug.c: ditto.
9324 * src/eval.c: ditto.
9325 * src/evalmp.c: ditto.
9326 * src/format.c: ditto.
9327 * src/freeze.c: ditto.
9328 * src/input.c: ditto.
9330 * src/macro.c: ditto.
9331 * src/module.c: ditto.
9332 * src/numb.h: ditto.
9333 * src/output.c: ditto.
9334 * src/path.c: ditto.
9335 * stackovf.c: ditto.
9338 * po/POTFILES.in: compensate for renaming of lib/*.
9339 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9340 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9341 and then in $(top_srcdir)/lib (for eg. "m4private.h").
9342 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9344 * m4/m4error.h: Renamed error.h, for installation to
9345 $prefix/include/m4..
9346 * m4/m4obstack.h: Renamed obstack.h, for same reason.
9347 * m4/m4regex.h: Renamed regex.h, for same reason.
9348 * m4/m4error.c: Renamed error.c, and use #include "error.h".
9349 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9350 * m4/m4regex.c: Renamed regex.c, and fix #includes.
9352 * lib: moved to m4 to easily support header installation to
9354 * Makefile.am (SUBDIRS): renamed lib dir to m4.
9355 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9356 * acm4/regex.m4: Point to m4/regex.c.
9358 * examples/foreach.m4: Sanitise quoting.
9359 * examples/foreach.test: New torture test.
9360 From Akim Demaille <akim@epita.fr>
9362 2000-01-17 Gary V. Vaughan <gary@gnu.org>
9364 * src/ltdl.c: Use access() to abort doomed module load attempts
9365 if module file does not exist.
9367 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9368 getopt1.o will already be used if appropriate, so I moved getopt.c
9369 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9371 * modules/modpath1.test: Use correct filename in header line.
9372 * modules/modpath2.test: ditto.
9373 * modules/modpath3.test: ditto.
9374 * modules/modpath4.test: ditto.
9376 Without these changes lt_dlopen("test") attempts to
9377 LoadLibrary("/bin/test") on Windows, which although harmless
9378 generates a spurious error message which spoils most of the tests:
9379 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9380 (TESTS): s/test.test /modtest.test /
9381 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9382 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9383 * modules/modpath1.test: s/test.m4 /modtest.m4 /
9384 * modules/modpath2.test: ditto.
9385 * modules/modpath4.test: ditto.
9386 * modules/modpath3.test: s/-m test /-m modtest /
9387 * modules/shadow.m4: use {un,}loadmodule(`modtest').
9389 2000-01-16 Gary V. Vaughan <gary@gnu.org>
9391 * src/ltdl.c (find_file): Updated to new version with fixed memory
9392 allocation bug in `next'.
9393 * src/ltdl.h: updated to match.
9395 * modules/Makefile.am: Cleaned up and reordered.
9397 2000-01-16 René Seindal <rene@seindal.dk>
9399 * modules/Makefile.am (TESTS): New tests for the module system.
9401 * modules/*.test: New files.
9403 * src/m4.c (main): Added call to module_init().
9404 Treats -M and -m as the arguments -D -U and -t, ie deferred.
9406 * src/m4.h: Added declaration of module_init().
9408 * src/module.c (module_init): No longer static
9410 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9411 Added to shut up automake about non standard libtool library
9414 * src/module.c: Disabled DEBUG by default.
9416 * modules/README: Changed example from unload.m4 to shadow.m4
9418 * modules/shadow.m4: Renamed from unload.m4
9420 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9422 * src/m4.c (main): Functionality for -m and -M were reversed.
9425 2000-01-12 Gary V. Vaughan <gary@gnu.org>
9427 * doc/help2man.pl: updated to version 1.020.
9429 * lib/COPYING.LIB: updated to version 2.1.
9431 * lib/m4module.h: restructure the M4_SCOPE code to work when
9432 creating a dll which links with libm4.la and both DLL_EXPORT
9433 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9436 2000-01-11 Gary V. Vaughan <gary@gnu.org>
9438 Merged the following changes from my tree:
9440 1999-06-15 Gary V. Vaughan <gary@gnu.org>
9442 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9443 ported to compile shared libs.
9445 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9446 use `__declspec(dllimport)' when linking libm4.la on win32.
9447 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9449 * configure.in (M4OBJS): Discover whether we need the shipped
9450 implementation of getopt_long.
9451 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9452 main binary here, as opposed to the module library in lib/libm4.la.
9454 1999-06-14 Gary V. Vaughan <gary@gnu.org>
9456 * modules/README: Updated to describe the improved libltdl based
9458 * README (cygwin): Added some compilation notes for building m4
9459 correctly under cygwin.
9460 * TODO: Cleaned out the entries for the module system since they
9461 are now implemented.
9463 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9464 all instances of __P with M4_PARAMS.
9466 * lib/getdate.h: removed unreferenced file.
9468 * lib/m4private.h: New file to define the private interface to the
9469 token_data struct, which must be shared between m4module.c, and
9470 builtin.c but not exported to modules built from the installed
9471 m4module.h since it's size changes depending on compile time
9474 * src/m4.h: Lots of stuff moved to lib/m4module.h.
9476 * lib/m4module.h: New file to define the interface available when
9477 compiling m4 modules.
9478 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9479 necessary for module compilation into this new file.
9481 * lib/Makefile.am (include_HEADERS): install headers (renamed to
9482 avoid nameclash with other system headers) necessary for compiling
9484 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9485 so that modules can include the (renamed) installed headers and
9486 be guaranteed a matching implementation.
9487 * lib/m4error.h: renamed from error.h.
9488 * lib/m4obstack.h: renamed from obstack.h.
9489 * lib/m4regex.h: renamed from regex.h.
9490 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
9491 implementation, simply include the shipped version
9492 unconditionally, otherwise it is hard for a module to know
9493 whether the m4obstack.h header it is using matches the
9494 implementation it ends up linking against.
9495 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
9498 1999-05-18 Gary V. Vaughan <gary@gnu.org>
9500 * examples/misc.test: Don't run this test on machines which don't
9501 have a root user in /etc/passwd (e.g. cygwin).
9503 * tests/get-them (/^@example$/): Error messages might have a
9504 ``.exe'' suffix to the program name, or else use the libtool
9505 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
9506 of these cases are now catered for when comparing error messages
9508 * tests/other-tests/*.test: ditto.
9509 * examples/*.test: ditto.
9511 * tests/defs (M4): use libtool execute mode.
9512 * examples/defs (M4): ditto.
9514 * tests/get-them (END): explicitly close any open file.
9515 (printthem): In a regular expression, '{' is the start of a repeat
9516 count! Use `[{]' for a literal open brace.
9517 (/^@node /): Don't use substr on a string shorter than the trim
9520 1999-05-17 Gary V. Vaughan <gary@gnu.org>
9522 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9524 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9526 2000-01-10 Andreas Schwab <schwab@suse.de>
9528 * tests/other-tests/gmp.test: Find config.sh in build directory.
9530 * configure.in: Find tests/mkconfig.sh in $srcdir.
9532 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9533 <signal.h> (for SUS2 compliant systems).
9535 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
9538 2000-01-10 René Seindal <rene@seindal.dk>
9542 * TODO, NEWS: Cleaned up and updated.
9544 * src/m4.c (main): New variable exit_status for exit status in
9545 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
9546 file cannot be read instead of EXIT_SUCCESS.
9548 * src/builtin.c (m4_indir): Changed error message to help
9549 translators (from Akim Demaille <demaille@inf.enst.fr>).
9551 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
9554 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
9557 * src/input.c (match_input): Reordering of code, to avoid multiple
9558 calls to push_string_init() from obstack_grow(), which can happen
9559 with some compilers (found and fixed by James Bonfield
9560 <jkb@mrc-lmb.cam.ac.uk>).
9562 * src/stackovf.c: Added prototypes for ultrix.
9563 (setup_stackovf_trap): Added __P to cast.
9564 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
9566 2000-01-09 René Seindal <rene@seindal.dk>
9568 * doc/m4.texinfo (Changequote): Added comment about changing
9569 quotes when the old quote is a part of the new.
9571 * src/builtin.c (expand_ranges): Added break after trailing dash.
9572 This caused misbehavious on some systems (found and fixed by Akim
9573 Demaille <demaille@inf.enst.fr>).
9575 * AUTHORS: Thomas Tanner included
9577 * acconfig.h: Added entry for ss_sp (see below).
9579 * configure.in (use_stackovf): Added check for stack_t with member
9580 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
9581 <eggert@twinsun.com>).
9583 * doc/m4.texinfo (Frozen files): Added a simpler example for
9584 generating frozen files from several input files.
9586 1999-11-14 Paul Eggert <eggert@twinsun.com>
9588 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
9589 lib/regex.c, lib/xmalloc.c.
9591 1999-11-10 René Seindal <rene@seindal.dk>
9593 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
9595 * src/module.c: reindented.
9596 (module_load): return if this is a repeated load of same module.
9597 (module_init): slight change of logic to avoid repeated
9598 initialisation debug messages.
9600 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
9601 in the distribution.
9603 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
9604 automake warnings about missing lib prefix.
9605 (time_la_LDFLAGS): ditto
9606 (stdlib_la_LDFLAGS): ditto
9608 1999-11-10 Paul Eggert <eggert@twinsun.com>
9610 * src/m4.h: Include error.h, since our macros use error.
9611 * src/m4.c: Don't need to include error.h.
9613 1999-11-09 Paul Eggert <eggert@twinsun.com>
9615 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
9616 and zero, as Solaris 7 cc does.
9617 (bcopy): Remove macro; no longer needed with new obstack.h.
9619 * src/output.c (freeze_diversions): Don't assume that a
9620 diversion size can fit in `int'. Check for diversion file
9621 size too large to be printed with `unsigned long'.
9623 * src/Makefile.am (CFLAGS): Omit -Wall.
9625 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
9627 * src/debug.c (trace_format):
9628 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
9630 * src/freeze.c (produce_frozen_state):
9631 Don't assume string lengths fit in int.
9633 1999-10-13 René Seindal <rene@seindal.dk>
9635 * po/cs.po: Czech translation added.
9637 * po/sv.po: Updated Swedish translation.
9639 * po/ru.po: Updated Russian translation.
9641 * po/pl.po: Updated Polish translation.
9643 * po/el.po: Greek translation added.
9645 1999-10-13 René Seindal <rene@seindal.dk>
9647 * configure.in (ALL_LINGUAS): Added Greek translation (el).
9648 (ALL_LINGUAS): Added Czech translation (cs).
9650 1999-03-30 Gary V. Vaughan <gary@gnu.org>
9652 * src/builtin.c: moved module loading functions into...
9653 * src/module.c: entirely new implementation using libltdl.
9654 * po/POTFILES.in: added src/module.c.
9655 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
9656 are modules, not linktime libraries.
9657 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
9658 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
9659 avoidance on exported symbols.
9660 * modules/test.c (m4_macro_table, m4_init_module,
9661 m4_finish_module): ditto.
9662 * modules/time.c (m4_macro_table): ditto.
9664 * modules/time2.m4: new file which requires command line loading
9666 * src/m4.c (--load-module): dynamically load named runtime module
9667 into running executable before reading the source.
9668 (--module-directory): prepend a directory to the module search
9670 (module_init()): Do this the first time we load a module instead;
9671 if the module subsystem is broken normal m4 scripts can still run.
9672 * src/m4.h (install_builtin_table): is now exported.
9674 1999-03-26 Gary V. Vaughan <gary@gnu.org>
9676 * src/module.c: removed. No longer required.
9677 * po/POTFILES.in: removed src/module.c.
9679 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
9680 the bootstrap script can recreate.
9681 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
9682 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
9683 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
9684 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
9685 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
9686 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
9687 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
9688 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
9690 * acinclude.m4: removed. `aclocal -I acm4' handles this much
9692 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
9693 * acm4/gettext.m4: removed. It causes a multiple definition vs.
9694 the installed gettext.m4 file when running aclocal.
9696 1999-03-25 Gary V. Vaughan <gary@gnu.org>
9698 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
9699 distinguish this from the last prerelease.
9700 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
9701 in its own subdirectory.
9703 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
9704 lib prefix on a module" feature.
9705 (LDFLAGS): Added `-module -avoid-version' flags to build
9706 versionless module libraries.
9707 * src/builtin.c (m4_load_module): use libltdl.
9708 (module_unload_all): use libltdl.
9709 * src/m4.c (module_init): initialise module loading on demand for
9710 better diagnostics, and so that m4 will still work even if
9711 the module code is broken.
9712 * src/m4.h (module_init): removed. No longer relevant.
9713 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
9714 exported symbols for compatibility with dlpreopening.
9715 * modules/test.c (m4_macro_table, m4_init_module,
9716 m4_finish_module): ditto.
9717 * modules/time.c (m4_macro_table): ditto.
9719 * bootstrap: New file. Runs all the autoutils in the right order
9720 after a fresh checkout, or a make maintainer-clean.
9722 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
9724 * src/builtin.c (dump_symbols): New function, factoring common
9725 content of m4_dumpdef and m4_symbols.
9726 (m4_dumpdef): Use it.
9727 (m4_symbols): New function, implementing `symbols'. Use it.
9728 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
9729 file compile with modern makeinfo.
9730 (Symbols): New node, documenting symbols.
9731 (direntry): Modernize.
9733 1998-12-11 René Seindal <rene@seindal.dk>
9735 * src/builtin.c (predefined_tab): New predefined macros
9736 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
9737 configure time options.
9739 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
9741 * src/module.c (module_try_load): Don't try to be clever and
9742 overwrite argument string. Instead allocate all constructed
9743 strings locally, since they can have arbitrary lengths. Make
9744 arguments pointers to const.
9745 (module_search): Simplify due to above change.
9747 1998-11-29 René Seindal <rene@seindal.dk>
9751 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
9753 * tests/other-tests/import-environment.{m4,test}: New test.
9755 * tests/other-tests/discard-comments.{m4,test}: New test.
9757 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
9759 * src/m4.c (main): New option -c --discard-comments.
9760 New global variable discard_comments.
9762 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
9763 discarded, ie never returned from next_token().
9764 Added declaration of discard_comments.
9766 * src/input.c (next_token): Now loops until token type is not
9767 TOKEN_NONE. Comments are now given this type when comments should
9770 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
9773 1998-11-28 René Seindal <rene@seindal.dk>
9775 * src/m4.c (main): New option --import-environment (no single
9778 * When configured with --with-gmp both the normal (fast) eval()
9779 and the gmp aware mpeval() are defined. To restore previous
9780 bahaviour use "define(`eval', defn(`mpeval'))".
9782 * tests/other-tests/gmp.m4: Changed to use mpeval().
9784 * src/evalmp.c: New file for compiling eval.c as gmp aware.
9785 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
9787 * src/eval.c: Now includes "numb.c" directly. Everything in this
9788 file must by static, except evaluate(), which is changed to
9789 mp_evaluate() if USE_GMP in force.
9791 * src/numb.c: Changed to be included by eval.c instead of being
9792 compiled separately. Everything is declared static.
9794 * src/numb.h: Removed declarations of functions, as numb.c is now
9797 * src/builtin.c: Declaration of m4_mpeval() added.
9798 Inserted `mpeval' in builtin table.
9799 (do_eval): New function with common code for m4_eval and m4_mpeval.
9800 (m4_mpeval): New function for gmp version of eval.
9802 * src/m4.h: Declaration of mp_evaluate().
9804 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
9805 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
9807 * src/m4.c (main): m4 --version also shows which options were used
9808 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
9810 1998-11-27 René Seindal <rene@seindal.dk>
9812 * Error messages now always print program name before input file
9813 name as specified by GNU coding standards. Reported by Akim
9814 Demaille <demaille@inf.enst.fr>.
9816 * doc/m4.texinfo (Include): Change due to changed error message
9820 * tests/get-them: Minor change to sed script due to changed error
9823 * src/m4.c (print_program_name): New func used to print program
9824 name, input file and line number in error (). Used as an
9825 error_print_progname handler.
9826 (reference_error): Removed.
9827 (main): Assigns error_print_progname.
9829 * src/m4.h (M4ERROR): Removed reference_error ().
9831 1998-11-25 René Seindal <rene@seindal.dk>
9833 * Updated to libtool 1.2b.
9835 * src/builtin.c (install_builtin_table): Added braces to avoid
9836 warning of ambiguous 'else'.
9838 * src/module.c: Inserted search path code from path.c modified to
9840 (module_init): Configured default path used only if M4MODPATH is
9842 (module_try_load): Now reads libMODULE.la as generated by libtool
9843 for actual module name.
9844 (module_load): Gives better error messages on failure.
9846 * src/m4.h: Added declarations of structures and functions for
9847 generic search path handling.
9849 * src/path.c: Removed all module specific code and introduced new
9850 functions of more generic search path handling.
9852 1998-11-24 René Seindal <rene@seindal.dk>
9854 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
9855 included gettext, as <libintl.h> might not be found
9856 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
9858 1998-11-22 René Seindal <rene@seindal.dk>
9860 * src/output.c (insert_diversion): Fixed bug that might cause m4
9861 to read from standard output! Triggered by input
9862 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
9863 so now 'undivert(0)' does nothing.
9865 1998-11-18 René Seindal <rene@seindal.dk>
9869 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
9870 could be changed when compiling a illegal regexp, causing later
9871 use of the regexp to dump core.
9873 * src/module.c (module_load): Changed error message to conform to
9876 * src/m4.c (usage): Added message about reporting bugs.
9878 * doc/m4.texinfo (Changeword): Corrected a wrong example.
9879 (Changeword): Added note about the type of regexps used.
9881 * ltconfig, ltmain.sh: New files from Libtool 1.2.
9883 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
9884 and AM_PROG_LIBTOOL.
9886 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
9889 * modules/Makefile.am: Changed completely to compile modules using
9890 libtool. The modules are compiled as shared libraries, and are
9891 renamed when installed.
9893 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
9894 USE_SHL_LOAD to HAVE_SHL_LOAD
9896 * src/builtin.c (shipout_string): Now tests for a NULL string.
9898 * src/module.c: New level of indirection around non-portable
9899 functions to load shared objects. Intended to encapsulate the non
9900 portable parts better and to reduce the number of #ifdefs in the
9903 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
9904 directory modules/ to the distribution.
9906 1998-11-15 René Seindal <rene@seindal.dk>
9910 * modules/stdlib.c: New module `stdlib' defining some standard
9911 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
9912 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
9914 * src/builtin.c (shipout_string): New convenience function for
9915 builtins and modules.
9917 * src/module.c (module_load): Tentative support for
9918 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
9920 * Makefile.am (SUBDIRS): Directory modules added if configured.
9922 * modules/Makefile.am: Now correctly compiles and installs
9923 modules in pkglibexecdir.
9925 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
9926 These two are now initialised by autoconf macros.
9928 * src/path.c (module_env_init): MODULE_PATH is always on the
9931 * src/Makefile.am: Now generated pathconf.h which defined the
9932 default MODULE_PATH.
9934 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
9935 where modules are installed.
9937 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
9938 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
9939 build and install automatically, and it is prepared for other
9940 interfacec than dlopen().
9942 * src/builtin.c (predefined_tab): Added __m4_version__ for the
9943 current version of GNU m4. It is a GNU extension.
9945 1998-11-14 René Seindal <rene@seindal.dk>
9947 * tests/Makefile.am (GENERATED_TESTS): Added new
9948 generated-tests/changesy.8.test
9950 * doc/m4.texinfo (Changesyntax): Documentation for escape
9953 * src/macro.c (expand_token): Check for escaped macro call before
9954 symbol table lookup.
9956 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
9959 * src/input.c: New static variable use_macro_escape, which is TRUE
9960 iff some character has code SYNTAX_ESCAPE
9961 (input_init): Added initialisation of use_macro_escape.
9962 (check_use_macro_escape): New function to synchronise
9963 use_macro_escape with the syntax table.
9964 (set_quotes): Added call to check_use_macro_escape()
9967 (next_token): Added new case for IS_ESCAPE.
9969 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
9971 1998-10-13 René Seindal <rene@seindal.dk>
9975 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
9978 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
9979 maintained tests in tests/other-tests. These currently tests for
9980 8-bit transparency, multiple precision arithmetic and sync-line
9981 output. Test for stackoverflow detection does not work.
9983 * examples/Makefile.am (TESTS): Added tests for all example files.
9985 * examples/mktests.sh: New file. Help program for creating test
9988 * tests/mkconfig.sh: New file to generate tests/config.m4 and
9989 tests/config.sh. This is for tests of configure selectable
9990 features. Picks up all set WITH_ and ENABLE_ veriables from
9993 * src/path.c (path_search): Added argument 'char **expanded_name'
9994 to return the expanded name.
9996 * src/m4.h: Added 2nd argument to declaration of path_search().
9998 * src/m4.c (main): Added 2nd argument to path_search().
10000 * src/freeze.c (reload_frozen_state): Do.
10002 * src/builtin.c (m4_undivert): Do.
10005 1998-10-11 René Seindal <rene@seindal.dk>
10007 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
10009 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
10011 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
10013 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
10015 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
10017 * intl/: Updated to GNU gettext 0.10.35.
10019 * doc/m4.texinfo (Format): Documented that format is blind.
10021 * src/builtin.c (builtin_tab): Builtin format marked as blind.
10023 1998-10-07 René Seindal <rene@seindal.dk>
10027 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
10028 .test, as the files are no longer just m4 input.
10030 * tests/get-them (FILE): Changed .m4 extension to .test.
10032 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
10033 Otherwise quoted strings with leading whitespace first in a macro
10034 argument would be eliminated.
10036 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
10037 (expand_argument): Do.
10039 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
10040 grouped together iff both quote and comment strings are single
10041 character. Otherwise they might include a comment/quote leader.
10042 (next_token): Returns new token type TOKEN_SPACE.
10044 * src/builtin.c (push_builtin_table): New function to push a
10045 builtin_table on the stack without installing its contents.
10046 (find_builtin_by_name): Added call to push_builtin_table() if
10047 reading frozen files. Otherwise the builtins named in the frozen
10048 files could not be found.
10049 (install_builtin_table): Changed to use push_builtin_table()
10051 1998-10-04 René Seindal <rene@seindal.dk>
10053 * po/pl.po: Polish translation added.
10055 * po/POTFILES.in: src/module.c added.
10057 1998-10-04 René Seindal <rene@seindal.dk>
10061 * configure.in (ALL_LINGUAS): Added Polish pl.po
10063 1998-10-03 René Seindal <rene@seindal.dk>
10065 * Many files: Incorporated changes to implement dynamic modules.
10066 Detailed comments in src/modules.c and modules/README
10068 * src/module.c: New file, implements the OS dependant parts of
10069 dynamic module loading.
10071 * src/Makefile.am (m4_SOURCES): Added module.c
10073 * src/builtin.h: New file, declares some functions from builtin.c
10074 that are of use for other modules (shipout_int, numeric_arg,
10075 skip_space, bad_argc), and the macros ARG() and DECLARE().
10077 * src/builtin.c (install_builtin_table): New function. Each
10078 module brings in a builtin_table, which is pushed on a stack.
10079 (struct builtin_table): New struct for list of builtin_tables.
10080 (m4_loadmodule): New function to implement builtin "loadmodule".
10081 (shipout_int): No longer static, to be used by modules.
10085 (builtin_init): changed to call install_builtin_table()
10086 (find_builtin_by_name): Now searches all builtin_tables
10087 (find_builtin_by_addr): do.
10089 * src/path.c: Reorganised to allow for two search paths, one for
10090 include files and one for modules.
10092 * src/m4.h: Added declarations for new functions in module.c and
10095 * src/m4.c (main): Added call to module_init().
10097 * modules: New directory with a few demo modules.
10099 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
10102 * configure.in: Added modules/Makefile to AC_OUTPUT.
10104 * configure.in: Added code to implement --with-modules. Tests for
10105 <dlfcn.h> and -ldl.
10107 * acconfig.h: Added WITH_MODULES
10109 1998-10-02 René Seindal <rene@seindal.dk>
10111 * examples/Makefile.am (pkgdata_DATA): Removed special target for
10112 check and variables TESTS. These tests are now run from the
10115 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
10116 directory. The files stay there but the tests are run from the
10119 * tests/Makefile.am (EXTRA_DIST): Added run-test.
10121 * tests/run-test: New file. Run a test manually
10123 * tests/Makefile.am, tests/get_them: Moved automatically generated
10124 tests (from the manual) to sub directory tests/gentest/. The
10125 tests/ directory had gotten a bit messy.
10127 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10129 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
10130 wrap}.test: Added a few testcases.
10132 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10136 * lib/Makefile.am (noinst_HEADERS): regex.h added
10138 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
10139 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
10141 * acm4/Makefile.am: created providing rules to create
10142 $(top_srcdir)/acinclude.m4 to be used by aclocal.
10144 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
10145 `C'. Reported by Ulrich Drepper.
10147 * Makefile.am (SUBDIRS): Removed checks directory
10148 * configure.in (AC_OUTPUT): Removed checks/Makefile
10150 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
10151 the space when m4.texinfo is edited and whitespace.el is active.
10152 (Defn,example): idem.
10154 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10156 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
10157 ../COPYING. ../Makefile is a file which is certainly present when
10158 test is executed in testSubDir. One can't be sure that the COPYING
10159 file is in .. or ../.. in all situations, the ../Makefile is
10162 * doc/m4.texinfo (Include): adjusted expected test output
10163 according to new tests, i.e. the input will always come from the
10164 file `in' created by the test.
10166 * tests/Makefile.am: Added three lines at the top to get
10167 esyscmd.1.test working.
10169 * tests/get-them: modified to generate clearer tests who will need
10170 less maintenance when new test examples are created in
10171 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
10172 need the generic file `defs') shell scripts creating `in', `ok',
10173 `out' and when apropriate `okerr' and `err' in the directory
10174 `testSubDir' when executed. The compare of `ok' and `out'
10175 (and of `okerr' and `err') will be the exit status of the test.
10176 `out' must match `ok' (and `okerr' must match `err') for the test
10179 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
10180 the tests generated by tests/get-them getting it input normally
10181 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
10182 (dot) before the numeric part) is reserved for all other (hand
10183 written) tests. The `+' means one or more times.
10185 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10187 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
10188 supported short man page to refer to info documentation
10189 * helptoman.pl: added
10190 * configure.in: AC_PATH_PROG(PERL,perl)
10191 * Makefile.am (SUBDIRS): doc after src
10193 * libitized with libit 0.5 from
10194 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
10196 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
10197 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
10198 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
10199 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
10200 lib/rx.{c,h}: added
10201 * configure.in (AC_CHECK_FUNC): getopt_long
10203 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
10205 * TODO: added entry about dependencies
10207 1998-08-10 René Seindal <rene@seindal.dk>
10211 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
10214 * src/builtin.c (m4_changesyntax): Added builtin macro
10215 "changesyntax" to modify the syntax table.
10217 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
10218 table. All categories are assigned a syntax code and tokens are
10219 read according to this table.
10221 1998-08-09 René Seindal <rene@seindal.dk>
10223 * src/numb.{c,h}: New files, implements multiple precision eval
10224 using GNU gmp. Originally submitted by John Gerard Makecki
10225 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
10227 * doc/m4.texinfo (Eval): Added documentation for multiple
10228 precision arithmetic library support.
10230 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
10231 to accommodate multiple precision eval.
10233 1998-08-07 René Seindal <rene@seindal.dk>
10235 * src/input.c (MATCH, match_input), src/m4.h: changed definition
10236 of comment and quote strings to `unsigned int' to allow eight bit
10237 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
10239 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
10240 patch from Mike Howard <mike@clove.com>
10242 1998-08-06 René Seindal <rene@seindal.dk>
10244 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
10247 1998-08-03 René Seindal <rene@seindal.dk>
10251 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
10252 and _ macro. M4 now builds with --disable-nls.
10254 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
10255 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
10257 * configure.in (ALL_LINGUAS): Added complete list of translations:
10258 de fr it ja nl ru sv.
10260 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10262 * po/nl.po: Dutch translation by Erick Branderhorst.
10264 * po/fr.po: French translation by Erick Branderhorst, based on the
10265 translations by François Pinard in fr.msg and m4.cod.
10267 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10271 * src/m4.c: #include <signal.h> not <sys/signal.h>.
10273 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10275 * checks/Makefile.am: explicit list tests in CHECKS.
10277 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10278 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10279 mkinstalldirs, install-sh: Added automake (1.3) support.
10281 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10282 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10283 Used libitize (0.4) to update.
10285 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10286 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10287 README accordingly.
10289 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10290 stack overflow functionality.
10292 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
10294 * Prerelease 1.4.1.
10296 * Makefile.in (realclean-local): Delete stamp-h.in.
10298 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10299 Localize, adapting from how it is done in sharutils.
10301 * fr.tt: New file, for French.
10303 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10304 src/freeze.c: Rename PRODUCT to PACKAGE.
10306 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
10308 * configure.in: Check for <libintl.h> and <locale.h>.
10309 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10310 src/stackovf.c: Rename _ to __P.
10311 * src/m4.h: Declare _ as a macro returning its argument, or else,
10312 include <libintl.h> and declare _ as gettext.
10313 * src/m4.c: Possibly include <locale.h> and call setlocale.
10314 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10315 src/input.c, src/macro.c, src/output.c, src/path.c,
10316 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10319 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
10321 * doc/Makefile.in (stamp-vti): Use new -r option to date.
10323 * configure.in: Put --with-gmp in place, in prevision for John
10325 * acconfig.h: Document WITH_GMP.
10327 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
10331 * doc/Makefile.in (realclean): Also remove stamp-vti.
10332 Reported by Eric Backus.
10334 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
10336 * src/freeze.c (produce_frozen_state): If the frozen file cannot
10337 be opened, return immediately after producing the error message.
10338 Reported by Andreas Schwab.
10340 * configure.in: Check for const only after having found possible
10341 ANSIfying compiler flags, this is of no use to check it before.
10342 Reported by Alexander Lehmann.
10344 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
10346 * src/macro.c (collect_arguments): Cast obstack arguments to
10347 (voidstar), so avoiding compiler warnings.
10348 Reported by Joseph E. Sacco.
10350 * src/freeze.c (produce_frozen_state): Cast printed lengths to
10351 (int) so they correspond to %d format items.
10352 Reported by Joseph E. Sacco.
10354 * src/m4.c (main): Cast the argument to xfree to (voidstar).
10355 * src/symtab.c (free_symbol): Idem.
10356 Reported by Karl Vogel.
10358 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
10360 * Makefile.in (DISTFILES): Distribute BACKLOG.
10362 * configure.in: Define PRODUCT and VERSION.
10363 * acconfig.h: Document PRODUCT and VERSION.
10364 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10365 constant string m4 and variable or parameter named version.
10367 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
10369 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10370 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10371 defines __STDC__ to 0, for indicating it is *not* ANSI!
10372 Reported by Kaveh R. Ghazi.
10374 * configure.in: Added obsolescent tests for AIX and Minix.
10376 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10377 which texclean does not exist anymore.
10378 Reported by Eric Backus, Jim Meyering, John David Anglin and
10381 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
10383 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10384 Reported by John David Anglin.
10386 * src/ansi2knr.c: New version, sent by Peter Deutsch.
10387 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10388 ANSI2KNR, depending on the fact the compiler is ANSI or not.
10389 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10390 Remove the sed filter after ansi2knr for debug.c. Use $O instead
10391 of $U, put underline in extensions rather than in basenames. Use
10392 implicit rules, now that regularity makes this possible.
10393 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10394 of ansi2knr whenever it is needed.
10395 * configure.in: Adjusted for correct STACKOVF substitution.
10396 * src/debug.c (trace_format): When not __STDC__, use (...) as a
10397 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10398 Reported by David MacKenzie.
10400 * Makefile.in: Remove binprefix. Use transform_name instead.
10401 Reported by David MacKenzie.
10403 * doc/Makefile.in: Create version.texi, use it, clean it.
10404 Reported by Jim Meyering.
10406 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
10408 * Makefile.in (all, install, uninstall): Depend on Makefile.
10410 * Makefile.in: For actions invoking $(MAKE) from within compound
10411 sh statements, exit non-zero if the sub-make fails. Otherwise,
10412 the top-level make may exit successfully when it should fail.
10413 Reported by Jim Kingdon.
10415 * {,/*}Makefile.in: Use && after all cd, in case they fail.
10417 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10418 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10419 * configure.in: Substitute PRODUCT and VERSION.
10421 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10423 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
10425 * Makefile.in (mostlyclean-local): Do not remove *~.
10426 * */Makefile.in (mostlyclean): Idem.
10427 Reported by Robert E. Brown and Richard Stallman.
10429 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
10431 * src/m4.h: Get rid of CONFIG_BROKETS.
10433 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
10435 * configure.in: Use AC_ARG_PROGRAM.
10436 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10437 Reported by David MacKenzie.
10439 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
10441 * configure.in: Do not add -O to CFLAGS for GNU C, now that
10442 configure does it automatically.
10443 Reported by Jim Meyering.
10445 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
10447 * src/stackovf.c: Declare the handler_t typedef earlier in the
10448 code, use it for stackovf_handler.
10449 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10450 casting sigsegv_handler.
10451 Reported by Robert Bernstein.
10453 * src/m4.c (main): Initialize program_name to argv[0] without
10455 Reported by Karl Berry.
10457 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
10459 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10460 Reported by Karl Berry.
10462 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
10464 * lib/Makefile.in (mostlyclean): Added.
10465 (TAGS): Make in $(srcdir).
10467 * configure.in: Use `choke me' in test, like everywhere!
10469 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10470 unreacheable and useless.
10472 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10474 * lib/Makefile.in (DISTFILES): Distribute TAGS.
10475 (distclean): Do not remove TAGS.
10476 (realclean): Remove it.
10477 * Makefile.in: Make TAGS in lib also, not just in src.
10478 Reported by Karl Berry.
10480 * Makefile.in (distclean, realclean): Instead of recursively
10481 calling $(MAKE) for the -local part, allow parallel execution of
10482 -recursive and -local, only delay the removal of config.status,
10483 which is repeated in both goals.
10485 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
10489 * Makefile.in: Group all *clean-recursive goals in one, using sed
10490 to remove `-recursive' while calling make recursively. Also, use
10491 a subshell for each recursive $(MAKE).
10492 Reported by Jim Meyering.
10494 * src/m4.h (memcpy): Define with bcopy for BSD systems.
10495 Reported by Kaveh R. Ghazi.
10497 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10498 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10501 * configure.in: Use date instead of touch for stamp-h.
10502 * Makefile.in (stamp-h.in): Idem.
10504 * Makefile.in (distclean, realclean): Force serial execution of
10505 both goals, in case parallel makes are being used.
10506 Reported by Jim Meyering.
10508 * src/Makefile.in (DISTFILES): Distribute TAGS.
10509 (distclean): Do not remove TAGS.
10510 (realclean): Remove it.
10511 Reported by Karl Berry.
10513 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
10515 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
10516 to old names, for following Autoconf.
10518 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
10520 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10521 ./install.sh will not be correctly referred to in sub-Makefiles.
10522 Reported by John David Anglin.
10524 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10525 Reported by Eric Backus.
10527 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10528 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10529 config.status into remaking this directory's Makefile only.
10530 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10531 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10532 Reported by Jim Meyering.
10534 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
10536 * configure.in: Correct stack overflow detection logic, taking
10537 care of systems having only incomplete implementations (like for
10538 Pyramid 9820 OSx 5.0d).
10539 Reported by Kaveh R. Ghazi.
10541 * src/Makefile.in (TAGS): Remote -t from etags call.
10543 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
10545 * lib/Makefile.in (install): Depend on all.
10547 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
10549 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
10550 Reported by Jim Meyering and John David Anglin.
10552 * Makefile.in (distclean-local): Delete config.log.
10553 Reported by Jim Meyering.
10555 Solidify frozen files with respect to -P:
10556 * src/m4.c: Have -P set prefix_all_buitins variable instead of
10557 calling a function by that name. Declare the variable.
10558 * src/m4.h: Adjust declaration for prefix_all_buitins.
10559 * src/builtin.c (builtin_init): Merge in functionality from
10560 previous prefix_all_buitins function, while making entries in the
10561 symbol table, but not modifying the builtin description itself.
10563 * src/freeze.c (reload_frozen_state): Add a useless `break;',
10564 because *many* compilers do not accept an empty `default:'.
10565 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
10566 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
10568 * configure.in: Use AC_TYPE_SIGNAL.
10569 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
10570 Reported by Robert Bernstein.
10572 * checks/Makefile.in (check): Modify PATH so check-them will find
10573 m4 in the src directory.
10574 * Makefile.in (check): Don't.
10575 Reported by Akiko Matsushita and Jim Meyering.
10577 * src/output.c (make_room_for, output_character_helper): New
10578 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
10579 a per buffer MAXIMUM_BUFFER_SIZE.
10581 * src/output.c (output_text): New function, for optimizing the
10582 output of strings of characters. Use it.
10584 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
10586 * doc, src: New directories reorganizing the distribution.
10587 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
10589 * Makefile.in: Adjusted.
10590 * configure.in: Configure new Makefiles.
10592 * m4.h: Declare STRING typedef. Use it for comment and quote
10593 strings, adjusting all references. (This is the rudiments of a
10594 beginning for the eventual withdrawal of NUL terminated strings.)
10595 * output.c (shipout_text): Accept a length parameter, and use it.
10596 All callers adjusted.
10598 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
10600 * m4.h: Include <unistd.h> if it exists.
10601 * stackovf.c: Don't.
10603 Clean up for current_diversion variable:
10604 * output.c: Move current_diversion from builtin.c.
10605 * m4.h: Declare current_diversion so builtin.c can access it.
10606 * output.c (output_init, make_diversion): Initialize or update
10608 * builtin.c (builtin_init, m4_divert): Leave current_diversion
10611 Remove limit on number of diversions:
10612 * output.c: Replace ndiversion by diversions, declare it.
10613 (output_init): Allocate only diversion 0.
10614 (make_diversion): Allocate new diversions as needed.
10615 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
10616 * m4.c: Still accept -N, but do nothing with it.
10617 Reported by David MacKenzie.
10620 * output.c (freeze_diversions): New function.
10621 * m4.h: Declare freeze_diversions.
10622 * freeze.c: Document frozen file format, revise it, call
10623 freeze_diversions to add diversions to frozen format, and code to
10624 reload them properly.
10625 * m4.c: Do not undivert automatically at end when status being
10626 frozen. Do not call builtin_init when reloading frozen state.
10628 Speed up diversion processing:
10629 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
10630 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
10631 structure and variables, cached variables out of output_diversion,
10632 reallocate_diversion_for and OUTPUT_CHARACTER.
10633 (shipout_text, make_diversion, insert_diversion): Adapted to new
10635 (insert_file): Use better buffering.
10636 Reported by David MacKenzie.
10638 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
10640 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
10641 dist works from another build directory.
10643 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
10645 * symtab.c (hack_all_symbols): Use hash_table_size instead of
10646 constant HASHMAX, for -H option to work better.
10648 * builtin.c (DECLARE): Simplify by using _ ().
10650 * freeze.c: New file.
10651 * Makefile.in: Compile it, distribute it.
10652 * m4.c: Recognize, document and process --freeze-state (-F) and
10653 --reload-state (-R) options. Pass a true flag to builtin_init
10654 only if no reloading some state.
10655 * builtin.c (define_builtin): Remove static specifier.
10656 (find_builtin_by_name): Remove static specifier.
10657 (builtin_init): Accept and obey a flag argument.
10658 * m4.h: Add declarations for freeze.c, changes for builtin.c.
10660 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
10662 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
10665 * configure.in: Implement --with-dmalloc.
10666 * acconfig.h: Document WITH_DMALLOC.
10667 * m4.h: Add code for when WITH_DMALLOC.
10669 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
10671 * m4.c (long_options): Use "error-output", the dash was missing.
10672 Reported by Akiko Matsushita.
10674 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
10676 * m4.h: Include <sys/types.h>.
10677 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
10678 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
10680 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
10681 as size_t, not int.
10682 * builtin.c (dump_args): Declare len as size_t, not int.
10684 * debug.c: Prototype the forward declaration of debug_set_file.
10686 * builtin.c (m4_undivert): Replace div by file, for avoiding the
10687 shadowing of this variable.
10688 * output.c (insert_diversion): Idem.
10690 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
10691 (input_init): Duplicate default quote and comment strings.
10692 (set_quotes): Free previous quote strings in all cases. Duplicate
10693 even default quote strings.
10694 (set_comment): Free previous comment strings in all cases.
10695 Duplicate even default comment strings.
10697 * configure.in: Updated for Autoconf 2.0.
10698 * Makefile.in (distclean-local): Also delete config.cache.
10700 * m4.c (usage): Reorganize the --help output by topic. Include a
10701 description for debugging flags.
10703 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
10705 * configure.in: If sigaction is available and SA_ONSTACK defined,
10706 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
10707 defined, use sigvec. Else don't compile stackovf.c.
10708 * stackovf.c (setup_stackovf_trap): Idem.
10709 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
10712 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
10714 * m4.c (usage): Replace printf par fputs.
10716 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
10720 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
10722 * configure.in: Check for sigaction and sigvec. Add a new delayed
10723 check for RLIMIT_STACK, combine in the checking for getrlimit.
10724 All those things are not universally available.
10725 * stackovf.c: Split setting up the trap handler and catching
10726 signals, for better taking care of various configure outcomes.
10727 * examples/stackovf.sh: Correct a typo.
10728 Reported by Eric Backus, Jim Avera and Jim Meyering.
10730 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
10732 * ansi2knr.c: New version sent by its author, Peter Deutsch.
10734 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
10736 * Makefile.in: Modify so parallel make will not try making
10737 lib/libm4.a twice simultaneously.
10738 Reported by Jim Meyering.
10740 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
10742 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
10743 error message, for when no code possibility exists. Even if this
10744 line is completely #ifdef'ed out, it brings a syntax error.
10745 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
10747 * Makefile.in (install): Have install depend on all too, for lib
10748 to be remade as needed.
10750 * examples/stackovf.sh: Try ksh, bsh and bash for shells
10751 providing ulimit, instead of using only ksh.
10752 Reported by Jim Avera and Joseph E. Sacco.
10754 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
10756 * Makefile.in (check): Have it depend on all instead of m4. In
10757 this way, a change in lib will be detected and processed.
10759 * builtin.c (numeric_arg): Use strtol and verify the conversion,
10760 instead of using sscanf which stops as soon as there is a
10761 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
10762 and divert(1xyzzy) were all accepted without any warning or error
10764 * m4.h: Declare strtol as long if not including stdlib.h.
10765 * configure.in: Check for limits.h, and replace strtol if missing.
10766 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
10767 * lib/strtol.c: New file, from elsewhere.
10768 Reported by Andreas Schwab.
10770 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
10772 * macro.c (expand_macro): Cast value to (boolean) prior to
10773 assigning it to traced.
10774 Reported by Tom McConnell.
10776 * Makefile.in (m4): Always make all in lib first.
10777 Reported by Jim Meyering.
10779 1994-07-06 Jim Avera <jima@netcom.com>
10781 * stackovf.c: Isolated OS-dependent sections; Improved portability,
10782 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
10783 handlers), and a default error message if the fault address is not
10784 available (when neither siginfo.h nor BSD sigcontext are supported).
10785 * configure.in: Changes for stackovf.h: Check for sigcontext,
10786 sigaction, sigstack, and define rlim_t as int if necessary.
10787 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
10788 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
10789 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
10791 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
10793 * configure.in: Use AC_SET_MAKE.
10794 * Makefile.in: Use @SET_MAKE@.
10795 Reported by Jim Meyering.
10797 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
10798 Reported by Ian Taylor.
10800 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
10802 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
10803 because siginfo.h is unrelated to standard headers, and siginfo.h
10804 is already checked for.
10805 Reported by Joseph E. Sacco.
10807 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
10809 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
10812 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
10814 * builtin.c (substitute): Use \& to represent this part of the
10815 string which was matched by the whole regexp, instead of
10816 representing the whole string. Any usage of \0 issues a warning
10817 and acts like \&, it will disappear in some subsequent release.
10819 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
10821 * m4.c: Complete prototype for forwarded declaration of usage.
10823 * input.c (init_macro_token): Correct own reference in error
10824 message. Previous name get_macro_func was referred to instead.
10825 (next_char): Correct own reference in error message. Previous
10826 name advance_input was referred to instead.
10828 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10829 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10830 and_term, not_term, logical_not_term, cmp_term, shift_term,
10831 add_term, mult_term, exp_term, unary_term, simple_term): Add
10832 prototype to forwarded declarations. Declare parameter v1 as
10833 eval_t * instead of int *. Same for local variable v2 in dyadic
10834 functions. Same for result in exp_term.
10835 * builtin.c (m4_eval): Declare value as eval_t instead of int.
10836 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
10837 unsigned_eval_t instead of unsigned int. Change casts accordingly.
10838 (shipout_int): Cast first argument of ntoa to eval_t.
10839 Reported by Thorsten Ohl.
10841 * macro.c: Complete the prototypes of forwarded expand_macro and
10843 Reported by Thorsten Ohl.
10845 * m4.h: Define voidstar as void * or char * depending on __STDC__.
10846 The Ultrix 3.1 compiler cannot do much with void pointers.
10848 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10849 * m4.c (xfree): Replace void * by voidstar.
10850 Reported by Tom McConnell.
10852 * ansi2knr.1: New, from elsewhere.
10853 * Makefile.in (DISTFILES): Distribute ansi2knr.1
10855 * Makefile.in (stamp-h.in): Avoid running ./config.status if
10856 stamp-h does not exist yet. This avoids running it a second time
10857 just after the initial ./configure.
10858 Reported by David MacKenzie and Tom McConnell.
10860 * m4.h: Replace the enum debug_info declaration with a series of
10861 #define's. The Ultrix 3.1 compiler would otherwise need casting
10862 (int) to most references, when used in expressions.
10863 Reported by Tom McConnell.
10865 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
10867 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
10868 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
10869 calls the compiler. Previously, FP_PROTOTYPES was only calling
10870 the preprocessor; by not being subject to CFLAGS, this was
10871 discouraging those flags asking for ANSI compilation.
10872 * acconfig.h: Document HAVE_PROTOTYPES.
10873 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
10874 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
10875 Reported by Eric Backus.
10877 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
10878 from the environment. Default CFLAGS to -g if not set.
10879 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
10880 * lib/Makefile.in: Have CFLAGS substituted from configure.
10881 Reported by Eric Backus and Tom McConnell.
10883 * configure.in: m4_undefine changeword before using AC_ENABLE.
10885 * m4.h: Declare prototypes for error (for ANSI compilers only),
10886 prefix_all_builtins and reference_error.
10887 Reported by Tom McConnell.
10889 * input.c (set_word_regexp): Do not try to initialize the array
10890 test from a string, this does not work with non-ANSI compilers.
10891 Reported by Eric Backus.
10893 * Makefile.in (dist): Clean examples/ before saving it.
10894 (distclean-local): Also remove stamp-h.
10895 Reported by Eric Backus.
10897 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
10898 non ANSI compilers.
10899 Reported by Tom McConnell.
10901 * checks/Makefile.in (clean): Depends on mostlyclean.
10902 (mostlyclean): New goal.
10904 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
10906 * Makefile.in (DISTFILES): Distribute install.sh.
10907 * install.sh: New file, copied from elsewhere.
10908 Reported by Assar Westerlund and Kaveh R. Ghazi.
10910 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
10912 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
10913 * acconfig.h: Explain ENABLE_CHANGEWORD.
10915 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
10916 from code provided by Pete Chown]
10917 * m4.h: Add original_text field to u_t variant of union u.
10918 Declare TOKEN_DATA_FUNC macro.
10919 * builtin.c: Declare changeword.
10920 (m4_changeword): New function.
10921 * input.c: Include "regex.h", define variables with word regexps.
10922 (input_init): Initialize the word regexp.
10923 (set_word_regexp): New.
10924 (next_token): Declare local variables, use the previous code if
10925 default_word_regexp is true. Else, match using a new code. Save
10927 * macro.c (expand_token): Ship out original text if not a macro
10929 Reported by Krste Asanovic and Pete Chown.
10931 [These modifs all depend upon ENABLE_CHANGEWORD]
10932 * m4.h: Declare external user_word_regexp.
10933 * m4.c: Declare user_word_regexp, and initialize it from
10934 --word-regexp or -W, or NULL if not specified.
10935 * input.c: Use user_word_regexp if specified, instead of
10936 DEFAULT_WORD_REGEXP.
10938 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
10941 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
10942 * checks/Makefile.in: Empty the suffix list.
10943 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
10945 * m4.c: Declare nesting_limit and initialize it to 250.
10946 Implement -LNUMBER or --nesting-limit=NUMBER to change its
10948 * m4.h: Declare nesting_limit as external.
10949 * macro.c (expand_macro): Stop execution whenever nesting limit
10951 Reported by Bengt Mertensson.
10953 * eval.c (evaluate): Diagnose excess characters in eval input.
10954 Things like `eval(08)' used to return 0 with no diagnostic.
10956 * m4.h: Capitalize first letter of all macro arguments in
10959 * m4.c: Declare warning_status, initialize it to 0. Add new
10960 option -E, or --fatal-warnings, which sets warning_status to
10961 EXIT_FAILURE instead.
10962 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
10963 EXIT_FAILURE if not otherwise done by header files.
10964 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
10965 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
10966 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
10967 argument of all M4ERROR calls.
10968 Reported by Noah Friedman.
10970 * examples/incl-test.m4: Renamed from incl_test.m4.
10971 * examples/include.m4: Include incl-test.m4 instead of
10973 * examples/multiquotes.m4: Renamed from multi-quotes.m.
10975 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
10977 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
10978 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
10979 also tested it on a Sun Sparc workstation running SunOS 4.x.
10981 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
10982 49.format check, abusing a `union values' argument with sprintf
10983 without selecting the proper field. Now, save the formatting type
10984 first, delaying the fetch of the corresponding argument.
10985 Reported by Joseph E. Sacco and Tom Quinn.
10987 * format.c (format): Remove const from char *fmt declaration when
10988 not HAVE_EFGCVT, because a NUL may be forced into it.
10990 * m4.h: Declare atof() when not STDC_HEADERS.
10991 Reported by Joseph E. Sacco.
10993 * Regenerate configure using Autoconf 1.11, this corrects a
10994 problem about an incorrect cpp seting on NeXT 3.1.
10995 Reported by Alexander Lehmann.
10997 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
10999 * m4.h (_): Change argument from `x' to `Args'.
11001 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
11003 * m4.h: Rename Args() to _().
11004 * m4.h: Remove extern specifier from all function declarations.
11006 1994-04-22 Jim Avera <jima@netcom.com>
11008 * stackovf.c: New file implementing stack-overflow detection.
11009 * configure.in: Check for getrlimit, sigaction. If all of
11010 standard headers, getrlimit and sigaction, define USE_STACKOVF and
11011 substitute ${U}stackovf.o for STACKOVF.
11012 * acconfig.h: Declare USE_STACKOVF.
11013 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
11014 * m4.h: Declare setup_stackovf_trap().
11015 * m4.c: Call setup_stackovf_trap().
11016 * tests/stackovf_test.sh: New file.
11018 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
11020 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
11022 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
11024 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
11026 * m4.h: Remove definition of volatile, not used anymore.
11027 Reported by Jim Meyering and Joseph E. Sacco.
11029 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
11030 of `if ... else /* nothing */' for if macros.
11031 Reported by Jim Meyering.
11033 * builtin.c (m4_regexp): Reorganize the code for avoiding a
11034 warning from gcc about `repl' possibly used before defined.
11035 Reported by Jim Meyering.
11037 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
11038 Reported by Jim Meyering.
11040 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
11042 * m4.h: Move the conditional definition of volatile after the
11043 inclusion of system files, because they may define it first.
11045 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
11047 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
11048 get around a problem with Alpha make seeing a syntax error, there.
11049 Reported by Vern Paxson.
11051 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
11053 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
11054 Reported by Richard Stallman.
11056 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
11058 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
11059 instead of AC_HAVE_FUNCS.
11060 Reported by Noah Friedman.
11062 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
11064 * m4.c: Initialize show_help and show_version to zero.
11066 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
11067 Use them in exit() and usage() calls.
11069 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
11071 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
11072 syserr() macro. Delete errref, add reference_error and M4ERROR.
11073 * m4.c: Replace errref, which was returning an input reference
11074 string, with reference_error, which prints it on standard error.
11075 * builtin.c, output.c: Use errno as second parameter to error,
11076 instead of using syserr() with %s.
11077 * *.c: Use M4ERROR instead of error: no more errref() with %s.
11078 Doing so, the program name appears after the input reference
11079 instead of before, which eases M-x next-error processing.
11081 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
11083 * checks/get-them: Escape braces with backslashes in patterns,
11084 because HPUX-9.01 awk needs this.
11085 Reported by Jim Meyering.
11087 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
11089 * builtin.c: Declare "FILE *popen ();".
11091 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
11092 macros, replace error_message_prefix() declaration by errref()'s.
11093 Declare xrealloc, for use in errref().
11094 * m4.c: Delete error_message_prefix() function, add errref().
11095 * *.c: Use error() systematically in place of all error macros,
11096 now that error() flushes stdout first. Make needed adjustments.
11098 * m4.h: Remove const in sys_errlist[] declaration, it creates
11099 conflicts on SGI and Alpha.
11100 Reported by Kaveh R. Ghazi.
11102 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
11104 * m4.c: Include <getopt.h> instead of "getopt.h".
11106 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
11107 * acconfig.h: New, for documenting HAVE_EFGCVT.
11108 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
11109 use them wherever appropriate. Also use -I. for compilations.
11110 * lib/Makefile.in: Use -I.. for compilations.
11111 * *.c: Include <config.h> or "config.h".
11113 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
11114 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
11116 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
11118 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
11120 * input.c (input_init): Initialize quote and comment strings
11121 explicitely instead of calling set_quotes and set_comment: by
11122 doing so, we ensure we do not free uninitialized variables.
11124 * checks/check-them: Reverse arguments to both diff, so the
11125 expected is on the left and the obtained on the right.
11127 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
11128 macros. Delete declarations for m4error, warning, fatal and
11129 internal_error, add declaration for error_message_prefix.
11130 * m4.c: Delete m4error, warning, fatal and internal_error
11131 routines, add error_message_prefix routine.
11132 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
11133 warning with WARNING*, fatal with FATAL* and internal_error with
11135 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
11136 this is not needed anymore.
11138 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
11139 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
11140 and debug_message, add declaration for debug_message_prefix.
11141 * debug.c: Remove static specifier for FILE *debug declaration.
11142 Delete debug_print and debug_message routines, add
11143 debug_message_prefix routine.
11144 * builtin.c, debug.c: Replace debug_print routine calls with
11145 DEBUG_PRINT* macro calls.
11146 * input.c, path.c: Replace debug_message routine calls with
11147 DEBUG_MESSAGE* macro calls.
11149 * m4.h: Remove inclusion of <varargs.h>.
11150 * debug.c: Include <stdarg.h> or <varargs.h>.
11151 (trace_format): Use stdarg instead of varargs if __STDC__.
11153 * configure.in: Remove checks for vfprintf and _doprnt. These
11154 implementations use varargs tricks which are not portable enough.
11155 * lib/vfprintf.c: Deleted.
11156 * lib/_doprnt.c: Deleted.
11157 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
11158 Reported by Joel Sherrill.
11160 * path.c (add_include_directory): Use xstrdup.
11162 * builtin.c (find_builtin_by_name): Declare static.
11164 * *.[ch]: Add const to a few "char *" declarations.
11166 * configure.in: Remove commented tests for fileno() and fstat().
11167 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
11169 * debug.c (debug_flush_files): New.
11170 * m4.h: Declares it.
11171 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
11172 Reported by Nicolas Pioch.
11174 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
11176 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
11177 Reported by Joel Sherrill.
11179 * builtin.c (prefix_all_builtins): Instead of the table size, use
11180 the null entry at end for stopping the loop. It was overwritten.
11181 Reported by Andreas Schwab and Jim Meyering.
11183 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
11184 Reported by Kaveh R. Ghazi.
11186 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
11187 Reported by Karl Vogel.
11189 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
11191 * m4.h: Do not define volatile if already defined.
11192 Reported by René Seindal.
11194 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
11196 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
11197 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
11199 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11201 * m4.h: Define strchr and strrchr in terms of index and rindex,
11202 instead of the other way around.
11203 * builtin.c, m4.c, path.c: Use strchr instead of index.
11205 * input.c (next_char): Remove a "break;" after a "return ...;".
11206 Reported by Tom McConnell.
11208 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11212 * configure.in: Do not copy check files in the build hierarchy.
11213 * checks/check-them: Identify the m4 version being checked. For
11214 finding m4, look in $PATH instead of in the parent directory.
11215 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
11216 * checks/Makefile.in (.all-stamp): Always create check files in
11217 the source hierarchy, not anymore in the build hierarchy.
11218 (check): cd to the source hierarchy before performing checks.
11219 Do not copy nor clean COPYING anymore, take it from `..'.
11220 Reported by Tom McConnell.
11222 * Makefile.in (Makefile): Use $(SHELL).
11223 (config.status): Use $(SHELL). Use "config.status --recheck"
11224 instead of "configure --no-create", which is obsolete.
11225 Reported by Tom McConnell.
11227 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
11229 * m4.c (usage): Use "%s" instead of "m4" in format string.
11230 Reported by Jim Meyering.
11232 * Makefile.in: Distribute mkinstalldirs.
11233 Reported by Pierre Gaumond.
11234 Reported by Jim Meyering.
11235 Reported by Tom McConnell.
11236 Reported by Andreas Gustafsson.
11238 * checks/check-them: Renamed from checks/check_them.
11239 * checks/get-them: Renamed from checks/get_them.
11240 * checks/.all-stamp: Renamed from checks/.all_stamp.
11241 * checks/Makefile.in: Changed accordingly.
11242 Reported by Jim Meyering.
11244 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
11246 * lib/Makefile.in (dist): Correct permissions on files.
11248 * output.c: Declare tmpfile, some systems don't.
11250 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
11252 * checks/Makefile.in (dist): Correct permissions on files.
11254 * Makefile.in (dist): Ensure recursive linking for subdirectory
11255 `examples', also set read/write permissions on all its files.
11257 * mkinstalldirs: New, from elsewhere.
11258 * Makefile.in: Use it.
11260 * debug.c: Synchronize debug messages and regular output when
11261 the debug file and stdout are redirected to the same file.
11262 * configure.in: Add (commented) checks for fileno and fstat.
11263 Reported by Jim Avera.
11265 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
11266 etc., arguments, then ignore the superfluous one. m4 used to
11267 diagnose missing arguments and return the empty string.
11268 Reported by Nick S. Kanakakorn.
11270 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
11272 * m4.c (main): At end of all input, ensure all undiverted text
11273 goes to the main output stream.
11274 Reported by Andreas Gustafsson.
11276 * m4.c (main): exit (0), instead of return 0.
11278 * m4.c: Implement -P and --prefix-builtins.
11279 * builtin.c: Delete const specifier on builtin_tab.
11280 (prefix_all_builtins): New.
11281 Reported by Noah Friedman.
11282 Reported by Scott Bartram.
11284 * c-boxes.el: New, from elsewhere.
11285 * Makefile.in: Distribute it.
11287 * m4.h: Do not define bcopy if <string.h> defines it.
11288 Reported by Stephen Perkins.
11290 * builtin.c (define_macro): Allow a missing second argument, in
11291 which case it is implied empty. Affects define and pushdef.
11292 Reported by Eric Allman.
11294 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
11296 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11297 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11298 * builtin.c: Initialize all the blindness fields in builtin_tab.
11299 (define_builtin): Copy the blindness of a builtin into its symbol.
11300 * macro.c (expand_token): Avoid processing a blind builtin if the
11301 next character is not an opening parenthesis.
11302 Reported by David MacKenzie.
11303 Reported by Noah Friedman.
11305 * configure.in: Ensure an exit status of 0 on completion.
11306 Reported by Vivek P. Singhal.
11308 * eval.c (eval_lex): Admit both lower and upper case letters for
11309 bases greater than 10. Only lower case letters were accepted.
11311 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11312 Reported by Krste Asanovic.
11314 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
11315 * eval.c (logical_not_term): New name for not_term.
11316 * eval.c (xor_term): New, between or_term and and_term.
11317 * eval.c (not_term): New, between and_term and logical_not_term.
11318 * eval.c (shift_term): New, between cmp_term and add_term.
11319 Reported by Krste Asanovic: ~, ^, <<, >>.
11320 Reported by Ben A. Mesander: ** vs ^.
11322 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11323 * m4.h: Delete xrealloc.c.
11324 * lib/xmalloc.c: New, from elsewhere.
11325 * lib/xstrdup.c: New, from elsewhere.
11326 * lib/Makefile.in: Distribute and compile them.
11328 * m4.c: Change progname to program_name.
11329 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11330 * lib/error.c: New, from elsewhere.
11331 * lib/Makefile.in: Distribute and compile error.c.
11332 * configure.in: Check AC_VPRINTF and for strerror.
11333 * m4.c: Delete cmd_error. Use error instead.
11334 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11336 * m4.h: Delete #define const, let Autoconf takes care of this.
11338 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11339 Merge parse_args into main. Declare argv to be `char *const *',
11340 then remove superfluous casts.
11342 * m4.c: Rename --no-gnu-extensions to --traditional.
11343 Reported by Ben A. Mesander.
11345 * m4.c (usage): Add a status parameter. Supply one in various
11346 calls. Add --help processing. Remove -V for --version.
11348 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11350 * lib/Makefile.in: Have an AR=ar declaration.
11351 Reported by Eric Backus.
11352 Reported by Bjorn R. Bjornsson.
11353 Reported by Tom Tromey.
11354 Reported by Kristine Lund.
11355 Reported by Marion Hakanson.
11357 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
11359 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11360 Reported by Noah Friedman.
11362 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
11364 * Makefile.in: Remove MDEFINES and cleanup.
11366 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
11368 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11369 Create a gzip file.
11371 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
11373 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11374 ensure 777 mode for directories, so older tar's will restore file
11377 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
11379 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11380 so the installer can override automatically configured choices.
11381 Reported by Karl Berry.
11383 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
11385 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
11386 previous version was not working properly on m68k-hp-bsd4.3.
11387 Reported by Roland McGrath.
11389 * lib/_doprnt.c: Stolen from Oleo distribution.
11390 * configure.in: Check for _doprnt.c if vfprintf.c selected.
11391 * lib/Makefile.in: Distribute _doprnt.c.
11392 Do not distribute regex.[ch].old anymore.
11394 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
11396 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11397 Richard wants it there.
11399 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
11401 * Makefile.in: Add DEFS to MDEFINES.
11402 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11403 (libm4.a): Remove the library before creating it.
11404 (distclean): Remove tags and TAGS too.
11406 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
11408 * Makefile.in (dvi, m4.dvi): New goals.
11410 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11411 macro.c, output.c, path.c, symtab.c: Change Copyright from
11412 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11414 * examples/divert.m4: Deleted, this bug has been corrected.
11416 * Makefile.in (texclean, mostlyclean): New goals.
11418 * Makefile.in (clean): Remove clutter from ansi2knr.
11419 Reported by Pierre Gaumond.
11421 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
11423 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
11424 might well use CFLAGS is s/he needs it.
11426 * Makefile.in: Allow installation of info files from a separate
11428 Reported by Jason Merrill.
11429 Reported by David MacKenzie.
11430 Reported by Skip Montanaro.
11431 Reported by Erez Zadok.
11432 Reported by Assar Westerlund.
11434 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
11437 This is still a beta release for the future GNU m4 version 1.1.
11439 * lib/alloca.c: New, from elsewhere.
11440 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
11442 * m4.h: Do not define index/rindex if already defined. If
11443 FALSE/TRUE are already defined, do not redefine them, but merely
11444 define boolean typedef to int.
11446 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11447 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11448 because some C compilers do not like connectives with #ifdef.
11449 * m4.h: Define `volatile' only if __GNUC__, instead of once for
11450 __GNUC__ and once for __STDC__.
11451 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11453 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11454 Makefile dependencies. Without it, make keeps destroying and
11455 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
11457 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11458 to diversion/DIVERSION, this was a spelling error.
11460 * m4.c: Declare version[], remove #include "version.h".
11461 * version.h: Deleted.
11462 * Makefile.in: Remove references to version.h.
11464 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11465 production, by using a simpler and more robust algorithm. This
11466 solves the problem of synclines sometimes written in the middle of
11467 an output line. Delete sync_line() and output_lines variable.
11468 * m4.h: Remove sync_line prototype and output_lines declaration.
11469 * input.c (next_char), output.c (shipout_text): Remove references
11471 * input.c (push_file, pop_file): Merely put the value -1 in
11472 output_current_line instead of calling sync_line, for delaying a
11473 single `#line NUM FILE' before next output line. Do not test
11474 for sync_output, because this is unnecessary clutter.
11475 * output.c (make_divertion, insert_divertion): Idem.
11476 * input.c: Rename must_advance_line to start_of_input_line, for
11479 * debug.c (trace_header): Select a new debug line format, which
11480 better complies with GNU standards for formatting error messages.
11481 With option `-dfl', M-x next-error might be used on the output.
11482 * m4.c (vmesg): Adjust format of error output to GNU standards.
11483 * m4.texinfo: Adjust examples for `make check' to work.
11485 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11486 case for enum debug_info constants, which were all lower case.
11488 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11490 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11491 collected patches. I tried a few times using newer regex.[ch], it
11492 mysteriously stopped aborting with this one. Insecure feeling...
11493 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11495 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
11497 * m4.c: Change `--no-warnings' to `--silent'.
11498 Reported by David MacKenzie.
11500 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11501 leave it off for now. See comment in m4.c for justification.
11502 Reported by David MacKenzie.
11504 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11505 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11507 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
11509 * Makefile.in: Ensure recursive cleaning is done before local
11510 cleaning for all clean goals.
11512 * builtin.c (ntoa): Ensure the value is always interpreted as a
11513 signed quantity, whatever the radix is.
11515 1992-11-18 Jim Meyering <meyering@idefix>
11517 * builtin.c, format.c, input.c: Split long lines.
11518 * m4.c: Use typedef macro_definition instead of struct
11520 * symtab.c: Use typedef symbol instead of struct symbol.
11522 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
11524 * *.[ch]: Remove all trailing whitespace, in code and comments.
11526 * configure.in: Find some awk.
11527 * Makefile.in: Add $(AWK) to MDEFINES.
11528 * checks/Makefile.in: Transmit $(AWK) to get_them.
11529 * checks/get_them: Use $AWK instead of gawk. Add a close in the
11530 awk script when switching files, because without this, mawk runs
11531 out of file descriptors.
11533 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
11535 * Makefile.in (realclean): Delete m4.info*.
11536 Reported by Jim Meyering.
11538 * Makefile.in: Adjust and link with checks/Makefile.
11539 * checks/Makefile.in: New.
11540 * configure.in: Output checks/Makefile.
11542 * checks/get_them: Have the dnl header of each test more
11543 recognizable by next-error, also use a better message.
11545 1992-11-16 Jim Meyering <meyering@idefix>
11547 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
11548 And use that only if __GNUC__ since we're using it's GCC-specific
11549 semantics that tell the compiler the associated function doesn't
11552 * builtin.c (substitute): Don't use character as an array index.
11553 (dumpdef_cmp): Make formal arguments `const void *' to avoid
11554 warnings with gcc -W -Wall on systems with qsort prototype.
11555 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
11558 * eval.c (most functions): Add parentheses to assignments used
11559 as truth values go avoid warnings from gcc -Wall.
11561 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
11562 any functions that don't need external scope.
11564 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
11565 (many functions and arrays): Declare `const'.
11567 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
11569 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
11570 removing the declaration from m4.h. Also rename false to FALSE
11573 * lib/Makefile.in (Makefile): New goal.
11575 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
11576 so heavily loaded. It gets more easily overridable, calling make.
11577 Reported by Jim Meyering.
11579 * Makefile.in (dist): Get .fname from the current directory name,
11580 instead of from version.h. I need updating many files manually,
11581 when the version changes, version.h is just one of them.
11583 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
11585 * m4.h: Remove the tag `boolean' on the enum introducing typedef
11586 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
11587 Reported by Tom McConnell.
11589 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
11591 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
11592 39.cleardiv, which were describing missing or spurious newlines.
11593 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
11594 do not depend on machine word size, `/bin/false' implementation,
11595 or `wc' output format. `make check' is more dependable, now.
11597 * checks/check_them: Summarize the failed tests by listing their
11598 name, at end. If none, issue `All checks successful'. Output
11599 `Checking' instead of `Input file:'.
11601 * checks/get_them, checks/check_them: Reindented.
11603 * Makefile.in (dist): chmod a+r before making the tar file.
11605 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
11607 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
11609 * input.c (next_token): Reinitialize token_buttom just after using
11610 it as a watermark with obstack_free. Or else, a future token, big
11611 enough for triggering reallocation of the obstack chunk, could
11612 void the initialized value of token_buttom, later causing panic in
11613 obstack_free. Rename token_buttom to token_bottom everywhere.
11615 * m4.h: Before declaring errno, first include <errno.h> and
11616 ensure that it does not define errno.
11617 Reported by Richard Stallman.
11619 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
11621 * builtin.c: Define and use DECLARE macro for builtins.
11623 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
11624 argument, this is a common idiom for introducing long comments.
11626 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
11627 arguments. The last argument was silently ignored.
11629 * m4.c (cmd_error): Add a missing semicolon before va_end().
11631 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
11633 * Makefile.in: Now handle protoized sources. Define and use U.
11634 Compile and use ansi2knr with old compilers. Update DISTFILES.
11635 Add `aclocal.m4' to `configure' dependencies.
11636 * ansi2knr.c: New, from Ghostscript distribution.
11637 * configure.in: Define U through FP_PROTOTYPES for old compilers.
11638 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
11639 * aclocal.m4: New, provide FP_PROTOTYPES.
11640 * m4.h: Conditionnaly protoized through Args, save for varags.
11641 * builtin.c: Protoized. Then:
11642 Include <sys/types.h> if size_t is not defined, before "regex.h".
11643 (m4_ifelse): Fetch built-in name properly for diagnostic.
11644 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
11645 (m4_regexp): Add const to `msg' declaration.
11646 (m4_patsubst): Add const to `msg' declaration.
11647 * debug.c: Protoized, save for varargs.
11648 * eval.c: Protoized.
11649 * format.c: Protoized.
11650 * input.c: Protoized.
11651 * m4.c: Protoized, save for varargs. Then:
11652 (xfree): Accept void * instead of char *.
11653 (xmalloc): Return void * instead of char *.
11654 (xrealloc): Accept and return void * instead of char *.
11655 * macro.c: Protoized.
11656 * output.c: Protoized.
11657 * path.c: Protoized. Then cast some (char *) over xmalloc's.
11658 * symtab.c: Protoized.
11660 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
11662 * m4.texinfo: Remove directory from diagnostics in 30.include,
11663 51.eval, 56.errprint and 57.m4exit tests.
11665 * m4.h: Remove declarations for int or void system functions, they
11666 cause more conflicting trouble than they make good.
11668 * configure.in: Avoid configuration header file. Add some tests.
11669 * m4.h: Remove #include "config.h".
11670 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
11671 Then, rewritten for better compliance with GNU standards.
11673 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
11675 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
11676 because of a misplaced #endif.
11678 * Many *.[hc] files: Correct intra-line spacing here and there,
11679 according to GNU indent 1.6 advice.
11681 * configure.in: New, using Autoconf 1.2.
11682 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
11683 * Delete old configure.in, configure, etc/configure.in,
11684 etc/configure, lib/configure.in, lib/configure and config/*.
11685 Reported by Jason Merrill.
11687 * symtab.c (hash): Change (char) NULL to '\0'.
11688 Reported by Jason Merrill.
11690 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
11691 etc/nextvers.sh. Release numbers will be edited `by hand'.
11692 * version.h: De-automatize, force value in.
11694 * m4.c: Changes in order to use a newer getopt.h.
11695 Reported by David MacKenzie.
11697 * checks/: New name for examples/.
11698 * checks/get_them: New location for etc/get_examples.
11699 * checks/check_them: New location for etc/check_examples.
11700 * Makefile.in, checks/get_them, checks/check_them: Adjust.
11701 * lib/vfprintf.c: New location for etc/vfprintf.c.
11702 * Delete empty etc/.
11703 * examples/: New name for test/.
11705 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
11707 * Makefile.in (check): Add m4 as dependency.
11709 * m4.c: Accept --no-warnings instead of --no_warnings, and
11710 --no-gnu-extensions instead of --no_gnu_extensions. Make the
11711 usage message more informative.
11712 Reported by David MacKenzie.
11714 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
11716 * etc/check_examples: New name for check_examples.sh.
11717 * etc/get_examples: New name for get_examples.sh.
11718 * Makefile.in, etc/Makefile.in: Use new names.
11720 * Makefile.in: Transmit $(CC) while making in lib.
11722 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
11723 code disposition by hand.
11725 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
11727 * m4.h: Delete definitions for abort() and exit().
11728 Reported by Richard Stallman.
11730 * config/hmake-unicos, config/s-unicos.h: New files.
11731 Reported by Hal Peterson.
11733 * eval.c (exp_term): Have N^0 return 1.
11734 Reported by Michael Fetterman.
11736 * eval.c, input.c, m4.h: Remove last comma in enums.
11737 Reported by Mike Lijewski.
11739 * Transfer of maintenance duties from René to François.
11741 1991-10-24 René Seindal <seindal@diku.dk>
11743 * Release 1.0. Many thanks to those, who provided me with bug
11744 reports and feedback.
11746 * Uses GNU configure, taken from the gdb distribution.
11748 * Uses GNU getopt(), with long option names.
11750 * The -Q/+quiet option is added, which suppresses warnings about
11751 missing or superflous arguments to built-in macros.
11753 * Added default options via the M4OPTS environment variable.
11755 * The built-in format can now be configured to use sprintf as
11756 the formatting engine, for systems without [efg]cvt(3).
11758 * GNU library code is moved to the ./lib subdirectory; other
11759 utility files are now in ./etc.
11761 * Several minor bugs have been fixed.
11763 1991-07-26 René Seindal <seindal@diku.dk>
11765 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
11766 François Pinard and Roland H. Pesch for providing me with reports.
11768 * The builtins incr and decr are now implemented without use of
11771 * The builtin indir is added, to allow for indirect macro calls
11772 (allows use of "illegal" macro names).
11774 * The debugging and tracing facilities has been enhanced
11775 considerably. See the manual for details.
11777 * The -tMACRO option is added, marks MACRO for tracing as soon
11780 * Builtins are traced after renaming iff they were before.
11782 * Named files can now be undiverted.
11784 * The -Nnum option can be used to increase the number of
11785 divertions available.
11787 * Calling changecom without arguments now disables all comment
11790 * The function m4_patsubst() is now consistently declared
11793 * A bug in dnl is fixed.
11795 * A bug in the multi-character quoting code is fixed.
11797 * Several typos in the manual has been corrected. More probably
11800 * The m4.info file is now installed along with the program.
11802 1990-11-15 René Seindal <seindal@diku.dk>
11804 * Updated and enhanced version. Release 0.75, manual 0.07.
11806 * Implemented search path for include files (-I option and
11807 M4PATH envronment variable).
11809 * Implemented builtin "format" for printf-like formatting.
11811 * Implemented builtin "regexp" for searching for regular
11814 * Implemented builtin "patsubst" for substitution with regular
11817 * Implemented builtin "esyscmd", which expands to a shell
11820 * Implemented "__file__" and "__line__" for use in error
11823 * Implemented character ranges in "translit".
11825 * Implemented control over debugging output.
11827 * Implemented multi-character quotes.
11829 * Implemented multi-character comment delimiters.
11831 * Changed predefined macro "gnu" to "__gnu__".
11833 * Changed predefined macro "unix" to "__unix__", when the -G
11834 option is not used. With -G, "unix" is still defined.
11836 * Changed "shift", "$@" and "$*" to not insert spaces afters
11839 * Added program name to error messages.
11841 * Fixed two missing null bytes bugs.
11843 1990-01-22 René Seindal <seindal@diku.dk>
11845 * Initial beta release. Release 0.50, manual 0.05.
11854 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
11855 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
11857 Copying and distribution of this file, with or without
11858 modification, are permitted provided the copyright notice
11859 and this notice are preserved.