1 2009-06-15 Eric Blake <ebb9@byu.net>
3 Drop .cvsignore and redundant .gitignore files.
4 * .cvsignore: Delete. We are moving further away from CVS.
5 * build-aux/.cvsignore: Likewise.
6 * doc/.cvsignore: Likewise.
7 * examples/.cvsignore: Likewise.
8 * ltdl/.cvsignore: Likewise.
9 * m4/.cvsignore: Likewise.
10 * modules/.cvsignore: Likewise.
11 * po/.cvsignore: Likewise.
12 * src/.cvsignore: Likewise.
13 * tests/.cvsignore: Likewise.
14 * .gitignore: Consolidate from other files.
15 * build-aux/.gitignore: Delete, now that it is consolidated.
16 * doc/.gitignore: Likewise.
17 * examples/.gitignore: Likewise.
18 * ltdl/.gitignore: Likewise.
19 * m4/.gitignore: Likewise.
20 * modules/.gitignore: Likewise.
21 * po/.gitignore: Likewise.
22 * src/.gitignore: Likewise.
23 * tests/.gitignore: Likewise.
24 * bootstrap: Simplify accordingly. Sync gnulib tree prior to
25 libtoolize, to avoid libtool overwriting config.guess.
27 Avoid compiler warning.
28 * m4/macro.c (process_macro): Use correct type for isdigit.
30 2009-06-13 Eric Blake <ebb9@byu.net>
32 Avoid snprintf link failures.
33 * ltdl/m4/gnulib-cache.m4: Import snprintf-posix module.
34 Reported by Ralf Wildenhues.
36 2009-06-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
38 Avoid pointer arithmetic on `void *'.
39 * modules/m4.c (dump_symbol_CB): Cast obstack_base return value
40 to `char *' before using it.
42 2009-05-04 Eric Blake <ebb9@byu.net>
44 Silence verbose testsuite runs.
45 * tests/testsuite.at (m4_version_prereq): Bump to recent
46 autoconf.git version where stdout-nolog was added.
47 * tests/builtins.at (esyscmd, syscmd): Use new stdout-nolog.
48 * tests/freeze.at (AT_TEST_FREEZE): Likewise.
49 * tests/others.at (stderr closed): Likewise.
50 * HACKING: Mention new requirement.
51 * bootstrap: Likewise.
52 Reported by Ralf Wildenhues.
54 2009-04-21 Eric Blake <ebb9@byu.net>
56 Be more explicit about default quoting characters.
57 * doc/m4.texinfo (Quoted strings): Call out characters by name.
59 Suggested by Mehul Sanghvi.
61 2009-04-16 Eric Blake <ebb9@byu.net>
63 Use gnulib rename module.
64 * ltdl/m4/gnulib-cache.m4: Import rename module. At the moment,
65 we don't tickle either of the platform bugs that it fixes, but it
66 is better to be safe than sorry.
68 Require newer automake features.
69 * configure.ac (AM_INIT_AUTOMAKE): Add dist-xz, color-tests,
70 parallel-tests, and silent-rules. Drop dist-lzma.
71 * HACKING: Update minimum requirements.
72 * gnulib: Update to latest version.
74 Mention release of 1.4.13.
75 * NEWS: Update to match release on branch-1.4.
76 * doc/m4.texinfo (History): Update release history.
77 (copying): Finish conversion to GFDL 1.3, started 2008-11-04.
79 2009-03-23 Eric Blake <ebb9@byu.net>
81 Exploit git submodule by adding appropriate symlinks.
82 * bootstrap: No longer copy files from gnulib.
83 * COPYING: Change to symlink pointing into gnulib.
85 * build-aux/compile: Likewise.
86 * build-aux/config.guess: Likewise.
87 * build-aux/config.sub: Likewise.
88 * build-aux/depcomp: Likewise.
89 * build-aux/install-sh: Likewise.
90 * build-aux/mdate-sh: Likewise.
91 * build-aux/missing: Likewise.
92 * build-aux/texinfo.tex: Likewise.
93 * .cvsignore: Reflect these changes.
94 * .gitignore: Likewise.
95 * build-aux/.cvsignore: New file.
96 * build-aux/.gitignore: Likewise.
98 Make gnulib a git submodule.
99 * .gitmodules: New file.
100 * gnulib: Record which version of gnulib has been tested.
101 * bootstrap: Aid in submodule usage.
102 * cfg.mk (gnulib_dir): Alter default location of gnulib.
103 * HACKING: Mention how to use submodule.
105 2009-03-21 Eric Blake <ebb9@byu.net>
107 Use memcmp2 to simplify lexicographic comparisons.
108 * ltdl/m4/gnulib-cache.m4: Import memcmp2.
109 * modules/m4.c (dumpdef_cmp_CB): Use it.
111 2009-03-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
113 Fix m4.1 build race, exposed by parallelism through GNUmakefile.
114 * Makefile.am (SUBDIRS): Add doc.
115 (Documentation rules): Move ...
116 * doc/Makefile.am: ... to this new file.
117 * configure.ac (AC_CONFIG_FILES): Generate doc/Makefile.
119 2009-03-13 Eric Blake <ebb9@byu.net>
121 Try to tolerate spaces in directory names in testsuite.
122 * tests/null.m4: Provide shell quoting, in case __program__
125 Fix awk script portability.
126 * checks/get-them: In gsub, properly escape {.
127 Reported by Gary V. Vaughan.
129 Make bootstrap easier on Solaris.
130 * bootstrap: Add GNULIB_SRCDIR. Useful when a wrapper script
131 gnulib-tool exists earlier on the path to work around /bin/sh
132 failure in parsing $GNULIB_SRCDIR/gnulib-tool.
134 2009-03-13 Eric Blake <ebb9@byu.net>
136 Allow configuration choice in syscmd shell.
137 * ltdl/m4/m4-syscmd.m4: New file.
138 * configure.ac (M4_SYSCMD): Use it to provide
140 (AC_CHECK_HEADERS_ONCE): No longer need to worry about
142 * modules/m4.c (syscmd): Use it to avoid hard-coding the shell
144 * modules/gnu.c (esyscmd): Likewise.
145 * doc/m4.texinfo (Syscmd, Esyscmd): Document this.
146 * README: Document new configure option.
149 Use gnulib pipe module instead of popen(3).
150 * ltdl/m4/gnulib-cache.m4: Import pipe and wait-process modules.
151 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS):
153 (esyscmd): Rewrite with pipe module.
154 Resolves a failure on AIX, reported by Gary V. Vaughan.
156 Use gnulib execute module instead of system(3).
157 * ltdl/m4/gnulib-cache.m4: Import execute module.
158 * m4/utility.c (m4_info_name): New function.
159 * m4/m4module.h (m4_info_name): New prototype.
160 * modules/m4.c (syscmd): Rewrite with execute module.
161 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS, m4_sysval): Move
163 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS)
165 Resolves a failure on AIX, reported by Gary V. Vaughan.
167 2009-03-05 Eric Blake <ebb9@byu.net>
169 Improve web-manual maintainer rule.
170 * maint.mk (web-manual): Factor package-specific detail...
171 * cfg.mk (manual_title): ...to new variable.
173 2009-02-23 Eric Blake <ebb9@byu.net>
175 Speed up translit when from argument is short.
176 * modules/m4.c (translit): Use memchr2 when possible.
177 * tests/builtins.at (translit): Add tests.
178 * NEWS: Document this.
180 2009-02-18 Eric Blake <ebb9@byu.net>
182 Prefer buffer over byte operations.
183 * modules/format.c (format): Use memchr for speed.
184 * modules/gnu.c (substitute): Likewise.
185 * m4/macro.c (locate_dollar): Inline into only caller...
186 (process_macro): ...and rearrange for readability.
187 * m4/input.c (consume_buffer): Allow C++ compilation.
188 * doc/m4.texinfo (Changesyntax): Enhance test.
190 Speed up esyscmd with buffer reads.
191 * modules/gnu.c (esyscmd): Read blocks directly into obstack,
192 rather than repeatedly reading bytes. Detect read errors.
194 Avoid risk of stack overflow.
195 * m4/output.c (insert_file): Avoid stack allocation of large
198 Synchronize THANKS with branch.
199 * THANKS: Import more names.
201 Improve handling of $ in syntax table.
202 * m4/m4module.h (m4_is_syntax_single_dollar): New function.
203 (M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
204 be context rather than basic syntax categories.
205 (M4_SYNTAX_MASKS): Adjust macro.
206 * m4/m4private.h (struct m4_syntax_table): Add dollar and
207 is_single_dollar members.
208 (m4_is_syntax_single_dollar): Add fast alternative.
209 * m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
210 account for change to context categories.
211 (m4_set_syntax): Manage is_single_dollar.
212 (m4_is_syntax_single_dollar): New function.
213 * m4/macro.c (locate_dollar): New helper function.
214 (process_macro): Use it to speed up macro expansion.
215 * m4/input.c (m4__next_token): Adjust client.
216 * doc/m4.texinfo (Changesyntax): Document this.
218 2009-02-17 Eric Blake <ebb9@byu.net>
220 Sync changecom documentation with branch.
221 * doc/m4.texinfo (Changecom): Tweak wording.
222 * NEWS: Import changes from the branch.
224 Stage 29b: Process quotes and comments by buffer, not bytes.
225 Search for quote and comment delimiters by buffer when possible.
227 Speed impact: noticeable improvement, from fewer function calls.
228 * ltdl/m4/gnulib-cache.m4: Import memchr2 module.
229 * m4/input.c (m4__next_token): Add buffer reads to quote and
231 * NEWS: Document this.
233 2009-02-16 Eric Blake <ebb9@byu.net>
235 Stage 29a: Process dnl and macro names by buffer, not bytes.
236 Enhance input engine to provide lookahead buffer, rather than
237 forcing clients to call next_char for every byte. Utilize this
238 for the simplest clients.
240 Speed impact: noticeable improvement, from fewer function calls.
241 * ltdl/m4/gnulib-cache.m4: Import freadptr and freadseek modules.
242 * m4/input.c (struct input_funcs): Add virtual functions
243 buffer_func and consume_func.
244 (file_buffer, file_consume, string_buffer, string_consume)
245 (composite_buffer, composite_consume, eof_buffer): Implement
247 (file_funcs, string_funcs, composite_funcs, eof_funcs): Update
249 (buffer_retry): New sentinel.
250 (next_buffer, consume_buffer): New functions.
251 (m4_skip_line, match_input, consume_syntax): Use them for faster
253 Suggested by Bruno Haible.
255 Unify single and multi-character delimiter handling.
256 * m4/input.c (MATCH): Add a parameter.
257 (m4__next_token): Simplify logic and reduce redundancy.
258 (m4__next_token_is_open): Adjust caller.
259 * m4/syntax.c (m4_set_comment, m4_set_quotes): Handle delimiters
260 of differing lengths.
261 (m4_set_syntax): Recognize restoration of single delimiters.
263 Revamp changesyntax vs. changequote interactions.
264 * m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
265 (M4_SYNTAX_SUSPECT): New macro.
266 * m4/m4private.h (struct m4_syntax_table): Add suspect field.
267 * m4/syntax.c (check_is_single_quotes, check_is_single_comments)
268 (check_is_macro_escaped): Delete, by inlining body...
269 (m4_set_syntax): ...into here. Improves handling between
270 changesyntax and changequote/changecom.
271 (add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
272 and let suspect field track needed cleanup.
273 (m4_set_quotes, m4_set_comment): Adjust meaning of
274 is_single_quotes and is_single_comment flags to always be true if
275 only one delimiter exists, regardless of its length. Ensure that
276 the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
277 only used on 1-byte delimiters.
278 (add_syntax_attribute, remove_syntax_attribute): Change signature
279 to allow the use of fewer casts. Adjust the suspect field when
281 (m4_reset_syntax, set_quote_age): Adjust callers.
282 * m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
284 * doc/m4.texinfo (Changesyntax): Update documentation and tests.
286 Improve changesyntax documentation.
287 * doc/m4.texinfo (Changesyntax): Merge two tables into one
290 Fix regression in multicharacter quotes, from 2008-01-26.
291 * m4/input.c (m4__next_token): Fix typo.
292 * tests/builtins.at (changequote): Enhance test.
294 2009-02-13 Eric Blake <ebb9@byu.net>
296 Speed up parsing when detecting input file change.
297 * m4/input.c (next_char): Clear input_change flag. Bug introduced
300 2009-02-12 Eric Blake <ebb9@byu.net>
302 Avoid quadratic code when walking definition stack.
303 * examples/stack_sep.m4: Use linear, not quadratic
305 * doc/m4.texinfo (Improved copy): Fix documentation, based on
306 recent autoconf bug fix.
307 * tests/others.at (recursion): Enhance test.
309 2009-02-11 Eric Blake <ebb9@byu.net>
311 Stage 28c: Warn on embedded NUL in remaining cases.
312 Ensure all remaining warnings can handle embedded NUL.
314 Speed impact: none noticed.
315 * m4/m4module.h (m4_debug_decode, m4_parse_truth_arg): Add
317 * m4/macro.c (m4_macro_call): Improve diagnostic.
318 * modules/m4.c (defn): Likewise.
319 * m4/debug.c (m4_debug_decode): Handle embedded NUL.
320 * m4/utility.c (m4_parse_truth_arg): Likewise.
321 * modules/format.c (arg_int, arg_long, arg_double): Likewise.
322 (arg_string): New function.
323 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Update callers.
324 * src/main.c (main): Likewise.
325 * src/freeze.c (reload_frozen_state): Likewise.
326 * modules/gnu.c (debugmode, syncoutput): Likewise.
327 * tests/options.at (--regexp-syntax): Adjust test.
328 * tests/freeze.at (reloading nul): Likewise.
329 * tests/null.m4: Likewise.
330 * tests/null.out: Likewise.
331 * tests/null.err: Likewise.
333 Stage 28b: Warn on embedded NUL in file arguments.
334 Quote warning messages related to file and other NUL-terminated
337 Speed impact: none noticed.
338 * m4/path.c (m4_path_search): Quote file names in message.
339 * modules/m4.c (syscmd, include, m4_make_temp): Handle embedded
341 * modules/gnu.c (debugfile, esyscmd): Likewise.
342 * tests/others.at (nul character): Adjust test.
343 * tests/builtins.at (mkdtemp, mkstemp): Likewise.
344 * tests/null.m4: Likewise.
345 * tests/null.out: Likewise.
346 * tests/null.err: Likewise.
348 Stage 28a: Warn on embedded NUL in numeric arguments.
349 Quote warning messages related to numeric parsing in order to
352 Speed impact: none noticed.
353 * m4/m4module.h (m4_numeric_arg): Adjust prototype.
354 * m4/utility.c (m4_numeric_arg): Add parameter.
355 * modules/gnu.c (debuglen): Adjust callers.
356 * modules/m4.c (incr, decr, divert, undivert, m4exit, substr)
358 * modules/evalparse.c (m4_evaluate): Likewise.
359 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
360 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
362 * doc/m4.texinfo (Changesyntax): Fix typo.
363 * tests/others.at (nul character): Adjust test.
364 * tests/null.m4: Likewise.
365 * tests/null.out: Likewise.
366 * tests/null.err: Likewise.
368 2009-02-11 Eric Blake <ebb9@byu.net>
370 Avoid regression in popdef(undef).
371 * doc/m4.texinfo (Trace): Enhance test, to cover regression
372 recently fixed on the branch.
374 2009-02-09 Eric Blake <ebb9@byu.net>
376 Enhance index to support starting offset.
377 * modules/m4.c (index): Add optional third argument.
378 * NEWS: Document this.
379 * doc/m4.texinfo (Index macro): Likewise.
380 (Macro Arguments): Adjust tests.
382 2009-01-24 Eric Blake <ebb9@byu.net>
384 Add URLs to --help output.
385 * src/main.c (usage): Use enhanced version-etc features.
387 2009-01-07 Eric Blake <ebb9@byu.net>
389 Enhance substr to support replacement text.
390 * doc/m4.texinfo (Substr): Document new semantics.
391 * modules/m4.c (substr): Support optional fourth argument.
392 * NEWS: Document this.
394 Enhance substr to support negative values.
395 * doc/m4.texinfo (Substr): Document new semantics, and how to
397 * modules/m4.c (substr): Support negative values.
398 * NEWS: Document this.
400 2009-01-05 Eric Blake <ebb9@byu.net>
403 * HACKING: Remove mention of xdelta.
404 * Makefile.am (EXTRA_DIST, MAINTAINERCLEANFILES): Let gnulib take
405 care of distributing gendocs.sh.
406 * maint.mk (web-manual): Use new feature of gendocs.
407 * ltdl/m4/gnulib-cache.m4: Regenerate.
409 2008-12-24 Eric Blake <ebb9@byu.net>
411 Relax eval as allowed by POSIX 2008.
412 * modules/evalparse.c (m4_evaluate): Warn, not error, on invalid
413 operator. Quote expression in warning.
414 * modules/mpeval.c (includes): Add quotearg.h.
415 * doc/m4.texinfo (Eval, Improved forloop): Update tests.
416 * NEWS: Update to reflect 1.6 support for `?:'.
418 2008-12-23 Eric Blake <ebb9@byu.net>
420 Add debugmode(o) to control dumpdef output location.
421 * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
422 (M4_DEBUG_TRACE_VERBOSE): Update.
423 * m4/debug.c (m4_debug_decode): Support new debug option.
424 * src/freeze.c (produce_debugmode_state): Likewise.
425 * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
427 * src/main.c (usage): Document it.
428 * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
429 (Debugfile): Likewise.
431 Based on an autoconf bug report by Paolo Bonzini.
433 Make --debugfile argument optional.
434 * src/main.c (long_options): Make the argument optional, to allow
435 setting debug file back to stderr.
436 (main): Make --debugfile order-dependent.
437 (usage): Document this.
438 * doc/m4.texinfo (Debugging options): Likewise.
440 * tests/options.at (--debugfile): Enhance test.
441 (--safer): Adjust to new semantics.
443 2008-12-22 Eric Blake <ebb9@byu.net>
446 * doc/m4.texinfo (Operation modes, Preprocessor features)
447 (Limits control, Frozen state, Debugging options)
448 (Dynamic loading features): Use lower case names in @var.
449 (Improved copy): Use @code, not @var, as appropriate.
451 2008-12-18 Eric Blake <ebb9@byu.net>
453 Deal with M4 1.4.x limitation on builtin tokens.
454 * doc/m4.texinfo (Composition): Mention limitation on curry.
455 (Improved copy): New node.
457 * examples/stack.m4: Likewise.
458 * examples/stack_sep.m4: New file.
459 * Makefile.am (dist_pkgdata_DATA): Distribute it.
461 2008-12-15 Eric Blake <ebb9@byu.net>
463 Double size of temp file cache.
464 * m4/output.c (tmp_file, tmp_file_owner): Split...
465 (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
467 (tmp_file2_recent): New variable.
468 (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
469 (m4_output_exit): Adjust callers.
471 Use fewer seeks on cached files.
472 * m4/output.c (m4_tmpfile): Use write, not append mode.
473 (m4_tmpopen): Add parameter to decide when to skip seeks.
474 (m4_tmprename, m4_make_diversion, insert_diversion_helper)
475 (m4_freeze_diversions): Adjust callers.
477 Cache most recently spilled diversion.
478 * m4/output.c (tmp_file, tmp_file_owner): New variables, for
479 1-deep cache of spilled diversions.
480 (m4_tmpfile): Open in append mode, since we might revisit
481 diversion without closing it now.
482 (m4_tmpopen): Check cache first.
483 (m4_tmpclose): Update cache, rather than closing. Add parameter.
484 (m4_tmpremove): Close cache before removing.
485 (m4_tmprename): Deal with open files when renaming.
486 (m4_output_exit): Close cache before exiting.
487 (make_room_for, m4_make_diversion, insert_diversion_helper):
489 * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
490 * configure.ac (M4_RENAME): Invoke it.
492 Correctly track size of in-memory diversions.
493 * m4/output.c (insert_diversion_helper): Correctly track total
494 in-memory diversion size after undivert.
496 Avoid quadratic behavior for some cases of divert/undivert.
497 * m4/output.c (struct m4_diversion): Improve comments.
498 (m4_tmpname, m4_make_diversion): Strengthen preconditions.
499 (m4_tmprename): New function.
500 (m4_output_init, m4_output_exit): Move after internal functions.
501 (make_room_for): Don't bother copying uninitialized bytes.
502 (insert_diversion_helper): Transfer metadata, rather than copying
503 contents, when undiverting into a previously unused diversion.
504 * tests/builtins.at (divert): Add a check to the test.
505 * doc/m4.texinfo (Undivert): Enhance test.
506 * NEWS: Document the speedup.
508 2008-12-02 Eric Blake <ebb9@byu.net>
510 Stage 27: Allow embedded NUL in text processing macros.
511 Pass NUL through regular expressions, format, and translit, and
512 diagnose it in eval and changeresyntax. Improve warning
513 capabilities of format.
515 Speed impact: none noticed.
516 * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
517 (translit): Manage NUL bytes.
518 * modules/format.c (format): Likewise.
519 * modules/gnu.c (substitute, regexp_substitute): Likewise.
520 (m4_resyntax_encode_safe): Add parameter.
521 (regexp, patsubst, renamesyms): Update callers.
522 (regexp_compile): Adjust error message.
523 * modules/evalparse.c (m4_evaluate): Use consistent message.
524 (end_text): New variable.
525 (eval_init_lex): Add parameter.
526 (eval_lex): Detect embedded NUL.
527 * src/freeze.c (reload_frozen_state): Likewise.
528 * doc/m4.texinfo (Format): Update to cover new behavior.
529 (Eval): Mention that result is unquoted.
530 * tests/freeze.at (reloading nul): Enhance test.
531 * tests/null.m4: Likewise.
532 * tests/null.err: Update expected output.
533 * tests/null.out: Likewise.
534 * tests/options.at (--regexp-syntax): Likewise.
536 2008-11-28 Eric Blake <ebb9@byu.net>
538 Resync NEWS with branches.
539 * NEWS: Mention 1.4.12, update state of 1.6.
541 2008-11-26 Eric Blake <ebb9@byu.net>
543 Keep COPYING in repository.
544 * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
545 * .cvsignore: Don't ignore it.
546 * .gitignore: Likewise.
547 * COPYING: Store in repository, per automake 1.10.2
550 2008-11-26 Eric Blake <ebb9@byu.net>
552 Document optimized forloop.
553 * doc/m4.texinfo (Improved forloop): Mention alternate style that
554 avoids define overhead.
555 * examples/forloop3.m4: New file.
556 * Makefile.am (dist_pkgdata_DATA): Distribute it.
558 Document copy composite using stack_foreach and curry.
559 * doc/m4.texinfo (Stacks): New node, to document pushdef stack
561 (Ifelse): Move define_blind...
562 (Composition): ...to this new node. Document currying, then use
563 it to implement copy and rename.
564 * examples/curry.m4: New file.
565 * examples/stack.m4: Likewise.
566 * Makefile.am (dist_pkgdata_DATA): Distribute them.
568 2008-11-04 Eric Blake <ebb9@byu.net>
571 * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
572 * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
574 * doc/m4.texinfo (GNU Free Documentation License): Likewise.
576 2008-10-22 Eric Blake <ebb9@byu.net>
578 Give nicer error if user modifies testsuite but lacks autoconf.
579 * Makefile.am (AUTOM4TE): Use missing in the definition.
581 2008-10-09 Eric Blake <ebb9@byu.net>
583 Allow user to choose which sed to use in testsuite.
584 * tests/atlocal.in (SED): Inherit from configure results.
585 * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
586 (mkstemp, syscmd): Use $SED.
587 * tests/generate.awk (new_test): Likewise.
588 * tests/options.at (deprecated options, unknown option)
589 (--debugmode, --help and --version): Likewise.
590 * tests/testsuite.at (AT_CHECK_M4): Likewise.
591 * tests/others.at (directory, stderr closed, stdin seekable)
592 (stdout closed): Likewise.
593 (nul character): Likewise. Also, skip test if sed can't handle
596 Clean up testsuite invocation.
597 * tests/atlocal.in: Fix copyright notice.
598 * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
599 (check-local, installcheck-local): Adjust clients. Add missing
602 2008-09-25 Eric Blake <ebb9@byu.net>
604 Tweak error message on command line failure.
605 * m4/m4private.h (includes): Use "quotearg.h".
606 * src/main.c (process_file, main): Use nicer quotes for file name
608 * m4/input.c (file_clean, m4_push_file): Likewise.
609 * m4/module.c (m4__module_open): Likewise.
610 * src/freeze.c (produce_frozen_state, reload_frozen_state):
612 * modules/gnu.c (debugfile): Likewise.
613 * modules/m4.c (undivert, include): Likewise.
614 * tests/others.at (directory, stdin closed): Update tests.
615 * tests/options.at (file names, --debugmode): Likewise.
616 * doc/m4.texinfo (Debugmode): Likewise.
618 Unify error handling for reading directories.
619 * m4/path.c (m4_path_search): Factor open attempts...
620 (m4_fopen): ...into new function, to reject directories.
621 * tests/others.at (directory): Enhance test.
622 * doc/m4.texinfo (Include): Document that directories cannot be
625 Avoid bugs on platforms that mishandle trailing /.
626 * ltdl/m4/gnulib-cache.m4: Import fopen module.
627 * tests/others.at (directory): New test.
629 2008-09-16 Eric Blake <ebb9@byu.net>
631 Fix bootstrap for Solaris /bin/sh.
632 * bootstrap: Avoid shell quoting pitfall.
634 2008-09-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
636 Typos in source code comments.
637 * modules/m4.c: Fix typos in comments.
638 * m4/input.c: Likewise.
639 * src/main.c: Likewise.
641 2008-08-29 Eric Blake <ebb9@byu.net>
643 Fix manual date information.
644 * doc/m4.texinfo: UPDATED refers to the day the manual was built,
645 not the release date of M4.
646 Based on a bison patch by Akim Demaille.
648 2008-08-27 Eric Blake <ebb9@byu.net>
651 * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
655 2008-08-23 Eric Blake <ebb9@byu.net>
657 Allow debugmode control over whether defn(undef) warns.
658 * ltdl/m4/gnulib-cache.m4: Import verify module.
659 * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
661 (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
662 * m4/m4.c (m4_create): Start with debugmode = d.
663 * src/main.c (usage): Mention this.
664 (main): Let -E impact debug mode.
665 * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
667 * modules/gnu.c (builtin, inder): Likewise.
668 * m4/debug.c (m4_debug_decode): Parse new mode.
669 * src/freeze.c (produce_debugmode_state): Accomodate new mode.
670 * doc/m4.texinfo (Debugging options): Mention change in the
672 (Debugmode): Mention new flag d.
673 (Operation modes): Mention interaction with -E.
674 (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
676 * tests/options.at (--debugmode): Update tests.
677 * tests/freeze.at (reloading debugmode): Likewise.
678 * NEWS: Document this.
679 Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
680 incompatible with Autoconf 2.62.
682 2008-08-22 Eric Blake <ebb9@byu.net>
684 Improve --debugmode behavior.
685 * m4/m4module.h (m4_debug_decode): Simplify interface.
686 * m4/debug.c (m4_debug_decode): Remove parameter, and handle
687 setting the new value.
688 * modules/gnu.c (debugmode): Adjust caller.
689 * src/freeze.c (reload_frozen_state): Likewise.
690 * src/main.c (main): Likewise.
691 (usage): Fix default for --debug.
692 * doc/m4.texinfo (Debugging options): Add an example.
694 2008-08-21 Eric Blake <ebb9@byu.net>
696 Avoid regression in defn(undef).
697 * doc/m4.texinfo (Trace): Enhance test, to cover regression
698 recently fixed on the branch.
700 2008-08-18 Eric Blake <ebb9@byu.net>
702 Remove deprecated -N option; fixes a regression from 2006-09-14.
703 * src/main.c (DIVERSIONS_OPTION): Delete.
704 (long_options, OPTSTRING, main): Remove -N/--diversions option.
705 * doc/m4.texinfo (Limits control): Remove it from the manual.
706 * NEWS: Mention that it is gone.
707 * tests/options.at (deprecated options): Update test.
709 Improve 'git diff' of manual source.
710 * .gitattributes (*.texi*): Add diff attribute.
711 * bootstrap: Tell git how to use it.
712 Inspired by Jim Meyering's similar patch for coreutils.
714 2008-08-07 Bruno Haible <bruno@clisp.org> (tiny change)
716 Run m4 tests prior to gnulib unit tests.
717 * Makefile.am (SUBDIRS): Swap order of directories.
719 2008-08-03 Eric Blake <ebb9@byu.net>
721 Stage 26: Allow embedded NUL in macro definitions.
722 Clean up final few locations that did not track macro definitions
723 by length, to allow embedded NUL. Make m4_arg_len callers aware
724 of issue of flattening builtins when determining length.
726 Speed impact: none noticed.
727 * m4/m4module.h (m4_arg_len): Add parameter.
728 (M4ARGLEN): Provide default for the parameter.
729 * m4/m4private.h (includes): Share xmemdup0.h among all libm4
731 * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
732 * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
733 * m4/symtab.c (includes): Likewise.
734 (m4_symbol_value_copy): Use xmemdup0.
735 * m4/module.c (install_macro_table): Likewise.
736 * src/freeze.c (reload_frozen_state): Likewise.
737 * tests/freeze.at (reloading nul): Enhance test.
738 * tests/null.m4: Likewise.
739 * tests/null.err: Update expected output.
740 * tests/null.out: Likewise.
742 Fix regression in commenting unbalanced quotes, from 2008-02-16.
743 * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
744 * m4/input.c (m4__next_token, m4_print_token): Supply new token
746 * m4/macro.c (expand_token): Penalize comments, as they can
747 contain unbalanced quotes; latent bug since 2007-12-07, exposed by
748 passing $@ references built from comments.
749 (expand_argument): Adjust caller.
750 * tests/others.at (Comments): Enhance test to catch it.
751 * NEWS: Mention the fix.
753 2008-07-30 Eric Blake <ebb9@byu.net>
755 Fix regression in trace output, introduced 2008-05-08.
756 * m4/input.c (m4__push_symbol): When cloning chains, break pointer
757 back to original chain; latent bug from 2008-02-02 that did not
758 cause misbehavior until trace output read unfinished chain.
759 * tests/builtins.at (debug): Add test for this.
761 2008-07-28 Eric Blake <ebb9@byu.net>
763 Optimize iteration examples.
764 * examples/forloop2.m4: Avoid excess indir, by passing current
765 counter value as parameter.
766 * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
768 * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
769 documentation to match.
771 2008-07-26 Eric Blake <ebb9@byu.net>
773 Give example for O(n) foreach on m4 1.4.x.
774 * examples/foreachq4.m4: New file.
775 * Makefile.am (dist_pkgdata_DATA): Distribute it.
776 * tests/others.at (recursion): Test it.
777 * doc/m4.texinfo (Improved foreach): Document linear foreach with
778 m4 1.4.5 and greater.
780 2008-07-19 Eric Blake <ebb9@byu.net>
782 Resynchronize docs from branch.
783 * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
784 name, particularly since the old documentation didn't match code.
785 (Standard Modules): Add caveat about using __m4_version__.
787 2008-07-11 Eric Blake <ebb9@byu.net>
789 Bump required automake to 1.10a; regression introduced 2008-01-22.
790 * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
791 1.10.1, since we also rely on pkglibexecdir.
792 * HACKING: Fix minimum requirement.
793 * bootstrap: Likewise.
795 Reported by Joel E. Denny.
797 Avoid bogus whitespace in @ovar, @dvar.
798 * doc/m4.texinfo (ovar, dvar): Add @c.
799 Based on patch by Ralf Wildenhues to Autoconf manual.
801 2008-06-23 Eric Blake <ebb9@byu.net>
803 Adjust to new gnulib-tool layout.
804 * ltdl/m4/gnulib-cache.m4: Reformat.
806 Fix bootstrap comment.
807 * bootstrap: DOWNLOAD_PO was previously removed.
809 2008-06-19 Eric Blake <ebb9@byu.net>
811 Revert speed regression from 2008-06-16.
812 * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
813 * modules/m4.c (numb_obstack): Likewise.
814 * m4/input.c (MATCH): Use fewer conditionals, and factor
816 (match_input): ...here for smaller code size.
817 * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
818 Supply trailing NUL to delimiters, to meet contract of faster
821 2008-06-18 Eric Blake <ebb9@byu.net>
824 * m4/m4module.h: Use consistent spacing for pointer parameters.
825 * m4/m4private.h: Likewise.
827 Stage 25b: Handle embedded NUL in changesyntax and friends.
828 Track quote and comment delimiters by length, to allow embedded
829 NUL. Improve changesyntax to support assigning syntax to NUL.
831 Speed impact: none noticed.
832 * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
834 (m4_reset_syntax): New prototype.
835 * m4/syntax.c (add_syntax_set, subtract_syntax_set)
836 (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
838 (m4_set_syntax): Likewise. Also, split code to reset the table...
839 (m4_reset_syntax): ...into a new function.
840 (m4_syntax_create): Adjust callers.
841 * m4/input.c (match_input, MATCH): Add parameter.
842 (m4__next_token, m4__next_token_is_open): Adjust callers.
843 * modules/m4.h (m4_expand_ranges_func): Add parameter.
844 * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
845 (changequote, changecom, translit, m4_expand_ranges): Track
847 * modules/gnu.c (changesyntax): Handle embedded NUL.
848 * src/freeze.c (reload_frozen_state): Adjust callers.
849 * tests/freeze.at (reloading nul): Enhance test.
850 * tests/null.m4: Likewise.
851 * tests/null.out: Update expected output.
852 * tests/null.err: Likewise.
854 2008-06-16 Eric Blake <ebb9@byu.net>
856 Stage 25a: Use obstack_printf for easier output.
857 Convert macro tracing and other locations to use obstack_printf
858 rather than hand-rolled equivalents. Ensure that embedded NUL in
859 trace output does not truncate the trace string.
861 Speed impact: noticeable penalty, from obstack_printf overhead.
862 * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
863 * m4/macro.c (trace_format): Delete; use obstack_printf instead.
864 (trace_header, trace_pre, trace_post): All callers updated.
865 * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
866 (m4_divert_text): Speed up syncline output.
867 * modules/m4.c (dumpdef): Handle embedded NUL.
868 (numb_obstack): Speed up eval output.
869 (maketemp): Use obstack_printf.
870 * modules/format.c (format): Likewise.
872 Add missing const qualifications.
873 * m4/resyntax.c (m4_resyntax_map): Declare array elements as
875 * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
876 * modules/import.c (m4_builtin_table): Likewise.
877 * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
878 * modules/m4.c (m4_builtin_table): Likewise.
879 * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
880 * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
881 * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
882 * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
883 * modules/stdlib.c (m4_builtin_table): Likewise.
884 * modules/time.c (m4_builtin_table): Likewise.
885 * modules/traditional.c (m4_macro_table): Likewise.
887 2008-06-10 Eric Blake <ebb9@byu.net>
889 Avoid corrupted frozen file if NUL appears on block boundary.
890 * m4/output.c (insert_file): Separate consecutive quotearg blocks
891 with \<newline>, in case last byte of first block was NUL.
893 2008-06-03 Eric Blake <ebb9@byu.net>
895 Fix printf type mismatches.
896 * m4/m4module.h (m4_bad_argc): Alter parameter type.
897 * m4/m4private.h (struct m4_call_info): Alter call_id type.
898 * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
900 * m4/utility.c (m4_bad_argc): Likewise.
902 Borrow bootstrap ideas from gnulib.
903 * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
904 advertized subset of languages didn't work. Use --skip-po
905 instead, for consistency with gnulib bootstrap.
906 (func_get_translations): Use rsync, not wget.
907 (func_update_po): Use a reference directory, to avoid changing
908 timestamps on unchanged .po files.
909 * TODO: Update accordingly.
911 Fix fallout from previous patch.
912 * doc/m4.texinfo (Builtin): Adjust expected output.
914 2008-06-02 Eric Blake <ebb9@byu.net>
916 Stage 24c: Improve display of macro names with embedded NUL.
917 Quote instances of problematic characters in macro names when
918 presented to user. Track location via call_info rather than
919 munging context for every expansion.
921 Speed impact: slight penalty, due to more bookkeeping.
922 * m4/m4module.h (m4_push_string_init): Add parameters.
923 * m4/m4private.h (struct m4_macro_args): Remove argv0 and
924 argv0_len, now redundant with info.
925 (m4__push_wrapup_init): Add parameter.
926 * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
927 location from caller, rather than context.
928 (composite_peek, composite_read, match_input): Adjust callers.
929 * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
930 (m4_verror_at_line): Allow NUL in macro name.
931 * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
933 (expand_macro): No longer munge context location.
934 (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
935 (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
936 * modules/gnu.c (builtin, indir): Likewise.
937 * tests/null.m4: Enhance test.
938 * tests/null.err: Adjust expected output.
939 * tests/null.out: Likewise.
941 Stage 24b: Allow embedded NUL in macro names.
942 Use length rather than NUL-termination when tracking macro names.
943 All APIs dealing with symbol table changed.
945 Speed impact: slight penalty, due to more bookkeeping.
946 * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
947 (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
948 (m4_symbol_rename, m4_symbol_delete): Add length parameter.
949 (m4_string): New type.
950 * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
951 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
953 * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
954 (m4__symtab_remove_module_references, symbol_destroy_CB)
955 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
956 (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
957 (m4_symbol_delete): Likewise.
958 * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
960 * m4/macro.c (expand_token): Adjust all callers.
961 * m4/module.c (install_builtin_table, install_macro_table):
963 * m4/utility.c (m4_symbol_value_lookup): Likewise.
964 * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
965 * modules/m4.c (define, undefine, pushdef, popdef)
966 (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
967 (traceon, traceoff): Likewise.
968 * src/main.c (main): Likewise.
969 * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
970 * tests/freeze.at (reloading nul): Augment test.
971 * tests/null.out: Adjust expected output.
973 Stage 24a: Use full call context in error reporting.
974 Replace const char *macro_name with const m4_call_info *call, so
975 that the next patch can pass the length of macro_name with
976 embedded NUL. Simplifies handling of global state.
978 Speed impact: none noticed.
979 * m4/m4module.h (m4_error, m4_warn): Change parameter type.
980 (m4_error_at_line, m4_warn_at_line): Delete.
981 (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
982 (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
983 * m4/m4private.h (m4__next_token): Likewise.
984 * m4/utility.c (m4_verror_at_line): Alter parameter, and use
985 caller's location if caller is provided.
986 (m4_error, m4_warn): Change parameter type.
987 (m4_error_at_line, m4_warn_at_line): Delete.
988 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
989 (m4_symbol_value_lookup): Adjust all callers.
990 * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
991 * m4/input.c (m4_skip_line, m4__next_token): Likewise.
992 * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
993 (process_macro): Likewise.
994 * modules/m4.h (m4_make_temp_func): Likewise.
995 * modules/evalparse.c (m4_evaluate): Likewise.
996 * modules/format.c (arg_int, arg_long, arg_double, format):
998 * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
999 (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
1000 (renamesyms, syncoutput, regexp_compile, substitute)
1001 (regexp_substitute, m4_resyntax_encode_safe): Likewise.
1002 * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
1003 (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
1004 (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
1006 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
1007 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
1009 * tests/options.at (--syncoutput): Add test for invalid
1010 command-line argument. Split xfailed portion...
1011 (--syncoutput and diversions): ...into new test.
1012 (unknown option): New test.
1013 * tests/freeze.at (reloading unknown builtin): Update expected
1016 Adjust to recent gnulib change.
1017 * configure.ac (AB_INIT): Delete, now that gnulib does this.
1019 2008-05-28 Eric Blake <ebb9@byu.net>
1021 Improve frozen debugmode behavior.
1022 * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
1023 * src/main.c (main): Interleave -d with files.
1024 * tests/options.at (--debugmode): Update test.
1025 * tests/freeze.at (reloading debugmode): New test.
1026 * doc/m4.texinfo (Debugging options, Debugmode): Document the
1030 2008-05-27 Eric Blake <ebb9@byu.net>
1032 Fix some testsuite failures on Solaris 8.
1033 * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
1035 * tests/others.at (stderr closed): Likewise. Also support Solaris
1037 (stdin closed): Skip test if closed stdin gets reopened.
1038 (stdout closed): Support Solaris wording for EBADF.
1039 * tests/testsuite.at (AT_CHECK_M4): Likewise.
1041 Fix configure message nesting, broken since 2001-09-20.
1042 * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
1043 not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
1045 Support 'make dist' with BSD make.
1046 * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
1047 of the generated file tests/generated.at.
1048 (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
1049 * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
1051 2008-05-24 Eric Blake <ebb9@byu.net>
1053 Test NUL in frozen files.
1054 * tests/testsuite.at (AT_CHECK_M4): Add parameter.
1055 * tests/freeze.at (reloading nul): New test.
1056 (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
1057 (reloading unknown builtin): Likewise.
1059 2008-05-23 Eric Blake <ebb9@byu.net>
1061 Improve handling of frozen file errors.
1062 * src/freeze.c (produce_frozen_state): Detect write failures.
1063 (reload_frozen_state): Use close_stream.
1064 * tests/freeze.at (freezing failure): New test.
1066 Reported by Jean-Charles Longuet.
1068 2008-05-19 Eric Blake <ebb9@byu.net>
1070 In frozen file, split consecutive strings with newline.
1071 * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
1072 (produce_frozen_state): Likewise for 'Q', 'C'.
1073 (reload_frozen_state): Parse the new layout.
1074 [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
1075 * tests/freeze.at (loading format 2): Rewrite to new format.
1076 (reloading unknown builtin): Likewise.
1077 (loading format 1): Make sure backslash-newline is not
1079 * doc/m4.texinfo (Frozen file format 2): Document the format.
1080 * NEWS: Document this change.
1082 Fix xgettext options.
1083 * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
1086 Fix spelling of René Seindal's name in --version output.
1087 * ltdl/m4/gnulib-cache.m4: Import propername module.
1088 * src/main.c (AUTHORS): Rewrite in terms of proper_name.
1089 * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
1090 * HACKING: Mention new prerequisite of gperf.
1092 2008-05-18 Eric Blake <ebb9@byu.net>
1094 Allow freezing the trace status of macros.
1095 * src/freeze.c (produce_symbol_dump): Let undefined traced macros
1097 (dump_symbol_CB): Also freeze trace state.
1098 * tests/freeze.at (reloading traced macros): New test.
1099 * doc/m4.texinfo (Using frozen files): Update documentation to
1101 (Frozen file format 1): Improve synchronization with branch.
1102 (Frozen file format 2): Reorder directives, and add `d', `t'.
1103 * NEWS: Document this change.
1105 2008-05-15 Eric Blake <ebb9@byu.net>
1107 Fix frozen file regression in pushdef stacks from 2001-09-01.
1108 * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
1109 just the current definition.
1110 (reverse_symbol_value_stack): New helper method.
1111 * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
1112 (reloading pushdef stack): New test.
1113 (reloading unknown builtin): Enhance test.
1115 2008-05-13 Eric Blake <ebb9@byu.net>
1117 Fix frozen file regression in diversions from 2007-01-21.
1118 * m4/output.c (insert_diversion_helper): Add parameter.
1119 (m4_insert_file): Move contents...
1120 (insert_file): ...to this new helper, with added parameter.
1121 (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
1123 * src/freeze.c (produce_mem_dump): Simplify.
1124 * tests/freeze.at (large diversion): Test for this.
1126 Improve error message when frozen file is invalid.
1127 * src/freeze.c (decode_char): Add parameter. Allow \<newline>
1129 (reload_frozen_state): Track current line.
1130 * tests/freeze.at (loading format 1, loading format 2): Update to
1133 2008-05-10 Eric Blake <ebb9@byu.net>
1135 Detect integer overflow when loading frozen file.
1136 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
1137 immediately on overflow.
1138 * tests/freeze.at (loading format 2): Test this.
1139 Reported by Jim Meyering.
1141 2008-05-08 Eric Blake <ebb9@byu.net>
1143 Stage 23: allow tracing of indirect macro calls.
1144 Track all trace information as part of the argv struct, rather
1145 than temporarily resetting global state. Teach indir to trace
1146 macros that it invokes.
1147 Memory impact: slight penalty, due to larger argv struct.
1148 Speed impact: none noticed.
1149 * m4/m4module.h (m4_input_block): Remove.
1150 (m4_call_info): New opaque type.
1151 (m4_trace_prepare, m4_arg_info): New prototypes.
1152 (m4_macro_call, m4_push_string_finish, m4_input_print): Change
1154 * m4/m4private.h (struct m4_macro_args): Add info field.
1155 (struct m4_call_info): New structure.
1156 (m4_arg_info): New accessor.
1157 * m4/input.c (m4_input_block): Make typedef local.
1158 (m4_push_string_init): Initialize length.
1159 (m4_push_string_finish, m4_input_print): Change signature, so that
1160 printing can be done before finalization.
1161 (struct input_funcs): Add parameter to print_func.
1162 (file_print, string_print, composite_print): Adjust accordingly.
1163 * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
1164 Change signatures for stacked trace messages, and for using call
1166 (trace_prepre): Export and rename...
1167 (m4_trace_prepare): ...to this, for use by indir. Alter signature
1168 to use call context.
1169 (collect_arguments): Alter signature, to manage new field.
1170 (expand_macro): Change call context management. Move tracing...
1171 (m4_macro_call): ...here. Remove redundant parameter.
1172 (m4_arg_argc): New function.
1173 (m4_make_argv_ref): Replace unused skip parameter with new trace
1174 parameter; manage new field.
1175 * modules/gnu.c (builtin, indir): Adjust callers.
1176 * src/main.c (usage): Update debugmode flag summary.
1177 * tests/null.m4: Enhance test.
1178 * tests/null.err: Update expected output.
1179 * tests/macros.at (Tracing Hanoi Towers): Likewise.
1180 * doc/m4.texinfo (Trace): Mention more about trace formatting.
1181 (Debugmode): Enhance description of 'c' and 'x'. Enhance test to
1182 cover line numbering details in traces.
1183 (Debuglen): Enhance test to cover indir tracing.
1184 * NEWS: Mention these changes.
1185 Reported by Akim Demaille in the autoconf TODO file in 2000.
1187 2008-05-07 Eric Blake <ebb9@byu.net>
1189 Test for traceon regression just fixed in branch-1.6.
1190 * doc/m4.texinfo (Trace): Enhance test.
1191 * NEWS: Port news item from branch.
1193 2008-05-05 Eric Blake <ebb9@byu.net>
1195 Stage 22: allow builtin token concatenation outside $@.
1196 Adjust the input and argument parsing engines to append builtins
1197 alongside text. Make define warn when builtins must be
1199 Memory impact: slight penalty, with fewer builtins flattened.
1200 Speed impact: slight penalty, from more bookkeeping.
1201 * m4/m4module.h (m4_is_arg_composite): New prototype.
1202 (m4_symbol_value_copy): Change return type.
1203 (m4_arg_text): Add parameter.
1204 (M4ARG): Adjust callers.
1205 * m4/m4private.h: Adjust comments.
1206 * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
1208 * m4/input.c (init_builtin_token): Add parameter, and allow
1209 concatenating builtins.
1210 (m4__next_token): Adjust caller.
1211 * m4/macro.c (m4_is_arg_composite): New function.
1212 (expand_argument): Allow builtin concatenation.
1213 (m4_arg_text): Add parameter.
1214 (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
1215 (m4_arg_equal): Fix comparison of builtin tokens.
1216 * modules/m4.c (define, pushdef): Warn when flattening builtins.
1217 * doc/m4.texinfo (Define): Remove dead comment.
1218 (Defn): Update to reflect code changes.
1219 * tests/builtins.at (defn): Remove xfail.
1220 * NEWS: Document this change.
1222 2008-05-03 Eric Blake <ebb9@byu.net>
1224 Document define_blind.
1225 * doc/m4.texinfo (Ifelse): Add a new composite macro.
1227 Suggested by Mike R.
1229 2008-05-01 Eric Blake <ebb9@byu.net>
1231 Avoid -Wshadow compiler warnings.
1232 * m4/output.c (threshold_diversion_CB): s/div/diversion/.
1233 * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
1234 (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
1235 (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
1236 (m4_push_arg, m4__push_arg_quote): s/index/arg/.
1237 * modules/format.c (format): Likewise.
1238 * modules/m4.c (ifelse): Likewise.
1240 Improve debugmode testing, based on recent branch-1.6 regressions.
1241 * doc/m4.texinfo (Debugmode): Enhance tests.
1242 * tests/generate.awk: Run tests from stdin, not input.m4. Support
1243 stderr munging when using -I examples.
1245 Fix regression in define from 2008-02-22.
1246 * m4/m4module.h (m4_symbol_value_copy): Add parameter.
1247 * m4/symtab.c (m4_symbol_value_copy): Support copying $@
1249 * m4/macro.c (expand_argument): Update callers.
1250 * modules/m4.c (define, pushdef): Likewise.
1251 * tests/builtins.at (define): Enhance test to catch this.
1253 2008-04-21 Eric Blake <ebb9@byu.net>
1255 Simplify previous patch.
1256 * tests/m4.in: Compress assignment.
1257 Suggested by Gary V. Vaughan.
1259 Fix --disable-shared testsuite regression from previous patch.
1260 * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
1263 Fix spelling of attribution to Christopher Strachey.
1264 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
1266 Reported by Fernando Carrijo.
1268 2008-04-17 Eric Blake <ebb9@byu.net>
1270 Fix testsuite bug when SIGPIPE is ignored.
1271 * tests/builtins.at (divert): Consume all of m4's output, to avoid
1272 spurious write failure.
1273 * src/main.c (main): In batch mode, restore default handling of
1275 * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
1277 Reported by Bob Proulx, via his autobuilder.
1279 2008-04-15 Eric Blake <ebb9@byu.net>
1281 Fix 'make installcheck' after './configure --prefix-progname'.
1282 * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
1284 (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
1285 * tests/builtins.at (patsubst): Avoid space-tab.
1286 (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
1287 * tests/options.at (--debugfile): Likewise.
1288 * tests/others.at (stdin seekable): Likewise.
1289 (fstab): Avoid space-tab.
1290 * Makefile.am (installcheck-local): Accomodate transformed name.
1291 (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
1292 during 'make distcheck'.
1293 * cfg.mk: New file, borrowed from branch.
1295 Update prerequisite tools to match recent releases.
1296 * configure.ac (AC_PREREQ): Rely on released autoconf.
1297 (LT_PREREQ): Rely on released libtool.
1298 * tests/testsuite.at (m4_version_prereq): Update dependence.
1299 * bootstrap: Mention prerequisites.
1301 Work around OS/2 limitation of printf(1).
1302 * tests/null.m4: Use m4, not printf, to generate NUL byte.
1303 * tests/null.out: Check for esyscmd failure.
1304 Reported by Elbert Pol.
1306 2008-04-14 Eric Blake <ebb9@byu.net>
1308 Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
1309 Improve arg_print to handle builtin tokens when printing to a
1310 known chain, rather than always flattening builtins. This allows
1311 m4wrap and $@ back-references to handle embedded builtin tokens.
1312 Memory impact: none.
1313 Speed impact: slight penalty, from more bookkeeping.
1314 * m4/m4module.h (m4_push_builtin): Add parameter.
1315 (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
1316 (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
1317 * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
1318 (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
1319 ...to these, in some cases adding a parameter.
1320 (m4__append_builtin): New prototype.
1321 * m4/builtin.c (m4_builtin_print): Alter signature to print
1322 builtin to a growing symbol chain.
1323 * m4/symtab.c (m4__symbol_value_print): Alter signature.
1324 (m4_symbol_print, dump_symbol_CB): Adjust callers.
1325 * m4/input.c (builtin_peek, builtin_read, builtin_unget)
1326 (builtin_print, builtin_funcs): Delete, handled via composite
1328 (struct m4_input_block): Delete u.builtin member.
1329 (init_builtin_token): Only use composite block.
1330 (m4__append_builtin): New function.
1331 (m4_push_builtin, m4__push_wrapup_init): Alter signature.
1332 (m4__push_symbol): Allow builtin tokens.
1333 (m4__push_wrapup_finish): Rename.
1334 (composite_print, m4_print_token): Adjust callers.
1335 * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
1337 (m4__arg_print): Alter signature.
1338 (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
1340 * modules/m4.c (m4wrap): Allow builtin tokens.
1341 (defn, errprint): Adjust callers.
1342 * modules/gnu.c (builtin): Likewise.
1343 * doc/m4.texinfo (M4wrap): New test.
1344 (Debuglen): Adjust expected output.
1346 Stage 21a: Optimize checks for end of input.
1347 Create a new polymorphic input block type, which always fails with
1348 CHAR_EOF, so that remaining input routines no longer have to check
1349 for NULL input block.
1350 Memory impact: none.
1351 Speed impact: noticeable improvement, from fewer conditionals.
1352 * m4/input.c (eof_funcs, input_eof): New objects.
1353 (eof_peek, eof_read, eof_unget): New functions.
1354 (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
1355 (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
1356 (m4_input_exit): Use placeholder to guarantee non-NULL isp and
1358 (next_char): Rename retry to allow_unget, and change sense for
1359 easier manipulation. All callers changed.
1361 Improve OS/2 detection.
1362 * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
1363 are defined, not just the first. The testsuite ensures that
1364 exactly one gets defined.
1365 * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
1366 what other pre-defined macros it has.
1368 Reported by Elbert Pol.
1370 Ensure __m4_version__ is unquoted.
1371 * tests/builtins.at (__m4_@&t@version__): Augment test.
1373 Avoid GNU make failure on tarball.
1374 * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
1376 2008-04-10 Eric Blake <ebb9@byu.net>
1378 Allow back-referenced macro names; fixes 2008-03-13 regression.
1379 * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
1380 * m4/utility.c (m4_symbol_value_lookup): Change signature.
1381 * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
1383 * tests/others.at (ifndef): New test.
1385 Be namespace clean for M4 version; fixes 2008-04-08 regression.
1386 * configure.ac (version): Rename...
1387 (M4_VERSION): ...to this, since using 'version' broke po.m4.
1389 2008-04-09 Eric Blake <ebb9@byu.net>
1391 Mention 1.4.11 release.
1392 * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
1393 (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
1394 (Format): Add test of C99 hex-float parsing.
1395 * NEWS: Mention 1.4.11 release.
1396 * tests/builtins.at (divert): Add additional test.
1398 2008-04-08 Eric Blake <ebb9@byu.net>
1400 Overhaul inter-version releases to work with git.
1401 * configure.ac (version): New variable, which has nicer version
1402 contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
1403 (TIMESTAMP): Delete, since CVS id expansion died with transition
1405 (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
1406 * build-aux/mkstamp: Delete, no longer used.
1407 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
1408 rebuilds when timestamps don't matter.
1409 (MKSTAMP): Delete, no longer used.
1410 (EXTRA_DIST): No longer worry about mkstamp.
1411 (.version): New rule and distributed file.
1412 (doc/m4.1, tests/package.m4): Depend on .version, not
1413 configure.ac, for timestamp.
1414 * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
1415 * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
1416 * src/main.c (main): Likewise.
1418 2008-03-28 Eric Blake <ebb9@byu.net>
1420 Use GNUmakefile module.
1421 * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1422 * Makefile.am: Split off maintainer rules...
1423 * maint.mk: ...into this new file.
1425 2008-03-18 Eric Blake <ebb9@byu.net>
1427 Stage 20b: make m4wrap obey POSIX fifo ordering.
1428 Improve input engine to support location changes within symbol
1429 chains, then convert m4wrap to always build symbol chain.
1430 Memory impact: none.
1431 Speed impact: slight penalty, from more m4wrap bookkeeping.
1432 * m4/m4module.h (m4_wrap_args): Add prototype.
1433 * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1434 (struct m4__symbol_chain): Add struct u_l.
1435 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1437 (composite_peek, composite_read, composite_clean): Handle location
1439 * m4/macro.c (m4_wrap_args): New function.
1440 * modules/m4.c (m4wrap): Use it.
1441 * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1442 (Extensions): Document extension of multiple arguments.
1443 (Location, Improved m4wrap): Adjust example to match FIFO order.
1444 * tests/builtins.at (wrap): Likewise.
1445 * NEWS: Document this change.
1447 2008-03-17 Eric Blake <ebb9@byu.net>
1449 Stage 20a: reduce unget's in input engine.
1450 Now that out-of-range input placeholders like CHAR_BUILTIN are
1451 consumed outside of next_char, next_token should always consume
1452 rather than peek at the first character. Fewer peeks results in
1453 less ungetc overhead.
1454 Memory impact: none.
1455 Speed impact: noticeable improvement, from fewer function calls.
1456 * m4/input.c (struct input_funcs): Alter read_func prototype.
1457 (next_char, file_read, buildin_read, string_read, composite_read):
1458 Add allow_argv parameter.
1459 (init_builtin_token, init_argv_symbol): Require all prior input to
1461 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1462 (m4__next_token): Consume first byte without peek.
1464 Update for fresh bootstrap.
1465 * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1467 2008-03-15 Eric Blake <ebb9@byu.net>
1469 Document join, in order to fix bug in m4wrap example.
1470 * examples/join.m4: New file.
1471 * examples/wraplifo2.m4: Likewise.
1472 * Makefile.am (EXTRA_DIST): Add new files.
1473 * doc/m4.texinfo (Improved m4wrap): New node.
1474 (Defn, Location): Enhance tests.
1475 (Shift): Document the composite macro join.
1476 (Incompatibilities): Move documentation of LIFO vs. FIFO...
1477 (M4wrap): ...here, to match improved example.
1479 2008-03-13 Eric Blake <ebb9@byu.net>
1481 Stage 19c: allow builtin tokens in more macros.
1482 Allow builtin tokens inside symbol chains, although for now, they
1483 are not allowed inside comments or quotes. Enable builtin token
1484 handling in more macros, if only to consistently diagnose invalid
1486 Memory impact: none.
1487 Speed impact: slight impact, due to more bookkeeping.
1488 * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1490 * m4/m4private.h (enum m4__symbol_chain_type): Add
1492 (struct m4__symbol_chain): Add builtin member.
1493 * m4/utility.c (m4_symbol_value_lookup): New method.
1494 * m4/builtin.c (m4_builtin_print): New function.
1495 * m4/symtab.c (m4_symbol_value_print): Use it.
1496 * m4/input.c (builtin_print): Likewise.
1497 (m4__push_symbol): Allow pushing builtin tokens.
1498 (composite_peek, composite_read, composite_unget, composite_clean)
1499 (composite_print): Handle builtin tokens.
1500 (init_builtin_token): Allow builtin tokens from composite input.
1501 (m4__next_token): Flatten builtins inside comment or string.
1502 * m4/macro.c (expand_argument): Strengthen assertion.
1503 (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1504 Handle builtin tokens.
1505 (arg_symbol): Add parameter, and allow NULL level.
1506 (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1507 (m4_arg_text): Ensure all builtins have been flattened.
1508 * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1509 (undefine, m4_dump_symbols): Warn on invalid macro names.
1510 (ifdef, ifelse, shift): Handle builtin tokens.
1511 * modules/gnu.c (m4symbols): Likewise.
1512 * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1514 (Debuglen): Likewise, and remove xfail.
1515 * NEWS: Mention the change.
1517 Stage 19b: invert sense of bit for handling builtin tokens.
1518 Pass builtin tokens by default, rather than as the exception, so
1519 that the logic can consistently refer to flattening arguments.
1520 Memory impact: none.
1522 * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1523 (M4_BUILTIN_GROKS_MACRO): Rename...
1524 (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1525 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1526 (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1528 * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1529 (m4_symbol_value_groks_macro): Likewise...
1530 (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1532 * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1533 (m4_symbol_value_flatten_args): ...to this.
1534 * m4/macro.c (collect_arguments): Accomodate changed sense.
1535 * m4/module.c (m4__module_open): Require arguments if flattening
1537 * m4/input.c (m4_push_string_finish): For now, flatten all
1538 builtins pushed as back-references.
1539 * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1540 * modules/import.c (m4_builtin_table): Likewise.
1541 * modules/load.c (m4_builtin_table): Likewise.
1542 * modules/modtest.c (m4_builtin_table): Likewise.
1543 * modules/mpeval.c (m4_builtin_table): Likewise.
1544 * modules/perl.c (m4_builtin_table): Likewise.
1545 * modules/shadow.c (m4_builtin_table): Likewise.
1546 * modules/stdlib.c (m4_builtin_table): Likewise.
1547 * modules/time.c (m4_builtin_table): Likewise.
1548 * modules/m4.c (m4_builtin_table): Likewise.
1549 (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1550 are stringized without preprocessor expansion.
1551 * doc/m4.texinfo (Defn): Update comments to match reality.
1552 (Debuglen): Update test now that user macros pass builtin tokens.
1554 Stage 19a: sort and cache builtins loaded by a module.
1555 Rather than repeatedly using dlsym to browse the builtin table,
1556 copy off the table at module load time. Then, the input engine
1557 merely refers to the copy instead of duplicating information.
1558 Memory impact: slight penalty, due to more memory per module, but
1559 offset by less memory in input engine.
1560 Speed impact: slight improvement, due to faster builtin lookups.
1561 * m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
1562 m4_builtin_find_by_* instead.
1563 (m4_builtin_find_by_func): Change return type.
1564 * m4/m4private.h (m4__builtin): New struct.
1565 (m4_module): Add sorted list of loaded builtins.
1566 (struct m4_symbol_value): Change type of builtin value.
1567 (m4__set_symbol_value_builtin): New prototype and fast accessor.
1568 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1570 * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1571 (m4__set_symbol_value_builtin): ...and populate additional fields,
1573 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1575 * m4/module.c (install_builtin_table): Use cached table.
1576 (compare_builtin_CB): New helper function.
1577 (m4__module_open): Populate table.
1578 (module_remove): Free table.
1579 * m4/builtin.c (compare_builtin_name_CB): New helper function.
1580 (m4_builtin_find_by_name): Rewrite to use sorted table.
1581 (m4_builtin_find_by_func): Change return type.
1582 * m4/input.c (struct m4_input_block): Simplify u_b, since most
1583 fields can be determined from builtin.
1584 (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1585 (m4__next_token): Alter parsing so that only init_builtin_token
1587 (builtin_print, m4_push_builtin): Adjust all users.
1588 * tests/macros.at (Arity, defn, and freeze): Fix typo.
1590 Consistently cast malloc results, for C++ compilation.
1591 * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1592 * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1593 (m4_hash_resize, maybe_grow): Likewise.
1594 * m4/m4.c (m4_create): Likewise.
1595 * m4/macro.c (expand_macro): Likewise.
1596 * m4/output.c (m4_tmpname): Likewise.
1597 * m4/path.c (search_path_add): Likewise.
1598 * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1599 (symtab_fetch): Likewise.
1600 * m4/syntax.c (m4_syntax_create): Likewise.
1601 * modules/gnu.c (regexp_compile): Likewise.
1602 * src/main.c (main): Likewise.
1603 * src/freeze.c (reload_frozen_state): Likewise.
1605 2008-03-06 Eric Blake <ebb9@byu.net>
1607 Fix nested builtin(`shift',$@) regression from 2008-02-23.
1608 * m4/macro.c (make_argv_ref): Don't output expansion text when
1609 making wrapper for builtin or indir.
1610 * tests/builtins.at (builtin): New test.
1611 * NEWS: Document the fix.
1612 Reported by Andreas Schwab.
1614 2008-03-04 Eric Blake <ebb9@byu.net>
1616 The gnulib module free was deprecated.
1617 * ltdl/m4/gnulib-cache.m4: Remove free module.
1619 2008-02-29 Eric Blake <ebb9@byu.net>
1621 Import news from 1.4.10b.
1622 * NEWS: Update from branch.
1624 2008-02-23 Eric Blake <ebb9@byu.net>
1626 Stage 18: try harder to reuse argv in recursion.
1627 When pushing arguments that contain an existing $@ ref, reuse the
1628 ref rather than creating another layer of wrappers.
1629 Memory impact: noticeable improvement, due to better $@ reuse.
1630 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1631 reduction in unboxed recursion.
1632 * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1633 (m4_push_args): Let make_argv_ref take care of pending data.
1634 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1635 performance capability.
1636 * tests/others.at (recursion): Add tests to avoid performance
1639 2008-02-22 Eric Blake <ebb9@byu.net>
1642 * NEWS: Document change to __gnu__ on 2008-02-11.
1644 Stage 17: pass argv through quoted strings.
1645 Allow the concatenation of $@ references with other text input
1646 inside quoted contexts, which requires distinguishing between a
1647 wrapper around many arguments vs. a reference serving as part of a
1648 single argument. Also optimize based on whether argv contains
1649 builtin tokens that might need flattening to the empty string.
1650 Memory impact: noticeable improvement, due to O(n^2) to O(n)
1651 reduction from total reuse of $@ references.
1652 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1653 reduction in boxed recursion.
1654 * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1655 (M4ARGLEN): Adjust definition.
1656 * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1657 (struct m4_symbol_value): Add wrapper and has_func members.
1658 (struct m4_macro_args): Add flatten and has_func members.
1659 * m4/input.c (append_quote_token): Return argv refs inside quoted
1661 (init_argv_symbol): Populate new fields.
1662 * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1663 (m4_make_argv_ref): Likewise.
1664 (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1666 (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1668 * modules/m4.c (ifelse): Adjust caller.
1670 2008-02-22 Gary V. Vaughan <gary@gnu.org>
1672 Fix regression in argument collection, from 2008-01-21.
1673 * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1674 undo argument collection optimisation for strings, so that
1675 m4_print_token doesn't abort when it otherwise receives an
1676 unprintable M4_SYMBOL_VOID type token.
1678 2008-02-20 Eric Blake <ebb9@byu.net>
1680 Stage 16: cache quotes and improve m4_arg_print.
1681 Cache rather than always copying quotes when pushing $@ refs; in
1682 particular, reconstruct single-byte quotes on the fly. Allow NUL
1683 through m4wrap. Improve sharing of code that prints arguments.
1684 Memory impact: slight improvement, due to cached quotes.
1685 Speed impact: slight improvement, due to less copying.
1686 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
1687 (m4_arg_print): Adjust prototypes.
1688 (m4_dump_args): Delete.
1689 (m4_push_wrapup): Split...
1690 (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
1692 * m4/m4private.h (struct m4_syntax_table): Add cached_quote
1694 (m4__quote_cache, m4__quote_uncache): New prototypes.
1695 * m4/syntax.c (m4_syntax_create): Initialize the cache.
1696 (m4__quote_cache): New function.
1697 (m4_set_syntax): Update caller.
1698 * m4/symtab.c (m4_symbol_value_print): Add parameter.
1699 (m4_symbol_print, dump_symbol_CB): Adjust all callers.
1700 * m4/utility.c (m4_dump_args): Delete; callers should use
1701 m4_arg_print instead.
1702 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
1703 implementation, and allow embedded NUL.
1704 (m4_print_token, pop_input, composite_print, composite_peek):
1705 (composite_read, append_quote_token): Adjust all callers.
1706 * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
1708 (m4_arg_print): Add parameters.
1709 (trace_pre): Rewrite in terms of m4_arg_print.
1710 * modules/m4.c (errprint): Likewise.
1711 (m4wrap): Rewrite to allow embedded NUL.
1712 (dumpdef): Adjust caller.
1713 * doc/m4.texinfo (Debuglen): Enhance debuglen test.
1714 * tests/null.m4: Test for NUL in m4wrap.
1715 * tests/null.out: Update expected output.
1717 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
1718 * m4/utility.c (m4_verror_at_line): Properly terminate the string.
1719 Reported by Ralf Wildenhues.
1721 * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
1723 2008-02-19 Eric Blake <ebb9@byu.net>
1725 Clean up example on filtering defined symbols.
1726 * doc/m4.texinfo (Foreach, Improved foreach): Document another
1727 shortcoming in foreach.m4, and improve filter example by using
1730 * src/main.c (usage): Fix typo.
1732 2008-02-18 Eric Blake <ebb9@byu.net>
1734 Avoid some magic numbers.
1735 * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
1736 (CHAR_RETRY): Define in terms of UCHAR_MAX.
1737 * m4/syntax.c (m4_syntax_create, set_syntax_set)
1738 (reset_syntax_set, check_is_single_quotes)
1739 (check_is_single_comments, check_is_macro_escaped)
1740 (m4_set_quotes, m4_set_comment): Likewise.
1741 * modules/gnu.c (regexp_compile): Likewise.
1742 * modules/m4.c (translit): Likewise.
1743 * src/freeze.c (produce_syntax_dump): Likewise.
1744 Reported by Ralf Wildenhues.
1746 2008-02-16 Eric Blake <ebb9@byu.net>
1748 Add regression test for multi-character quote recursion.
1749 * examples/foreach2.m4: Use $0 rather than spelling out name.
1750 * examples/foreachq2.m4: Likewise.
1751 * examples/forloop2.m4: Likewise.
1752 * examples/hanoi.m4: Likewise.
1753 * examples/trace.m4: Likewise.
1754 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1755 (Improved foreach): Adjust dump from file.
1757 Stage 15: return argv refs back to collect_arguments.
1758 Collect an entire $@ reference at once rather than one argument at
1759 a time, outside of quotes (but inside quotes, $@ is still
1760 flattened for now). The skip_last field allows concatenation of
1761 $@ with other text when collecting arguments.
1762 Memory impact: noticeable improvement, due to better reuse of $@.
1763 Speed impact: noticeable improvement, due to less parsing.
1764 * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
1765 (enum m4__token_type): Add M4_TOKEN_ARGV.
1766 (struct m4__symbol_chain): Add skip_last member to argv link.
1767 (m4__next_token): Add parameter.
1768 * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
1769 (composite_peek, m4__next_token): Add new parameter.
1770 (composite_read, append_quote_token): Support argv in quotes.
1771 (init_argv_symbol): New function.
1772 (m4__push_symbol, match_input, consume_syntax)
1773 (m4__next_token_is_open, m4_print_token): Adjust callers.
1774 * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
1775 (arg_mark, m4_arg_text, make_argv_ref): Likewise.
1776 (expand_argument, collect_arguments): Handle new token.
1777 (arg_symbol): Drill through $@ reference.
1778 * m4/syntax.c (set_quote_age): Detect disabled comments.
1779 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
1781 2008-02-15 Eric Blake <ebb9@byu.net>
1783 * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
1785 2008-02-13 Eric Blake <ebb9@byu.net>
1787 Fix texinfo grammar.
1788 * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
1789 (History): Use @: after abbreviations.
1790 (M4exit): Use correct Latin abbreviation.
1791 (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
1794 2008-02-11 Eric Blake <ebb9@byu.net>
1796 Allow builtin text macros to specify number of arguments.
1797 * m4/m4module.h (struct m4_macro): Add argument limits to builtin
1799 * m4/module.c (install_macro_table): Allow text macros to warn on
1801 * modules/gnu.c (m4_macro_table): Update all clients.
1802 * modules/load.c (m4_macro_table): Likewise.
1803 * modules/mpeval.c (m4_macro_table): Likewise.
1804 * modules/perl.c (m4_macro_table): Likewise.
1805 * modules/shadow.c (m4_macro_table): Likewise.
1806 * modules/traditional.c (m4_macro_table): Likewise.
1807 * modules/modtest.c (m4_macro_table): Likewise. Also add text
1808 macros, for testing this.
1809 * doc/m4.texinfo (Standard Modules): Update text, and enhance
1811 * tests/modules.at (modules: text): New test.
1813 Fix regression in command line -D option, from 2006-08-25.
1814 * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
1815 * m4/m4module.h: Fix typo.
1816 * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
1818 * tests/macros.at (Command line define): Enhance test.
1819 * tests/others.at (nul character): Enhance test.
1820 * tests/null.m4: Likewise.
1821 * tests/null.out: Likewise.
1823 Use gnulib's git-merge-changelog driver when available.
1824 * .gitattributes: Add merge attributes for ChangeLog.
1825 * bootstrap: Install driver, if not already present.
1827 2008-02-06 Eric Blake <ebb9@byu.net>
1829 Fix security hole introduced 2007-11-23.
1830 * m4/utility.c (m4_verror_at_line): Properly escape macro names.
1831 * src/main.c (main): Manage quoteargs defaults.
1832 * doc/m4.texinfo (Indir): Document and test this.
1834 Using raw strtod is not portable.
1835 * ltdl/m4/gnulib-cache.m4: Import the strtod module.
1837 2008-02-02 Eric Blake <ebb9@byu.net>
1839 Consistently use size_t for number of arguments.
1840 * m4/m4module.h (m4_builtin_func): Alter prototype.
1841 (struct m4_builtin): Adjust type of min_args, max_args.
1842 (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
1843 (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
1844 (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
1845 (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
1846 (m4_arg_print, m4_push_arg): Adjust all clients.
1847 * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
1848 (m4_macro_args): Adjust type of various fields.
1849 (m4__push_arg_quote): Adjust all clients.
1850 * m4/input.c (m4_pop_wrapup): Likewise.
1851 * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
1852 (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
1853 (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
1854 (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
1855 (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
1856 * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
1857 * modules/evalparse.c (m4_evaluate): Likewise.
1858 * modules/gnu.c (changesyntax): Likewise.
1859 * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
1860 (undivert, traceon, traceoff): Likewise.
1861 * modules/m4.h (m4_dump_symbols_func): Likewise.
1862 * modules/perl.c (perleval): Likewise.
1864 Stage 14b: allow pushing argv references.
1865 Push a $@ reference to the input engine in one go, rather than
1866 pushing each element. For now, argument collection still gets one
1867 argument of a $@ at a time; but the penalties of this patch make
1868 it easier to manage $@ efficiently in future patches.
1869 Memory impact: noticeable penalty, due to larger struct and O(n)
1870 to O(n^2) on unboxed recursion.
1871 Speed impact: noticeable penalty, due to more bookkeeping.
1872 * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
1874 (struct m4_macro_args): Add level field.
1875 (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
1876 * m4/input.c (m4__push_symbol, composite_peek, composite_read)
1877 (composite_unget, composite_clean, composite_print): Support $@
1879 * m4/macro.c (collect_arguments): Populate new field.
1880 (expand_macro): Move argv cleanup...
1881 (m4__arg_adjust_refcount): ...to this new function.
1882 (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
1883 (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
1884 helper functions, to add parameters.
1885 (m4_push_args): Adjust caller.
1886 * m4/symtab.c (m4_symbol_value_print): Likewise.
1888 Stage 14a: allow printing argv references.
1889 Refactor symbol-value printing code for better sharing, and to
1890 allow printing a contiguous text representation of a $@ ref.
1891 Memory impact: none.
1893 * m4/m4module.h (m4_arg_print): New prototype.
1894 (m4_symbol_value_print): Alter prototype.
1895 * m4/input.c (struct input_funcs): Add parameter to peek_func.
1896 (file_peek, builtin_peek, string_peek): Ignore new parameter.
1897 (composite_peek): Ignore new parameter, for now.
1898 (composite_clean, pop_input): Rework to minimize indirection, and
1899 to avoid infinite recursion in next patch.
1900 * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
1901 (m4_arg_print): New function.
1902 * m4/symtab.c (m4_symbol_value_print): Update signature.
1903 (m4_symbol_print): Update caller.
1904 * m4/output.c (m4_shipout_string_trunc): Update comments.
1905 * m4/syntax.c (set_quote_age): Require comma as argument separator
1906 when dealing with $@ as a unit.
1907 * tests/builtins.at (ifelse): Augment test.
1908 * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
1910 2008-01-31 Eric Blake <ebb9@byu.net>
1912 Kill hack for M4 1.4.4.
1913 * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
1914 we require new enough autoconf which in turn requires M4 1.4.5.
1916 2008-01-31 Gary V. Vaughan <gary@gnu.org>
1917 and Eric Blake <ebb9@byu.net>
1919 Depend on new libtool to use non-recursive build.
1920 * configure.ac (LT_PREREQ): Bump to alpha release version.
1921 (LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
1922 installed libtool has correct symbols.
1923 * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
1925 (AM_CPPFLAGS): Drop directories covered by libtool.
1926 (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
1927 (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
1928 macros, used by libtool.
1929 (lib_LTLIBRARIES): Also used by libtool.
1930 (ltdl/libltdlc.la): Delete, now that libtool does this.
1931 * bootstrap: Mention new requirements.
1932 (LIBTOOLIZE): Provide default program, and run libtoolize prior to
1934 (autoreconf): Also neutralize libtoolize, since it is run early.
1935 * HACKING: Mention updated prerequisites.
1937 2008-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1939 Fix build failure if installed libltdl is used.
1940 * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
1942 2008-01-28 Eric Blake <ebb9@byu.net>
1944 Depend on newer autoconf, for testsuite -C dir.
1945 * Makefile.am (CD_TESTDIR): Delete, no longer required.
1946 (check-local, installcheck-local, clean-local-tests): Use new -C
1947 option from autotest.
1948 * configure.ac (AC_PREREQ): Bump to 2.61a.347.
1949 * bootstrap: Mention new dependency.
1950 * HACKING: Likewise.
1952 2008-01-27 Eric Blake <ebb9@byu.net>
1954 Stage 13: push composite text tokens.
1955 Support pushing composite tokens, allowing back-references to be
1956 reused through multiple macro expansions. Add hueristic that
1957 avoids creating new reference when pushing existing references.
1958 Memory impact: noticeable improvement due to better reference
1959 reuse, except for O(n) to O(n^2) copying in boxed recursion.
1960 Speed impact: slight penalty, due to more bookkeeping.
1961 * m4/m4private.h (m4__push_symbol): Adjust prototype.
1962 * m4/input.c (m4__push_symbol): Add parameter, and support
1964 (append_quote_token): Add parameter, and support inlining of short
1966 (m4__next_token): Adjust caller.
1967 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1969 2008-01-26 Eric Blake <ebb9@byu.net>
1971 Stage 12c: add macro for m4_arg_len.
1972 Make a common action easier to type.
1973 Memory impact: none.
1975 * m4/m4module.h (M4ARGLEN): New macro.
1976 * m4/macro.c (process_macro): Adjust all callers.
1977 * m4/utility.c (m4_dump_args): Likewise.
1978 * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1980 * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1981 (renamesyms): Likewise.
1982 * modules/stdlib.c (setenv): Likewise.
1984 Stage 12b: add m4_string_pair.
1985 Make passing quote delimiters around more efficient.
1986 Memory impact: none.
1987 Speed impact: slight penalty, due to more bookkeeping.
1988 * m4/m4module.h (m4_string_pair): New type.
1989 (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1990 (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1992 * m4/m4private.h (struct m4_string): Delete.
1993 (struct m4_syntax_table): Combine quote and comment members.
1994 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1995 (m4_get_syntax_ecomm): Adjust accessors.
1996 (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1998 * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
2000 * m4/input.c (string_print, composite_print, m4_input_print):
2001 All callers updated.
2002 * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
2003 (check_is_single_quotes, m4_set_quotes, set_quote_age)
2004 (m4_get_syntax_lquote, m4_get_syntax_rquote)
2005 (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
2006 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
2007 (m4_get_syntax_comments): Likewise.
2008 * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
2009 * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
2011 * modules/m4.c (dumpdef, m4_make_temp): Likewise.
2012 * src/freeze.c (produce_frozen_state): Likewise.
2013 * tests/freeze.at (reloading unknown builtin): Update test.
2015 Stage 12a: make m4_symbol_chain a union.
2016 Shrink size of symbol chains by using a union.
2017 Memory impact: slight improvement, due to smaller struct.
2018 Speed impact: slight improvement, due to less bookkeeping.
2019 * m4/m4private.h (enum m4__symbol_chain_type): New enum.
2020 (struct m4_symbol_chain): Rename...
2021 (struct m4__symbol_chain): ...to this, since it is internal.
2022 * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
2024 * m4/input.c (struct m4_input_block, m4__push_symbol)
2025 (composite_peek, composite_read, composite_unget)
2026 (composite_clean, composite_print, m4__make_text_link)
2027 (append_quote_token): Likewise.
2028 * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
2029 (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
2030 (m4_push_args): Likewise.
2032 2008-01-23 Eric Blake <ebb9@byu.net>
2034 Adjust to recent libtool interface change.
2035 * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
2036 (LT_WITH_LTDL): Delete, now that it is obsolete.
2037 (LTDL_INIT): Use new libtool macro.
2039 2008-01-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2040 and Eric Blake <ebb9@byu.net>
2042 Rely on newer automake.
2043 * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
2045 * bootstrap: Update automake requirement.
2046 (func_version): Fix --version output, broken since 2007-08-06.
2047 * HACKING: Likewise. Add lzma requirement.
2048 * Makefile.am (clean-local-src): Not needed any more with newest
2050 (clean-local): Adjust.
2051 * TODO: Remove completed item.
2053 2008-01-22 Eric Blake <ebb9@byu.net>
2056 * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
2059 2008-01-21 Eric Blake <ebb9@byu.net>
2061 Stage 11: full circle for single argument references.
2062 Pass quoted strings through to argument collection in a single
2063 action, so that an argument can be reused throughout macro
2064 recursion if it remains unchanged.
2065 Memory impact: noticeable improvement, due to more reuse in
2066 argument collection stacks; O(n^2) to O(n) on boxed recursion.
2067 Speed impact: noticeable improvement, due to less copying.
2068 * m4/m4module.h (m4_arg_text): Add parameter.
2070 * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
2071 (m4__make_text_link): New prototype.
2072 (struct m4_symbol_chain): Add quote_age member.
2073 (struct m4_symbol_value): Add end member to chained symbol.
2074 (struct m4_macro_args): Add wrapper member.
2075 * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
2076 (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
2078 * m4/input.c (make_text_link): Rename...
2079 (m4__make_text_link): ...to this, and export.
2080 (m4_push_string_finish): Adjust caller.
2081 (make_text_link, m4__push_symbol): Update new field.
2082 (file_read, builtin_read, string_read, composite_read, next_char):
2084 (m4_skip_line, match_input, consume_syntax): Adjust callers.
2085 (append_quote_token): New function.
2086 (m4__next_token): Pass quoted strings onto argument collection.
2087 (m4_print_token) [DEBUG_INPUT]: Update.
2088 * m4/macro.c (expand_argument): Collect composite arguments.
2089 (collect_arguments): Update new field.
2090 (expand_macro): Reduce ref-count of back-references after use.
2091 (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
2093 (m4_is_arg_text): Also recognize composite symbols as text.
2094 (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
2095 (m4_arg_equal): Compare composite symbols.
2096 (m4_push_arg, m4_push_args): Handle composite symbols.
2097 (m4_arg_symbol): Relax assertion.
2098 (process_macro): Use single-argument references.
2099 * m4/output.c (m4_shipout_string_trunc): Update comment.
2100 * tests/macros.at (Rescanning macros): Augment test.
2102 2008-01-16 Eric Blake <ebb9@byu.net>
2104 Stage 10: avoid extra copying of strings and comments.
2105 When collecting tokens that are immune to further expansion, avoid
2106 copying data from one obstack to another by outputting it into the
2107 destination obstack to begin with. Also reduce copying done in
2109 Memory impact: slight improvement, due to better obstack usage.
2110 Speed impact: noticeable improvement, due less data copying.
2111 * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
2113 * m4/m4private.h (m4__token_type): Adjust prototype.
2114 * m4/input.c (m4__next_token): Support new parameter.
2115 * m4/macro.c (m4_macro_expand_input, expand_token)
2116 (expand_argument, collect_arguments): Adjust callers.
2117 * modules/m4.c (ntoa): Tighten buffer size.
2118 * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
2119 * modules/format.c (arg_int, arg_long, arg_double): New helper
2120 functions, to detect overflow or unparsed characters.
2121 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
2122 missing or excess arguments.
2123 (format): Likewise, and also output directly into obstack if there
2125 * doc/m4.texinfo (History): Update for new year.
2126 (Format): Test for new warnings.
2128 2008-01-15 Eric Blake <ebb9@byu.net>
2130 * TODO: Update with some newer URLs.
2132 Verify linear `index'.
2133 * tests/builtins.at (index): New test.
2134 (translit): Make test take longer, to make quadratic algorithms
2137 2007-12-20 Eric Blake <ebb9@byu.net>
2139 Stage 9: share rather than copy single-arg refs.
2140 Use hooks of previous patch to create back-references to arguments
2141 in the input engine, and inline short text rather than always
2142 creating a FIFO link. Also start testing embedded NUL behavior.
2143 Until the argument collection engine also shares references, the
2144 memory usage increases.
2145 Memory impact: noticeable penalty, due to longer life of argv
2146 changing O(n) to O(n^2) on boxed recursion.
2147 Speed impact: slight improvement, due less data copying.
2148 * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
2149 * m4/m4module.h (m4_arg_scratch): New prototype.
2150 * m4/m4private.h (m4__push_symbol): Add parameter.
2151 (m4_arg_scratch): Add fast accessor.
2152 (struct m4): Add expansion_level member, taken...
2153 * m4/macro.c (expansion_level): ...from here. Adjust all users.
2154 (expand_argument): Minor cleanup.
2155 (expand_macro): Track scratch space per macro call.
2156 (m4_arg_scratch): New function.
2157 (m4_make_argv_ref): Call new function.
2158 (m4_push_arg): Push reference to $0.
2159 (m4_push_args): Rework separator usage, since separators will
2161 (process_macro): Allow embedded NUL.
2162 * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
2163 (m4__push_symbol): Add parameter. Inline short strings, and save
2164 references through rescanning.
2165 * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
2166 * modules/m4.c (errprint, index): Handle NUL transparently.
2167 (dumpdef, translit): Use scratch space, rather than expansion
2169 * modules/gnu.c (renamesyms, m4symbols): Likewise.
2170 * tests/others.at (nul character): New test.
2171 (iso8859): Quote absolute file name, remove XFAIL.
2172 * tests/iso8859.m4: Avoid raw NUL in output.
2173 * tests/null.m4: New file.
2174 * tests/null.out: Likewise.
2175 * tests/null.err: Likewise.
2176 * Makefile.am (OTHER_FILES): Distribute new files.
2177 * .gitattributes: Treat new files as text.
2179 2007-12-17 Eric Blake <ebb9@byu.net>
2181 Stage 8: extend life of references into argv.
2182 Add hooks to lengthen the lifetime of arguments reused in a macro
2183 expansion, rather than always discarding arguments at the end of
2184 expand_macro. Rework the expand_macro obstacks to handle longer
2185 lifetimes. For now, the hooks remain unused.
2186 Memory impact: slight penalty, due to larger structs.
2187 Speed impact: slight penalty, due to more bookkeeping.
2188 * m4/system_.h (obstack_regrow): Delete.
2189 * m4/m4private.h (struct m4_symbol_chain): Add level field.
2190 (m4__push_symbol): Adjust prototype.
2191 (m4__adjust_refcount): New prototype.
2192 (DEBUG_MACRO) [DEBUG]: New debug control.
2193 (struct m4__macro_arg_stacks): New structure.
2194 (struct m4): Add arg_stacks, stacks_count fields.
2195 * m4/m4module.h (m4_make_argv_ref): Add parameter.
2196 * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
2197 context->arg_stacks.
2198 (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
2199 conditional on M4_DEBUG_MACRO envvar.
2200 (collect_arguments): Adjust signature.
2201 (expand_macro): Rework obstack handling.
2202 (m4__adjust_refcount, arg_mark): New functions.
2203 (m4_make_argv_ref): Populate new field.
2204 (m4_push_arg, m4_push_args): Track inuse.
2205 (process_macro): One less cast.
2206 * m4/m4.c (m4_delete): Clean up arg_stacks.
2207 * m4/input.c (make_text_link): Use new field.
2208 (m4__push_symbol, file_clean): Update signature.
2209 (composite_read): Bump refcount when done with reference.
2210 (composite_clean): New function.
2211 (pop_input): Adjust caller.
2212 * m4/debug.c (m4_debug_message): Make assertion match comment.
2213 * modules/gnu.c (builtin, indir): Adjust callers.
2214 * tests/builtins.at (ifelse): New test.
2215 (exp): Move and rename...
2216 * tests/others.at (countdown): ...to this.
2217 * doc/m4.texinfo (Improved foreach): Fix tracing usage in
2220 2007-12-13 Eric Blake <ebb9@byu.net>
2223 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
2228 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2230 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
2232 Reported by Giovanni Toffetti.
2234 2007-12-11 Eric Blake <ebb9@byu.net>
2236 Stage 7: use chained input support in input parser.
2237 Allow the LIFO input engine to rescan a macro expansion composed
2238 of smaller chunks of FIFO data, rather than the old approach of a
2239 monolithic string. For now, all chunks are still copied.
2240 Memory impact: slight penalty, due to FIFO chain overhead.
2241 Speed impact: slight penalty, due to extra bookkeeping.
2242 * m4/m4private.h (m4__push_symbol): New prototype.
2243 (struct m4_symbol_chain): Add const-safety.
2244 * m4/symtab.c (m4_symbol_value_print): Simplify.
2245 (dump_symbol_CB): Update caller.
2246 * m4/input.c (struct m4_input_block): Alter u_c member, first
2247 introduced 2006-10-25, but unused until now.
2248 (composite_peek, composite_read, composite_unget)
2249 (composite_print, init_builtin_token): Rewrite accordingly.
2250 (m4_push_wrapup): No longer need trailing NUL.
2251 (m4__push_symbol, make_text_link): New functions.
2252 (m4_push_string_finish): Use them.
2253 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2254 (expand_macro): Simplify logic of nesting_limit.
2255 * src/main.c (main): Likewise.
2256 * doc/m4.texinfo (Dumpdef): Augment test.
2258 2007-12-08 Eric Blake <ebb9@byu.net>
2260 Stage 6: convert builtins to push arg at a time.
2261 Add new methods to factor all builtins whose expansion includes an
2262 argument, making back-reference creation easier in future patches.
2263 Factor out length-limited printing to obstacks, and use -1 rather
2264 than 0 for unlimited length.
2265 Memory impact: none.
2266 Speed impact: slight improvement, due to better code sharing.
2267 * m4/m4module.h (m4_shipout_text): Rename...
2268 (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
2269 that does not worry about sync lines.
2270 (m4_shipout_string_trunc): New prototype.
2271 * m4/output.c (m4_shipout_text): Rename...
2272 (m4_divert_text): ...to this.
2273 (m4_shipout_string): Move guts...
2274 (m4_shipout_string_trunc): ...to this new function.
2275 * m4/macro.c (m4_push_arg, m4_push_args): New functions.
2276 (expand_token, process_macro): Update callers.
2277 * m4/input.c (string_print): Likewise.
2278 * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
2280 * modules/gnu.c (patsubst): Likewise.
2281 (debuglen): Use SIZE_MAX for unlimited debug length.
2282 * src/main.c (main): Likewise.
2283 * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
2286 2007-12-07 Eric Blake <ebb9@byu.net>
2288 Minor security fix: Quote output of mkstemp.
2289 * modules/m4.c (m4_make_temp): Produce quoted output.
2290 * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
2293 Stage 5: add notion of quote age.
2294 Cache the quoting rules that were in effect when a string was
2295 parsed, to avoid reparsing that string if no changequote or other
2296 quote age change took place in the meantime. A quote_age of 0 is
2297 always safe, but does not benefit from caching.
2298 Memory impact: slight improvement, due to smaller struct in input
2300 Speed impact: slight penalty, due to more bookkeeping.
2301 * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
2302 (m4_set_symbol_value_text): Adjust prototype.
2303 (m4_has_syntax): Factor out the unsigned char cast.
2304 * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
2306 (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
2307 functions at this point.
2308 (struct m4_symbol_value, struct m4_macro_args): Add quote_age
2310 (m4_set_symbol_value_text): Adjust fast accessor.
2311 (m4_get_symbol_value_quote_age): New fast accessor.
2312 * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
2313 (m4_get_symbol_value_quote_age): New function.
2314 (m4_symbol_value_copy): Adjust callers.
2315 * m4/macro.c (expand_token): Add parameter, and track quote age.
2316 (expand_argument, collect_arguments): Track quote age.
2317 (m4_macro_expand_input, process_macro, m4_make_argv_ref)
2318 (m4_macro_expand_input): Update callers.
2319 (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
2320 * m4/input.c: Comment cleanups.
2321 (struct m4_input_block): Reduce size.
2322 (m4__next_token): Report quote age.
2323 (m4_push_builtin, init_builtin_token): Update callers.
2324 * m4/utility.c (skip_space): Adjust callers.
2325 * m4/module.c (install_macro_table): Likewise.
2326 * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
2327 (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
2329 (set_quote_age): New helper function.
2330 (check_is_single_quotes, check_is_single_comments): Adjust
2332 * src/freeze.c (reload_frozen_state): Likewise.
2333 * src/main.c (main): Likewise.
2334 * modules/m4.c (define, pushdef): No need to set macro text.
2335 * tests/builtins.at (changequote, defn): New tests.
2336 * examples/wrapfifo.m4: New file.
2337 * examples/wraplifo.m4: New file.
2338 * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
2340 2007-12-04 Eric Blake <ebb9@byu.net>
2342 Fix builds with OpenBSD make.
2343 * Makefile.am (HELP2MAN): New macro.
2344 (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
2346 * README: Update copyright.
2347 * HACKING: Mention help2man and makeinfo dependencies.
2349 2007-11-29 Eric Blake <ebb9@byu.net>
2351 Stage 4: route indir, builtin through ref; make argv opaque.
2352 Finish making struct opaque to all but the input engine, by
2353 reworking obstack usage in expand_macro to better support creation
2354 of a $@ reference. Canonicalize the empty argument, to allow
2355 pointer comparison optimizations.
2356 Memory impact: slight penalty, due to larger struct.
2357 Speed impact: slight improvement, due to fewer function calls.
2358 * m4/system_.h (obstack_regrow): Fix precedence.
2359 * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
2361 (struct m4_macro_args): Move...
2362 * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
2363 to modules. Add has_ref member.
2364 (bool_bitfield): New helper typedef.
2365 (struct m4_symbol_chain): Add flatten and len members.
2366 * m4/macro.c (empty_symbol): New placeholder, for optimizing
2367 comparison with empty string.
2368 (m4_macro_expand_input): Initialize it.
2369 (collect_arguments): Alter signature, and populate new fields.
2370 (trace_pre, trace_post): Remove redundant parameter.
2371 (expand_macro): Alter handling of obstacks.
2372 (m4_arg_symbol): Account for wrapped argv.
2373 (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
2374 (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
2375 * modules/m4.c (ifelse, syscmd): Likewise.
2376 * modules/evalparse.c (m4_evaluate): Likewise.
2377 (undefine, popdef, m4_dump_symbols): Optimize.
2378 * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
2380 (changesyntax, regexp): Optimize.
2381 * m4/output.c (diversion_storage): Use typedef.
2383 Stage 3b: cache length, rather than computing it, in modules.
2384 Use cached token length in builtins and output engine.
2385 Memory impact: none.
2386 Speed impact: noticeable improvement, due to fewer function calls.
2387 * m4/hash.c (m4_hash_remove): Avoid double free on remove
2389 * m4/output.c (m4_shipout_string): Change semantics of len param.
2390 (m4_shipout_int): Use cached length.
2391 * m4/input.c (m4_push_string_finish): Likewise.
2392 * modules/m4.h (m4_make_temp_func): Add parameter.
2393 * m4/macro.c (expand_token, m4_arg_len): Use cached length.
2394 (collect_arguments, expand_macro): Alter signature.
2395 (trace_format): Don't use out-of-scope buffer.
2396 (process_macro): All callers changed.
2397 * m4/utility.c (m4_dump_args): Likewise.
2398 * m4/symtab.c (m4_symbol_value_print): Likewise.
2399 * modules/gnu.c (__file__, __program__, builtin, indir)
2400 (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
2401 renamesyms, patsubst, regexp, regexp_compile): Likewise.
2402 * modules/load.c (m4modules): Likewise.
2403 * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
2404 (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
2405 * modules/perl.c (perleval): Likewise.
2406 * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
2407 (hostname, uname, setenv): Likewise.
2408 * modules/mpeval.c (numb_obstack): Likewise.
2409 * src/freeze.c (dump_symbol_CB): Likewise.
2410 * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
2411 * tests/builtins.at (mkstemp): Likewise.
2412 * tests/others.at (iso8859): XFAIL this test, now that
2413 length-based handling allows NUL through part but not all of M4.
2415 2007-11-28 Eric Blake <ebb9@byu.net>
2417 Stage 3a: cache length, rather than computing it, in libm4.
2418 Cache the length of a token in the input engine and symbol table,
2419 to avoid repeating lots of strlen calls. Additionally, by using
2420 obstack length rather than strlen, the input engine can now
2421 support embedded NUL.
2422 Memory impact: slight penalty, due to larger struct.
2423 Speed impact: slight improvement, due to fewer function calls.
2424 * m4/m4module.h (struct m4_macro_args): Cache length.
2425 (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2426 (m4_set_symbol_value_text): Change signature.
2427 * m4/m4private.h (struct m4_symbol_value): Store string length.
2428 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2429 (m4_set_symbol_value_placeholder): Update accordingly.
2430 (m4_set_symbol_value_text): Change signature.
2431 (m4_get_symbol_value_len): New accessor.
2432 * m4/input.c (struct m4_input_block, string_peek, string_read)
2433 (string_unget, string_print, m4_push_string_finish)
2434 (m4_push_wrapup): Track length of string input.
2435 (m4__next_token): Adjust all users of symbol text to track length,
2437 * m4/macro.c (expand_argument, collect_arguments): Likewise.
2438 * m4/module.c (install_macro_table): Likewise.
2439 * modules/gnu.c (builtin, indir): Likewise.
2440 * modules/m4.c (define, pushdef): Likewise.
2441 * src/main.c (main): Likewise.
2442 * src/freeze.c (reload_frozen_state): Likewise.
2443 * m4/symtab.c (m4_symbol_value_copy): Likewise.
2444 (m4_get_symbol_value_len): New function.
2445 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2446 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2447 Adjust implementation.
2449 2007-11-27 Eric Blake <ebb9@byu.net>
2451 Stage 2: use accessors, not direct reference, into argv.
2452 Outside of macro.c, use accessor methods rather than direct access
2453 into the argv struct.
2454 Memory impact: none.
2455 Speed impact: slight penalty, due to increased function calls.
2456 * m4/m4private.h (m4_arg_argc): New fast accessor.
2457 * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2458 (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2460 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2461 (m4_macro_call): Make argc unsigned.
2462 (M4ARG): Use new accessors.
2463 * modules/m4.c (define, pushdef): Likewise.
2464 (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2465 (traceon, traceoff): Make argc unsigned.
2466 * modules/m4.h (m4_dump_symbols_func): Likewise.
2467 * modules/evalparse.c (m4_evaluate): Likewise.
2468 * modules/gnu.c (builtin, indir): Use new accessors.
2469 (changesyntax): Make argc unsigned.
2470 * modules/perl.c (perleval): Likewise.
2471 * m4/utility.c (m4_dump_args): Use new accessors.
2472 * m4/macro.c (trace_pre): Likewise.
2473 (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2474 (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2475 (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2478 2007-11-24 Eric Blake <ebb9@byu.net>
2480 Stage 1: convert m4_symbol_value** into new object.
2481 Pass a variable-size wrapper structure instead of an array to
2482 builtins, so that subsequent optimizations in the structure need
2483 not impact every builtin client.
2484 Memory impact: slight penalty, since struct is larger than array.
2485 Speed impact: slight penalty, due to increased bookkeeping.
2486 * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2487 * m4/m4module.h (m4_macro_args): New type, will be opaque to
2489 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2490 (m4_macro_call): Alter signature to use m4_macro_args object.
2491 (M4ARG): Redefine to access new struct.
2492 * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2493 (struct m4_symbol_chain): New type.
2494 (struct m4_symbol_value): Add chain alternative.
2495 * m4/macro.c (collect_arguments): Build new struct.
2496 (expand_macro, m4_macro_call, process_macro, trace_pre)
2497 (trace_post): Adjust implementation to use it.
2498 * m4/utility.c (m4_dump_args): Likewise.
2499 * modules/gnu.c (builtin, indir): Likewise.
2500 * modules/format.c (format): Likewise.
2501 * modules/m4.h (m4_dump_symbols_func): Likewise.
2502 * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2503 (shift, include, errprint, m4wrap): Likewise.
2504 * modules/evalparse.c (m4_evaluate): Likewise.
2506 Pass only macro name to utility functions.
2507 * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2508 * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2510 * m4/macro.c (m4_macro_call): Adjust callers.
2511 * modules/gnu.c (builtin, debuglen): Likewise.
2512 * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2514 * modules/evalparse.c (m4_evaluate): Likewise.
2515 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2516 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2519 2007-11-23 Eric Blake <ebb9@byu.net>
2521 Add macro name to debugfile messages.
2522 * m4/m4module.h (m4_debug_set_output): Add parameter.
2523 * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2525 * modules/gnu.c (debugfile): Adjust caller.
2526 * modules/m4.c (m4exit): Likewise.
2527 * src/main.c (main): Likewise.
2529 Factor out handling of macro name in error messages.
2530 * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2531 (m4_warn_at_line): Add new parameter.
2532 * m4/utility.c (m4_verror_at_line): New helper method.
2533 (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2535 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2537 * m4/debug.c: Likewise.
2538 * m4/input.c: Likewise.
2539 * m4/macro.c: Likewise.
2540 * m4/module.c: Likewise.
2541 * m4/output.c: Likewise.
2542 * m4/path.c: Likewise.
2543 * modules/evalparse.c: Likewise.
2544 * modules/format.c: Likewise.
2545 * modules/gnu.c: Likewise.
2546 * modules/load.c: Likewise.
2547 * modules/m4.c: Likewise.
2548 * modules/mpeval.c: Likewise.
2549 * src/freeze.c: Likewise.
2550 * src/main.c: Likewise.
2552 2007-11-14 Eric Blake <ebb9@byu.net>
2554 Handle some defn corner cases differently.
2555 * doc/m4.texinfo (Defn): Update documentation; although this still
2556 doesn't match the branch, since it may be changed before 2.0.
2557 * m4/macro.c (expand_argument): Consistently ignore builtins in
2558 concatenation contexts.
2559 * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2561 2007-11-13 Eric Blake <ebb9@byu.net>
2563 Note: Patches titled Stage 0 through N form a series of patches
2564 which decreases the algorithmic complexity of tail recursion in
2565 macro expansions from O(n^2) to O(n) in both time and memory, then
2566 performs cleanups, such as handling of embedded NUL, made easier
2567 by the code refactoring.
2569 Stage 0: Fix memory leak in tail recursion.
2570 Free expansion text in the input engine as soon as it is parsed,
2571 rather than when the recursive expansion completes.
2572 Memory impact: noticeable improvement, due to reduction from
2573 O(n^2) to O(n) on recursion.
2574 Speed impact: minor improvement, due to better memory usage.
2575 * m4/input.c (pop_input): Add flag parameter and return type.
2576 (next_char): Adjust caller.
2577 (m4_push_string_init): Let go of memory earlier.
2579 2007-11-07 Eric Blake <ebb9@byu.net>
2581 * tests/macros.at (Rescanning macros): Test more corner cases.
2583 2007-11-06 Eric Blake <ebb9@byu.net>
2585 * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2587 * Makefile.am (tests/package.m4): Work around bash bug.
2588 Reported by Ralf Wildenhues.
2590 2007-11-05 Eric Blake <ebb9@byu.net>
2592 For consistency with other GNU projects, use build-aux directory.
2593 * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2595 * bootstrap (config_aux_dir): Likewise.
2596 * Makefile.am (config_aux_dir): Likewise.
2597 * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2599 2007-11-02 Eric Blake <ebb9@byu.net>
2601 Update some documentation about version control.
2602 * NEWS: M4 is now stored in git.
2603 * HACKING: Likewise.
2605 * bootstrap: Likewise.
2606 * commit: Delete, now that CVS commits are no longer necessary.
2607 * ltdl/config/mailnotify: No longer necessary; git's patch
2608 generation and mail capability is more powerful.
2610 Update to recent gnulib changes.
2611 * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2612 xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2614 2007-11-01 Eric Blake <ebb9@byu.net>
2616 Improve error message when early end of file occurs.
2617 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2618 (M4wrap): Adjust to new messages.
2619 (Improved capitalize): Enhance test.
2620 * m4/m4private.h (m4__next_token): Adjust prototype.
2621 * m4/input.c (m4__next_token): Add new parameter, and improve
2623 * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2625 (expand_argument): Likewise, and add parameter.
2627 2007-10-31 Eric Blake <ebb9@byu.net>
2629 Test more corner cases.
2630 * tests/macros.at (Rescanning macros): Beef up test.
2631 * doc/m4.texinfo (Changecom): Beef up test.
2632 (Improved foreach): Document alternate foreachq style.
2633 * examples/foreachq3.m4: New file.
2634 * examples/loop.m4: New file.
2635 * Makefile.am (dist_pkgdata_DATA): Distribute them.
2637 2007-10-28 Eric Blake <ebb9@byu.net>
2639 More test coverage for autoconf usage patterns.
2640 * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2641 * tests/macros.at (Rescanning macros): New test.
2642 * tests/builtins.at (include): Augment test.
2644 2007-10-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2646 * Makefile.am: Adjust getopt handling to latest gnulib layout.
2648 2007-10-27 Eric Blake <ebb9@byu.net>
2650 Document one use of changequote(`(',`)').
2651 * doc/m4.texinfo (Changequote): Add new test, based on recent
2652 autoconf addition of m4_expand.
2654 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2656 * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2658 2007-10-22 Eric Blake <ebb9@byu.net>
2660 Never let printf failures go undetected.
2661 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2663 * m4/system_.h: Include xprintf.h.
2664 * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2665 use of printf, xprintf.
2666 * m4/input.c [DEBUG_INPUT]: Likewise.
2667 * m4/module.c [DEBUG_MODULES]: Likewise.
2668 * m4/output.c (m4_shipout_text, m4_shipout_int)
2669 (m4_freeze_diversions): Likewise.
2670 * m4/path.c [DEBUG_INCL]: Likewise.
2671 * m4/symtab.c [DEBUG_SYM]: Likewise.
2672 * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2673 * modules/modtest.c (export_test): Likewise.
2674 * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2675 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2677 * src/main.c (usage): Likewise.
2678 * po/POTFILES.in: Adjust to new file.
2679 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2681 2007-10-18 Eric Blake <ebb9@byu.net>
2683 Fix 'm4 -F file -t undefined'.
2684 * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
2685 * src/freeze.c (dump_symbol_CB): Also skip void symbols.
2686 * tests/freeze.at (reloading unknown builtin): Test for this bug.
2687 * m4/m4module.h (m4_symtab_apply): Add parameter.
2688 * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
2690 (m4_symtab_delete, symtab_dump): Adjust callers.
2691 * modules/m4.c (m4_dump_symbols): Likewise.
2693 2007-10-09 Eric Blake <ebb9@byu.net>
2695 Fix regexp regression of 2007-09-29.
2696 * modules/gnu.c (substitute): Allow NULL buf when no
2697 subexpressions were present.
2698 (regexp): Handle \ escapes even with empty regex.
2699 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
2701 Cache regex compilation for another autoconf speedup.
2702 * modules/gnu.c (gnu_buf): Replace...
2703 (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
2704 (m4_pattern_buffer): Add fields.
2705 (m4_regexp_compile): Rename...
2706 (regexp_compile): ...to this, and drop no_sub parameter.
2708 (M4FINISH_HANDLER): Clean up entire cache.
2709 (m4_regexp_search): Rename...
2710 (regex_search): ...to this, adjust to new struct contents, and add
2712 (m4_regexp_substitute): Rename...
2713 (regexp_substitute): ...to this.
2714 (substitute, patsubst, regexp, renamesyms): Adjust callers.
2716 2007-10-02 Eric Blake <ebb9@byu.net>
2718 Document quoting pitfalls in capitalize.
2719 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
2721 (Improved capitalize): New node.
2722 * examples/capitalize.m4: Update to match manual.
2723 * examples/capitalize2.m4: New file.
2725 2007-10-01 Eric Blake <ebb9@byu.net>
2727 Another Autoconf usage pattern optimization.
2728 * modules/m4.c (m4_index): Optimize search for one byte.
2729 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
2732 2007-09-29 Eric Blake <ebb9@byu.net>
2734 Optimize for Autoconf usage pattern.
2735 * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
2737 * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
2739 2007-09-24 Eric Blake <ebb9@byu.net>
2741 Create .gitignore alongside .cvsignore.
2742 * bootstrap (version control): Update to reflect git usage.
2744 2007-09-13 Eric Blake <ebb9@byu.net>
2746 * AUTHORS: Fix typo.
2748 2007-09-12 Gary V. Vaughan <gary@gnu.org>
2750 Be consistent about using 'module' for m4_module types and
2751 'handle' for lt_dlhandle types:
2753 * m4/m4private.h (m4_symbol_value): Rename handle element to
2754 method. Changed all references.
2755 (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
2756 SYMBOL_HANDLE respectively. Changed all references.
2757 * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
2758 * m4/builtin.c (m4_builtin_find_by_name)
2759 (m4_builtin_find_by_func): Use module as the parameter name for
2760 pointers of type 'm4_module'.
2761 * m4/module.c (module_remove, m4_get_module_name)
2762 (install_builtin_table, install_macro_table)
2763 (m4_module_make_resident, m4__module_next, m4_module_refcount):
2765 * src/freeze.c (produce_module_dump): Ditto.
2766 * m4/input.c (m4_input_block): Rename handle element to method.
2767 Changed all references.
2768 * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
2769 * modules/load.c: Use module as the variable name for pointers
2770 of type 'm4_module'.
2771 * modules/m4.c: Ditto.
2772 * modules/perl.c: Ditto.
2773 * modules/shadow.c: Ditto.
2775 2007-09-07 Eric Blake <ebb9@byu.net>
2777 Add refcount builtin.
2778 * modules/load.c (refcount): New builtin.
2779 (m4modules): Use correct type.
2780 * doc/m4.texinfo (Refcount): New section.
2781 * m4/m4private.h (struct m4_module): Add refcount member.
2782 (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
2783 * m4/module.c (m4_module_load): Add symbols to table on first
2784 load by m4, regardless of other libltdl loads of same module.
2785 (m4_module_refcount): Use new struct member, rather than relying
2786 on libltdl count which might be inflated by unrelated loads.
2787 (m4__module_interface): Optimize.
2788 (m4__module_next, m4__module_find): Avoid assertions that could
2789 trigger with unrelated libltdl loads.
2790 (m4__module_open): Track m4 load count.
2791 (m4__module_exit): Only unload what m4 loaded.
2792 (module_remove): Track m4 unloads.
2793 * NEWS: Document new builtin.
2795 More conversion to m4_module*.
2796 * src/freeze.c (produce_module_dump, dump_symbol_CB)
2797 (reload_frozen_state): Use correct type.
2798 * m4/input.c (struct m4_input_block): Likewise.
2799 * m4/symtab.c (dump_symbol_CB): Likewise.
2801 * AUTHORS: Simplify, to match libtool and autoconf layout.
2802 * THANKS: Sync with branch.
2804 2007-09-06 Eric Blake <ebb9@byu.net>
2806 Wrap lt_dlhandle in struct m4_module.
2807 * m4/m4module.h (includes): No longer require clients to know
2809 (m4_module): New opaque declaration.
2810 (m4_export): Delete unused type.
2811 (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
2812 (m4_module_finish_func, m4_module_load, m4_get_module_name)
2813 (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
2815 (m4_module_makeresident, m4_module_refcount): New declarations.
2816 * m4/m4private.h (includes): Move <ltdl.h> here.
2817 (m4_module): New declaration. Simple for now, but intended for
2819 (m4__module_open, m4__module_next, m4__module_find)
2820 (m4__symtab_remove_module_references): Use new wrapper.
2821 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2823 * m4/module.c (m4_get_module_name, m4_module_import)
2824 (m4_module_load): Likewise.
2825 (install_builtin_table, install_macro_table): Likewise. Also,
2826 change return type since these always returned NULL and no one
2828 (m4_module_makeresident, m4_module_refcount): New functions.
2829 (m4_module_unload, m4__module_next, m4__module_find): Use new
2831 (m4__module_open): Populate new wrapper, and associate it with the
2833 (m4__module_exit): Use new wrapper.
2834 (module_remove): Likewise. Reclaim storage on last use.
2835 (module_close): Delete, and inline into module_remove.
2836 * m4/symtab.c (m4__symtab_remove_module_references): Use new
2838 * modules/load.c (load_init): Use new API.
2839 * modules/m4.c (m4_export_table): Kill unused declaration.
2840 (m4_init): Use new API.
2841 * modules/shadow.c (shadow_init): Use new API.
2842 * src/main.c (main): Adjust callers.
2843 * src/freeze.c (reload_frozen_state): Likewise.
2844 * tests/modules.at (unload load module): New test.
2846 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2848 * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
2849 * src/m4/.cvsignore: Add xstrtol module sources.
2851 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2853 Work around a bug in darwin's awk:
2855 * bootstrap (func_get_translations): Use $AWK instead of raw
2856 `awk' so that the user can use an alternative implementation
2857 if the first awk in PATH doesn't behave as expected.
2858 (func_get_translations): The first awk script mangles the last
2859 entry passed to it for at least the awk implementation shipped
2860 with Darwin 8.10.1. Capture $3 into a variable too to work-
2861 around that problem.
2863 2007-08-29 Gary V. Vaughan <gary@gnu.org>
2865 As gnulib xstrtol is only used by main, and unconditionally pulls
2866 in a copy of getopt, undo bootstrap change from 2007-08-11 below,
2867 and copy the xstrtol code into src/ so that main() can use it
2868 without pushing the extra code into libm4:
2870 * bootstrap (src_modules): Add getopt and xstrtol modules.
2871 * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
2872 * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
2874 2007-08-11 Eric Blake <ebb9@byu.net>
2876 Another upstream xstrtol change.
2877 * po/POTFILES.in: Track changes in files containing messages.
2878 * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
2879 need to grab it separately.
2880 * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2882 (size_opt): Adjust to latest xstrtol interface.
2884 2007-08-10 Eric Blake <ebb9@byu.net>
2886 Documentation improvements.
2887 * doc/m4.texinfo (Defn): Resync with branch.
2888 (Compatibility, Extensions): Sync with branch.
2890 2007-08-07 Eric Blake <ebb9@byu.net>
2892 Adjust to gnulib xstrtol changes.
2893 * src/main.c (size_opt): Adjust signature, so that error strings
2894 are easier to translate.
2895 (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
2896 for tracking long options.
2897 (main): Track which long option was used.
2898 * tests/options.at (--debuglen, --nesting-limit): Adjust to change
2900 (deprecated options): Test that --arglength spelling shows up in
2903 2007-08-06 Eric Blake <ebb9@byu.net>
2905 Normalize all GPL license notices.
2906 * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
2908 * Makefile.am: Update license wording.
2909 * bootstrap: Likewise.
2911 * configure.ac: Likewise.
2912 * ltdl/config/mailnotify: Likewise.
2913 * ltdl/config/mkstamp: Likewise.
2914 * ltdl/m4/debug.m4: Likewise.
2915 * ltdl/m4/gmp.m4: Likewise.
2916 * ltdl/m4/m4-error.m4: Likewise.
2917 * ltdl/m4/m4-getopt.m4: Likewise.
2918 * ltdl/m4/m4-gettext.m4: Likewise.
2919 * ltdl/m4/m4-obstack.m4: Likewise.
2920 * ltdl/m4/m4-regex.m4: Likewise.
2921 * ltdl/m4/stackovf.m4: Likewise.
2922 * m4/builtin.c: Likewise.
2923 * m4/debug.c: Likewise.
2924 * m4/hash.c: Likewise.
2925 * m4/hash.h: Likewise.
2926 * m4/input.c: Likewise.
2927 * m4/m4.c: Likewise.
2928 * m4/m4module.h: Likewise.
2929 * m4/m4private.h: Likewise.
2930 * m4/macro.c: Likewise.
2931 * m4/module.c: Likewise.
2932 * m4/output.c: Likewise.
2933 * m4/path.c: Likewise.
2934 * m4/resyntax.c: Likewise.
2935 * m4/symtab.c: Likewise.
2936 * m4/syntax.c: Likewise.
2937 * m4/system_.h: Likewise.
2938 * m4/utility.c: Likewise.
2939 * modules/evalparse.c: Likewise.
2940 * modules/format.c: Likewise.
2941 * modules/gnu.c: Likewise.
2942 * modules/import.c: Likewise.
2943 * modules/load.c: Likewise.
2944 * modules/m4.c: Likewise.
2945 * modules/m4.h: Likewise.
2946 * modules/modtest.c: Likewise.
2947 * modules/mpeval.c: Likewise.
2948 * modules/perl.c: Likewise.
2949 * modules/shadow.c: Likewise.
2950 * modules/stdlib.c: Likewise.
2951 * modules/time.c: Likewise.
2952 * modules/traditional.c: Likewise.
2953 * po/Makevars: Likewise.
2954 * src/freeze.c: Likewise.
2955 * src/m4.h: Likewise.
2956 * src/main.c: Likewise.
2957 * src/stackovf.c: Likewise.
2958 * tests/builtins.at: Likewise.
2959 * tests/freeze.at: Likewise.
2960 * tests/generate.awk: Likewise.
2961 * tests/m4.in: Likewise.
2962 * tests/macros.at: Likewise.
2963 * tests/modules.at: Likewise.
2964 * tests/options.at: Likewise.
2965 * tests/others.at: Likewise.
2966 * tests/stackovf.test: Likewise.
2967 * tests/testsuite.at: Likewise.
2969 2007-07-22 Eric Blake <ebb9@byu.net>
2971 Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2972 * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2973 * tests/builtins.at (divert): Enhance test to cover this.
2975 Reported by Thomas Klausner.
2977 2007-07-20 Eric Blake <ebb9@byu.net>
2979 Fix 'make distcheck' issues.
2980 * bootstrap: Add more files that might be more up-to-date in
2982 * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2983 * config/m4/gnulib-cache.m4: Update to latest gnulib.
2985 2007-07-16 Eric Blake <ebb9@byu.net>
2987 * po/POTFILES.in: Track recent translation additions from gnulib
2990 2007-07-14 Eric Blake <ebb9@byu.net>
2992 Reflect upstream license .texi changes.
2993 * doc/m4.texinfo (Copying): Rename node...
2994 (GNU General Public License): ...to this.
2995 (GNU Free Documentation License): Adjust node location.
2996 * local/doc/gpl-3.0.texi.diff: Remove file.
2998 2007-07-10 Eric Blake <ebb9@byu.net>
3000 Upgrade to GPLv3, and document 1.4.10.
3001 * bootstrap: Adjust to GPLv3.
3002 (func_update): Port from branch.
3003 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3004 --local-dir=local --import gpl-3.0'.
3005 * doc/m4.texinfo (History): Mention 1.4.11.
3006 (Copying This Package): New appendix.
3007 * NEWS: Document 1.4.10.
3008 * local/doc/gpl-3.0.texi.diff: New file.
3009 * Makefile.am: Update license.
3010 (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
3011 * commit: Update license.
3012 * configure.ac: Likewise.
3013 * ltdl/config/mailnotify: Likewise.
3014 * ltdl/config/mkstamp: Likewise.
3015 * ltdl/m4/debug.m4: Likewise.
3016 * ltdl/m4/gmp.m4: Likewise.
3017 * ltdl/m4/m4-error.m4: Likewise.
3018 * ltdl/m4/m4-getopt.m4: Likewise.
3019 * ltdl/m4/m4-gettext.m4: Likewise.
3020 * ltdl/m4/m4-obstack.m4: Likewise.
3021 * ltdl/m4/m4-regex.m4: Likewise.
3022 * ltdl/m4/stackovf.m4: Likewise.
3023 * m4/builtin.c: Likewise.
3024 * m4/debug.c: Likewise.
3025 * m4/hash.c: Likewise.
3026 * m4/hash.h: Likewise.
3027 * m4/input.c: Likewise.
3028 * m4/m4.c: Likewise.
3029 * m4/m4module.h: Likewise.
3030 * m4/m4private.h: Likewise.
3031 * m4/macro.c: Likewise.
3032 * m4/module.c: Likewise.
3033 * m4/output.c: Likewise.
3034 * m4/path.c: Likewise.
3035 * m4/resyntax.c: Likewise.
3036 * m4/symtab.c: Likewise.
3037 * m4/syntax.c: Likewise.
3038 * m4/system_.h: Likewise.
3039 * m4/utility.c: Likewise.
3040 * modules/evalparse.c: Likewise.
3041 * modules/format.c: Likewise.
3042 * modules/gnu.c: Likewise.
3043 * modules/import.c: Likewise.
3044 * modules/load.c: Likewise.
3045 * modules/m4.c: Likewise.
3046 * modules/m4.h: Likewise.
3047 * modules/modtest.c: Likewise.
3048 * modules/mpeval.c: Likewise.
3049 * modules/perl.c: Likewise.
3050 * modules/shadow.c: Likewise.
3051 * modules/stdlib.c: Likewise.
3052 * modules/time.c: Likewise.
3053 * modules/traditional.c: Likewise.
3054 * po/Makevars: Likewise.
3055 * src/freeze.c: Likewise.
3056 * src/m4.h: Likewise.
3057 * src/main.c: Likewise.
3058 * src/stackovf.c: Likewise.
3059 * tests/builtins.at: Likewise.
3060 * tests/freeze.at: Likewise.
3061 * tests/generate.awk: Likewise.
3062 * tests/m4.in: Likewise.
3063 * tests/macros.at: Likewise.
3064 * tests/modules.at: Likewise.
3065 * tests/options.at: Likewise.
3066 * tests/others.at: Likewise.
3067 * tests/stackovf.test: Likewise.
3068 * tests/testsuite.at: Likewise.
3070 2007-07-09 Eric Blake <ebb9@byu.net>
3072 * modules/format.c (format): Avoid undefined behavior with %c.
3074 2007-07-01 Gary V. Vaughan <gary@gnu.org>
3076 The translation project has moved.
3077 * bootstrap (func_get_translations): Use the new translation
3081 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
3083 Match Free Software Directory categories.
3084 * doc/m4.texinfo (dircategory): Update.
3086 2007-05-31 Eric Blake <ebb9@byu.net>
3088 Add extension to divert builtin.
3089 * modules/m4.c (builtin_divert): Immediately divert second
3091 * m4/output.c (m4_output_text): Allow 0 length. Fixes regression
3093 (m4_shipout_text): Short-circuit on zero length.
3094 * tests/freeze.at (loading format 2): Expand test to catch
3095 regression. Also check out-of-range version.
3096 * tests/builtins.at (divert): Expand test to check corner cases
3098 * doc/m4.texinfo (Divert): Document the extension.
3100 Reported by Daniel Richard G.
3102 2007-05-30 Eric Blake <ebb9@byu.net>
3104 Port format improvements from branch.
3105 * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
3106 (Format): Enhance section.
3107 * modules/format.c (format): Accept %'hhd, and issue warnings on
3108 unrecognized specifiers.
3109 * modules/gnu.c (builtin_format): Adjust how format is called.
3111 2007-05-28 Eric Blake <ebb9@byu.net>
3113 * tests/options.at (--syncoutput): Add xfailed test.
3115 Fix sync line interaction with multiline comments.
3116 * doc/m4.texinfo (Preprocessor features): Improve documentation.
3117 (Syncoutput): Improve testsuite.
3118 (Incompatibilities): Add testcase, and document bug.
3119 * src/freeze.c (reload_frozen_state): Don't interfere with
3120 synclines when reloading state.
3121 * m4/input.c (m4__next_token): Report line where multiline tokens
3123 * m4/m4private.h (m4__token_type): Add parameter.
3124 * m4/m4module.h (m4_output_text): Export.
3125 (m4_shipout_text): Add parameter.
3126 * src/macro.c (m4_macro_expand_input, expand_token)
3127 (expand_argument): Adjust callers so that line is passed from
3129 * m4/output.c (output_text): Rename...
3130 (m4_output_text): ...to this, and export.
3131 (m4_insert_file, insert_diversion_helper): Update callers.
3132 (m4_shipout_text): Take new parameter for start line of token.
3133 Output at most one syncline per token.
3134 Reported by Sergey Poznyakoff.
3136 Fix large diversion corner cases.
3137 * tests/freeze.at (large diversion): New test.
3138 * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
3139 (make_room_for): Use NULL, not 0, for pointers.
3140 (m4_freeze_diversions): Allow freezing large diversions.
3141 (insert_diversion_helper): Avoid using rewind.
3143 Also run gnulib unit tests during make check.
3144 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3145 --tests-base=tests/gnu --with-tests'.
3146 * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
3147 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
3149 2007-05-25 Eric Blake <ebb9@byu.net>
3151 * m4/system_.h: Include <stdint.h>, for intmax_t.
3153 Reported by Daniel Richard G.
3155 2007-05-24 Eric Blake <ebb9@byu.net>
3157 Provide consistent shift semantics regardless of hardware.
3158 * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
3160 (number, unumber): Always use [u]intmax_t.
3161 Reported by Gary V. Vaughan.
3163 Support POSIX flush semantics on all platforms.
3164 * modules/m4.c (m4_sysval_flush): Rely on gnulib.
3165 * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
3167 Work around cygwin and mingw fseeko bugs.
3168 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3170 * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
3172 2007-04-25 Eric Blake <ebb9@byu.net>
3174 Test that regression in 1.4.9's eval doesn't recur.
3175 * doc/m4.texinfo (Eval): Check negative division.
3178 2007-04-12 Eric Blake <ebb9@byu.net>
3180 Allow for running test in sticky or setgid directory.
3181 * tests/builtins.at (mkdtemp): Adjust test.
3183 Don't test for broken sed too soon.
3184 * tests/others.at (stdin seekable): Rearrange subtests.
3186 Work around 'stdin seekable' shortcoming on glibc.
3187 * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
3188 * tests/others.at (stdin closed): Adjust to new output.
3189 * src/main.c (process_file): No need to return anything.
3190 (main): Use close_stdin instead of close_stdout.
3191 Reported by Ralf Wildenhues.
3193 Enable autobuild usage.
3194 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3196 * configure.ac (AB_INIT): Output autobuild information.
3198 2007-04-11 Eric Blake <ebb9@byu.net>
3200 Address testsuite shortcoming in 'stdout full' on glibc.
3201 * tests/others.at (stdout full): Adjust expected output when more
3202 than 1k text is printed to /dev/full.
3203 Reported by Ralf Wildenhues.
3205 2007-04-10 Eric Blake <ebb9@byu.net>
3207 * tests/macros.at (Arity and defn): Fix quoting.
3209 2007-04-09 Eric Blake <ebb9@byu.net>
3211 Address failure of 'seekable stdin' on Mac OS X.
3212 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3215 2007-04-07 Eric Blake <ebb9@byu.net>
3217 Include <config.h> first in all C files, and not in headers.
3218 Fixes regression for --disable-assert builds from 2007-04-02.
3219 * src/m4.h (includes): Don't include config.h here.
3220 * m4/m4private.h (includes): Likewise.
3221 * m4/builtin.c: Include config.h before anything else.
3222 * m4/debug.c: Likewise.
3223 * m4/hash.c: Likewise.
3224 * m4/input.c: Likewise.
3225 * m4/m4.c: Likewise.
3226 * m4/macro.c: Likewise.
3227 * m4/module.c: Likewise.
3228 * m4/symtab.c: Likewise.
3229 * m4/syntax.c: Likewise.
3230 * m4/utility.c: Likewise.
3231 * src/freeze.c: Likewise.
3232 * src/stackovf.c: Likewise.
3234 2007-04-03 Eric Blake <ebb9@byu.net>
3236 * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
3237 SIGFPE on x86 architectures.
3238 Reported by Ralf Wildenhues.
3240 2007-04-02 Eric Blake <ebb9@byu.net>
3242 Fix warnings from last commit.
3243 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3244 fprintf-posix sprintf-posix'.
3245 * m4/macro.c (expand_macro, trace_format): Use correct specifier
3247 (process_macro): Avoid negative array index.
3248 * src/freeze.c (produce_resyntax_dump, produce_module_dump)
3249 (dump_symbol_CB, produce_frozen_state): Use correct specifier for
3252 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3254 Get rid of the last 'differs in signedness' compiler warnings:
3256 * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
3257 a regular 'char *', so variables to store the return address,
3258 and iterate through it should be regular 'char *' too.
3259 * m4/input.c (m4_input_block): The start and current members of
3260 the string part of this union store regular 'char *' types, so
3261 they should be regular 'char *' types too.
3263 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3265 M4 was designed to have a small number of header files defining
3266 the interfaces to several source files each. Keeping this in
3267 mind allows us to tidy things up considerably. Having done this,
3268 it becomes clear that some of the installed headers reference
3269 other headers which are not installed (but that's another patch):
3271 * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
3273 * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
3274 ...to here, so client modules can benefit too.
3275 (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
3276 lowest level to save doing it multiple times elsewhere.
3277 * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
3278 is already included via m4private.h.
3279 * modules/time.c (stdio.h): Ditto.
3280 * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
3281 * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
3282 and <gnu/unistd--.h>,
3283 * m4/m4private.h (m4module.h): Use angle brackets for an installed
3285 * m4/hash.h (system.h): Ditto.
3286 * modules/gnu.c (progname.h): Removed.
3287 * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
3288 * m4/m4private.h (assert.h, errno.h): Already included via
3290 * m4/input.c (ctype.h): Ditto.
3291 * m4/module.c (ltdl.h): Ditto.
3292 * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
3294 * m4/path.c (config.h, stdlib.h): Ditto.
3295 * m4/utility.c (config.h): Ditto.
3296 * modules/evalparse.c (assert.h, ctype.h): Ditto.
3297 * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
3298 * modules/import.c (assert.h): Ditto.
3299 * modules/m4.c (assert.h, errno.h): Ditto.
3300 * modules/modtest.c (assert.h): Ditto.
3301 * modules/stdlib.c (sys/types.h): DittAo.
3302 * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
3304 * src/stackovf.c (assert.h): Ditto.
3305 * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
3306 private interfaces when NDEBUG is defined.
3307 * modules/import.c (m4/m4module.h, m4private.h): Ditto.
3308 * modules/load.c (m4/m4module.h, m4private.h): Ditto.
3309 * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
3310 * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
3311 * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
3312 * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
3313 * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
3314 * modules/time.c (m4/m4module.h, m4private.h): Ditto.
3315 * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
3316 * src/m4.h (locale.h): Moved from here...
3317 * src/main.h: ...to here.
3318 (m4private.h): Already included via m4.h.
3319 * src/stackovf.c (m4private.h): Ditto.
3321 2007-03-28 Gary V. Vaughan <gary@gnu.org>
3323 * Makefile.am (stamp-vcl): Removed.
3324 (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
3326 2007-03-28 Eric Blake <ebb9@byu.net>
3328 * src/main.c (usage): Improve note to TRANSLATORS.
3329 * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
3331 * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
3334 2007-03-24 Eric Blake <ebb9@byu.net>
3336 * m4/output.c (m4_output_init): Update to latest gnulib.
3337 * bootstrap (ltdl/m4/.cvsignore): No longer track generated
3339 * NEWS: Reflect release of 1.4.9.
3342 2007-03-07 Eric Blake <ebb9@byu.net>
3346 Exercise gnulib's new POSIX *printf modules.
3347 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3349 * modules/format.c (format): Support %a and %A.
3350 * doc/m4.texinfo (Format): Test this addition.
3351 * NEWS: Document this addition.
3353 2007-03-03 Eric Blake <ebb9@byu.net>
3355 * m4/input.c (m4__next_token): Fix synclines when in batch mode.
3356 * doc/m4.texinfo (M4exit): Synch another section.
3357 (Syncoutput): Make similar to other sections.
3359 2007-03-01 Eric Blake <ebb9@byu.net>
3361 * doc/m4.texinfo: Improve the indices.
3362 (Concept index): Rearrange to be last.
3363 (Sysval): Merge from branch.
3365 * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
3367 2007-02-28 Eric Blake <ebb9@byu.net>
3369 POSIX XCU ERN 137 was approved.
3370 * modules/mpeval.c (numb_extension): Delete.
3371 * modules/m4.c (numb_extension): Likewise.
3372 * modules/evalparse.c (comma_term, condition_term): Always
3373 implement ?: and , operators.
3374 * m4/symtab.c: Update comment to match reality.
3375 * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
3376 dereferencing context directly when accessor exists.
3377 * src/main.c (usage): Prefer GNU_M4 over EMACS.
3378 (struct macro_definition): Rename...
3379 (struct deferred): ...to match usage. All uses changed.
3380 * doc/m4.texinfo (Eval): Document this change.
3381 (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
3383 (Preprocessor features, Changesyntax): Fix inaccuracies.
3384 * NEWS: Import branch NEWS items for 1.4.x series. Document
3387 POSIX XCU ERN 118 was approved.
3388 * modules/m4.c (define): Kill posixly_correct distinction in
3389 define behavior, since POSIX says GNU behavior complies.
3390 * tests/builtins.at (define): Restore original semantics.
3391 * doc/m4.texinfo (Pushdef): Document portability issues with
3393 (Incompatibilities): Clean up wording of what POSIX requires.
3394 * NEWS: Document this.
3396 2007-02-26 Eric Blake <ebb9@byu.net>
3398 Re-enable clean bootstrap on cygwin.
3399 * Makefile.am (AM_LDFLAGS): For now, export all symbols from
3400 modules, since otherwise we run afoul of current libtool
3401 limitations on cygwin and mingw.
3403 2007-02-25 M. Levinson <levinsm@users.sourceforge.net> (tiny change)
3405 * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
3406 memory. Fixes regression introduced 2007-01-20.
3408 2007-02-25 Eric Blake <ebb9@byu.net>
3410 * tests/freeze.at (loading format 2): Augment test to catch
3411 regression introduced on 2007-01-20.
3413 Reported by M. Levinson.
3415 * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3418 2007-02-05 Eric Blake <ebb9@byu.net>
3420 * tests/options.at (--fatal-warnings): New test.
3421 * tests/others.at (stdin seekable): Exit on error.
3422 * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3423 (m4_get_warnings_exit_opt): Access it.
3424 * m4/m4module.h (m4_context_opt_bit_table): Access it.
3425 * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3427 (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3429 * src/m4.c (usage): Document new -E behavior.
3430 (main): Make -E an additive option.
3431 * doc/m4.texinfo (Operation modes): Document the change.
3432 Reported by Ralf Wildenhues.
3434 * tests/others.at (stdin seekable): Fix bug in test.
3435 * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3437 * m4/input.c (struct m4_input_block): Remove unused field traced.
3439 2007-02-03 Eric Blake <ebb9@byu.net>
3440 and Bruno Haible <bruno@clisp.org> (tiny change)
3442 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3444 Reported by Bruno Haible.
3446 2007-01-31 Eric Blake <ebb9@byu.net>
3448 * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3451 2007-01-26 Eric Blake <ebb9@byu.net>
3453 * m4/symtab.c (includes): Adjust to latest gnulib.
3454 * modules/m4.c (includes): Likewise.
3456 2007-01-23 Eric Blake <ebb9@byu.net>
3458 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3459 extension to make enough room.
3460 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3461 code in input.c special cases this category.
3462 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3463 for define(eleventh,${11}) extension.
3464 * m4/syntax.c: Update comments accordingly.
3465 (m4_syntax_create, m4_syntax_code): Handle { and }.
3466 * m4/input.c (m4__next_token): Likewise.
3467 * src/freeze.c (produce_frozen_state): Support new categories.
3468 (reload_frozen_state): When loading version 1, disable syntax
3469 features not present in 1.4.x.
3470 * tests/freeze.at: Sort and rename existing tests.
3471 (loading format 1): Ensure we don't break v1 frozen files that
3473 (loading format 2, reloading changecom, reloading changesyntax):
3475 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3476 the new syntax categories.
3477 (Arguments): Update the FIXME comment.
3478 (M4wrap): Merge examples from branch, before worrying about fixing
3479 m4wrap to obey POSIX.
3480 (Using frozen files): Start merging from branch.
3483 2007-01-20 Eric Blake <ebb9@byu.net>
3485 * src/freeze.c (produce_char_dump): Delete. Replace with...
3486 (produce_mem_dump): ...this new function, to encode more strings.
3487 Also make the coding easier to read and slightly more compact.
3488 (produce_syntax_dump): Only dump non-default syntax codes.
3489 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3490 Encode non-ASCII characters in user-supplied strings.
3491 (GET_STRING): Accept escape sequences in version 2.
3492 * NEWS: Document this change.
3495 2007-01-16 Eric Blake <ebb9@byu.net>
3497 Port patch from branch for stack overflow detection on BSD/OS.
3498 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3499 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3500 ! HAVE_STACK_T_SS_SP]: Use this check.
3501 Reported by Chris McGuire.
3503 2007-01-15 Eric Blake <ebb9@byu.net>
3505 * tests/builtins.at (__m4_version__): New test.
3506 * modules/traditional.c (m4_macro_table): Provide windows and os2
3507 macros, as appropriate. Add __traditional__ macro.
3508 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3509 not __gmp__, to match module name.
3510 * modules/load.c (m4_macro_table): Name the macro __load__, not
3511 __modules__, to match module name.
3512 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3514 (Standard Modules): Improve wording.
3515 (Incompatibilities): Move platform macros into their own node.
3516 (Load, Unload): Use actual examples.
3517 * NEWS: Document this change.
3520 2007-01-13 Eric Blake <ebb9@byu.net>
3522 * doc/m4.texinfo (Mpeval): Add tests.
3523 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3524 * tests/builtins.at (gmp): ...here. Rename test to...
3526 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3528 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3529 no_gnu_extensions with posixly_correct_opt, since they were set in
3531 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3532 * src/main.c (main): Update caller.
3533 * src/freeze.c (reload_frozen_state): Likewise.
3534 * modules/m4.c (m4wrap): Likewise.
3536 2007-01-12 Eric Blake <ebb9@byu.net>
3538 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3539 POSIX, so update the comment.
3540 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3541 approved by POSIX, so we can always have blind macros, even when
3543 (Ifelse): Mention the term `blind builtin'.
3545 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3547 * doc/m4.texinfo: Fix a couple of typos.
3549 2007-01-08 Eric Blake <ebb9@byu.net>
3551 * ltdl/m4/gnulib-cache.m4: Update for new year.
3552 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3553 Reported by Ralf Wildenhues.
3555 2007-01-06 Eric Blake <ebb9@byu.net>
3557 * m4/m4private.h (to_uchar): Move...
3558 * m4/m4module.h: here, so modules can use it.
3559 * src/main.c (usage, long_options): Support --posix as a synonym
3561 * modules/m4.c (numb_invert): Detect unsupported x**-y.
3562 (numb_incr, numb_urshift, numb_extension): New macros.
3563 (numb_obstack): Port patch from branch to support radix 1 output.
3564 * modules/mpeval.c (numb_obstack): Use \ for ratios.
3565 (numb_incr, numb_urshift, numb_extension): New macros.
3566 (mpq2mpz): Warn rather than error.
3567 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3569 (eval_error): Rearrange, so that all ignorable errors are less
3571 (eval_text, last_text): Obey C++ type safety rules.
3572 (numb_pow): Change return type.
3573 (exp_term): Adjust caller.
3574 (m4_evaluate): Fail on bad exponent.
3575 (logical_or_term, logical_and_term): Ignore failed ** in short
3577 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
3578 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
3579 to parse radix 1 numbers.
3580 (condition_term, comma_term): New parse functions.
3581 (shift_term): Support >>>.
3582 (m4_evaluate): Port patch from branch to output radix 1 numbers.
3583 Warn instead of error for most parse problems.
3584 * doc/m4.texinfo (Limits control, Eval): Document these changes.
3585 * NEWS: Document new operators and new command line option.
3587 2007-01-04 Eric Blake <ebb9@byu.net>
3589 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3591 2007-01-03 Eric Blake <ebb9@byu.net>
3593 * doc/m4.texinfo (Format, Incr): More merges.
3594 (Eval): Ensure C precedence rules are met.
3595 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3596 (not_term, logical_not_term): Delete; these are same precedence
3597 as other unary operators.
3598 (equality_term): New; these are lower precedence than relational
3600 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3601 operators for better error messages.
3602 (logical_or_term, logical_and_term): Short-circuit out the error
3603 of division by zero.
3604 (unary_term): Allow consecutive unary operators.
3605 * modules/m4.c (int2numb, numb2int): Delete; these potentially
3607 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3608 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3609 * NEWS: Document this change.
3611 2006-12-27 Eric Blake <ebb9@byu.net>
3613 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3615 * modules/m4.c (substr): Merge from branch.
3617 2006-12-26 Eric Blake <ebb9@byu.net>
3619 * doc/m4.texinfo (Changesyntax): Check for regressions with
3620 changesyntax(W=...).
3622 2006-12-22 Eric Blake <ebb9@byu.net>
3624 * m4/m4module.h (m4_set_syntax): Change signature.
3625 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3627 (changesyntax): Likewise, and update caller.
3628 * m4/m4private.h (m4_syntax_table): Add orig member.
3629 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3630 Don't set is_single_quotes and is_single_comments when the begin
3631 character is shadowed by another syntax type.
3632 (m4_syntax_create): Populate default syntax table.
3633 (add_syntax_attribute): Don't lose quote assignment.
3634 (remove_syntax_attribute): Only allow removing rquote or ecomm.
3635 (add_syntax_set, subtract_syntax_set, set_syntax_set)
3636 (reset_syntax_set): New helper routines.
3637 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3638 to default, and empty chars reverts that key to default.
3639 (check_is_single_quotes, check_is_single_comments): New helper
3641 * modules/m4.c (changecom): Merge from branch.
3642 * m4/input.c (m4__next_token): Rearrange token recognition order
3643 to macro, quote, comment, in order to match traditional
3645 * src/freeze.c (reload_frozen_state): Update caller.
3646 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3648 (Changeresyntax): Revise to match style of surrounding sections
3649 and add more examples.
3650 (Changesyntax): Likewise, and update to new semantics.
3651 * NEWS: Document this change.
3653 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3654 (M4wrap, Eval, Errprint): Fix typos.
3655 (Divnum): Not necessary to redivert in example.
3657 2006-12-21 Eric Blake <ebb9@byu.net>
3659 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3662 2006-12-19 Eric Blake <ebb9@byu.net>
3664 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3665 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3666 can track write errors without all other callers warning multiple
3668 (sysval_flush_helper): New function.
3669 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3670 * modules/gnu.c (esyscmd): Likewise.
3671 * tests/others.at (stdout closed, stdout full): Error message
3674 2006-12-16 Eric Blake <ebb9@byu.net>
3676 * src/main.c: Fix missing include.
3678 * src/main.c (main): Check for errors when closing stdin.
3679 * modules/m4.c (m4exit): Missed part of previous patch: flush
3680 stdin before a successful exit.
3681 Reported by Ralf Wildenhues.
3683 2006-12-14 Eric Blake <ebb9@byu.net>
3685 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
3687 * tests/others.at (stdin seekable): New test.
3689 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3691 * doc/m4.texinfo: Fix some typos.
3693 2006-12-04 Eric Blake <ebb9@byu.net>
3695 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
3697 (Modules): Make style consistent.
3699 2006-11-16 Eric Blake <ebb9@byu.net>
3701 * bootstrap: Relax m4 requirement, thanks to...
3702 * configure.ac (Gettext support): ...this workaround to the 1.4.4
3703 bug. Undoes restriction added on 2006-11-09.
3705 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
3706 diversions are now closed when not active.
3707 (divert): Remove check now in the manual.
3708 * tests/others.at (stderr closed): Likewise.
3709 (stdout closed): Add a check.
3710 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
3711 more docs with branch.
3713 2006-11-14 Eric Blake <ebb9@byu.net>
3715 Remerge sparse diversion handling from branch.
3716 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
3718 * m4/output.c (diversion_table): Change type to gl_oset_t.
3719 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
3720 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
3721 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
3722 (div0, diversion_storage): New variables.
3723 (diversions, equal_diversion_CB): Deleted.
3724 (threshold_diversion_CB): New callback.
3725 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
3727 (m4_tmpfile): Move cloexec action here.
3729 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
3732 2006-11-13 Eric Blake <ebb9@byu.net>
3734 Add several new command line options.
3735 * src/main.c (usage): Update.
3736 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
3737 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
3738 Make --regexp-syntax argument optional.
3739 (main): Support new options. Fix regression in interactive
3740 behavior from Nov 8.
3741 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
3742 M4_OPT_SYNC_OUTPUT_BIT.
3743 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
3744 syncoutput, to match option.
3745 (m4_parse_truth_arg): New prototype.
3746 * m4/utility.c (m4_parse_truth_arg): Implement it.
3747 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
3748 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
3750 * doc/m4.texinfo (Operation modes, Dynamic loading features)
3751 (Preprocessor features, Limits control, Debugging options)
3752 (Command line files): Update documentation.
3753 * tests/builtins.at (mkstemp): Simplify.
3754 * tests/macros.at (Command line pushdef): New test.
3755 (Command line define): Improve.
3756 * tests/options.at (--traceon and --traceoff, --syncoutput): New
3758 (POSIXLY_CORRECT): Likewise.
3759 (deprecated options): Augment.
3760 (--regexp-syntax): Update, now that -r takes optional arg.
3761 * NEWS: Reformat. Document new options.
3763 2006-11-11 Eric Blake <ebb9@byu.net>
3765 One step closer to allowing C++ compilation - don't blindly
3766 convert between char* and unsigned char*.
3767 * m4/m4module.h (m4_set_syntax): Change signature.
3768 * m4/m4private.h (m4_string): Use signed char.
3769 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
3770 (m4_get_syntax_ecomm): No longer a need to cast.
3771 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
3772 Reflect this change.
3773 * m4/macro.c (expand_argument): Simplify.
3774 (expand_token): Use proper type.
3775 * src/freeze.c (reload_frozen_state): Likewise.
3776 * m4/input.c (MATCH, match_input): Likewise.
3777 * modules/m4.c (translit): Likewise.
3778 * modules/gnu.c (substitute): Simplify.
3780 * m4/macro.c (trace_format): Use canonical type name.
3781 * m4/output.c (m4_freeze_diversions): Likewise.
3782 * src/freeze.c (produce_module_dump, dump_symbol_CB)
3783 (produce_frozen_state): Likewise.
3784 * m4/m4private.h (to_uchar): Grab from branch.
3785 * m4/input.c (string_peek, string_read): Use it.
3786 * m4/utility.c (skip_space): Likewise.
3787 * src/main.c (main): Likewise.
3788 * doc/m4.texinfo (Translit): Remerge from branch.
3789 * tests/builtins.at (translit): Test 8-bit range.
3790 * modules/m4.c (m4_expand_ranges): Merge from branch.
3792 2006-11-09 Eric Blake <ebb9@byu.net>
3794 * bootstrap: Validate that installed M4 is powerful enough.
3795 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
3797 2006-11-08 Eric Blake <ebb9@byu.net>
3799 Merge deferred handling of -D option from branch.
3800 * doc/m4.texinfo (Debugging options, Preprocessor features)
3801 (Dynamic loading features, Operation modes, Invoking m4):
3802 Document this change.
3803 * src/main.c (OPTSTRING): Specify in-order processing.
3804 (process_file): New function.
3805 (main): Use it to interleave files and deferred options.
3806 * tests/macros.at (Command line define): New test.
3807 * tests/generate.awk: Allow '@comment file' as first example
3809 * tests/options.at (option grouping): Update to reflect actual
3811 (file names): New test.
3813 2006-11-07 Eric Blake <ebb9@byu.net>
3815 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
3818 * tests/builtins.at (m4exit): New test; failed on cygwin before
3820 * m4/output.c (cleanup_tmpfile): Close files before removing
3822 (make_room_for, m4_output_exit): Ensure that atexit handler
3823 invoked from m4_error sees consistent state.
3825 * doc/m4.texinfo (Errprint): Merge another doc node.
3826 * tests/builtins.at (dumpdef, errprint): New tests.
3827 * modules/m4.c (errprint): Merge from branch: flush before
3830 2006-11-02 Eric Blake <ebb9@byu.net>
3832 * bootstrap: Update bootstrap requirement wording.
3833 Reported by Bruno Haible.
3835 2006-10-31 Eric Blake <ebb9@byu.net>
3837 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3839 * doc/m4.texinfo (Translit): Merge from branch.
3840 * modules/m4.c (divert, substr): Ignore excess arguments.
3841 (index, translit): Merge from branch.
3842 * tests/builtins.at (translit): Add a test.
3844 2006-10-30 Eric Blake <ebb9@byu.net>
3846 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
3848 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
3850 * modules/m4.c (m4_make_temp): Make safe across libtool.
3851 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
3852 * configure.ac (--with-modules): Accomodate changed module
3853 location when doing './configure --enable-debug'.
3855 2006-10-28 Eric Blake <ebb9@byu.net>
3857 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3860 2006-10-27 Eric Blake <ebb9@byu.net>
3862 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
3864 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3865 0.16, since 0.15 is incompatible with our automake requirement.
3867 * m4/macro.c (expand_argument): Fix missing initialization.
3868 * m4/m4private.h (struct m4_symbol_value): Store entire
3869 m4_builtin, not just the func.
3870 (m4_get_symbol_value_func): Update.
3871 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
3873 * m4/m4module.h (m4_get_symbol_value_builtin)
3874 (m4_get_symbol_builtin): New prototypes.
3875 (m4_set_symbol_value_func): Delete, replace with...
3876 (m4_set_symbol_value_builtin): New function.
3877 (m4_builtin_find_by_name): Change signature.
3878 * m4/symtab.c (m4_symbol_value_print): Simplify.
3879 (m4_get_symbol_value_func): Update.
3880 (m4_get_symbol_value_builtin): New function.
3881 (m4_set_symbol_value_func): Delete, replace with...
3882 (m4_set_symbol_value_builtin): New function.
3883 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
3884 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
3885 * m4/input.c (struct m4_input_block): Remove unused trace member.
3886 (m4_push_builtin, builtin_print, init_builtin_token): Update
3888 * m4/module.c (install_builtin_table): Likewise.
3889 * src/freeze.c (reload_frozen_state): Likewise.
3890 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
3891 token, even after the builtin has been undefined.
3892 * doc/m4.texinfo (Builtin): Document new capability.
3895 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3897 * modules/m4.c (m4_make_temp): Use it.
3898 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
3900 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3902 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
3905 2006-10-26 Eric Blake <ebb9@byu.net>
3907 Silence -O2 -Wall -Wwrite-strings warnings.
3908 * m4/m4private.h (m4_symbol_value): Const-ify text.
3909 * m4/m4module.h (m4_get_symbol_value_text)
3910 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
3911 (m4_set_symbol_value_placeholder): Likewise.
3912 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
3914 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
3915 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
3916 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
3918 * modules/format.c (format): Likewise.
3919 * src/main.c (main): Likewise.
3920 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
3921 * modules/shadow.c (shadow, test): Likewise.
3922 * m4/output.c (m4_make_diversion): Don't hold on to empty
3924 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
3925 (m4_freeze_diversions): Likewise. Don't use uninitialized
3928 Convert diversions to list instead of sparse array, part 2.
3929 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3931 * m4/output.c (m4_diversion): Add next pointer and divnum members.
3932 (diversion_table): Convert to a list instead of a sparse array.
3933 (free_list): Maintain free list of reclaimed diversions.
3934 (equal_diversion_CB, cmp_diversion_CB): New functions.
3935 (m4_output_init): Set up list.
3936 (m4_output_exit): Tear down list.
3937 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
3939 (m4_make_diversion): Change creation of new diversions.
3940 (m4_insert_diversion_helper): New function, to avoid list
3942 * tests/builtins.at (divert): The test now passes.
3943 * NEWS: Document this improvement.
3945 Convert diversions to list instead of sparse array, part 1.
3946 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
3948 * m4/output.c (diversion, total_buffer_size, output_unused):
3949 Track size in size_t. All users changed.
3950 (struct diversion): Reduce size now, to compensate for part 2.
3951 (m4_make_diversion, make_room_for): Avoid malloc overflow.
3952 (m4_output_exit): Fix typo in assert.
3953 (m4_output_init, make_room_for, m4_make_diversion)
3954 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
3955 struct m4_diversion to disambiguate the new union.
3956 * tests/builtins.at (divert): Detect this failure.
3958 2006-10-25 Eric Blake <ebb9@byu.net>
3960 * m4/m4module.h (m4_push_builtin): Add parameter.
3961 * modules/m4.c (defn): Update caller.
3962 * m4/input.c (file_read_init, string_read_init): No longer
3964 (input_funcs): Change signature of read_func, all callers
3966 (composite_peek, composite_read, composite_unget),
3967 (composite_print, composite_funcs): New input type. Not yet
3968 fully utilized, but one step closer to fixing defn.
3969 (m4_input_block): Make every input block track current file and
3970 line. Rename some members. Remove unused out_line. Add support
3971 for composite input block.
3972 (input_change): New flag.
3973 (file_peek, file_read, file_clean, file_unget, file_print):
3975 (m4_push_file, m4_push_builtin, m4_push_string_init)
3976 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3977 (m4_skip_line, pop_input): Track input block changes.
3978 (m4_pop_wrapup): Avoid overflow.
3979 (init_builtin_token): Handle composite input.
3980 (next_char): Handle input block changes.
3981 * doc/m4.texinfo (Location): Remerge from branch.
3983 * src/m4.h (includes): Need <locale.h> after all; fixes
3984 regression from yesterday.
3986 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
3988 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3989 Handle nesting the argc obstack.
3990 (expand_token): Avoid unnecessary malloc.
3991 (collect_arguments): Copy name before invalidating it.
3992 (argc_stack, argv_stack): New variables.
3993 (m4_macro_expand_input): Initialize argc and argv stacks once per
3994 file, instead of once per macro.
3996 2006-10-24 Eric Blake <ebb9@byu.net>
3998 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
4000 2006-10-23 Eric Blake <ebb9@byu.net>
4002 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
4003 from branch regarding stripped leading whitespace.
4005 * modules/m4.c (includes): Use safe headers even when configured
4006 with --enable-assert.
4007 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
4008 #defined as mkstemp_safer.
4010 2006-10-21 Eric Blake <ebb9@byu.net>
4012 * modules/m4.c (m4_make_temp): Change signature.
4013 (maketemp, mkstemp): Update callers.
4014 * modules/m4.h (m4_make_temp_func): New export.
4015 * modules/gnu.c (mkdtemp): New macro.
4016 * doc/m4.texinfo (Operation modes): Document interaction with
4018 (Mkdtemp): New node.
4019 * tests/builtins.at (mkdtemp): New test.
4020 (mkstemp): Check for umask effect.
4021 * NEWS: Document new builtin.
4023 * tests/generate.awk (normalize): Update recognition of trailing
4025 * doc/m4.texinfo: Minor formatting fixes from branch.
4026 (Foreach, Improved foreach): Merge from branch.
4027 * examples/foreach.m4: Merge from branch.
4028 * examples/foreachq.m4: New file from branch.
4029 * examples/foreach2.m4: Likewise.
4030 * examples/foreachq2.m4: Likewise.
4032 * doc/m4.texinfo (titlepage): Add myself as author.
4033 * src/main.c (AUTHORS): Likewise.
4035 2006-10-19 Eric Blake <ebb9@byu.net>
4037 * modules/m4.c (m4_make_temp, mkstemp): New functions.
4038 (maketemp): Add POSIX behavior and a warning.
4039 * tests/others.at (maketemp): Move this test...
4040 * tests/builtins.at (mkstemp): ...to here, and beef up.
4041 * tests/options.at (--safer): Update to new warning message.
4042 * doc/m4.texinfo (Mkstemp): Sync from branch.
4043 (Extensions): Update maketemp behavior.
4044 * NEWS: Document that maketemp now always warns.
4046 * tests/generate.awk: For ease of doc-writing, simplify selection
4047 of '-Ipath/to/examples' to '@comment examples'.
4048 * examples/forloop.m4: Simplify.
4049 * examples/forloop2.m4: New file.
4050 * examples/quote.m4: New file.
4051 * doc/m4.texinfo (Improved forloop): New node.
4052 (Manual): Clarify use of examples directory.
4053 (Shift, Forloop): Resync from branch.
4054 (Include, Location): Update to new usage of examples directory.
4056 * m4/system_.h (includes): Pick up <unistd.h> before checking for
4058 (gettext_noop): Don't define here, let gettext.h do it instead.
4059 * po/POTFILES.in: Update entries to reflect gnulib imports.
4061 2006-10-16 Eric Blake <ebb9@byu.net>
4063 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4065 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
4066 pkglibexecdir support.
4067 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
4068 worry about pathconf.h, now that gnulib does it for us.
4069 (pkgmodincludedir): Simplify.
4070 (pkglibexecdir): Delete, now that automake does this.
4071 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
4072 * src/main.c (usage): Likewise.
4073 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
4075 * doc/m4.texinfo: Port some changes from the branch.
4076 (Invoking m4): Promote to a chapter, instead of a section of
4078 (Operation modes, Dynamic loading features, Preprocessor features)
4079 (Limits control Frozen state, Debugging options)
4080 (Command line files): Subdivide into new sections.
4081 (Cleardivert): Rename from cleardiv.
4083 2006-10-14 Eric Blake <ebb9@byu.net>
4085 * tests/others.at (stdin closed): Update to match previous patch.
4087 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
4089 Reported by Ralf Wildenhues.
4091 * modules/m4.c (undivert): Merge from branch.
4092 * doc/m4.texinfo (Improved fatal_error): Fix typo.
4093 (Improved exch): New node, copied from branch.
4094 (Improved cleardivert): Update from branch.
4097 2006-10-13 Eric Blake <ebb9@byu.net>
4099 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
4101 * modules/gnu.c (builtin, indir): Transparently handle builtin
4103 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
4104 * m4/input.c (m4_pop_wrapup): Display debug message when switching
4106 (m4_input_init): No need to use empty file any more.
4107 (file_print): Display correct file name.
4108 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
4109 dereference a NULL file name.
4110 * m4/m4module.h (m4_pop_wrapup): New parameter.
4111 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
4113 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
4114 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
4115 * src/main.c (main): Adjust caller.
4116 * tests/options.at (--debugmode): Test more output from -dV.
4118 2006-10-12 Eric Blake <ebb9@byu.net>
4120 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
4122 * m4/m4private.h (m4__next_token_is_open): New prototype.
4123 * m4/m4module.h (m4_push_single): Delete; push_string is an
4124 adequate interface, and removing support for this simplifies the
4126 (m4_push_wrapup): New parameter.
4127 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
4128 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
4129 start-quote and start-comment exclusive from other syntax
4131 * m4/syntax.c: Likewise.
4132 * m4/input.c (input_funcs): Make polymorphic without requiring
4133 clients to know whether they are located at isp. All users
4135 (file_names): New variable.
4136 (m4_input_init): Initialize it.
4137 (m4_push_file): Use it.
4138 (m4_input_exit): Free it after use.
4139 (m4__next_token): Simplify slightly.
4140 (m4__peek_token): Rename and simplify...
4141 (m4__next_token_is_open): ... to this. In particular, this
4142 allows us to avoid a double ungetc, which POSIX doesn't
4144 (struct m4_input_block, m4_push_single, single_peek, single_read):
4145 Remove support for single characters, as the input engine now
4146 guarantees we don't need it.
4147 (file_unget, string_unget, m4_input_print, unget_input):
4148 Strengthen assertions.
4149 (file_init_funcs, file_read_init): New for file reading.
4150 (string_init_funcs, string_read_init): New for wrapped text.
4151 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
4152 Support wrapped text with locations.
4153 (m4_skip_line): Support dnl across include file boundary.
4154 (peek_char): Don't pop input when peeking.
4155 (file_peek): Peek can be called at the end of the file.
4156 (string_read): Don't read beyond string bounds.
4157 * m4/macro.c (expand_token, collect_arguments): Update callers.
4158 (expand_macro): Report errors at location of open parenthesis.
4159 (expand_token, expand_argument, process_macro): Avoid negative
4160 array dereferences with m4_has_syntax.
4161 * m4/utility.c (skip_space): Likewise.
4162 * modules/m4.c (m4wrap): Update caller.
4163 * tests/builtins.at (__file__, __line__, dnl): New tests.
4164 * tests/options.at (--debugmode): Normalize the output.
4165 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
4166 Remerge recent changes from branch.
4167 (Improved fatal_error): New node from branch.
4169 2006-10-11 Eric Blake <ebb9@byu.net>
4171 * src/main.c (usage, long_options): Add --debugmode as an alias
4172 for --debug, to match macro name.
4173 * tests/options.at (--debugmode): Rename from --debug, and test
4175 (--discard-comments): Augment test.
4176 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
4179 2006-10-10 Eric Blake <ebb9@byu.net>
4181 Trace improvements: debugmode(c) was always printing the last two
4182 lines paired, combine them; and show non-text expansions.
4183 * m4/macro.c (trace_prepre): Update to show what the macro will
4185 (trace_pre): No need to special-case on debugmode(c).
4186 (trace_post): Likewise. Also, show non-text expansions.
4187 (expand_macro): Update caller. Collecting arguments can change
4188 debug mode, so cache values beforehand.
4189 (trace_format): Remove support for unused %l%S%r, and fix support
4190 for %z to match gcc's attribute((printf)).
4191 (trace_header): Update caller.
4192 * m4/input.c (struct m4_input_block): Rename from input_block.
4193 (struct input_funcs): Add print_func member.
4194 (file_print, builtin_unget, builtin_print, string_print)
4195 (m4_input_print): New functions.
4196 (m4_push_string_finish): Change return type.
4197 (m4_push_file): Fix missing use of close parameter.
4198 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
4199 * m4/m4module.h (m4_input_print): New prototype.
4200 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
4201 to match behavior change.
4202 * tests/options.at (--debug): Likewise.
4203 * tests/macros.at (Propagation of traceon)
4204 (Propagation of --trace): Likewise.
4205 * tests/others.at (stderr closed, stdout closed, stdin closed):
4207 * doc/m4.texinfo (Forloop): Simplify.
4208 (Trace): Update to changed behavior.
4209 (Debugmode): Document this change.
4210 * src/main.c (usage): Likewise.
4213 2006-10-09 Eric Blake <ebb9@byu.net>
4215 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
4216 Reported by Ralf Wildenhues.
4218 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
4220 2006-10-07 Eric Blake <ebb9@byu.net>
4222 * m4/m4module.h (m4_set_exit_failure): New prototype.
4223 * m4/utility.c (m4_set_exit_failure): New function.
4224 * modules/m4.c (m4exit): Use it to avoid yet another global
4225 variable export in libm4.
4227 2006-10-06 Eric Blake <ebb9@byu.net>
4229 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
4231 * tests/others.at (stdout closed): Fix final check.
4233 Replace uses of tmpfile with clean-temp, since tmpfile is
4234 incompatible with closeout.
4235 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
4237 * tests/others.at (stderr closed): Likewise.
4238 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
4239 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4241 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
4242 (m4_tmpfile, cleanup_tmpfile): New functions.
4243 (make_room_for, m4_insert_diversion): Use clean-temp module.
4244 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
4246 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
4248 * m4/utility.c (m4_numeric_arg): Merge from branch.
4249 * modules/gnu.c (debuglen): New builtin.
4250 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
4251 Rename --arglength to --debuglen.
4252 * tests/options.at (--arglength): Rename to --debuglen.
4253 (deprecated options): Augment test.
4254 * doc/m4.texinfo (Invoking m4): Document the name change.
4255 (Debugmode): Rename from Debug Levels.
4256 (Debugfile): Rename from Debug Output.
4257 (Debuglen): New node.
4258 * NEWS: Document these changes.
4260 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
4261 case closing a module exits.
4263 * modules/m4.c (m4exit): Merge from branch.
4264 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
4266 2006-10-05 Eric Blake <ebb9@byu.net>
4268 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4270 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
4271 * src/main.c (main): Close stdout on exit.
4272 * m4/debug.c (set_debug_file): Check for write failure.
4273 * m4/m4.c (m4_delete): Don't mask write failure.
4274 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
4275 macros before calling AT_CHECK.
4276 (M4_ONE_MEG_DEFN): New helper macro.
4277 * tests/others.at (stdout full): New test.
4278 (stderr closed, stdin closed, stdout closed): Augment.
4279 * tests/builtins.at (syscmd): New test.
4282 2006-10-04 Eric Blake <ebb9@byu.net>
4284 * tests/builtins.at: Alphabetize tests.
4285 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
4286 * tests/generate.awk (new_test): Fix underquoting.
4287 * tests/others.at (maketemp): Rename from misc.
4288 (stdin closed, stdout closed, stderr closed): New tests.
4290 2006-10-03 Eric Blake <ebb9@byu.net>
4292 Avoid all global variables in modules, so that --disable-static
4294 * examples/incl.m4: New file, from branch.
4295 * Makefile.am (dist_pkgdata_DATA): Distribute it.
4296 * doc/m4.texinfo (Location): Merge this section from branch.
4297 (Include): Update the test.
4298 * tests/generate.awk (new_test): Allow for VPATH build
4299 pre-processing of expected __program__ output.
4300 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
4301 Avoid global variables.
4302 (m4_context_field_table): Add current_diversion, output_line.
4303 (m4_output_init, m4_make_diversion): Add parameter.
4304 (m4_get_program_name, m4_set_program_name): New accessors.
4305 * m4/m4private.h (m4_get_current_diversion),
4306 (m4_set_current_diversion, m4_get_output_line)
4307 (m4_set_output_line): New accessors.
4308 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
4310 * modules/m4.c (divnum, divert): Adjust callers.
4311 * modules/gnu.c (__program__): Likewise.
4312 * m4/output.c (m4_output_init, m4_make_diversion)
4313 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
4314 (m4_insert_diversion): Likewise.
4315 * m4/input.c (file_clean, m4_push_file): Likewise.
4316 * src/freeze.c (reload_frozen_state): Likewise.
4317 * src/main.c (main, usage): Likewise.
4319 Partially plug memory leak when unloading gnu module.
4320 * tests/modules.at (unload gnu module): New test.
4321 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
4322 (m4_regexp_compile): Move static storage to module visibility.
4323 * tests/options.at (--debug): Adjust to new output.
4325 2006-09-29 Eric Blake <ebb9@byu.net>
4327 Even when not the first option, --help can't have side effects.
4328 * tests/options.at (--debugfile): Detect bugs in this area.
4329 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
4331 * src/main.c (main): Fix it by deferring debugfile change. Also,
4332 defer closing streams until after module tracing is done.
4333 * modules/gnu.c (debugfile): Make message consistent with command
4335 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
4336 * NEWS: Document this fix.
4338 * modules/m4.c (dnl): Include macro name in warning message.
4339 * m4/input.c (m4_skip_line): Add parameter.
4340 * m4/m4module.h (m4_skip_line): Likewise.
4341 * src/main.c (usage): Update wording.
4342 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
4343 issue of blind macros vs. POSIX is resolved.
4344 (Dnl): Merge another node from branch.
4346 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4348 * m4/system_.h (N_): Define.
4349 * src/main.c (main): Validate numeric arguments.
4350 (size_opt): New function, idea borrowed from coreutils.
4351 * m4/macro.c (expand_macro): -L0 implies no limit.
4352 * doc/m4.texinfo (Invoking m4): Document this change.
4354 * tests/options.at: (--arglength, --nesting-limit)
4355 (--regexp-syntax): New tests of argument validation.
4357 2006-09-28 Eric Blake <ebb9@byu.net>
4359 * tests/options.at: Alphabetize the tests.
4361 2006-09-27 Eric Blake <ebb9@byu.net>
4363 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
4364 another parameter to print module info.
4365 * m4/macro.c (trace_pre): Adjust caller.
4366 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
4367 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
4368 * NEWS: Document this.
4370 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4372 * m4/symtab.c (symbol_value_print): Rename to...
4373 (m4_symbol_value_print): ...this, and...
4374 (m4_symbol_print): Update to allow -L length truncation. Now
4375 truncation also affects dumpdef output and builtin names.
4376 * m4/m4private.h (nesting_limit, max_debug_argument_length):
4378 * m4/m4module.h (m4_symbol_print): Add parameter.
4379 (m4_symbol_value_print): New function.
4380 * modules/m4.c (dumpdef): Allow length truncation.
4381 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
4383 * doc/m4.texinfo (Invoking m4): Document -l better.
4384 (Dumpdef, Debug Levels): Document the effect of -l.
4385 * NEWS: Document this change.
4387 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
4388 (m4_expand_ranges): Ensure we aren't picking up partial object on
4390 * modules/stdlib.c (setenv): Allow extra arguments.
4391 * modules/time.c (ctime): Avoid side effect in call to
4393 * modules/gnu.c (m4_regexp_substitute): Likewise.
4394 (renamesyms): Avoid extra obstack_init.
4395 * src/freeze.c (reload_frozen_state): Remove debug comment.
4396 (produce_frozen_state): Simplify fprintf to puts where possible.
4397 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
4398 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
4399 * m4/macro.c (trace_flush): Likewise.
4400 * m4/debug.c (m4_debug_message_prefix): Likewise.
4401 * m4/path.c (include_dump): Likewise.
4402 * m4/module.c (module_remove): Likewise.
4403 (install_builtin_table): Simplify malloc and string
4406 2006-09-26 Eric Blake <ebb9@byu.net>
4408 * m4/m4module.h (m4_symbol_print): New prototype.
4409 (M4_DEBUG_TRACE_STACK): New enumerator.
4410 (m4_is_debug_bit): Allow use without requiring m4private.h.
4411 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
4413 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
4415 (dumpdef): Allow printing pushdef'd stacks.
4416 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4417 * src/main.c (usage): Document it.
4418 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4421 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4423 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4424 of lines during make.
4425 (AM_CPPFLAGS): Remove unneeded include path.
4426 (src_m4_CPPFLAGS): Remove redundant include path.
4427 * m4/system_.h Make preprocessor indentation consistent.
4428 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4430 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4432 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4433 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4434 (bool, true, false): Don't undefine here; stdbool takes care of
4436 * src/m4.h (includes): Assume config.h, and several standard
4438 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4439 * m4/m4private.h: Assume config.h.
4440 * m4/output.c: Likewise.
4441 * m4/path.c: Likewise.
4442 * m4/resyntax.c: Likewise.
4443 * m4/utility.c: Likewise.
4444 * modules/gnu.c: Likewise.
4445 * modules/import.c: Likewise.
4446 * modules/load.c: Likewise.
4447 * modules/m4.c: Likewise.
4448 * modules/modtest.c: Likewise.
4449 * modules/mpeval.c: Likewise.
4450 * modules/perl.c: Likewise.
4451 * modules/shadow.c: Likewise.
4452 * modules/stdlib.c: Likewise.
4453 * modules/time.c: Likewise.
4454 * modules/traditional.c: Likewise.
4456 2006-09-21 Eric Blake <ebb9@byu.net>
4458 * doc/m4.texinfo (Invoking m4): Add clarification on option
4459 processing behavior.
4460 * tests/options.at (option grouping): Test this.
4462 Reported by Mikhail Teterin.
4464 * bootstrap: Add --force option, based on idea from coreutils.
4465 * README: Document that ./bootstrap and autoreconf are for
4466 developers, and not lightly done in tarballs.
4468 2006-09-20 Eric Blake <ebb9@byu.net>
4470 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
4471 warnings consistent.
4472 (long_options, HASHSIZE_OPTION): Warn on -H.
4473 * doc/m4.texinfo (Invoking m4): Document this.
4474 * tests/options.at (deprecated options): Update.
4476 Change the default of interactive sessions to match sh.
4477 * src/main.c (usage): Document this.
4478 (enum interactive_choice): New enum.
4479 (main): Use it to defer decision of interactive until after
4480 argument processing.
4481 * doc/m4.texinfo (Invoking m4): Document this.
4482 * NEWS: Likewise, plus add missing mention of -b.
4483 Reported by Stepan Kasal.
4485 2006-09-19 Eric Blake <ebb9@byu.net>
4487 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4488 well as --error-output; the goal is to add -o/--output in some
4489 future version with semantics like gcc or autom4te.
4490 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4491 (Extensions): Reflect this update.
4492 (Renamesyms): Add another test.
4493 (Defn): Xfail for now, so that `make check' is happy.
4494 * NEWS: Document this change.
4495 * tests/generate.awk: Mark dynamic loading tests as such. Allow
4497 * tests/macros.at (Renamesyms collisions): New test, exposing
4498 renamesyms' coredump.
4499 * tests/options.at (--debugfile, --safer): Update to match
4502 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4503 and stderr are same file, introduced 2003-07-23.
4504 * tests/options.at (--debugfile): New test, to catch the bug.
4505 (deprecated options): Test --error-output.
4506 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4507 Deprecate --error-output, and replace it with --debugfile.
4508 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4509 Document this change.
4512 2006-09-18 Eric Blake <ebb9@byu.net>
4514 * modules/load.c (modules): Rename to...
4515 (m4modules): ...this, since it is an English word with 0
4517 * modules/gnu.c (symbols, m4symbols): Likewise.
4518 * doc/m4.texinfo (Listing Modules): Rename to...
4519 (M4modules): ...this.
4520 (Symbols): Rename to...
4521 (M4symbols): ...this.
4522 (Load, Foreach, Trace, Answers): Update to new spellings.
4523 * NEWS: Document this.
4525 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4526 such that without arguments, the global trace flag is changed
4527 rather than walking the table of all currently-defined macros.
4528 (set_trace_CB): No longer needed.
4529 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4530 (m4_set_symbol_traced): Delete.
4531 (m4_symtab_create): Nuke the nuke parameter.
4532 * m4/m4private.h (m4_get_symbol_value): Delete.
4533 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4534 (m4_set_symbol_name_traced): Free undefined entries that are no
4536 (symbol_destroy_CB): Update caller.
4537 * m4/m4.c (m4_create): Update caller.
4538 * src/main.c (main): Likewise.
4539 (usage): Fix typo in last commit.
4540 * doc/m4.texinfo: Minor cleanups throughout.
4541 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4542 more nodes from branch.
4543 (Trace): Document new semantics, and how to simulate the old.
4544 * tests/builtins.at (multiquotes): Adjust to new semantics.
4545 * NEWS: Update somewhat.
4547 2006-09-14 Eric Blake <ebb9@byu.net>
4549 Add --safer option, per debian bug 5898.
4550 * src/main.c (usage): Document new option.
4551 (SAFER_OPTION): New enumerator.
4552 (main): Set the option bit.
4553 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4555 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4556 (m4_get_safer_opt): New accessor.
4557 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4558 * modules/m4.c (syscmd, maketemp): Likewise.
4559 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4560 (Sysval, Maketemp): Add tests of this.
4561 * tests/options.at (--safer): Likewise.
4563 2006-09-13 Eric Blake <ebb9@byu.net>
4565 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4567 Reported by Ralf Wildenhues.
4570 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4571 tests directory, so we can be sure an installed build is not
4572 picking up uninstalled non-test libraries.
4573 (check-local, installcheck-local): Depend on test libraries.
4574 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4575 after file name. Fix quoting. Remove skipping the test, now
4576 that makefile guarantees test modules will exist.
4577 (Freezing modules, modules: shadow, modules: unload)
4578 (modules: trace): Always put test modules in module path.
4579 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4581 * src/main.c (usage): Document default module search path.
4582 (import_environment, frozen_file_to_read, frozen_file_to_write):
4585 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4586 * tests/m4.in: ...not here.
4587 Reported by Ralf Wildenhues.
4589 2006-09-08 Eric Blake <ebb9@byu.net>
4591 * bootstrap: Kill unrelated copy-n-paste code from argument
4592 parsing. Let Makefile generate testsuite.
4593 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4595 2006-09-07 Eric Blake <ebb9@byu.net>
4597 * m4/m4module.h (m4_peek_input): No longer export.
4598 (m4_error_at_line, m4_warn_at_line): New prototypes.
4599 (m4_is_symbol_void): New macro.
4600 (m4_push_file): Update prototype.
4601 * m4/m4private.h (m4__peek_token): New prototype.
4602 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4603 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4604 * src/main.c (main): Allow reading from stdin twice.
4605 * modules/m4.c (include): Adjust to new prototype.
4606 * m4/input.c: General comment cleanup.
4607 (file_peek, file_read, file_unget, push_file): Set end flag on
4608 EOF, so that we don't call getc twice.
4609 (push_file, file_clean): Port fix from branch to avoid closing
4611 (pop_input): Port fix from branch to avoid reading free'd memory
4612 when input ends mid-string.
4613 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4614 (string_peek, string_read): Always use unsigned char.
4615 (m4_skip_line): Warn when dnl cut short by EOF.
4616 (peek_input): Rename from m4_peek_input.
4617 (match_input): Update signature, to distinguish between `(' token
4618 and multi-char quote or comment beginning with `('.
4619 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4620 (m4__peek_token): New function, ported from branch.
4621 (m4__next_token): Update to new token types.
4622 * m4/macro.c (expand_token, expand_argument): Use peek_token.
4623 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4624 (Invoking m4): Remerge from branch.
4626 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4627 (check-local): and put dependency here.
4628 Reported by Ralf Wildenhues.
4630 2006-09-05 Eric Blake <ebb9@byu.net>
4632 * m4/m4module.h (m4_debug_message): New prototype.
4633 (M4_DEBUG_TRACE_MODULE): New debug bit.
4634 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4635 (M4_DEBUG_MESSAGE2): Delete these macros.
4636 * m4/debug.c (m4_debug_message): New method.
4637 (m4_debug_decode): Add module tracing as flag `m'.
4638 * m4/input.c (m4_push_file, file_clean): Use new method.
4639 * m4/path.c (m4_path_search): Likewise.
4640 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4641 * m4/module.c (install_builtin_table, install_macro_table)
4642 (m4__module_open, module_close, module_remove): Promote several
4643 module debug messages outside of DEBUG_MODULES.
4644 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4645 DEBUG_MODULES with normal trace output.
4646 * src/main.c (usage): Document new flag.
4647 * doc/m4.texinfo (Debug Levels): Likewise.
4648 * Makefile.am ($(TESTSUITE)): Add missing dependency.
4649 * tests/m4.in: Neutralize platform-dependent module filenames.
4650 * tests/options.at (--debug): Update expected output.
4652 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4654 * doc/m4.texinfo: Fix some typos.
4655 * tests/others.at: Likewise.
4657 2006-09-05 Eric Blake <ebb9@byu.net>
4659 * m4/input.c (lex_debug): Remove dead code that broke compilation
4660 with --enable-debug.
4661 * m4/module.c (install_builtin_table, install_macro_table)
4662 (m4__module_init, m4__module_open, module_close)
4663 (module_remove): Fix compilation when --enable-debug.
4664 * m4/output.c (m4_shipout_text): Likewise.
4665 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4666 libraries when --enable-debug.
4667 * configure.ac (DYNAMIC_MODULES): New variable, to pass
4668 information to testsuite.
4669 (modules to preload): Determine modules after we know whether
4670 shared libraries are supported.
4671 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4673 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4674 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4675 (modules: shadow, modules: unload, modules: importing)
4676 (modules: trace): Use new macro.
4677 * tests/builtins.at (gmp): Likewise.
4679 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
4681 (expand_token): Avoid assertion just added to docs.
4682 (expand_macro): Track pending expansions, for when a symbol's
4683 definition changes during argument collection.
4684 (m4_macro_call, process_macro): Operate on symbol value, not
4685 symbol, since symbol may have changed during argument collection.
4686 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
4687 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
4688 (m4_get_symbol_value): Add fast macro version.
4689 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
4690 (m4_macro_call): Adjust prototype.
4691 * m4/module.c (install_builtin_table): Check that flags are valid
4692 when creating builtin.
4693 * m4/symtab.c (m4__symtab_remove_module_references): Use
4694 m4_symbol_value_delete, rather than inlining it.
4695 (m4_symbol_value_copy): Copy placeholder text.
4696 (symbol_popval): Use m4_symbol_value_delete.
4697 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
4698 Handle pending expansions.
4699 * modules/gnu.c (indir): Update to new prototype.
4700 * doc/m4.texinfo: Fix menus to be consistent with section names.
4701 (Defn): Add test that macro tokens flatten to empty string;
4702 triggered an assert before this patch.
4703 (Ifelse): Merge another node.
4704 (Loops): Split into...
4705 (Forloop, Foreach): New nodes; work is still underway on them.
4706 (Answers): Add more info on foreach macro; work is still underway.
4707 (Indir): Add test that indir collects arguments before looking up
4709 * TODO: Update based on this patch.
4711 2006-09-01 Eric Blake <ebb9@byu.net>
4713 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
4714 * m4/hash.h (m4_free_hash_iterator): New prototype.
4715 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
4716 ensure we don't do unsafe things while iterating.
4717 (HASH_ITER, ITER_CHAIN): New accessor macros.
4718 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
4719 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
4720 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
4721 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
4722 to catch unsafe actions.
4723 (m4_free_hash_iterator): New function, to avoid memory leaks, and
4724 when debugging, to track safe actions.
4725 (m4_hash_apply): Avoid memory leak.
4726 * m4/symtab.c (m4_symtab_apply): Likewise.
4727 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
4728 in manually to src/ for now.
4729 * tests/builtins.at (gmp): Add keyword module.
4730 * tests/modules.at (Freezing modules, modules: shadow)
4731 (modules: unload, modules: importing, modules: trace): Likewise.
4733 2006-08-30 Eric Blake <ebb9@byu.net>
4735 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
4737 (m4_bad_argc, m4_numeric_arg): Update all callers.
4738 * m4/macro.c (m4_macro_call): Likewise.
4739 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
4740 (Indir, Builtin, Ifdef): More doc merges.
4741 (Loops): Mention that documenting foreach would be nice.
4742 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
4743 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
4744 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
4745 (substitute, syncoutput): Update all m4_warn callers.
4746 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
4747 (traceon, traceoff): Make warning message consistent.
4748 (define, pushdef): Update all m4_warn callers.
4749 * tests/generate.awk: Choose file name so that documentation can
4750 show command-line behavior.
4751 * tests/builtins.at (define): Update to new wording.
4752 * tests/macros.at (pushdef/popdef): Likewise.
4753 * tests/freeze.at (loading format 1): Likewise.
4754 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4756 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
4758 (Defn): Add failing test case for mixing text and builtin.
4759 (Renamesyms): Improve wording, and identify core dump that needs
4762 2006-08-29 Eric Blake <ebb9@byu.net>
4764 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
4765 (Arguments, Pseudo Arguments): More doc merges from the branch.
4766 (Macro expansion): Turn example into test.
4767 (Pseudo Arguments): Add example of avoiding argument.
4768 * modules/m4.c (undefine, popdef): Accept multiple arguments.
4769 (define, pushdef): Warn on non-text macro name.
4770 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
4771 warning/error messages.
4772 (ifdef): Ignore extra arguments.
4773 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
4774 (m4__symtab_remove_module_references): Check that there is no leak.
4775 * tests/macros.at (pushdef/popdef): Update to new message.
4776 * tests/builtins.at (define): Likewise.
4777 * tests/freeze.at (loading format 1): Likewise.
4778 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4780 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
4781 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
4782 as accessor function, to avoid compiler warning.
4783 * m4/module.c (m4__module_open): Move declaration of variable to
4784 avoid compiler warning.
4785 * src/main.c (main): Avoid shadowing a global variable.
4786 * src/freeze.c (produce_symbol_dump): Avoid unused variable
4787 warning when NDEBUG.
4788 * tests/options.at (--discard-comments, --import-environment)
4789 (--debug, --prepend-include, --help and --version): Rename tests
4790 to name option tested.
4792 2006-08-28 Eric Blake <ebb9@byu.net>
4794 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
4795 * m4/module.c (install_builtin_table): ...to here, and add
4796 assertion that blind macros require arguments.
4797 * m4/m4module.h (struct m4_builtin): Document restrictions that
4798 must be met during module loading.
4799 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
4800 so require an argument to avoid triggering assertion.
4801 (debugfile): Tweak error message.
4803 2006-08-25 Eric Blake <ebb9@byu.net>
4805 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
4806 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
4807 (struct m4_builtin): New member flags replaces groks_macro_args,
4808 blind_if_no_args. min_args and max_args are now 0-based.
4809 Rearrange members to reduce size on platforms where function
4810 pointers are 64 bits but regular pointers are 32.
4811 (m4_bad_argc): Add argument.
4812 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
4813 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
4814 effect into account.
4815 * m4/module.c (install_builtin_table): Adjust all users affected
4817 * m4/macro.c (m4_macro_call): Likewise.
4818 * src/freeze.c (reload_frozen_state): Likewise.
4819 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
4820 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
4821 * modules/import.c (builtin_functions): Likewise.
4822 * modules/load.c (builtin_functions): Likewise.
4823 * modules/modtest.c (builtin_functions): Likewise.
4824 * modules/mpeval.c (builtin_functions): Likewise.
4825 * modules/perl.c (builtin_functions): Likewise.
4826 * modules/shadow.c (builtin_functions): Likewise.
4827 * modules/stdlib.c (builtin_functions): Likewise.
4828 * modules/time.c (builtin_functions, mktime_functions)
4829 (strftime_functions): Likewise.
4830 * doc/m4.texinfo (Loops): Update test now that shift is blind.
4831 (Macro Arguments): Fix typo in test.
4832 (Patsubst): Fix typo in test.
4833 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
4834 end of string. Fix return value when ignore_duplicates.
4835 * tests/builtins.at (patsubst): Fix typo in test.
4837 * tests/options.at (debug-flags): Update to reflect new message.
4838 (deprecated options, prepend-include, help and version): New
4840 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
4841 test omits an input file name.
4842 * src/main.c (long_options, main): Add -B/--prepend-include.
4843 (usage): Document it.
4844 (main): `m4 --help --version' now displays help, not version.
4845 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4846 dirname filenamecat.
4847 * m4/m4module.h (m4_add_include_directory): Add parameter.
4848 * m4/m4private.h (m4__include_init): New prototype.
4849 * m4/m4.c (m4_create): Put `.' on path before options are
4851 * m4/path.c (includes): Assume C89. Use gnulib for file name
4853 (m4__include_init): New function.
4854 (search_path_add): Allow prepending.
4855 (m4_add_include_directory, search_path_env_init): Adjust callers.
4856 (m4_path_search): Relative names now invoke path search, since
4857 `.' might not be first.
4858 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
4860 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
4861 and Eric Blake <ebb9@byu.net>
4863 * bootstrap: Run autopoint before gnulib-tool, since autopoint
4864 0.15 installs macros obsoleted by current gnulib.
4866 2006-08-25 Eric Blake <ebb9@byu.net>
4868 * doc/m4.texinfo (Macro Arguments): Another section merged;
4869 testsuite failures now exposed.
4871 2006-08-23 Eric Blake <ebb9@byu.net>
4873 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
4874 (Input processing): More doc merges from the branch.
4875 (Regular expression syntax): Add introductory text.
4876 (Inhibiting Invocation): More doc merges from the branch.
4877 (Other tokens): Reorder after comments.
4878 * tests/generate.awk: Allow passing options to doc examples.
4880 2006-08-22 Eric Blake <ebb9@byu.net>
4882 * tests/options.at (debug-flags): New test.
4883 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
4884 not negative, to distinguish failure in m4_debug_decode.
4885 (m4_debug_decode): Add new parameter.
4886 * modules/gnu.c (regexp): Slight cleanup.
4887 (renamesyms): Ignore excess arguments.
4888 (syncoutput): Make case-insensitive, warn on bad argument.
4889 (debugmode): Factor -+ handling out to...
4890 * m4/debug.c (m4_debug_decode): ...here.
4891 (m4_debug_message_prefix): Fix spacing.
4892 * src/main.c (main): Let -d option adjust flags.
4893 * m4/input.c (file_clean): Avoid printing empty file name.
4894 * doc/m4.texinfo (Syncoutput): Document new range of input.
4895 (Invoking m4): Document use of multiple -d flags.
4897 Start porting various fixes from the branch that use gnulib.
4898 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4899 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
4900 regexprops-generic stdlib-safer unlocked-io.
4901 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
4902 * m4/path.c (m4_path_search): Close input file on exec, reject
4903 empty file name, fix parameter naming.
4904 * m4/output.c (make_room_for): Close diversion file on exec.
4905 (includes): Assume C89 headers.
4906 (tmpfile): For now, we don't want tmpfile-safer, because we want
4908 * m4/m4private.h (includes): Use various gnulib headers.
4909 * doc/regexprops-generic.texi: Use gnulib's copy.
4911 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
4912 * AUTHORS: Add copyright.
4913 * ChangeLog: Likewise.
4914 * README: Likewise. Require automake 1.9b or later.
4915 * HACKING: New file.
4916 * README-alpha: Add copyright.
4917 * THANKS: Likewise. Update.
4918 * doc/STYLE: Add copyright, and tweak for changed directories.
4919 * modules/README: Add copyright, and tweak for libtool version.
4920 * examples/COPYING: New file.
4921 * examples/WWW/COPYING: Likewise.
4922 * examples/WWW/m4lib/COPYING: Likewise.
4923 * modules/shadow.m4: Add copyright.
4924 * modules/perl.m4: Likewise.
4925 * modules/modtest.m4: Likewise.
4926 * modules/stdlib.m4: Likewise.
4927 * modules/time.m4: Likewise.
4928 * modules/time2.m4: Likewise.
4929 * po/Makevars: Likewise.
4930 * tests/iso8859.m4: Likewise.
4931 * tests/m4.in: Likewise.
4932 * NEWS: Add (C) to copyright.
4934 * m4/system_.h: Likewise.
4935 * tests/atlocal.in: Likewise.
4936 * tests/builtins.at: Likewise.
4937 * tests/freeze.at: Likewise.
4938 * tests/generate.awk: Likewise.
4939 * tests/macros.at: Likewise.
4940 * tests/modules.at: Likewise.
4941 * tests/options.at: Likewise.
4942 * tests/others.at: Likewise.
4943 * tests/testsuite.at: Likewise.
4944 * m4/utility.c: Spell out copyright years.
4945 * src/main.c: Likewise.
4947 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
4949 2006-08-21 Eric Blake <ebb9@byu.net>
4951 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
4952 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
4953 when no arguments are given, but without losing warning about 0
4955 * modules/m4.c (syscmd): Likewise.
4956 (includes): Assume C89.
4957 (m4_sysval): Make static.
4958 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
4959 (sysval): Port calculation from branch.
4961 2006-08-20 Eric Blake <ebb9@byu.net>
4963 * m4/macro.c (expand_macro): Move argument check...
4964 (m4_macro_call): ...to here, so indir will warn.
4965 * modules/gnu.c (__program__): New macro, ported from branch.
4966 (builtin): Perform argument check.
4967 (changesyntax): Avoid out-of-bounds read.
4969 * modules/gnu.c (includes): Assume stdlib.h, errno.
4970 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4971 (substitute): Add caller parameter, avoid out-of-bounds memory
4973 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4976 2006-08-16 Eric Blake <ebb9@byu.net>
4978 * po/POTFILES.in: Add more files that contain translatable
4980 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4981 information to translators.
4982 (USE_MSGCTXT): New var for gettext 0.15.
4983 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4984 debug/trace messages in lower case.
4985 * m4/macro.c (expand_argument): Likewise.
4986 * m4/path.c (m4_path_search): Likewise.
4987 * src/main.c (main): Likewise.
4989 2006-08-14 Eric Blake <ebb9@byu.net>
4991 * src/main.c (usage): Document --import-environment.
4992 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4994 2006-08-11 Eric Blake <ebb9@byu.net>
4996 * bootstrap (func_get_translations): Only remove files when doing
4998 (func_update_po): Avoid CDPATH problems.
5000 2006-08-10 Eric Blake <ebb9@byu.net>
5002 * bootstrap (func_get_translations): New function.
5003 (func_update_po): Borrow ideas from tar to correctly pull in
5004 translations from newer location.
5006 2006-08-09 Eric Blake <ebb9@byu.net>
5008 * bootstrap: Recent gnulib no longer has jm_* macros to worry
5010 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
5012 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
5013 (m4_error, m4_warn): ... these new prototypes.
5014 (m4_current_file, m4_current_line): Move into context, rather
5015 than leaving as globals.
5016 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
5017 (m4_undivert_all, m4_input_init): Now takes context.
5018 * m4/utility.c (m4_error, m4_warn): New functions.
5019 * m4/m4private.h: Assume errno exists.
5020 (struct m4): Move warning_status to a bit flag,
5021 and add exit_status. Adjust accessors accordingly.
5022 * src/main.c (print_program_name_CB): No longer needed.
5023 (main): Use new m4_get_fatal_warnings_opt.
5024 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
5025 instead of issuing "INTERNAL ERROR". Pass context when needed,
5026 and use new accessors.
5027 * m4/input.c: Likewise.
5028 * m4/macro.c: Likewise.
5029 * m4/output.c: Likewise.
5030 * m4/utility.c: Likewise.
5031 * modules/evalparse.c: Likewise.
5032 * modules/gnu.c: Likewise.
5033 * modules/load.c: Likewise.
5034 * modules/m4.c: Likewise.
5035 * modules/mpeval.c: Likewise.
5036 * src/freeze.c: Likewise.
5037 * src/main.c: Likewise.
5038 * tests/macros.at: Adjust to new message format.
5039 * tests/builtins.at: Likewise.
5040 * tests/freeze.at: Likewise.
5041 * tests/modules.at: Likewise.
5042 * doc/m4.texinfo: Likewise.
5044 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
5047 2006-08-03 Eric Blake <ebb9@byu.net>
5049 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
5050 gracefully handle ENOSYS.
5054 2006-07-28 Eric Blake <ebb9@byu.net>
5056 * src/freeze.c (reload_frozen_state): Copy string when creating
5057 placeholder, to avoid memory corruption.
5058 * m4/symtab.c (symbol_popval): Avoid memory leak.
5059 (m4_symbol_rename): Avoid shadowing rename function.
5060 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
5061 * tests/freeze.at (reloading unknown builtin): Add test.
5062 * tests/generate.awk: Capture m4.texinfo line number in
5063 testsuite.log, not just generated.at.
5065 Port idea from branch that a frozen file can request an unknown
5066 builtin without producing a warning unless the builtin is
5068 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
5069 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
5070 (m4_set_symbol_value_placeholder): New accessors.
5071 * m4/m4module.h (m4_is_symbol_placeholder),
5072 (m4_get_symbol_value_placeholder),
5073 (m4_set_symbol_value_placeholder),
5074 (m4_get_symbol_placeholder): Likewise.
5075 * m4/symtab.c (m4_is_symbol_value_placeholder),
5076 (m4_get_symbol_value_placeholder),
5077 (m4_set_symbol_value_placeholder): Likewise.
5078 (dump_symbol_CB): Handle new symbol type.
5079 * m4/macro.c (trace_pre): Likewise.
5080 (m4_macro_call): Warn when invoking a placeholder.
5081 * modules/m4.c (dumpdef): Handle dumping a placeholder.
5082 (defn): Warn when referencing a placeholder.
5083 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
5085 (reload_frozen_state): When reloading unknown builtin, install a
5086 placeholder instead of warning.
5087 * tests/freeze.at (loading format 1): Allow warning when
5088 popdef'ing undefined function.
5090 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
5092 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
5093 function. Shift by 7, not 3, for consistency with
5094 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
5096 2006-07-27 Eric Blake <ebb9@byu.net>
5098 * src/main.c (usage): Update to match branch.
5099 (main): Update --version info to distinguish between program name
5100 `m4' and package name `GNU M4'.
5101 (AUTHORS): Translate René Seindal's name.
5102 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
5103 * Makefile.am (doc/m4.1): Update to match branch.
5104 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
5107 * m4/system_.h (EXIT_MISMATCH): Define.
5108 * src/main.c (main): Don't clear syntax table for version 1.
5109 (usage): Document exit status.
5110 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
5111 branch, and require V directive to appear first in file. Fix
5112 broken logic for detecting F and T in version 1 files.
5114 2006-07-22 Eric Blake <ebb9@byu.net>
5116 * src/main.c (stackovf_handler): Document the problems in our
5118 * src/stackovf.c: Forward port changes in branch to use POSIX
5119 sa_sigaction when available.
5120 (process_sigsegv): Avoid buffer overrun when error string is
5121 translated, although the fact that we translate in a signal
5122 handler is still a bug.
5123 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
5124 from branch to modernize checks.
5126 * modules/format.c (format): Avoid compiler warning that str may
5127 be used uninitialized.
5129 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
5131 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
5132 (DEBUG_MACRO): Remove unused macro.
5133 * src/stackovf.c: Avoid compiler warnings.
5134 * m4/input.c: Likewise.
5135 * m4/module.c: Likewise.
5136 * m4/output.c: Likewise.
5137 * m4/path.c: Likewise.
5138 * m4/symtab.c: Likewise.
5139 * m4/syntax.c: Likewise.
5141 2006-07-20 Eric Blake <ebb9@byu.net>
5143 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
5144 Regenerate to explicitly ask for --assume-autoconf=2.60.
5146 2006-07-19 Eric Blake <ebb9@byu.net>
5148 * po/ChangeLog: Merge into main ChangeLog, then delete file.
5151 * doc/m4.texinfo (copying): Relax restriction on front-cover and
5154 2006-07-17 Eric Blake <ebb9@byu.net>
5156 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
5159 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5161 * modules/format.c (includes): Use xvasprintf.h.
5162 (format): Make static. Avoid buffer overflow, that can lead to
5163 arbitrary code execution exploit. Only pass unsigned char to
5164 is*(). Support F, g, and G specifiers.
5165 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
5168 2006-07-17 Gary V. Vaughan <gary@gnu.org>
5170 Ensure M4 compiles correctly with -DDEBUG, and use a single
5171 consistent definition of various /DEBUG_[A-Z]+/ symbols:
5173 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
5174 (m4_print_token): Use m4_get_symbol_value_text and
5175 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
5176 and VALUE_FUNC respectively.
5177 (m4__next_token): Use m4_print_token call instead of obsolescent
5179 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
5180 * m4/output.c: Similarly for DEBUG_OUTPUT.
5181 * m4/path.c: Similarly for DEBUG_INCL.
5182 * m4/symtax.c: Similarly for DEBUG_SYM.
5183 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
5184 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
5185 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
5186 preprocessor macros defined with -DDEBUG compiles.
5188 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
5190 * bootstrap: Correct typo in --download-po argument parsing.
5192 2006-07-15 Eric Blake <ebb9@byu.net>
5194 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5196 * tests/generate.awk (normalize): Recognize @tabchar.
5197 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
5198 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
5200 (Index macro, Shell commands, Incompatiblities): Rename nodes
5201 from Index, UNIX commands, Other incompat.
5202 (Platform macros, Using frozen files, Frozen file format 1)
5203 (Frozen file format 2, Copying This Manual, Indices): New nodes.
5204 * Makefile.am (EXTRA_DIST): Distribute gendocs.
5205 (MAINTAINERCLEANFILES): Clean up files from gnulib.
5206 (doc_m4_TEXINFOS): Depend on fdl.texi.
5207 (web-manual): New maintainer target.
5209 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5211 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
5212 the modular architecture of M4. The result is paraphrased here
5213 for the benefit of future readers of the manual.
5215 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
5217 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5219 2006-07-14 Eric Blake <ebb9@byu.net>
5221 * src/main.c (main): Avoid compiler warning.
5222 * modules/gnu.c (renamesyms): Remove unused variable.
5224 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5226 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
5227 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
5228 new functions for managing regexp syntax options.
5229 * m4/m4private.h (m4): Add regexp_syntax field.
5230 * m4/resyntax.c: New file implements the above.
5231 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
5232 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
5233 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
5234 (m4_patsubst_do, m4_renamesyms_do): Removed.
5235 (builtin_changeresyntax): New builtin to change regular expression
5237 (m4_resyntax_encode_safe): Factor out diagnostics code.
5238 * src/freeze.c (produce_resyntax_dump): New function to dump
5239 default regexp syntax specifier to frozen file.
5240 (reload_frozen_state): Updated to action 'R' directive.
5241 * src/main.c (usage): Describe new -r option.
5242 (long_options, OPTSTRING): Declare it.
5243 (main): Encode and store cli regexp syntax option argument.
5244 * tests/freeze.at (regexp syntax): New test that regexp syntax
5246 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
5247 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
5248 (Epatsubst and Patsubst): Renamed to...
5249 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
5250 documentation and added new examples.
5251 (Changeresyntax): New section describing changeresyntax builtin,
5252 and regexp syntax names.
5253 (Regular expression syntax): New section describing differences
5254 between various regular expression syntaxes.
5255 (Frozen files): Document 'R' directive.
5258 2006-07-13 Gary V. Vaughan <gary@gnu.org>
5260 * bootstrap: Enhanced to work more like our other scripts:
5261 Add a copyright statement; support --version and --help; accept a
5262 --download-po option with argument as a substitute for DOWNLOAD_PO
5265 2006-07-11 Eric Blake <ebb9@byu.net>
5267 * Makefile.am (doc/m4.1): Port patch from branch that avoids
5269 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
5272 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
5274 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
5275 that `\0' is no longer accepted.
5277 * src/main.c (usage): Alphabetize options within their sections.
5279 * modules/gnu.c (m4_regexp_search, regsub, substitute)
5280 (esyscmd): Improve comments.
5282 * modules/gnu.c (substitute): Remove old warning for \0.
5283 (substitute_warned): No longer required. Removed.
5285 * modules/gnu.c: Put macro definitions into alphabetical order.
5287 2006-07-07 Eric Blake <ebb9@byu.net>
5289 * tests/freeze.at (loading format 1): New file, with new test.
5290 * tests/testsuite.at: Include it.
5291 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
5292 * tests/modules.at (Freezing modules): Likewise.
5294 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
5295 (AC_CHECK_HEADERS): Assume signal.h.
5296 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
5297 (AC_CHECK_FUNCS_ONCE): Likewise.
5298 * src/m4.h (includes): Assume signal.h.
5300 2006-07-05 Eric Blake <ebb9@byu.net>
5302 Fix all testsuite failures on cygwin.
5303 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
5304 branch-1_4. Solves testsuite failure when uninstalled m4 is
5305 shadowed by redefinition of PATH in libtool wrapper.
5306 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
5307 contains the -no-undefined required by cygwin.
5308 (TESTS_ENVIRONMENT): Export abs_top_builddir.
5309 * tests/others.at (misc): Port to platforms where /etc/passwd
5310 does not exist or does not contain user named root.
5311 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
5313 * tests/builtins.at (define, divert): Avoid overquoting.
5314 * tests/generate.awk (new_group): Likewise.
5316 2006-07-05 Gary V. Vaughan <gary@gnu.org>
5318 The regs_allocated field in a struct re_pattern_buffer refers
5319 to the state of a particular re_registers struct when used in
5320 successive matches using the same compiled pattern. Avoid a
5321 SEGV in `renamesyms' resulting from using a new re_registers
5322 with an existing re_pattern_buffer:
5324 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
5325 pattern buffer and registers.
5326 (m4_regexp_search): New function to call re_regexp_search with
5327 correctly matched pattern buffer and register instantiations.
5328 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
5331 2006-07-04 Gary V. Vaughan <gary@gnu.org>
5333 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
5334 changes to gnulib getopt.m4 since last build.
5335 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
5336 if the system getopt fails M4_GETOPT tests.
5338 2006-06-22 Eric Blake <ebb9@byu.net>
5340 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
5341 Reported by Bruno Haible.
5343 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5345 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
5347 2006-06-19 Eric Blake <ebb9@byu.net>
5351 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5353 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
5354 (clean-local): Split into and depend upon...
5355 (clean-local-tests, clean-local-src): ...these two. The latter
5356 removes the libtool object directory below `src', to work around
5357 a buglet in Automake, failing to list it.
5358 (EXTRA_DIST): Distribute modules/perl.c.
5360 2006-06-19 Eric Blake <ebb9@byu.net>
5362 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
5363 right side of dependency; VPATH does that.
5364 (stamp-vcl): Update to use libtool's algorithm.
5365 (EXTRA_DIST): Distribute stamp-vcl.
5366 Reported by Ralf Wildenhues.
5367 (TESTSUITE): Revert earlier change that used absolute path, as
5368 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
5369 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
5370 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
5371 atlocal takes care of it instead.
5372 (check-local, installcheck-local, clean-local): Inline absolute
5373 path to testsuite here, rather than relative path to testsuite
5376 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5378 * m4/m4private.h (DELETE): Cast away const here...
5379 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
5380 * src/freeze.c (reload_frozen_state): Avoid uninitialized
5383 2006-06-19 Eric Blake <ebb9@byu.net>
5385 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
5386 .info pages are built.
5387 Reported by Ralf Wildenhues.
5388 (EXTRA_DIST): Inline definition of testsuite, so that make dist
5391 2006-06-16 Eric Blake <ebb9@byu.net>
5393 Follow recommendations from autoconf manual for autotest.
5394 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
5395 turn it into an absolute path until autotest provides an option
5396 that allows us to avoid changing directories. Properly quote
5398 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
5399 (check-recursive): Delete unused target.
5400 ($(TESTSUITE)): Atomically update testsuite.
5401 (CD_TESTDIR): Simplify.
5402 (m4__cd): Delete unused macro.
5403 (check-local): Let TESTSUITEFLAGS influence the run.
5404 (installcheck-local): Let TESTSUITEFLAGS override
5405 AUTOTEST_PATH. Add dependencies.
5406 (clean-local): Clean up.
5407 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
5408 * README: Document how to use the testsuite.
5410 2006-06-15 Eric Blake <ebb9@byu.net>
5412 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
5414 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
5415 clashes with m4sugar.
5416 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5417 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5418 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5419 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5420 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5421 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5422 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5423 * configure.ac: Likewise.
5424 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5425 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5427 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5429 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
5430 const mpq_t is not assignable from plain mpq_t. Avoid
5431 type-punning warnings caused trying to mix these types.
5432 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5433 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5434 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5435 (mult_term, exp_term): Remove type-punning casts.
5436 (numb_pow): Remove const qualifier.
5437 * src/freeze.c (reload_frozen_state): Fix typo in messages.
5438 Fix variables that can be used uninitialized, which fixes
5439 security hole where malicious frozen file can execute arbitrary
5442 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5444 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5446 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5447 and Eric Blake <ebb9@byu.net>
5449 Allow `make dist' to work again.
5450 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5451 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5452 (cvs-dist): Fix typo.
5453 * NEWS: Match current version number.
5455 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5457 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
5460 * bootstrap: Do not run libtoolize manually, this is done
5461 correctly by autoreconf. Invoke autoreconf with --no-recursive
5462 to avoid unnecessary rerunning of autotools for libltdl.
5464 2006-06-13 Eric Blake <ebb9@byu.net>
5468 2006-06-12 Eric Blake <ebb9@byu.net>
5470 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5472 * src/m4.h: Don't declare mktemp.
5473 * m4/input.c (m4__next_token): Avoid bzero.
5474 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5475 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5476 than distributing outdated helptoman.pl.
5477 * doc/helptoman.pl: Delete.
5479 2006-06-10 Eric Blake <ebb9@byu.net>
5481 * README (Patches): Document the current dependence on CVS
5482 builds of autotools.
5483 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5484 * configure.ac: Use consistent quoting throughout.
5485 (AC_PREREQ): Bump to 2.59d.
5486 (AC_INIT): Package name begins with uppercase.
5487 (AC_ARG_WITH): Use AS_HELP_STRING.
5488 (AM_INIT_AUTOMAKE): Enable gnits mode.
5489 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5490 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5491 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5492 done by gnulib or automake, or which autoconf has declared
5494 * m4/m4private.h (Includes): Assume C89 or better, and use errno
5496 * m4/output.c (Includes): Likewise.
5497 * modules/gnu.c (Includes): Likewise.
5498 * modules/m4.c (Includes): Likewise.
5499 * src/m4.h (Includes): Likewise.
5501 * README-alpha: Update web address.
5502 * README: Likewise. Change encoding to ASCII. Remove old advice
5503 about cygwin. Document bootstrapping dependency.
5504 * AUTHORS: Update from branch-1_4.
5505 * THANKS: Likewise. Change encoding to UTF-8.
5506 * BACKLOG: Delete. This file is too old and unmaintained to be
5508 * ChangeLog: Change encoding to UTF-8.
5510 Avoid compiler warnings.
5511 * m4/macro.c (trace_format): Don't mark this as a printf format,
5512 since we don't accept the same set of modifiers as printf. It
5513 would be nice if gcc let us specify a custom format archetype.
5514 * src/main.c (main): Cast away const.
5516 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
5517 Eric Blake <ebb9@byu.net>
5519 * modules/time.c (ctime): Pass correctly typed variable to
5522 (localtime): Likewise.
5523 (strftime): Likewise.
5524 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5525 limit inherent in this interface.
5527 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
5529 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5530 (sysval): Use WEXITSTATUS.
5531 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5532 big-endian and little-endian wait status definitions.
5534 2006-05-06 Eric Blake <ebb9@byu.net>
5536 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5537 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5540 2006-05-06 Eric Blake <ebb9@byu.net>
5542 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5543 subdirectory to use.
5544 (support for -pipe): Move after LT_INIT, since it relies on
5547 2006-05-05 Eric Blake <ebb9@byu.net>
5549 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5553 2006-05-05 Bruno Haible <bruno@clisp.org>
5554 and Eric Blake <ebb9@byu.net>
5556 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5557 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5559 * bootstrap: Update usage of gnulib-tool.
5561 2006-05-04 Eric Blake <ebb9@byu.net>
5563 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5566 2005-12-05 Gary V. Vaughan <gary@gnu.org>
5568 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
5569 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5570 Reported by Eric Blake <ebb9@byu.net>
5572 2005-12-04 Gary V. Vaughan <gary@gnu.org>
5574 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5575 http caching as -C is no longer supported by wget 1.10.x.
5576 Reported by Eric Blake <ebb9@byu.net>
5578 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5580 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5582 (iface_id): ...an lt_dlinterface_id type.
5583 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
5584 throughout, instead of calling obsolete lt_dlhandle_find directly.
5585 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
5586 throughout, instead of calling obsolete lt_dlhandle_next.
5587 * m4/m4private.h (m4__module_find): Declare it.
5588 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5589 Use m4__module_next instead of obsolete lt_dlhandle_next.
5591 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5593 * bootstrap (func_update_po): Update pofiles directly from the
5594 translation project.
5595 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5596 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5597 these files under source control anymore.
5598 Suggested by Eric Blake <ebb9@byu.net>
5600 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5602 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
5603 file escaped the address updates on 2005-05-01.
5605 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5607 * bootstrap: Allow user overriding of gnulib-tool location, and
5608 correctly determine module source directories whether gnulib-tool
5609 is given as a relative or absolute path, or is found by searching
5611 Reported by Eric Blake <ebb9@byu.net>
5613 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5615 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5616 and $RM are defined for various versions of
5617 AC_LIBTOOL_COMPILER_OPTION.
5619 * bootstrap (AUTORECONF): New variable to allow user overriding of
5622 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5624 * doc/m4.texinfo (History): Add better notes on the ancestory of
5625 GNU m4, and other historical interest.
5627 2005-05-08 Gary V. Vaughan <gary@gnu.org>
5629 * m4/symtab.c (m4_symbol_rename): New function that performs a low
5630 level symbol rename.
5631 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5632 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5633 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5635 (erenamesyms, renamesyms): ...builtins that use these to implement
5636 macro renaming by regular expression.
5637 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5638 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5639 to stop the new generated tests from choking.
5641 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5643 Since most of the build is handled from a single Makefile.am now,
5644 we can teach make about the dependencies between the m4 binary and
5645 the preopened modules it is built against:
5647 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5649 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5650 of the preopened modules have changed.
5652 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5654 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5655 have a native implementation.
5657 2005-05-06 Gary V. Vaughan <gary@gnu.org>
5659 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
5660 handled already by gnu/exit.h.
5662 * configure.ac (gl_MODULES): Add assert to support a
5663 --disable-assert configure time option for NDEBUG setting.
5665 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5666 * bootstrap (src_modules): Add version-etc-fsf.
5667 * src/main.c (version_etc_copyright): Removed.
5669 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5671 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5673 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5675 * src/freeze.c (produce_frozen_state): Use \n line-endings even
5676 on Windows, so that the frozen file reader will work.
5677 Reported by Josef T. Burger <bolo@bolo.com>
5679 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
5681 Forward port of a patch that allowed m4-1.4.2 to compile on
5684 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
5686 * src/m4.h: And include them as appropriate.
5687 * src/main.c, src/stackovf.h: Don't include signal.h literally;
5688 m4.h will include the correct file.
5690 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5692 * m4/m4private.h: Make errno visible for the sources patched
5695 2005-05-04 Paul Eggert <eggert@twinsun.com>
5697 * src/main.c (print_program_name_CB): Preserve errno, since
5698 M4ERROR relies on this.
5699 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
5700 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
5701 * m4/path.c (m4_path_search): Don't let "free" trash errno when
5704 * m4/output.c (m4_insert_file): Don't assume errno has a valid
5705 value simply because fread returns zero. This fixes a
5706 portability bug reported by Marion Hakanson in
5707 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
5709 2005-05-04 Santiago Vila <sanvila@debian.org>
5711 * tests/stackovf.test: Use tempfile if available.
5713 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
5715 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
5716 * m4/output.c (m4_insert_file): Do not mix buffered and
5717 unbuffered I/O, as this breaks on the Hurd.
5719 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5721 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
5722 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
5723 and libtoolize does a better job of ltdl importing now too, so
5724 take advantage of that while updating the tree:
5726 * acm4, config: Moved from here...
5727 * ltdl/m4, ltdl/config: ...to here.
5728 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
5729 src/Makefile.am, tests/Makefile.am: Removed...
5730 * Makefile.am: ...and migrated to here, with adjustments to
5731 compensate for relative path differences.
5732 * commit: Adjust relative paths.
5733 * configure.ac: Adjust relative paths.
5734 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
5736 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
5737 the meanwhile, CVS HEAD libtool is needed.
5738 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
5739 stricly new enough, we also need a patch.
5740 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
5741 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
5742 (gl_MODULES): Don't list getopt and version-etc, as they don't
5744 * bootstrap: After running gnulib-tool to import the listed
5745 modules, fetch getopt and version-etc into src manually.
5746 (ltdldir): Change to ltdl.
5747 * src/main.c: Adjust for changes in version-etc API.
5748 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
5749 but works when the getopt module isn't to be included in the lib.
5750 * README: Add note about patching autoconf and automake to
5753 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
5755 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
5756 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
5757 empty file rather than to a nonexistent file. This closes a
5758 common security hole.
5759 * modules/m4.c (m4_maketemp): Implement the above, by using
5760 mkstemp rather than mktemp.
5762 2005-05-01 Gary V. Vaughan <gary@gnu.org>
5764 The FSF are moving offices today. Changed their contact address
5765 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
5766 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
5768 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5770 * tests/Makefile (clean-local): Ignore testsuite cleanup
5773 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
5775 * tests/Makefile (clean-local): Only run the testsuite cleanup
5776 if the testsuite has been generated.
5778 2005-02-11 Stepan Kasal <kasal@ucw.cz>
5780 * TODO: slight clarification of the example of qindir usage.
5782 2005-02-08 Gary V. Vaughan <gary@gnu.org>
5784 * TODO: Add qindir requirement, and defn bug.
5785 From Stepan Kasal <kasal@ucw.cz>
5787 2005-02-08 Stepan Kasal <kasal@ucw.cz>
5789 * TODO: Add ``execution stack'', fix a typo.
5790 * doc/m4.texinfo: Typos.
5792 2004-12-24 Eric Blake <ebb9@byu.net>
5794 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
5795 to the gnu subdirectory.
5796 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
5797 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
5798 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
5799 * m4/system_.h: Likewise, in non-configured includes.
5801 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
5802 Gary V. Vaughan <gary@gnu.org>
5804 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
5805 Protect definitions from macro expansion under -DNDEBUG by
5806 parenthesising the expanded function names.
5807 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5808 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5809 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5810 (m4_is_syntax_macro_escaped): Similarly protect function
5811 definitions from macro expansion under -DNDEBUG by #undefing the
5812 matching macro names before each definition. Also, move all the
5813 function definitions to the end of the file so that any
5814 invocations in the rest of the file pick up the fast macro
5816 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
5817 (m4_set_debug_file, m4_set_trace_messages)
5818 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5819 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5820 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
5821 option setter functions.
5823 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5825 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
5828 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5830 * src/main.c: Include gnulib files from the correct directory.
5832 * gnulib/*: Don't store any of the gnulib files in arch, as they
5833 generate spurious changes.
5834 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
5835 gnulib macros now share our macro directory.
5836 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
5837 * bootstrap: Call gnulib-tool to import from the gnulib tree.
5838 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
5839 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
5840 the gettext macros from autopoint that overwrite the gnulib-tool
5841 imported versions. Import sources and Makefile.am into the `gnu'
5842 directory. Changed all callers.
5843 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
5844 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
5845 for imported modules.
5846 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
5847 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
5848 hardcoding the gnulib macros they wrap.
5850 2004-07-15 Gary V. Vaughan <gary@gnu.org>
5852 Latest CVS libtool can preload modules in libraries, including
5853 its own module loaders! Tweak m4 so that it doesn't try to treat
5854 libltdl's module loaders as m4 modules when freezing and on exit:
5856 * gnulib/acm4/*.m4: Don't store these files in arch since they
5857 generate spurious changes.
5858 * bootstrap: Simplify initial libtoolize call, since CVS
5859 libtoolize is smarter these days.
5860 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
5862 * m4/module.h (m4__module_exit): Missing declaration.
5863 * m4/m4private.h (m4__module_next): New function declaration.
5864 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
5865 encapsulation. Changed all callers.
5866 (m4__module_interface): New function to verify m4 loadable module
5868 (m4__module_init): Register the interface validator.
5869 (m4__module_exit): Only close my own modules.
5870 * modules/m4.c (unistd.h): Provide missing declaration.
5871 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
5872 (m4_expand_ranges): More missing declarations.
5873 * modules/modtest.c (export_test): Ditto.
5874 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
5875 * src/main.c (main): Bump copyright year.
5876 * tests/modules.at: Fix sed syntax error.
5879 2004-06-17 Gary V. Vaughan <gary@gnu.org>
5881 Tweaking to enable compilation with latest CVS libtool and
5882 libltdl. We can't just dump the library files directly into the
5883 m4 directory anymore now that libltdl is built from pieces itself:
5885 * bootstrap: Rewritten to use latest libtoolize sanely, and to
5886 set up libltdl subdirectory.
5887 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
5888 gnulib subdirectory's config.
5889 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
5890 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
5892 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
5893 configure.ac, so use AC_WITH_LTDL instead.
5894 * Makefile.am (SUBDIRS): Add libltdl.
5895 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
5897 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
5898 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
5899 (libm4_la_LIBADD): Add LIBLTDL.
5900 * m4/ltdl.c, m4/ltdl.h: Removed.
5901 * m4/m4module.h: Include canonical ltdl.h.
5904 2004-06-14 Gary V. Vaughan <gary@gnu.org>
5906 * gnulib/import: Now updates makefile fragments, and configure.ac.
5907 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
5908 * gnulib/m4/Makefile.am: include it.
5909 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
5910 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
5911 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
5912 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
5913 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
5914 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
5915 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
5916 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
5917 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5918 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5919 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5920 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
5921 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
5923 * gnulib/m4/getopt_int.h: New source file from latest gnulib
5925 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
5926 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
5927 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
5928 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
5929 Updated source files from latest gnulib.
5931 2004-02-29 Gary V. Vaughan <gary@gnu.org>
5933 * config/mailnotify: New file for mailing commit notifications,
5934 imported from cvs-utils.
5935 * commit: Updated from cvs-utils and tweaked for m4.
5937 2003-12-01 Gary V. Vaughan <gary@gnu.org>
5939 * config/mkstamp: Updated from CVS libtool.
5940 * configure.ac: Generate a gnu coding standards compliant version
5941 number, and use it for the banner.
5942 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
5943 mhen the TIMESTAMP changes in ChangeLog, but the file modification
5944 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
5945 contain the previous version number.
5946 * src/main.c: Make --version output conform to the GNU standard.
5948 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
5949 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
5950 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
5951 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
5952 time_la_SOURCES): ...so that these are defaulted correctly, and
5953 can be removed from this file.
5954 (AM_LDFLAGS): Add -module...
5955 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
5956 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
5957 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
5958 the individual settings can be removed.
5959 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
5960 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
5961 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
5962 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
5963 time_la_LIBADD): ...so that these are picked up as a deplib of
5964 libm4 and don't need to be set explicitly.
5966 2003-11-18 Gary V. Vaughan <gary@gnu.org>
5968 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
5969 from the standard build. It is too fragile.
5971 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5972 CVS libtool after merging m4 changes across to libtool.
5974 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5975 * m4/path.c (search_path_add): Ditto.
5977 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5979 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5980 libtool tags we don't use in configure. This reduces the size
5981 of the script from over 1Mb to under 700Kb.
5983 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5985 The import script was not written properly, and the last gnulib
5986 import was incomplete. Fixed that problem, and reimport our
5987 gnulib dependencies, which picks up the address calculation
5988 overflow checks described by Paul below. Also tweak the clients
5989 of the gnulib xalloc module not to use deprecated macros:
5991 * gnulib/import: Recurse through module dependencies rather than
5992 naively descending only one level.
5993 * configure.ac: Add calls to gnulib's strnlen and extension module
5995 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5997 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5998 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5999 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
6000 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
6002 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
6003 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
6004 place of `xcalloc (1, S)'.
6005 * m4/m4.c (m4_create): Likewise.
6006 * m4/m4private.h (m4_symbol_value_create): Likewise.
6007 * m4/symtab.c (symtab_fetch): Likewise.
6008 * m4/syntax.c (m4_syntax_create): Likewise.
6009 * src/freeze.c (reload_frozen_state): Likewise.
6010 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
6012 * m4/symtab.c (m4_symtab_create): Likewise.
6014 2003-11-13 Gary V. Vaughan <gary@gnu.org>
6016 * tests/module.at: Comment typo.
6018 2003-10-10 Gary V. Vaughan <gary@gnu.org>
6020 * tests/modules.at (modules: importing): Apply some lateral
6021 thinking, and use AT_CHECK to compare the output of a sed pass
6022 over stderr against the canonical strerror string.
6024 * tests/modules.at (modules: importing): Edit the generated stderr
6025 output to canonicalize strerror output, before a comparison.
6027 2003-10-10 Gary V. Vaughan <gary@gnu.org>
6029 Tru64UNIX perl is sloppy with namespace pollution. This patch is
6030 careful not to trip over the mess:
6032 * modules/perl.c: Some builds of perl install headers that contain
6033 `#define try __builtin_try'. Be sure to undefine that macro
6034 before `m4/hash.h' gets included, which uses the `try' symbol.
6035 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
6036 `false' before including `stdbool.h'.
6037 (DELETE): This symbol is not in m4's namespace, and is in any
6038 case only used internally...
6039 * m4/m4private.h (DELETE): ...so move it to here.
6040 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
6042 2003-10-08 Paul Eggert <eggert@twinsun.com>
6044 Don't use XMALLOC and XCALLOC. Once we install the
6045 corresponding patch into gnulib, this will fix some
6046 address-calculation overflow bugs on hosts where calloc (A, B)
6047 returns garbage when A*B overflows.
6049 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
6050 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
6051 xmalloc, XCALLOC with xcalloc.
6052 * m4/m4.c (m4_create): Likewise.
6053 * m4/m4private.h (m4_symbol_value_create): Likewise.
6054 * m4/output.c (m4_output_init): Likewise.
6055 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
6056 * m4/syntax.c (remove_syntax_attribute): Likewise.
6057 * src/freeze.c (reload_frozen_state): Likewise.
6058 * src/main.c (main): Likewise.
6060 2003-10-07 Gary V. Vaughan <gary@gnu.org>
6062 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
6063 gnulib/acm4 directories for aclocal m4 macros.
6064 * gnulib/Makefile.am (EXTRA_DIST): Removed.
6065 (MAINTAINERCLEANFILES): Add Makefile.in.
6066 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
6068 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
6069 * gnulib/import: New file. Temporary script for updating gnulib
6070 imported files, until gnulib-tool is working.
6071 * gnulib/config/codeset.m4, gnulib/config/error.m4,
6072 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
6073 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
6074 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6075 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
6076 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6077 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6078 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6079 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
6080 gnulib/config/nls.m4, gnulib/config/obstack.m4,
6081 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
6082 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
6083 gnulib/config/regex.m4, gnulib/config/restrict.m4.
6084 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
6085 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
6086 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
6087 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
6088 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
6089 gnulib/config/xstrndup.m4: Removed.
6090 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
6091 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
6092 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
6093 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
6094 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
6095 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
6096 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
6097 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
6098 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
6099 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
6100 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
6101 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
6102 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
6103 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
6104 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
6105 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
6106 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
6107 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
6108 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
6109 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
6110 gnulib/import script.
6111 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
6112 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
6113 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
6114 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
6115 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
6116 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
6117 gnulib with gnulib/import script.
6118 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
6119 guards ready for gnulib-tool to autoupdate on import.
6120 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
6121 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
6122 config/stackovf.m4: Moved from here...
6123 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
6124 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
6125 acm4/stackovf.m4: ...to here, to separate aclocal macros from
6126 configure time helper scripts.
6127 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
6128 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
6129 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
6130 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
6132 * src/main.c (version_etc_copyright): Only output the current
6134 (version_etc): Call with new variadic API.
6136 2003-09-16 Gary V. Vaughan <gary@gnu.org>
6138 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
6139 version-etc module from CVS gnulib.
6140 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
6141 * src/Makefile.am: Build it.
6142 * src/main.c: Use it.
6144 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
6145 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
6146 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
6149 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
6150 Gary V. Vaughan <gary@gnu.org>
6152 * bootstrap: Separate options.
6153 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
6154 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
6156 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
6157 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
6158 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
6159 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
6160 $(LTLIBINTL) for gettext support on cygwin.
6161 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
6162 have $(LTLIBINTL) from the preloaded module la files.
6163 * README: Remove the warning about using --disable-nls on Windows
6166 2003-09-15 Gary V. Vaughan <gary@gnu.org>
6168 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
6169 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
6172 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6174 * doc/STYLE: Document the gnulib header naming conventions, and
6176 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
6177 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
6178 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
6180 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
6182 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
6183 module from CVS gnulib.
6184 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
6185 (gl_FUNC_STRTOL): In favour of the module macro.
6187 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6189 Replace the getopt code with CVS gnulib getopt. The source files
6190 detect whether they are in a glibc environment and preprocess away
6191 all of the code if there is a system getopt, so we can compile
6192 them into the m4 executable unconditionally:
6194 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
6195 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
6196 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
6198 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
6200 * src/Makefile.am: Adjust.
6201 * src/main.c: Always include our shipped getopt.h.
6202 * po/POTFILES.in: Use new location of getopt.c.
6204 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6206 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
6207 * config/Makefile.am: Removed. Automake 1.8 distributes the files
6208 in this directory automatically.
6209 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
6211 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
6213 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
6215 * modules/Makefile.am (pkglibexecdir): Set it here.
6216 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
6218 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
6219 Import regex module from CVS gnulib.
6220 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
6221 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
6222 do extra substitutions for Makefile.
6223 * configure.ac: Use it.
6224 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
6225 from regex_.h if necessary.
6226 * m4/system_.h: Include the correct version of regex.h.
6227 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
6229 * po/POTFILES.in: Use new location of regex.c.
6231 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
6232 realloc.c: automake distributes these files already.
6234 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6236 Replace the xstrzdup code by importing the xstrndup module from
6237 CVS gnulib, along with its dependencies: strndup and strnlen:
6239 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
6240 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
6242 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
6243 gnulib/config/strndup.m4: Ditto wrt strndup.
6244 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
6246 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
6247 However, contrary to gnulib, we install xstrndup.h.
6248 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
6249 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
6250 is an artifact of the old m4 portability layer.
6251 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
6252 * m4/system_.h: Include xstrndup.h.
6253 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
6255 2003-09-11 Gary V. Vaughan <gary@gnu.org>
6257 Reimport the latest xalloc module from CVS gnulib, and adjust the
6258 m4 sources to take advantage of xalloc xfree. Also create a new
6259 macro DELETE with the same semantics as the old m4 XFREE macro,
6260 and carefully tweak callers:
6262 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
6264 * m4/utility.c (xfree): Removed. This function is now supplied by
6266 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
6267 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
6268 * m4/symtab.c (m4_symtab_create): Ditto.
6269 * m4/system_.h: Removed XFREE redefine.
6270 (DELETE): New macro with same functionality as the original m4
6271 XFREE macro, but based on xalloc.h now. Changed all callers.
6272 * src/main.c (main): Use XMALLOC macro.
6273 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
6275 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
6277 2003-09-10 Gary V. Vaughan <gary@gnu.org>
6279 Import the xalloc module from CVS gnulib, along with its
6280 dependencies: exitfail, malloc and realloc. We had different
6281 semantics for our XFREE and a function xfree() not supplied by
6282 gnulib, so also a bit of work to keep everything running
6285 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
6286 (gl_XALLOC): Use gnulib equivalents.
6287 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
6288 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
6289 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
6290 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
6292 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
6293 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
6294 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
6296 (pkgincdir): Removed. Use pkgincludedir instead.
6297 * m4/m4private.h (XFREE): xfree already checks for NULL.
6298 * m4/system_.h: Use xalloc module, and remove macros already
6299 supplied by xalloc.h.
6300 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
6301 moved the old definition from m4/xmalloc.c to here for now.
6303 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6305 Import the error and progname modules from CVS gnulib. Our old
6306 error.c subsumed the functionality of both, so a little adjustment
6307 was required to accomodate the split in sources. Also added more
6308 wrapper macros to choose between a system installed error.h or our
6309 shipped gnulib error module:
6311 * m4/error.c, m4/error.h: Removed.
6312 * m4/Makefile.am: Adjust.
6313 (pkgincdir): Removed. Use pkgincludedir instead.
6314 * m4/module.h, src/main.c: Don't include `m4/error.h'.
6315 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
6317 * gnulib/m4/progname.c: Imported from CVS gnulib.
6318 * gnulib/m4/progname.h: Ditto.
6319 * src/main.c: Adjust to use progname module.
6320 * gnulib/m4/error.c: Imported from CVS gnulib.
6321 * gnulib/m4/error_.h: Ditto.
6322 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
6323 if appropriate, and link a local error.h if the system version is
6325 (libgnu_la_SOURCES) Add progname module sources.
6326 * gnulib/config/error.m4: Imported from CVS gnulib.
6327 * gnulib/config/strerror_r.m4: Ditto.
6328 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
6329 to have ERROR_H for Makefile substitutions and tell system.h
6330 whether the system error.h should be used, or a locally installed
6332 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
6334 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6336 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
6337 s/gettext_.h/gettext.h/.
6339 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
6340 automake have been fixed.
6342 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
6343 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
6344 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
6345 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
6347 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6349 The gnulib obstack module requires the gnulib gettext module for
6350 systems that do not have GNU gettext installed. Because we use
6351 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
6352 that directory incase it clashes with the system gettext.h. This
6353 delta uses gettext_.h and extra rules in the Makefile to make a
6354 link to gettext.h when needed:
6356 * Makefile.am (auxdir): Removed. No longer used.
6357 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
6358 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
6360 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
6361 Makefile based build.
6362 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
6363 of the macros are kept.
6364 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
6365 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
6366 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
6367 distributes these automatically.
6368 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
6369 warning from automake-1.7a.
6370 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
6371 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
6373 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
6374 wrt. m4_FUNC_OBSTACK.
6375 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
6376 wrt. m4_sys_STACKOVF.
6377 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
6378 wrt. _m4_LIB_GMP, m4_LIB_GMP.
6379 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
6380 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
6382 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
6383 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
6384 gettext.h link on deficient systems.
6385 (pkginc_HEADERS): Mention $(GETTEXT_H).
6386 (EXTRA_HEADERS): Mention gettext.h.
6387 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
6388 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
6389 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6390 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
6391 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6392 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6393 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6394 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
6395 gnulib/config/po.m4, gnulib/config/progtest.m4,
6396 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
6397 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
6399 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6401 We can't mirror the gnulib directory structure here, since we need
6402 to be able to eg. `#include <m4/obstack.h>' from our source files,
6403 which is much easier if the local obstack.h is created in a
6404 directory named m4. Rather than trying to symlink everything into
6405 the m4 directory, now we build a libtool convenience library from
6406 the sources we get from gnulib and link that with libm4.la:
6408 * gnulib/config/extensions.m4: Imported from CVS gnulib.
6409 * gnulib/config/unlocked-io.m4: Ditto.
6410 * gnulib/m4/unlocked-io.h: Ditto.
6411 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
6412 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
6413 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
6414 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
6415 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
6416 * m4/Makefile.am: Adjust.
6417 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6418 macros we redistribute.
6419 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
6420 library among others.
6421 (GNULIB_SRCS, GNULIB_MACROS): Removed.
6422 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6423 * config/m4-obstack.m4: Adjust.
6424 * po/POTFILES.in: Adjust.
6425 * configure.ac: Reformatting. Call newly imported gnulib macros.
6426 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6427 bogus calls of `#include "m4.h"'.
6428 * Makefile.am: INCLUDES has been deprecated in favour of
6430 * m4/Makefile.am: Ditto.
6431 * modules/Makefile.am: Ditto.
6432 * src/Makefile.am: Ditto.
6434 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6436 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6438 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6440 Migrate the obstack support into the gnulib directories for easy
6441 synchronisation with upstream files in gnulib:
6443 * config/gnu-obstack.m4: Moved from here...
6444 * config/m4-obstack.m4: ...to here.
6445 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6446 * m4/obstack.c, m4/obstack_.h: Moved from here...
6447 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6448 * po/POTFILES.in: Adjust.
6449 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6450 * m4/Makefile.am: Add a whole new section to link the obstack
6451 sources from the gnulib tree if necessary.
6452 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6454 * config/m4-obstack.m4: Rewrite as a wrapper for
6455 gnulib/m4/obstack.m4.
6457 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6459 GNU M4 currently builds with a number of files adapted from
6460 upstream sources. Recently the gnulib project on savannah.gnu.org
6461 has pulled together a great many of these externally maintained
6462 files. This delta is the beginnings of isolating those files
6463 maintained in gnulib to make it easy to synchronise M4 with the
6464 upstream files prior to releases.
6466 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6468 (SUBDIRS): Added new gnulib subdirectory.
6469 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6470 * config/stdbool.m4: Moved from here...
6471 * gnulib/m4/stdbool.m4: ...to here.
6472 * m4/stdbool_.h: Moved from here...
6473 * gnulib/lib/stdbool_.h: ...to here.
6474 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
6476 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6477 code to work with new stdbool_.h location.
6478 (gnulib_srcdir): New.
6480 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6482 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6483 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6485 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
6486 (EXTRA_DIST): Use it.
6488 * bootstrap: CVS autoreconf leaves file droppings. Remove
6489 aclocal.m4t incase autoreconf doesn't.
6491 2003-08-29 Gary V. Vaughan <gary@gnu.org>
6493 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
6494 the other gnulib imports, renamed to m4/obstack_.h.
6495 * m4/obstack.c: Updated from CVS gnulib.
6496 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6497 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6498 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
6499 about vpath already, and $top_srcdir upsets CVS Automake, so the
6500 $top_srcdir reference was removed.
6502 * m4/system-h.in: For consistency with the gnulib imports, renamed
6504 * m4/Makefile (EXTRA_HEADERS): Adjust.
6505 * configure.ac (AC_CONFIG_FILES): Adjust.
6507 * m4/stdbool_.h: New file from gnulib for systems without their
6509 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6510 * config/stdbool.m4: New file. Macros from gnulib for same.
6511 * configure.ac: Use it.
6513 2003-08-27 Gary V. Vaughan <gary@gnu.org>
6515 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6516 * config/gmp.m4: Ditto.
6517 * config/gnu-obstack.m4: Ditto.
6518 * config/stackovf.m4: Ditto.
6519 * m4/builtin.c: Ditto.
6520 * m4/debug.c: Ditto.
6521 * m4/error.c: Ditto.
6522 * m4/error.h: Ditto.
6523 * m4/gnu-obstack.h: Ditto.
6526 * m4/input.c: Ditto.
6528 * m4/m4module.h: Ditto.
6529 * m4/m4private.h: Ditto.
6530 * m4/macro.c: Ditto.
6531 * m4/module.c: Ditto.
6532 * m4/obstack.c: Ditto.
6533 * m4/output.c: Ditto.
6535 * m4/regex.c: Ditto.
6536 * m4/regex.h: Ditto.
6537 * m4/strtol.c: Ditto.
6538 * m4/symtab.c: Ditto.
6539 * m4/syntax.c: Ditto.
6540 * m4/utility.c: Ditto.
6541 * m4/xmalloc.c: Ditto.
6542 * m4/xstrdup.c: Ditto.
6543 * m4/xstrzdup.c: Ditto.
6544 * modules/evalparse.c: Ditto.
6545 * modules/format.c: Ditto.
6546 * modules/gnu.c: Ditto.
6547 * modules/import.c: Ditto.
6548 * modules/load.c: Ditto.
6549 * modules/m4.c: Ditto.
6550 * modules/m4.h: Ditto.
6551 * modules/modtest.c: Ditto.
6552 * modules/mpeval.c: Ditto.
6553 * modules/perl.c: Ditto.
6554 * modules/shadow.c: Ditto.
6555 * modules/stdlib.c: Ditto.
6556 * modules/time.c: Ditto.
6557 * modules/traditional.c: Ditto.
6558 * src/freeze.c: Ditto.
6559 * src/getopt.c: Ditto.
6560 * src/getopt1.c: Ditto.
6562 * src/main.c: Ditto.
6563 * src/stackovf.c: Ditto.
6565 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6566 ac_default_headers is an autoconf internal variable.
6567 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6568 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6570 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6571 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6574 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6576 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6578 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6579 possible or faking one with a typedef. Changed all callers.
6581 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6583 Still cleaning up the users' module API, by taking out the stuff
6584 that isn't used by any existing modules, and moving specialised
6585 functions out of libm4 and into the module they are used by.
6587 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
6588 * m4/utility.c (m4_skip_space): ...to here the home of its only
6589 use, made static and renamed to `skip_space'. Changed all
6591 * m4/m4module.h (m4_expand_ranges): Removed prototype.
6592 * m4/utility.c (m4_expand_ranges): Moved definition from here...
6593 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6595 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6597 * modules/gnu.c (builtin_syntax): Import and use in this
6598 builtin implementation.
6599 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6601 * m4/macro.c (trace_flush): Except here where the macro is now
6603 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6604 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6606 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6607 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6609 2003-08-14 Gary V. Vaughan <gary@gnu.org>
6611 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6612 compiler based AC_CHECK_HEADER that was introduced in
6614 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6615 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6616 * configure.ac: Use renamed M4_AC_LIB_GMP.
6618 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6619 macro that requires arguments! This stops the shell's bad
6620 substitution error at configure time.
6622 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6623 variables to the testsuite shell. Set the value of USE_GMP so
6624 that the gmp test will run!
6625 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6627 2003-08-11 Gary V. Vaughan <gary@gnu.org>
6629 Libltdl already has an excellent mechanism for accessing C symbols
6630 in modules. Lets use that! Remove all the exporting cruft and
6631 just use lt_dlsym in conjunction with a few conventions to
6632 simplify module writers' jobs. Also removed the table address
6633 caching code and otherwise simplified the module loader quite a
6634 bit. To access exported symbols in other modules, first the
6635 exporting module must name the symbols <modname>_LTX_<symname>,
6636 and the importing module must define a function type called
6637 <symname>_func. The importer then adds
6638 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6639 that wishes to call out to the exported functions. Care must be
6640 taken that <symname> is non-NULL in the importing module incase
6641 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6642 definition was in the importers source. Study
6643 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
6644 m4_module_import will attempt to automatically load a module
6645 required for symbol access if it is not loaded already.
6647 * TODO: Removed the items fixed in this delta.
6648 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6650 * m4/ltdl.h (lt_dlhandle_find): Declare it.
6651 * m4/module.c (m4_module_unload): Use it.
6652 * src/freeze.c (reload_frozen_state): Ditto.
6653 * m4/m4module.h (m4_export): Deleted. Removed all references.
6654 (M4_MODULE_IMPORT): New user convenience macro for importing
6655 arbitrary symbols from other modules.
6656 * m4/module.c (m4_module_import): New function to service
6657 M4_MODULE_IMPORT macro.
6658 (module_data): Removed. Looking up the tables on demand with
6659 lt_dlsym, rather than caching their addresses here simplifies the
6661 (m4_get_module_builtin_table, m4_get_module_macro_table):
6662 Removed. Changed all callers.
6663 (set_module_macro_table, set_module_builtin_table): Renamed to
6664 install_macro_table and install_builtin_table respectively, and
6665 simplified now that the cache is no more.
6666 * modules/gnu.c (builtin_symbols): Use this new mechanism to
6667 import m4_dump_symbols from the m4 module.
6668 (builtin_esyscmd): Likewise for m4_set_sysval and
6670 * modules/m4.c (m4_export_table): Removed. Functions are
6671 addressed with the new mechanism which doesn't need this.
6672 (m4_set_sysval): New exported accessor function to prevent
6673 problems with variable access on inferior architectures.
6674 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6675 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6676 that we can have some type safety.
6677 * modules/modtest.c (export_test): C level exported function for
6678 testing the new import mechanism.
6679 * modules/import.c: New file for the import end of the test.
6680 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
6681 * tests/modules.at: New test cases for intermodule symbol
6684 2003-08-07 Gary V. Vaughan <gary@gnu.org>
6686 * m4/m4module.c (m4_string): Moved from here...
6687 * m4/m4private.c (m4_string): ...to here.
6689 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
6691 2003-07-29 Gary V. Vaughan <gary@gnu.org>
6693 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
6694 already available to module writers through
6695 m4_{get,set}_nesting_limit_opt(), so moved from here...
6696 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
6697 (m4_create): Use it.
6699 2003-07-28 Gary V. Vaughan <gary@gnu.org>
6701 Aside from auditing path.c for m4module.h api obfuscation, this
6702 delta introduces the concept of private struct members in opaque
6703 data types to GNU m4: See the STYLE file for details.
6705 * TODO: Remind ourselves that a rewrite of path.c is needed.
6706 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
6708 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
6709 here and renamed. These type definitions are for internal api use
6710 only. Changed all callers.
6711 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
6713 * m4/path.c (search_path_env_init, search_path_add): ...to here
6714 and renamed. These calls were never used outside this file.
6715 Changed all callers.
6716 (dirpath): Moved functionality of this static declaration...
6717 * m4/m4private.h (struct m4): ...to this new internal only
6718 search_path field. Changed all callers.
6719 (m4__get_search_path): Added new internal api accessor.
6720 * m4/path.c (m4_search_path_info_new): Removed. Not used.
6721 (m4_include_init): Removed...
6722 * m4/m4.c (m4_create): ...because the new m4 field is now
6724 (m4_delete): Recycle search_path memory.
6725 * src/main.c (main): Don't call m4_include_init now that it's
6727 * doc/STYLE: Document convention for private fields in opaque
6730 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6732 Sometimes exporting the address of a symbol from a module isn't
6733 enough for other modules to call that symbol correctly. If
6734 custom data types are used for function parameters, they need to
6735 be known to the caller. This change introduces the concept of
6736 $(prefix)/include/modules/$(modulename).h to declare those
6737 structures. Also we move m4_dump_symbols from libm4 to the m4
6738 module to show this concept in action.
6740 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
6741 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
6742 exporting data structures from modules/m4.c.
6743 * modules/m4.c, modules/gnu.c: Include it.
6744 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
6745 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
6747 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
6749 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
6750 ...to here, with slight renaming.
6751 (m4_export_table): Prototype and add m4_dump_symbols.
6752 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
6753 definition of m4_dump_symbols.
6754 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
6755 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
6757 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6759 Create an export table in modules/m4.c in readiness for beefing up
6760 the module loader to track module exports and imports.
6762 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
6763 * m4/debug.c (m4_debug_flush_files): Moved...
6764 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
6765 * modules/gnu.c (builtin_esysval): Use it.
6766 * m4/m4module.h (m4_export): New type for declaring module symbols
6768 * modules/m4.c (m4_export_table): List symbols exported from this
6769 module for use by other modules.
6771 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6773 An experiment: There is loads of code in libm4 which should be in
6774 the m4 module, but is also used by another module. Just because
6775 some linkers won't cope with calls across dynamic runtime loaded
6776 objects I initially left the code in libm4. It will tidy the
6777 module api immensely if this code moves to the right place, I just
6778 need to remember to invent a suitable calling mechanism at some
6779 point. For now, only modules that are statically linked and
6780 preloaded will get this treatment, so the only platforms that will
6781 break are those that require all symbols to be resolved at link
6784 * TODO: Reminder that what I am doing could reduce portability
6785 unless I do something more robust later.
6786 * m4/m4module.h (m4_sysval): No longer exported from libm4.
6787 * m4/utility.c (m4_sysval): No longer declared in libm4.
6788 * modules/Makefile.am: Reformatting.
6789 * modules/m4.c (m4_sysval): Declare it at place of use.
6790 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
6792 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6794 * m4/m4module.h: Reformatting and rearranging lines a bit.
6795 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
6797 (m4_call_macro, m4_expand_input): Renamed...
6798 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
6800 (m4_expansion_level, m4_process_macro): Moved...
6801 * m4/macro.c (expansion_level, process_macro): ...to here, and
6804 * m4/m4module.h (program_name): Not used by modules at all, so
6806 * src/main.c (program_name): ...to here.
6807 (print_program_name): Renamed...
6808 (print_program_name_CB): ...to conform to the STYLE guide.
6810 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6812 More refactoring of the m4module.h API. Replace #defines with an
6813 enum, and move non-public functions out of the public API.
6815 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
6817 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
6818 * m4/debug.c (m4_debug, trace): Moved...
6819 * m4/m4private.h (struct m4): ...to fields of this struct.
6820 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
6822 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
6823 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
6824 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
6825 * m4/m4module.h (m4_context_field_table): Add entries for new
6826 debug_file and trace_messages fields.
6827 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
6828 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
6829 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
6830 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
6831 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
6832 (m4_is_debug_bit): New macro to simplfy checks against the debug
6834 (m4_trace_format, m4_trace_header, m4_trace_flush)
6835 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
6837 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
6838 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
6839 * m4/macro.c (trace_format, trace_header, trace_flush)
6840 (trace_prepre, trace_pre, trace_post): ...to these newly static
6841 functions, since they are only ever used from this file. Changed
6844 2003-07-17 Gary V. Vaughan <gary@gnu.org>
6846 Change the macros for checking syntax so that matching against
6847 multiple possible syntax classes can be done with a single
6848 comparison some of the time. The various classes are now bits of
6849 an int that can be checked with bitwise logic operators.
6851 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
6852 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
6853 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
6854 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
6855 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
6856 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
6857 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
6858 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
6859 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
6860 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
6861 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
6862 Replace all calls with invocations of these...
6863 (m4_is_syntax, m4_has_syntax): ...New macros.
6864 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
6865 is no longer required with new macros. Changed all callers.
6867 2003-07-15 Gary V. Vaughan <gary@gnu.org>
6869 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
6870 values are returned as part of the internal interface, so they
6872 * m4/private.h: ...to here.
6873 * m4/macro.c (expand_token): Check for out of range
6874 m4_peek_input() results before looking up in the syntax table.
6875 (collect_arguments): Ditto.
6877 * NEWS: Note `$' syntax class.
6879 2003-07-08 Paul Eggert <eggert@twinsun.com> and
6880 Gary V. Vaughan <gary@gnu.org>
6882 Conform to POSIX if the POSIXLY_CORRECT environment is set.
6883 --traditional `define' now smashes all the definitions.
6885 * NEWS: Explain this.
6886 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
6887 (Extensions): Explain that extensions that are incompatible with
6888 POSIX are disabled if POSIXLY_CORRECT is set.
6889 (Incompatibilities): Remove.
6890 (Define, Other Incompat): Explain difference
6891 between GNU and POSIX behavior of define, pushdef, popdef.
6892 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
6893 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
6894 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
6895 (m4_get_posixly_correct_opt): New macro.
6896 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
6898 * modules/m4.c (builtin_functions): defn now takes any number of args.
6899 (builtin_define): Smash all the definitions if
6901 (builtin_defn)): Allow any number of arguments.
6902 (builtin_undivert): Do not allow nonnumeric arguments
6904 * src/main.c (main): Set posixly-correct behavior if either
6905 POSIXLY_CORRECT is set, or if -G is given.
6906 * tests/builtins.at: New test for smashed definitions.
6908 2003-06-27 Gary V. Vaughan <gary@gnu.org>
6910 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
6911 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
6912 not to slow the parser down.
6913 (M4__IS_STRING): New macro to test string syntax class membership.
6914 * m4/syntax.c: Adjust docucomment.
6915 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
6916 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
6917 * m4/input.c (init_builtin_token): Comment typo.
6918 (m4__next_token): Comment typo.
6919 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
6920 by using the new M4__IS_STRING macro.
6921 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
6922 variable references in macro expansions.
6924 * doc/m4.texinfo (Eregexp and Regexp): Typo.
6925 (Epatsubst and Patsubst): Typo.
6928 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6930 Move the global variables that pertain to syntax to a new `struct
6931 m4_syntax_table', and then add one of these to `struct m4'. The
6932 ripple effect through the code to both change formerly global
6933 references, and make sure a suitable context is available in
6934 lexical scope is disproportionately large compared to the size of
6935 the change proper. This change is a large part of decoupling
6936 syntax.c from the rest of the code that uses it.
6938 * m4/m4private.h (struct m4): Add a syntax field.
6939 * m4/m4.c (m4_create): Initialise it,
6940 (m4_delete): Recycle it.
6941 (m4_get_symtab): Remove hand coded version...
6942 (m4_get_symbol_table): ...and generate this with cpp. Changed all
6944 * m4/m4module.h (m4_context_field_table): Add an extra field so we
6945 can generate m4_get_symbol_table. Add a new row for
6946 m4_get_syntax_table.
6947 (M4SYNTAX): Syntactic sugar for module writers.
6948 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
6949 (m4_syntax_table): New home for syntax related formerly global
6951 * m4/m4private.h (struct m4_syntax_table): Define it.
6952 * m4/input.c (m4_input_init): Initialisation of these formerly
6953 global variables moved...
6954 * m4/syntax.c (m4_syntax_create): ...to here.
6955 * m4/input.c (m4_input_exit): And similarly, recycling of the
6956 memory used by those values moved...
6957 * m4/syntax.c (m4_syntax_delete): ...to here.
6958 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
6959 Moved to m4/m4private.h.
6960 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6961 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6962 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6963 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
6964 objects. Changed all callers that used to directly access the
6966 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
6967 Removed and incorporated into m4_syntax_table structure.
6968 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
6969 * m4/syntax.c (m4_set_syntax): Now returns an error status,
6970 instead of requiring a `struct m4' to generate its own errors.
6971 Changed all callers.
6972 * src/main.c (main): Now that the syntax table is initialised as
6973 part of m4_create, we have to manually wipe the syntax entries if
6974 we are about to read a frozen file.
6976 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6978 * doc/STYLE: Added notes on callback naming schemes.
6980 * m4/module.c (m4_set_module_macro_table)
6981 (m4_set_module_builtin_table): Declarations weren't changed when
6982 definitions were renamed on 2003-06-19.
6984 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
6985 neither used nor particularly appropriate since it exposes the
6986 internal workings of the hash module. I haven't yet decided
6987 whether to remove it entirely.
6989 2003-06-20 Gary V. Vaughan <gary@gnu.org>
6991 Two related changes, and a huge knockon effect throughout the
6992 source: Moved the option variables out of global space and into
6993 `struct m4'; made `m4_symtab' a real datatype, so that its api
6994 is not marred passing `struct m4' around just so it can decide
6995 whether to keep traced symbol names or not. Added setters and
6996 getters for the formerly global option variables, and obviously
6997 changed a vast number of functions to take a `struct m4' and use
6998 the getter funcs to find option values.
7000 * m4/utility.c (interactive, sync_output, debug_level)
7001 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
7002 (max_debug_argument_length, warning_status, nesting_limit)
7003 (discard_comments): Removed.
7004 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
7005 (debug_level, max_debug_argument_length, prefix_all_builtins)
7006 (suppress_warnings, discard_comments, interactive, sync_output):
7007 Removed from here...
7008 * m4/m4private.h (struct m4): ...and equivalent fields added to
7010 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
7011 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
7012 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
7013 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
7014 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
7015 macros for the new fields.
7016 * m4/m4module.h (m4_context_field_table)
7017 (m4_context_opt_bit_table): Helper macros used to generate
7018 prototypes, setters and getters for new option fields
7020 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
7021 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
7022 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
7023 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
7024 (m4_get_interactive_opt, m4_get_sync_output_opt)
7025 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
7026 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
7027 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
7028 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
7029 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
7030 setter and getter functions generated by cpp from
7031 m4_context_field_table and m4_context_opt_bit_table, exported as
7032 part of the module api. Changed all callers.
7033 * m4/symtab (struct m4_symtab): Used as the concrete type for
7035 (m4_symtab_create): Allocate and initialise a new struct.
7036 (m4_symtab_apply): New function that works like m4_hash_apply, but
7037 with different callbacks specific to symbol tables. Changed all
7039 (symbol_destroy, arg_destroy, arg_copy): Renamed
7040 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
7041 they have unused parameters for a reason!
7042 (dump_symbol_CB): New callback to dump the contents of a single
7044 (symtob_dump): Rewritten in terms of dump_symbol_CB.
7045 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
7046 Changed all callers.
7047 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
7048 of the contained `m4_symtab' at the `no_gnu_extensions' field.
7049 Although I'm not convinced these semantics are correct, they are
7050 at least consistent with how things were before this delta. Also
7051 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
7053 2003-06-19 Gary V. Vaughan <gary@gnu.org>
7055 Tie down the interface to libm4 some more. Make more structures
7056 opaque to modules by moving them to m4private.h, and writing
7057 setters and getters. To win back the speed penalty for doing this
7058 also wrote macroized versions that do know about structure layout
7059 in m4private.h and #include that file into modules when NDEBUG is
7060 defined at compile time. There are still some accessor macros in
7061 m4private.h that need to go, but that is not necessary to clean
7064 * m4/m4module.h (m4_symbol_type): Moved...
7065 * m4/m4private.h (m4__symbol_type): ...to here.
7066 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
7067 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7068 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7069 (m4_get_symbol_func, m4_symbol_value_create)
7070 (m4_symbol_value_delete, m4_set_symbol_value_text)
7071 (m4_set_symbol_value_func): New exported api to symbols.
7072 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
7073 and m4_is_symbol_value_func.
7074 * m4/m4module.h: Prototype these guys.
7075 * m4/module.c (m4_set_module_macro_table)
7076 (m4_set_module_builtin_table): Make these static, there is no
7077 reason to pollute the api with them.
7078 * m4/m4private.h: Reformatting.
7079 (m4_get_symtab): Only define when NDEBUG is defined.
7080 (m4_get_symbol_value, m4_get_symbol_traced)
7081 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7082 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7083 (m4_get_symbol_func, m4_symbol_value_create)
7084 (m4_symbol_value_delete, m4_set_symbol_value_text)
7085 (m4_set_symbol_value_func): Macro implementations of the new
7086 functions when NDEBUG is defined.
7087 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
7088 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
7089 Superceded by the above. All callers changed.
7090 (M4ARG): Removed. This is no longer different to the
7091 m4/m4module.h definition.
7092 * modules/gnu.c, modules/m4.c: Only include m4private.h when
7093 NDEBUG is defined. That way we exercise the same (albeit slower)
7094 api that external modules must use.
7096 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7098 Renamed some of the types and their accessors to make more sense.
7099 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
7100 has a stack of SYMBOL_VALUEs.
7102 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
7103 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
7104 m4_get_symbol_value_type, m4_get_symbol_value_text,
7105 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
7106 Changed all callers.
7107 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
7108 (m4_get_token_type): Renamed
7109 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
7110 to the internal api.
7111 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
7113 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
7114 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
7115 (m4__token_type): Moved here from m4module.h.
7116 (m4__next_token): Renamed from m4_next_token.
7117 * m4/symtab.c: Removed some of the parameterised macro support
7118 functions for modularisation later.
7119 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
7120 m4_hash_dup to perform a true deep copy of the SRC.
7121 (arg_copy): Callback for m4_symbol_value_copy.
7122 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
7123 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
7124 m4_get_symbol_value_func. Changed all callers.
7126 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7128 Tidy up style of hash.[ch] in accordance with doc/STYLE.
7130 * m4/hash.c: Internal symbol renaming and formatting.
7131 (m4_hash_dup): New function to facilitate deep copies of hash
7133 (m4_hash_apply_func): Returns a void* now, which is a richer type
7134 for returning exceptions (NULL means keep going).
7135 (m4_hash_apply): Ditto.
7136 * m4/hash.h: Declare exported symbols with an explicit extern.
7139 2003-06-17 Gary V. Vaughan <gary@gnu.org>
7141 Still refactoring furiously. This delta represents a change in
7142 semantics to symtab.c. Instead of building temporary m4_tokens
7143 in the caller, and copying fields in the methods, we now create
7144 the actual m4_token for hashing in the caller so the methods just
7145 slot them in directly. Also, this means that we don't lookup a
7146 symbol and get back an allocated but VOID token to copy fields
7147 into, we create the token we want to push and pass that to
7148 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
7149 a few other small changes to stop knowledge of the implementation
7150 of symtab.c leaking out into other files.
7152 * m4/macro.c (expand_argument): Comment typo corrected.
7153 * m4/symtab.c (symtab_fetch): New function to fetch the address of
7155 (m4_symbol_pushdef): Take an extra value parameter and use this
7156 directly as the new top of the value stack. All callers changed
7157 to build a token and pass responsibility for memory in, rather
7158 than copying as we used to.
7159 (m4_symbol_define): Also use the new value parameter directly as a
7160 replacement for the top of the value stack. All callers changed
7161 to build a token as above.
7162 (m4_set_symbol_traced): New function to set the traced bit on the
7163 named symbol, creating it if necessary.
7164 (symbol_popval): The guts of the old m4_symbol_popdef.
7165 (m4_symbol_popdef): Use it.
7166 * m4/builtin.c (m4_symbol_set_token): Removed,
7167 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
7169 * m4/module.c (m4_set_module_builtin_table)
7170 (m4_set_module_macro_table): ...with these more orthogonal
7172 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
7173 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
7175 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
7176 (m4_arg_signature_parse): Moved...
7177 * m4/symtab.c: ...to here.
7178 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
7179 screw something up. Moved...
7180 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
7181 actually does a proper deep copy of source to dest.
7183 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7185 Further refactoring to stabilise the module API. Renaming some
7186 functions for orthogonality, and judicious definition migration to
7187 move things out of the set of exported symbols.
7189 * doc/STYLE: New file. Notes on coding style.
7190 * m4/m4module.c: Updated bitrotted docucomment at the top of the
7192 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
7193 m4_get_module_name, m4_get_module_builtin_table,
7194 m4_get_module_macro_table which are verb phrases. Changed all
7196 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
7198 * m4/module.c (m4_set_module_builtin_table)
7199 (m4_set_module_macro_table): ...here, and renamed. Changed all
7201 * m4/m4module.c (m4_module_data): This...
7202 * m4/m4private.c (struct m4_module_data): ...and this...
7203 * m4/module.c (module_data) ...consolidated here and no longer
7204 exported. Changed all callers.
7206 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7208 Begin work on lifting the curse of the global variables. To start
7209 with create a `struct m4' context container, and replace
7210 `m4__symtab' with `context->symtab' throughout. This means
7211 initialising a context container in main, and adjusting many
7212 functions between main and the module entry points so that the
7213 container gets passed through. It would have been nice to
7214 defer this until after 1.5, but it has a major effect on the
7215 user's module writing ABI, so it needs to be addressed now - at
7216 least in the areas that impact the ABI. An interrelated change
7217 in the symtab API removes the dependency on a global symbol table,
7218 and instead focuses on a passed table (from the context
7221 * TODO: Reminders for finishing context functionality.
7222 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
7223 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
7224 global variables and eventually allow m4 to be reentrant.
7225 * m4/m4private.h (m4): Define the new structure here...
7226 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
7227 don't carry the overhead of a function call.
7228 * m4/m4module.h: Prototype extern functions from m4/m4.c.
7229 (m4): Declare type for new struct m4 objects.
7230 (M4SYMTAB): User macro to ease finding the symbol table for the
7231 current context for module developers.
7232 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
7234 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
7235 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
7236 (m4_call_macro, m4_dump_symbols, m4_expand_input)
7237 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
7238 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
7239 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
7240 m4* context parameter. Changed definitions and all callers.
7241 (m4_symtab): Alias for m4_hash to decouple the
7242 m4_symtab api from m4_hash.
7243 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
7245 (m4_symtab_create): New function to return an initialised
7247 (m4_symtab_delete): New function to delete an m4_symtab's memory.
7248 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
7249 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
7250 instead of simply using the global m4__symtab. Changed
7251 definitions and all callers.
7252 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
7253 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
7254 * src/main.c (main): Create a context and use that instead of the
7255 former global m4__symtab.
7257 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7259 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
7260 to the callback. Callbacks should not need to hardcode the
7261 hashtable they are working from, nor should we have to waste the
7262 userdata parameter to pass the table in.
7263 * m4/hash.h (m4_hash_apply_func): Require the initial table
7265 * m4/symtab.c (symtab_destroy): Use the passed table instead
7266 of hardcoding m4__symtab.
7267 (m4_symbol_popdef): Don't use the userdata parameter to pass the
7268 table to arg_destroy.
7269 (arg_destroy): Use the hash parameter, ignore userdata.
7270 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
7272 (traceon, traceoff): Call set_trace with the extra initial
7275 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7277 More refactoring to stabilise the module api, this time for
7278 symtab.c. Additionally, start to pay attention to function names
7279 that don't contain a verb like they should.
7281 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
7282 wrapper for m4_hash_apply to decouple the symtab module from the
7284 (m4_symbol_builtin, m4_symbol_macro): Renamed to
7285 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
7287 (m4_symbol_delete): Create a macro version to save a function
7289 (m4_token_t, m4_data_t): These violate the POSIX reserved
7290 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
7292 (m4_token_type): Renamed to m4_token_get_type.
7293 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
7294 (m4_symtab_exit): Removed from the exported module
7296 * m4/m4private.h (m4__symtab, m4__symtab_init)
7297 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
7298 renamed and added to the internal api. Changed all callers.
7299 (m4_symtab_apply): A faster macro version of the function for
7300 users of the internal api.
7301 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
7302 symbol_destroy and arg_destroy.
7303 (symtab_debug): Added a prototype.
7304 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
7305 so that callers in this file get the faster macro versions from
7308 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7310 Refactoring modules to rationalise the API into an external
7311 documented (eventually!) API for use by modules in the `m4_'
7312 namespace declared in m4/m4module.h, an internal API between the
7313 source files we ship (including our shipped modules) in the `m4__'
7314 namespace declared in m4/m4private.h and making the rest as
7315 cohesive as possible with liberal use of the `static' keyword.
7316 This change represents an audit to m4/module.c along these
7319 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
7320 Removed. No longer used.
7321 (m4_module_close): Removed prototypes.
7322 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
7323 from the exported module api...
7324 * m4/m4private.h (m4__module_init, m4__module_open)
7325 (m4__module_exit): ...and renamed and added to the internal api.
7326 Changed all callers.
7327 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
7328 Centralised definitions after renaming...
7329 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
7330 (M4_FINISH_SYMBOL): ...and removing from here.
7331 (m4_module_dlerror, m4_module_remove, m4_module_close)
7332 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
7333 module_remove, module_close and caller_id.
7334 (MODULE_SELF_NAME): New macro to make reporting self errors
7336 (m4_module_load, module_close, module_remove): Use it.
7337 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
7339 * src/main.c (main): Use it.
7341 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7343 * README: Remove references to --enable-changeword, which has been
7344 removed from the code.
7346 2003-06-11 Gary V. Vaughan <gary@gnu.org>
7348 Getting rid of the annoying bug with configure --enable-debug,
7349 which spewed -e: command not found errors. This was an interaction
7350 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
7351 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
7352 branch-1-5) to get the full fix.
7354 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
7355 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
7356 and then use the probed value of $SED.
7357 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
7358 this, it messes up the AC_REQUIRE stack.
7360 2003-06-10 Gary V. Vaughan <gary@gnu.org>
7362 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
7363 the destroy callback.
7364 (m4_arg_destroy): Use the hash address to free the hash node key
7367 2003-06-06 Gary V. Vaughan <gary@gnu.org>
7369 First cut at formal parameters in macros.
7371 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
7372 * m4/xstrzdup.c: New file.
7373 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
7374 associative array of parameter names to details.
7375 (m4_symbol_token): Capture macro names with parameter lists.
7376 (m4_arg_signature_parse): And build an associative array to hang
7377 from the symbol structure to map names to details.
7378 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
7379 m4_hash_resize idiom. Now that we potentially add a little hash
7380 table to many of the entries in the symbol table, added an extra
7381 arg to set the initial size. Changed all callers.
7382 (m4_hash_apply): New function that is basically a generalised
7384 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
7385 all callers to call m4_hash_apply instead.
7386 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
7387 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
7388 m4_arg_signature association that might be attached to the symbol,
7389 * m4/hash.h (m4_hash_apply_func): Replacement type for...
7390 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
7391 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
7393 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
7394 (M4_IS_IDENT): Detect characters that can be safely used in
7396 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
7397 * m4/macro.c: Corrected grammar in some comments. Use `token'
7398 rather than `td' for m4_token variables.
7399 (m4_process_macro): If we find a dollar followed by some
7400 M4_IS_IDENT characters, replace that with the contents of the argv
7401 entry with offset stored in the m4_token_arg associated with the
7402 collected identifier.
7404 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7406 Begin preparations for supporting formal parameters in m4 macros.
7408 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
7409 the details of a formal parameter.
7410 (m4_token): Add an arg_signature member to hold a hash table for
7411 looking up formal parameters.
7412 * m4/input.c: Update more bitrotted comments.
7413 (m4_push_builtin): Initialise arg_signature member.
7414 (init_builtin_token): Copy arg_signature member.
7415 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
7416 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7418 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7419 (m4_macro_pushdef, m4_macro_define): ...these, And...
7420 (m4_symbol_token): ...wrapped around this new function, which
7421 vastly simplifies the arguments required by the functions it
7423 Changed all callers.
7425 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7427 * m4/macro.c: Format changes.
7429 2003-06-04 Gary V. Vaughan <gary@gnu.org>
7431 * m4/input.c: Updated various bitrotted comments.
7432 (m4_push_builtin): Just pass the whole m4_token, rather than
7433 extracting all the fields in the caller. This also allows us to
7434 check the token type for consistency.
7435 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7436 Renamed to builtin_funcs, builtin_peek, builtin_read,
7437 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7438 the code. Changed all callers.
7439 (struct input_block): Similarly renamed u_m member to u_b, and
7440 changed all callers.
7441 (m4_next_token): Use bzero to initialise the data fields.
7442 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7444 2003-05-29 Gary V. Vaughan <gary@gnu.org>
7446 These changes were necessary to get m4 to build on my iBook
7447 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7448 (GCC) 3.1 20020420 (prerelease)":
7450 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7451 inclusion of module loader headers.
7452 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7453 * m4/Makefile.am: Ditto.
7454 (libm4_la_LIBADD): Added $(LTLIBINTL).
7455 * m4/utility.c (program_name): Removed declaration in favour of
7456 the one already in error.c!
7457 * m4/m4module.h (program_name): Define to program_invocation_name
7458 when using GNU C library. Use an explicit extern declaration.
7459 (interactive, sync_output, debug_level, hash_table_size)
7460 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7461 (suppress_warnings, warning_status, nesting_limit, discard_comments)
7462 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7463 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7464 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7465 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7466 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7467 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7468 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7469 (m4_current_line, m4_current_diversion, m4_output_current_line):
7470 Don't rely on default, use an explicit extern.
7471 * m4/error.h (error, error_at_line, error_print_progname)
7472 (error_message_count, error_one_per_line): Ditto.
7473 * m4/ltdl.c: Update from CVS libtool.
7475 * commit: Update from CVS cvs-utils.
7477 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
7479 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7480 * po/boldquot.sed: New file, from gettext-0.11.5.
7481 * po/en@boldquot.header: New file, from gettext-0.11.5.
7482 * po/en@quot.header: New file, from gettext-0.11.5.
7483 * po/insert-header.sin: New file, from gettext-0.11.5.
7484 * po/quot.sed: New file, from gettext-0.11.5.
7485 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7486 * po/Rules-quot: New file, from gettext-0.11.5.
7488 2002-11-04 Akim Demaille <akim@epita.fr>
7490 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7492 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7494 2002-11-04 Akim Demaille <akim@epita.fr>
7496 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7498 2002-11-04 Akim Demaille <akim@epita.fr>
7500 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7501 used as `external', and Libtool 1.4.3.
7503 (LTLIBOBJS): Don't play with it.
7505 * Makefile.am (SUBDIRS): Remove intl.
7506 (ACLOCAL_AMFLAGS): Add -I config.
7507 (EXTRA_DIST): Add config/config.rpath.
7510 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7512 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7514 Preparations for refactoring syntax tables to allow reverse
7515 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7516 speed of normal lookups in an array of unsigned short.
7518 * m4/input.c (single_quotes, single_comments, use_macro_escape):
7520 * m4/m4private.h (m4__single_quotes, m4__single_comments,
7521 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
7522 is for internal symbols which unavoidably pollute the global
7523 namespace, but are not published APIs.
7524 Adjusted all callers.
7525 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7526 m4_set_comment, m4_set_syntax, set_syntax_internal,
7527 unset_syntax_attribute): Moved from this file...
7528 * m4/syntax.c: New. ...to this file.
7529 Also added an m4_syntax_exit stub for orthogonality.
7530 * src/main.c (main): Use it.
7531 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7532 * m4/m4module.h: Reformatting. New prototypes.
7534 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7536 * bootstrap (aclocal_apiversion): The aclocal apiversion is
7537 distinct from the automake release number (in that the apiversion
7538 apparently has no micro-version-component).
7539 (aclocal_apilibdir): Use it.
7541 2002-05-28 Gary V. Vaughan <gary@gnu.org>
7543 * m4/hash.c (m4_hash_resize): New function.
7544 * m4/hash.h: Add prototype.
7545 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
7546 benchmarking to find a good value for, say, autoconf. This is
7547 already a little quicker than before for me.
7549 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7550 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7552 * m4/hash.h: Adjust prototypes.
7554 2002-01-22 Akim Demaille <akim@epita.fr>
7556 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7558 * tests/Makefile.am (package.m4): New.
7559 * tests/atlocal.in: Adjust to CVS Autotest.
7560 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7561 * configure.ac: LIBOBJ is a forbidden string.
7562 Simplify AM_INIT_AUTOMAKE invocation.
7563 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7566 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
7568 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7570 2001-10-19 Akim Demaille <akim@epita.fr>
7572 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7574 2001-10-19 Akim Demaille <akim@epita.fr>
7576 * m4/input.c (m4_next_token): Display where was opened what is
7579 2001-10-19 Akim Demaille <akim@epita.fr>
7581 * m4/macro.c (expand_argument): Display where was opened what is
7584 2001-10-18 Akim Demaille <akim@epita.fr>
7586 * m4/input.c, modules/m4.c: Formatting changes.
7588 2001-10-17 Gary V. Vaughan <gary@gnu.org>
7590 * bootstrap: s/configure.in/configure.ac/
7592 2001-10-16 Gary V. Vaughan <gary@gnu.org>
7594 * m4/symtab.c (m4_symbol_destroy): This function calls
7595 m4_symbol_popdef, which recycles a symbols memory when the last
7596 definition is popped. Since we were passing the address of the
7597 symbol name found in the symbol table, and it was being removed
7598 partway through m4_symbol_destroy() we were referencing freed
7599 memory for the balance of the function. Now we take a copy of the
7600 symbol name tring and use that as a key into the symbol
7601 table... that way if the original symbol name is freed, the copy
7604 2001-10-13 Akim Demaille <akim@epita.fr>
7606 * m4/ltdl.c: Update.
7608 2001-10-13 Akim Demaille <akim@epita.fr>
7610 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7611 Don't gettextize internal error messages.
7613 2001-10-13 Akim Demaille <akim@epita.fr>
7615 * tests/macros.at (Arity and defn): New failing test.
7616 (Arity, defn, and freeze): New.
7618 Fix `Arity and defn'.
7620 * m4/input.c (m4_push_macro): Don't forget the arity.
7621 * modules/m4.c (defn): Likewise.
7623 2001-10-13 Akim Demaille <akim@epita.fr>
7625 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7627 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7628 (Propagation of traceon, Propagation of --trace): this new file.
7630 2001-10-13 Akim Demaille <akim@epita.fr>
7632 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7633 interface instead of (name, argc...).
7634 Upon failure, specify which argument was guilty.
7637 2001-10-13 Akim Demaille <akim@epita.fr>
7639 * modules/evalparse.c: Save translators' time: don't translate
7640 internal error messages.
7641 (m4_evaluate): Simplify/normalize error messages.
7642 * doc/m4.texinfo (Eval): Adjust.
7644 2001-10-13 Akim Demaille <akim@epita.fr>
7646 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7647 where no checking is needed.
7648 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7649 interface instead of (name, argc...).
7651 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7654 2001-10-13 Akim Demaille <akim@epita.fr>
7656 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7657 exclude the builtin name from the count.
7658 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7659 calling ifelse with a single argument is valid.
7660 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7661 with 1 and 2 args, mostly to strengthen the test suite.
7663 2001-10-13 Akim Demaille <akim@epita.fr>
7665 * m4/output.c (m4_make_diversion, m4_insert_file)
7666 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7668 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7670 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
7671 since we call these things builtins in the rest of the code!
7673 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7675 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7677 Rather than forcing each builtin definition to manage its own
7678 argument range checking, tabulate the maxima and minima for all
7679 builtins in each module. This forces us to consider what the
7680 valid ranges for each builtin should be, and moves the checking
7681 code out of each builtin implementation and into the builtin
7682 caller infrastructure.
7684 * m4/m4module.h (struct m4_builtin): Add argument minima and
7686 * m4/m4private.h (struct m4_token): Reflect them here too.
7687 * m4/input.c (struct input_block): ...and here.
7688 (m4_token_copy): New function for token copying.
7689 (init_macro_token): Copy them from a token to the input stack.
7690 (m4_next_token): Don't forget to initialise them for text
7692 * m4/macro.c (expand_argument): Use m4_token_copy, and also
7693 check argument counts before calling the builtin handler.
7694 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
7695 (m4_symbol_macro): Likewise.
7696 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
7697 parameters. Updated all callers.
7698 (m4_builtin_define): Ditto.
7699 (m4_macro_pushdef, m4_macro_define): Ditto.
7700 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
7701 * modules/evalparse.c: Declare argument counts for defined
7702 builtins and remove explicit calls to m4_bad_argc().
7703 * modules/gnu.c: Ditto.
7704 * modules/load.c: Ditto.
7705 * modules/m4.c: Ditto.
7706 * modules/modtest.c: Ditto.
7707 * modules/mpeval.c: Ditto.
7708 * modules/perl.c: Ditto.
7709 * modules/shadow.c: Ditto.
7710 * modules/stdlib.c: Ditto.
7711 * modules/time.c: Ditto.
7714 2001-10-10 Gary V. Vaughan <gary@gnu.org>
7716 The trace semantics now attach the trace bit to a symbol name.
7717 For as long as a traceon(`foo') is active, calls to foo will be
7718 traced regardless of intervening undefines or module unloads.
7719 Fixed the flag propogation issues differently to the fixes
7720 reverted with the last attempt at nailing down trace:
7722 * m4/m4private.h: This file is not visible outside of the m4
7723 source tree, so I removed all the `M4_' and `m4_' prefixes to save
7724 on typing. Updated all clients.
7725 (m4_token): New typedef contains the fields that need to be passed
7726 around with the low level tokeniser.
7727 (m4_token_data): Removed.
7728 (m4_symbol): Now contains the traced flag again.
7729 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
7730 the trace bit set. This change is contained entirely within this
7731 module and doesn't leak out into the callers. Updated all
7733 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
7734 new fields in m4_token. Updated all clients.
7735 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
7736 that `groks_macro_args' and `blind_if_no_args' flags are retained
7737 when defn() results are passed around in m4 code. Updated all
7739 (m4_builtin_define): Ditto.
7740 (m4_macro_pushdef, m4_macro_define): Ditto.
7741 * m4/input.c (struct input_block): Add a flags field to facilitate
7743 (m4_push_macro): ...use it.
7744 (init_macro_token): Retrieve it.
7745 (m4_next_token): Initialise it.
7746 * m4/macro.c (expand_argument): Copy it.
7747 * m4/m4module.h: Adjust.
7748 * tests/builtins.at: Adjust the expected output of the trace
7749 tests to reflect the change in semantics.
7750 * tests/modules.at (modules: trace): Check that unloading a
7751 module which supplies a traced symbol definition doesn't lose te
7754 2001-10-07 Gary V. Vaughan <gary@gnu.org>
7756 * modules/gnu.c (m4_macro_table): Display the timetamp when
7757 expanding __m4_version__.
7759 * configure.ac (--with-modules): Forgot a comma in the
7760 AC_HELP_STRING parameter list.
7762 2001-10-05 Gary V. Vaughan <gary@gnu.org>
7764 * bootstrap: Remove aclocal.m4t when it is no longer required.
7766 2001-10-05 Akim Demaille <akim@epita.fr>
7768 * tests/Makefile.am: Adjust for gnuprog2.
7769 * tests/m4.in: There can be a leading path.
7770 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
7771 * tests/testsuite.at: Adjust to the most recent Autotest.
7772 (AT_CHECK_M4_FILTER): Fix and rename as...
7774 * tests/others.at: Use it.
7776 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
7777 variable in shell scripts, one uses `$'...
7779 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7781 * configure.ac: `rm -f $m4_getopt_h' was lost.
7783 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7785 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
7786 time. Define it for config.h in order to...
7787 * src/main.c (main): ...display the timestamp for --version.
7789 2001-10-04 Akim Demaille <akim@epita.fr>
7791 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
7792 previous builtins `regexp' and `patsubst'.
7793 (regexp, patsubst): Use them.
7794 (eregexp, epatsubst): New builtins.
7795 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
7796 (Epatsubst and Patsubst, Eregexp and Regexp): these.
7797 (Extensions): More info on REs.
7799 2001-10-04 Akim Demaille <akim@epita.fr>
7801 * modules/modtest.c (init_handler): Consistently output to stderr.
7802 (finish_handler): New.
7803 (test): The `if' is an `assert'.
7804 * tests/modules.at: Adjust.
7806 2001-10-04 Akim Demaille <akim@epita.fr>
7808 * m4/utility.c (m4_bad_argc): Detail the mismatches.
7810 2001-10-01 Akim Demaille <akim@epita.fr>
7812 * tests/generate.awk: Tag the tests with `documentation'.
7813 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
7814 Use the make the existing modtest tests more uniform, and complete
7815 the set of possibilities.
7817 2001-10-01 Akim Demaille <akim@epita.fr>
7819 * config/gmp.m4: Consult the user before using GMP: use
7821 * configure.ac: Adjust.
7822 * modules/gmp.c: No protection needed as the module is not built
7825 2001-10-01 Akim Demaille <akim@epita.fr>
7827 * tests/generate.awk: Remove debugging code.
7828 (fatal): Specify the current location.
7830 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
7831 * modules/gnu.c, modules/m4.c: Use M4ARG.
7833 2001-10-01 Akim Demaille <akim@epita.fr>
7835 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
7836 (m4_regexp_compile): New.
7837 (regexp, patsubst): Use it.
7839 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7841 Reinstate the memory handling improvements from the patch I just
7842 reverted. Relevant ChangeLog entries repeated here:
7844 * m4/module.c (m4_module_remove): New function that holds the core
7845 of the old m4_module_unload.
7846 (m4_module_unload): Use it.
7847 (m4_module_unload_all): When we know the modules will never be
7848 used again (i.e. on exit), free up as much module memory as
7849 possible. There are still some artifacts from resident modules
7850 living inside ltdl.c, but everything else is freed.
7851 * m4/debug.c (m4_debug_exit): Free memory allocated in
7853 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7854 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7855 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7856 * m4/m4module.h: Updated prototypes.
7857 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7858 * m4/hash.h: Updated prototypes.
7859 * src/main.c (main): Use all these new functions to clean up as
7860 much memory as possible before exit.
7862 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7864 Reverted my large patch for removing the old m4_symbol
7865 structure on 2001-09-20. We are still not happy about the way
7866 trace works in conjunction with defn and undefine, and leaving
7867 the reverted patch active prevents us from moving the traced
7868 bit from the definition back to the symbol.
7870 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7872 * configure.in: Moved to...
7873 * configure.ac: ...here. Added a libtool like timestamped
7874 banner, and tidied up the libltdl cruft.
7875 * config/mkstamp: Script to extract a timestamp from ChangeLog.
7876 * modules/Makefile.am (INCLTDL): Removed. This is required
7877 only when libltdl is configured in a subdirectory.
7878 * src/Makefile.am: Ditto.
7879 (LIBADD_DL): No need to add this again, libtool already knows
7880 that libm4.la depends on it.
7881 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
7884 * TODO: stackovf.c is basically broken.
7885 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
7887 2001-09-28 Akim Demaille <akim@epita.fr>
7889 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
7891 2001-09-27 Akim Demaille <akim@epita.fr>
7893 * tests/m4.in: Don't use short options.
7894 Simplify the stderr signature normalization.
7896 2001-09-27 Akim Demaille <akim@epita.fr>
7898 tests/m4 shall be position independent.
7902 * tests/testsuite.at: No args to AT_INIT.
7903 * configure.in, tests/Makefile.am: Adjust.
7905 2001-09-22 Akim Demaille <akim@epita.fr>
7907 Autotest has changed again.
7909 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
7910 (package.m4): Remove.
7911 * configure.in: Adjust to LIBADD_GMP.
7913 2001-09-21 Gary V. Vaughan <gary@gnu.org>
7915 * config/gmp.m4 (AC_ARG_WITH): Removed.
7916 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
7917 (AC_LIB_GMP): When performing a test compile against libgmp,
7918 include the header gmp.h if possible, and link against -lgmp. If
7919 they both work define USE_GMP.
7920 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
7921 (mpeval_LTX_init_func): Complain on load that there was no libgmp
7924 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7926 * m4/evalparse.c: Moved to...
7927 * modules/evalparse.c: ...here. This code is shared between
7928 modules/mpeval.c and modules/m4.c, so there is no need to pollute
7929 the libm4 API with its details. Moderately rewritten to interface
7930 into its clients more simply.
7931 * m4/eval.c: Deleted. Migrated functionality to...
7932 * modules/m4.c: ...here.
7933 (builtin_eval): Implemented in terms of the new interface style.
7934 * modules/mpeval.c (builtin_mpeval): Ditto.
7935 * m4/m4module.h: Removed references to the former m4/eval.c.
7936 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
7937 (EXTRA_libm4_la_SOURCES): Deleted.
7938 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
7939 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
7941 2001-09-20 Akim Demaille <akim@epita.fr>
7943 * config/gmp.m4 (AM_WITH_GMP): Rename as...
7945 By default, use gmp.
7947 * configure.in: Adjust.
7948 Use Automake conditionals for USE_GMP.
7949 Always compute sizeof (long long int).
7950 This was a bug BTW, as `eval' (not `mpeval') depends on it:
7951 before, it was used _only_ if mpeval was not activated.
7952 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
7953 (mpeval_la_LIBADD): New macros.
7954 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
7956 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
7957 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
7960 2001-09-20 Akim Demaille <akim@epita.fr>
7962 * tests/Makefile.am (package.m4): New.
7963 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
7965 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7967 More cleanup. After the last patch, m4_symbol holds nothing but
7968 the head of a chain of m4_token_data. So I have removed the old
7969 m4_symbol, so that m4_token_data chains are stored directly in the
7970 value cell of a hash table node. But there's more... m4_symbol
7971 was a more natural name for the symbol value cell, and now that it
7972 is gone I have renamed the former m4_token_data structure to
7973 m4_symbol. This change turned out to be a pig to get right, since
7974 the original code didn't need to modify the value cell itself,
7975 since changing the chain happened inside the m4_symbol that used
7976 to be returned -- I had to pass the address of the value cell
7977 across various function calls, incase the head value changed. I
7978 also tightened up the memory management to help me find a nasty
7979 memory corruption bug that took me all night to track down...
7981 * m4/m4private.h (struct m4_symbol): Removed.
7982 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
7984 * m4/hash.c (m4_hash_iterator_value): Return the address of the
7985 value cell. Updated all callers.
7986 * m4/symtab.c: Took advantage of the simplification in the data
7987 structures to rewrite a lot of this file more simply. There is
7988 still some room for optimisation here, but we should tackle that
7989 systematically closer to the release.
7991 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7992 revealed. This version is ahead of CVS libtool until I get chance
7993 to flush my changes.
7994 * m4/module.c (m4_module_remove): New function that holds the core
7995 of the old m4_module_unload.
7996 (m4_module_unload): Use it.
7997 (m4_module_unload_all): When we know the modules will never be
7998 used again (i.e. on exit), free up as much module memory as
7999 possible. There are still some artifacts from resident modules
8000 living inside ltdl.c, but everything else is freed.
8001 * m4/debug.c (m4_debug_exit): Free memory allocated in
8003 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
8004 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
8005 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
8006 * m4/m4module.h: Updated prototypes.
8007 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
8008 * m4/hash.h: Updated prototypes.
8009 * src/main.c (main): Use all these new functions to clean up as
8010 much memory as possible before exit.
8012 2001-09-18 Gary V. Vaughan <gary@gnu.org>
8014 The `traced' flag needs to be attached to the definition of a
8015 symbol rather than the current symbol containing the definition.
8016 Implementing this showed up some long standing post 1.4 bugs in
8017 flag propogation which I also fixed.
8019 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
8020 (struct m4_token_data): And add it back in here.
8021 * m4/input.c (init_macro_token): Propogate the traced flag
8023 * m4/macro.c (expand_argument): Ditto.
8024 * tests/builtins.at (trace2, trace3): New tests based on Akim's
8027 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8029 * m4/m4private.h (struct m4_token_data): Simplified by removing
8030 the redundant `traced' flag, and one level of structure nesting.
8031 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
8032 * m4/input.c (init_macro_token): No need to initialise removed
8034 * m4/macro.c (expand_argument): No need to copy it either.
8035 * m4/utility.c (m4_token_data_func_traced): Or provide an access
8038 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
8039 dependant on multiple symbols with the same key, so preserving
8040 relative symbol order in each bucket during resizing is no longer
8041 required. The resize function is considerably faster as a result.
8043 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
8044 s/m4_symbol_insert/m4_symbol_define/g;
8045 s/m4_builtin_insert/m4_builtin_define/g;
8046 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
8048 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8050 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
8051 commits, the m4_lookup_symbol dispatch function is split into
8052 specialised functions that must be called directly.
8054 * m4/m4module.h (m4_symbol_lookup_t): Removed.
8055 * m4/symtab.c (m4_lookup_symbol): Removed.
8056 (m4_symbol_builtin, m4_symbol_macro): New functions.
8057 * m4/builtin.c (m4_builtin_define): Split into...
8058 (m4_builtin_pushdef, m4_builtin_insert): ...these.
8059 (m4_macro_define): Split into...
8060 (m4_macro_pushdef, m4_macro_insert): ...these.
8061 * src/main.c (main): Set command line macros from `-D' parameters
8062 using `m4_macro_define'.
8064 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8066 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
8067 this from m4_remove_table_reference_symbols().
8068 * m4/m4module.h, m4/module.c: Updated all references.
8070 2001-09-07 Akim Demaille <akim@epita.fr>
8072 * modules/stdlib.c, modules/times.c: Misc cleanups.
8074 2001-09-07 Akim Demaille <akim@epita.fr>
8076 * configure.in: We now need Autoconf 2.52e.
8077 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
8078 and `M4_SYMBOL_DELETE'.
8079 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
8080 * src/main.c (main): Adjust.
8082 2001-09-06 Gary V. Vaughan <gary@gnu.org>
8084 Fix the obstack.h problem once and for all! At configure time we
8085 can test for a system supplied obstack.h: depending on the
8086 result, we now generate system.h with an #include of the correct
8087 header. As a bonus, I've also added a --with-included-obstack,
8088 incase the user doesn't like the system obstack for some
8089 reason... and also we can test the shipped obstack on a system
8090 that has oe of its own. We also now need to be careful to add
8091 build directories to the include search path, since the generated
8092 system.h will be in the build tree.
8094 * configure.in (AC_CONFIG_FILES): Generate system.h from
8096 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
8097 include the system obstack header or the copy shipped with M4.
8098 Allow the user to override configure and force the build to use
8099 the shipped version.
8100 * m4/system-h.in: New file, template for...
8101 * m4/system.h: ...this. Now deleted.
8102 * m4/m4module.h: Include system.h before everything else.
8103 * src/freeze.c: Ditto.
8104 * m4/Makefile.am (dist-hook): Remove generated system.h.
8105 (INCLUDES): Check builddir for generated headers before checking
8107 * modules/Makefile.am (INCLUDES): Ditto.
8108 * src/Makefile.am (INCLUDES): Ditto.
8110 2001-09-05 Gary V. Vaughan <gary@gnu.org>
8112 * TODO: Remove the items that have been addressed already.
8114 2001-09-05 Akim Demaille <akim@epita.fr>
8116 * src/main.c (main): Standardize --version.
8118 2001-09-05 Akim Demaille <akim@epita.fr>
8120 * modules/format.c (format): Have a bigger `str'.
8122 2001-09-05 Akim Demaille <akim@epita.fr>
8124 Rationalize warnings, reporting the macro name as if it were a
8125 program name, and assertions.
8127 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
8129 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
8131 Use assert for internal errors.
8132 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
8134 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
8136 * tests/builtins.at (pushpop): Adjust.
8138 2001-09-05 Akim Demaille <akim@epita.fr>
8140 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
8143 2001-09-05 Akim Demaille <akim@epita.fr>
8145 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
8146 * m4/macro.c, m4/symtab.c: Adjust.
8148 2001-09-05 Akim Demaille <akim@epita.fr>
8150 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
8151 (m4_symbol_pop, m4_symbol_del): this.
8152 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
8153 (m4_symbol_popdef, m4_symbol_delete): New.
8154 (m4_lookup_symbol): Adjust.
8155 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
8157 2001-09-05 Akim Demaille <akim@epita.fr>
8159 * m4/m4module.h (m4_symbol_lookup): Rename as...
8160 (m4_symbol_lookup_t): this.
8162 2001-09-05 Akim Demaille <akim@epita.fr>
8164 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
8166 * m4/symtab.c (m4_lookup_symbol): Adjust.
8168 2001-09-03 Gary V. Vaughan <gary@gnu.org>
8170 Bootstrap will now work with Libtool 1.4.1 or higher:
8171 * bootstrap: Remove stale autom4te.cache files when
8173 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
8175 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
8176 libtool.m4 directly.
8177 Run libtoolize to refresh ltmain.sh.
8178 * config/ltmain.sh: Deleted.
8179 * acinclude.m4: Deleted.
8180 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
8182 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
8183 implementation for the cvs impaired libtool user.
8185 2001-09-03 Akim Demaille <akim@epita.fr>
8187 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
8189 Avoid using `default' in switch, as it hides useful compiler
8190 warnings when a case is forgotten.
8192 2001-09-03 Akim Demaille <akim@epita.fr>
8194 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
8195 is no such thing as `WITH_MODULES'.
8197 2001-09-03 Akim Demaille <akim@epita.fr>
8199 Improve the test suite's selfcontainedness.
8201 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
8202 (Include, Undivert): Tag the other input files.
8203 * tests/generate.awk: Catch `@comment file:'.
8204 `-I $src' is no longer needed.
8205 `next' is really like `return': the rest is skipped.
8206 Adjust to `input.m4'.
8207 (fatal): New function.
8208 * tests/foo, tests/incl.m4: Remove.
8210 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8212 The shadowing mechanism and, infact, the whole symbol table
8213 implementation was creaking under the weight of the features piled
8214 on top of it. We now have a separate hash table module which will
8215 dynamically resize to keep symbol density withing good performace
8216 limits, and a new symtab module layered above it. Symbol lookups
8217 are now marginally more efficient (since the shadowed flag is no
8218 longer required) and symbol removal, such as on module unload, is
8219 considerably faster due to a reorganisation of the data structures
8222 * src/main.c (main): Don't mention `-H'.
8223 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
8226 * m4/hash.c: New generalised dynamic hash table data structure
8228 * m4/hash.h: Public interface.
8229 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
8230 (libm4_la_SOURCES): Add hash.c.
8231 * m4/symtab.c: More or less rewritten from scratch, within the
8232 bounds of the previous API.
8233 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
8234 call. Updated all callers.
8235 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
8236 declarations to reflect API changes.
8237 (M4INIT): Generate a declaration too, to avoid the warning with
8238 --enable-debug builds.
8241 * m4/utility.c (hash_table_size): Removed.
8242 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
8243 names, which are then looked up by builtin_dumpdef() as necessary.
8244 This implies a small speedup in builtin_symbols(), which discarded
8245 all of the symbol info under the old call.
8246 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
8247 shadowing is implicit in respect to the new data structures.
8248 symbol names are no longer duplicated here, they are stored in the
8249 key field of the hash table.
8250 Moved macro_args and blind_no_args...
8251 (m4_token_data): ...to here.
8252 m4/macro.c (expand_macro): Added a name argument since the symbol
8253 name is no longer copied into each struct m4_symbol. Modified all
8255 (collect_arguments): Ditto.
8256 * modules/m4.c (set_trace): Ditto.
8257 * modules/gnu.c (builtin_symbols): Updated.
8258 * src/freeze.c (produce_symbol_dump): Much improved in light of
8259 the improved symbol table layout.
8261 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8263 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
8265 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
8266 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
8267 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
8268 SYMBOL_HANDLE): Ditto.
8269 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
8270 modules/gnu.c, modules/m4.c, src/freeze.c,
8271 src/main.c: Updated all references.
8273 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
8274 Automake 1.5 chokes on dynamic source file lists, Besides, it is
8275 already listed in m4_LDADD... how did that ever used to work?
8276 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
8278 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
8279 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
8281 * tests/m4: Don't call the m4 wrapper script with libtool, it
8282 works fine all by itself.
8284 2001-08-30 Gary V. Vaughan <gary@gnu.org>
8286 The experimental `changeword' feature never took off, and has
8287 no obvious advantages over `changesyntax' to compensate the
8288 enormous speed penalty it carries:
8289 * configure.in (ENABLE_CHANGEWORD): Removed.
8290 * m4/m4module.h (m4_set_word_regexp): Removed.
8291 * m4/m4private.h (m4_token_data): Removed original_text field.
8292 * m4/utility.c (m4_token_data_orig_text): Removed.
8293 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
8294 * m4/macro.c: Ditto.
8295 * src/main.c: Ditto.
8296 * modules/Makefile.am (changeword.la): Removed.
8297 * modules/changeword.c: File removed.
8298 * doc/m4.texinfo: References to changeword and --word-regexp
8300 * po/POTFILES.in: modules/changeword.c removed.
8301 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
8302 * tests/builtins.at (changeword): Test removed.
8304 2001-08-30 Akim Demaille <akim@epita.fr>
8306 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
8307 This also help having a single list of m4 files: in
8309 * config/Makefile.am (STANDARD_MACROS): Rename as...
8310 (ACLOCAL_MACROS): this.
8311 (list-standard-macros): Remove.
8314 2001-08-29 Gary V. Vaughan <gary@gnu.org>
8316 In an attempt to moderate my egomania...
8317 * tests/modules.at: Remove attributions.
8319 * tests/generate.awk: When making substitutions to "@&t@", either
8320 "&" or "\&" in the substitution string argument to gsub refer back
8321 to the matched text. "@\\&t@" seems to work though, Tests 43 and
8324 2001-08-29 Akim Demaille <akim@epita.fr>
8326 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
8327 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
8328 (sync-lines, trace, translit, undivert, wrap): Move to...
8329 * tests/builtins.at: this new file.
8330 * tests/others.at (Discard comments, import-environment): Move to...
8331 * tests/options.at: this new file.
8333 2001-08-29 Akim Demaille <akim@epita.fr>
8335 * tests/others.at (Freezing modules)
8336 (--module-directory: absolute path, modpath2, modpath3)
8337 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
8338 * tests/modules.at: here, new file.
8339 * tests/others.at, tests/generate.awk: Add a banner.
8340 * tests/testsuite.at: Adjust.
8341 (AT_CHECK_M4_FILTER): New, but unused.
8343 2001-08-29 Akim Demaille <akim@epita.fr>
8345 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
8347 * tests/others.at (wrap): Inline wrap.m4.
8348 (shadow): Inline shadow.m4.
8349 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
8350 * tests/m4: Simplify.
8352 2001-08-29 Akim Demaille <akim@epita.fr>
8354 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
8357 2001-08-29 Akim Demaille <akim@epita.fr>
8359 * tests/generate.awk (normalize): s/@__@/@&t@/.
8361 2001-08-28 Akim Demaille <akim@epita.fr>
8363 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
8365 2001-08-28 Gary V. Vaughan <gary@gnu.org>
8367 * bootstrap (generate.awk): Generate test cases with new script.
8369 2001-08-27 Akim Demaille <akim@epita.fr>
8371 * tests/Makefile.am (installcheck-local): Don't use
8372 `dc_install_base' which is not visible here, but `exec_prefix'
8373 which is clearly the RT anyway.
8374 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
8375 related to testing a now installed m4.
8376 * tests/m4: Do it here.
8378 2001-08-27 Akim Demaille <akim@epita.fr>
8380 * tests/others.at (indir): Formatting change.
8382 2001-08-27 Akim Demaille <akim@epita.fr>
8384 * tests/Makefile.am (installcheck-local): New.
8385 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
8387 Prefer options over envvars.
8388 * src/main.c (main): First bug caught by the test suite (yeah!):
8389 --batch lacked a `break' which resulted in an accidental
8390 invocation of --discard-comments.
8392 2001-08-27 Akim Demaille <akim@epita.fr>
8394 * tests/others.at (capitalize, changeword, comments, ddivert)
8395 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
8396 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
8397 (sysv-args, trace, translit, undivert): Don't rely on files in
8398 examples/: AT_DATA them.
8400 2001-08-27 Akim Demaille <akim@epita.fr>
8402 Let the test suite use a wrapper around the not installed m4 to
8403 pretend it is (installed).
8405 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
8406 such a way that m4 does not process them.
8407 * configure.in: The package name seems to be `m4', not `M4'.
8409 * tests/atlocal.in (at_package, M4): Remove.
8410 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
8412 2001-08-27 Akim Demaille <akim@epita.fr>
8414 * tests/Makefile.am (CLEANFILES): Remove.
8415 (DISTCLEANFILES, clean-local): New.
8416 * examples/mktests.sh: Remove.
8418 2001-08-27 Akim Demaille <akim@epita.fr>
8420 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8421 Don't use aclocal: it's written by hand.
8422 * aclocal.m4: m4_include all the files instead of being built by
8424 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8425 until it reads the traces by itself.
8426 * configure.in: Require Autoconf 2.42c as we are now using
8427 AC_CONFIG_TESTDIR instead of AT_CONFIG.
8428 Catch unexpanded `jm_' macros.
8429 * config/atconfig.m4: Remove.
8430 * config/error.m4: new.
8431 * config/Makefile.am: Ship the files included by aclocal.m4.
8432 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8433 (TESTSUITE_AT): this, to please Automake.
8434 (TESTSUITE): This target uses autotest/autotest.m4, not
8435 autotest/general.m4.
8436 * tests/testsuite.at: Prereq Autotest 2.52c.
8437 * examples/Makefile.am (pkgdata_DATA): Rename as...
8438 (dist_pkgdata_DATA): this.
8439 * doc/Makefile.am (man_MANS): Rename as...
8440 (dist_man_mans): this.
8442 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8444 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
8445 Robert Collins, building on Cygwin no longer requires Windows
8446 import and export symbol decorations.
8447 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
8448 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8449 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8450 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8451 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8452 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8453 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8454 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8455 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8456 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
8458 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8459 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8461 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8463 Ansify the source. Previously we had a mix, where my code was
8464 in a K&R compatible style, and the preexisting code was in ANSI
8465 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
8466 and now the code base is much cleaner.
8468 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
8469 VOID macro and all users.
8470 * m4/m4module.h: Ansify function prototypes and headers.
8471 * m4/builtin.c: Ditto.
8472 * m4/evalparse.c: Ditto.
8473 * m4/input.c: Ditto.
8474 * m4/macro.c: Ditto.
8475 * m4/module.c: Ditto.
8476 * m4/output.c: Ditto.
8478 * m4/symtab.c: Ditto.
8479 * m4/utility.c: Ditto.
8480 * modules/format.c: Ditto.
8481 * modules/gnu.c: Ditto.
8482 * modules/m4.c: Ditto.
8483 * modules/mpeval.c: Ditto.
8484 * src/freeze.c: Ditto.
8486 * src/main.c: Ditto.
8488 2001-08-20 Akim Demaille <akim@epita.fr>
8490 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8491 generated with stock 2.52.
8493 2001-08-20 Akim Demaille <akim@epita.fr>
8495 * config/atconfig.m4: New, until part of Autoconf per se.
8496 * configure.in (AT_CONFIG): Use it.
8498 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8499 * tests/atlocal.in: New.
8500 * tests/generate.awk: For the time being, the empty quadrigraph is
8502 * tests/others.at (changeword, gmp): Check the configuration
8503 variable against `yes'.
8504 * tests/testsuite.at (dnl): Allow it, as it's used all over the
8507 2001-08-20 Akim Demaille <akim@epita.fr>
8509 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8510 * modules/m4.c (undivert): Disable the possibility of undiverting
8511 several files at once: it is not documented, it is inconsistent
8512 with the other macros, it can be straightforwardly mocked by
8513 several invocations, and most importantly, it prevents the
8514 possibility of other kinds of extension.
8515 Use `m4_numeric_arg'.
8517 2001-08-20 Akim Demaille <akim@epita.fr>
8519 * examples/include.m4: Typo.
8520 * tests/generate.awk: Really add it.
8521 * tests/Makefile.am: Adjust.
8522 * tests/others.at (Discard comments): It sure fails without `-c'.
8523 (include, undivert): Add -I examples/.
8525 2001-08-20 Akim Demaille <akim@epita.fr>
8527 Use sprintf, not ecft and friends since it is standard, portable,
8528 simplifies the code, and since the latter is even deprecated
8529 according to the GNU libc documentation.
8531 * modules/format.c: Drop evct support.
8533 2001-08-19 Gary V. Vaughan <gary@gnu.org>
8535 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
8537 * configure.in: ...do it here instead.
8539 * c-boxes.el: Deleted.
8540 * m4/builtin.c: Reformat box comments to be closer to GNU
8542 * m4/debug.c: Ditto.
8544 * m4/evalparse.c: Ditto.
8545 * m4/input.c: Ditto.
8546 * m4/m4module.h: Ditto.
8547 * m4/macro.c: Ditto.
8548 * m4/output.c: Ditto.
8549 * m4/symtab.c: Ditto.
8550 * m4/utility.c: Ditto.
8551 * modules/changeword.c: Ditto.
8552 * modules/format.c: Ditto.
8553 * modules/gnu.c: Ditto.
8554 * modules/load.c: Ditto.
8555 * modules/m4.c: Ditto.
8556 * modules/modtest.c: Ditto.
8557 * modules/mpeval.c: Ditto.
8558 * modules/perl.c: Ditto.
8559 * modules/shadow.c: Ditto.
8560 * modules/stdlib.c: Ditto.
8561 * modules/time.c: Ditto.
8562 * src/freeze.c: Ditto.
8563 * src/main.c: Ditto.
8565 2001-08-17 Gary V. Vaughan <gary@gnu.org>
8567 * m4/module.c: Fixup some errors in the description comment.
8569 2001-08-17 Akim Demaille <akim@epita.fr>
8571 * tests/others.at (iso8859): Specify the path to the M4 test file.
8572 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8573 files in error messages.
8575 2001-08-17 Akim Demaille <akim@epita.fr>
8577 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8578 * tests/others.at: Adjust input files paths.
8579 * tests/atconfig.in: Set top_builddir.
8580 * tests/Makefile.am: Adjust.
8581 `testsuite' is in src, not build.
8583 2001-08-17 Akim Demaille <akim@epita.fr>
8585 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8586 (generate.at): Install a temporary hack until the actual
8587 generate.awk is added to the repository.
8588 * tests/atconfig.in: New.
8590 2001-08-17 Akim Demaille <akim@epita.fr>
8592 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8594 2001-08-17 Akim Demaille <akim@epita.fr>
8596 * doc/m4.texinfo: Promote proper quotation.
8598 2001-08-17 Akim Demaille <akim@epita.fr>
8600 Remove the non Autotest tests.
8602 * tests/other-tests/capitalize.test,
8603 * tests/other-tests/changeword.test,
8604 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8605 * tests/other-tests/debug.test,
8606 * tests/other-tests/discard-comments.m4,
8607 * tests/other-tests/discard-comments.test,
8608 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8609 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8610 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8611 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8612 * tests/other-tests/hanoi.test,
8613 * tests/other-tests/import-environment.m4,
8614 * tests/other-tests/import-environment.test,
8615 * tests/other-tests/include.test, tests/other-tests/indir.test,
8616 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8617 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8618 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8619 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8620 * tests/other-tests/modtest.test,
8621 * tests/other-tests/multiquotes.test,
8622 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8623 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8624 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8625 * tests/other-tests/sync-lines.m4,
8626 * tests/other-tests/sync-lines.test,
8627 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8628 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8629 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8630 * tests/other-tests/wrap.test: Remove.
8632 * tests/run-test, tests/get-them: Remove.
8633 * tests/Makefile.am: Adjust.
8635 2001-08-17 Akim Demaille <akim@epita.fr>
8637 others.at no longer depends on other-tests/.
8639 * tests/others.at (stackovf): You're actually...
8641 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8642 (unload.test): Keep their authorship.
8643 (discard-comments, gmp, import-environment, modfreeze)
8644 (sync-lines): Embed the input files.
8645 * tests/stackovf.test: Copy from other-tests/stackovf.test.
8646 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8648 2001-08-17 Akim Demaille <akim@epita.fr>
8650 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8651 (M4exit): Tag the exit status of the example.
8652 * tests/get-them: Adjust.
8653 * tests/generate.awk: New, based on get-them.
8654 * tests/Makefile.am: Adjust to generate `generated.at'.
8655 * tests/testsuite.at: Adjust.
8656 (AT_CHECK_M4): Don't overquote. Blush...
8658 2001-08-17 Akim Demaille <akim@epita.fr>
8660 Start using Autotest. atconfig creation is still lacking.
8662 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8663 * examples/reverse.m4, tests/other-tests/import-environment.m4,
8664 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8665 * tests/other-tests/import-environment.test: Don't check LANGUAGE
8666 as it might be `unset', or set to `C'.
8667 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
8668 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8669 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8670 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
8671 * tests/other-tests/shadow.test: Adjust.
8672 * tests/testsuite.at, tests/others.at: New.
8673 * tests/Makefile.am: Adjust.
8675 2001-08-17 Akim Demaille <akim@epita.fr>
8677 Drop Autoconf 2.13 compatibility.
8679 * configure.in (changeword): No need to undefine it, as anyway if
8680 it's defined, M4sugar moved it as m4_changeword.
8681 And anyway, proper quotation is enough.
8682 (m4_pattern_allow): As it exists in 2.50, just use it.
8683 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
8684 Don't handle Gettext's duties, let it handle them.
8685 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
8687 2001-08-17 Akim Demaille <akim@epita.fr>
8689 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
8690 (m4_errprint): Use fputs.
8691 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
8692 dumpdef are not concerned.
8693 (Dumpdef, Errprint): Emphasize their insensitivity to
8695 * doc/Makefile.am: Add `TAGS' support.
8696 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
8698 * config/Makefile.am (MAINTAINERCLEANFILES): New.
8700 2001-08-17 Akim Demaille <akim@epita.fr>
8702 * modules/Makefile.am (ETAGS_ARGS): New.
8704 2001-08-17 Akim Demaille <akim@epita.fr>
8706 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
8709 2001-08-17 Akim Demaille <akim@epita.fr>
8711 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
8713 2001-08-17 Akim Demaille <akim@epita.fr>
8715 * m4/m4module.h (m4/list.h): Don't include it.
8717 2001-08-16 Gary V. Vaughan <gary@gnu.org>
8719 m4_modules are no more, we use lt_dlhandles directly and let
8720 latest libltdl features manage the list of loaded modules.
8721 * acinclude.m4: Regenerated.
8722 * m4/ltdl.c: Updated from master copy.
8723 * m4/module.c: Reimplemented to take advantage of advances in
8725 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
8726 list with lt_dlhandle_next.
8727 (m4_builtin_find_by_func): Ditto.
8728 (m4_builtin_table_install): Use lt_dlhandle.
8729 (m4_macro_define): Ditto.
8730 (m4_macro_table_install): Ditto.
8731 m4/module.h: Prototype new module management API.
8732 (m4_modules): No longer required.
8733 (m4_module_init_t, m4_module_finish_t): POSIX namespace
8734 violations, renamed to...
8735 (m4_module_init_func, m4_module_finish_func): ...these,
8737 (M4INIT_HANDLER): Clean way to declare init functions in modules.
8738 (M4FINISH_HANDLER): And similarly for finish functions.
8739 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
8740 -- Add indirection to the CONC macro so that arguments are
8742 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
8743 * modules/shadow.c (m4_init_module): Ditto.
8744 Due to new init function semantics, be careful to perform the
8745 initialisation only on first load.
8746 * modules/perl.c (m4_init_module): Ditto. And Ditto.
8747 (m4_finish_module): Replaced with M4FINISH_HANDLER.
8748 Due to new finish function semantics, be careful to perform the
8749 finalisation only on first load.
8750 * m4/m4private.h (m4_module): Removed in favour of...
8751 (m4_module_data): ...structure without all the wrapper fields.
8752 Instances of this new structure are stored associated lt_dlhandles
8753 with lt_dlcaller_data_set().
8754 * m4/builtin.c (m4_builtin_define): Takes a handle argument
8755 instead of the old module argument.
8756 (m4_builtin_table_install): Ditto.
8757 * modules/load.c (m4_resident_module): Removed. This is no
8758 longer implemented as a magic symbol...
8759 * modules/m4.c (m4_resident_module): Ditto.
8760 * modules/load.c (M4INIT_HANDLER): ...the module init function now
8761 uses the ltdl api to make the module resident.
8762 * modules/m4.c (M4INIT_HANDLER): Ditto.
8763 * modules/load.c (builtin_modules): Traverse the loaded module
8764 list with lt_dlhandle_next.
8765 (builtin_load): Much simplified in light of the reimplemented
8767 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
8768 light of the m4/module.c rewrite.
8769 (produce_symbol_dump): Ditto.
8770 (reload_frozen_state): Ditto.
8771 * m4/list.c, m4/list.h: Files deleted. No longer required.
8772 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
8773 (libm4_la_SOURCES): Delete list.c reference.
8774 * m4/m4private.h (m4_token_data): Add a handle field. This
8775 eliminates many of the searches to find the handle associated with
8776 various tokens that are passed between functions.
8777 (struct m4_symbol): Removed the module field. The
8778 module association does not belong with the symbol...
8779 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
8780 that the module implementation code is from. Added a handle
8782 (m4_push_macro): Add a `handle' argument. Changed all callers.
8783 (init_macro_token): Set the `handle' field for the
8785 * m4/macro.c (expand_argument): Copy the new handle field during
8787 * modules/m4.c (macro_install): Use the new handle field to
8788 optimise the search for the correct builtin structure, and pass
8789 the handle details to m4_builtin_define.
8791 2001-08-15 Akim Demaille <akim@epita.fr>
8793 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
8794 when creating `m4/obstack.h'.
8795 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
8797 * tests/defs: Make them absolute.
8798 (CDPATH) Neutralize.
8799 * tests/gethem: Use them.
8801 2001-08-14 Gary V. Vaughan <gary@gnu.org>
8803 * config/ltmain.sh: Doh! Import again for a quoting fix that
8804 prevented any regression test from passing.
8806 * m4/m4module.h (obstack.h): Choose between installed version
8807 and shipped version based on configure tests.
8808 * src/freeze.c (obstack.h): Ditto.
8810 * acconfig.h: Removed. No longer required.
8812 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
8813 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
8814 them to AC_INIT and AM_INIT_AUTOMAKE.
8815 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
8816 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
8817 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
8818 shell variable m4_cv_func_obstack_h.
8819 * tests/defs (M4): Be more careful about relative path to libtool
8820 script and m4 binary by using $srcdir.
8822 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
8823 optargs to the existing libltdl search path.
8824 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
8825 * m4/ltdl.c: Updated.
8827 * config/ltmain.sh: Ditto.
8829 2001-08-11 Gary V. Vaughan <gary@gnu.org>
8831 * src/main.c (main): Add `-b' (for `batch') mode switch to force
8832 interactive mode off.
8834 2001-08-10 Akim Demaille <akim@epita.fr>
8836 * configure.in: Require Autoconf 2.52.
8837 (AC_ARG_PROGRAM): Remove, handled by Automake.
8838 (m4_getopt): Rename as...
8839 (m4_getopt_h): this.
8840 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
8841 Undefine `changeword' only if defined.
8842 * config/gnu-obstack.m4: Require Autoconf 2.52.
8843 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
8846 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
8848 * doc/m4.texinfo: Fix some typos, and apply some small
8851 2001-08-09 Andreas Schwab <schwab@suse.de>
8853 * src/main.c (main): Fix improper uses of error (missing format
8856 2001-08-07 Akim Demaille <akim@epita.fr>
8858 Improve `make distcheck'.
8860 * configure.in: Be sure to be able to run `mkconfig.sh' when src
8862 * Makefile.am (dist-hook): Remove, as it is no longer needed.
8863 * doc/m4.texinfo (Include): Add missing blank.
8864 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
8867 2001-08-07 Akim Demaille <akim@epita.fr>
8869 * m4/evalparse.c: A better introductory comment.
8870 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
8871 * m4/macro.c: Adjust old comments.
8872 * modules/README: Typo.
8874 2001-08-07 Akim Demaille <akim@epita.fr>
8876 * config/gnu-obstack.m4: New.
8878 2001-08-07 Akim Demaille <akim@epita.fr>
8880 * config/Makefile.am, config/stackovf.m4: New.
8881 * configure.in, Makefile.am: Adjust.
8883 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
8885 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
8886 * po/cat-id-tbl.c: Remove file.
8887 * po/stamp-cat-id: Remove file.
8889 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
8891 * modules/format.c (format): Formatting for %f was not
8892 interpreting the position of the decimal point correctly for
8895 2000-12-01 Gary V. Vaughan <gary@gnu.org>
8897 * TODO: Removed m4exit bug.
8898 * modules/load.c (m4_resident_module): Make this module resident.
8899 * module/m4.c (m4_resident_module): Ditto.
8900 * m4/modules.c (m4_module_load): Use new ltdl resident modules
8901 feature to mark modules as resident if they export
8902 `m4_resident_module' as TRUE.
8903 (m4_module_unload): Do not remove resident modules, and take care
8904 with symbol insertion and deletion with resident modules.
8905 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
8906 use resident modules feature.
8908 2000-11-30 Gary V. Vaughan <gary@gnu.org>
8910 * TODO: Updated. Removed some cruft that has since been fixed
8911 or implemented. Added some more entries.
8914 * modules/README: Updated.
8915 * doc/m4.texinfo: Updated.
8917 * modules/gnu.c (builtin_functions): Make indir orthogonal to
8918 builtin, in that each is recognised as a macro only with parameters
8919 (builtin_indir): Passing 0 arguments is now an error, as with
8922 * src/main.c (usage): Added missing description of `-c' option.
8924 2000-11-29 Gary V. Vaughan <gary@gnu.org>
8926 Consolidate the myriad of dispersed test scripts into the
8927 tests subdirectory. I think I now have all the file where I
8928 want them, so there shouldn't be anymore upheaval =)O|
8930 * tests/Makefile.am: Updated to run the new tests added below.
8931 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
8932 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
8933 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8934 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8935 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8936 tests/other-tests/hanoi.test, tests/other-tests/include.test,
8937 tests/other-tests/indir.test, tests/other-tests/misc.test,
8938 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
8939 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8940 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8941 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
8942 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
8943 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
8944 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8945 tests/other-tests/translit.test, tests/other-tests/undivert.test,
8946 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8947 tests/other-tests/wrap.test: New tests based on the contents
8948 of the tests removed below.
8949 * examples/Makefile.am, modules/Makefile.am: Updated to
8950 reflect removed tests.
8951 * examples/defs,modules/defs: Removed.
8952 * examples/capitalize.test, examples/comments.test,
8953 examples/ddivert.test, examples/debug.test,
8954 examples/esyscmd.test, examples/exp.test,
8955 examples/foreach.test, examples/forloop.test,
8956 examples/fstab.test, examples/hanoi.test,
8957 examples/include.test, examples/indir.test,
8958 examples/misc.test, examples/multiquotes.test,
8959 examples/patsubst.test, examples/pushpop.test,
8960 examples/regexp.test, examples/reverse.test,
8961 examples/sysv-args.test, examples/trace.test,
8962 examples/translit.test, examples/undivert.test,
8963 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
8964 modules/modpath1.test, modules/modpath2.test,
8965 modules/modpath3.test, modules/modpath4.test,
8966 modules/modtest.test, modules/shadow.test,
8967 modules/unfrozen.m4, modules/unload.test: Removed.
8969 Move the implementation of GMP support for the mpeval() builtin
8970 into a loadable module that depends on libgmp. mpeval() and
8971 eval() share a common parser, now in m4/evalparser.c; the code
8972 in m4/numb.c and m4/numb.h is now physically split between
8973 m4/eval.c (the eval() backend) and modules/mpeval.c (the
8974 mpeval() backend), rather than being differentiated by cpp
8975 macros and multiple inclusion. The mpeval module is always
8976 built but will generate an diagnostic if it is used from an
8977 installation that didn't link in the gmp library.
8978 * modules/Makefile.am: build and install the new mpeval module.
8979 * modules/mpeval.c: Now contains the former parts of m4/numb.c
8980 and m4/numb.h that are required for gmp support in mpeval().
8981 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8982 * m4/evalmp.c: Removed.
8983 * m4/m4module.h: Removed conditional prototype for
8985 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
8986 and m4/numb.h that do not rely on gmp.
8987 * m4/evalparse.c: New file, contains the shared parts of the
8988 eval() and evalmp() parser implementations, and is no longer
8989 unencumbered by cpp magic to uncover the right parts.
8990 * m4/numb.h: Removed. It's former contents are split between
8991 m4/eval.c and modules/mpeval.c.
8994 * tests/other-tests/changeword.test: New test. Rudimentary
8995 testing of changeword builtin runs only if --wnable-changeword
8996 was used at configure time.
8997 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8998 alternation correctly. Split into two expressions to compensate.
8999 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
9000 * modules/Makefile.am: Build changeword module.
9001 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
9002 only when --enable-changeword was passed to configure.
9003 (builtin_changeword): If --enable-changeword was not used, then
9004 report that changeword() builtin has no support in m4 binary.
9006 2000-11-28 Gary V. Vaughan <gary@gnu.org>
9008 * src/main.c (main): Fixed a particularly nasty bug is
9009 user_search_path setting -- the -M flag processing must be
9010 extremely careful with search path ordering, or else the default
9011 installed module directory (possibly containing modules from a
9012 previous release) is placed earlier in the search path than any -M
9013 arguments (which are relied upon to load uninstalled modules with
9014 most of the tests in the regresion suite).
9016 * modules/load.c (builtin_load): Nasty hack to prevent adding
9017 symbols to symtab again if a module is loaded more than once.
9018 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
9020 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
9021 possible NULL pointer dereference.
9023 * m4/module.c (m4_module_find_by_modname): Renamed from
9024 m4_module_modname_find. Fixed all references.
9025 (m4_module_find_by_builtin): New function.
9027 * modules/modfreeze.test: load the `load' module with each
9029 * src/freeze.c (produce_frozen_state): Simplified in light of
9030 module field in m4_symbol. Allow a third argument for text macros
9031 to name the originating module.
9032 (reload_frozen_state): ditto.
9033 * m4/m4module.h: Fixup prototypes.
9034 * m4/builtin.h (m4_builtin_define): Add a module argument so
9035 that symbols can be registered against the defining module.
9036 (m4_macro_define): ditto.
9037 * m4/m4private.h (m4_symbol): Make the module field const to save
9038 on casting in the rest of the code.
9039 (SYMBOL_MODULE): New macro.
9041 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
9042 symbol reference maintenance bugs when removing a symbol from the
9045 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
9047 2000-11-27 Gary V. Vaughan <gary@gnu.org>
9049 * configure.in (m4_cv_func_obstack): A better check for whether
9050 libc has an obstack implementation.
9051 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
9053 * configure.in (--with-modules): Changed semantics. This
9054 option is now used to list modules to be preopened.
9055 * src/m4.h: #include "ltdl.h" unconditionally.
9056 * src/main.c: Removed all dependencies on WITH_MODULES.
9057 * src/freeze.c: ditto.
9058 * modules/Makefile.am: ditto.
9059 * m4/m4.c (builtin_m4exit): ditto.
9060 * modules/modpath1.test: ditto.
9061 * modules/modpath2.test: ditto.
9062 * modules/modpath3.test: ditto.
9063 * modules/modpath4.test: ditto.
9064 * modules/modtest.test: ditto.
9065 * modules/shadow.test: ditto.
9066 * modules/unload.test: ditto.
9068 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
9069 comes up on demand in LTLIBOBJS now.
9070 * configure.in (getopt_long): Creating and relying on a link for
9071 getopt.h on hosts with no getopt_long() of thier own works
9072 correctly now. This is necessary so that callers of getopt_long()
9073 can simply `#include <getopt.h>': the naive way of doing this
9074 would end up using our own getopt.h and the installed
9075 getopt_long(), which is asking for trouble!
9076 (obstack_init): A similar argument applies to obstack.h and
9079 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
9080 On Solaris-2.5 (at least) the native dlopen implementation
9081 gets confused about m4.o when looking for module "m4". This
9082 version always looks for .la an .$lib_ext suffixed names first
9083 to work around the problem. Sigh.
9085 * po/POTFILES.in: Take account of these file movements.
9086 * src/Makefile.am (m4_SOURCES): removed eval.c.
9087 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
9088 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
9089 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
9090 * modules/m4.c (builtin_eval): Use m4_evaluate().
9091 * m4/eval.c: Moved here from src/eval.c to facilitate
9092 implementation of eval() builtin as part of the `m4' loadable
9094 (m4_evaluate): renamed from evaluate for namespace cleanliness.
9095 * m4/numb.c: Moved here from src/numb.c, since it is #included
9096 into eval.c at compile time.
9097 * m4/m4module.h (m4_evaluate): Added prototype.
9098 * src/m4.h (evaluate): Removed prototype.
9100 2000-11-25 Gary V. Vaughan <gary@gnu.org>
9102 * modules/perl.c (builtin_perleval): Use PL_na for
9103 compatibility with perl-5.6.
9105 * src/main.c (main): It is now safe to
9106 ``m4_module_install("m4")'', without tripping over the m4
9108 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
9109 versions having fixed the insidious module search order bug.
9111 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
9112 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
9114 * configure.in: Figure out whether to use the installed
9115 getopt.h or the supplied one.
9116 * src/Makefile.am: ditto.
9118 * po/POTFILES.in: List files in their new positions.
9120 * config/ltmain.sh: This needs to be checked in to match the
9121 libtool macros copied to acinclude.m4 (until a released
9122 libtool copes with m4's needs).
9123 * bootstrap: Run gettextize.
9125 2000-11-24 Gary V. Vaughan <gary@gnu.org>
9127 * AUTHORS: Added my details.
9130 * bootstrap: temporary update until released libtool catches up.
9132 * All files: Use new GNU GPL copyright blurb with current contact
9135 * configure.in (LTLIBOBJS): Use canonical code for calculation of
9138 * config: renamed acm4 directory to config to be more like
9139 other autoconfiscated packages.
9141 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
9142 * config/debug.m4: New file implementing configure macros to add
9143 suitable debug flags to the compiler invocation.
9145 * modules/load.c: New file implementing the ``load'' and
9146 ``unload'' builtins.
9147 * tests/get-them: Set the module search directory to the modules
9148 build directory in generated tests.
9149 * modules/shadow.test: ditto.
9150 * modules/modtest.test: ditto.
9151 * modules/modpath1.test: ditto.
9152 * modules/modpath2.test: ditto.
9153 * modules/modpath3.test: ditto.
9154 * modules/modpath4.test: ditto.
9155 * modules/modtest.test: ditto.
9156 * modules/modfreeze.test: ditto.
9157 * modules/unload.test: ditto.
9159 * modules/changeword.c: New file implementing the ``changeword''
9160 builtin as a loadable module.
9161 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
9162 as a loadable module.
9164 * src/main.c (main): Load the gnu module if m4 was started
9165 normally -- i.e. without the -G option.
9166 * modules/gnu.c: New file implementing a new loadable module wuth
9167 definitions for all the gnu extension builtins.
9168 * modules/format.c: Moved here from src/format.c. Now included
9171 * src/main.c (main): Load the traditional module if m4 was
9172 started in `no_gnu_extensions' mode.
9173 * modules/traditional.c: New file implementing the ``unix'' macro,
9174 required when m4 is executed in traditional mode, as a loadable
9177 * src/main.c: Renamed from m4.c to avoid confusion with
9179 (main): Always load the m4 module.
9180 * modules/m4.c: New file implementing a new loadable module with
9181 definitions for all m4 builtins that are not gnu extensions.
9183 * m4/Makefile.am: Adjusted to take new files below into account.
9184 * m4/m4module.h: Prototypes for exported functions and types moved
9185 to this directory from the src directory.
9186 * m4/m4private.h: Moved here from src/m4private.h to facilitate
9187 the migration of all builtin implementations to loadable modules.
9188 * m4/macro.c: Moved this file here from the src directory,
9189 renaming all exported symbols to use the prefix ``m4_''.
9190 * m4/builtin.c: ditto.
9191 * m4/module.c: ditto.
9192 * m4/symtab.c: ditto.
9193 * m4/debug.c: ditto.
9194 * m4/input.c: ditto.
9195 * m4/output.c: ditto.
9197 * m4/ltdl.h, m4/ltdl.c: ditto.
9198 * m4/utility.c: Odd functions moved here from files in the src
9199 directory to facilitate builtin migration.
9201 2000-08-12 Gary V. Vaughan <gary@gnu.org>
9203 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
9204 error message, to make translators' jobs a little easier.
9205 (builtin_builtin): ditto.
9206 (builtin_traceon): ditto.
9207 (builtin_traceoff): ditto.
9208 Reported by Akim Demaille <akim@epita.fr>
9210 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
9211 pkgincludedir instead.
9213 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
9214 it is exported globally. Fixed all references.
9218 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
9219 globally. Fixed all references.
9220 (DEF_LQUOTE): ditto.
9224 2000-07-28 Gary V. Vaughan <gary@gnu.org>
9229 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
9230 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
9232 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
9233 Removed `Prev', `Next' and `Up' fields of all @nodes now that
9234 makeinfo calculates them for us, and to make any future
9235 reorganisation easier.
9236 (Frozen files): Document format version 2.
9237 `V' now takes argument `2'.
9238 `F' can take a single argument if symbol and builtin names
9239 are the same, or 3 arguments if the builtin is from a module.
9240 New `S' specification for saving syntax table contents.
9241 New `M' specification for saving loaded module names.
9242 * src/freeze.c: Implement them.
9243 * src/input.c (syntax_code): For interpreting frozen syntax
9246 * examples/Makefile.am: Add the contents of the WWW directory to
9248 * examples/WWW/Makefile: ditto,
9249 (%.htm): Compares file contents (not just sizes) to determine
9250 whether a change has occured.
9251 * examples/WWW/_header.htm: Bumped version number.
9252 * examples/WWW: Regenerated content.
9254 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
9255 compilers comes much easier without ansi2knr.
9256 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
9258 * m4/list.c: New generic list container type.
9259 * m4/list.h: Interface to new container type.
9260 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
9261 (libm4_la_SOURCES): compile and link list.c.
9262 * src/builtin.c (builtin_tables): Use list container.
9263 * src/module.c (symtab): ditto.
9264 * src/symtab.c (symtab): ditto.
9266 * m4/system.h: New file for common preprocessor definitions.
9267 * m4/Makefile.am (pkginc_HEADERS): install system.h.
9268 * m4/error.c: Use system.h in place of inline preprocessor.
9269 * m4/error.h: ditto.
9270 * m4/module.c: ditto.
9271 * m4/module.h: ditto.
9272 * m4/xmalloc.c: ditto.
9274 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
9276 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
9278 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
9279 it is exported globally. Fixed all references.
9281 (module_init_t): ditto.
9282 (module_finish_t): ditto.
9283 (token_data): ditto.
9284 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
9285 it is exported globally. Fixed all references.
9286 (SYNTAX_IGNORE): ditto.
9287 (SYNTAX_SPACE): ditto.
9288 (SYNTAX_OPEN): ditto.
9289 (SYNTAX_CLOSE): ditto.
9290 (SYNTAX_COMMA): ditto.
9291 (SYNTAX_DOLLAR): ditto.
9292 (SYNTAX_ACTIVE): ditto.
9293 (SYNTAX_ESCAPE): ditto.
9294 (SYNTAX_ALPHA): ditto.
9295 (SYNTAX_NUM): ditto.
9296 (SYNTAX_ALNUM): ditto.
9297 (SYNTAX_LQUOTE): ditto.
9298 (SYNTAX_RQUOTE): ditto.
9299 (SYNTAX_BCOMM): ditto.
9300 (SYNTAX_ECOMM): ditto.
9301 (SYNTAX_VALUE): ditto.
9302 (SYNTAX_MASKS): ditto.
9320 (TOKEN_NONE): ditto.
9321 (TOKEN_STRING): ditto.
9322 (TOKEN_SPACE): ditto.
9323 (TOKEN_WORD): ditto.
9324 (TOKEN_SIMPLE): ditto.
9325 (TOKEN_MACDEF): ditto.
9327 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
9328 consistency. Fixed all references.
9329 (STRING): Renamed to `m4_string' for consistency, and because if
9330 is exported globally. Fixed all references.
9331 (token_type): Renamed to `m4_token_t' for the same reasons.
9332 (token_data_type): Renamed to `m4_token_data_t' for the same
9335 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
9339 (XFREE): Wrapper macro which avoids freeing NULL pointers.
9341 * m4/m4module.h (m4_macro): New type for module defined user
9343 * modules/modtest.c (m4_macro_table): Define module user macros.
9344 * modules/shadow.c (m4_macro_table): ditto.
9346 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
9347 declared with M4BUILTIN.
9349 * m4/xmalloc.c: Use memset if bzero is not available when
9350 emulating calloc with malloc.
9351 (xcalloc): Fallback to malloc/bzero if calloc is not available.
9352 (xfree): Added for consistency. Will not try to free NULL
9354 * src/m4.c (xfree): Deleted in favour of the above.
9355 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
9356 linking with libdmalloc.
9357 * m4/xstrdup.c (WITH_DMALLOC): ditto.
9359 * modules/frozen.m4: New test case.
9360 * modules/unfrozen.m4: ditto.
9361 * modules/modfreeze.test: New test.
9362 * modules/unload.test: ditto.
9363 * modules/Makefile.am (EXTRA_DIST): Distribute them.
9365 * modules/modpath1.test: Don't try this test if module support is
9367 * modules/modpath2.test: ditto.
9368 * modules/modpath3.test: ditto.
9369 * modules/modpath4.test: ditto.
9370 * modules/modtest.test: ditto.
9371 * modules/shadow.test: ditto.
9373 * modules/perl.c: New module.
9374 * modules/perl.m4: Example of using it.
9375 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
9377 * src/m4.c (main): Assume interactive mode if STDIN is connected
9379 Changed startup sequence slightly so that syntax is not
9380 initialised from here when loading a frozen file.
9382 * src/builtin.c: Much improved macro definition style.
9383 * src/m4private.h: Internal structures for m4_builtin and
9384 m4_macro instances. These are not exposed to module writers.
9385 * src/module.c (module_modname_find): Find a module structure
9387 (make_macro_table): Build an internal macro table from a external
9389 (make_builtin_table): Build an internal builtin table from an
9390 external definition.
9392 * src/module.c (module_unload): Be extremely careful to remove
9393 builtins and macros that match the module being unloaded -- no
9394 longer assume that the top element can be removed incase another
9395 odule defines an identical name.
9396 * src/symtab.c (remove_table_reference_symbols): remove all symbol
9397 table entries which refer to a given builtin table.
9398 * src/builtin.c (remove_tables): Use it!
9400 2000-07-13 Thomas Tanner <tanner@ffii.org>
9402 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
9403 * acm4/modules.m4: deleted
9404 * bootstrap: don't libtoolize libltdl!
9405 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
9406 if set, enable WITH_MODULES and add modules to DLPREOPEN
9407 * examples/misc.test: redirect standard output
9408 * lib/Makefile.am: don't use DLLDFLAGS
9409 * lib/m4module.c: include necessary headers to silence GCC -Wall
9410 * lib/m4regex.c: fixes to silence GCC -Wall
9411 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
9412 build modules conditionally
9413 * modules/shadow.c: define symbol aliases before using them
9414 * modules/test.c: define symbol aliases before using them
9415 * po/de.po: update translation
9416 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9417 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9419 * src/m4.c: initialize libltdl's preloaded symbols via
9420 LTDL_SET_PRELOADED_SYMBOLS
9421 * src/module.c: libltdl's memory management must be initialized
9422 before calling lt_dlinit!, fix warnings
9424 2000-01-18 Gary V. Vaughan <gary@gnu.org>
9426 * README: Caveat about nls not supported by dll architecture on
9429 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9431 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
9432 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
9433 * modules/Makefile.am (LIBS): ditto.
9434 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9435 $(top_srcdir)/m4 (for only <m4module.h>).
9436 * modules/shadow.test: fixed for VPATH.
9437 * modules/modtest.test: ditto.
9438 * modules/modpath4.test: ditto.
9439 * modules/modpath3.test: ditto.
9440 * modules/modpath2.test: ditto.
9441 * modules/modpath1.test: ditto.
9443 * modules/time.test: Removed due to timezone dependence,
9444 * modules/Makefile.am (TESTS): Removed time.test.
9446 * configure.in: Use $3 of AC_DEFINE so that we can,,,
9447 * acconfig.h: Remove everything except the gettext parameters.
9448 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9450 * acm4/ltdl.m4: Updated to latest from libtool cvs.
9451 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
9452 increment serial number.
9454 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9455 src dir and immediately after libm4 is built for confidence that
9456 it doesn't rely on the src directory.
9457 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9458 makeinfo stop the build on cygwin (because they don't work).
9460 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9462 * m4/m4private.h: ...is not a public header, so moved to src.
9463 Add `#include <config.h>', `#define _COMPILING_M4' and
9465 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9466 * src/Makefile.am (noinst_HEADERS): add m4private.h.
9467 * src/builtin.c: `#include "m4private.h"' now takes care of the
9468 above. Duplicates removed.
9469 * src/debug.c: ditto.
9470 * src/eval.c: ditto.
9471 * src/evalmp.c: ditto.
9472 * src/format.c: ditto.
9473 * src/freeze.c: ditto.
9474 * src/input.c: ditto.
9476 * src/macro.c: ditto.
9477 * src/module.c: ditto.
9478 * src/numb.h: ditto.
9479 * src/output.c: ditto.
9480 * src/path.c: ditto.
9481 * stackovf.c: ditto.
9484 * po/POTFILES.in: compensate for renaming of lib/*.
9485 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9486 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9487 and then in $(top_srcdir)/lib (for eg. "m4private.h").
9488 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9490 * m4/m4error.h: Renamed error.h, for installation to
9491 $prefix/include/m4..
9492 * m4/m4obstack.h: Renamed obstack.h, for same reason.
9493 * m4/m4regex.h: Renamed regex.h, for same reason.
9494 * m4/m4error.c: Renamed error.c, and use #include "error.h".
9495 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9496 * m4/m4regex.c: Renamed regex.c, and fix #includes.
9498 * lib: moved to m4 to easily support header installation to
9500 * Makefile.am (SUBDIRS): renamed lib dir to m4.
9501 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9502 * acm4/regex.m4: Point to m4/regex.c.
9504 * examples/foreach.m4: Sanitise quoting.
9505 * examples/foreach.test: New torture test.
9506 From Akim Demaille <akim@epita.fr>
9508 2000-01-17 Gary V. Vaughan <gary@gnu.org>
9510 * src/ltdl.c: Use access() to abort doomed module load attempts
9511 if module file does not exist.
9513 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9514 getopt1.o will already be used if appropriate, so I moved getopt.c
9515 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9517 * modules/modpath1.test: Use correct filename in header line.
9518 * modules/modpath2.test: ditto.
9519 * modules/modpath3.test: ditto.
9520 * modules/modpath4.test: ditto.
9522 Without these changes lt_dlopen("test") attempts to
9523 LoadLibrary("/bin/test") on Windows, which although harmless
9524 generates a spurious error message which spoils most of the tests:
9525 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9526 (TESTS): s/test.test /modtest.test /
9527 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9528 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9529 * modules/modpath1.test: s/test.m4 /modtest.m4 /
9530 * modules/modpath2.test: ditto.
9531 * modules/modpath4.test: ditto.
9532 * modules/modpath3.test: s/-m test /-m modtest /
9533 * modules/shadow.m4: use {un,}loadmodule(`modtest').
9535 2000-01-16 Gary V. Vaughan <gary@gnu.org>
9537 * src/ltdl.c (find_file): Updated to new version with fixed memory
9538 allocation bug in `next'.
9539 * src/ltdl.h: updated to match.
9541 * modules/Makefile.am: Cleaned up and reordered.
9543 2000-01-16 René Seindal <rene@seindal.dk>
9545 * modules/Makefile.am (TESTS): New tests for the module system.
9547 * modules/*.test: New files.
9549 * src/m4.c (main): Added call to module_init().
9550 Treats -M and -m as the arguments -D -U and -t, ie deferred.
9552 * src/m4.h: Added declaration of module_init().
9554 * src/module.c (module_init): No longer static
9556 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9557 Added to shut up automake about non standard libtool library
9560 * src/module.c: Disabled DEBUG by default.
9562 * modules/README: Changed example from unload.m4 to shadow.m4
9564 * modules/shadow.m4: Renamed from unload.m4
9566 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9568 * src/m4.c (main): Functionality for -m and -M were reversed.
9571 2000-01-12 Gary V. Vaughan <gary@gnu.org>
9573 * doc/help2man.pl: updated to version 1.020.
9575 * lib/COPYING.LIB: updated to version 2.1.
9577 * lib/m4module.h: restructure the M4_SCOPE code to work when
9578 creating a dll which links with libm4.la and both DLL_EXPORT
9579 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9582 2000-01-11 Gary V. Vaughan <gary@gnu.org>
9584 Merged the following changes from my tree:
9586 1999-06-15 Gary V. Vaughan <gary@gnu.org>
9588 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9589 ported to compile shared libs.
9591 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9592 use `__declspec(dllimport)' when linking libm4.la on win32.
9593 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9595 * configure.in (M4OBJS): Discover whether we need the shipped
9596 implementation of getopt_long.
9597 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9598 main binary here, as opposed to the module library in lib/libm4.la.
9600 1999-06-14 Gary V. Vaughan <gary@gnu.org>
9602 * modules/README: Updated to describe the improved libltdl based
9604 * README (cygwin): Added some compilation notes for building m4
9605 correctly under cygwin.
9606 * TODO: Cleaned out the entries for the module system since they
9607 are now implemented.
9609 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9610 all instances of __P with M4_PARAMS.
9612 * lib/getdate.h: removed unreferenced file.
9614 * lib/m4private.h: New file to define the private interface to the
9615 token_data struct, which must be shared between m4module.c, and
9616 builtin.c but not exported to modules built from the installed
9617 m4module.h since it's size changes depending on compile time
9620 * src/m4.h: Lots of stuff moved to lib/m4module.h.
9622 * lib/m4module.h: New file to define the interface available when
9623 compiling m4 modules.
9624 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9625 necessary for module compilation into this new file.
9627 * lib/Makefile.am (include_HEADERS): install headers (renamed to
9628 avoid nameclash with other system headers) necessary for compiling
9630 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9631 so that modules can include the (renamed) installed headers and
9632 be guaranteed a matching implementation.
9633 * lib/m4error.h: renamed from error.h.
9634 * lib/m4obstack.h: renamed from obstack.h.
9635 * lib/m4regex.h: renamed from regex.h.
9636 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
9637 implementation, simply include the shipped version
9638 unconditionally, otherwise it is hard for a module to know
9639 whether the m4obstack.h header it is using matches the
9640 implementation it ends up linking against.
9641 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
9644 1999-05-18 Gary V. Vaughan <gary@gnu.org>
9646 * examples/misc.test: Don't run this test on machines which don't
9647 have a root user in /etc/passwd (e.g. cygwin).
9649 * tests/get-them (/^@example$/): Error messages might have a
9650 ``.exe'' suffix to the program name, or else use the libtool
9651 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
9652 of these cases are now catered for when comparing error messages
9654 * tests/other-tests/*.test: ditto.
9655 * examples/*.test: ditto.
9657 * tests/defs (M4): use libtool execute mode.
9658 * examples/defs (M4): ditto.
9660 * tests/get-them (END): explicitly close any open file.
9661 (printthem): In a regular expression, '{' is the start of a repeat
9662 count! Use `[{]' for a literal open brace.
9663 (/^@node /): Don't use substr on a string shorter than the trim
9666 1999-05-17 Gary V. Vaughan <gary@gnu.org>
9668 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9670 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9672 2000-01-10 Andreas Schwab <schwab@suse.de>
9674 * tests/other-tests/gmp.test: Find config.sh in build directory.
9676 * configure.in: Find tests/mkconfig.sh in $srcdir.
9678 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9679 <signal.h> (for SUS2 compliant systems).
9681 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
9684 2000-01-10 René Seindal <rene@seindal.dk>
9688 * TODO, NEWS: Cleaned up and updated.
9690 * src/m4.c (main): New variable exit_status for exit status in
9691 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
9692 file cannot be read instead of EXIT_SUCCESS.
9694 * src/builtin.c (m4_indir): Changed error message to help
9695 translators (from Akim Demaille <demaille@inf.enst.fr>).
9697 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
9700 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
9703 * src/input.c (match_input): Reordering of code, to avoid multiple
9704 calls to push_string_init() from obstack_grow(), which can happen
9705 with some compilers (found and fixed by James Bonfield
9706 <jkb@mrc-lmb.cam.ac.uk>).
9708 * src/stackovf.c: Added prototypes for ultrix.
9709 (setup_stackovf_trap): Added __P to cast.
9710 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
9712 2000-01-09 René Seindal <rene@seindal.dk>
9714 * doc/m4.texinfo (Changequote): Added comment about changing
9715 quotes when the old quote is a part of the new.
9717 * src/builtin.c (expand_ranges): Added break after trailing dash.
9718 This caused misbehavious on some systems (found and fixed by Akim
9719 Demaille <demaille@inf.enst.fr>).
9721 * AUTHORS: Thomas Tanner included
9723 * acconfig.h: Added entry for ss_sp (see below).
9725 * configure.in (use_stackovf): Added check for stack_t with member
9726 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
9727 <eggert@twinsun.com>).
9729 * doc/m4.texinfo (Frozen files): Added a simpler example for
9730 generating frozen files from several input files.
9732 1999-11-14 Paul Eggert <eggert@twinsun.com>
9734 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
9735 lib/regex.c, lib/xmalloc.c.
9737 1999-11-10 René Seindal <rene@seindal.dk>
9739 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
9741 * src/module.c: reindented.
9742 (module_load): return if this is a repeated load of same module.
9743 (module_init): slight change of logic to avoid repeated
9744 initialisation debug messages.
9746 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
9747 in the distribution.
9749 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
9750 automake warnings about missing lib prefix.
9751 (time_la_LDFLAGS): ditto
9752 (stdlib_la_LDFLAGS): ditto
9754 1999-11-10 Paul Eggert <eggert@twinsun.com>
9756 * src/m4.h: Include error.h, since our macros use error.
9757 * src/m4.c: Don't need to include error.h.
9759 1999-11-09 Paul Eggert <eggert@twinsun.com>
9761 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
9762 and zero, as Solaris 7 cc does.
9763 (bcopy): Remove macro; no longer needed with new obstack.h.
9765 * src/output.c (freeze_diversions): Don't assume that a
9766 diversion size can fit in `int'. Check for diversion file
9767 size too large to be printed with `unsigned long'.
9769 * src/Makefile.am (CFLAGS): Omit -Wall.
9771 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
9773 * src/debug.c (trace_format):
9774 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
9776 * src/freeze.c (produce_frozen_state):
9777 Don't assume string lengths fit in int.
9779 1999-10-13 René Seindal <rene@seindal.dk>
9781 * po/cs.po: Czech translation added.
9783 * po/sv.po: Updated Swedish translation.
9785 * po/ru.po: Updated Russian translation.
9787 * po/pl.po: Updated Polish translation.
9789 * po/el.po: Greek translation added.
9791 1999-10-13 René Seindal <rene@seindal.dk>
9793 * configure.in (ALL_LINGUAS): Added Greek translation (el).
9794 (ALL_LINGUAS): Added Czech translation (cs).
9796 1999-03-30 Gary V. Vaughan <gary@gnu.org>
9798 * src/builtin.c: moved module loading functions into...
9799 * src/module.c: entirely new implementation using libltdl.
9800 * po/POTFILES.in: added src/module.c.
9801 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
9802 are modules, not linktime libraries.
9803 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
9804 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
9805 avoidance on exported symbols.
9806 * modules/test.c (m4_macro_table, m4_init_module,
9807 m4_finish_module): ditto.
9808 * modules/time.c (m4_macro_table): ditto.
9810 * modules/time2.m4: new file which requires command line loading
9812 * src/m4.c (--load-module): dynamically load named runtime module
9813 into running executable before reading the source.
9814 (--module-directory): prepend a directory to the module search
9816 (module_init()): Do this the first time we load a module instead;
9817 if the module subsystem is broken normal m4 scripts can still run.
9818 * src/m4.h (install_builtin_table): is now exported.
9820 1999-03-26 Gary V. Vaughan <gary@gnu.org>
9822 * src/module.c: removed. No longer required.
9823 * po/POTFILES.in: removed src/module.c.
9825 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
9826 the bootstrap script can recreate.
9827 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
9828 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
9829 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
9830 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
9831 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
9832 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
9833 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
9834 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
9836 * acinclude.m4: removed. `aclocal -I acm4' handles this much
9838 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
9839 * acm4/gettext.m4: removed. It causes a multiple definition vs.
9840 the installed gettext.m4 file when running aclocal.
9842 1999-03-25 Gary V. Vaughan <gary@gnu.org>
9844 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
9845 distinguish this from the last prerelease.
9846 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
9847 in its own subdirectory.
9849 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
9850 lib prefix on a module" feature.
9851 (LDFLAGS): Added `-module -avoid-version' flags to build
9852 versionless module libraries.
9853 * src/builtin.c (m4_load_module): use libltdl.
9854 (module_unload_all): use libltdl.
9855 * src/m4.c (module_init): initialise module loading on demand for
9856 better diagnostics, and so that m4 will still work even if
9857 the module code is broken.
9858 * src/m4.h (module_init): removed. No longer relevant.
9859 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
9860 exported symbols for compatibility with dlpreopening.
9861 * modules/test.c (m4_macro_table, m4_init_module,
9862 m4_finish_module): ditto.
9863 * modules/time.c (m4_macro_table): ditto.
9865 * bootstrap: New file. Runs all the autoutils in the right order
9866 after a fresh checkout, or a make maintainer-clean.
9868 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
9870 * src/builtin.c (dump_symbols): New function, factoring common
9871 content of m4_dumpdef and m4_symbols.
9872 (m4_dumpdef): Use it.
9873 (m4_symbols): New function, implementing `symbols'. Use it.
9874 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
9875 file compile with modern makeinfo.
9876 (Symbols): New node, documenting symbols.
9877 (direntry): Modernize.
9879 1998-12-11 René Seindal <rene@seindal.dk>
9881 * src/builtin.c (predefined_tab): New predefined macros
9882 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
9883 configure time options.
9885 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
9887 * src/module.c (module_try_load): Don't try to be clever and
9888 overwrite argument string. Instead allocate all constructed
9889 strings locally, since they can have arbitrary lengths. Make
9890 arguments pointers to const.
9891 (module_search): Simplify due to above change.
9893 1998-11-29 René Seindal <rene@seindal.dk>
9897 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
9899 * tests/other-tests/import-environment.{m4,test}: New test.
9901 * tests/other-tests/discard-comments.{m4,test}: New test.
9903 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
9905 * src/m4.c (main): New option -c --discard-comments.
9906 New global variable discard_comments.
9908 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
9909 discarded, ie never returned from next_token().
9910 Added declaration of discard_comments.
9912 * src/input.c (next_token): Now loops until token type is not
9913 TOKEN_NONE. Comments are now given this type when comments should
9916 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
9919 1998-11-28 René Seindal <rene@seindal.dk>
9921 * src/m4.c (main): New option --import-environment (no single
9924 * When configured with --with-gmp both the normal (fast) eval()
9925 and the gmp aware mpeval() are defined. To restore previous
9926 bahaviour use "define(`eval', defn(`mpeval'))".
9928 * tests/other-tests/gmp.m4: Changed to use mpeval().
9930 * src/evalmp.c: New file for compiling eval.c as gmp aware.
9931 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
9933 * src/eval.c: Now includes "numb.c" directly. Everything in this
9934 file must by static, except evaluate(), which is changed to
9935 mp_evaluate() if USE_GMP in force.
9937 * src/numb.c: Changed to be included by eval.c instead of being
9938 compiled separately. Everything is declared static.
9940 * src/numb.h: Removed declarations of functions, as numb.c is now
9943 * src/builtin.c: Declaration of m4_mpeval() added.
9944 Inserted `mpeval' in builtin table.
9945 (do_eval): New function with common code for m4_eval and m4_mpeval.
9946 (m4_mpeval): New function for gmp version of eval.
9948 * src/m4.h: Declaration of mp_evaluate().
9950 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
9951 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
9953 * src/m4.c (main): m4 --version also shows which options were used
9954 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
9956 1998-11-27 René Seindal <rene@seindal.dk>
9958 * Error messages now always print program name before input file
9959 name as specified by GNU coding standards. Reported by Akim
9960 Demaille <demaille@inf.enst.fr>.
9962 * doc/m4.texinfo (Include): Change due to changed error message
9966 * tests/get-them: Minor change to sed script due to changed error
9969 * src/m4.c (print_program_name): New func used to print program
9970 name, input file and line number in error (). Used as an
9971 error_print_progname handler.
9972 (reference_error): Removed.
9973 (main): Assigns error_print_progname.
9975 * src/m4.h (M4ERROR): Removed reference_error ().
9977 1998-11-25 René Seindal <rene@seindal.dk>
9979 * Updated to libtool 1.2b.
9981 * src/builtin.c (install_builtin_table): Added braces to avoid
9982 warning of ambiguous 'else'.
9984 * src/module.c: Inserted search path code from path.c modified to
9986 (module_init): Configured default path used only if M4MODPATH is
9988 (module_try_load): Now reads libMODULE.la as generated by libtool
9989 for actual module name.
9990 (module_load): Gives better error messages on failure.
9992 * src/m4.h: Added declarations of structures and functions for
9993 generic search path handling.
9995 * src/path.c: Removed all module specific code and introduced new
9996 functions of more generic search path handling.
9998 1998-11-24 René Seindal <rene@seindal.dk>
10000 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
10001 included gettext, as <libintl.h> might not be found
10002 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
10004 1998-11-22 René Seindal <rene@seindal.dk>
10006 * src/output.c (insert_diversion): Fixed bug that might cause m4
10007 to read from standard output! Triggered by input
10008 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
10009 so now 'undivert(0)' does nothing.
10011 1998-11-18 René Seindal <rene@seindal.dk>
10015 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
10016 could be changed when compiling a illegal regexp, causing later
10017 use of the regexp to dump core.
10019 * src/module.c (module_load): Changed error message to conform to
10022 * src/m4.c (usage): Added message about reporting bugs.
10024 * doc/m4.texinfo (Changeword): Corrected a wrong example.
10025 (Changeword): Added note about the type of regexps used.
10027 * ltconfig, ltmain.sh: New files from Libtool 1.2.
10029 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
10030 and AM_PROG_LIBTOOL.
10032 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
10035 * modules/Makefile.am: Changed completely to compile modules using
10036 libtool. The modules are compiled as shared libraries, and are
10037 renamed when installed.
10039 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
10040 USE_SHL_LOAD to HAVE_SHL_LOAD
10042 * src/builtin.c (shipout_string): Now tests for a NULL string.
10044 * src/module.c: New level of indirection around non-portable
10045 functions to load shared objects. Intended to encapsulate the non
10046 portable parts better and to reduce the number of #ifdefs in the
10049 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
10050 directory modules/ to the distribution.
10052 1998-11-15 René Seindal <rene@seindal.dk>
10056 * modules/stdlib.c: New module `stdlib' defining some standard
10057 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
10058 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
10060 * src/builtin.c (shipout_string): New convenience function for
10061 builtins and modules.
10063 * src/module.c (module_load): Tentative support for
10064 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
10066 * Makefile.am (SUBDIRS): Directory modules added if configured.
10068 * modules/Makefile.am: Now correctly compiles and installs
10069 modules in pkglibexecdir.
10071 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
10072 These two are now initialised by autoconf macros.
10074 * src/path.c (module_env_init): MODULE_PATH is always on the
10077 * src/Makefile.am: Now generated pathconf.h which defined the
10078 default MODULE_PATH.
10080 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
10081 where modules are installed.
10083 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
10084 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
10085 build and install automatically, and it is prepared for other
10086 interfacec than dlopen().
10088 * src/builtin.c (predefined_tab): Added __m4_version__ for the
10089 current version of GNU m4. It is a GNU extension.
10091 1998-11-14 René Seindal <rene@seindal.dk>
10093 * tests/Makefile.am (GENERATED_TESTS): Added new
10094 generated-tests/changesy.8.test
10096 * doc/m4.texinfo (Changesyntax): Documentation for escape
10099 * src/macro.c (expand_token): Check for escaped macro call before
10100 symbol table lookup.
10102 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
10105 * src/input.c: New static variable use_macro_escape, which is TRUE
10106 iff some character has code SYNTAX_ESCAPE
10107 (input_init): Added initialisation of use_macro_escape.
10108 (check_use_macro_escape): New function to synchronise
10109 use_macro_escape with the syntax table.
10110 (set_quotes): Added call to check_use_macro_escape()
10113 (next_token): Added new case for IS_ESCAPE.
10115 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
10117 1998-10-13 René Seindal <rene@seindal.dk>
10121 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
10124 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
10125 maintained tests in tests/other-tests. These currently tests for
10126 8-bit transparency, multiple precision arithmetic and sync-line
10127 output. Test for stackoverflow detection does not work.
10129 * examples/Makefile.am (TESTS): Added tests for all example files.
10131 * examples/mktests.sh: New file. Help program for creating test
10134 * tests/mkconfig.sh: New file to generate tests/config.m4 and
10135 tests/config.sh. This is for tests of configure selectable
10136 features. Picks up all set WITH_ and ENABLE_ veriables from
10139 * src/path.c (path_search): Added argument 'char **expanded_name'
10140 to return the expanded name.
10142 * src/m4.h: Added 2nd argument to declaration of path_search().
10144 * src/m4.c (main): Added 2nd argument to path_search().
10146 * src/freeze.c (reload_frozen_state): Do.
10148 * src/builtin.c (m4_undivert): Do.
10151 1998-10-11 René Seindal <rene@seindal.dk>
10153 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
10155 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
10157 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
10159 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
10161 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
10163 * intl/: Updated to GNU gettext 0.10.35.
10165 * doc/m4.texinfo (Format): Documented that format is blind.
10167 * src/builtin.c (builtin_tab): Builtin format marked as blind.
10169 1998-10-07 René Seindal <rene@seindal.dk>
10173 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
10174 .test, as the files are no longer just m4 input.
10176 * tests/get-them (FILE): Changed .m4 extension to .test.
10178 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
10179 Otherwise quoted strings with leading whitespace first in a macro
10180 argument would be eliminated.
10182 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
10183 (expand_argument): Do.
10185 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
10186 grouped together iff both quote and comment strings are single
10187 character. Otherwise they might include a comment/quote leader.
10188 (next_token): Returns new token type TOKEN_SPACE.
10190 * src/builtin.c (push_builtin_table): New function to push a
10191 builtin_table on the stack without installing its contents.
10192 (find_builtin_by_name): Added call to push_builtin_table() if
10193 reading frozen files. Otherwise the builtins named in the frozen
10194 files could not be found.
10195 (install_builtin_table): Changed to use push_builtin_table()
10197 1998-10-04 René Seindal <rene@seindal.dk>
10199 * po/pl.po: Polish translation added.
10201 * po/POTFILES.in: src/module.c added.
10203 1998-10-04 René Seindal <rene@seindal.dk>
10207 * configure.in (ALL_LINGUAS): Added Polish pl.po
10209 1998-10-03 René Seindal <rene@seindal.dk>
10211 * Many files: Incorporated changes to implement dynamic modules.
10212 Detailed comments in src/modules.c and modules/README
10214 * src/module.c: New file, implements the OS dependant parts of
10215 dynamic module loading.
10217 * src/Makefile.am (m4_SOURCES): Added module.c
10219 * src/builtin.h: New file, declares some functions from builtin.c
10220 that are of use for other modules (shipout_int, numeric_arg,
10221 skip_space, bad_argc), and the macros ARG() and DECLARE().
10223 * src/builtin.c (install_builtin_table): New function. Each
10224 module brings in a builtin_table, which is pushed on a stack.
10225 (struct builtin_table): New struct for list of builtin_tables.
10226 (m4_loadmodule): New function to implement builtin "loadmodule".
10227 (shipout_int): No longer static, to be used by modules.
10231 (builtin_init): changed to call install_builtin_table()
10232 (find_builtin_by_name): Now searches all builtin_tables
10233 (find_builtin_by_addr): do.
10235 * src/path.c: Reorganised to allow for two search paths, one for
10236 include files and one for modules.
10238 * src/m4.h: Added declarations for new functions in module.c and
10241 * src/m4.c (main): Added call to module_init().
10243 * modules: New directory with a few demo modules.
10245 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
10248 * configure.in: Added modules/Makefile to AC_OUTPUT.
10250 * configure.in: Added code to implement --with-modules. Tests for
10251 <dlfcn.h> and -ldl.
10253 * acconfig.h: Added WITH_MODULES
10255 1998-10-02 René Seindal <rene@seindal.dk>
10257 * examples/Makefile.am (pkgdata_DATA): Removed special target for
10258 check and variables TESTS. These tests are now run from the
10261 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
10262 directory. The files stay there but the tests are run from the
10265 * tests/Makefile.am (EXTRA_DIST): Added run-test.
10267 * tests/run-test: New file. Run a test manually
10269 * tests/Makefile.am, tests/get_them: Moved automatically generated
10270 tests (from the manual) to sub directory tests/gentest/. The
10271 tests/ directory had gotten a bit messy.
10273 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10275 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
10276 wrap}.test: Added a few testcases.
10278 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10282 * lib/Makefile.am (noinst_HEADERS): regex.h added
10284 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
10285 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
10287 * acm4/Makefile.am: created providing rules to create
10288 $(top_srcdir)/acinclude.m4 to be used by aclocal.
10290 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
10291 `C'. Reported by Ulrich Drepper.
10293 * Makefile.am (SUBDIRS): Removed checks directory
10294 * configure.in (AC_OUTPUT): Removed checks/Makefile
10296 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
10297 the space when m4.texinfo is edited and whitespace.el is active.
10298 (Defn,example): idem.
10300 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10302 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
10303 ../COPYING. ../Makefile is a file which is certainly present when
10304 test is executed in testSubDir. One can't be sure that the COPYING
10305 file is in .. or ../.. in all situations, the ../Makefile is
10308 * doc/m4.texinfo (Include): adjusted expected test output
10309 according to new tests, i.e. the input will always come from the
10310 file `in' created by the test.
10312 * tests/Makefile.am: Added three lines at the top to get
10313 esyscmd.1.test working.
10315 * tests/get-them: modified to generate clearer tests who will need
10316 less maintenance when new test examples are created in
10317 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
10318 need the generic file `defs') shell scripts creating `in', `ok',
10319 `out' and when apropriate `okerr' and `err' in the directory
10320 `testSubDir' when executed. The compare of `ok' and `out'
10321 (and of `okerr' and `err') will be the exit status of the test.
10322 `out' must match `ok' (and `okerr' must match `err') for the test
10325 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
10326 the tests generated by tests/get-them getting it input normally
10327 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
10328 (dot) before the numeric part) is reserved for all other (hand
10329 written) tests. The `+' means one or more times.
10331 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10333 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
10334 supported short man page to refer to info documentation
10335 * helptoman.pl: added
10336 * configure.in: AC_PATH_PROG(PERL,perl)
10337 * Makefile.am (SUBDIRS): doc after src
10339 * libitized with libit 0.5 from
10340 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
10342 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
10343 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
10344 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
10345 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
10346 lib/rx.{c,h}: added
10347 * configure.in (AC_CHECK_FUNC): getopt_long
10349 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
10351 * TODO: added entry about dependencies
10353 1998-08-10 René Seindal <rene@seindal.dk>
10357 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
10360 * src/builtin.c (m4_changesyntax): Added builtin macro
10361 "changesyntax" to modify the syntax table.
10363 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
10364 table. All categories are assigned a syntax code and tokens are
10365 read according to this table.
10367 1998-08-09 René Seindal <rene@seindal.dk>
10369 * src/numb.{c,h}: New files, implements multiple precision eval
10370 using GNU gmp. Originally submitted by John Gerard Makecki
10371 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
10373 * doc/m4.texinfo (Eval): Added documentation for multiple
10374 precision arithmetic library support.
10376 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
10377 to accommodate multiple precision eval.
10379 1998-08-07 René Seindal <rene@seindal.dk>
10381 * src/input.c (MATCH, match_input), src/m4.h: changed definition
10382 of comment and quote strings to `unsigned int' to allow eight bit
10383 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
10385 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
10386 patch from Mike Howard <mike@clove.com>
10388 1998-08-06 René Seindal <rene@seindal.dk>
10390 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
10393 1998-08-03 René Seindal <rene@seindal.dk>
10397 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
10398 and _ macro. M4 now builds with --disable-nls.
10400 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
10401 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
10403 * configure.in (ALL_LINGUAS): Added complete list of translations:
10404 de fr it ja nl ru sv.
10406 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10408 * po/nl.po: Dutch translation by Erick Branderhorst.
10410 * po/fr.po: French translation by Erick Branderhorst, based on the
10411 translations by François Pinard in fr.msg and m4.cod.
10413 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10417 * src/m4.c: #include <signal.h> not <sys/signal.h>.
10419 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10421 * checks/Makefile.am: explicit list tests in CHECKS.
10423 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10424 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10425 mkinstalldirs, install-sh: Added automake (1.3) support.
10427 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10428 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10429 Used libitize (0.4) to update.
10431 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10432 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10433 README accordingly.
10435 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10436 stack overflow functionality.
10438 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
10440 * Prerelease 1.4.1.
10442 * Makefile.in (realclean-local): Delete stamp-h.in.
10444 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10445 Localize, adapting from how it is done in sharutils.
10447 * fr.tt: New file, for French.
10449 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10450 src/freeze.c: Rename PRODUCT to PACKAGE.
10452 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
10454 * configure.in: Check for <libintl.h> and <locale.h>.
10455 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10456 src/stackovf.c: Rename _ to __P.
10457 * src/m4.h: Declare _ as a macro returning its argument, or else,
10458 include <libintl.h> and declare _ as gettext.
10459 * src/m4.c: Possibly include <locale.h> and call setlocale.
10460 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10461 src/input.c, src/macro.c, src/output.c, src/path.c,
10462 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10465 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
10467 * doc/Makefile.in (stamp-vti): Use new -r option to date.
10469 * configure.in: Put --with-gmp in place, in prevision for John
10471 * acconfig.h: Document WITH_GMP.
10473 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
10477 * doc/Makefile.in (realclean): Also remove stamp-vti.
10478 Reported by Eric Backus.
10480 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
10482 * src/freeze.c (produce_frozen_state): If the frozen file cannot
10483 be opened, return immediately after producing the error message.
10484 Reported by Andreas Schwab.
10486 * configure.in: Check for const only after having found possible
10487 ANSIfying compiler flags, this is of no use to check it before.
10488 Reported by Alexander Lehmann.
10490 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
10492 * src/macro.c (collect_arguments): Cast obstack arguments to
10493 (voidstar), so avoiding compiler warnings.
10494 Reported by Joseph E. Sacco.
10496 * src/freeze.c (produce_frozen_state): Cast printed lengths to
10497 (int) so they correspond to %d format items.
10498 Reported by Joseph E. Sacco.
10500 * src/m4.c (main): Cast the argument to xfree to (voidstar).
10501 * src/symtab.c (free_symbol): Idem.
10502 Reported by Karl Vogel.
10504 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
10506 * Makefile.in (DISTFILES): Distribute BACKLOG.
10508 * configure.in: Define PRODUCT and VERSION.
10509 * acconfig.h: Document PRODUCT and VERSION.
10510 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10511 constant string m4 and variable or parameter named version.
10513 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
10515 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10516 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10517 defines __STDC__ to 0, for indicating it is *not* ANSI!
10518 Reported by Kaveh R. Ghazi.
10520 * configure.in: Added obsolescent tests for AIX and Minix.
10522 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10523 which texclean does not exist anymore.
10524 Reported by Eric Backus, Jim Meyering, John David Anglin and
10527 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
10529 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10530 Reported by John David Anglin.
10532 * src/ansi2knr.c: New version, sent by Peter Deutsch.
10533 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10534 ANSI2KNR, depending on the fact the compiler is ANSI or not.
10535 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10536 Remove the sed filter after ansi2knr for debug.c. Use $O instead
10537 of $U, put underline in extensions rather than in basenames. Use
10538 implicit rules, now that regularity makes this possible.
10539 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10540 of ansi2knr whenever it is needed.
10541 * configure.in: Adjusted for correct STACKOVF substitution.
10542 * src/debug.c (trace_format): When not __STDC__, use (...) as a
10543 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10544 Reported by David MacKenzie.
10546 * Makefile.in: Remove binprefix. Use transform_name instead.
10547 Reported by David MacKenzie.
10549 * doc/Makefile.in: Create version.texi, use it, clean it.
10550 Reported by Jim Meyering.
10552 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
10554 * Makefile.in (all, install, uninstall): Depend on Makefile.
10556 * Makefile.in: For actions invoking $(MAKE) from within compound
10557 sh statements, exit non-zero if the sub-make fails. Otherwise,
10558 the top-level make may exit successfully when it should fail.
10559 Reported by Jim Kingdon.
10561 * {,/*}Makefile.in: Use && after all cd, in case they fail.
10563 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10564 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10565 * configure.in: Substitute PRODUCT and VERSION.
10567 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10569 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
10571 * Makefile.in (mostlyclean-local): Do not remove *~.
10572 * */Makefile.in (mostlyclean): Idem.
10573 Reported by Robert E. Brown and Richard Stallman.
10575 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
10577 * src/m4.h: Get rid of CONFIG_BROKETS.
10579 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
10581 * configure.in: Use AC_ARG_PROGRAM.
10582 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10583 Reported by David MacKenzie.
10585 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
10587 * configure.in: Do not add -O to CFLAGS for GNU C, now that
10588 configure does it automatically.
10589 Reported by Jim Meyering.
10591 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
10593 * src/stackovf.c: Declare the handler_t typedef earlier in the
10594 code, use it for stackovf_handler.
10595 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10596 casting sigsegv_handler.
10597 Reported by Robert Bernstein.
10599 * src/m4.c (main): Initialize program_name to argv[0] without
10601 Reported by Karl Berry.
10603 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
10605 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10606 Reported by Karl Berry.
10608 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
10610 * lib/Makefile.in (mostlyclean): Added.
10611 (TAGS): Make in $(srcdir).
10613 * configure.in: Use `choke me' in test, like everywhere!
10615 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10616 unreacheable and useless.
10618 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10620 * lib/Makefile.in (DISTFILES): Distribute TAGS.
10621 (distclean): Do not remove TAGS.
10622 (realclean): Remove it.
10623 * Makefile.in: Make TAGS in lib also, not just in src.
10624 Reported by Karl Berry.
10626 * Makefile.in (distclean, realclean): Instead of recursively
10627 calling $(MAKE) for the -local part, allow parallel execution of
10628 -recursive and -local, only delay the removal of config.status,
10629 which is repeated in both goals.
10631 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
10635 * Makefile.in: Group all *clean-recursive goals in one, using sed
10636 to remove `-recursive' while calling make recursively. Also, use
10637 a subshell for each recursive $(MAKE).
10638 Reported by Jim Meyering.
10640 * src/m4.h (memcpy): Define with bcopy for BSD systems.
10641 Reported by Kaveh R. Ghazi.
10643 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10644 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10647 * configure.in: Use date instead of touch for stamp-h.
10648 * Makefile.in (stamp-h.in): Idem.
10650 * Makefile.in (distclean, realclean): Force serial execution of
10651 both goals, in case parallel makes are being used.
10652 Reported by Jim Meyering.
10654 * src/Makefile.in (DISTFILES): Distribute TAGS.
10655 (distclean): Do not remove TAGS.
10656 (realclean): Remove it.
10657 Reported by Karl Berry.
10659 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
10661 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
10662 to old names, for following Autoconf.
10664 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
10666 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10667 ./install.sh will not be correctly referred to in sub-Makefiles.
10668 Reported by John David Anglin.
10670 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10671 Reported by Eric Backus.
10673 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10674 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10675 config.status into remaking this directory's Makefile only.
10676 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10677 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10678 Reported by Jim Meyering.
10680 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
10682 * configure.in: Correct stack overflow detection logic, taking
10683 care of systems having only incomplete implementations (like for
10684 Pyramid 9820 OSx 5.0d).
10685 Reported by Kaveh R. Ghazi.
10687 * src/Makefile.in (TAGS): Remote -t from etags call.
10689 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
10691 * lib/Makefile.in (install): Depend on all.
10693 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
10695 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
10696 Reported by Jim Meyering and John David Anglin.
10698 * Makefile.in (distclean-local): Delete config.log.
10699 Reported by Jim Meyering.
10701 Solidify frozen files with respect to -P:
10702 * src/m4.c: Have -P set prefix_all_buitins variable instead of
10703 calling a function by that name. Declare the variable.
10704 * src/m4.h: Adjust declaration for prefix_all_buitins.
10705 * src/builtin.c (builtin_init): Merge in functionality from
10706 previous prefix_all_buitins function, while making entries in the
10707 symbol table, but not modifying the builtin description itself.
10709 * src/freeze.c (reload_frozen_state): Add a useless `break;',
10710 because *many* compilers do not accept an empty `default:'.
10711 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
10712 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
10714 * configure.in: Use AC_TYPE_SIGNAL.
10715 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
10716 Reported by Robert Bernstein.
10718 * checks/Makefile.in (check): Modify PATH so check-them will find
10719 m4 in the src directory.
10720 * Makefile.in (check): Don't.
10721 Reported by Akiko Matsushita and Jim Meyering.
10723 * src/output.c (make_room_for, output_character_helper): New
10724 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
10725 a per buffer MAXIMUM_BUFFER_SIZE.
10727 * src/output.c (output_text): New function, for optimizing the
10728 output of strings of characters. Use it.
10730 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
10732 * doc, src: New directories reorganizing the distribution.
10733 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
10735 * Makefile.in: Adjusted.
10736 * configure.in: Configure new Makefiles.
10738 * m4.h: Declare STRING typedef. Use it for comment and quote
10739 strings, adjusting all references. (This is the rudiments of a
10740 beginning for the eventual withdrawal of NUL terminated strings.)
10741 * output.c (shipout_text): Accept a length parameter, and use it.
10742 All callers adjusted.
10744 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
10746 * m4.h: Include <unistd.h> if it exists.
10747 * stackovf.c: Don't.
10749 Clean up for current_diversion variable:
10750 * output.c: Move current_diversion from builtin.c.
10751 * m4.h: Declare current_diversion so builtin.c can access it.
10752 * output.c (output_init, make_diversion): Initialize or update
10754 * builtin.c (builtin_init, m4_divert): Leave current_diversion
10757 Remove limit on number of diversions:
10758 * output.c: Replace ndiversion by diversions, declare it.
10759 (output_init): Allocate only diversion 0.
10760 (make_diversion): Allocate new diversions as needed.
10761 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
10762 * m4.c: Still accept -N, but do nothing with it.
10763 Reported by David MacKenzie.
10766 * output.c (freeze_diversions): New function.
10767 * m4.h: Declare freeze_diversions.
10768 * freeze.c: Document frozen file format, revise it, call
10769 freeze_diversions to add diversions to frozen format, and code to
10770 reload them properly.
10771 * m4.c: Do not undivert automatically at end when status being
10772 frozen. Do not call builtin_init when reloading frozen state.
10774 Speed up diversion processing:
10775 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
10776 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
10777 structure and variables, cached variables out of output_diversion,
10778 reallocate_diversion_for and OUTPUT_CHARACTER.
10779 (shipout_text, make_diversion, insert_diversion): Adapted to new
10781 (insert_file): Use better buffering.
10782 Reported by David MacKenzie.
10784 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
10786 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
10787 dist works from another build directory.
10789 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
10791 * symtab.c (hack_all_symbols): Use hash_table_size instead of
10792 constant HASHMAX, for -H option to work better.
10794 * builtin.c (DECLARE): Simplify by using _ ().
10796 * freeze.c: New file.
10797 * Makefile.in: Compile it, distribute it.
10798 * m4.c: Recognize, document and process --freeze-state (-F) and
10799 --reload-state (-R) options. Pass a true flag to builtin_init
10800 only if no reloading some state.
10801 * builtin.c (define_builtin): Remove static specifier.
10802 (find_builtin_by_name): Remove static specifier.
10803 (builtin_init): Accept and obey a flag argument.
10804 * m4.h: Add declarations for freeze.c, changes for builtin.c.
10806 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
10808 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
10811 * configure.in: Implement --with-dmalloc.
10812 * acconfig.h: Document WITH_DMALLOC.
10813 * m4.h: Add code for when WITH_DMALLOC.
10815 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
10817 * m4.c (long_options): Use "error-output", the dash was missing.
10818 Reported by Akiko Matsushita.
10820 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
10822 * m4.h: Include <sys/types.h>.
10823 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
10824 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
10826 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
10827 as size_t, not int.
10828 * builtin.c (dump_args): Declare len as size_t, not int.
10830 * debug.c: Prototype the forward declaration of debug_set_file.
10832 * builtin.c (m4_undivert): Replace div by file, for avoiding the
10833 shadowing of this variable.
10834 * output.c (insert_diversion): Idem.
10836 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
10837 (input_init): Duplicate default quote and comment strings.
10838 (set_quotes): Free previous quote strings in all cases. Duplicate
10839 even default quote strings.
10840 (set_comment): Free previous comment strings in all cases.
10841 Duplicate even default comment strings.
10843 * configure.in: Updated for Autoconf 2.0.
10844 * Makefile.in (distclean-local): Also delete config.cache.
10846 * m4.c (usage): Reorganize the --help output by topic. Include a
10847 description for debugging flags.
10849 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
10851 * configure.in: If sigaction is available and SA_ONSTACK defined,
10852 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
10853 defined, use sigvec. Else don't compile stackovf.c.
10854 * stackovf.c (setup_stackovf_trap): Idem.
10855 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
10858 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
10860 * m4.c (usage): Replace printf par fputs.
10862 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
10866 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
10868 * configure.in: Check for sigaction and sigvec. Add a new delayed
10869 check for RLIMIT_STACK, combine in the checking for getrlimit.
10870 All those things are not universally available.
10871 * stackovf.c: Split setting up the trap handler and catching
10872 signals, for better taking care of various configure outcomes.
10873 * examples/stackovf.sh: Correct a typo.
10874 Reported by Eric Backus, Jim Avera and Jim Meyering.
10876 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
10878 * ansi2knr.c: New version sent by its author, Peter Deutsch.
10880 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
10882 * Makefile.in: Modify so parallel make will not try making
10883 lib/libm4.a twice simultaneously.
10884 Reported by Jim Meyering.
10886 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
10888 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
10889 error message, for when no code possibility exists. Even if this
10890 line is completely #ifdef'ed out, it brings a syntax error.
10891 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
10893 * Makefile.in (install): Have install depend on all too, for lib
10894 to be remade as needed.
10896 * examples/stackovf.sh: Try ksh, bsh and bash for shells
10897 providing ulimit, instead of using only ksh.
10898 Reported by Jim Avera and Joseph E. Sacco.
10900 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
10902 * Makefile.in (check): Have it depend on all instead of m4. In
10903 this way, a change in lib will be detected and processed.
10905 * builtin.c (numeric_arg): Use strtol and verify the conversion,
10906 instead of using sscanf which stops as soon as there is a
10907 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
10908 and divert(1xyzzy) were all accepted without any warning or error
10910 * m4.h: Declare strtol as long if not including stdlib.h.
10911 * configure.in: Check for limits.h, and replace strtol if missing.
10912 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
10913 * lib/strtol.c: New file, from elsewhere.
10914 Reported by Andreas Schwab.
10916 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
10918 * macro.c (expand_macro): Cast value to (boolean) prior to
10919 assigning it to traced.
10920 Reported by Tom McConnell.
10922 * Makefile.in (m4): Always make all in lib first.
10923 Reported by Jim Meyering.
10925 1994-07-06 Jim Avera <jima@netcom.com>
10927 * stackovf.c: Isolated OS-dependent sections; Improved portability,
10928 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
10929 handlers), and a default error message if the fault address is not
10930 available (when neither siginfo.h nor BSD sigcontext are supported).
10931 * configure.in: Changes for stackovf.h: Check for sigcontext,
10932 sigaction, sigstack, and define rlim_t as int if necessary.
10933 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
10934 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
10935 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
10937 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
10939 * configure.in: Use AC_SET_MAKE.
10940 * Makefile.in: Use @SET_MAKE@.
10941 Reported by Jim Meyering.
10943 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
10944 Reported by Ian Taylor.
10946 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
10948 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
10949 because siginfo.h is unrelated to standard headers, and siginfo.h
10950 is already checked for.
10951 Reported by Joseph E. Sacco.
10953 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
10955 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
10958 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
10960 * builtin.c (substitute): Use \& to represent this part of the
10961 string which was matched by the whole regexp, instead of
10962 representing the whole string. Any usage of \0 issues a warning
10963 and acts like \&, it will disappear in some subsequent release.
10965 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
10967 * m4.c: Complete prototype for forwarded declaration of usage.
10969 * input.c (init_macro_token): Correct own reference in error
10970 message. Previous name get_macro_func was referred to instead.
10971 (next_char): Correct own reference in error message. Previous
10972 name advance_input was referred to instead.
10974 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10975 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10976 and_term, not_term, logical_not_term, cmp_term, shift_term,
10977 add_term, mult_term, exp_term, unary_term, simple_term): Add
10978 prototype to forwarded declarations. Declare parameter v1 as
10979 eval_t * instead of int *. Same for local variable v2 in dyadic
10980 functions. Same for result in exp_term.
10981 * builtin.c (m4_eval): Declare value as eval_t instead of int.
10982 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
10983 unsigned_eval_t instead of unsigned int. Change casts accordingly.
10984 (shipout_int): Cast first argument of ntoa to eval_t.
10985 Reported by Thorsten Ohl.
10987 * macro.c: Complete the prototypes of forwarded expand_macro and
10989 Reported by Thorsten Ohl.
10991 * m4.h: Define voidstar as void * or char * depending on __STDC__.
10992 The Ultrix 3.1 compiler cannot do much with void pointers.
10994 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10995 * m4.c (xfree): Replace void * by voidstar.
10996 Reported by Tom McConnell.
10998 * ansi2knr.1: New, from elsewhere.
10999 * Makefile.in (DISTFILES): Distribute ansi2knr.1
11001 * Makefile.in (stamp-h.in): Avoid running ./config.status if
11002 stamp-h does not exist yet. This avoids running it a second time
11003 just after the initial ./configure.
11004 Reported by David MacKenzie and Tom McConnell.
11006 * m4.h: Replace the enum debug_info declaration with a series of
11007 #define's. The Ultrix 3.1 compiler would otherwise need casting
11008 (int) to most references, when used in expressions.
11009 Reported by Tom McConnell.
11011 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
11013 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
11014 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
11015 calls the compiler. Previously, FP_PROTOTYPES was only calling
11016 the preprocessor; by not being subject to CFLAGS, this was
11017 discouraging those flags asking for ANSI compilation.
11018 * acconfig.h: Document HAVE_PROTOTYPES.
11019 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
11020 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
11021 Reported by Eric Backus.
11023 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
11024 from the environment. Default CFLAGS to -g if not set.
11025 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
11026 * lib/Makefile.in: Have CFLAGS substituted from configure.
11027 Reported by Eric Backus and Tom McConnell.
11029 * configure.in: m4_undefine changeword before using AC_ENABLE.
11031 * m4.h: Declare prototypes for error (for ANSI compilers only),
11032 prefix_all_builtins and reference_error.
11033 Reported by Tom McConnell.
11035 * input.c (set_word_regexp): Do not try to initialize the array
11036 test from a string, this does not work with non-ANSI compilers.
11037 Reported by Eric Backus.
11039 * Makefile.in (dist): Clean examples/ before saving it.
11040 (distclean-local): Also remove stamp-h.
11041 Reported by Eric Backus.
11043 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
11044 non ANSI compilers.
11045 Reported by Tom McConnell.
11047 * checks/Makefile.in (clean): Depends on mostlyclean.
11048 (mostlyclean): New goal.
11050 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
11052 * Makefile.in (DISTFILES): Distribute install.sh.
11053 * install.sh: New file, copied from elsewhere.
11054 Reported by Assar Westerlund and Kaveh R. Ghazi.
11056 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
11058 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
11059 * acconfig.h: Explain ENABLE_CHANGEWORD.
11061 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
11062 from code provided by Pete Chown]
11063 * m4.h: Add original_text field to u_t variant of union u.
11064 Declare TOKEN_DATA_FUNC macro.
11065 * builtin.c: Declare changeword.
11066 (m4_changeword): New function.
11067 * input.c: Include "regex.h", define variables with word regexps.
11068 (input_init): Initialize the word regexp.
11069 (set_word_regexp): New.
11070 (next_token): Declare local variables, use the previous code if
11071 default_word_regexp is true. Else, match using a new code. Save
11073 * macro.c (expand_token): Ship out original text if not a macro
11075 Reported by Krste Asanovic and Pete Chown.
11077 [These modifs all depend upon ENABLE_CHANGEWORD]
11078 * m4.h: Declare external user_word_regexp.
11079 * m4.c: Declare user_word_regexp, and initialize it from
11080 --word-regexp or -W, or NULL if not specified.
11081 * input.c: Use user_word_regexp if specified, instead of
11082 DEFAULT_WORD_REGEXP.
11084 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
11087 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
11088 * checks/Makefile.in: Empty the suffix list.
11089 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
11091 * m4.c: Declare nesting_limit and initialize it to 250.
11092 Implement -LNUMBER or --nesting-limit=NUMBER to change its
11094 * m4.h: Declare nesting_limit as external.
11095 * macro.c (expand_macro): Stop execution whenever nesting limit
11097 Reported by Bengt Mertensson.
11099 * eval.c (evaluate): Diagnose excess characters in eval input.
11100 Things like `eval(08)' used to return 0 with no diagnostic.
11102 * m4.h: Capitalize first letter of all macro arguments in
11105 * m4.c: Declare warning_status, initialize it to 0. Add new
11106 option -E, or --fatal-warnings, which sets warning_status to
11107 EXIT_FAILURE instead.
11108 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
11109 EXIT_FAILURE if not otherwise done by header files.
11110 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
11111 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
11112 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
11113 argument of all M4ERROR calls.
11114 Reported by Noah Friedman.
11116 * examples/incl-test.m4: Renamed from incl_test.m4.
11117 * examples/include.m4: Include incl-test.m4 instead of
11119 * examples/multiquotes.m4: Renamed from multi-quotes.m.
11121 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
11123 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
11124 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
11125 also tested it on a Sun Sparc workstation running SunOS 4.x.
11127 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
11128 49.format check, abusing a `union values' argument with sprintf
11129 without selecting the proper field. Now, save the formatting type
11130 first, delaying the fetch of the corresponding argument.
11131 Reported by Joseph E. Sacco and Tom Quinn.
11133 * format.c (format): Remove const from char *fmt declaration when
11134 not HAVE_EFGCVT, because a NUL may be forced into it.
11136 * m4.h: Declare atof() when not STDC_HEADERS.
11137 Reported by Joseph E. Sacco.
11139 * Regenerate configure using Autoconf 1.11, this corrects a
11140 problem about an incorrect cpp seting on NeXT 3.1.
11141 Reported by Alexander Lehmann.
11143 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
11145 * m4.h (_): Change argument from `x' to `Args'.
11147 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
11149 * m4.h: Rename Args() to _().
11150 * m4.h: Remove extern specifier from all function declarations.
11152 1994-04-22 Jim Avera <jima@netcom.com>
11154 * stackovf.c: New file implementing stack-overflow detection.
11155 * configure.in: Check for getrlimit, sigaction. If all of
11156 standard headers, getrlimit and sigaction, define USE_STACKOVF and
11157 substitute ${U}stackovf.o for STACKOVF.
11158 * acconfig.h: Declare USE_STACKOVF.
11159 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
11160 * m4.h: Declare setup_stackovf_trap().
11161 * m4.c: Call setup_stackovf_trap().
11162 * tests/stackovf_test.sh: New file.
11164 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
11166 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
11168 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
11170 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
11172 * m4.h: Remove definition of volatile, not used anymore.
11173 Reported by Jim Meyering and Joseph E. Sacco.
11175 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
11176 of `if ... else /* nothing */' for if macros.
11177 Reported by Jim Meyering.
11179 * builtin.c (m4_regexp): Reorganize the code for avoiding a
11180 warning from gcc about `repl' possibly used before defined.
11181 Reported by Jim Meyering.
11183 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
11184 Reported by Jim Meyering.
11186 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
11188 * m4.h: Move the conditional definition of volatile after the
11189 inclusion of system files, because they may define it first.
11191 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
11193 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
11194 get around a problem with Alpha make seeing a syntax error, there.
11195 Reported by Vern Paxson.
11197 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
11199 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
11200 Reported by Richard Stallman.
11202 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
11204 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
11205 instead of AC_HAVE_FUNCS.
11206 Reported by Noah Friedman.
11208 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
11210 * m4.c: Initialize show_help and show_version to zero.
11212 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
11213 Use them in exit() and usage() calls.
11215 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
11217 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
11218 syserr() macro. Delete errref, add reference_error and M4ERROR.
11219 * m4.c: Replace errref, which was returning an input reference
11220 string, with reference_error, which prints it on standard error.
11221 * builtin.c, output.c: Use errno as second parameter to error,
11222 instead of using syserr() with %s.
11223 * *.c: Use M4ERROR instead of error: no more errref() with %s.
11224 Doing so, the program name appears after the input reference
11225 instead of before, which eases M-x next-error processing.
11227 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
11229 * checks/get-them: Escape braces with backslashes in patterns,
11230 because HPUX-9.01 awk needs this.
11231 Reported by Jim Meyering.
11233 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
11235 * builtin.c: Declare "FILE *popen ();".
11237 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
11238 macros, replace error_message_prefix() declaration by errref()'s.
11239 Declare xrealloc, for use in errref().
11240 * m4.c: Delete error_message_prefix() function, add errref().
11241 * *.c: Use error() systematically in place of all error macros,
11242 now that error() flushes stdout first. Make needed adjustments.
11244 * m4.h: Remove const in sys_errlist[] declaration, it creates
11245 conflicts on SGI and Alpha.
11246 Reported by Kaveh R. Ghazi.
11248 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
11250 * m4.c: Include <getopt.h> instead of "getopt.h".
11252 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
11253 * acconfig.h: New, for documenting HAVE_EFGCVT.
11254 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
11255 use them wherever appropriate. Also use -I. for compilations.
11256 * lib/Makefile.in: Use -I.. for compilations.
11257 * *.c: Include <config.h> or "config.h".
11259 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
11260 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
11262 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
11264 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
11266 * input.c (input_init): Initialize quote and comment strings
11267 explicitely instead of calling set_quotes and set_comment: by
11268 doing so, we ensure we do not free uninitialized variables.
11270 * checks/check-them: Reverse arguments to both diff, so the
11271 expected is on the left and the obtained on the right.
11273 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
11274 macros. Delete declarations for m4error, warning, fatal and
11275 internal_error, add declaration for error_message_prefix.
11276 * m4.c: Delete m4error, warning, fatal and internal_error
11277 routines, add error_message_prefix routine.
11278 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
11279 warning with WARNING*, fatal with FATAL* and internal_error with
11281 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
11282 this is not needed anymore.
11284 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
11285 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
11286 and debug_message, add declaration for debug_message_prefix.
11287 * debug.c: Remove static specifier for FILE *debug declaration.
11288 Delete debug_print and debug_message routines, add
11289 debug_message_prefix routine.
11290 * builtin.c, debug.c: Replace debug_print routine calls with
11291 DEBUG_PRINT* macro calls.
11292 * input.c, path.c: Replace debug_message routine calls with
11293 DEBUG_MESSAGE* macro calls.
11295 * m4.h: Remove inclusion of <varargs.h>.
11296 * debug.c: Include <stdarg.h> or <varargs.h>.
11297 (trace_format): Use stdarg instead of varargs if __STDC__.
11299 * configure.in: Remove checks for vfprintf and _doprnt. These
11300 implementations use varargs tricks which are not portable enough.
11301 * lib/vfprintf.c: Deleted.
11302 * lib/_doprnt.c: Deleted.
11303 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
11304 Reported by Joel Sherrill.
11306 * path.c (add_include_directory): Use xstrdup.
11308 * builtin.c (find_builtin_by_name): Declare static.
11310 * *.[ch]: Add const to a few "char *" declarations.
11312 * configure.in: Remove commented tests for fileno() and fstat().
11313 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
11315 * debug.c (debug_flush_files): New.
11316 * m4.h: Declares it.
11317 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
11318 Reported by Nicolas Pioch.
11320 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
11322 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
11323 Reported by Joel Sherrill.
11325 * builtin.c (prefix_all_builtins): Instead of the table size, use
11326 the null entry at end for stopping the loop. It was overwritten.
11327 Reported by Andreas Schwab and Jim Meyering.
11329 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
11330 Reported by Kaveh R. Ghazi.
11332 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
11333 Reported by Karl Vogel.
11335 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
11337 * m4.h: Do not define volatile if already defined.
11338 Reported by René Seindal.
11340 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
11342 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
11343 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
11345 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11347 * m4.h: Define strchr and strrchr in terms of index and rindex,
11348 instead of the other way around.
11349 * builtin.c, m4.c, path.c: Use strchr instead of index.
11351 * input.c (next_char): Remove a "break;" after a "return ...;".
11352 Reported by Tom McConnell.
11354 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11358 * configure.in: Do not copy check files in the build hierarchy.
11359 * checks/check-them: Identify the m4 version being checked. For
11360 finding m4, look in $PATH instead of in the parent directory.
11361 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
11362 * checks/Makefile.in (.all-stamp): Always create check files in
11363 the source hierarchy, not anymore in the build hierarchy.
11364 (check): cd to the source hierarchy before performing checks.
11365 Do not copy nor clean COPYING anymore, take it from `..'.
11366 Reported by Tom McConnell.
11368 * Makefile.in (Makefile): Use $(SHELL).
11369 (config.status): Use $(SHELL). Use "config.status --recheck"
11370 instead of "configure --no-create", which is obsolete.
11371 Reported by Tom McConnell.
11373 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
11375 * m4.c (usage): Use "%s" instead of "m4" in format string.
11376 Reported by Jim Meyering.
11378 * Makefile.in: Distribute mkinstalldirs.
11379 Reported by Pierre Gaumond.
11380 Reported by Jim Meyering.
11381 Reported by Tom McConnell.
11382 Reported by Andreas Gustafsson.
11384 * checks/check-them: Renamed from checks/check_them.
11385 * checks/get-them: Renamed from checks/get_them.
11386 * checks/.all-stamp: Renamed from checks/.all_stamp.
11387 * checks/Makefile.in: Changed accordingly.
11388 Reported by Jim Meyering.
11390 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
11392 * lib/Makefile.in (dist): Correct permissions on files.
11394 * output.c: Declare tmpfile, some systems don't.
11396 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
11398 * checks/Makefile.in (dist): Correct permissions on files.
11400 * Makefile.in (dist): Ensure recursive linking for subdirectory
11401 `examples', also set read/write permissions on all its files.
11403 * mkinstalldirs: New, from elsewhere.
11404 * Makefile.in: Use it.
11406 * debug.c: Synchronize debug messages and regular output when
11407 the debug file and stdout are redirected to the same file.
11408 * configure.in: Add (commented) checks for fileno and fstat.
11409 Reported by Jim Avera.
11411 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
11412 etc., arguments, then ignore the superfluous one. m4 used to
11413 diagnose missing arguments and return the empty string.
11414 Reported by Nick S. Kanakakorn.
11416 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
11418 * m4.c (main): At end of all input, ensure all undiverted text
11419 goes to the main output stream.
11420 Reported by Andreas Gustafsson.
11422 * m4.c (main): exit (0), instead of return 0.
11424 * m4.c: Implement -P and --prefix-builtins.
11425 * builtin.c: Delete const specifier on builtin_tab.
11426 (prefix_all_builtins): New.
11427 Reported by Noah Friedman.
11428 Reported by Scott Bartram.
11430 * c-boxes.el: New, from elsewhere.
11431 * Makefile.in: Distribute it.
11433 * m4.h: Do not define bcopy if <string.h> defines it.
11434 Reported by Stephen Perkins.
11436 * builtin.c (define_macro): Allow a missing second argument, in
11437 which case it is implied empty. Affects define and pushdef.
11438 Reported by Eric Allman.
11440 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
11442 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11443 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11444 * builtin.c: Initialize all the blindness fields in builtin_tab.
11445 (define_builtin): Copy the blindness of a builtin into its symbol.
11446 * macro.c (expand_token): Avoid processing a blind builtin if the
11447 next character is not an opening parenthesis.
11448 Reported by David MacKenzie.
11449 Reported by Noah Friedman.
11451 * configure.in: Ensure an exit status of 0 on completion.
11452 Reported by Vivek P. Singhal.
11454 * eval.c (eval_lex): Admit both lower and upper case letters for
11455 bases greater than 10. Only lower case letters were accepted.
11457 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11458 Reported by Krste Asanovic.
11460 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
11461 * eval.c (logical_not_term): New name for not_term.
11462 * eval.c (xor_term): New, between or_term and and_term.
11463 * eval.c (not_term): New, between and_term and logical_not_term.
11464 * eval.c (shift_term): New, between cmp_term and add_term.
11465 Reported by Krste Asanovic: ~, ^, <<, >>.
11466 Reported by Ben A. Mesander: ** vs ^.
11468 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11469 * m4.h: Delete xrealloc.c.
11470 * lib/xmalloc.c: New, from elsewhere.
11471 * lib/xstrdup.c: New, from elsewhere.
11472 * lib/Makefile.in: Distribute and compile them.
11474 * m4.c: Change progname to program_name.
11475 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11476 * lib/error.c: New, from elsewhere.
11477 * lib/Makefile.in: Distribute and compile error.c.
11478 * configure.in: Check AC_VPRINTF and for strerror.
11479 * m4.c: Delete cmd_error. Use error instead.
11480 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11482 * m4.h: Delete #define const, let Autoconf takes care of this.
11484 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11485 Merge parse_args into main. Declare argv to be `char *const *',
11486 then remove superfluous casts.
11488 * m4.c: Rename --no-gnu-extensions to --traditional.
11489 Reported by Ben A. Mesander.
11491 * m4.c (usage): Add a status parameter. Supply one in various
11492 calls. Add --help processing. Remove -V for --version.
11494 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11496 * lib/Makefile.in: Have an AR=ar declaration.
11497 Reported by Eric Backus.
11498 Reported by Bjorn R. Bjornsson.
11499 Reported by Tom Tromey.
11500 Reported by Kristine Lund.
11501 Reported by Marion Hakanson.
11503 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
11505 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11506 Reported by Noah Friedman.
11508 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
11510 * Makefile.in: Remove MDEFINES and cleanup.
11512 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
11514 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11515 Create a gzip file.
11517 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
11519 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11520 ensure 777 mode for directories, so older tar's will restore file
11523 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
11525 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11526 so the installer can override automatically configured choices.
11527 Reported by Karl Berry.
11529 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
11531 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
11532 previous version was not working properly on m68k-hp-bsd4.3.
11533 Reported by Roland McGrath.
11535 * lib/_doprnt.c: Stolen from Oleo distribution.
11536 * configure.in: Check for _doprnt.c if vfprintf.c selected.
11537 * lib/Makefile.in: Distribute _doprnt.c.
11538 Do not distribute regex.[ch].old anymore.
11540 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
11542 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11543 Richard wants it there.
11545 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
11547 * Makefile.in: Add DEFS to MDEFINES.
11548 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11549 (libm4.a): Remove the library before creating it.
11550 (distclean): Remove tags and TAGS too.
11552 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
11554 * Makefile.in (dvi, m4.dvi): New goals.
11556 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11557 macro.c, output.c, path.c, symtab.c: Change Copyright from
11558 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11560 * examples/divert.m4: Deleted, this bug has been corrected.
11562 * Makefile.in (texclean, mostlyclean): New goals.
11564 * Makefile.in (clean): Remove clutter from ansi2knr.
11565 Reported by Pierre Gaumond.
11567 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
11569 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
11570 might well use CFLAGS is s/he needs it.
11572 * Makefile.in: Allow installation of info files from a separate
11574 Reported by Jason Merrill.
11575 Reported by David MacKenzie.
11576 Reported by Skip Montanaro.
11577 Reported by Erez Zadok.
11578 Reported by Assar Westerlund.
11580 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
11583 This is still a beta release for the future GNU m4 version 1.1.
11585 * lib/alloca.c: New, from elsewhere.
11586 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
11588 * m4.h: Do not define index/rindex if already defined. If
11589 FALSE/TRUE are already defined, do not redefine them, but merely
11590 define boolean typedef to int.
11592 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11593 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11594 because some C compilers do not like connectives with #ifdef.
11595 * m4.h: Define `volatile' only if __GNUC__, instead of once for
11596 __GNUC__ and once for __STDC__.
11597 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11599 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11600 Makefile dependencies. Without it, make keeps destroying and
11601 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
11603 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11604 to diversion/DIVERSION, this was a spelling error.
11606 * m4.c: Declare version[], remove #include "version.h".
11607 * version.h: Deleted.
11608 * Makefile.in: Remove references to version.h.
11610 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11611 production, by using a simpler and more robust algorithm. This
11612 solves the problem of synclines sometimes written in the middle of
11613 an output line. Delete sync_line() and output_lines variable.
11614 * m4.h: Remove sync_line prototype and output_lines declaration.
11615 * input.c (next_char), output.c (shipout_text): Remove references
11617 * input.c (push_file, pop_file): Merely put the value -1 in
11618 output_current_line instead of calling sync_line, for delaying a
11619 single `#line NUM FILE' before next output line. Do not test
11620 for sync_output, because this is unnecessary clutter.
11621 * output.c (make_divertion, insert_divertion): Idem.
11622 * input.c: Rename must_advance_line to start_of_input_line, for
11625 * debug.c (trace_header): Select a new debug line format, which
11626 better complies with GNU standards for formatting error messages.
11627 With option `-dfl', M-x next-error might be used on the output.
11628 * m4.c (vmesg): Adjust format of error output to GNU standards.
11629 * m4.texinfo: Adjust examples for `make check' to work.
11631 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11632 case for enum debug_info constants, which were all lower case.
11634 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11636 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11637 collected patches. I tried a few times using newer regex.[ch], it
11638 mysteriously stopped aborting with this one. Insecure feeling...
11639 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11641 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
11643 * m4.c: Change `--no-warnings' to `--silent'.
11644 Reported by David MacKenzie.
11646 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11647 leave it off for now. See comment in m4.c for justification.
11648 Reported by David MacKenzie.
11650 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11651 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11653 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
11655 * Makefile.in: Ensure recursive cleaning is done before local
11656 cleaning for all clean goals.
11658 * builtin.c (ntoa): Ensure the value is always interpreted as a
11659 signed quantity, whatever the radix is.
11661 1992-11-18 Jim Meyering <meyering@idefix>
11663 * builtin.c, format.c, input.c: Split long lines.
11664 * m4.c: Use typedef macro_definition instead of struct
11666 * symtab.c: Use typedef symbol instead of struct symbol.
11668 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
11670 * *.[ch]: Remove all trailing whitespace, in code and comments.
11672 * configure.in: Find some awk.
11673 * Makefile.in: Add $(AWK) to MDEFINES.
11674 * checks/Makefile.in: Transmit $(AWK) to get_them.
11675 * checks/get_them: Use $AWK instead of gawk. Add a close in the
11676 awk script when switching files, because without this, mawk runs
11677 out of file descriptors.
11679 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
11681 * Makefile.in (realclean): Delete m4.info*.
11682 Reported by Jim Meyering.
11684 * Makefile.in: Adjust and link with checks/Makefile.
11685 * checks/Makefile.in: New.
11686 * configure.in: Output checks/Makefile.
11688 * checks/get_them: Have the dnl header of each test more
11689 recognizable by next-error, also use a better message.
11691 1992-11-16 Jim Meyering <meyering@idefix>
11693 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
11694 And use that only if __GNUC__ since we're using it's GCC-specific
11695 semantics that tell the compiler the associated function doesn't
11698 * builtin.c (substitute): Don't use character as an array index.
11699 (dumpdef_cmp): Make formal arguments `const void *' to avoid
11700 warnings with gcc -W -Wall on systems with qsort prototype.
11701 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
11704 * eval.c (most functions): Add parentheses to assignments used
11705 as truth values go avoid warnings from gcc -Wall.
11707 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
11708 any functions that don't need external scope.
11710 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
11711 (many functions and arrays): Declare `const'.
11713 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
11715 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
11716 removing the declaration from m4.h. Also rename false to FALSE
11719 * lib/Makefile.in (Makefile): New goal.
11721 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
11722 so heavily loaded. It gets more easily overridable, calling make.
11723 Reported by Jim Meyering.
11725 * Makefile.in (dist): Get .fname from the current directory name,
11726 instead of from version.h. I need updating many files manually,
11727 when the version changes, version.h is just one of them.
11729 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
11731 * m4.h: Remove the tag `boolean' on the enum introducing typedef
11732 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
11733 Reported by Tom McConnell.
11735 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
11737 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
11738 39.cleardiv, which were describing missing or spurious newlines.
11739 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
11740 do not depend on machine word size, `/bin/false' implementation,
11741 or `wc' output format. `make check' is more dependable, now.
11743 * checks/check_them: Summarize the failed tests by listing their
11744 name, at end. If none, issue `All checks successful'. Output
11745 `Checking' instead of `Input file:'.
11747 * checks/get_them, checks/check_them: Reindented.
11749 * Makefile.in (dist): chmod a+r before making the tar file.
11751 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
11753 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
11755 * input.c (next_token): Reinitialize token_buttom just after using
11756 it as a watermark with obstack_free. Or else, a future token, big
11757 enough for triggering reallocation of the obstack chunk, could
11758 void the initialized value of token_buttom, later causing panic in
11759 obstack_free. Rename token_buttom to token_bottom everywhere.
11761 * m4.h: Before declaring errno, first include <errno.h> and
11762 ensure that it does not define errno.
11763 Reported by Richard Stallman.
11765 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
11767 * builtin.c: Define and use DECLARE macro for builtins.
11769 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
11770 argument, this is a common idiom for introducing long comments.
11772 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
11773 arguments. The last argument was silently ignored.
11775 * m4.c (cmd_error): Add a missing semicolon before va_end().
11777 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
11779 * Makefile.in: Now handle protoized sources. Define and use U.
11780 Compile and use ansi2knr with old compilers. Update DISTFILES.
11781 Add `aclocal.m4' to `configure' dependencies.
11782 * ansi2knr.c: New, from Ghostscript distribution.
11783 * configure.in: Define U through FP_PROTOTYPES for old compilers.
11784 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
11785 * aclocal.m4: New, provide FP_PROTOTYPES.
11786 * m4.h: Conditionnaly protoized through Args, save for varags.
11787 * builtin.c: Protoized. Then:
11788 Include <sys/types.h> if size_t is not defined, before "regex.h".
11789 (m4_ifelse): Fetch built-in name properly for diagnostic.
11790 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
11791 (m4_regexp): Add const to `msg' declaration.
11792 (m4_patsubst): Add const to `msg' declaration.
11793 * debug.c: Protoized, save for varargs.
11794 * eval.c: Protoized.
11795 * format.c: Protoized.
11796 * input.c: Protoized.
11797 * m4.c: Protoized, save for varargs. Then:
11798 (xfree): Accept void * instead of char *.
11799 (xmalloc): Return void * instead of char *.
11800 (xrealloc): Accept and return void * instead of char *.
11801 * macro.c: Protoized.
11802 * output.c: Protoized.
11803 * path.c: Protoized. Then cast some (char *) over xmalloc's.
11804 * symtab.c: Protoized.
11806 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
11808 * m4.texinfo: Remove directory from diagnostics in 30.include,
11809 51.eval, 56.errprint and 57.m4exit tests.
11811 * m4.h: Remove declarations for int or void system functions, they
11812 cause more conflicting trouble than they make good.
11814 * configure.in: Avoid configuration header file. Add some tests.
11815 * m4.h: Remove #include "config.h".
11816 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
11817 Then, rewritten for better compliance with GNU standards.
11819 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
11821 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
11822 because of a misplaced #endif.
11824 * Many *.[hc] files: Correct intra-line spacing here and there,
11825 according to GNU indent 1.6 advice.
11827 * configure.in: New, using Autoconf 1.2.
11828 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
11829 * Delete old configure.in, configure, etc/configure.in,
11830 etc/configure, lib/configure.in, lib/configure and config/*.
11831 Reported by Jason Merrill.
11833 * symtab.c (hash): Change (char) NULL to '\0'.
11834 Reported by Jason Merrill.
11836 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
11837 etc/nextvers.sh. Release numbers will be edited `by hand'.
11838 * version.h: De-automatize, force value in.
11840 * m4.c: Changes in order to use a newer getopt.h.
11841 Reported by David MacKenzie.
11843 * checks/: New name for examples/.
11844 * checks/get_them: New location for etc/get_examples.
11845 * checks/check_them: New location for etc/check_examples.
11846 * Makefile.in, checks/get_them, checks/check_them: Adjust.
11847 * lib/vfprintf.c: New location for etc/vfprintf.c.
11848 * Delete empty etc/.
11849 * examples/: New name for test/.
11851 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
11853 * Makefile.in (check): Add m4 as dependency.
11855 * m4.c: Accept --no-warnings instead of --no_warnings, and
11856 --no-gnu-extensions instead of --no_gnu_extensions. Make the
11857 usage message more informative.
11858 Reported by David MacKenzie.
11860 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
11862 * etc/check_examples: New name for check_examples.sh.
11863 * etc/get_examples: New name for get_examples.sh.
11864 * Makefile.in, etc/Makefile.in: Use new names.
11866 * Makefile.in: Transmit $(CC) while making in lib.
11868 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
11869 code disposition by hand.
11871 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
11873 * m4.h: Delete definitions for abort() and exit().
11874 Reported by Richard Stallman.
11876 * config/hmake-unicos, config/s-unicos.h: New files.
11877 Reported by Hal Peterson.
11879 * eval.c (exp_term): Have N^0 return 1.
11880 Reported by Michael Fetterman.
11882 * eval.c, input.c, m4.h: Remove last comma in enums.
11883 Reported by Mike Lijewski.
11885 * Transfer of maintenance duties from René to François.
11887 1991-10-24 René Seindal <seindal@diku.dk>
11889 * Release 1.0. Many thanks to those, who provided me with bug
11890 reports and feedback.
11892 * Uses GNU configure, taken from the gdb distribution.
11894 * Uses GNU getopt(), with long option names.
11896 * The -Q/+quiet option is added, which suppresses warnings about
11897 missing or superflous arguments to built-in macros.
11899 * Added default options via the M4OPTS environment variable.
11901 * The built-in format can now be configured to use sprintf as
11902 the formatting engine, for systems without [efg]cvt(3).
11904 * GNU library code is moved to the ./lib subdirectory; other
11905 utility files are now in ./etc.
11907 * Several minor bugs have been fixed.
11909 1991-07-26 René Seindal <seindal@diku.dk>
11911 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
11912 François Pinard and Roland H. Pesch for providing me with reports.
11914 * The builtins incr and decr are now implemented without use of
11917 * The builtin indir is added, to allow for indirect macro calls
11918 (allows use of "illegal" macro names).
11920 * The debugging and tracing facilities has been enhanced
11921 considerably. See the manual for details.
11923 * The -tMACRO option is added, marks MACRO for tracing as soon
11926 * Builtins are traced after renaming iff they were before.
11928 * Named files can now be undiverted.
11930 * The -Nnum option can be used to increase the number of
11931 divertions available.
11933 * Calling changecom without arguments now disables all comment
11936 * The function m4_patsubst() is now consistently declared
11939 * A bug in dnl is fixed.
11941 * A bug in the multi-character quoting code is fixed.
11943 * Several typos in the manual has been corrected. More probably
11946 * The m4.info file is now installed along with the program.
11948 1990-11-15 René Seindal <seindal@diku.dk>
11950 * Updated and enhanced version. Release 0.75, manual 0.07.
11952 * Implemented search path for include files (-I option and
11953 M4PATH envronment variable).
11955 * Implemented builtin "format" for printf-like formatting.
11957 * Implemented builtin "regexp" for searching for regular
11960 * Implemented builtin "patsubst" for substitution with regular
11963 * Implemented builtin "esyscmd", which expands to a shell
11966 * Implemented "__file__" and "__line__" for use in error
11969 * Implemented character ranges in "translit".
11971 * Implemented control over debugging output.
11973 * Implemented multi-character quotes.
11975 * Implemented multi-character comment delimiters.
11977 * Changed predefined macro "gnu" to "__gnu__".
11979 * Changed predefined macro "unix" to "__unix__", when the -G
11980 option is not used. With -G, "unix" is still defined.
11982 * Changed "shift", "$@" and "$*" to not insert spaces afters
11985 * Added program name to error messages.
11987 * Fixed two missing null bytes bugs.
11989 1990-01-22 René Seindal <seindal@diku.dk>
11991 * Initial beta release. Release 0.50, manual 0.05.
12000 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
12001 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
12003 Copying and distribution of this file, with or without
12004 modification, are permitted provided the copyright notice
12005 and this notice are preserved.