1 2009-06-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3 Avoid pointer arithmetic on `void *'.
4 * modules/m4.c (dump_symbol_CB): Cast obstack_base return value
5 to `char *' before using it.
7 2009-05-04 Eric Blake <ebb9@byu.net>
9 Silence verbose testsuite runs.
10 * tests/testsuite.at (m4_version_prereq): Bump to recent
11 autoconf.git version where stdout-nolog was added.
12 * tests/builtins.at (esyscmd, syscmd): Use new stdout-nolog.
13 * tests/freeze.at (AT_TEST_FREEZE): Likewise.
14 * tests/others.at (stderr closed): Likewise.
15 * HACKING: Mention new requirement.
16 * bootstrap: Likewise.
17 Reported by Ralf Wildenhues.
19 2009-04-21 Eric Blake <ebb9@byu.net>
21 Be more explicit about default quoting characters.
22 * doc/m4.texinfo (Quoted strings): Call out characters by name.
24 Suggested by Mehul Sanghvi.
26 2009-04-16 Eric Blake <ebb9@byu.net>
28 Use gnulib rename module.
29 * ltdl/m4/gnulib-cache.m4: Import rename module. At the moment,
30 we don't tickle either of the platform bugs that it fixes, but it
31 is better to be safe than sorry.
33 Require newer automake features.
34 * configure.ac (AM_INIT_AUTOMAKE): Add dist-xz, color-tests,
35 parallel-tests, and silent-rules. Drop dist-lzma.
36 * HACKING: Update minimum requirements.
37 * gnulib: Update to latest version.
39 Mention release of 1.4.13.
40 * NEWS: Update to match release on branch-1.4.
41 * doc/m4.texinfo (History): Update release history.
42 (copying): Finish conversion to GFDL 1.3, started 2008-11-04.
44 2009-03-23 Eric Blake <ebb9@byu.net>
46 Exploit git submodule by adding appropriate symlinks.
47 * bootstrap: No longer copy files from gnulib.
48 * COPYING: Change to symlink pointing into gnulib.
50 * build-aux/compile: Likewise.
51 * build-aux/config.guess: Likewise.
52 * build-aux/config.sub: Likewise.
53 * build-aux/depcomp: Likewise.
54 * build-aux/install-sh: Likewise.
55 * build-aux/mdate-sh: Likewise.
56 * build-aux/missing: Likewise.
57 * build-aux/texinfo.tex: Likewise.
58 * .cvsignore: Reflect these changes.
59 * .gitignore: Likewise.
60 * build-aux/.cvsignore: New file.
61 * build-aux/.gitignore: Likewise.
63 Make gnulib a git submodule.
64 * .gitmodules: New file.
65 * gnulib: Record which version of gnulib has been tested.
66 * bootstrap: Aid in submodule usage.
67 * cfg.mk (gnulib_dir): Alter default location of gnulib.
68 * HACKING: Mention how to use submodule.
70 2009-03-21 Eric Blake <ebb9@byu.net>
72 Use memcmp2 to simplify lexicographic comparisons.
73 * ltdl/m4/gnulib-cache.m4: Import memcmp2.
74 * modules/m4.c (dumpdef_cmp_CB): Use it.
76 2009-03-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
78 Fix m4.1 build race, exposed by parallelism through GNUmakefile.
79 * Makefile.am (SUBDIRS): Add doc.
80 (Documentation rules): Move ...
81 * doc/Makefile.am: ... to this new file.
82 * configure.ac (AC_CONFIG_FILES): Generate doc/Makefile.
84 2009-03-13 Eric Blake <ebb9@byu.net>
86 Try to tolerate spaces in directory names in testsuite.
87 * tests/null.m4: Provide shell quoting, in case __program__
90 Fix awk script portability.
91 * checks/get-them: In gsub, properly escape {.
92 Reported by Gary V. Vaughan.
94 Make bootstrap easier on Solaris.
95 * bootstrap: Add GNULIB_SRCDIR. Useful when a wrapper script
96 gnulib-tool exists earlier on the path to work around /bin/sh
97 failure in parsing $GNULIB_SRCDIR/gnulib-tool.
99 2009-03-13 Eric Blake <ebb9@byu.net>
101 Allow configuration choice in syscmd shell.
102 * ltdl/m4/m4-syscmd.m4: New file.
103 * configure.ac (M4_SYSCMD): Use it to provide
105 (AC_CHECK_HEADERS_ONCE): No longer need to worry about
107 * modules/m4.c (syscmd): Use it to avoid hard-coding the shell
109 * modules/gnu.c (esyscmd): Likewise.
110 * doc/m4.texinfo (Syscmd, Esyscmd): Document this.
111 * README: Document new configure option.
114 Use gnulib pipe module instead of popen(3).
115 * ltdl/m4/gnulib-cache.m4: Import pipe and wait-process modules.
116 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS):
118 (esyscmd): Rewrite with pipe module.
119 Resolves a failure on AIX, reported by Gary V. Vaughan.
121 Use gnulib execute module instead of system(3).
122 * ltdl/m4/gnulib-cache.m4: Import execute module.
123 * m4/utility.c (m4_info_name): New function.
124 * m4/m4module.h (m4_info_name): New prototype.
125 * modules/m4.c (syscmd): Rewrite with execute module.
126 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS, m4_sysval): Move
128 * modules/gnu.c (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS)
130 Resolves a failure on AIX, reported by Gary V. Vaughan.
132 2009-03-05 Eric Blake <ebb9@byu.net>
134 Improve web-manual maintainer rule.
135 * maint.mk (web-manual): Factor package-specific detail...
136 * cfg.mk (manual_title): ...to new variable.
138 2009-02-23 Eric Blake <ebb9@byu.net>
140 Speed up translit when from argument is short.
141 * modules/m4.c (translit): Use memchr2 when possible.
142 * tests/builtins.at (translit): Add tests.
143 * NEWS: Document this.
145 2009-02-18 Eric Blake <ebb9@byu.net>
147 Prefer buffer over byte operations.
148 * modules/format.c (format): Use memchr for speed.
149 * modules/gnu.c (substitute): Likewise.
150 * m4/macro.c (locate_dollar): Inline into only caller...
151 (process_macro): ...and rearrange for readability.
152 * m4/input.c (consume_buffer): Allow C++ compilation.
153 * doc/m4.texinfo (Changesyntax): Enhance test.
155 Speed up esyscmd with buffer reads.
156 * modules/gnu.c (esyscmd): Read blocks directly into obstack,
157 rather than repeatedly reading bytes. Detect read errors.
159 Avoid risk of stack overflow.
160 * m4/output.c (insert_file): Avoid stack allocation of large
163 Synchronize THANKS with branch.
164 * THANKS: Import more names.
166 Improve handling of $ in syntax table.
167 * m4/m4module.h (m4_is_syntax_single_dollar): New function.
168 (M4_SYNTAX_DOLLAR, M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): Change to
169 be context rather than basic syntax categories.
170 (M4_SYNTAX_MASKS): Adjust macro.
171 * m4/m4private.h (struct m4_syntax_table): Add dollar and
172 is_single_dollar members.
173 (m4_is_syntax_single_dollar): Add fast alternative.
174 * m4/syntax.c (m4_syntax_create, reset_syntax_set): Adjust to
175 account for change to context categories.
176 (m4_set_syntax): Manage is_single_dollar.
177 (m4_is_syntax_single_dollar): New function.
178 * m4/macro.c (locate_dollar): New helper function.
179 (process_macro): Use it to speed up macro expansion.
180 * m4/input.c (m4__next_token): Adjust client.
181 * doc/m4.texinfo (Changesyntax): Document this.
183 2009-02-17 Eric Blake <ebb9@byu.net>
185 Sync changecom documentation with branch.
186 * doc/m4.texinfo (Changecom): Tweak wording.
187 * NEWS: Import changes from the branch.
189 Stage 29b: Process quotes and comments by buffer, not bytes.
190 Search for quote and comment delimiters by buffer when possible.
192 Speed impact: noticeable improvement, from fewer function calls.
193 * ltdl/m4/gnulib-cache.m4: Import memchr2 module.
194 * m4/input.c (m4__next_token): Add buffer reads to quote and
196 * NEWS: Document this.
198 2009-02-16 Eric Blake <ebb9@byu.net>
200 Stage 29a: Process dnl and macro names by buffer, not bytes.
201 Enhance input engine to provide lookahead buffer, rather than
202 forcing clients to call next_char for every byte. Utilize this
203 for the simplest clients.
205 Speed impact: noticeable improvement, from fewer function calls.
206 * ltdl/m4/gnulib-cache.m4: Import freadptr and freadseek modules.
207 * m4/input.c (struct input_funcs): Add virtual functions
208 buffer_func and consume_func.
209 (file_buffer, file_consume, string_buffer, string_consume)
210 (composite_buffer, composite_consume, eof_buffer): Implement
212 (file_funcs, string_funcs, composite_funcs, eof_funcs): Update
214 (buffer_retry): New sentinel.
215 (next_buffer, consume_buffer): New functions.
216 (m4_skip_line, match_input, consume_syntax): Use them for faster
218 Suggested by Bruno Haible.
220 Unify single and multi-character delimiter handling.
221 * m4/input.c (MATCH): Add a parameter.
222 (m4__next_token): Simplify logic and reduce redundancy.
223 (m4__next_token_is_open): Adjust caller.
224 * m4/syntax.c (m4_set_comment, m4_set_quotes): Handle delimiters
225 of differing lengths.
226 (m4_set_syntax): Recognize restoration of single delimiters.
228 Revamp changesyntax vs. changequote interactions.
229 * m4/m4module.h (M4_SYNTAX_VALUE): Delete unused macro.
230 (M4_SYNTAX_SUSPECT): New macro.
231 * m4/m4private.h (struct m4_syntax_table): Add suspect field.
232 * m4/syntax.c (check_is_single_quotes, check_is_single_comments)
233 (check_is_macro_escaped): Delete, by inlining body...
234 (m4_set_syntax): ...into here. Improves handling between
235 changesyntax and changequote/changecom.
236 (add_syntax_set, subtract_syntax_set, set_syntax_set): Simplify,
237 and let suspect field track needed cleanup.
238 (m4_set_quotes, m4_set_comment): Adjust meaning of
239 is_single_quotes and is_single_comment flags to always be true if
240 only one delimiter exists, regardless of its length. Ensure that
241 the syntax categories M4_SYNTAX_LQUOTE and M4_SYNTAX_BCOMM are
242 only used on 1-byte delimiters.
243 (add_syntax_attribute, remove_syntax_attribute): Change signature
244 to allow the use of fewer casts. Adjust the suspect field when
246 (m4_reset_syntax, set_quote_age): Adjust callers.
247 * m4/input.c (m4__next_token, m4__next_token_is_open): Simplify
249 * doc/m4.texinfo (Changesyntax): Update documentation and tests.
251 Improve changesyntax documentation.
252 * doc/m4.texinfo (Changesyntax): Merge two tables into one
255 Fix regression in multicharacter quotes, from 2008-01-26.
256 * m4/input.c (m4__next_token): Fix typo.
257 * tests/builtins.at (changequote): Enhance test.
259 2009-02-13 Eric Blake <ebb9@byu.net>
261 Speed up parsing when detecting input file change.
262 * m4/input.c (next_char): Clear input_change flag. Bug introduced
265 2009-02-12 Eric Blake <ebb9@byu.net>
267 Avoid quadratic code when walking definition stack.
268 * examples/stack_sep.m4: Use linear, not quadratic
270 * doc/m4.texinfo (Improved copy): Fix documentation, based on
271 recent autoconf bug fix.
272 * tests/others.at (recursion): Enhance test.
274 2009-02-11 Eric Blake <ebb9@byu.net>
276 Stage 28c: Warn on embedded NUL in remaining cases.
277 Ensure all remaining warnings can handle embedded NUL.
279 Speed impact: none noticed.
280 * m4/m4module.h (m4_debug_decode, m4_parse_truth_arg): Add
282 * m4/macro.c (m4_macro_call): Improve diagnostic.
283 * modules/m4.c (defn): Likewise.
284 * m4/debug.c (m4_debug_decode): Handle embedded NUL.
285 * m4/utility.c (m4_parse_truth_arg): Likewise.
286 * modules/format.c (arg_int, arg_long, arg_double): Likewise.
287 (arg_string): New function.
288 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Update callers.
289 * src/main.c (main): Likewise.
290 * src/freeze.c (reload_frozen_state): Likewise.
291 * modules/gnu.c (debugmode, syncoutput): Likewise.
292 * tests/options.at (--regexp-syntax): Adjust test.
293 * tests/freeze.at (reloading nul): Likewise.
294 * tests/null.m4: Likewise.
295 * tests/null.out: Likewise.
296 * tests/null.err: Likewise.
298 Stage 28b: Warn on embedded NUL in file arguments.
299 Quote warning messages related to file and other NUL-terminated
302 Speed impact: none noticed.
303 * m4/path.c (m4_path_search): Quote file names in message.
304 * modules/m4.c (syscmd, include, m4_make_temp): Handle embedded
306 * modules/gnu.c (debugfile, esyscmd): Likewise.
307 * tests/others.at (nul character): Adjust test.
308 * tests/builtins.at (mkdtemp, mkstemp): Likewise.
309 * tests/null.m4: Likewise.
310 * tests/null.out: Likewise.
311 * tests/null.err: Likewise.
313 Stage 28a: Warn on embedded NUL in numeric arguments.
314 Quote warning messages related to numeric parsing in order to
317 Speed impact: none noticed.
318 * m4/m4module.h (m4_numeric_arg): Adjust prototype.
319 * m4/utility.c (m4_numeric_arg): Add parameter.
320 * modules/gnu.c (debuglen): Adjust callers.
321 * modules/m4.c (incr, decr, divert, undivert, m4exit, substr)
323 * modules/evalparse.c (m4_evaluate): Likewise.
324 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
325 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
327 * doc/m4.texinfo (Changesyntax): Fix typo.
328 * tests/others.at (nul character): Adjust test.
329 * tests/null.m4: Likewise.
330 * tests/null.out: Likewise.
331 * tests/null.err: Likewise.
333 2009-02-11 Eric Blake <ebb9@byu.net>
335 Avoid regression in popdef(undef).
336 * doc/m4.texinfo (Trace): Enhance test, to cover regression
337 recently fixed on the branch.
339 2009-02-09 Eric Blake <ebb9@byu.net>
341 Enhance index to support starting offset.
342 * modules/m4.c (index): Add optional third argument.
343 * NEWS: Document this.
344 * doc/m4.texinfo (Index macro): Likewise.
345 (Macro Arguments): Adjust tests.
347 2009-01-24 Eric Blake <ebb9@byu.net>
349 Add URLs to --help output.
350 * src/main.c (usage): Use enhanced version-etc features.
352 2009-01-07 Eric Blake <ebb9@byu.net>
354 Enhance substr to support replacement text.
355 * doc/m4.texinfo (Substr): Document new semantics.
356 * modules/m4.c (substr): Support optional fourth argument.
357 * NEWS: Document this.
359 Enhance substr to support negative values.
360 * doc/m4.texinfo (Substr): Document new semantics, and how to
362 * modules/m4.c (substr): Support negative values.
363 * NEWS: Document this.
365 2009-01-05 Eric Blake <ebb9@byu.net>
368 * HACKING: Remove mention of xdelta.
369 * Makefile.am (EXTRA_DIST, MAINTAINERCLEANFILES): Let gnulib take
370 care of distributing gendocs.sh.
371 * maint.mk (web-manual): Use new feature of gendocs.
372 * ltdl/m4/gnulib-cache.m4: Regenerate.
374 2008-12-24 Eric Blake <ebb9@byu.net>
376 Relax eval as allowed by POSIX 2008.
377 * modules/evalparse.c (m4_evaluate): Warn, not error, on invalid
378 operator. Quote expression in warning.
379 * modules/mpeval.c (includes): Add quotearg.h.
380 * doc/m4.texinfo (Eval, Improved forloop): Update tests.
381 * NEWS: Update to reflect 1.6 support for `?:'.
383 2008-12-23 Eric Blake <ebb9@byu.net>
385 Add debugmode(o) to control dumpdef output location.
386 * m4/m4module.h (M4_DEBUG_TRACE_OUTPUT_DUMPDEF): New enumerator.
387 (M4_DEBUG_TRACE_VERBOSE): Update.
388 * m4/debug.c (m4_debug_decode): Support new debug option.
389 * src/freeze.c (produce_debugmode_state): Likewise.
390 * modules/m4.c (dumpdef): When set, force dumpdef to stderr rather
392 * src/main.c (usage): Document it.
393 * doc/m4.texinfo (Debugmode, Dumpdef, Debugging options)
394 (Debugfile): Likewise.
396 Based on an autoconf bug report by Paolo Bonzini.
398 Make --debugfile argument optional.
399 * src/main.c (long_options): Make the argument optional, to allow
400 setting debug file back to stderr.
401 (main): Make --debugfile order-dependent.
402 (usage): Document this.
403 * doc/m4.texinfo (Debugging options): Likewise.
405 * tests/options.at (--debugfile): Enhance test.
406 (--safer): Adjust to new semantics.
408 2008-12-22 Eric Blake <ebb9@byu.net>
411 * doc/m4.texinfo (Operation modes, Preprocessor features)
412 (Limits control, Frozen state, Debugging options)
413 (Dynamic loading features): Use lower case names in @var.
414 (Improved copy): Use @code, not @var, as appropriate.
416 2008-12-18 Eric Blake <ebb9@byu.net>
418 Deal with M4 1.4.x limitation on builtin tokens.
419 * doc/m4.texinfo (Composition): Mention limitation on curry.
420 (Improved copy): New node.
422 * examples/stack.m4: Likewise.
423 * examples/stack_sep.m4: New file.
424 * Makefile.am (dist_pkgdata_DATA): Distribute it.
426 2008-12-15 Eric Blake <ebb9@byu.net>
428 Double size of temp file cache.
429 * m4/output.c (tmp_file, tmp_file_owner): Split...
430 (tmp_file1, tmp_file2, tmp_file1_owner, tmp_file2_owner): ...into
432 (tmp_file2_recent): New variable.
433 (m4_tmpopen, m4_tmpclose, m4_tmpremove, m4_tmprename)
434 (m4_output_exit): Adjust callers.
436 Use fewer seeks on cached files.
437 * m4/output.c (m4_tmpfile): Use write, not append mode.
438 (m4_tmpopen): Add parameter to decide when to skip seeks.
439 (m4_tmprename, m4_make_diversion, insert_diversion_helper)
440 (m4_freeze_diversions): Adjust callers.
442 Cache most recently spilled diversion.
443 * m4/output.c (tmp_file, tmp_file_owner): New variables, for
444 1-deep cache of spilled diversions.
445 (m4_tmpfile): Open in append mode, since we might revisit
446 diversion without closing it now.
447 (m4_tmpopen): Check cache first.
448 (m4_tmpclose): Update cache, rather than closing. Add parameter.
449 (m4_tmpremove): Close cache before removing.
450 (m4_tmprename): Deal with open files when renaming.
451 (m4_output_exit): Close cache before exiting.
452 (make_room_for, m4_make_diversion, insert_diversion_helper):
454 * ltdl/m4/m4-rename.m4 (M4_RENAME): New file.
455 * configure.ac (M4_RENAME): Invoke it.
457 Correctly track size of in-memory diversions.
458 * m4/output.c (insert_diversion_helper): Correctly track total
459 in-memory diversion size after undivert.
461 Avoid quadratic behavior for some cases of divert/undivert.
462 * m4/output.c (struct m4_diversion): Improve comments.
463 (m4_tmpname, m4_make_diversion): Strengthen preconditions.
464 (m4_tmprename): New function.
465 (m4_output_init, m4_output_exit): Move after internal functions.
466 (make_room_for): Don't bother copying uninitialized bytes.
467 (insert_diversion_helper): Transfer metadata, rather than copying
468 contents, when undiverting into a previously unused diversion.
469 * tests/builtins.at (divert): Add a check to the test.
470 * doc/m4.texinfo (Undivert): Enhance test.
471 * NEWS: Document the speedup.
473 2008-12-02 Eric Blake <ebb9@byu.net>
475 Stage 27: Allow embedded NUL in text processing macros.
476 Pass NUL through regular expressions, format, and translit, and
477 diagnose it in eval and changeresyntax. Improve warning
478 capabilities of format.
480 Speed impact: none noticed.
481 * modules/m4.c (m4_expand_ranges): Don't append extra bytes.
482 (translit): Manage NUL bytes.
483 * modules/format.c (format): Likewise.
484 * modules/gnu.c (substitute, regexp_substitute): Likewise.
485 (m4_resyntax_encode_safe): Add parameter.
486 (regexp, patsubst, renamesyms): Update callers.
487 (regexp_compile): Adjust error message.
488 * modules/evalparse.c (m4_evaluate): Use consistent message.
489 (end_text): New variable.
490 (eval_init_lex): Add parameter.
491 (eval_lex): Detect embedded NUL.
492 * src/freeze.c (reload_frozen_state): Likewise.
493 * doc/m4.texinfo (Format): Update to cover new behavior.
494 (Eval): Mention that result is unquoted.
495 * tests/freeze.at (reloading nul): Enhance test.
496 * tests/null.m4: Likewise.
497 * tests/null.err: Update expected output.
498 * tests/null.out: Likewise.
499 * tests/options.at (--regexp-syntax): Likewise.
501 2008-11-28 Eric Blake <ebb9@byu.net>
503 Resync NEWS with branches.
504 * NEWS: Mention 1.4.12, update state of 1.6.
506 2008-11-26 Eric Blake <ebb9@byu.net>
508 Keep COPYING in repository.
509 * Makefile.am (MAINTAINERCLEANFILES): Don't remove COPYING.
510 * .cvsignore: Don't ignore it.
511 * .gitignore: Likewise.
512 * COPYING: Store in repository, per automake 1.10.2
515 2008-11-26 Eric Blake <ebb9@byu.net>
517 Document optimized forloop.
518 * doc/m4.texinfo (Improved forloop): Mention alternate style that
519 avoids define overhead.
520 * examples/forloop3.m4: New file.
521 * Makefile.am (dist_pkgdata_DATA): Distribute it.
523 Document copy composite using stack_foreach and curry.
524 * doc/m4.texinfo (Stacks): New node, to document pushdef stack
526 (Ifelse): Move define_blind...
527 (Composition): ...to this new node. Document currying, then use
528 it to implement copy and rename.
529 * examples/curry.m4: New file.
530 * examples/stack.m4: Likewise.
531 * Makefile.am (dist_pkgdata_DATA): Distribute them.
533 2008-11-04 Eric Blake <ebb9@byu.net>
536 * ltdl/m4/gnulib-cache.m4: Replace fdl module with fdl-1.3.
537 * Makefile.am (doc_m4_TEXINFOS, MAINTAINERCLEANFILES): Reflect
539 * doc/m4.texinfo (GNU Free Documentation License): Likewise.
541 2008-10-22 Eric Blake <ebb9@byu.net>
543 Give nicer error if user modifies testsuite but lacks autoconf.
544 * Makefile.am (AUTOM4TE): Use missing in the definition.
546 2008-10-09 Eric Blake <ebb9@byu.net>
548 Allow user to choose which sed to use in testsuite.
549 * tests/atlocal.in (SED): Inherit from configure results.
550 * tests/builtins.at (__m4_@&t@version__, divert, esyscmd)
551 (mkstemp, syscmd): Use $SED.
552 * tests/generate.awk (new_test): Likewise.
553 * tests/options.at (deprecated options, unknown option)
554 (--debugmode, --help and --version): Likewise.
555 * tests/testsuite.at (AT_CHECK_M4): Likewise.
556 * tests/others.at (directory, stderr closed, stdin seekable)
557 (stdout closed): Likewise.
558 (nul character): Likewise. Also, skip test if sed can't handle
561 Clean up testsuite invocation.
562 * tests/atlocal.in: Fix copyright notice.
563 * Makefile.am (TESTS_ENVIRONMENT): Delete; it wasn't being used.
564 (check-local, installcheck-local): Adjust clients. Add missing
567 2008-09-25 Eric Blake <ebb9@byu.net>
569 Tweak error message on command line failure.
570 * m4/m4private.h (includes): Use "quotearg.h".
571 * src/main.c (process_file, main): Use nicer quotes for file name
573 * m4/input.c (file_clean, m4_push_file): Likewise.
574 * m4/module.c (m4__module_open): Likewise.
575 * src/freeze.c (produce_frozen_state, reload_frozen_state):
577 * modules/gnu.c (debugfile): Likewise.
578 * modules/m4.c (undivert, include): Likewise.
579 * tests/others.at (directory, stdin closed): Update tests.
580 * tests/options.at (file names, --debugmode): Likewise.
581 * doc/m4.texinfo (Debugmode): Likewise.
583 Unify error handling for reading directories.
584 * m4/path.c (m4_path_search): Factor open attempts...
585 (m4_fopen): ...into new function, to reject directories.
586 * tests/others.at (directory): Enhance test.
587 * doc/m4.texinfo (Include): Document that directories cannot be
590 Avoid bugs on platforms that mishandle trailing /.
591 * ltdl/m4/gnulib-cache.m4: Import fopen module.
592 * tests/others.at (directory): New test.
594 2008-09-16 Eric Blake <ebb9@byu.net>
596 Fix bootstrap for Solaris /bin/sh.
597 * bootstrap: Avoid shell quoting pitfall.
599 2008-09-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
601 Typos in source code comments.
602 * modules/m4.c: Fix typos in comments.
603 * m4/input.c: Likewise.
604 * src/main.c: Likewise.
606 2008-08-29 Eric Blake <ebb9@byu.net>
608 Fix manual date information.
609 * doc/m4.texinfo: UPDATED refers to the day the manual was built,
610 not the release date of M4.
611 Based on a bison patch by Akim Demaille.
613 2008-08-27 Eric Blake <ebb9@byu.net>
616 * doc/m4.texinfo (Invoking m4): Fix example, since order of -d
620 2008-08-23 Eric Blake <ebb9@byu.net>
622 Allow debugmode control over whether defn(undef) warns.
623 * ltdl/m4/gnulib-cache.m4: Import verify module.
624 * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL):
626 (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust.
627 * m4/m4.c (m4_create): Start with debugmode = d.
628 * src/main.c (usage): Mention this.
629 (main): Let -E impact debug mode.
630 * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning
632 * modules/gnu.c (builtin, inder): Likewise.
633 * m4/debug.c (m4_debug_decode): Parse new mode.
634 * src/freeze.c (produce_debugmode_state): Accomodate new mode.
635 * doc/m4.texinfo (Debugging options): Mention change in the
637 (Debugmode): Mention new flag d.
638 (Operation modes): Mention interaction with -E.
639 (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and
641 * tests/options.at (--debugmode): Update tests.
642 * tests/freeze.at (reloading debugmode): Likewise.
643 * NEWS: Document this.
644 Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be
645 incompatible with Autoconf 2.62.
647 2008-08-22 Eric Blake <ebb9@byu.net>
649 Improve --debugmode behavior.
650 * m4/m4module.h (m4_debug_decode): Simplify interface.
651 * m4/debug.c (m4_debug_decode): Remove parameter, and handle
652 setting the new value.
653 * modules/gnu.c (debugmode): Adjust caller.
654 * src/freeze.c (reload_frozen_state): Likewise.
655 * src/main.c (main): Likewise.
656 (usage): Fix default for --debug.
657 * doc/m4.texinfo (Debugging options): Add an example.
659 2008-08-21 Eric Blake <ebb9@byu.net>
661 Avoid regression in defn(undef).
662 * doc/m4.texinfo (Trace): Enhance test, to cover regression
663 recently fixed on the branch.
665 2008-08-18 Eric Blake <ebb9@byu.net>
667 Remove deprecated -N option; fixes a regression from 2006-09-14.
668 * src/main.c (DIVERSIONS_OPTION): Delete.
669 (long_options, OPTSTRING, main): Remove -N/--diversions option.
670 * doc/m4.texinfo (Limits control): Remove it from the manual.
671 * NEWS: Mention that it is gone.
672 * tests/options.at (deprecated options): Update test.
674 Improve 'git diff' of manual source.
675 * .gitattributes (*.texi*): Add diff attribute.
676 * bootstrap: Tell git how to use it.
677 Inspired by Jim Meyering's similar patch for coreutils.
679 2008-08-07 Bruno Haible <bruno@clisp.org> (tiny change)
681 Run m4 tests prior to gnulib unit tests.
682 * Makefile.am (SUBDIRS): Swap order of directories.
684 2008-08-03 Eric Blake <ebb9@byu.net>
686 Stage 26: Allow embedded NUL in macro definitions.
687 Clean up final few locations that did not track macro definitions
688 by length, to allow embedded NUL. Make m4_arg_len callers aware
689 of issue of flattening builtins when determining length.
691 Speed impact: none noticed.
692 * m4/m4module.h (m4_arg_len): Add parameter.
693 (M4ARGLEN): Provide default for the parameter.
694 * m4/m4private.h (includes): Share xmemdup0.h among all libm4
696 * m4/macro.c (m4_arg_len): Fail if builtins are not flattened.
697 * m4/syntax.c (includes): Rely on m4private.h for xmemdup0.
698 * m4/symtab.c (includes): Likewise.
699 (m4_symbol_value_copy): Use xmemdup0.
700 * m4/module.c (install_macro_table): Likewise.
701 * src/freeze.c (reload_frozen_state): Likewise.
702 * tests/freeze.at (reloading nul): Enhance test.
703 * tests/null.m4: Likewise.
704 * tests/null.err: Update expected output.
705 * tests/null.out: Likewise.
707 Fix regression in commenting unbalanced quotes, from 2008-02-16.
708 * m4/m4private.h (m4__token_type): Add M4_TOKEN_COMMENT.
709 * m4/input.c (m4__next_token, m4_print_token): Supply new token
711 * m4/macro.c (expand_token): Penalize comments, as they can
712 contain unbalanced quotes; latent bug since 2007-12-07, exposed by
713 passing $@ references built from comments.
714 (expand_argument): Adjust caller.
715 * tests/others.at (Comments): Enhance test to catch it.
716 * NEWS: Mention the fix.
718 2008-07-30 Eric Blake <ebb9@byu.net>
720 Fix regression in trace output, introduced 2008-05-08.
721 * m4/input.c (m4__push_symbol): When cloning chains, break pointer
722 back to original chain; latent bug from 2008-02-02 that did not
723 cause misbehavior until trace output read unfinished chain.
724 * tests/builtins.at (debug): Add test for this.
726 2008-07-28 Eric Blake <ebb9@byu.net>
728 Optimize iteration examples.
729 * examples/forloop2.m4: Avoid excess indir, by passing current
730 counter value as parameter.
731 * examples/foreachq3.m4: Avoid unneeded ifelse, by injecting an
733 * doc/m4.texinfo (Improved forloop, Improved foreach): Update the
734 documentation to match.
736 2008-07-26 Eric Blake <ebb9@byu.net>
738 Give example for O(n) foreach on m4 1.4.x.
739 * examples/foreachq4.m4: New file.
740 * Makefile.am (dist_pkgdata_DATA): Distribute it.
741 * tests/others.at (recursion): Test it.
742 * doc/m4.texinfo (Improved foreach): Document linear foreach with
743 m4 1.4.5 and greater.
745 2008-07-19 Eric Blake <ebb9@byu.net>
747 Resynchronize docs from branch.
748 * doc/m4.texinfo (Undefine, Pushdef): Mention warning on undefined
749 name, particularly since the old documentation didn't match code.
750 (Standard Modules): Add caveat about using __m4_version__.
752 2008-07-11 Eric Blake <ebb9@byu.net>
754 Bump required automake to 1.10a; regression introduced 2008-01-22.
755 * configure.ac (AM_INIT_AUTOMAKE): Undo requirement downgrade to
756 1.10.1, since we also rely on pkglibexecdir.
757 * HACKING: Fix minimum requirement.
758 * bootstrap: Likewise.
760 Reported by Joel E. Denny.
762 Avoid bogus whitespace in @ovar, @dvar.
763 * doc/m4.texinfo (ovar, dvar): Add @c.
764 Based on patch by Ralf Wildenhues to Autoconf manual.
766 2008-06-23 Eric Blake <ebb9@byu.net>
768 Adjust to new gnulib-tool layout.
769 * ltdl/m4/gnulib-cache.m4: Reformat.
771 Fix bootstrap comment.
772 * bootstrap: DOWNLOAD_PO was previously removed.
774 2008-06-19 Eric Blake <ebb9@byu.net>
776 Revert speed regression from 2008-06-16.
777 * m4/output.c (m4_shipout_int): Avoid obstack_printf in hot path.
778 * modules/m4.c (numb_obstack): Likewise.
779 * m4/input.c (MATCH): Use fewer conditionals, and factor
781 (match_input): ...here for smaller code size.
782 * m4/syntax.c (m4_reset_syntax, m4_set_quotes, m4_set_comment):
783 Supply trailing NUL to delimiters, to meet contract of faster
786 2008-06-18 Eric Blake <ebb9@byu.net>
789 * m4/m4module.h: Use consistent spacing for pointer parameters.
790 * m4/m4private.h: Likewise.
792 Stage 25b: Handle embedded NUL in changesyntax and friends.
793 Track quote and comment delimiters by length, to allow embedded
794 NUL. Improve changesyntax to support assigning syntax to NUL.
796 Speed impact: none noticed.
797 * m4/m4module.h (m4_set_quotes, m4_set_comment, m4_set_syntax):
799 (m4_reset_syntax): New prototype.
800 * m4/syntax.c (add_syntax_set, subtract_syntax_set)
801 (set_syntax_set, m4_set_quotes, m4_set_comment): Add parameter, to
803 (m4_set_syntax): Likewise. Also, split code to reset the table...
804 (m4_reset_syntax): ...into a new function.
805 (m4_syntax_create): Adjust callers.
806 * m4/input.c (match_input, MATCH): Add parameter.
807 (m4__next_token, m4__next_token_is_open): Adjust callers.
808 * modules/m4.h (m4_expand_ranges_func): Add parameter.
809 * modules/m4.c (dumpdef): Handle NUL in dumped quotes.
810 (changequote, changecom, translit, m4_expand_ranges): Track
812 * modules/gnu.c (changesyntax): Handle embedded NUL.
813 * src/freeze.c (reload_frozen_state): Adjust callers.
814 * tests/freeze.at (reloading nul): Enhance test.
815 * tests/null.m4: Likewise.
816 * tests/null.out: Update expected output.
817 * tests/null.err: Likewise.
819 2008-06-16 Eric Blake <ebb9@byu.net>
821 Stage 25a: Use obstack_printf for easier output.
822 Convert macro tracing and other locations to use obstack_printf
823 rather than hand-rolled equivalents. Ensure that embedded NUL in
824 trace output does not truncate the trace string.
826 Speed impact: noticeable penalty, from obstack_printf overhead.
827 * ltdl/m4/gnulib-cache.m4: Import obstack-printf-posix module.
828 * m4/macro.c (trace_format): Delete; use obstack_printf instead.
829 (trace_header, trace_pre, trace_post): All callers updated.
830 * m4/output.c (m4_shipout_int, m4_tmpname): Use obstack_printf.
831 (m4_divert_text): Speed up syncline output.
832 * modules/m4.c (dumpdef): Handle embedded NUL.
833 (numb_obstack): Speed up eval output.
834 (maketemp): Use obstack_printf.
835 * modules/format.c (format): Likewise.
837 Add missing const qualifications.
838 * m4/resyntax.c (m4_resyntax_map): Declare array elements as
840 * modules/gnu.c (m4_builtin_table, m4_macro_table): Likewise.
841 * modules/import.c (m4_builtin_table): Likewise.
842 * modules/load.c (m4_builtin_table, m4_macro_table): Likewise.
843 * modules/m4.c (m4_builtin_table): Likewise.
844 * modules/modtest.c (m4_builtin_table, m4_macro_table): Likewise.
845 * modules/mpeval.c (m4_builtin_table, m4_macro_table): Likewise.
846 * modules/perl.c (m4_builtin_table, m4_macro_table): Likewise.
847 * modules/shadow.c (m4_builtin_table, m4_macro_table): Likewise.
848 * modules/stdlib.c (m4_builtin_table): Likewise.
849 * modules/time.c (m4_builtin_table): Likewise.
850 * modules/traditional.c (m4_macro_table): Likewise.
852 2008-06-10 Eric Blake <ebb9@byu.net>
854 Avoid corrupted frozen file if NUL appears on block boundary.
855 * m4/output.c (insert_file): Separate consecutive quotearg blocks
856 with \<newline>, in case last byte of first block was NUL.
858 2008-06-03 Eric Blake <ebb9@byu.net>
860 Fix printf type mismatches.
861 * m4/m4module.h (m4_bad_argc): Alter parameter type.
862 * m4/m4private.h (struct m4_call_info): Alter call_id type.
863 * m4/macro.c (expand_macro, m4__adjust_refcount): Use correct
865 * m4/utility.c (m4_bad_argc): Likewise.
867 Borrow bootstrap ideas from gnulib.
868 * bootstrap (options, DOWNLOAD_PO): Remove --download-po; the
869 advertized subset of languages didn't work. Use --skip-po
870 instead, for consistency with gnulib bootstrap.
871 (func_get_translations): Use rsync, not wget.
872 (func_update_po): Use a reference directory, to avoid changing
873 timestamps on unchanged .po files.
874 * TODO: Update accordingly.
876 Fix fallout from previous patch.
877 * doc/m4.texinfo (Builtin): Adjust expected output.
879 2008-06-02 Eric Blake <ebb9@byu.net>
881 Stage 24c: Improve display of macro names with embedded NUL.
882 Quote instances of problematic characters in macro names when
883 presented to user. Track location via call_info rather than
884 munging context for every expansion.
886 Speed impact: slight penalty, due to more bookkeeping.
887 * m4/m4module.h (m4_push_string_init): Add parameters.
888 * m4/m4private.h (struct m4_macro_args): Remove argv0 and
889 argv0_len, now redundant with info.
890 (m4__push_wrapup_init): Add parameter.
891 * m4/input.c (m4_push_string_init, m4__push_wrapup_init): Track
892 location from caller, rather than context.
893 (composite_peek, composite_read, match_input): Adjust callers.
894 * m4/utility.c (m4_symbol_value_lookup): Quote macro name.
895 (m4_verror_at_line): Allow NUL in macro name.
896 * m4/macro.c (trace_flush, m4_trace_prepare, trace_pre): Allow NUL
898 (expand_macro): No longer munge context location.
899 (collect_arguments, m4_arg_text, m4_arg_empty, m4_arg_len)
900 (m4_make_argv_ref, m4_push_arg, m4_wrap_args): Adjust callers.
901 * modules/gnu.c (builtin, indir): Likewise.
902 * tests/null.m4: Enhance test.
903 * tests/null.err: Adjust expected output.
904 * tests/null.out: Likewise.
906 Stage 24b: Allow embedded NUL in macro names.
907 Use length rather than NUL-termination when tracking macro names.
908 All APIs dealing with symbol table changed.
910 Speed impact: slight penalty, due to more bookkeeping.
911 * m4/m4module.h (m4_symtab_apply_func, m4_symbol_lookup)
912 (m4_symbol_pushdef, m4_symbol_define, m4_symbol_popdef)
913 (m4_symbol_rename, m4_symbol_delete): Add length parameter.
914 (m4_string): New type.
915 * ltdl/m4/gnulib-cache.m4: Import xmemdup0 module.
916 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): Account for
918 * m4/symtab.c (m4_symtab_delete, m4_symtab_apply, symtab_fetch)
919 (m4__symtab_remove_module_references, symbol_destroy_CB)
920 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_define)
921 (m4_symbol_popdef, m4_symbol_rename, m4_set_symbol_name_traced)
922 (m4_symbol_delete): Likewise.
923 * modules/m4.h (struct m4_dump_symbol_data): Adjust type to allow
925 * m4/macro.c (expand_token): Adjust all callers.
926 * m4/module.c (install_builtin_table, install_macro_table):
928 * m4/utility.c (m4_symbol_value_lookup): Likewise.
929 * modules/gnu.c (indir, renamesyms, m4symbols): Likewise.
930 * modules/m4.c (define, undefine, pushdef, popdef)
931 (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols, dumpdef)
932 (traceon, traceoff): Likewise.
933 * src/main.c (main): Likewise.
934 * src/freeze.c (dump_symbol_CB, reload_frozen_state): Likewise.
935 * tests/freeze.at (reloading nul): Augment test.
936 * tests/null.out: Adjust expected output.
938 Stage 24a: Use full call context in error reporting.
939 Replace const char *macro_name with const m4_call_info *call, so
940 that the next patch can pass the length of macro_name with
941 embedded NUL. Simplifies handling of global state.
943 Speed impact: none noticed.
944 * m4/m4module.h (m4_error, m4_warn): Change parameter type.
945 (m4_error_at_line, m4_warn_at_line): Delete.
946 (m4_debug_set_output, m4_skip_line, m4_bad_argc, m4_numeric_arg)
947 (m4_parse_truth_arg, m4_symbol_value_lookup): Adjust all clients.
948 * m4/m4private.h (m4__next_token): Likewise.
949 * m4/utility.c (m4_verror_at_line): Alter parameter, and use
950 caller's location if caller is provided.
951 (m4_error, m4_warn): Change parameter type.
952 (m4_error_at_line, m4_warn_at_line): Delete.
953 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg)
954 (m4_symbol_value_lookup): Adjust all callers.
955 * m4/debug.c (set_debug_file, m4_debug_set_output): Likewise.
956 * m4/input.c (m4_skip_line, m4__next_token): Likewise.
957 * m4/macro.c (expand_argument, collect_arguments, m4_macro_call)
958 (process_macro): Likewise.
959 * modules/m4.h (m4_make_temp_func): Likewise.
960 * modules/evalparse.c (m4_evaluate): Likewise.
961 * modules/format.c (arg_int, arg_long, arg_double, format):
963 * modules/gnu.c (builtin, changeresyntax, changesyntax, debugfile)
964 (debuglen, debugmode, esyscmd, indir, mkdtemp, patsubst, regexp)
965 (renamesyms, syncoutput, regexp_compile, substitute)
966 (regexp_substitute, m4_resyntax_encode_safe): Likewise.
967 * modules/m4.c (define, undefine, pushdef, popdef, ifdef, ifelse)
968 (m4_dump_symbols, defn, syscmd, incr, decr, divert, undivert, dnl)
969 (include, maketemp, mkstemp, m4exit, traceon, traceoff, substr):
971 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
972 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
974 * tests/options.at (--syncoutput): Add test for invalid
975 command-line argument. Split xfailed portion...
976 (--syncoutput and diversions): ...into new test.
977 (unknown option): New test.
978 * tests/freeze.at (reloading unknown builtin): Update expected
981 Adjust to recent gnulib change.
982 * configure.ac (AB_INIT): Delete, now that gnulib does this.
984 2008-05-28 Eric Blake <ebb9@byu.net>
986 Improve frozen debugmode behavior.
987 * m4/debug.c (m4_debug_decode): Make empty debugmode additive.
988 * src/main.c (main): Interleave -d with files.
989 * tests/options.at (--debugmode): Update test.
990 * tests/freeze.at (reloading debugmode): New test.
991 * doc/m4.texinfo (Debugging options, Debugmode): Document the
995 2008-05-27 Eric Blake <ebb9@byu.net>
997 Fix some testsuite failures on Solaris 8.
998 * tests/builtins.at (esyscmd, syscmd): Skip tests if system(2) is
1000 * tests/others.at (stderr closed): Likewise. Also support Solaris
1002 (stdin closed): Skip test if closed stdin gets reopened.
1003 (stdout closed): Support Solaris wording for EBADF.
1004 * tests/testsuite.at (AT_CHECK_M4): Likewise.
1006 Fix configure message nesting, broken since 2001-09-20.
1007 * ltdl/m4/gmp.m4 (M4_LIB_GMP): Don't cache result; the test is
1008 not expensive, and AC_MSG_WARN doesn't work in AC_CACHE_CHECK.
1010 Support 'make dist' with BSD make.
1011 * Makefile.am (TESTSUITE_AT, MAINTAINERCLEANFILES): Qualify uses
1012 of the generated file tests/generated.at.
1013 (EXTRA_DIST, $(TESTSUITE)): Likewise for tests/package.m4.
1014 * tests/others.at (stdout closed): Accomodate OpenBSD /bin/sh.
1016 2008-05-24 Eric Blake <ebb9@byu.net>
1018 Test NUL in frozen files.
1019 * tests/testsuite.at (AT_CHECK_M4): Add parameter.
1020 * tests/freeze.at (reloading nul): New test.
1021 (AT_TEST_FREEZE): Inhibit -d when reloading frozen file.
1022 (reloading unknown builtin): Likewise.
1024 2008-05-23 Eric Blake <ebb9@byu.net>
1026 Improve handling of frozen file errors.
1027 * src/freeze.c (produce_frozen_state): Detect write failures.
1028 (reload_frozen_state): Use close_stream.
1029 * tests/freeze.at (freezing failure): New test.
1031 Reported by Jean-Charles Longuet.
1033 2008-05-19 Eric Blake <ebb9@byu.net>
1035 In frozen file, split consecutive strings with newline.
1036 * src/freeze.c (dump_symbol_CB): Add newline to 'T', 'F'.
1037 (produce_frozen_state): Likewise for 'Q', 'C'.
1038 (reload_frozen_state): Parse the new layout.
1039 [GET_DIRECTIVE]: Fix format 1 regression from 2008-05-13.
1040 * tests/freeze.at (loading format 2): Rewrite to new format.
1041 (reloading unknown builtin): Likewise.
1042 (loading format 1): Make sure backslash-newline is not
1044 * doc/m4.texinfo (Frozen file format 2): Document the format.
1045 * NEWS: Document this change.
1047 Fix xgettext options.
1048 * po/Makevars (XGETTEXT_OPTIONS): The " must be passed to
1051 Fix spelling of René Seindal's name in --version output.
1052 * ltdl/m4/gnulib-cache.m4: Import propername module.
1053 * src/main.c (AUTHORS): Rewrite in terms of proper_name.
1054 * po/Makevars (XGETTEXT_OPTIONS): Detect new functions.
1055 * HACKING: Mention new prerequisite of gperf.
1057 2008-05-18 Eric Blake <ebb9@byu.net>
1059 Allow freezing the trace status of macros.
1060 * src/freeze.c (produce_symbol_dump): Let undefined traced macros
1062 (dump_symbol_CB): Also freeze trace state.
1063 * tests/freeze.at (reloading traced macros): New test.
1064 * doc/m4.texinfo (Using frozen files): Update documentation to
1066 (Frozen file format 1): Improve synchronization with branch.
1067 (Frozen file format 2): Reorder directives, and add `d', `t'.
1068 * NEWS: Document this change.
1070 2008-05-15 Eric Blake <ebb9@byu.net>
1072 Fix frozen file regression in pushdef stacks from 2001-09-01.
1073 * src/freeze.c (dump_symbol_CB): Push all values on the stack, not
1074 just the current definition.
1075 (reverse_symbol_value_stack): New helper method.
1076 * tests/freeze.at (AT_TEST_FREEZE): New helper macro.
1077 (reloading pushdef stack): New test.
1078 (reloading unknown builtin): Enhance test.
1080 2008-05-13 Eric Blake <ebb9@byu.net>
1082 Fix frozen file regression in diversions from 2007-01-21.
1083 * m4/output.c (insert_diversion_helper): Add parameter.
1084 (m4_insert_file): Move contents...
1085 (insert_file): ...to this new helper, with added parameter.
1086 (m4_insert_diversion, m4_undivert_all, m4_freeze_diversions):
1088 * src/freeze.c (produce_mem_dump): Simplify.
1089 * tests/freeze.at (large diversion): Test for this.
1091 Improve error message when frozen file is invalid.
1092 * src/freeze.c (decode_char): Add parameter. Allow \<newline>
1094 (reload_frozen_state): Track current line.
1095 * tests/freeze.at (loading format 1, loading format 2): Update to
1098 2008-05-10 Eric Blake <ebb9@byu.net>
1100 Detect integer overflow when loading frozen file.
1101 * src/freeze.c (reload_frozen_state) [GET_NUMBER]: Rewrite to fail
1102 immediately on overflow.
1103 * tests/freeze.at (loading format 2): Test this.
1104 Reported by Jim Meyering.
1106 2008-05-08 Eric Blake <ebb9@byu.net>
1108 Stage 23: allow tracing of indirect macro calls.
1109 Track all trace information as part of the argv struct, rather
1110 than temporarily resetting global state. Teach indir to trace
1111 macros that it invokes.
1112 Memory impact: slight penalty, due to larger argv struct.
1113 Speed impact: none noticed.
1114 * m4/m4module.h (m4_input_block): Remove.
1115 (m4_call_info): New opaque type.
1116 (m4_trace_prepare, m4_arg_info): New prototypes.
1117 (m4_macro_call, m4_push_string_finish, m4_input_print): Change
1119 * m4/m4private.h (struct m4_macro_args): Add info field.
1120 (struct m4_call_info): New structure.
1121 (m4_arg_info): New accessor.
1122 * m4/input.c (m4_input_block): Make typedef local.
1123 (m4_push_string_init): Initialize length.
1124 (m4_push_string_finish, m4_input_print): Change signature, so that
1125 printing can be done before finalization.
1126 (struct input_funcs): Add parameter to print_func.
1127 (file_print, string_print, composite_print): Adjust accordingly.
1128 * m4/macro.c (trace_header, trace_flush, trace_pre, trace_post):
1129 Change signatures for stacked trace messages, and for using call
1131 (trace_prepre): Export and rename...
1132 (m4_trace_prepare): ...to this, for use by indir. Alter signature
1133 to use call context.
1134 (collect_arguments): Alter signature, to manage new field.
1135 (expand_macro): Change call context management. Move tracing...
1136 (m4_macro_call): ...here. Remove redundant parameter.
1137 (m4_arg_argc): New function.
1138 (m4_make_argv_ref): Replace unused skip parameter with new trace
1139 parameter; manage new field.
1140 * modules/gnu.c (builtin, indir): Adjust callers.
1141 * src/main.c (usage): Update debugmode flag summary.
1142 * tests/null.m4: Enhance test.
1143 * tests/null.err: Update expected output.
1144 * tests/macros.at (Tracing Hanoi Towers): Likewise.
1145 * doc/m4.texinfo (Trace): Mention more about trace formatting.
1146 (Debugmode): Enhance description of 'c' and 'x'. Enhance test to
1147 cover line numbering details in traces.
1148 (Debuglen): Enhance test to cover indir tracing.
1149 * NEWS: Mention these changes.
1150 Reported by Akim Demaille in the autoconf TODO file in 2000.
1152 2008-05-07 Eric Blake <ebb9@byu.net>
1154 Test for traceon regression just fixed in branch-1.6.
1155 * doc/m4.texinfo (Trace): Enhance test.
1156 * NEWS: Port news item from branch.
1158 2008-05-05 Eric Blake <ebb9@byu.net>
1160 Stage 22: allow builtin token concatenation outside $@.
1161 Adjust the input and argument parsing engines to append builtins
1162 alongside text. Make define warn when builtins must be
1164 Memory impact: slight penalty, with fewer builtins flattened.
1165 Speed impact: slight penalty, from more bookkeeping.
1166 * m4/m4module.h (m4_is_arg_composite): New prototype.
1167 (m4_symbol_value_copy): Change return type.
1168 (m4_arg_text): Add parameter.
1169 (M4ARG): Adjust callers.
1170 * m4/m4private.h: Adjust comments.
1171 * m4/symtab.c (m4_symbol_value_copy): Detect when builtins are
1173 * m4/input.c (init_builtin_token): Add parameter, and allow
1174 concatenating builtins.
1175 (m4__next_token): Adjust caller.
1176 * m4/macro.c (m4_is_arg_composite): New function.
1177 (expand_argument): Allow builtin concatenation.
1178 (m4_arg_text): Add parameter.
1179 (m4__arg_adjust_refcount, m4__arg_print): Adjust callers.
1180 (m4_arg_equal): Fix comparison of builtin tokens.
1181 * modules/m4.c (define, pushdef): Warn when flattening builtins.
1182 * doc/m4.texinfo (Define): Remove dead comment.
1183 (Defn): Update to reflect code changes.
1184 * tests/builtins.at (defn): Remove xfail.
1185 * NEWS: Document this change.
1187 2008-05-03 Eric Blake <ebb9@byu.net>
1189 Document define_blind.
1190 * doc/m4.texinfo (Ifelse): Add a new composite macro.
1192 Suggested by Mike R.
1194 2008-05-01 Eric Blake <ebb9@byu.net>
1196 Avoid -Wshadow compiler warnings.
1197 * m4/output.c (threshold_diversion_CB): s/div/diversion/.
1198 * m4/macro.c (make_argv_ref, arg_symbol, m4_arg_symbol)
1199 (m4_is_arg_text, m4_is_arg_func, m4_arg_text, m4_arg_empty)
1200 (m4_arg_len, m4_arg_func, m4__arg_print, m4_make_argv_ref)
1201 (m4_push_arg, m4__push_arg_quote): s/index/arg/.
1202 * modules/format.c (format): Likewise.
1203 * modules/m4.c (ifelse): Likewise.
1205 Improve debugmode testing, based on recent branch-1.6 regressions.
1206 * doc/m4.texinfo (Debugmode): Enhance tests.
1207 * tests/generate.awk: Run tests from stdin, not input.m4. Support
1208 stderr munging when using -I examples.
1210 Fix regression in define from 2008-02-22.
1211 * m4/m4module.h (m4_symbol_value_copy): Add parameter.
1212 * m4/symtab.c (m4_symbol_value_copy): Support copying $@
1214 * m4/macro.c (expand_argument): Update callers.
1215 * modules/m4.c (define, pushdef): Likewise.
1216 * tests/builtins.at (define): Enhance test to catch this.
1218 2008-04-21 Eric Blake <ebb9@byu.net>
1220 Simplify previous patch.
1221 * tests/m4.in: Compress assignment.
1222 Suggested by Gary V. Vaughan.
1224 Fix --disable-shared testsuite regression from previous patch.
1225 * tests/m4.in: Export M4MODPATH, so that recursive m4 invocations
1228 Fix spelling of attribution to Christopher Strachey.
1229 * doc/m4.texinfo (History, Inhibiting Invocation): Fix typo.
1231 Reported by Fernando Carrijo.
1233 2008-04-17 Eric Blake <ebb9@byu.net>
1235 Fix testsuite bug when SIGPIPE is ignored.
1236 * tests/builtins.at (divert): Consume all of m4's output, to avoid
1237 spurious write failure.
1238 * src/main.c (main): In batch mode, restore default handling of
1240 * doc/m4.texinfo (Operation modes): Document SIGPIPE behavior.
1242 Reported by Bob Proulx, via his autobuilder.
1244 2008-04-15 Eric Blake <ebb9@byu.net>
1246 Fix 'make installcheck' after './configure --prefix-progname'.
1247 * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
1249 (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
1250 * tests/builtins.at (patsubst): Avoid space-tab.
1251 (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
1252 * tests/options.at (--debugfile): Likewise.
1253 * tests/others.at (stdin seekable): Likewise.
1254 (fstab): Avoid space-tab.
1255 * Makefile.am (installcheck-local): Accomodate transformed name.
1256 (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
1257 during 'make distcheck'.
1258 * cfg.mk: New file, borrowed from branch.
1260 Update prerequisite tools to match recent releases.
1261 * configure.ac (AC_PREREQ): Rely on released autoconf.
1262 (LT_PREREQ): Rely on released libtool.
1263 * tests/testsuite.at (m4_version_prereq): Update dependence.
1264 * bootstrap: Mention prerequisites.
1266 Work around OS/2 limitation of printf(1).
1267 * tests/null.m4: Use m4, not printf, to generate NUL byte.
1268 * tests/null.out: Check for esyscmd failure.
1269 Reported by Elbert Pol.
1271 2008-04-14 Eric Blake <ebb9@byu.net>
1273 Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
1274 Improve arg_print to handle builtin tokens when printing to a
1275 known chain, rather than always flattening builtins. This allows
1276 m4wrap and $@ back-references to handle embedded builtin tokens.
1277 Memory impact: none.
1278 Speed impact: slight penalty, from more bookkeeping.
1279 * m4/m4module.h (m4_push_builtin): Add parameter.
1280 (m4_builtin_print, m4_push_wrapup_init, m4_push_wrapup_finish)
1281 (m4_arg_print, m4_symbol_value_print): Rename and reduce scope...
1282 * m4/m4private.h (m4__builtin_print, m4__push_wrapup_init)
1283 (m4__push_wrapup_finish, m4__arg_print, m4__symbol_value_print):
1284 ...to these, in some cases adding a parameter.
1285 (m4__append_builtin): New prototype.
1286 * m4/builtin.c (m4_builtin_print): Alter signature to print
1287 builtin to a growing symbol chain.
1288 * m4/symtab.c (m4__symbol_value_print): Alter signature.
1289 (m4_symbol_print, dump_symbol_CB): Adjust callers.
1290 * m4/input.c (builtin_peek, builtin_read, builtin_unget)
1291 (builtin_print, builtin_funcs): Delete, handled via composite
1293 (struct m4_input_block): Delete u.builtin member.
1294 (init_builtin_token): Only use composite block.
1295 (m4__append_builtin): New function.
1296 (m4_push_builtin, m4__push_wrapup_init): Alter signature.
1297 (m4__push_symbol): Allow builtin tokens.
1298 (m4__push_wrapup_finish): Rename.
1299 (composite_print, m4_print_token): Adjust callers.
1300 * m4/macro.c (m4_wrap_args, collect_arguments): Allow builtin
1302 (m4__arg_print): Alter signature.
1303 (trace_prepre, trace_pre, m4_arg_text, m4_arg_equal): Adjust
1305 * modules/m4.c (m4wrap): Allow builtin tokens.
1306 (defn, errprint): Adjust callers.
1307 * modules/gnu.c (builtin): Likewise.
1308 * doc/m4.texinfo (M4wrap): New test.
1309 (Debuglen): Adjust expected output.
1311 Stage 21a: Optimize checks for end of input.
1312 Create a new polymorphic input block type, which always fails with
1313 CHAR_EOF, so that remaining input routines no longer have to check
1314 for NULL input block.
1315 Memory impact: none.
1316 Speed impact: noticeable improvement, from fewer conditionals.
1317 * m4/input.c (eof_funcs, input_eof): New objects.
1318 (eof_peek, eof_read, eof_unget): New functions.
1319 (file_clean, m4_push_string_init, pop_input, m4_push_wrapup_init)
1320 (m4_pop_wrapup, next_char, peek_char, unget_input, m4_input_init)
1321 (m4_input_exit): Use placeholder to guarantee non-NULL isp and
1323 (next_char): Rename retry to allow_unget, and change sense for
1324 easier manipulation. All callers changed.
1326 Improve OS/2 detection.
1327 * modules/gnu.c (m4_macro_table): Ensure all possible identifiers
1328 are defined, not just the first. The testsuite ensures that
1329 exactly one gets defined.
1330 * m4/system_.h [__EMX__]: OS/2 is not Unix-compatible, no matter
1331 what other pre-defined macros it has.
1333 Reported by Elbert Pol.
1335 Ensure __m4_version__ is unquoted.
1336 * tests/builtins.at (__m4_@&t@version__): Augment test.
1338 Avoid GNU make failure on tarball.
1339 * Makefile.am (EXTRA_DIST): Distribute cfg.mk and maint.mk.
1341 2008-04-10 Eric Blake <ebb9@byu.net>
1343 Allow back-referenced macro names; fixes 2008-03-13 regression.
1344 * m4/m4module.h (m4_symbol_value_lookup): Change prototype.
1345 * m4/utility.c (m4_symbol_value_lookup): Change signature.
1346 * modules/m4.c (undefine, popdef, ifdef, m4_dump_symbols, defn):
1348 * tests/others.at (ifndef): New test.
1350 Be namespace clean for M4 version; fixes 2008-04-08 regression.
1351 * configure.ac (version): Rename...
1352 (M4_VERSION): ...to this, since using 'version' broke po.m4.
1354 2008-04-09 Eric Blake <ebb9@byu.net>
1356 Mention 1.4.11 release.
1357 * doc/m4.texinfo (History, Defn, Ifdef, Ifelse, M4wrap)
1358 (Extensions, Improved foreach): Distinguish 1.4.11 and 1.6.
1359 (Format): Add test of C99 hex-float parsing.
1360 * NEWS: Mention 1.4.11 release.
1361 * tests/builtins.at (divert): Add additional test.
1363 2008-04-08 Eric Blake <ebb9@byu.net>
1365 Overhaul inter-version releases to work with git.
1366 * configure.ac (version): New variable, which has nicer version
1367 contents when using git 1.5.5+, hardcoded to 1.9a otherwise.
1368 (TIMESTAMP): Delete, since CVS id expansion died with transition
1370 (AM_INIT_AUTOMAKE): Use version to decide gnu vs. gnits.
1371 * build-aux/mkstamp: Delete, no longer used.
1372 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Kill, to speed up
1373 rebuilds when timestamps don't matter.
1374 (MKSTAMP): Delete, no longer used.
1375 (EXTRA_DIST): No longer worry about mkstamp.
1376 (.version): New rule and distributed file.
1377 (doc/m4.1, tests/package.m4): Depend on .version, not
1378 configure.ac, for timestamp.
1379 * ltdl/m4/gnulib-cache.m4: Import git-version-gen module.
1380 * modules/gnu.c (__m4_version__): TIMESTAMP no longer exists.
1381 * src/main.c (main): Likewise.
1383 2008-03-28 Eric Blake <ebb9@byu.net>
1385 Use GNUmakefile module.
1386 * ltdl/m4/gnulib-cache.m4: Import gnumakefile module.
1387 * Makefile.am: Split off maintainer rules...
1388 * maint.mk: ...into this new file.
1390 2008-03-18 Eric Blake <ebb9@byu.net>
1392 Stage 20b: make m4wrap obey POSIX fifo ordering.
1393 Improve input engine to support location changes within symbol
1394 chains, then convert m4wrap to always build symbol chain.
1395 Memory impact: none.
1396 Speed impact: slight penalty, from more m4wrap bookkeeping.
1397 * m4/m4module.h (m4_wrap_args): Add prototype.
1398 * m4/m4private.h (enum m4__symbol_chain_type): Add M4__CHAIN_LOC.
1399 (struct m4__symbol_chain): Add struct u_l.
1400 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Use
1402 (composite_peek, composite_read, composite_clean): Handle location
1404 * m4/macro.c (m4_wrap_args): New function.
1405 * modules/m4.c (m4wrap): Use it.
1406 * doc/m4.texinfo (M4wrap): Sync with branch and POSIX.
1407 (Extensions): Document extension of multiple arguments.
1408 (Location, Improved m4wrap): Adjust example to match FIFO order.
1409 * tests/builtins.at (wrap): Likewise.
1410 * NEWS: Document this change.
1412 2008-03-17 Eric Blake <ebb9@byu.net>
1414 Stage 20a: reduce unget's in input engine.
1415 Now that out-of-range input placeholders like CHAR_BUILTIN are
1416 consumed outside of next_char, next_token should always consume
1417 rather than peek at the first character. Fewer peeks results in
1418 less ungetc overhead.
1419 Memory impact: none.
1420 Speed impact: noticeable improvement, from fewer function calls.
1421 * m4/input.c (struct input_funcs): Alter read_func prototype.
1422 (next_char, file_read, buildin_read, string_read, composite_read):
1423 Add allow_argv parameter.
1424 (init_builtin_token, init_argv_symbol): Require all prior input to
1426 (m4_skip_line, match_input, consume_syntax): Adjust callers.
1427 (m4__next_token): Consume first byte without peek.
1429 Update for fresh bootstrap.
1430 * ltdl/m4/gnulib-cache.m4: Updated copyright from upstream.
1432 2008-03-15 Eric Blake <ebb9@byu.net>
1434 Document join, in order to fix bug in m4wrap example.
1435 * examples/join.m4: New file.
1436 * examples/wraplifo2.m4: Likewise.
1437 * Makefile.am (EXTRA_DIST): Add new files.
1438 * doc/m4.texinfo (Improved m4wrap): New node.
1439 (Defn, Location): Enhance tests.
1440 (Shift): Document the composite macro join.
1441 (Incompatibilities): Move documentation of LIFO vs. FIFO...
1442 (M4wrap): ...here, to match improved example.
1444 2008-03-13 Eric Blake <ebb9@byu.net>
1446 Stage 19c: allow builtin tokens in more macros.
1447 Allow builtin tokens inside symbol chains, although for now, they
1448 are not allowed inside comments or quotes. Enable builtin token
1449 handling in more macros, if only to consistently diagnose invalid
1451 Memory impact: none.
1452 Speed impact: slight impact, due to more bookkeeping.
1453 * m4/m4module.h (m4_symbol_value_lookup, m4_builtin_print): New
1455 * m4/m4private.h (enum m4__symbol_chain_type): Add
1457 (struct m4__symbol_chain): Add builtin member.
1458 * m4/utility.c (m4_symbol_value_lookup): New method.
1459 * m4/builtin.c (m4_builtin_print): New function.
1460 * m4/symtab.c (m4_symbol_value_print): Use it.
1461 * m4/input.c (builtin_print): Likewise.
1462 (m4__push_symbol): Allow pushing builtin tokens.
1463 (composite_peek, composite_read, composite_unget, composite_clean)
1464 (composite_print): Handle builtin tokens.
1465 (init_builtin_token): Allow builtin tokens from composite input.
1466 (m4__next_token): Flatten builtins inside comment or string.
1467 * m4/macro.c (expand_argument): Strengthen assertion.
1468 (collect_arguments, m4_arg_equal, m4_arg_print, m4_push_args):
1469 Handle builtin tokens.
1470 (arg_symbol): Add parameter, and allow NULL level.
1471 (m4_arg_symbol, m4__push_arg_quote): Adjust callers.
1472 (m4_arg_text): Ensure all builtins have been flattened.
1473 * modules/m4.c (defn, dumpdef, popdef, traceoff, traceon)
1474 (undefine, m4_dump_symbols): Warn on invalid macro names.
1475 (ifdef, ifelse, shift): Handle builtin tokens.
1476 * modules/gnu.c (m4symbols): Likewise.
1477 * doc/m4.texinfo (Defn, Ifdef, Ifelse): Document and test the new
1479 (Debuglen): Likewise, and remove xfail.
1480 * NEWS: Mention the change.
1482 Stage 19b: invert sense of bit for handling builtin tokens.
1483 Pass builtin tokens by default, rather than as the exception, so
1484 that the logic can consistently refer to flattening arguments.
1485 Memory impact: none.
1487 * m4/m4module.h (M4BUILTIN_ENTRY): New convenience macro.
1488 (M4_BUILTIN_GROKS_MACRO): Rename...
1489 (M4_BUILTIN_FLATTEN_ARGS): ...and invert sense.
1490 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): Likewise...
1491 (m4_symbol_value_flatten_args, m4_symbol_flatten_args): ...to
1493 * m4/m4private.h (VALUE_MACRO_ARGS_BIT)
1494 (m4_symbol_value_groks_macro): Likewise...
1495 (VALUE_FLATTEN_ARGS_BIT, m4_symbol_value_flatten_args): ...to
1497 * m4/symtab.c (m4_symbol_value_groks_macro): Likewise...
1498 (m4_symbol_value_flatten_args): ...to this.
1499 * m4/macro.c (collect_arguments): Accomodate changed sense.
1500 * m4/module.c (m4__module_open): Require arguments if flattening
1502 * m4/input.c (m4_push_string_finish): For now, flatten all
1503 builtins pushed as back-references.
1504 * modules/gnu.c (m4_builtin_table, builtin): Adjust all clients.
1505 * modules/import.c (m4_builtin_table): Likewise.
1506 * modules/load.c (m4_builtin_table): Likewise.
1507 * modules/modtest.c (m4_builtin_table): Likewise.
1508 * modules/mpeval.c (m4_builtin_table): Likewise.
1509 * modules/perl.c (m4_builtin_table): Likewise.
1510 * modules/shadow.c (m4_builtin_table): Likewise.
1511 * modules/stdlib.c (m4_builtin_table): Likewise.
1512 * modules/time.c (m4_builtin_table): Likewise.
1513 * modules/m4.c (m4_builtin_table): Likewise.
1514 (mkstemp): Undo #undef hack from 2006-10-23, now that macro names
1515 are stringized without preprocessor expansion.
1516 * doc/m4.texinfo (Defn): Update comments to match reality.
1517 (Debuglen): Update test now that user macros pass builtin tokens.
1519 Stage 19a: sort and cache builtins loaded by a module.
1520 Rather than repeatedly using dlsym to browse the builtin table,
1521 copy off the table at module load time. Then, the input engine
1522 merely refers to the copy instead of duplicating information.
1523 Memory impact: slight penalty, due to more memory per module, but
1524 offset by less memory in input engine.
1525 Speed impact: slight improvement, due to faster builtin lookups.
1526 * m4/m4module.h (m4_set_symbol_value_builtin): Delete. Use
1527 m4_builtin_find_by_* instead.
1528 (m4_builtin_find_by_func): Change return type.
1529 * m4/m4private.h (m4__builtin): New struct.
1530 (m4_module): Add sorted list of loaded builtins.
1531 (struct m4_symbol_value): Change type of builtin value.
1532 (m4__set_symbol_value_builtin): New prototype and fast accessor.
1533 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1535 * m4/symtab.c (m4_set_symbol_value_builtin): Rename...
1536 (m4__set_symbol_value_builtin): ...and populate additional fields,
1538 (m4_get_symbol_value_func, m4_get_symbol_value_builtin): Adjust to
1540 * m4/module.c (install_builtin_table): Use cached table.
1541 (compare_builtin_CB): New helper function.
1542 (m4__module_open): Populate table.
1543 (module_remove): Free table.
1544 * m4/builtin.c (compare_builtin_name_CB): New helper function.
1545 (m4_builtin_find_by_name): Rewrite to use sorted table.
1546 (m4_builtin_find_by_func): Change return type.
1547 * m4/input.c (struct m4_input_block): Simplify u_b, since most
1548 fields can be determined from builtin.
1549 (builtin_peek, builtin_read, builtin_unget, init_builtin_token)
1550 (m4__next_token): Alter parsing so that only init_builtin_token
1552 (builtin_print, m4_push_builtin): Adjust all users.
1553 * tests/macros.at (Arity, defn, and freeze): Fix typo.
1555 Consistently cast malloc results, for C++ compilation.
1556 * m4/builtin.c (m4_builtin_find_by_name): Add cast.
1557 * m4/hash.c (m4_hash_new, m4_get_hash_iterator_next, node_new)
1558 (m4_hash_resize, maybe_grow): Likewise.
1559 * m4/m4.c (m4_create): Likewise.
1560 * m4/macro.c (expand_macro): Likewise.
1561 * m4/output.c (m4_tmpname): Likewise.
1562 * m4/path.c (search_path_add): Likewise.
1563 * m4/symtab.c (m4_symtab_create, m4_symbol_value_create)
1564 (symtab_fetch): Likewise.
1565 * m4/syntax.c (m4_syntax_create): Likewise.
1566 * modules/gnu.c (regexp_compile): Likewise.
1567 * src/main.c (main): Likewise.
1568 * src/freeze.c (reload_frozen_state): Likewise.
1570 2008-03-06 Eric Blake <ebb9@byu.net>
1572 Fix nested builtin(`shift',$@) regression from 2008-02-23.
1573 * m4/macro.c (make_argv_ref): Don't output expansion text when
1574 making wrapper for builtin or indir.
1575 * tests/builtins.at (builtin): New test.
1576 * NEWS: Document the fix.
1577 Reported by Andreas Schwab.
1579 2008-03-04 Eric Blake <ebb9@byu.net>
1581 The gnulib module free was deprecated.
1582 * ltdl/m4/gnulib-cache.m4: Remove free module.
1584 2008-02-29 Eric Blake <ebb9@byu.net>
1586 Import news from 1.4.10b.
1587 * NEWS: Update from branch.
1589 2008-02-23 Eric Blake <ebb9@byu.net>
1591 Stage 18: try harder to reuse argv in recursion.
1592 When pushing arguments that contain an existing $@ ref, reuse the
1593 ref rather than creating another layer of wrappers.
1594 Memory impact: noticeable improvement, due to better $@ reuse.
1595 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1596 reduction in unboxed recursion.
1597 * m4/macro.c (make_argv_ref): Avoid wrapping $@ when possible.
1598 (m4_push_args): Let make_argv_ref take care of pending data.
1599 * doc/m4.texinfo (Improved foreach): Tweak wording to match new
1600 performance capability.
1601 * tests/others.at (recursion): Add tests to avoid performance
1604 2008-02-22 Eric Blake <ebb9@byu.net>
1607 * NEWS: Document change to __gnu__ on 2008-02-11.
1609 Stage 17: pass argv through quoted strings.
1610 Allow the concatenation of $@ references with other text input
1611 inside quoted contexts, which requires distinguishing between a
1612 wrapper around many arguments vs. a reference serving as part of a
1613 single argument. Also optimize based on whether argv contains
1614 builtin tokens that might need flattening to the empty string.
1615 Memory impact: noticeable improvement, due to O(n^2) to O(n)
1616 reduction from total reuse of $@ references.
1617 Speed impact: noticeable improvement, due to O(n^2) to O(n)
1618 reduction in boxed recursion.
1619 * m4/m4module.h (m4_arg_equal, m4_arg_len): Add parameter.
1620 (M4ARGLEN): Adjust definition.
1621 * m4/m4private.h (struct m4__symbol_chain): Add has_func member.
1622 (struct m4_symbol_value): Add wrapper and has_func members.
1623 (struct m4_macro_args): Add flatten and has_func members.
1624 * m4/input.c (append_quote_token): Return argv refs inside quoted
1626 (init_argv_symbol): Populate new fields.
1627 * m4/macro.c (expand_argument, collect_arguments, make_argv_ref)
1628 (m4_make_argv_ref): Likewise.
1629 (arg_symbol, arg_mark, m4_is_arg_text, m4_is_arg_func): Use new
1631 (m4_arg_equal, m4_arg_len): Handle quoted argv references, and add
1633 * modules/m4.c (ifelse): Adjust caller.
1635 2008-02-22 Gary V. Vaughan <gary@gnu.org>
1637 Fix regression in argument collection, from 2008-01-21.
1638 * m4/input.c (m4__next_token): When DEBUG_INPUT is defined,
1639 undo argument collection optimisation for strings, so that
1640 m4_print_token doesn't abort when it otherwise receives an
1641 unprintable M4_SYMBOL_VOID type token.
1643 2008-02-20 Eric Blake <ebb9@byu.net>
1645 Stage 16: cache quotes and improve m4_arg_print.
1646 Cache rather than always copying quotes when pushing $@ refs; in
1647 particular, reconstruct single-byte quotes on the fly. Allow NUL
1648 through m4wrap. Improve sharing of code that prints arguments.
1649 Memory impact: slight improvement, due to cached quotes.
1650 Speed impact: slight improvement, due to less copying.
1651 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print)
1652 (m4_arg_print): Adjust prototypes.
1653 (m4_dump_args): Delete.
1654 (m4_push_wrapup): Split...
1655 (m4_push_wrapup_init, m4_push_wrapup_finish): ...into these
1657 * m4/m4private.h (struct m4_syntax_table): Add cached_quote
1659 (m4__quote_cache, m4__quote_uncache): New prototypes.
1660 * m4/syntax.c (m4_syntax_create): Initialize the cache.
1661 (m4__quote_cache): New function.
1662 (m4_set_syntax): Update caller.
1663 * m4/symtab.c (m4_symbol_value_print): Add parameter.
1664 (m4_symbol_print, dump_symbol_CB): Adjust all callers.
1665 * m4/utility.c (m4_dump_args): Delete; callers should use
1666 m4_arg_print instead.
1667 * m4/input.c (m4_push_wrapup_init, m4_push_wrapup_finish): Split
1668 implementation, and allow embedded NUL.
1669 (m4_print_token, pop_input, composite_print, composite_peek):
1670 (composite_read, append_quote_token): Adjust all callers.
1671 * m4/macro.c (trace_prepre, m4_arg_text, make_argv_ref):
1673 (m4_arg_print): Add parameters.
1674 (trace_pre): Rewrite in terms of m4_arg_print.
1675 * modules/m4.c (errprint): Likewise.
1676 (m4wrap): Rewrite to allow embedded NUL.
1677 (dumpdef): Adjust caller.
1678 * doc/m4.texinfo (Debuglen): Enhance debuglen test.
1679 * tests/null.m4: Test for NUL in m4wrap.
1680 * tests/null.out: Update expected output.
1682 Fix out-of-bounds read for sanitized macro names, from 2008-02-06.
1683 * m4/utility.c (m4_verror_at_line): Properly terminate the string.
1684 Reported by Ralf Wildenhues.
1686 * doc/m4.texinfo (Debuglen, Changesyntax): Fix typos.
1688 2008-02-19 Eric Blake <ebb9@byu.net>
1690 Clean up example on filtering defined symbols.
1691 * doc/m4.texinfo (Foreach, Improved foreach): Document another
1692 shortcoming in foreach.m4, and improve filter example by using
1695 * src/main.c (usage): Fix typo.
1697 2008-02-18 Eric Blake <ebb9@byu.net>
1699 Avoid some magic numbers.
1700 * m4/m4private.h (CHAR_EOF, CHAR_BUILTIN, CHAR_QUOTE, CHAR_ARGV)
1701 (CHAR_RETRY): Define in terms of UCHAR_MAX.
1702 * m4/syntax.c (m4_syntax_create, set_syntax_set)
1703 (reset_syntax_set, check_is_single_quotes)
1704 (check_is_single_comments, check_is_macro_escaped)
1705 (m4_set_quotes, m4_set_comment): Likewise.
1706 * modules/gnu.c (regexp_compile): Likewise.
1707 * modules/m4.c (translit): Likewise.
1708 * src/freeze.c (produce_syntax_dump): Likewise.
1709 Reported by Ralf Wildenhues.
1711 2008-02-16 Eric Blake <ebb9@byu.net>
1713 Add regression test for multi-character quote recursion.
1714 * examples/foreach2.m4: Use $0 rather than spelling out name.
1715 * examples/foreachq2.m4: Likewise.
1716 * examples/forloop2.m4: Likewise.
1717 * examples/hanoi.m4: Likewise.
1718 * examples/trace.m4: Likewise.
1719 * doc/m4.texinfo (Improved forloop): Document advantage of $0.
1720 (Improved foreach): Adjust dump from file.
1722 Stage 15: return argv refs back to collect_arguments.
1723 Collect an entire $@ reference at once rather than one argument at
1724 a time, outside of quotes (but inside quotes, $@ is still
1725 flattened for now). The skip_last field allows concatenation of
1726 $@ with other text when collecting arguments.
1727 Memory impact: noticeable improvement, due to better reuse of $@.
1728 Speed impact: noticeable improvement, due to less parsing.
1729 * m4/m4private.h (CHAR_ARGV): New input engine sentinel.
1730 (enum m4__token_type): Add M4_TOKEN_ARGV.
1731 (struct m4__symbol_chain): Add skip_last member to argv link.
1732 (m4__next_token): Add parameter.
1733 * m4/input.c (peek_char, file_peek, builtin_peek, string_peek)
1734 (composite_peek, m4__next_token): Add new parameter.
1735 (composite_read, append_quote_token): Support argv in quotes.
1736 (init_argv_symbol): New function.
1737 (m4__push_symbol, match_input, consume_syntax)
1738 (m4__next_token_is_open, m4_print_token): Adjust callers.
1739 * m4/macro.c (m4_macro_expand_input, m4__arg_adjust_refcount)
1740 (arg_mark, m4_arg_text, make_argv_ref): Likewise.
1741 (expand_argument, collect_arguments): Handle new token.
1742 (arg_symbol): Drill through $@ reference.
1743 * m4/syntax.c (set_quote_age): Detect disabled comments.
1744 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Fix debug code.
1746 2008-02-15 Eric Blake <ebb9@byu.net>
1748 * modules/gnu.c (regexp_compile): Use a fastmap for regex speed.
1750 2008-02-13 Eric Blake <ebb9@byu.net>
1752 Fix texinfo grammar.
1753 * doc/m4.texinfo (Eval, Incompatibilities): Use @. after capital.
1754 (History): Use @: after abbreviations.
1755 (M4exit): Use correct Latin abbreviation.
1756 (Dumpdef, Debugmode, Frozen file format 2): Use correct spacing
1759 2008-02-11 Eric Blake <ebb9@byu.net>
1761 Allow builtin text macros to specify number of arguments.
1762 * m4/m4module.h (struct m4_macro): Add argument limits to builtin
1764 * m4/module.c (install_macro_table): Allow text macros to warn on
1766 * modules/gnu.c (m4_macro_table): Update all clients.
1767 * modules/load.c (m4_macro_table): Likewise.
1768 * modules/mpeval.c (m4_macro_table): Likewise.
1769 * modules/perl.c (m4_macro_table): Likewise.
1770 * modules/shadow.c (m4_macro_table): Likewise.
1771 * modules/traditional.c (m4_macro_table): Likewise.
1772 * modules/modtest.c (m4_macro_table): Likewise. Also add text
1773 macros, for testing this.
1774 * doc/m4.texinfo (Standard Modules): Update text, and enhance
1776 * tests/modules.at (modules: text): New test.
1778 Fix regression in command line -D option, from 2006-08-25.
1779 * m4/m4private.h (m4_symbol_value_create): Delete fast accessor.
1780 * m4/m4module.h: Fix typo.
1781 * m4/symtab.c (m4_symbol_value_create): Prime the maximum number
1783 * tests/macros.at (Command line define): Enhance test.
1784 * tests/others.at (nul character): Enhance test.
1785 * tests/null.m4: Likewise.
1786 * tests/null.out: Likewise.
1788 Use gnulib's git-merge-changelog driver when available.
1789 * .gitattributes: Add merge attributes for ChangeLog.
1790 * bootstrap: Install driver, if not already present.
1792 2008-02-06 Eric Blake <ebb9@byu.net>
1794 Fix security hole introduced 2007-11-23.
1795 * m4/utility.c (m4_verror_at_line): Properly escape macro names.
1796 * src/main.c (main): Manage quoteargs defaults.
1797 * doc/m4.texinfo (Indir): Document and test this.
1799 Using raw strtod is not portable.
1800 * ltdl/m4/gnulib-cache.m4: Import the strtod module.
1802 2008-02-02 Eric Blake <ebb9@byu.net>
1804 Consistently use size_t for number of arguments.
1805 * m4/m4module.h (m4_builtin_func): Alter prototype.
1806 (struct m4_builtin): Adjust type of min_args, max_args.
1807 (M4BUILTIN, M4BUILTIN_HANDLER): Adjust all builtins.
1808 (m4_bad_argc, m4_dump_args, m4_macro_call, m4_arg_argc)
1809 (m4_arg_symbol, m4_is_arg_text, m4_is_arg_func, m4_arg_text)
1810 (m4_arg_equal, m4_arg_empty, m4_arg_len, m4_arg_func)
1811 (m4_arg_print, m4_push_arg): Adjust all clients.
1812 * m4/m4private.h (struct m4__symbol_chain, m4_symbol_value)
1813 (m4_macro_args): Adjust type of various fields.
1814 (m4__push_arg_quote): Adjust all clients.
1815 * m4/input.c (m4_pop_wrapup): Likewise.
1816 * m4/macro.c (m4_macro_call, trace_pre, make_argv_ref)
1817 (arg_symbol, m4_arg_symbol, m4_is_arg_text, m4_is_arg_func)
1818 (m4_arg_text, m4_arg_equal, m4_arg_empty, m4_arg_len)
1819 (m4_arg_func, m4_arg_print, m4_make_argv_ref, m4_push_arg)
1820 (m4__push_arg_quote, m4_push_args, m4_arg_argc): Likewise.
1821 * m4/utility.c (m4_bad_argc, m4_dump_args): Likewise.
1822 * modules/evalparse.c (m4_evaluate): Likewise.
1823 * modules/gnu.c (changesyntax): Likewise.
1824 * modules/m4.c (m4_dump_symbols, undefine, popdef, ifelse, defn)
1825 (undivert, traceon, traceoff): Likewise.
1826 * modules/m4.h (m4_dump_symbols_func): Likewise.
1827 * modules/perl.c (perleval): Likewise.
1829 Stage 14b: allow pushing argv references.
1830 Push a $@ reference to the input engine in one go, rather than
1831 pushing each element. For now, argument collection still gets one
1832 argument of a $@ at a time; but the penalties of this patch make
1833 it easier to manage $@ efficiently in future patches.
1834 Memory impact: noticeable penalty, due to larger struct and O(n)
1835 to O(n^2) on unboxed recursion.
1836 Speed impact: noticeable penalty, due to more bookkeeping.
1837 * m4/m4private.h (struct m4__symbol_chain): Add comma and quotes
1839 (struct m4_macro_args): Add level field.
1840 (m4__arg_adjust_refcount, m4__push_arg_quote): New prototypes.
1841 * m4/input.c (m4__push_symbol, composite_peek, composite_read)
1842 (composite_unget, composite_clean, composite_print): Support $@
1844 * m4/macro.c (collect_arguments): Populate new field.
1845 (expand_macro): Move argv cleanup...
1846 (m4__arg_adjust_refcount): ...to this new function.
1847 (m4_arg_symbol, m4_make_argv_ref, m4_push_arg): Factor...
1848 (arg_symbol, make_argv_ref, m4__push_arg_quote): ...to these new
1849 helper functions, to add parameters.
1850 (m4_push_args): Adjust caller.
1851 * m4/symtab.c (m4_symbol_value_print): Likewise.
1853 Stage 14a: allow printing argv references.
1854 Refactor symbol-value printing code for better sharing, and to
1855 allow printing a contiguous text representation of a $@ ref.
1856 Memory impact: none.
1858 * m4/m4module.h (m4_arg_print): New prototype.
1859 (m4_symbol_value_print): Alter prototype.
1860 * m4/input.c (struct input_funcs): Add parameter to peek_func.
1861 (file_peek, builtin_peek, string_peek): Ignore new parameter.
1862 (composite_peek): Ignore new parameter, for now.
1863 (composite_clean, pop_input): Rework to minimize indirection, and
1864 to avoid infinite recursion in next patch.
1865 * m4/macro.c (trace_prepre, trace_pre): Adjust callers.
1866 (m4_arg_print): New function.
1867 * m4/symtab.c (m4_symbol_value_print): Update signature.
1868 (m4_symbol_print): Update caller.
1869 * m4/output.c (m4_shipout_string_trunc): Update comments.
1870 * m4/syntax.c (set_quote_age): Require comma as argument separator
1871 when dealing with $@ as a unit.
1872 * tests/builtins.at (ifelse): Augment test.
1873 * doc/m4.texinfo (Changesyntax): Document changesyntax deficiency.
1875 2008-01-31 Eric Blake <ebb9@byu.net>
1877 Kill hack for M4 1.4.4.
1878 * configure.ac (AM_GNU_GETTEXT_INTL_SUBDIR): Delete, now that
1879 we require new enough autoconf which in turn requires M4 1.4.5.
1881 2008-01-31 Gary V. Vaughan <gary@gnu.org>
1882 and Eric Blake <ebb9@byu.net>
1884 Depend on new libtool to use non-recursive build.
1885 * configure.ac (LT_PREREQ): Bump to alpha release version.
1886 (LTDL_INIT): Choose nonrecursive mode. Perform sanity check that
1887 installed libtool has correct symbols.
1888 * Makefile.am (SUBDIRS): Drop ltdl, now that it is built from the
1890 (AM_CPPFLAGS): Drop directories covered by libtool.
1891 (AM_LDFLAGS): Drop -no-undefined, covered by libtool.
1892 (include_HEADERS, noinst_LTLIBRARIES, EXTRA_LTLIBRARIES): New
1893 macros, used by libtool.
1894 (lib_LTLIBRARIES): Also used by libtool.
1895 (ltdl/libltdlc.la): Delete, now that libtool does this.
1896 * bootstrap: Mention new requirements.
1897 (LIBTOOLIZE): Provide default program, and run libtoolize prior to
1899 (autoreconf): Also neutralize libtoolize, since it is run early.
1900 * HACKING: Mention updated prerequisites.
1902 2008-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1904 Fix build failure if installed libltdl is used.
1905 * Makefile.am (m4_libm4_la_DEPENDENCIES): Use $(LTDLDEPS).
1907 2008-01-28 Eric Blake <ebb9@byu.net>
1909 Depend on newer autoconf, for testsuite -C dir.
1910 * Makefile.am (CD_TESTDIR): Delete, no longer required.
1911 (check-local, installcheck-local, clean-local-tests): Use new -C
1912 option from autotest.
1913 * configure.ac (AC_PREREQ): Bump to 2.61a.347.
1914 * bootstrap: Mention new dependency.
1915 * HACKING: Likewise.
1917 2008-01-27 Eric Blake <ebb9@byu.net>
1919 Stage 13: push composite text tokens.
1920 Support pushing composite tokens, allowing back-references to be
1921 reused through multiple macro expansions. Add hueristic that
1922 avoids creating new reference when pushing existing references.
1923 Memory impact: noticeable improvement due to better reference
1924 reuse, except for O(n) to O(n^2) copying in boxed recursion.
1925 Speed impact: slight penalty, due to more bookkeeping.
1926 * m4/m4private.h (m4__push_symbol): Adjust prototype.
1927 * m4/input.c (m4__push_symbol): Add parameter, and support
1929 (append_quote_token): Add parameter, and support inlining of short
1931 (m4__next_token): Adjust caller.
1932 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
1934 2008-01-26 Eric Blake <ebb9@byu.net>
1936 Stage 12c: add macro for m4_arg_len.
1937 Make a common action easier to type.
1938 Memory impact: none.
1940 * m4/m4module.h (M4ARGLEN): New macro.
1941 * m4/macro.c (process_macro): Adjust all callers.
1942 * m4/utility.c (m4_dump_args): Likewise.
1943 * modules/m4.c (divert, maketemp, mkstemp, m4wrap, len, index)
1945 * modules/gnu.c (builtin, indir, mkdtemp, patsubst, regexp)
1946 (renamesyms): Likewise.
1947 * modules/stdlib.c (setenv): Likewise.
1949 Stage 12b: add m4_string_pair.
1950 Make passing quote delimiters around more efficient.
1951 Memory impact: none.
1952 Speed impact: slight penalty, due to more bookkeeping.
1953 * m4/m4module.h (m4_string_pair): New type.
1954 (m4_get_syntax_quotes, m4_get_syntax_comments): New prototypes.
1955 (m4_symbol_value_print, m4_symbol_print, m4_shipout_string_trunc):
1957 * m4/m4private.h (struct m4_string): Delete.
1958 (struct m4_syntax_table): Combine quote and comment members.
1959 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
1960 (m4_get_syntax_ecomm): Adjust accessors.
1961 (m4_get_syntax_quotes, m4_get_syntax_comments): New fast
1963 * m4/symtab.c (m4_symbol_value_print, m4_symbol_print):
1965 * m4/input.c (string_print, composite_print, m4_input_print):
1966 All callers updated.
1967 * m4/syntax.c (m4_syntax_delete, m4_set_syntax)
1968 (check_is_single_quotes, m4_set_quotes, set_quote_age)
1969 (m4_get_syntax_lquote, m4_get_syntax_rquote)
1970 (m4_get_syntax_quotes, check_is_single_comments, m4_set_comment)
1971 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
1972 (m4_get_syntax_comments): Likewise.
1973 * m4/macro.c (trace_prepre, trace_pre, m4_push_args): Likewise.
1974 * m4/output.c (m4_shipout_string, m4_shipout_string_trunc):
1976 * modules/m4.c (dumpdef, m4_make_temp): Likewise.
1977 * src/freeze.c (produce_frozen_state): Likewise.
1978 * tests/freeze.at (reloading unknown builtin): Update test.
1980 Stage 12a: make m4_symbol_chain a union.
1981 Shrink size of symbol chains by using a union.
1982 Memory impact: slight improvement, due to smaller struct.
1983 Speed impact: slight improvement, due to less bookkeeping.
1984 * m4/m4private.h (enum m4__symbol_chain_type): New enum.
1985 (struct m4_symbol_chain): Rename...
1986 (struct m4__symbol_chain): ...to this, since it is internal.
1987 * m4/symtab.c (m4_symbol_value_copy, m4_symbol_value_print): All
1989 * m4/input.c (struct m4_input_block, m4__push_symbol)
1990 (composite_peek, composite_read, composite_unget)
1991 (composite_clean, composite_print, m4__make_text_link)
1992 (append_quote_token): Likewise.
1993 * m4/macro.c (expand_macro, arg_mark, m4_arg_symbol, m4_arg_text)
1994 (m4_arg_equal, m4_arg_len, m4_make_argv_ref, m4_push_arg)
1995 (m4_push_args): Likewise.
1997 2008-01-23 Eric Blake <ebb9@byu.net>
1999 Adjust to recent libtool interface change.
2000 * configure.ac (LT_PREREQ): Require bleeding-edge libtool.
2001 (LT_WITH_LTDL): Delete, now that it is obsolete.
2002 (LTDL_INIT): Use new libtool macro.
2004 2008-01-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2005 and Eric Blake <ebb9@byu.net>
2007 Rely on newer automake.
2008 * configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1, and add lzma
2010 * bootstrap: Update automake requirement.
2011 (func_version): Fix --version output, broken since 2007-08-06.
2012 * HACKING: Likewise. Add lzma requirement.
2013 * Makefile.am (clean-local-src): Not needed any more with newest
2015 (clean-local): Adjust.
2016 * TODO: Remove completed item.
2018 2008-01-22 Eric Blake <ebb9@byu.net>
2021 * doc/m4.texinfo (Renamesyms): Avoid underfull hbox, and improve
2024 2008-01-21 Eric Blake <ebb9@byu.net>
2026 Stage 11: full circle for single argument references.
2027 Pass quoted strings through to argument collection in a single
2028 action, so that an argument can be reused throughout macro
2029 recursion if it remains unchanged.
2030 Memory impact: noticeable improvement, due to more reuse in
2031 argument collection stacks; O(n^2) to O(n) on boxed recursion.
2032 Speed impact: noticeable improvement, due to less copying.
2033 * m4/m4module.h (m4_arg_text): Add parameter.
2035 * m4/m4private.h (CHAR_QUOTE): New input engine sentinel.
2036 (m4__make_text_link): New prototype.
2037 (struct m4_symbol_chain): Add quote_age member.
2038 (struct m4_symbol_value): Add end member to chained symbol.
2039 (struct m4_macro_args): Add wrapper member.
2040 * m4/symtab.c (m4_symbol_value_print): Print composite tokens.
2041 (m4_symbol_value_copy, m4_symbol_value_delete): Recognize
2043 * m4/input.c (make_text_link): Rename...
2044 (m4__make_text_link): ...to this, and export.
2045 (m4_push_string_finish): Adjust caller.
2046 (make_text_link, m4__push_symbol): Update new field.
2047 (file_read, builtin_read, string_read, composite_read, next_char):
2049 (m4_skip_line, match_input, consume_syntax): Adjust callers.
2050 (append_quote_token): New function.
2051 (m4__next_token): Pass quoted strings onto argument collection.
2052 (m4_print_token) [DEBUG_INPUT]: Update.
2053 * m4/macro.c (expand_argument): Collect composite arguments.
2054 (collect_arguments): Update new field.
2055 (expand_macro): Reduce ref-count of back-references after use.
2056 (arg_mark, m4_arg_symbol, m4_make_argv_ref): Adjust to new member
2058 (m4_is_arg_text): Also recognize composite symbols as text.
2059 (m4_arg_text, m4_arg_len): Merge composite symbols as needed.
2060 (m4_arg_equal): Compare composite symbols.
2061 (m4_push_arg, m4_push_args): Handle composite symbols.
2062 (m4_arg_symbol): Relax assertion.
2063 (process_macro): Use single-argument references.
2064 * m4/output.c (m4_shipout_string_trunc): Update comment.
2065 * tests/macros.at (Rescanning macros): Augment test.
2067 2008-01-16 Eric Blake <ebb9@byu.net>
2069 Stage 10: avoid extra copying of strings and comments.
2070 When collecting tokens that are immune to further expansion, avoid
2071 copying data from one obstack to another by outputting it into the
2072 destination obstack to begin with. Also reduce copying done in
2074 Memory impact: slight improvement, due to better obstack usage.
2075 Speed impact: noticeable improvement, due less data copying.
2076 * ltdl/m4/gnulib-cache.m4: Import intprops and vasnprintf-posix
2078 * m4/m4private.h (m4__token_type): Adjust prototype.
2079 * m4/input.c (m4__next_token): Support new parameter.
2080 * m4/macro.c (m4_macro_expand_input, expand_token)
2081 (expand_argument, collect_arguments): Adjust callers.
2082 * modules/m4.c (ntoa): Tighten buffer size.
2083 * m4/output.c (m4_tmpname): Guarantee no buffer overflow.
2084 * modules/format.c (arg_int, arg_long, arg_double): New helper
2085 functions, to detect overflow or unparsed characters.
2086 (ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Adjust to check for
2087 missing or excess arguments.
2088 (format): Likewise, and also output directly into obstack if there
2090 * doc/m4.texinfo (History): Update for new year.
2091 (Format): Test for new warnings.
2093 2008-01-15 Eric Blake <ebb9@byu.net>
2095 * TODO: Update with some newer URLs.
2097 Verify linear `index'.
2098 * tests/builtins.at (index): New test.
2099 (translit): Make test take longer, to make quadratic algorithms
2102 2007-12-20 Eric Blake <ebb9@byu.net>
2104 Stage 9: share rather than copy single-arg refs.
2105 Use hooks of previous patch to create back-references to arguments
2106 in the input engine, and inline short text rather than always
2107 creating a FIFO link. Also start testing embedded NUL behavior.
2108 Until the argument collection engine also shares references, the
2109 memory usage increases.
2110 Memory impact: noticeable penalty, due to longer life of argv
2111 changing O(n) to O(n^2) on boxed recursion.
2112 Speed impact: slight improvement, due less data copying.
2113 * ltdl/m4/gnulib-cache.m4: Import memmem and quote modules.
2114 * m4/m4module.h (m4_arg_scratch): New prototype.
2115 * m4/m4private.h (m4__push_symbol): Add parameter.
2116 (m4_arg_scratch): Add fast accessor.
2117 (struct m4): Add expansion_level member, taken...
2118 * m4/macro.c (expansion_level): ...from here. Adjust all users.
2119 (expand_argument): Minor cleanup.
2120 (expand_macro): Track scratch space per macro call.
2121 (m4_arg_scratch): New function.
2122 (m4_make_argv_ref): Call new function.
2123 (m4_push_arg): Push reference to $0.
2124 (m4_push_args): Rework separator usage, since separators will
2126 (process_macro): Allow embedded NUL.
2127 * m4/input.c (INPUT_INLINE_THRESHOLD): New define.
2128 (m4__push_symbol): Add parameter. Inline short strings, and save
2129 references through rescanning.
2130 * m4/symtab.c (m4_set_symbol_value_text): Weaken assertion.
2131 * modules/m4.c (errprint, index): Handle NUL transparently.
2132 (dumpdef, translit): Use scratch space, rather than expansion
2134 * modules/gnu.c (renamesyms, m4symbols): Likewise.
2135 * tests/others.at (nul character): New test.
2136 (iso8859): Quote absolute file name, remove XFAIL.
2137 * tests/iso8859.m4: Avoid raw NUL in output.
2138 * tests/null.m4: New file.
2139 * tests/null.out: Likewise.
2140 * tests/null.err: Likewise.
2141 * Makefile.am (OTHER_FILES): Distribute new files.
2142 * .gitattributes: Treat new files as text.
2144 2007-12-17 Eric Blake <ebb9@byu.net>
2146 Stage 8: extend life of references into argv.
2147 Add hooks to lengthen the lifetime of arguments reused in a macro
2148 expansion, rather than always discarding arguments at the end of
2149 expand_macro. Rework the expand_macro obstacks to handle longer
2150 lifetimes. For now, the hooks remain unused.
2151 Memory impact: slight penalty, due to larger structs.
2152 Speed impact: slight penalty, due to more bookkeeping.
2153 * m4/system_.h (obstack_regrow): Delete.
2154 * m4/m4private.h (struct m4_symbol_chain): Add level field.
2155 (m4__push_symbol): Adjust prototype.
2156 (m4__adjust_refcount): New prototype.
2157 (DEBUG_MACRO) [DEBUG]: New debug control.
2158 (struct m4__macro_arg_stacks): New structure.
2159 (struct m4): Add arg_stacks, stacks_count fields.
2160 * m4/m4module.h (m4_make_argv_ref): Add parameter.
2161 * m4/macro.c (argc_stack, argv_stack): Delete, replaced by
2162 context->arg_stacks.
2163 (m4_macro_expand_input) [DEBUG_MACRO]: Add debug hooks,
2164 conditional on M4_DEBUG_MACRO envvar.
2165 (collect_arguments): Adjust signature.
2166 (expand_macro): Rework obstack handling.
2167 (m4__adjust_refcount, arg_mark): New functions.
2168 (m4_make_argv_ref): Populate new field.
2169 (m4_push_arg, m4_push_args): Track inuse.
2170 (process_macro): One less cast.
2171 * m4/m4.c (m4_delete): Clean up arg_stacks.
2172 * m4/input.c (make_text_link): Use new field.
2173 (m4__push_symbol, file_clean): Update signature.
2174 (composite_read): Bump refcount when done with reference.
2175 (composite_clean): New function.
2176 (pop_input): Adjust caller.
2177 * m4/debug.c (m4_debug_message): Make assertion match comment.
2178 * modules/gnu.c (builtin, indir): Adjust callers.
2179 * tests/builtins.at (ifelse): New test.
2180 (exp): Move and rename...
2181 * tests/others.at (countdown): ...to this.
2182 * doc/m4.texinfo (Improved foreach): Fix tracing usage in
2185 2007-12-13 Eric Blake <ebb9@byu.net>
2188 * doc/m4.texinfo (Inhibiting Invocation): Missed one instance in
2193 2007-12-13 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2195 * doc/m4.texinfo (Inhibiting Invocation): Fix quoting of a quoting
2197 Reported by Giovanni Toffetti.
2199 2007-12-11 Eric Blake <ebb9@byu.net>
2201 Stage 7: use chained input support in input parser.
2202 Allow the LIFO input engine to rescan a macro expansion composed
2203 of smaller chunks of FIFO data, rather than the old approach of a
2204 monolithic string. For now, all chunks are still copied.
2205 Memory impact: slight penalty, due to FIFO chain overhead.
2206 Speed impact: slight penalty, due to extra bookkeeping.
2207 * m4/m4private.h (m4__push_symbol): New prototype.
2208 (struct m4_symbol_chain): Add const-safety.
2209 * m4/symtab.c (m4_symbol_value_print): Simplify.
2210 (dump_symbol_CB): Update caller.
2211 * m4/input.c (struct m4_input_block): Alter u_c member, first
2212 introduced 2006-10-25, but unused until now.
2213 (composite_peek, composite_read, composite_unget)
2214 (composite_print, init_builtin_token): Rewrite accordingly.
2215 (m4_push_wrapup): No longer need trailing NUL.
2216 (m4__push_symbol, make_text_link): New functions.
2217 (m4_push_string_finish): Use them.
2218 * m4/macro.c (m4_push_arg, m4_push_args): Likewise.
2219 (expand_macro): Simplify logic of nesting_limit.
2220 * src/main.c (main): Likewise.
2221 * doc/m4.texinfo (Dumpdef): Augment test.
2223 2007-12-08 Eric Blake <ebb9@byu.net>
2225 Stage 6: convert builtins to push arg at a time.
2226 Add new methods to factor all builtins whose expansion includes an
2227 argument, making back-reference creation easier in future patches.
2228 Factor out length-limited printing to obstacks, and use -1 rather
2229 than 0 for unlimited length.
2230 Memory impact: none.
2231 Speed impact: slight improvement, due to better code sharing.
2232 * m4/m4module.h (m4_shipout_text): Rename...
2233 (m4_divert_text): ...to this, to avoid confusion with m4_shipout_*
2234 that does not worry about sync lines.
2235 (m4_shipout_string_trunc): New prototype.
2236 * m4/output.c (m4_shipout_text): Rename...
2237 (m4_divert_text): ...to this.
2238 (m4_shipout_string): Move guts...
2239 (m4_shipout_string_trunc): ...to this new function.
2240 * m4/macro.c (m4_push_arg, m4_push_args): New functions.
2241 (expand_token, process_macro): Update callers.
2242 * m4/input.c (string_print): Likewise.
2243 * modules/m4.c (ifdef, ifelse, shift, substr, translit, divert):
2245 * modules/gnu.c (patsubst): Likewise.
2246 (debuglen): Use SIZE_MAX for unlimited debug length.
2247 * src/main.c (main): Likewise.
2248 * m4/m4.c (m4_create): Default max_debug_length to SIZE_MAX, not
2251 2007-12-07 Eric Blake <ebb9@byu.net>
2253 Minor security fix: Quote output of mkstemp.
2254 * modules/m4.c (m4_make_temp): Produce quoted output.
2255 * doc/m4.texinfo (Mkstemp, Mkdtemp): Update the documentation and
2258 Stage 5: add notion of quote age.
2259 Cache the quoting rules that were in effect when a string was
2260 parsed, to avoid reparsing that string if no changequote or other
2261 quote age change took place in the meantime. A quote_age of 0 is
2262 always safe, but does not benefit from caching.
2263 Memory impact: slight improvement, due to smaller struct in input
2265 Speed impact: slight penalty, due to more bookkeeping.
2266 * m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
2267 (m4_set_symbol_value_text): Adjust prototype.
2268 (m4_has_syntax): Factor out the unsigned char cast.
2269 * m4/m4private.h (struct m4_syntax_table): Add syntax_age and
2271 (m4__quote_age, m4__safe_quotes): New accessor macros, no need for
2272 functions at this point.
2273 (struct m4_symbol_value, struct m4_macro_args): Add quote_age
2275 (m4_set_symbol_value_text): Adjust fast accessor.
2276 (m4_get_symbol_value_quote_age): New fast accessor.
2277 * m4/symtab.c (m4_set_symbol_value_text): Add parameter.
2278 (m4_get_symbol_value_quote_age): New function.
2279 (m4_symbol_value_copy): Adjust callers.
2280 * m4/macro.c (expand_token): Add parameter, and track quote age.
2281 (expand_argument, collect_arguments): Track quote age.
2282 (m4_macro_expand_input, process_macro, m4_make_argv_ref)
2283 (m4_macro_expand_input): Update callers.
2284 (m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
2285 * m4/input.c: Comment cleanups.
2286 (struct m4_input_block): Reduce size.
2287 (m4__next_token): Report quote age.
2288 (m4_push_builtin, init_builtin_token): Update callers.
2289 * m4/utility.c (skip_space): Adjust callers.
2290 * m4/module.c (install_macro_table): Likewise.
2291 * m4/syntax.c (m4_set_syntax): Initialize and update quote age.
2292 (m4_set_quotes, m4_set_comment): Detect no-op changes, and update
2294 (set_quote_age): New helper function.
2295 (check_is_single_quotes, check_is_single_comments): Adjust
2297 * src/freeze.c (reload_frozen_state): Likewise.
2298 * src/main.c (main): Likewise.
2299 * modules/m4.c (define, pushdef): No need to set macro text.
2300 * tests/builtins.at (changequote, defn): New tests.
2301 * examples/wrapfifo.m4: New file.
2302 * examples/wraplifo.m4: New file.
2303 * Makefile.am (dist_pkgdata_DATA): Distribute new examples.
2305 2007-12-04 Eric Blake <ebb9@byu.net>
2307 Fix builds with OpenBSD make.
2308 * Makefile.am (HELP2MAN): New macro.
2309 (dist_man_MANS, doc/m4.1): Fix rules for building m4.1 into
2311 * README: Update copyright.
2312 * HACKING: Mention help2man and makeinfo dependencies.
2314 2007-11-29 Eric Blake <ebb9@byu.net>
2316 Stage 4: route indir, builtin through ref; make argv opaque.
2317 Finish making struct opaque to all but the input engine, by
2318 reworking obstack usage in expand_macro to better support creation
2319 of a $@ reference. Canonicalize the empty argument, to allow
2320 pointer comparison optimizations.
2321 Memory impact: slight penalty, due to larger struct.
2322 Speed impact: slight improvement, due to fewer function calls.
2323 * m4/system_.h (obstack_regrow): Fix precedence.
2324 * m4/m4module.h (m4_arg_equal, m4_arg_empty, m4_make_argv_ref):
2326 (struct m4_macro_args): Move...
2327 * m4/m4private.h (struct m4_macro_args): ...here, making it opaque
2328 to modules. Add has_ref member.
2329 (bool_bitfield): New helper typedef.
2330 (struct m4_symbol_chain): Add flatten and len members.
2331 * m4/macro.c (empty_symbol): New placeholder, for optimizing
2332 comparison with empty string.
2333 (m4_macro_expand_input): Initialize it.
2334 (collect_arguments): Alter signature, and populate new fields.
2335 (trace_pre, trace_post): Remove redundant parameter.
2336 (expand_macro): Alter handling of obstacks.
2337 (m4_arg_symbol): Account for wrapped argv.
2338 (m4_arg_equal, m4_arg_empty, m4_make_argv_ref): New methods.
2339 (m4_arg_text, m4_arg_len, m4_arg_func): Use new methods.
2340 * modules/m4.c (ifelse, syscmd): Likewise.
2341 * modules/evalparse.c (m4_evaluate): Likewise.
2342 (undefine, popdef, m4_dump_symbols): Optimize.
2343 * modules/gnu.c (builtin, indir, esyscmd, debugfile): Use new
2345 (changesyntax, regexp): Optimize.
2346 * m4/output.c (diversion_storage): Use typedef.
2348 Stage 3b: cache length, rather than computing it, in modules.
2349 Use cached token length in builtins and output engine.
2350 Memory impact: none.
2351 Speed impact: noticeable improvement, due to fewer function calls.
2352 * m4/hash.c (m4_hash_remove): Avoid double free on remove
2354 * m4/output.c (m4_shipout_string): Change semantics of len param.
2355 (m4_shipout_int): Use cached length.
2356 * m4/input.c (m4_push_string_finish): Likewise.
2357 * modules/m4.h (m4_make_temp_func): Add parameter.
2358 * m4/macro.c (expand_token, m4_arg_len): Use cached length.
2359 (collect_arguments, expand_macro): Alter signature.
2360 (trace_format): Don't use out-of-scope buffer.
2361 (process_macro): All callers changed.
2362 * m4/utility.c (m4_dump_args): Likewise.
2363 * m4/symtab.c (m4_symbol_value_print): Likewise.
2364 * modules/gnu.c (__file__, __program__, builtin, indir)
2365 (m4symbols, mkdtemp, regexp_compile, regexp_substitute,
2366 renamesyms, patsubst, regexp, regexp_compile): Likewise.
2367 * modules/load.c (m4modules): Likewise.
2368 * modules/m4.c (defn, m4wrap, maketemp, m4_make_temp)
2369 (numb_obstack, ifdef, ifelse, divert, len, substr): Likewise.
2370 * modules/perl.c (perleval): Likewise.
2371 * modules/stdlib.c (getcwd, getenv, getlogin, getpwnam, getpwuid)
2372 (hostname, uname, setenv): Likewise.
2373 * modules/mpeval.c (numb_obstack): Likewise.
2374 * src/freeze.c (dump_symbol_CB): Likewise.
2375 * doc/m4.texinfo (Renamesyms, Dumpdef, Changesyntax): Adjust test.
2376 * tests/builtins.at (mkstemp): Likewise.
2377 * tests/others.at (iso8859): XFAIL this test, now that
2378 length-based handling allows NUL through part but not all of M4.
2380 2007-11-28 Eric Blake <ebb9@byu.net>
2382 Stage 3a: cache length, rather than computing it, in libm4.
2383 Cache the length of a token in the input engine and symbol table,
2384 to avoid repeating lots of strlen calls. Additionally, by using
2385 obstack length rather than strlen, the input engine can now
2386 support embedded NUL.
2387 Memory impact: slight penalty, due to larger struct.
2388 Speed impact: slight improvement, due to fewer function calls.
2389 * m4/m4module.h (struct m4_macro_args): Cache length.
2390 (m4_get_symbol_len, m4_get_symbol_value_len): New accessors.
2391 (m4_set_symbol_value_text): Change signature.
2392 * m4/m4private.h (struct m4_symbol_value): Store string length.
2393 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2394 (m4_set_symbol_value_placeholder): Update accordingly.
2395 (m4_set_symbol_value_text): Change signature.
2396 (m4_get_symbol_value_len): New accessor.
2397 * m4/input.c (struct m4_input_block, string_peek, string_read)
2398 (string_unget, string_print, m4_push_string_finish)
2399 (m4_push_wrapup): Track length of string input.
2400 (m4__next_token): Adjust all users of symbol text to track length,
2402 * m4/macro.c (expand_argument, collect_arguments): Likewise.
2403 * m4/module.c (install_macro_table): Likewise.
2404 * modules/gnu.c (builtin, indir): Likewise.
2405 * modules/m4.c (define, pushdef): Likewise.
2406 * src/main.c (main): Likewise.
2407 * src/freeze.c (reload_frozen_state): Likewise.
2408 * m4/symtab.c (m4_symbol_value_copy): Likewise.
2409 (m4_get_symbol_value_len): New function.
2410 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
2411 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
2412 Adjust implementation.
2414 2007-11-27 Eric Blake <ebb9@byu.net>
2416 Stage 2: use accessors, not direct reference, into argv.
2417 Outside of macro.c, use accessor methods rather than direct access
2418 into the argv struct.
2419 Memory impact: none.
2420 Speed impact: slight penalty, due to increased function calls.
2421 * m4/m4private.h (m4_arg_argc): New fast accessor.
2422 * m4/m4module.h (m4_arg_argc, m4_arg_symbol, m4_is_arg_text)
2423 (m4_is_arg_func, m4_arg_text, m4_arg_len, m4_arg_func): New
2425 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2426 (m4_macro_call): Make argc unsigned.
2427 (M4ARG): Use new accessors.
2428 * modules/m4.c (define, pushdef): Likewise.
2429 (undefine, popdef, ifelse, m4_dump_symbols, defn, undivert)
2430 (traceon, traceoff): Make argc unsigned.
2431 * modules/m4.h (m4_dump_symbols_func): Likewise.
2432 * modules/evalparse.c (m4_evaluate): Likewise.
2433 * modules/gnu.c (builtin, indir): Use new accessors.
2434 (changesyntax): Make argc unsigned.
2435 * modules/perl.c (perleval): Likewise.
2436 * m4/utility.c (m4_dump_args): Use new accessors.
2437 * m4/macro.c (trace_pre): Likewise.
2438 (m4_arg_symbol, m4_arg_argc, m4_is_arg_text, m4_is_arg_func)
2439 (m4_arg_text, m4_arg_len, m4_arg_func): New functions.
2440 (expand_macro, trace_pre, trace_post, m4_macro_call): Update argc
2443 2007-11-24 Eric Blake <ebb9@byu.net>
2445 Stage 1: convert m4_symbol_value** into new object.
2446 Pass a variable-size wrapper structure instead of an array to
2447 builtins, so that subsequent optimizations in the structure need
2448 not impact every builtin client.
2449 Memory impact: slight penalty, since struct is larger than array.
2450 Speed impact: slight penalty, due to increased bookkeeping.
2451 * ltdl/m4/gnulib-cache.m4: Import flexmember module.
2452 * m4/m4module.h (m4_macro_args): New type, will be opaque to
2454 (m4_builtin_func, M4BUILTIN, M4BUILTIN_HANDLER, m4_dump_args)
2455 (m4_macro_call): Alter signature to use m4_macro_args object.
2456 (M4ARG): Redefine to access new struct.
2457 * m4/m4private.h (M4_SYMBOL_COMP): New enumerator.
2458 (struct m4_symbol_chain): New type.
2459 (struct m4_symbol_value): Add chain alternative.
2460 * m4/macro.c (collect_arguments): Build new struct.
2461 (expand_macro, m4_macro_call, process_macro, trace_pre)
2462 (trace_post): Adjust implementation to use it.
2463 * m4/utility.c (m4_dump_args): Likewise.
2464 * modules/gnu.c (builtin, indir): Likewise.
2465 * modules/format.c (format): Likewise.
2466 * modules/m4.h (m4_dump_symbols_func): Likewise.
2467 * modules/m4.c (m4_dump_symbols, define, pushdef, defn, ifelse)
2468 (shift, include, errprint, m4wrap): Likewise.
2469 * modules/evalparse.c (m4_evaluate): Likewise.
2471 Pass only macro name to utility functions.
2472 * m4/m4module.h (m4_bad_argc, m4_numeric_arg): Adjust signature.
2473 * m4/utility.c (m4_bad_argc, m4_numeric_arg): Adjust
2475 * m4/macro.c (m4_macro_call): Adjust callers.
2476 * modules/gnu.c (builtin, debuglen): Likewise.
2477 * modules/m4.c (ifelse, incr, decr, divert, undivert, m4exit)
2479 * modules/evalparse.c (m4_evaluate): Likewise.
2480 * modules/stdlib.c (setenv, getpwuid, srand): Likewise.
2481 * modules/time.c (ctime, gmtime, localtime, mktime, strftime):
2484 2007-11-23 Eric Blake <ebb9@byu.net>
2486 Add macro name to debugfile messages.
2487 * m4/m4module.h (m4_debug_set_output): Add parameter.
2488 * m4/debug.c (m4_debug_set_output, set_debug_file): Pass macro
2490 * modules/gnu.c (debugfile): Adjust caller.
2491 * modules/m4.c (m4exit): Likewise.
2492 * src/main.c (main): Likewise.
2494 Factor out handling of macro name in error messages.
2495 * m4/m4module.h (m4_error, m4_error_at_line, m4_warn)
2496 (m4_warn_at_line): Add new parameter.
2497 * m4/utility.c (m4_verror_at_line): New helper method.
2498 (m4_error, m4_error_at_line, m4_warn, m4_warn_at_line): Add new
2500 (m4_bad_argc, m4_numeric_arg, m4_parse_truth_arg): All callers
2502 * m4/debug.c: Likewise.
2503 * m4/input.c: Likewise.
2504 * m4/macro.c: Likewise.
2505 * m4/module.c: Likewise.
2506 * m4/output.c: Likewise.
2507 * m4/path.c: Likewise.
2508 * modules/evalparse.c: Likewise.
2509 * modules/format.c: Likewise.
2510 * modules/gnu.c: Likewise.
2511 * modules/load.c: Likewise.
2512 * modules/m4.c: Likewise.
2513 * modules/mpeval.c: Likewise.
2514 * src/freeze.c: Likewise.
2515 * src/main.c: Likewise.
2517 2007-11-14 Eric Blake <ebb9@byu.net>
2519 Handle some defn corner cases differently.
2520 * doc/m4.texinfo (Defn): Update documentation; although this still
2521 doesn't match the branch, since it may be changed before 2.0.
2522 * m4/macro.c (expand_argument): Consistently ignore builtins in
2523 concatenation contexts.
2524 * m4/m4private.h (m4__symbol_type): Fix C89 compliance bug.
2526 2007-11-13 Eric Blake <ebb9@byu.net>
2528 Note: Patches titled Stage 0 through N form a series of patches
2529 which decreases the algorithmic complexity of tail recursion in
2530 macro expansions from O(n^2) to O(n) in both time and memory, then
2531 performs cleanups, such as handling of embedded NUL, made easier
2532 by the code refactoring.
2534 Stage 0: Fix memory leak in tail recursion.
2535 Free expansion text in the input engine as soon as it is parsed,
2536 rather than when the recursive expansion completes.
2537 Memory impact: noticeable improvement, due to reduction from
2538 O(n^2) to O(n) on recursion.
2539 Speed impact: minor improvement, due to better memory usage.
2540 * m4/input.c (pop_input): Add flag parameter and return type.
2541 (next_char): Adjust caller.
2542 (m4_push_string_init): Let go of memory earlier.
2544 2007-11-07 Eric Blake <ebb9@byu.net>
2546 * tests/macros.at (Rescanning macros): Test more corner cases.
2548 2007-11-06 Eric Blake <ebb9@byu.net>
2550 * build-aux/mkstamp: Rename from ltdl/config/mkstamp.
2552 * Makefile.am (tests/package.m4): Work around bash bug.
2553 Reported by Ralf Wildenhues.
2555 2007-11-05 Eric Blake <ebb9@byu.net>
2557 For consistency with other GNU projects, use build-aux directory.
2558 * configure.ac (AC_CONFIG_AUX_DIR): Change ltdl/config to
2560 * bootstrap (config_aux_dir): Likewise.
2561 * Makefile.am (config_aux_dir): Likewise.
2562 * ltdl/m4/gnulib-cache.m4: Use --aux-dir option.
2564 2007-11-02 Eric Blake <ebb9@byu.net>
2566 Update some documentation about version control.
2567 * NEWS: M4 is now stored in git.
2568 * HACKING: Likewise.
2570 * bootstrap: Likewise.
2571 * commit: Delete, now that CVS commits are no longer necessary.
2572 * ltdl/config/mailnotify: No longer necessary; git's patch
2573 generation and mail capability is more powerful.
2575 Update to recent gnulib changes.
2576 * ltdl/m4/gnulib-cache.m4: Replace fprintf-posix, vasprintf-posix,
2577 xprintf, and xvasprintf with xprintf-posix and xvasprintf-posix.
2579 2007-11-01 Eric Blake <ebb9@byu.net>
2581 Improve error message when early end of file occurs.
2582 * doc/m4.texinfo (Macro Arguments, Changequote, Changecom)
2583 (M4wrap): Adjust to new messages.
2584 (Improved capitalize): Enhance test.
2585 * m4/m4private.h (m4__next_token): Adjust prototype.
2586 * m4/input.c (m4__next_token): Add new parameter, and improve
2588 * m4/macro.c (m4_macro_expand_input, collect_arguments): Adjust
2590 (expand_argument): Likewise, and add parameter.
2592 2007-10-31 Eric Blake <ebb9@byu.net>
2594 Test more corner cases.
2595 * tests/macros.at (Rescanning macros): Beef up test.
2596 * doc/m4.texinfo (Changecom): Beef up test.
2597 (Improved foreach): Document alternate foreachq style.
2598 * examples/foreachq3.m4: New file.
2599 * examples/loop.m4: New file.
2600 * Makefile.am (dist_pkgdata_DATA): Distribute them.
2602 2007-10-28 Eric Blake <ebb9@byu.net>
2604 More test coverage for autoconf usage patterns.
2605 * doc/m4.texinfo (Shift): Document cond macro, and add new test.
2606 * tests/macros.at (Rescanning macros): New test.
2607 * tests/builtins.at (include): Augment test.
2609 2007-10-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2611 * Makefile.am: Adjust getopt handling to latest gnulib layout.
2613 2007-10-27 Eric Blake <ebb9@byu.net>
2615 Document one use of changequote(`(',`)').
2616 * doc/m4.texinfo (Changequote): Add new test, based on recent
2617 autoconf addition of m4_expand.
2619 2007-10-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2621 * Makefile.am (dist_pkgdata_DATA): Add examples/capitalize2.m4.
2623 2007-10-22 Eric Blake <ebb9@byu.net>
2625 Never let printf failures go undetected.
2626 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
2628 * m4/system_.h: Include xprintf.h.
2629 * m4/debug.c (m4_debug_message_prefix, m4_debug_message): Wrap all
2630 use of printf, xprintf.
2631 * m4/input.c [DEBUG_INPUT]: Likewise.
2632 * m4/module.c [DEBUG_MODULES]: Likewise.
2633 * m4/output.c (m4_shipout_text, m4_shipout_int)
2634 (m4_freeze_diversions): Likewise.
2635 * m4/path.c [DEBUG_INCL]: Likewise.
2636 * m4/symtab.c [DEBUG_SYM]: Likewise.
2637 * m4/syntax.c [DEBUG_SYNTAX]: Likewise.
2638 * modules/modtest.c (export_test): Likewise.
2639 * src/freeze.c (produce_resyntax_dump, produce_syntax_dump)
2640 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
2642 * src/main.c (usage): Likewise.
2643 * po/POTFILES.in: Adjust to new file.
2644 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
2646 2007-10-18 Eric Blake <ebb9@byu.net>
2648 Fix 'm4 -F file -t undefined'.
2649 * src/freeze.c (produce_symbol_dump): Skip trace placeholders.
2650 * src/freeze.c (dump_symbol_CB): Also skip void symbols.
2651 * tests/freeze.at (reloading unknown builtin): Test for this bug.
2652 * m4/m4module.h (m4_symtab_apply): Add parameter.
2653 * m4/symtab.c (m4_symtab_apply): Ignore trace placeholders when
2655 (m4_symtab_delete, symtab_dump): Adjust callers.
2656 * modules/m4.c (m4_dump_symbols): Likewise.
2658 2007-10-09 Eric Blake <ebb9@byu.net>
2660 Fix regexp regression of 2007-09-29.
2661 * modules/gnu.c (substitute): Allow NULL buf when no
2662 subexpressions were present.
2663 (regexp): Handle \ escapes even with empty regex.
2664 * doc/m4.texinfo (Regexp, Patsubst): Catch this bug.
2666 Cache regex compilation for another autoconf speedup.
2667 * modules/gnu.c (gnu_buf): Replace...
2668 (REGEX_CACHE_SIZE, regex_cache): ...with new declarations.
2669 (m4_pattern_buffer): Add fields.
2670 (m4_regexp_compile): Rename...
2671 (regexp_compile): ...to this, and drop no_sub parameter.
2673 (M4FINISH_HANDLER): Clean up entire cache.
2674 (m4_regexp_search): Rename...
2675 (regex_search): ...to this, adjust to new struct contents, and add
2677 (m4_regexp_substitute): Rename...
2678 (regexp_substitute): ...to this.
2679 (substitute, patsubst, regexp, renamesyms): Adjust callers.
2681 2007-10-02 Eric Blake <ebb9@byu.net>
2683 Document quoting pitfalls in capitalize.
2684 * doc/m4.texinfo (Patsubst): Use the examples directory. Also
2686 (Improved capitalize): New node.
2687 * examples/capitalize.m4: Update to match manual.
2688 * examples/capitalize2.m4: New file.
2690 2007-10-01 Eric Blake <ebb9@byu.net>
2692 Another Autoconf usage pattern optimization.
2693 * modules/m4.c (m4_index): Optimize search for one byte.
2694 * doc/m4.texinfo (Index macro, Regexp, Patsubst): Test the new
2697 2007-09-29 Eric Blake <ebb9@byu.net>
2699 Optimize for Autoconf usage pattern.
2700 * modules/gnu.c (regexp, patsubst): Handle empty regex faster.
2702 * tests/testsuite.at (AT_CHECK_M4): Slight optimization.
2704 2007-09-24 Eric Blake <ebb9@byu.net>
2706 Create .gitignore alongside .cvsignore.
2707 * bootstrap (version control): Update to reflect git usage.
2709 2007-09-13 Eric Blake <ebb9@byu.net>
2711 * AUTHORS: Fix typo.
2713 2007-09-12 Gary V. Vaughan <gary@gnu.org>
2715 Be consistent about using 'module' for m4_module types and
2716 'handle' for lt_dlhandle types:
2718 * m4/m4private.h (m4_symbol_value): Rename handle element to
2719 method. Changed all references.
2720 (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
2721 SYMBOL_HANDLE respectively. Changed all references.
2722 * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
2723 * m4/builtin.c (m4_builtin_find_by_name)
2724 (m4_builtin_find_by_func): Use module as the parameter name for
2725 pointers of type 'm4_module'.
2726 * m4/module.c (module_remove, m4_get_module_name)
2727 (install_builtin_table, install_macro_table)
2728 (m4_module_make_resident, m4__module_next, m4_module_refcount):
2730 * src/freeze.c (produce_module_dump): Ditto.
2731 * m4/input.c (m4_input_block): Rename handle element to method.
2732 Changed all references.
2733 * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
2734 * modules/load.c: Use module as the variable name for pointers
2735 of type 'm4_module'.
2736 * modules/m4.c: Ditto.
2737 * modules/perl.c: Ditto.
2738 * modules/shadow.c: Ditto.
2740 2007-09-07 Eric Blake <ebb9@byu.net>
2742 Add refcount builtin.
2743 * modules/load.c (refcount): New builtin.
2744 (m4modules): Use correct type.
2745 * doc/m4.texinfo (Refcount): New section.
2746 * m4/m4private.h (struct m4_module): Add refcount member.
2747 (m4_module_refcount) [NDEBUG]: Add faster accessor macro.
2748 * m4/module.c (m4_module_load): Add symbols to table on first
2749 load by m4, regardless of other libltdl loads of same module.
2750 (m4_module_refcount): Use new struct member, rather than relying
2751 on libltdl count which might be inflated by unrelated loads.
2752 (m4__module_interface): Optimize.
2753 (m4__module_next, m4__module_find): Avoid assertions that could
2754 trigger with unrelated libltdl loads.
2755 (m4__module_open): Track m4 load count.
2756 (m4__module_exit): Only unload what m4 loaded.
2757 (module_remove): Track m4 unloads.
2758 * NEWS: Document new builtin.
2760 More conversion to m4_module*.
2761 * src/freeze.c (produce_module_dump, dump_symbol_CB)
2762 (reload_frozen_state): Use correct type.
2763 * m4/input.c (struct m4_input_block): Likewise.
2764 * m4/symtab.c (dump_symbol_CB): Likewise.
2766 * AUTHORS: Simplify, to match libtool and autoconf layout.
2767 * THANKS: Sync with branch.
2769 2007-09-06 Eric Blake <ebb9@byu.net>
2771 Wrap lt_dlhandle in struct m4_module.
2772 * m4/m4module.h (includes): No longer require clients to know
2774 (m4_module): New opaque declaration.
2775 (m4_export): Delete unused type.
2776 (M4INIT_HANDLER, M4FINISH_HANDLER, m4_module_init_func)
2777 (m4_module_finish_func, m4_module_load, m4_get_module_name)
2778 (m4_builtin_find_by_name, m4_builtin_find_by_func): Use new
2780 (m4_module_makeresident, m4_module_refcount): New declarations.
2781 * m4/m4private.h (includes): Move <ltdl.h> here.
2782 (m4_module): New declaration. Simple for now, but intended for
2784 (m4__module_open, m4__module_next, m4__module_find)
2785 (m4__symtab_remove_module_references): Use new wrapper.
2786 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
2788 * m4/module.c (m4_get_module_name, m4_module_import)
2789 (m4_module_load): Likewise.
2790 (install_builtin_table, install_macro_table): Likewise. Also,
2791 change return type since these always returned NULL and no one
2793 (m4_module_makeresident, m4_module_refcount): New functions.
2794 (m4_module_unload, m4__module_next, m4__module_find): Use new
2796 (m4__module_open): Populate new wrapper, and associate it with the
2798 (m4__module_exit): Use new wrapper.
2799 (module_remove): Likewise. Reclaim storage on last use.
2800 (module_close): Delete, and inline into module_remove.
2801 * m4/symtab.c (m4__symtab_remove_module_references): Use new
2803 * modules/load.c (load_init): Use new API.
2804 * modules/m4.c (m4_export_table): Kill unused declaration.
2805 (m4_init): Use new API.
2806 * modules/shadow.c (shadow_init): Use new API.
2807 * src/main.c (main): Adjust callers.
2808 * src/freeze.c (reload_frozen_state): Likewise.
2809 * tests/modules.at (unload load module): New test.
2811 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2813 * bootstrap (ltdl/m4/.cvsignore): Add xstrtol module macros.
2814 * src/m4/.cvsignore: Add xstrtol module sources.
2816 2007-09-03 Gary V. Vaughan <gary@gnu.org>
2818 Work around a bug in darwin's awk:
2820 * bootstrap (func_get_translations): Use $AWK instead of raw
2821 `awk' so that the user can use an alternative implementation
2822 if the first awk in PATH doesn't behave as expected.
2823 (func_get_translations): The first awk script mangles the last
2824 entry passed to it for at least the awk implementation shipped
2825 with Darwin 8.10.1. Capture $3 into a variable too to work-
2826 around that problem.
2828 2007-08-29 Gary V. Vaughan <gary@gnu.org>
2830 As gnulib xstrtol is only used by main, and unconditionally pulls
2831 in a copy of getopt, undo bootstrap change from 2007-08-11 below,
2832 and copy the xstrtol code into src/ so that main() can use it
2833 without pushing the extra code into libm4:
2835 * bootstrap (src_modules): Add getopt and xstrtol modules.
2836 * Makefile.am (src_m4_SOURCES): Add xstrtol sources.
2837 * po/POTFILES.in: Move gnu/xstrtol-error.c to src/xstrtol-error.c.
2839 2007-08-11 Eric Blake <ebb9@byu.net>
2841 Another upstream xstrtol change.
2842 * po/POTFILES.in: Track changes in files containing messages.
2843 * bootstrap (src_modules): getopt is now pulled into libgnu.a, no
2844 need to grab it separately.
2845 * src/main.c (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
2847 (size_opt): Adjust to latest xstrtol interface.
2849 2007-08-10 Eric Blake <ebb9@byu.net>
2851 Documentation improvements.
2852 * doc/m4.texinfo (Defn): Resync with branch.
2853 (Compatibility, Extensions): Sync with branch.
2855 2007-08-07 Eric Blake <ebb9@byu.net>
2857 Adjust to gnulib xstrtol changes.
2858 * src/main.c (size_opt): Adjust signature, so that error strings
2859 are easier to translate.
2860 (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT): New macros
2861 for tracking long options.
2862 (main): Track which long option was used.
2863 * tests/options.at (--debuglen, --nesting-limit): Adjust to change
2865 (deprecated options): Test that --arglength spelling shows up in
2868 2007-08-06 Eric Blake <ebb9@byu.net>
2870 Normalize all GPL license notices.
2871 * m4/COPYING.LIB: Delete - libm4 is not distributed under LGPLv2
2873 * Makefile.am: Update license wording.
2874 * bootstrap: Likewise.
2876 * configure.ac: Likewise.
2877 * ltdl/config/mailnotify: Likewise.
2878 * ltdl/config/mkstamp: Likewise.
2879 * ltdl/m4/debug.m4: Likewise.
2880 * ltdl/m4/gmp.m4: Likewise.
2881 * ltdl/m4/m4-error.m4: Likewise.
2882 * ltdl/m4/m4-getopt.m4: Likewise.
2883 * ltdl/m4/m4-gettext.m4: Likewise.
2884 * ltdl/m4/m4-obstack.m4: Likewise.
2885 * ltdl/m4/m4-regex.m4: Likewise.
2886 * ltdl/m4/stackovf.m4: Likewise.
2887 * m4/builtin.c: Likewise.
2888 * m4/debug.c: Likewise.
2889 * m4/hash.c: Likewise.
2890 * m4/hash.h: Likewise.
2891 * m4/input.c: Likewise.
2892 * m4/m4.c: Likewise.
2893 * m4/m4module.h: Likewise.
2894 * m4/m4private.h: Likewise.
2895 * m4/macro.c: Likewise.
2896 * m4/module.c: Likewise.
2897 * m4/output.c: Likewise.
2898 * m4/path.c: Likewise.
2899 * m4/resyntax.c: Likewise.
2900 * m4/symtab.c: Likewise.
2901 * m4/syntax.c: Likewise.
2902 * m4/system_.h: Likewise.
2903 * m4/utility.c: Likewise.
2904 * modules/evalparse.c: Likewise.
2905 * modules/format.c: Likewise.
2906 * modules/gnu.c: Likewise.
2907 * modules/import.c: Likewise.
2908 * modules/load.c: Likewise.
2909 * modules/m4.c: Likewise.
2910 * modules/m4.h: Likewise.
2911 * modules/modtest.c: Likewise.
2912 * modules/mpeval.c: Likewise.
2913 * modules/perl.c: Likewise.
2914 * modules/shadow.c: Likewise.
2915 * modules/stdlib.c: Likewise.
2916 * modules/time.c: Likewise.
2917 * modules/traditional.c: Likewise.
2918 * po/Makevars: Likewise.
2919 * src/freeze.c: Likewise.
2920 * src/m4.h: Likewise.
2921 * src/main.c: Likewise.
2922 * src/stackovf.c: Likewise.
2923 * tests/builtins.at: Likewise.
2924 * tests/freeze.at: Likewise.
2925 * tests/generate.awk: Likewise.
2926 * tests/m4.in: Likewise.
2927 * tests/macros.at: Likewise.
2928 * tests/modules.at: Likewise.
2929 * tests/options.at: Likewise.
2930 * tests/others.at: Likewise.
2931 * tests/stackovf.test: Likewise.
2932 * tests/testsuite.at: Likewise.
2934 2007-07-22 Eric Blake <ebb9@byu.net>
2936 Fix diversions on NetBSD, when fopen(name,"a+") seeks to end.
2937 * m4/output.c (m4_tmpopen): Explicitly seek to beginning.
2938 * tests/builtins.at (divert): Enhance test to cover this.
2940 Reported by Thomas Klausner.
2942 2007-07-20 Eric Blake <ebb9@byu.net>
2944 Fix 'make distcheck' issues.
2945 * bootstrap: Add more files that might be more up-to-date in
2947 * Makefile.am (EXTRA_DIST): No longer distribute removed diff.
2948 * config/m4/gnulib-cache.m4: Update to latest gnulib.
2950 2007-07-16 Eric Blake <ebb9@byu.net>
2952 * po/POTFILES.in: Track recent translation additions from gnulib
2955 2007-07-14 Eric Blake <ebb9@byu.net>
2957 Reflect upstream license .texi changes.
2958 * doc/m4.texinfo (Copying): Rename node...
2959 (GNU General Public License): ...to this.
2960 (GNU Free Documentation License): Adjust node location.
2961 * local/doc/gpl-3.0.texi.diff: Remove file.
2963 2007-07-10 Eric Blake <ebb9@byu.net>
2965 Upgrade to GPLv3, and document 1.4.10.
2966 * bootstrap: Adjust to GPLv3.
2967 (func_update): Port from branch.
2968 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
2969 --local-dir=local --import gpl-3.0'.
2970 * doc/m4.texinfo (History): Mention 1.4.11.
2971 (Copying This Package): New appendix.
2972 * NEWS: Document 1.4.10.
2973 * local/doc/gpl-3.0.texi.diff: New file.
2974 * Makefile.am: Update license.
2975 (doc_m4_TEXINFOS, EXTRA_DIST): Distribute additions.
2976 * commit: Update license.
2977 * configure.ac: Likewise.
2978 * ltdl/config/mailnotify: Likewise.
2979 * ltdl/config/mkstamp: Likewise.
2980 * ltdl/m4/debug.m4: Likewise.
2981 * ltdl/m4/gmp.m4: Likewise.
2982 * ltdl/m4/m4-error.m4: Likewise.
2983 * ltdl/m4/m4-getopt.m4: Likewise.
2984 * ltdl/m4/m4-gettext.m4: Likewise.
2985 * ltdl/m4/m4-obstack.m4: Likewise.
2986 * ltdl/m4/m4-regex.m4: Likewise.
2987 * ltdl/m4/stackovf.m4: Likewise.
2988 * m4/builtin.c: Likewise.
2989 * m4/debug.c: Likewise.
2990 * m4/hash.c: Likewise.
2991 * m4/hash.h: Likewise.
2992 * m4/input.c: Likewise.
2993 * m4/m4.c: Likewise.
2994 * m4/m4module.h: Likewise.
2995 * m4/m4private.h: Likewise.
2996 * m4/macro.c: Likewise.
2997 * m4/module.c: Likewise.
2998 * m4/output.c: Likewise.
2999 * m4/path.c: Likewise.
3000 * m4/resyntax.c: Likewise.
3001 * m4/symtab.c: Likewise.
3002 * m4/syntax.c: Likewise.
3003 * m4/system_.h: Likewise.
3004 * m4/utility.c: Likewise.
3005 * modules/evalparse.c: Likewise.
3006 * modules/format.c: Likewise.
3007 * modules/gnu.c: Likewise.
3008 * modules/import.c: Likewise.
3009 * modules/load.c: Likewise.
3010 * modules/m4.c: Likewise.
3011 * modules/m4.h: Likewise.
3012 * modules/modtest.c: Likewise.
3013 * modules/mpeval.c: Likewise.
3014 * modules/perl.c: Likewise.
3015 * modules/shadow.c: Likewise.
3016 * modules/stdlib.c: Likewise.
3017 * modules/time.c: Likewise.
3018 * modules/traditional.c: Likewise.
3019 * po/Makevars: Likewise.
3020 * src/freeze.c: Likewise.
3021 * src/m4.h: Likewise.
3022 * src/main.c: Likewise.
3023 * src/stackovf.c: Likewise.
3024 * tests/builtins.at: Likewise.
3025 * tests/freeze.at: Likewise.
3026 * tests/generate.awk: Likewise.
3027 * tests/m4.in: Likewise.
3028 * tests/macros.at: Likewise.
3029 * tests/modules.at: Likewise.
3030 * tests/options.at: Likewise.
3031 * tests/others.at: Likewise.
3032 * tests/stackovf.test: Likewise.
3033 * tests/testsuite.at: Likewise.
3035 2007-07-09 Eric Blake <ebb9@byu.net>
3037 * modules/format.c (format): Avoid undefined behavior with %c.
3039 2007-07-01 Gary V. Vaughan <gary@gnu.org>
3041 The translation project has moved.
3042 * bootstrap (func_get_translations): Use the new translation
3046 2007-06-26 Karl Berry <karl@freefriends.org> (tiny change)
3048 Match Free Software Directory categories.
3049 * doc/m4.texinfo (dircategory): Update.
3051 2007-05-31 Eric Blake <ebb9@byu.net>
3053 Add extension to divert builtin.
3054 * modules/m4.c (builtin_divert): Immediately divert second
3056 * m4/output.c (m4_output_text): Allow 0 length. Fixes regression
3058 (m4_shipout_text): Short-circuit on zero length.
3059 * tests/freeze.at (loading format 2): Expand test to catch
3060 regression. Also check out-of-range version.
3061 * tests/builtins.at (divert): Expand test to check corner cases
3063 * doc/m4.texinfo (Divert): Document the extension.
3065 Reported by Daniel Richard G.
3067 2007-05-30 Eric Blake <ebb9@byu.net>
3069 Port format improvements from branch.
3070 * doc/m4.texinfo (History): Mention upcoming 1.4.10 release.
3071 (Format): Enhance section.
3072 * modules/format.c (format): Accept %'hhd, and issue warnings on
3073 unrecognized specifiers.
3074 * modules/gnu.c (builtin_format): Adjust how format is called.
3076 2007-05-28 Eric Blake <ebb9@byu.net>
3078 * tests/options.at (--syncoutput): Add xfailed test.
3080 Fix sync line interaction with multiline comments.
3081 * doc/m4.texinfo (Preprocessor features): Improve documentation.
3082 (Syncoutput): Improve testsuite.
3083 (Incompatibilities): Add testcase, and document bug.
3084 * src/freeze.c (reload_frozen_state): Don't interfere with
3085 synclines when reloading state.
3086 * m4/input.c (m4__next_token): Report line where multiline tokens
3088 * m4/m4private.h (m4__token_type): Add parameter.
3089 * m4/m4module.h (m4_output_text): Export.
3090 (m4_shipout_text): Add parameter.
3091 * src/macro.c (m4_macro_expand_input, expand_token)
3092 (expand_argument): Adjust callers so that line is passed from
3094 * m4/output.c (output_text): Rename...
3095 (m4_output_text): ...to this, and export.
3096 (m4_insert_file, insert_diversion_helper): Update callers.
3097 (m4_shipout_text): Take new parameter for start line of token.
3098 Output at most one syncline per token.
3099 Reported by Sergey Poznyakoff.
3101 Fix large diversion corner cases.
3102 * tests/freeze.at (large diversion): New test.
3103 * m4/output.c (m4_tmpfile, m4_tmpopen): Simplify use of errno.
3104 (make_room_for): Use NULL, not 0, for pointers.
3105 (m4_freeze_diversions): Allow freezing large diversions.
3106 (insert_diversion_helper): Avoid using rewind.
3108 Also run gnulib unit tests during make check.
3109 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool
3110 --tests-base=tests/gnu --with-tests'.
3111 * configure.ac (AC_CONFIG_FILES): Build tests/gnu testdir.
3112 * Makefile.am (SUBDIRS): Run gnulib tests before ours.
3114 2007-05-25 Eric Blake <ebb9@byu.net>
3116 * m4/system_.h: Include <stdint.h>, for intmax_t.
3118 Reported by Daniel Richard G.
3120 2007-05-24 Eric Blake <ebb9@byu.net>
3122 Provide consistent shift semantics regardless of hardware.
3123 * modules/m4.c (numb_lshift, numb_rshift, numb_urshift): Mask
3125 (number, unumber): Always use [u]intmax_t.
3126 Reported by Gary V. Vaughan.
3128 Support POSIX flush semantics on all platforms.
3129 * modules/m4.c (m4_sysval_flush): Rely on gnulib.
3130 * ltdl/m4/gnulib-cache.m4: Fix typo in previous commit.
3132 Work around cygwin and mingw fseeko bugs.
3133 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3135 * modules/m4.c (m4_sysval_flush): Prefer fseeko over fseek.
3137 2007-04-25 Eric Blake <ebb9@byu.net>
3139 Test that regression in 1.4.9's eval doesn't recur.
3140 * doc/m4.texinfo (Eval): Check negative division.
3143 2007-04-12 Eric Blake <ebb9@byu.net>
3145 Allow for running test in sticky or setgid directory.
3146 * tests/builtins.at (mkdtemp): Adjust test.
3148 Don't test for broken sed too soon.
3149 * tests/others.at (stdin seekable): Rearrange subtests.
3151 Work around 'stdin seekable' shortcoming on glibc.
3152 * ltdl/m4/gnulib-cache.m4: Use closein instead of closeout.
3153 * tests/others.at (stdin closed): Adjust to new output.
3154 * src/main.c (process_file): No need to return anything.
3155 (main): Use close_stdin instead of close_stdout.
3156 Reported by Ralf Wildenhues.
3158 Enable autobuild usage.
3159 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3161 * configure.ac (AB_INIT): Output autobuild information.
3163 2007-04-11 Eric Blake <ebb9@byu.net>
3165 Address testsuite shortcoming in 'stdout full' on glibc.
3166 * tests/others.at (stdout full): Adjust expected output when more
3167 than 1k text is printed to /dev/full.
3168 Reported by Ralf Wildenhues.
3170 2007-04-10 Eric Blake <ebb9@byu.net>
3172 * tests/macros.at (Arity and defn): Fix quoting.
3174 2007-04-09 Eric Blake <ebb9@byu.net>
3176 Address failure of 'seekable stdin' on Mac OS X.
3177 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3180 2007-04-07 Eric Blake <ebb9@byu.net>
3182 Include <config.h> first in all C files, and not in headers.
3183 Fixes regression for --disable-assert builds from 2007-04-02.
3184 * src/m4.h (includes): Don't include config.h here.
3185 * m4/m4private.h (includes): Likewise.
3186 * m4/builtin.c: Include config.h before anything else.
3187 * m4/debug.c: Likewise.
3188 * m4/hash.c: Likewise.
3189 * m4/input.c: Likewise.
3190 * m4/m4.c: Likewise.
3191 * m4/macro.c: Likewise.
3192 * m4/module.c: Likewise.
3193 * m4/symtab.c: Likewise.
3194 * m4/syntax.c: Likewise.
3195 * m4/utility.c: Likewise.
3196 * src/freeze.c: Likewise.
3197 * src/stackovf.c: Likewise.
3199 2007-04-03 Eric Blake <ebb9@byu.net>
3201 * modules/m4.c (numb_ratio, numb_divide, numb_modulo): Avoid
3202 SIGFPE on x86 architectures.
3203 Reported by Ralf Wildenhues.
3205 2007-04-02 Eric Blake <ebb9@byu.net>
3207 Fix warnings from last commit.
3208 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3209 fprintf-posix sprintf-posix'.
3210 * m4/macro.c (expand_macro, trace_format): Use correct specifier
3212 (process_macro): Avoid negative array index.
3213 * src/freeze.c (produce_resyntax_dump, produce_module_dump)
3214 (dump_symbol_CB, produce_frozen_state): Use correct specifier for
3217 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3219 Get rid of the last 'differs in signedness' compiler warnings:
3221 * m4/macro.c (process_macro): m4_get_symbol_value_text() returns
3222 a regular 'char *', so variables to store the return address,
3223 and iterate through it should be regular 'char *' too.
3224 * m4/input.c (m4_input_block): The start and current members of
3225 the string part of this union store regular 'char *' types, so
3226 they should be regular 'char *' types too.
3228 2007-04-02 Gary V. Vaughan <gary@gnu.org>
3230 M4 was designed to have a small number of header files defining
3231 the interfaces to several source files each. Keeping this in
3232 mind allows us to tidy things up considerably. Having done this,
3233 it becomes clear that some of the installed headers reference
3234 other headers which are not installed (but that's another patch):
3236 * m4/m4private.h (stdio--.h, stdlib--.h, unistd--.h): Moved from
3238 * m4/system_.h (gnu/stdio--.h, gnu/stdlib--.h, gnu/unistd--.h):
3239 ...to here, so client modules can benefit too.
3240 (assert.h, errno.h, limits.h, sys/stat.h): Include one here at the
3241 lowest level to save doing it multiple times elsewhere.
3242 * m4/debug.c (stdio.h): Removed. The portable <gnu/stdio--.h>
3243 is already included via m4private.h.
3244 * modules/time.c (stdio.h): Ditto.
3245 * modules/gnu.c (stdlib.h): Ditto resp <gnu/stdlib--.h>.
3246 * modules/stdlib.c (stdlib.h, unistd.h): Ditto resp <gnu/stdlib--.h>
3247 and <gnu/unistd--.h>,
3248 * m4/m4private.h (m4module.h): Use angle brackets for an installed
3250 * m4/hash.h (system.h): Ditto.
3251 * modules/gnu.c (progname.h): Removed.
3252 * src/freeze.c (m4/system.h, m4private.h): Already included vi m4.h.
3253 * m4/m4private.h (assert.h, errno.h): Already included via
3255 * m4/input.c (ctype.h): Ditto.
3256 * m4/module.c (ltdl.h): Ditto.
3257 * m4/output.c (errno.h, limits.h, stdio.h, sys/types.h, sys/stat.h)
3259 * m4/path.c (config.h, stdlib.h): Ditto.
3260 * m4/utility.c (config.h): Ditto.
3261 * modules/evalparse.c (assert.h, ctype.h): Ditto.
3262 * modules/gnu.c (assert.h, ctype.h, errno.h): Ditto.
3263 * modules/import.c (assert.h): Ditto.
3264 * modules/m4.c (assert.h, errno.h): Ditto.
3265 * modules/modtest.c (assert.h): Ditto.
3266 * modules/stdlib.c (sys/types.h): DittAo.
3267 * src/m4.h (ctype.h, errno.h, string.h, sys/types.h, ltdl.h):
3269 * src/stackovf.c (assert.h): Ditto.
3270 * modules/gnu.c (m4/m4module.h, m4private.h): Build using the faster
3271 private interfaces when NDEBUG is defined.
3272 * modules/import.c (m4/m4module.h, m4private.h): Ditto.
3273 * modules/load.c (m4/m4module.h, m4private.h): Ditto.
3274 * modules/m4.c (m4/m4module.h, m4private.h): Ditto.
3275 * modules/modtest.c (m4/m4module.h, m4private.h): Ditto.
3276 * modules/mpeval.c (m4/m4module.h, m4private.h): Ditto.
3277 * modules/perl.c (m4/m4module.h, m4private.h): Ditto.
3278 * modules/shadow.c (m4/m4module.h, m4private.h): Ditto.
3279 * modules/time.c (m4/m4module.h, m4private.h): Ditto.
3280 * modules/traditional.c (m4/m4module.h, m4private.h): Ditto.
3281 * src/m4.h (locale.h): Moved from here...
3282 * src/main.h: ...to here.
3283 (m4private.h): Already included via m4.h.
3284 * src/stackovf.c (m4private.h): Ditto.
3286 2007-03-28 Gary V. Vaughan <gary@gnu.org>
3288 * Makefile.am (stamp-vcl): Removed.
3289 (CONFIG_STATUS_DEPENDENCIES): Depend directly on ChangeLog.
3291 2007-03-28 Eric Blake <ebb9@byu.net>
3293 * src/main.c (usage): Improve note to TRANSLATORS.
3294 * m4/system_.h (EXIT_FAILURE): Reflect gnulib changes.
3296 * tests/builtins.at (__m4_version__): Fix bug when TIMESTAMP is
3299 2007-03-24 Eric Blake <ebb9@byu.net>
3301 * m4/output.c (m4_output_init): Update to latest gnulib.
3302 * bootstrap (ltdl/m4/.cvsignore): No longer track generated
3304 * NEWS: Reflect release of 1.4.9.
3307 2007-03-07 Eric Blake <ebb9@byu.net>
3311 Exercise gnulib's new POSIX *printf modules.
3312 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3314 * modules/format.c (format): Support %a and %A.
3315 * doc/m4.texinfo (Format): Test this addition.
3316 * NEWS: Document this addition.
3318 2007-03-03 Eric Blake <ebb9@byu.net>
3320 * m4/input.c (m4__next_token): Fix synclines when in batch mode.
3321 * doc/m4.texinfo (M4exit): Synch another section.
3322 (Syncoutput): Make similar to other sections.
3324 2007-03-01 Eric Blake <ebb9@byu.net>
3326 * doc/m4.texinfo: Improve the indices.
3327 (Concept index): Rearrange to be last.
3328 (Sysval): Merge from branch.
3330 * doc/m4.texinfo (Syscmd, Esyscmd): Merge more doc sections.
3332 2007-02-28 Eric Blake <ebb9@byu.net>
3334 POSIX XCU ERN 137 was approved.
3335 * modules/mpeval.c (numb_extension): Delete.
3336 * modules/m4.c (numb_extension): Likewise.
3337 * modules/evalparse.c (comma_term, condition_term): Always
3338 implement ?: and , operators.
3339 * m4/symtab.c: Update comment to match reality.
3340 * src/freeze.c (produce_frozen_state, reload_frozen_state): Avoid
3341 dereferencing context directly when accessor exists.
3342 * src/main.c (usage): Prefer GNU_M4 over EMACS.
3343 (struct macro_definition): Rename...
3344 (struct deferred): ...to match usage. All uses changed.
3345 * doc/m4.texinfo (Eval): Document this change.
3346 (Operation modes, Changeresyntax): Fix wording to prefer GNU_M4
3348 (Preprocessor features, Changesyntax): Fix inaccuracies.
3349 * NEWS: Import branch NEWS items for 1.4.x series. Document
3352 POSIX XCU ERN 118 was approved.
3353 * modules/m4.c (define): Kill posixly_correct distinction in
3354 define behavior, since POSIX says GNU behavior complies.
3355 * tests/builtins.at (define): Restore original semantics.
3356 * doc/m4.texinfo (Pushdef): Document portability issues with
3358 (Incompatibilities): Clean up wording of what POSIX requires.
3359 * NEWS: Document this.
3361 2007-02-26 Eric Blake <ebb9@byu.net>
3363 Re-enable clean bootstrap on cygwin.
3364 * Makefile.am (AM_LDFLAGS): For now, export all symbols from
3365 modules, since otherwise we run afoul of current libtool
3366 limitations on cygwin and mingw.
3368 2007-02-25 M. Levinson <levinsm@users.sourceforge.net> (tiny change)
3370 * src/freeze.c (reload_frozen_state): Avoid dereferencing freed
3371 memory. Fixes regression introduced 2007-01-20.
3373 2007-02-25 Eric Blake <ebb9@byu.net>
3375 * tests/freeze.at (loading format 2): Augment test to catch
3376 regression introduced on 2007-01-20.
3378 Reported by M. Levinson.
3380 * m4/system_.h (includes, EXIT_SUCCESS, EXIT_FAILURE): Adjust to
3383 2007-02-05 Eric Blake <ebb9@byu.net>
3385 * tests/options.at (--fatal-warnings): New test.
3386 * tests/others.at (stdin seekable): Exit on error.
3387 * m4/m4private.h (M4_OPT_WARN_EXIT_BIT): New bit.
3388 (m4_get_warnings_exit_opt): Access it.
3389 * m4/m4module.h (m4_context_opt_bit_table): Access it.
3390 * m4/utility.c (m4_error, m4_error_at_line): Only force an exit
3392 (m4_warn, m4_warn_at_line): Change exit status on -E, and force
3394 * src/m4.c (usage): Document new -E behavior.
3395 (main): Make -E an additive option.
3396 * doc/m4.texinfo (Operation modes): Document the change.
3397 Reported by Ralf Wildenhues.
3399 * tests/others.at (stdin seekable): Fix bug in test.
3400 * ltdl/m4/gnulib-cache.m4: Gnulib module strstr no longer exists.
3402 * m4/input.c (struct m4_input_block): Remove unused field traced.
3404 2007-02-03 Eric Blake <ebb9@byu.net>
3405 and Bruno Haible <bruno@clisp.org> (tiny change)
3407 * doc/m4.texinfo (Input processing, Quoting Arguments): Beef up
3409 Reported by Bruno Haible.
3411 2007-01-31 Eric Blake <ebb9@byu.net>
3413 * m4/resyntax.c (m4_regexp_syntax_encode): Detect allocation
3416 2007-01-26 Eric Blake <ebb9@byu.net>
3418 * m4/symtab.c (includes): Adjust to latest gnulib.
3419 * modules/m4.c (includes): Likewise.
3421 2007-01-23 Eric Blake <ebb9@byu.net>
3423 * m4/m4module.h (M4_SYNTAX_ASSIGN): Delete this unused
3424 extension to make enough room.
3425 (M4_SYNTAX_IGNORE): Change value to zero, since the (commented)
3426 code in input.c special cases this category.
3427 (M4_SYNTAX_LBRACE, M4_SYNTAX_RBRACE): New values in preparation
3428 for define(eleventh,${11}) extension.
3429 * m4/syntax.c: Update comments accordingly.
3430 (m4_syntax_create, m4_syntax_code): Handle { and }.
3431 * m4/input.c (m4__next_token): Likewise.
3432 * src/freeze.c (produce_frozen_state): Support new categories.
3433 (reload_frozen_state): When loading version 1, disable syntax
3434 features not present in 1.4.x.
3435 * tests/freeze.at: Sort and rename existing tests.
3436 (loading format 1): Ensure we don't break v1 frozen files that
3438 (loading format 2, reloading changecom, reloading changesyntax):
3440 * doc/m4.texinfo (Changesyntax, Frozen file format 1): Document
3441 the new syntax categories.
3442 (Arguments): Update the FIXME comment.
3443 (M4wrap): Merge examples from branch, before worrying about fixing
3444 m4wrap to obey POSIX.
3445 (Using frozen files): Start merging from branch.
3448 2007-01-20 Eric Blake <ebb9@byu.net>
3450 * src/freeze.c (produce_char_dump): Delete. Replace with...
3451 (produce_mem_dump): ...this new function, to encode more strings.
3452 Also make the coding easier to read and slightly more compact.
3453 (produce_syntax_dump): Only dump non-default syntax codes.
3454 (produce_module_dump, dump_symbol_CB, produce_frozen_state):
3455 Encode non-ASCII characters in user-supplied strings.
3456 (GET_STRING): Accept escape sequences in version 2.
3457 * NEWS: Document this change.
3460 2007-01-16 Eric Blake <ebb9@byu.net>
3462 Port patch from branch for stack overflow detection on BSD/OS.
3463 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Check for stack_t.ss_sp.
3464 * src/stackovf.c (setup_stackovf_trap) [HAVE_SIGALTSTACK &&
3465 ! HAVE_STACK_T_SS_SP]: Use this check.
3466 Reported by Chris McGuire.
3468 2007-01-15 Eric Blake <ebb9@byu.net>
3470 * tests/builtins.at (__m4_version__): New test.
3471 * modules/traditional.c (m4_macro_table): Provide windows and os2
3472 macros, as appropriate. Add __traditional__ macro.
3473 * modules/mpeval.c (m4_macro_table): Name the macro __mpeval__,
3474 not __gmp__, to match module name.
3475 * modules/load.c (m4_macro_table): Name the macro __load__, not
3476 __modules__, to match module name.
3477 * doc/m4.texinfo (History, Shell commands, Platform macros): Merge
3479 (Standard Modules): Improve wording.
3480 (Incompatibilities): Move platform macros into their own node.
3481 (Load, Unload): Use actual examples.
3482 * NEWS: Document this change.
3485 2007-01-13 Eric Blake <ebb9@byu.net>
3487 * doc/m4.texinfo (Mpeval): Add tests.
3488 * tests/testsuite.at (AT_CHECK_GMP): New filter, factored from...
3489 * tests/builtins.at (gmp): ...here. Rename test to...
3491 * tests/generate.awk (new_test): Filter out mpeval tests when gmp
3493 * m4/m4module.h (m4_get_no_gnu_extensions_opt): Merge
3494 no_gnu_extensions with posixly_correct_opt, since they were set in
3496 * m4/m4private.h (struct m4): Remove no_gnu_extensions.
3497 * src/main.c (main): Update caller.
3498 * src/freeze.c (reload_frozen_state): Likewise.
3499 * modules/m4.c (m4wrap): Likewise.
3501 2007-01-12 Eric Blake <ebb9@byu.net>
3503 * m4/syntax.c (m4_set_comment): XCU ERN 131 was approved by
3504 POSIX, so update the comment.
3505 * doc/m4.texinfo (Inhibiting Invocation): XCU ERN 130 was
3506 approved by POSIX, so we can always have blind macros, even when
3508 (Ifelse): Mention the term `blind builtin'.
3510 2007-01-08 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3512 * doc/m4.texinfo: Fix a couple of typos.
3514 2007-01-08 Eric Blake <ebb9@byu.net>
3516 * ltdl/m4/gnulib-cache.m4: Update for new year.
3517 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Cover all error cases.
3518 Reported by Ralf Wildenhues.
3520 2007-01-06 Eric Blake <ebb9@byu.net>
3522 * m4/m4private.h (to_uchar): Move...
3523 * m4/m4module.h: here, so modules can use it.
3524 * src/main.c (usage, long_options): Support --posix as a synonym
3526 * modules/m4.c (numb_invert): Detect unsupported x**-y.
3527 (numb_incr, numb_urshift, numb_extension): New macros.
3528 (numb_obstack): Port patch from branch to support radix 1 output.
3529 * modules/mpeval.c (numb_obstack): Use \ for ratios.
3530 (numb_incr, numb_urshift, numb_extension): New macros.
3531 (mpq2mpz): Warn rather than error.
3532 * modules/evalparse.c (URSHIFT, NEGATIVE_EXPONENT): New
3534 (eval_error): Rearrange, so that all ignorable errors are less
3536 (eval_text, last_text): Obey C++ type safety rules.
3537 (numb_pow): Change return type.
3538 (exp_term): Adjust caller.
3539 (m4_evaluate): Fail on bad exponent.
3540 (logical_or_term, logical_and_term): Ignore failed ** in short
3542 (eval_lex): Fix typos when detecting <<= and >>=. Use \ instead
3543 of : for ratio. Support >>>, ,, and ?:. Port patch from branch
3544 to parse radix 1 numbers.
3545 (condition_term, comma_term): New parse functions.
3546 (shift_term): Support >>>.
3547 (m4_evaluate): Port patch from branch to output radix 1 numbers.
3548 Warn instead of error for most parse problems.
3549 * doc/m4.texinfo (Limits control, Eval): Document these changes.
3550 * NEWS: Document new operators and new command line option.
3552 2007-01-04 Eric Blake <ebb9@byu.net>
3554 * configure.ac (AC_SYS_LARGEFILE): Guarantee large file support.
3556 2007-01-03 Eric Blake <ebb9@byu.net>
3558 * doc/m4.texinfo (Format, Incr): More merges.
3559 (Eval): Ensure C precedence rules are met.
3560 * modules/evalparse.c (BADOP, INVALID_OPERATOR): New enumerators.
3561 (not_term, logical_not_term): Delete; these are same precedence
3562 as other unary operators.
3563 (equality_term): New; these are lower precedence than relational
3565 (eval_lex, simple_term, m4_evaluate): Recognize forbidden C
3566 operators for better error messages.
3567 (logical_or_term, logical_and_term): Short-circuit out the error
3568 of division by zero.
3569 (unary_term): Allow consecutive unary operators.
3570 * modules/m4.c (int2numb, numb2int): Delete; these potentially
3572 (numb_not, numb_eor, numb_ior, numb_and): Update callers.
3573 * modules/mpeval.c (reduce1, reduce2): Protect macros better.
3574 * NEWS: Document this change.
3576 2006-12-27 Eric Blake <ebb9@byu.net>
3578 * doc/m4.texinfo (Substr, Patsubst): Merge more sections from the
3580 * modules/m4.c (substr): Merge from branch.
3582 2006-12-26 Eric Blake <ebb9@byu.net>
3584 * doc/m4.texinfo (Changesyntax): Check for regressions with
3585 changesyntax(W=...).
3587 2006-12-22 Eric Blake <ebb9@byu.net>
3589 * m4/m4module.h (m4_set_syntax): Change signature.
3590 * modules/gnu.c (m4_resyntax_encode_safe): Reduce error to
3592 (changesyntax): Likewise, and update caller.
3593 * m4/m4private.h (m4_syntax_table): Add orig member.
3594 * m4/syntax.c (m4_set_quotes, m4_set_comment): Merge from branch.
3595 Don't set is_single_quotes and is_single_comments when the begin
3596 character is shadowed by another syntax type.
3597 (m4_syntax_create): Populate default syntax table.
3598 (add_syntax_attribute): Don't lose quote assignment.
3599 (remove_syntax_attribute): Only allow removing rquote or ecomm.
3600 (add_syntax_set, subtract_syntax_set, set_syntax_set)
3601 (reset_syntax_set): New helper routines.
3602 (m4_set_syntax): Alter semantics - NUL key reverts entire syntax
3603 to default, and empty chars reverts that key to default.
3604 (check_is_single_quotes, check_is_single_comments): New helper
3606 * modules/m4.c (changecom): Merge from branch.
3607 * m4/input.c (m4__next_token): Rearrange token recognition order
3608 to macro, quote, comment, in order to match traditional
3610 * src/freeze.c (reload_frozen_state): Update caller.
3611 * doc/m4.texinfo (Changequote, Changecom): Merge from branch, with
3613 (Changeresyntax): Revise to match style of surrounding sections
3614 and add more examples.
3615 (Changesyntax): Likewise, and update to new semantics.
3616 * NEWS: Document this change.
3618 * doc/m4.texinfo (Operation modes): Avoid underfull hbox.
3619 (M4wrap, Eval, Errprint): Fix typos.
3620 (Divnum): Not necessary to redivert in example.
3622 2006-12-21 Eric Blake <ebb9@byu.net>
3624 * doc/m4.texinfo (Len, Index macro, Regexp): More section merging
3627 2006-12-19 Eric Blake <ebb9@byu.net>
3629 * modules/m4.h (m4_sysval_flush_func): Adjust prototype.
3630 * modules/m4.c (m4_sysval_flush): Add parameter, so that m4exit
3631 can track write errors without all other callers warning multiple
3633 (sysval_flush_helper): New function.
3634 (dumpdef, syscmd, errprint, m4exit): Adjust callers.
3635 * modules/gnu.c (esyscmd): Likewise.
3636 * tests/others.at (stdout closed, stdout full): Error message
3639 2006-12-16 Eric Blake <ebb9@byu.net>
3641 * src/main.c: Fix missing include.
3643 * src/main.c (main): Check for errors when closing stdin.
3644 * modules/m4.c (m4exit): Missed part of previous patch: flush
3645 stdin before a successful exit.
3646 Reported by Ralf Wildenhues.
3648 2006-12-14 Eric Blake <ebb9@byu.net>
3650 * modules/m4.c (m4_sysval_flush): Flush stdin before exiting, as
3652 * tests/others.at (stdin seekable): New test.
3654 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3656 * doc/m4.texinfo: Fix some typos.
3658 2006-12-04 Eric Blake <ebb9@byu.net>
3660 * doc/m4.texinfo (Undivert, Divnum, Cleardivert): Merge more doc
3662 (Modules): Make style consistent.
3664 2006-11-16 Eric Blake <ebb9@byu.net>
3666 * bootstrap: Relax m4 requirement, thanks to...
3667 * configure.ac (Gettext support): ...this workaround to the 1.4.4
3668 bug. Undoes restriction added on 2006-11-09.
3670 * tests/builtins.at (esyscmd, syscmd): Redo, since spilled
3671 diversions are now closed when not active.
3672 (divert): Remove check now in the manual.
3673 * tests/others.at (stderr closed): Likewise.
3674 (stdout closed): Add a check.
3675 * doc/m4.texinfo (Include, Search Path, Diversions, Divert): Sync
3676 more docs with branch.
3678 2006-11-14 Eric Blake <ebb9@byu.net>
3680 Remerge sparse diversion handling from branch.
3681 * ltdl/m4/gnulib-cache.m4: Replace avltree-list with
3683 * m4/output.c (diversion_table): Change type to gl_oset_t.
3684 (m4_output_init, m4_output_exit, cleanup_tmpfile, make_room_for)
3685 (m4_make_diversion, insert_diversion_helper, m4_insert_diversion)
3686 (m4_undivert_all, m4_freeze_diversions): Adjust all callers.
3687 (div0, diversion_storage): New variables.
3688 (diversions, equal_diversion_CB): Deleted.
3689 (threshold_diversion_CB): New callback.
3690 (m4_tmpname, m4_tmpopen, m4_tmpclose, m4_tmpremove): New
3692 (m4_tmpfile): Move cloexec action here.
3694 * m4/resyntax.c (m4_regexp_syntax_encode): Avoid bug with signed
3697 2006-11-13 Eric Blake <ebb9@byu.net>
3699 Add several new command line options.
3700 * src/main.c (usage): Update.
3701 (OPTSTRING, long_options): Add --pushdef, --popdef, --gnu,
3702 --traceon, --traceoff, --syncoutput, --warnings, --unload-module.
3703 Make --regexp-syntax argument optional.
3704 (main): Support new options. Fix regression in interactive
3705 behavior from Nov 8.
3706 * m4/m4private.h (M4_OPT_SYNCOUTPUT_BIT): Rename from
3707 M4_OPT_SYNC_OUTPUT_BIT.
3708 * m4/m4module.h (m4_context_opt_bit_table): Rename sync_output to
3709 syncoutput, to match option.
3710 (m4_parse_truth_arg): New prototype.
3711 * m4/utility.c (m4_parse_truth_arg): Implement it.
3712 * m4/output.c (m4_shipout_text): Adjust sync_output caller.
3713 * modules/gnu.c (syncoutput): Adjust sync_output caller, and use
3715 * doc/m4.texinfo (Operation modes, Dynamic loading features)
3716 (Preprocessor features, Limits control, Debugging options)
3717 (Command line files): Update documentation.
3718 * tests/builtins.at (mkstemp): Simplify.
3719 * tests/macros.at (Command line pushdef): New test.
3720 (Command line define): Improve.
3721 * tests/options.at (--traceon and --traceoff, --syncoutput): New
3723 (POSIXLY_CORRECT): Likewise.
3724 (deprecated options): Augment.
3725 (--regexp-syntax): Update, now that -r takes optional arg.
3726 * NEWS: Reformat. Document new options.
3728 2006-11-11 Eric Blake <ebb9@byu.net>
3730 One step closer to allowing C++ compilation - don't blindly
3731 convert between char* and unsigned char*.
3732 * m4/m4module.h (m4_set_syntax): Change signature.
3733 * m4/m4private.h (m4_string): Use signed char.
3734 (m4_get_syntax_lquote, m4_get_syntax_rquote, m4_get_syntax_bcomm)
3735 (m4_get_syntax_ecomm): No longer a need to cast.
3736 * m4/syntax.c (m4_set_syntax, m4_syntax_create, m4_set_quotes):
3737 Reflect this change.
3738 * m4/macro.c (expand_argument): Simplify.
3739 (expand_token): Use proper type.
3740 * src/freeze.c (reload_frozen_state): Likewise.
3741 * m4/input.c (MATCH, match_input): Likewise.
3742 * modules/m4.c (translit): Likewise.
3743 * modules/gnu.c (substitute): Simplify.
3745 * m4/macro.c (trace_format): Use canonical type name.
3746 * m4/output.c (m4_freeze_diversions): Likewise.
3747 * src/freeze.c (produce_module_dump, dump_symbol_CB)
3748 (produce_frozen_state): Likewise.
3749 * m4/m4private.h (to_uchar): Grab from branch.
3750 * m4/input.c (string_peek, string_read): Use it.
3751 * m4/utility.c (skip_space): Likewise.
3752 * src/main.c (main): Likewise.
3753 * doc/m4.texinfo (Translit): Remerge from branch.
3754 * tests/builtins.at (translit): Test 8-bit range.
3755 * modules/m4.c (m4_expand_ranges): Merge from branch.
3757 2006-11-09 Eric Blake <ebb9@byu.net>
3759 * bootstrap: Validate that installed M4 is powerful enough.
3760 Reported by Gary V. Vaughan, analyzed by Stepan Kasal.
3762 2006-11-08 Eric Blake <ebb9@byu.net>
3764 Merge deferred handling of -D option from branch.
3765 * doc/m4.texinfo (Debugging options, Preprocessor features)
3766 (Dynamic loading features, Operation modes, Invoking m4):
3767 Document this change.
3768 * src/main.c (OPTSTRING): Specify in-order processing.
3769 (process_file): New function.
3770 (main): Use it to interleave files and deferred options.
3771 * tests/macros.at (Command line define): New test.
3772 * tests/generate.awk: Allow '@comment file' as first example
3774 * tests/options.at (option grouping): Update to reflect actual
3776 (file names): New test.
3778 2006-11-07 Eric Blake <ebb9@byu.net>
3780 * m4/output.c (cleanup_tmpfile, m4_insert_diversion_helper): Check
3783 * tests/builtins.at (m4exit): New test; failed on cygwin before
3785 * m4/output.c (cleanup_tmpfile): Close files before removing
3787 (make_room_for, m4_output_exit): Ensure that atexit handler
3788 invoked from m4_error sees consistent state.
3790 * doc/m4.texinfo (Errprint): Merge another doc node.
3791 * tests/builtins.at (dumpdef, errprint): New tests.
3792 * modules/m4.c (errprint): Merge from branch: flush before
3795 2006-11-02 Eric Blake <ebb9@byu.net>
3797 * bootstrap: Update bootstrap requirement wording.
3798 Reported by Bruno Haible.
3800 2006-10-31 Eric Blake <ebb9@byu.net>
3802 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3804 * doc/m4.texinfo (Translit): Merge from branch.
3805 * modules/m4.c (divert, substr): Ignore excess arguments.
3806 (index, translit): Merge from branch.
3807 * tests/builtins.at (translit): Add a test.
3809 2006-10-30 Eric Blake <ebb9@byu.net>
3811 * m4/m4private.h (m4_get_symbol_value_module): Delete accidental
3813 * m4/symtab.c (m4_get_symbol_value_module): Likewise.
3815 * modules/m4.c (m4_make_temp): Make safe across libtool.
3816 * m4/symtab.c (dump_symbol_CB) [DEBUG_SYM]: Avoid warnings.
3817 * configure.ac (--with-modules): Accomodate changed module
3818 location when doing './configure --enable-debug'.
3820 2006-10-28 Eric Blake <ebb9@byu.net>
3822 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3825 2006-10-27 Eric Blake <ebb9@byu.net>
3827 * bootstrap (gnulib): No longer a need to patch after gnulib-tool
3829 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
3830 0.16, since 0.15 is incompatible with our automake requirement.
3832 * m4/macro.c (expand_argument): Fix missing initialization.
3833 * m4/m4private.h (struct m4_symbol_value): Store entire
3834 m4_builtin, not just the func.
3835 (m4_get_symbol_value_func): Update.
3836 (m4_get_symbol_value_builtin, m4_set_symbol_value_builtin): New
3838 * m4/m4module.h (m4_get_symbol_value_builtin)
3839 (m4_get_symbol_builtin): New prototypes.
3840 (m4_set_symbol_value_func): Delete, replace with...
3841 (m4_set_symbol_value_builtin): New function.
3842 (m4_builtin_find_by_name): Change signature.
3843 * m4/symtab.c (m4_symbol_value_print): Simplify.
3844 (m4_get_symbol_value_func): Update.
3845 (m4_get_symbol_value_builtin): New function.
3846 (m4_set_symbol_value_func): Delete, replace with...
3847 (m4_set_symbol_value_builtin): New function.
3848 (dump_symbol_CB) [DEBUG_SYM]: Simplify.
3849 * m4/builtin.c (m4_builtin_find_by_name): Change signature.
3850 * m4/input.c (struct m4_input_block): Remove unused trace member.
3851 (m4_push_builtin, builtin_print, init_builtin_token): Update
3853 * m4/module.c (install_builtin_table): Likewise.
3854 * src/freeze.c (reload_frozen_state): Likewise.
3855 * modules/gnu.c (builtin): Make it possible to retrieve a builtin
3856 token, even after the builtin has been undefined.
3857 * doc/m4.texinfo (Builtin): Document new capability.
3860 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3862 * modules/m4.c (m4_make_temp): Use it.
3863 * tests/builtins.at (mkstemp, mkdtemp): Update message wording.
3865 2006-10-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3867 * Makefile.am (dist_pkgdata_DATA): Distribute recently-added
3870 2006-10-26 Eric Blake <ebb9@byu.net>
3872 Silence -O2 -Wall -Wwrite-strings warnings.
3873 * m4/m4private.h (m4_symbol_value): Const-ify text.
3874 * m4/m4module.h (m4_get_symbol_value_text)
3875 (m4_get_symbol_value_placeholder, m4_set_symbol_value_text)
3876 (m4_set_symbol_value_placeholder): Likewise.
3877 * m4/macro.c (expand_token, expand_argument, expand_macro): Fix
3879 * m4/symtab.c (m4_symbol_value_delete, m4_symbol_value_copy)
3880 (m4_get_symbol_value_text, m4_get_symbol_value_placeholder)
3881 (m4_set_symbol_value_text, m4_set_symbol_value_placeholder):
3883 * modules/format.c (format): Likewise.
3884 * src/main.c (main): Likewise.
3885 * src/freeze.c (produce_symbol_dump, dump_symbol_CB): Likewise.
3886 * modules/shadow.c (shadow, test): Likewise.
3887 * m4/output.c (m4_make_diversion): Don't hold on to empty
3889 (m4_output_init, make_room_for, m4_undivert_all): Don't type-pun.
3890 (m4_freeze_diversions): Likewise. Don't use uninitialized
3893 Convert diversions to list instead of sparse array, part 2.
3894 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
3896 * m4/output.c (m4_diversion): Add next pointer and divnum members.
3897 (diversion_table): Convert to a list instead of a sparse array.
3898 (free_list): Maintain free list of reclaimed diversions.
3899 (equal_diversion_CB, cmp_diversion_CB): New functions.
3900 (m4_output_init): Set up list.
3901 (m4_output_exit): Tear down list.
3902 (make_room_for, m4_undivert_all, m4_freeze_diversions): Change
3904 (m4_make_diversion): Change creation of new diversions.
3905 (m4_insert_diversion_helper): New function, to avoid list
3907 * tests/builtins.at (divert): The test now passes.
3908 * NEWS: Document this improvement.
3910 Convert diversions to list instead of sparse array, part 1.
3911 * m4/m4module.h (m4_shipout_text, m4_shipout_string): Use size_t
3913 * m4/output.c (diversion, total_buffer_size, output_unused):
3914 Track size in size_t. All users changed.
3915 (struct diversion): Reduce size now, to compensate for part 2.
3916 (m4_make_diversion, make_room_for): Avoid malloc overflow.
3917 (m4_output_exit): Fix typo in assert.
3918 (m4_output_init, make_room_for, m4_make_diversion)
3919 (m4_insert_diversion, m4_freeze_diversions): Adjust users of
3920 struct m4_diversion to disambiguate the new union.
3921 * tests/builtins.at (divert): Detect this failure.
3923 2006-10-25 Eric Blake <ebb9@byu.net>
3925 * m4/m4module.h (m4_push_builtin): Add parameter.
3926 * modules/m4.c (defn): Update caller.
3927 * m4/input.c (file_read_init, string_read_init): No longer
3929 (input_funcs): Change signature of read_func, all callers
3931 (composite_peek, composite_read, composite_unget),
3932 (composite_print, composite_funcs): New input type. Not yet
3933 fully utilized, but one step closer to fixing defn.
3934 (m4_input_block): Make every input block track current file and
3935 line. Rename some members. Remove unused out_line. Add support
3936 for composite input block.
3937 (input_change): New flag.
3938 (file_peek, file_read, file_clean, file_unget, file_print):
3940 (m4_push_file, m4_push_builtin, m4_push_string_init)
3941 (m4_push_string_finish, m4_push_wrapup, m4_pop_wrapup)
3942 (m4_skip_line, pop_input): Track input block changes.
3943 (m4_pop_wrapup): Avoid overflow.
3944 (init_builtin_token): Handle composite input.
3945 (next_char): Handle input block changes.
3946 * doc/m4.texinfo (Location): Remerge from branch.
3948 * src/m4.h (includes): Need <locale.h> after all; fixes
3949 regression from yesterday.
3951 * m4/system_.h (obstack_regrow): New macro. Hopefully glibc will
3953 * m4/macro.c (expand_macro): Avoid referencing invalid memory.
3954 Handle nesting the argc obstack.
3955 (expand_token): Avoid unnecessary malloc.
3956 (collect_arguments): Copy name before invalidating it.
3957 (argc_stack, argv_stack): New variables.
3958 (m4_macro_expand_input): Initialize argc and argv stacks once per
3959 file, instead of once per macro.
3961 2006-10-24 Eric Blake <ebb9@byu.net>
3963 * src/m4.h (includes): Add gettext.h, for N_. Assume setlocale.
3965 2006-10-23 Eric Blake <ebb9@byu.net>
3967 * doc/m4.texinfo (Macro Arguments, Incompatibilities): Remerge
3968 from branch regarding stripped leading whitespace.
3970 * modules/m4.c (includes): Use safe headers even when configured
3971 with --enable-assert.
3972 (m4_builtin_table, m4_make_temp): Work around fact that mkstemp is
3973 #defined as mkstemp_safer.
3975 2006-10-21 Eric Blake <ebb9@byu.net>
3977 * modules/m4.c (m4_make_temp): Change signature.
3978 (maketemp, mkstemp): Update callers.
3979 * modules/m4.h (m4_make_temp_func): New export.
3980 * modules/gnu.c (mkdtemp): New macro.
3981 * doc/m4.texinfo (Operation modes): Document interaction with
3983 (Mkdtemp): New node.
3984 * tests/builtins.at (mkdtemp): New test.
3985 (mkstemp): Check for umask effect.
3986 * NEWS: Document new builtin.
3988 * tests/generate.awk (normalize): Update recognition of trailing
3990 * doc/m4.texinfo: Minor formatting fixes from branch.
3991 (Foreach, Improved foreach): Merge from branch.
3992 * examples/foreach.m4: Merge from branch.
3993 * examples/foreachq.m4: New file from branch.
3994 * examples/foreach2.m4: Likewise.
3995 * examples/foreachq2.m4: Likewise.
3997 * doc/m4.texinfo (titlepage): Add myself as author.
3998 * src/main.c (AUTHORS): Likewise.
4000 2006-10-19 Eric Blake <ebb9@byu.net>
4002 * modules/m4.c (m4_make_temp, mkstemp): New functions.
4003 (maketemp): Add POSIX behavior and a warning.
4004 * tests/others.at (maketemp): Move this test...
4005 * tests/builtins.at (mkstemp): ...to here, and beef up.
4006 * tests/options.at (--safer): Update to new warning message.
4007 * doc/m4.texinfo (Mkstemp): Sync from branch.
4008 (Extensions): Update maketemp behavior.
4009 * NEWS: Document that maketemp now always warns.
4011 * tests/generate.awk: For ease of doc-writing, simplify selection
4012 of '-Ipath/to/examples' to '@comment examples'.
4013 * examples/forloop.m4: Simplify.
4014 * examples/forloop2.m4: New file.
4015 * examples/quote.m4: New file.
4016 * doc/m4.texinfo (Improved forloop): New node.
4017 (Manual): Clarify use of examples directory.
4018 (Shift, Forloop): Resync from branch.
4019 (Include, Location): Update to new usage of examples directory.
4021 * m4/system_.h (includes): Pick up <unistd.h> before checking for
4023 (gettext_noop): Don't define here, let gettext.h do it instead.
4024 * po/POTFILES.in: Update entries to reflect gnulib imports.
4026 2006-10-16 Eric Blake <ebb9@byu.net>
4028 * ltdl/m4/gnulib-cache.m4: Augment with 'gnulib-tool --import
4030 * configure.ac (AM_INIT_AUTOMAKE): Bump requirement to 1.10a, for
4031 pkglibexecdir support.
4032 * Makefile.am (m4_libm4_la_SOURCES, m4/pathconf.h): No longer
4033 worry about pathconf.h, now that gnulib does it for us.
4034 (pkgmodincludedir): Simplify.
4035 (pkglibexecdir): Delete, now that automake does this.
4036 * m4/module.c (m4__module_init): Use PKGLIBEXECDIR.
4037 * src/main.c (usage): Likewise.
4038 * m4/symtab.c (m4_symbol_value_groks_macro): Fix typo.
4040 * doc/m4.texinfo: Port some changes from the branch.
4041 (Invoking m4): Promote to a chapter, instead of a section of
4043 (Operation modes, Dynamic loading features, Preprocessor features)
4044 (Limits control Frozen state, Debugging options)
4045 (Command line files): Subdivide into new sections.
4046 (Cleardivert): Rename from cleardiv.
4048 2006-10-14 Eric Blake <ebb9@byu.net>
4050 * tests/others.at (stdin closed): Update to match previous patch.
4052 * m4/input.c (file_clean): Don't close stdin twice, POSIX says it
4054 Reported by Ralf Wildenhues.
4056 * modules/m4.c (undivert): Merge from branch.
4057 * doc/m4.texinfo (Improved fatal_error): Fix typo.
4058 (Improved exch): New node, copied from branch.
4059 (Improved cleardivert): Update from branch.
4062 2006-10-13 Eric Blake <ebb9@byu.net>
4064 * configure.ac (AC_CONFIG_HEADERS): Name the template config.hin,
4066 * modules/gnu.c (builtin, indir): Transparently handle builtin
4068 * doc/m4.texinfo (Indir, Builtin): Remerge from branch.
4069 * m4/input.c (m4_pop_wrapup): Display debug message when switching
4071 (m4_input_init): No need to use empty file any more.
4072 (file_print): Display correct file name.
4073 * m4/utility.c (m4_error, m4_warn): Ensure we don't try to
4074 dereference a NULL file name.
4075 * m4/m4module.h (m4_pop_wrapup): New parameter.
4076 (m4_symbol_value_groks_macro, m4_symbol_groks_macro): New
4078 * m4/m4private.h (m4_symbol_value_groks_macro): Faster version.
4079 * m4/symtab.c (m4_symbol_value_groks_macro): New method.
4080 * src/main.c (main): Adjust caller.
4081 * tests/options.at (--debugmode): Test more output from -dV.
4083 2006-10-12 Eric Blake <ebb9@byu.net>
4085 * m4/input.c (m4_print_token) [DEBUG_INPUT]: Modernize.
4087 * m4/m4private.h (m4__next_token_is_open): New prototype.
4088 * m4/m4module.h (m4_push_single): Delete; push_string is an
4089 adequate interface, and removing support for this simplifies the
4091 (m4_push_wrapup): New parameter.
4092 (m4_is_syntax): Delete; m4_has_syntax is sufficient.
4093 (M4_SYNTAX_LQUOTE, M4_SYNTAX_BCOMM, M4_SYNTAX_MASKS): Make
4094 start-quote and start-comment exclusive from other syntax
4096 * m4/syntax.c: Likewise.
4097 * m4/input.c (input_funcs): Make polymorphic without requiring
4098 clients to know whether they are located at isp. All users
4100 (file_names): New variable.
4101 (m4_input_init): Initialize it.
4102 (m4_push_file): Use it.
4103 (m4_input_exit): Free it after use.
4104 (m4__next_token): Simplify slightly.
4105 (m4__peek_token): Rename and simplify...
4106 (m4__next_token_is_open): ... to this. In particular, this
4107 allows us to avoid a double ungetc, which POSIX doesn't
4109 (struct m4_input_block, m4_push_single, single_peek, single_read):
4110 Remove support for single characters, as the input engine now
4111 guarantees we don't need it.
4112 (file_unget, string_unget, m4_input_print, unget_input):
4113 Strengthen assertions.
4114 (file_init_funcs, file_read_init): New for file reading.
4115 (string_init_funcs, string_read_init): New for wrapped text.
4116 (m4_push_string_init, m4_push_string_finish, m4_push_wrapup):
4117 Support wrapped text with locations.
4118 (m4_skip_line): Support dnl across include file boundary.
4119 (peek_char): Don't pop input when peeking.
4120 (file_peek): Peek can be called at the end of the file.
4121 (string_read): Don't read beyond string bounds.
4122 * m4/macro.c (expand_token, collect_arguments): Update callers.
4123 (expand_macro): Report errors at location of open parenthesis.
4124 (expand_token, expand_argument, process_macro): Avoid negative
4125 array dereferences with m4_has_syntax.
4126 * m4/utility.c (skip_space): Likewise.
4127 * modules/m4.c (m4wrap): Update caller.
4128 * tests/builtins.at (__file__, __line__, dnl): New tests.
4129 * tests/options.at (--debugmode): Normalize the output.
4130 * doc/m4.texinfo (Macro Arguments, Dnl, History, Location):
4131 Remerge recent changes from branch.
4132 (Improved fatal_error): New node from branch.
4134 2006-10-11 Eric Blake <ebb9@byu.net>
4136 * src/main.c (usage, long_options): Add --debugmode as an alias
4137 for --debug, to match macro name.
4138 * tests/options.at (--debugmode): Rename from --debug, and test
4140 (--discard-comments): Augment test.
4141 * doc/m4.texinfo (Invoking m4, Debugmode): Document this.
4144 2006-10-10 Eric Blake <ebb9@byu.net>
4146 Trace improvements: debugmode(c) was always printing the last two
4147 lines paired, combine them; and show non-text expansions.
4148 * m4/macro.c (trace_prepre): Update to show what the macro will
4150 (trace_pre): No need to special-case on debugmode(c).
4151 (trace_post): Likewise. Also, show non-text expansions.
4152 (expand_macro): Update caller. Collecting arguments can change
4153 debug mode, so cache values beforehand.
4154 (trace_format): Remove support for unused %l%S%r, and fix support
4155 for %z to match gcc's attribute((printf)).
4156 (trace_header): Update caller.
4157 * m4/input.c (struct m4_input_block): Rename from input_block.
4158 (struct input_funcs): Add print_func member.
4159 (file_print, builtin_unget, builtin_print, string_print)
4160 (m4_input_print): New functions.
4161 (m4_push_string_finish): Change return type.
4162 (m4_push_file): Fix missing use of close parameter.
4163 * m4/debug.c (m4_debug_decode): Don't clear pending traces.
4164 * m4/m4module.h (m4_input_print): New prototype.
4165 * tests/builtins.at (debug, esyscmd, multiquotes, syscmd): Update
4166 to match behavior change.
4167 * tests/options.at (--debug): Likewise.
4168 * tests/macros.at (Propagation of traceon)
4169 (Propagation of --trace): Likewise.
4170 * tests/others.at (stderr closed, stdout closed, stdin closed):
4172 * doc/m4.texinfo (Forloop): Simplify.
4173 (Trace): Update to changed behavior.
4174 (Debugmode): Document this change.
4175 * src/main.c (usage): Likewise.
4178 2006-10-09 Eric Blake <ebb9@byu.net>
4180 * m4/path.c (m4_include_env_init): Don't alter result of getenv.
4181 Reported by Ralf Wildenhues.
4183 * modules/gnu.c (gnu_buf): Rename from buf to silence -Wshadow.
4185 2006-10-07 Eric Blake <ebb9@byu.net>
4187 * m4/m4module.h (m4_set_exit_failure): New prototype.
4188 * m4/utility.c (m4_set_exit_failure): New function.
4189 * modules/m4.c (m4exit): Use it to avoid yet another global
4190 variable export in libm4.
4192 2006-10-06 Eric Blake <ebb9@byu.net>
4194 * m4/output.c (cleanup_tmpfile): Exit nonzero on failure to clean
4196 * tests/others.at (stdout closed): Fix final check.
4198 Replace uses of tmpfile with clean-temp, since tmpfile is
4199 incompatible with closeout.
4200 * tests/builtins.at (esyscmd, syscmd): Don't use pipe; it loses
4202 * tests/others.at (stderr closed): Likewise.
4203 * tests/testsuite.at (M4_ONE_MEG_DEFN): Actually hit one meg.
4204 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4206 * m4/output.c [!HAVE_TMPFILE]: Delete dead code.
4207 (m4_tmpfile, cleanup_tmpfile): New functions.
4208 (make_room_for, m4_insert_diversion): Use clean-temp module.
4209 * configure.ac (AC_CHECK_FUNCS_ONCE): No longer check for
4211 * doc/m4.texinfo (Diversions): Document new use of $TMPDIR.
4213 * m4/utility.c (m4_numeric_arg): Merge from branch.
4214 * modules/gnu.c (debuglen): New builtin.
4215 * src/main.c (usage, ARGLENGTH_OPTION, long_options, main):
4216 Rename --arglength to --debuglen.
4217 * tests/options.at (--arglength): Rename to --debuglen.
4218 (deprecated options): Augment test.
4219 * doc/m4.texinfo (Invoking m4): Document the name change.
4220 (Debugmode): Rename from Debug Levels.
4221 (Debugfile): Rename from Debug Output.
4222 (Debuglen): New node.
4223 * NEWS: Document these changes.
4225 * modules/m4.c (m4exit): Fix typo. Ensure desired exit status in
4226 case closing a module exits.
4228 * modules/m4.c (m4exit): Merge from branch.
4229 * m4/m4.c (m4_delete): Avoid assertion triggered by last patch.
4231 2006-10-05 Eric Blake <ebb9@byu.net>
4233 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4235 * Makefile.am (m4_libm4_la_DEPENDENCIES): Add missing dependency.
4236 * src/main.c (main): Close stdout on exit.
4237 * m4/debug.c (set_debug_file): Check for write failure.
4238 * m4/m4.c (m4_delete): Don't mask write failure.
4239 * tests/testsuite.at (AT_CHECK_M4): Allow tracing by expanding
4240 macros before calling AT_CHECK.
4241 (M4_ONE_MEG_DEFN): New helper macro.
4242 * tests/others.at (stdout full): New test.
4243 (stderr closed, stdin closed, stdout closed): Augment.
4244 * tests/builtins.at (syscmd): New test.
4247 2006-10-04 Eric Blake <ebb9@byu.net>
4249 * tests/builtins.at: Alphabetize tests.
4250 * tests/testsuite.at (AT_CHECK_M4): Allow choosing stdin.
4251 * tests/generate.awk (new_test): Fix underquoting.
4252 * tests/others.at (maketemp): Rename from misc.
4253 (stdin closed, stdout closed, stderr closed): New tests.
4255 2006-10-03 Eric Blake <ebb9@byu.net>
4257 Avoid all global variables in modules, so that --disable-static
4259 * examples/incl.m4: New file, from branch.
4260 * Makefile.am (dist_pkgdata_DATA): Distribute it.
4261 * doc/m4.texinfo (Location): Merge this section from branch.
4262 (Include): Update the test.
4263 * tests/generate.awk (new_test): Allow for VPATH build
4264 pre-processing of expected __program__ output.
4265 * m4/m4module.h (m4_current_diversion, m4_output_current_line):
4266 Avoid global variables.
4267 (m4_context_field_table): Add current_diversion, output_line.
4268 (m4_output_init, m4_make_diversion): Add parameter.
4269 (m4_get_program_name, m4_set_program_name): New accessors.
4270 * m4/m4private.h (m4_get_current_diversion),
4271 (m4_set_current_diversion, m4_get_output_line)
4272 (m4_set_output_line): New accessors.
4273 * m4/utility.c (m4_get_program_name, m4_set_program_name): New
4275 * modules/m4.c (divnum, divert): Adjust callers.
4276 * modules/gnu.c (__program__): Likewise.
4277 * m4/output.c (m4_output_init, m4_make_diversion)
4278 (m4_freeze_diversions, m4_shipout_text, m4_make_diversion)
4279 (m4_insert_diversion): Likewise.
4280 * m4/input.c (file_clean, m4_push_file): Likewise.
4281 * src/freeze.c (reload_frozen_state): Likewise.
4282 * src/main.c (main, usage): Likewise.
4284 Partially plug memory leak when unloading gnu module.
4285 * tests/modules.at (unload gnu module): New test.
4286 * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
4287 (m4_regexp_compile): Move static storage to module visibility.
4288 * tests/options.at (--debug): Adjust to new output.
4290 2006-09-29 Eric Blake <ebb9@byu.net>
4292 Even when not the first option, --help can't have side effects.
4293 * tests/options.at (--debugfile): Detect bugs in this area.
4294 * tests/testsuite.at (AT_CHECK_M4): Avoid a process when ignoring
4296 * src/main.c (main): Fix it by deferring debugfile change. Also,
4297 defer closing streams until after module tracing is done.
4298 * modules/gnu.c (debugfile): Make message consistent with command
4300 * doc/m4.texinfo (Invoking m4): Touch up the documentation.
4301 * NEWS: Document this fix.
4303 * modules/m4.c (dnl): Include macro name in warning message.
4304 * m4/input.c (m4_skip_line): Add parameter.
4305 * m4/m4module.h (m4_skip_line): Likewise.
4306 * src/main.c (usage): Update wording.
4307 * doc/m4.texinfo (Inhibiting Invocation): Add xfailed test until
4308 issue of blind macros vs. POSIX is resolved.
4309 (Dnl): Merge another node from branch.
4311 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4313 * m4/system_.h (N_): Define.
4314 * src/main.c (main): Validate numeric arguments.
4315 (size_opt): New function, idea borrowed from coreutils.
4316 * m4/macro.c (expand_macro): -L0 implies no limit.
4317 * doc/m4.texinfo (Invoking m4): Document this change.
4319 * tests/options.at: (--arglength, --nesting-limit)
4320 (--regexp-syntax): New tests of argument validation.
4322 2006-09-28 Eric Blake <ebb9@byu.net>
4324 * tests/options.at: Alphabetize the tests.
4326 2006-09-27 Eric Blake <ebb9@byu.net>
4328 * m4/m4module.h (m4_symbol_value_print, m4_symbol_print): Add
4329 another parameter to print module info.
4330 * m4/macro.c (trace_pre): Adjust caller.
4331 * modules/m4.c (M4BUILTIN_HANDLER): Likewise.
4332 * doc/m4.texinfo (Dumpdef, Debug Levels): Document this.
4333 * NEWS: Document this.
4335 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4337 * m4/symtab.c (symbol_value_print): Rename to...
4338 (m4_symbol_value_print): ...this, and...
4339 (m4_symbol_print): Update to allow -L length truncation. Now
4340 truncation also affects dumpdef output and builtin names.
4341 * m4/m4private.h (nesting_limit, max_debug_argument_length):
4343 * m4/m4module.h (m4_symbol_print): Add parameter.
4344 (m4_symbol_value_print): New function.
4345 * modules/m4.c (dumpdef): Allow length truncation.
4346 * m4/macro.c (trace_pre): Use m4_symbol_print, rather than
4348 * doc/m4.texinfo (Invoking m4): Document -l better.
4349 (Dumpdef, Debug Levels): Document the effect of -l.
4350 * NEWS: Document this change.
4352 * modules/m4.c (m4_dump_symbols, errprint, m4wrap)
4353 (m4_expand_ranges): Ensure we aren't picking up partial object on
4355 * modules/stdlib.c (setenv): Allow extra arguments.
4356 * modules/time.c (ctime): Avoid side effect in call to
4358 * modules/gnu.c (m4_regexp_substitute): Likewise.
4359 (renamesyms): Avoid extra obstack_init.
4360 * src/freeze.c (reload_frozen_state): Remove debug comment.
4361 (produce_frozen_state): Simplify fprintf to puts where possible.
4362 * modules/modtest.c (modtest_init, modtest_finish): Likewise.
4363 * modules/import.c (import, symbol_fail, modules_fail): Likewise.
4364 * m4/macro.c (trace_flush): Likewise.
4365 * m4/debug.c (m4_debug_message_prefix): Likewise.
4366 * m4/path.c (include_dump): Likewise.
4367 * m4/module.c (module_remove): Likewise.
4368 (install_builtin_table): Simplify malloc and string
4371 2006-09-26 Eric Blake <ebb9@byu.net>
4373 * m4/m4module.h (m4_symbol_print): New prototype.
4374 (M4_DEBUG_TRACE_STACK): New enumerator.
4375 (m4_is_debug_bit): Allow use without requiring m4private.h.
4376 * m4/symtab.c (symbol_value_print, m4_symbol_print): New
4378 * modules/m4.c (dump_symbol_CB, m4_dump_symbols): Speed up
4380 (dumpdef): Allow printing pushdef'd stacks.
4381 * m4/debug.c (m4_debug_decode): Add new 's' debug mode.
4382 * src/main.c (usage): Document it.
4383 * doc/m4.texinfo (Dumpdef, Debug Levels): Likewise.
4386 * configure.ac (AC_CONFIG_HEADERS): Place <config.h> with other
4388 * Makefile.am (AUTOMAKE_OPTIONS): Add nostdinc, to reduce length
4389 of lines during make.
4390 (AM_CPPFLAGS): Remove unneeded include path.
4391 (src_m4_CPPFLAGS): Remove redundant include path.
4392 * m4/system_.h Make preprocessor indentation consistent.
4393 (M4_DIRSEP_CHAR, M4_PATHSEP_CHAR, M4_GNUC_FORMAT): Remove unused
4395 (UNIX, W32_NATIVE, OS2): Update platform recognition macros from
4397 (M4_GNUC_PRINTF, M4_GNUC_SCANF, M4_GNUC_NORETURN)
4398 (M4_GNUC_CONST, M4_GNUC_UNUSED): Mangle names properly for header.
4399 (bool, true, false): Don't undefine here; stdbool takes care of
4401 * src/m4.h (includes): Assume config.h, and several standard
4403 (__CYGWIN__, WIN32): Don't define here; let system.h do it.
4404 * m4/m4private.h: Assume config.h.
4405 * m4/output.c: Likewise.
4406 * m4/path.c: Likewise.
4407 * m4/resyntax.c: Likewise.
4408 * m4/utility.c: Likewise.
4409 * modules/gnu.c: Likewise.
4410 * modules/import.c: Likewise.
4411 * modules/load.c: Likewise.
4412 * modules/m4.c: Likewise.
4413 * modules/modtest.c: Likewise.
4414 * modules/mpeval.c: Likewise.
4415 * modules/perl.c: Likewise.
4416 * modules/shadow.c: Likewise.
4417 * modules/stdlib.c: Likewise.
4418 * modules/time.c: Likewise.
4419 * modules/traditional.c: Likewise.
4421 2006-09-21 Eric Blake <ebb9@byu.net>
4423 * doc/m4.texinfo (Invoking m4): Add clarification on option
4424 processing behavior.
4425 * tests/options.at (option grouping): Test this.
4427 Reported by Mikhail Teterin.
4429 * bootstrap: Add --force option, based on idea from coreutils.
4430 * README: Document that ./bootstrap and autoreconf are for
4431 developers, and not lightly done in tarballs.
4433 2006-09-20 Eric Blake <ebb9@byu.net>
4435 * src/main.c (usage, OPTSTRING, main): Rename -e to -i. Make
4436 warnings consistent.
4437 (long_options, HASHSIZE_OPTION): Warn on -H.
4438 * doc/m4.texinfo (Invoking m4): Document this.
4439 * tests/options.at (deprecated options): Update.
4441 Change the default of interactive sessions to match sh.
4442 * src/main.c (usage): Document this.
4443 (enum interactive_choice): New enum.
4444 (main): Use it to defer decision of interactive until after
4445 argument processing.
4446 * doc/m4.texinfo (Invoking m4): Document this.
4447 * NEWS: Likewise, plus add missing mention of -b.
4448 Reported by Stepan Kasal.
4450 2006-09-19 Eric Blake <ebb9@byu.net>
4452 * src/main.c (usage, main, DEBUGFILE_OPTION): Deprecate -o as
4453 well as --error-output; the goal is to add -o/--output in some
4454 future version with semantics like gcc or autom4te.
4455 * doc/m4.texinfo (Invoking m4, Dumpdef, Debug Output, Errprint):
4456 (Extensions): Reflect this update.
4457 (Renamesyms): Add another test.
4458 (Defn): Xfail for now, so that `make check' is happy.
4459 * NEWS: Document this change.
4460 * tests/generate.awk: Mark dynamic loading tests as such. Allow
4462 * tests/macros.at (Renamesyms collisions): New test, exposing
4463 renamesyms' coredump.
4464 * tests/options.at (--debugfile, --safer): Update to match
4467 * m4/debug.c (set_debug_file): Fix regression in -o when stdout
4468 and stderr are same file, introduced 2003-07-23.
4469 * tests/options.at (--debugfile): New test, to catch the bug.
4470 (deprecated options): Test --error-output.
4471 * src/main.c (usage, main, long_options, ERROR_OUTPUT_OPTION):
4472 Deprecate --error-output, and replace it with --debugfile.
4473 * doc/m4.texinfo (Invoking m4, Debug Output, Dumpdef, Errprint):
4474 Document this change.
4477 2006-09-18 Eric Blake <ebb9@byu.net>
4479 * modules/load.c (modules): Rename to...
4480 (m4modules): ...this, since it is an English word with 0
4482 * modules/gnu.c (symbols, m4symbols): Likewise.
4483 * doc/m4.texinfo (Listing Modules): Rename to...
4484 (M4modules): ...this.
4485 (Symbols): Rename to...
4486 (M4symbols): ...this.
4487 (Load, Foreach, Trace, Answers): Update to new spellings.
4488 * NEWS: Document this.
4490 * modules/m4.c (traceon, traceoff): Change to Solaris semantics,
4491 such that without arguments, the global trace flag is changed
4492 rather than walking the table of all currently-defined macros.
4493 (set_trace_CB): No longer needed.
4494 * m4/m4module.h (m4_set_symbol_name_traced): Add a parameter.
4495 (m4_set_symbol_traced): Delete.
4496 (m4_symtab_create): Nuke the nuke parameter.
4497 * m4/m4private.h (m4_get_symbol_value): Delete.
4498 * m4/symtab.c (m4_symbol_popdef): No more need for nuke_trace.
4499 (m4_set_symbol_name_traced): Free undefined entries that are no
4501 (symbol_destroy_CB): Update caller.
4502 * m4/m4.c (m4_create): Update caller.
4503 * src/main.c (main): Likewise.
4504 (usage): Fix typo in last commit.
4505 * doc/m4.texinfo: Minor cleanups throughout.
4506 (Debugging, Dumpdef, Trace, Debug Levels, Debug Output): Merge
4507 more nodes from branch.
4508 (Trace): Document new semantics, and how to simulate the old.
4509 * tests/builtins.at (multiquotes): Adjust to new semantics.
4510 * NEWS: Update somewhat.
4512 2006-09-14 Eric Blake <ebb9@byu.net>
4514 Add --safer option, per debian bug 5898.
4515 * src/main.c (usage): Document new option.
4516 (SAFER_OPTION): New enumerator.
4517 (main): Set the option bit.
4518 * m4/m4module.h (m4_context_opt_bit_table): Declare new bit
4520 * m4/m4private.h (M4_OPT_SAFER_BIT): New macro.
4521 (m4_get_safer_opt): New accessor.
4522 * modules/gnu.c (esyscmd, debugfile): Disable when --safer.
4523 * modules/m4.c (syscmd, maketemp): Likewise.
4524 * doc/m4.texinfo (Invoking m4, Debug Output, Syscmd, Esyscmd)
4525 (Sysval, Maketemp): Add tests of this.
4526 * tests/options.at (--safer): Likewise.
4528 2006-09-13 Eric Blake <ebb9@byu.net>
4530 * tests/modules.at (AT_CHECK_M4_MODTEST): Use AT_CHECK_M4, for
4532 Reported by Ralf Wildenhues.
4535 * Makefile.am (check_LTLIBRARIES): Build test libraries in the
4536 tests directory, so we can be sure an installed build is not
4537 picking up uninstalled non-test libraries.
4538 (check-local, installcheck-local): Depend on test libraries.
4539 * tests/modules.at (AT_CHECK_M4_MODTEST): Don't use options
4540 after file name. Fix quoting. Remove skipping the test, now
4541 that makefile guarantees test modules will exist.
4542 (Freezing modules, modules: shadow, modules: unload)
4543 (modules: trace): Always put test modules in module path.
4544 (modules: importing): Likewise, and rely on AT_CHECK_M4 for
4546 * src/main.c (usage): Document default module search path.
4547 (import_environment, frozen_file_to_read, frozen_file_to_write):
4550 * tests/testsuite.at (AT_CHECK_M4): Filter stderr here...
4551 * tests/m4.in: ...not here.
4552 Reported by Ralf Wildenhues.
4554 2006-09-08 Eric Blake <ebb9@byu.net>
4556 * bootstrap: Kill unrelated copy-n-paste code from argument
4557 parsing. Let Makefile generate testsuite.
4558 * Makefile.am (EXTRA_DIST): Remove examples/WWW/man/Makefile.
4560 2006-09-07 Eric Blake <ebb9@byu.net>
4562 * m4/m4module.h (m4_peek_input): No longer export.
4563 (m4_error_at_line, m4_warn_at_line): New prototypes.
4564 (m4_is_symbol_void): New macro.
4565 (m4_push_file): Update prototype.
4566 * m4/m4private.h (m4__peek_token): New prototype.
4567 (M4_TOKEN_OPEN, M4_TOKEN_COMMA, M4_TOKEN_CLOSE): New enumerators.
4568 * m4/utility.c (m4_error_at_line, m4_warn_at_line): New functions.
4569 * src/main.c (main): Allow reading from stdin twice.
4570 * modules/m4.c (include): Adjust to new prototype.
4571 * m4/input.c: General comment cleanup.
4572 (file_peek, file_read, file_unget, push_file): Set end flag on
4573 EOF, so that we don't call getc twice.
4574 (push_file, file_clean): Port fix from branch to avoid closing
4576 (pop_input): Port fix from branch to avoid reading free'd memory
4577 when input ends mid-string.
4578 (m4_pop_wrapup): Port fix from branch to allow multiple m4wraps.
4579 (string_peek, string_read): Always use unsigned char.
4580 (m4_skip_line): Warn when dnl cut short by EOF.
4581 (peek_input): Rename from m4_peek_input.
4582 (match_input): Update signature, to distinguish between `(' token
4583 and multi-char quote or comment beginning with `('.
4584 (m4_input_exit): Cleanup now done in m4_pop_wrapup.
4585 (m4__peek_token): New function, ported from branch.
4586 (m4__next_token): Update to new token types.
4587 * m4/macro.c (expand_token, expand_argument): Use peek_token.
4588 * doc/m4.texinfo (Pseudo Arguments, Defn, Answers): Fix typos.
4589 (Invoking m4): Remerge from branch.
4591 * Makefile.am ($(TESTSUITE)): Revert patch from 2006-09-05...
4592 (check-local): and put dependency here.
4593 Reported by Ralf Wildenhues.
4595 2006-09-05 Eric Blake <ebb9@byu.net>
4597 * m4/m4module.h (m4_debug_message): New prototype.
4598 (M4_DEBUG_TRACE_MODULE): New debug bit.
4599 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
4600 (M4_DEBUG_MESSAGE2): Delete these macros.
4601 * m4/debug.c (m4_debug_message): New method.
4602 (m4_debug_decode): Add module tracing as flag `m'.
4603 * m4/input.c (m4_push_file, file_clean): Use new method.
4604 * m4/path.c (m4_path_search): Likewise.
4605 * po/Makevars (XGETTEXT_OPTIONS): Likewise.
4606 * m4/module.c (install_builtin_table, install_macro_table)
4607 (m4__module_open, module_close, module_remove): Promote several
4608 module debug messages outside of DEBUG_MODULES.
4609 (m4__module_init, module_remove) [DEBUG_MODULES]: Don't mix
4610 DEBUG_MODULES with normal trace output.
4611 * src/main.c (usage): Document new flag.
4612 * doc/m4.texinfo (Debug Levels): Likewise.
4613 * Makefile.am ($(TESTSUITE)): Add missing dependency.
4614 * tests/m4.in: Neutralize platform-dependent module filenames.
4615 * tests/options.at (--debug): Update expected output.
4617 2006-09-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4619 * doc/m4.texinfo: Fix some typos.
4620 * tests/others.at: Likewise.
4622 2006-09-05 Eric Blake <ebb9@byu.net>
4624 * m4/input.c (lex_debug): Remove dead code that broke compilation
4625 with --enable-debug.
4626 * m4/module.c (install_builtin_table, install_macro_table)
4627 (m4__module_init, m4__module_open, module_close)
4628 (module_remove): Fix compilation when --enable-debug.
4629 * m4/output.c (m4_shipout_text): Likewise.
4630 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Preload all static
4631 libraries when --enable-debug.
4632 * configure.ac (DYNAMIC_MODULES): New variable, to pass
4633 information to testsuite.
4634 (modules to preload): Determine modules after we know whether
4635 shared libraries are supported.
4636 * tests/atlocal.in (DYNAMIC_MODULES): Substitute this into
4638 * tests/testsuite.at (AT_CHECK_DYNAMIC_MODULE): New macro.
4639 * tests/modules.at (Freezing modules, AT_CHECK_M4_MODTEST)
4640 (modules: shadow, modules: unload, modules: importing)
4641 (modules: trace): Use new macro.
4642 * tests/builtins.at (gmp): Likewise.
4644 * m4/macro.c (expansion_level, macro_call_id): Change to size_t.
4646 (expand_token): Avoid assertion just added to docs.
4647 (expand_macro): Track pending expansions, for when a symbol's
4648 definition changes during argument collection.
4649 (m4_macro_call, process_macro): Operate on symbol value, not
4650 symbol, since symbol may have changed during argument collection.
4651 * m4/m4private.h (m4_symbol_value): Add pending_expansions member.
4652 (VALUE_PENDING, SYMBOL_PENDING, VALUE_DELETED_BIT): New defines.
4653 (m4_get_symbol_value): Add fast macro version.
4654 * m4/m4module.h (M4_BUILTIN_FLAGS_MASK): New enumerator.
4655 (m4_macro_call): Adjust prototype.
4656 * m4/module.c (install_builtin_table): Check that flags are valid
4657 when creating builtin.
4658 * m4/symtab.c (m4__symtab_remove_module_references): Use
4659 m4_symbol_value_delete, rather than inlining it.
4660 (m4_symbol_value_copy): Copy placeholder text.
4661 (symbol_popval): Use m4_symbol_value_delete.
4662 (m4_symbol_value_delete): Implementation was missing when NDEBUG.
4663 Handle pending expansions.
4664 * modules/gnu.c (indir): Update to new prototype.
4665 * doc/m4.texinfo: Fix menus to be consistent with section names.
4666 (Defn): Add test that macro tokens flatten to empty string;
4667 triggered an assert before this patch.
4668 (Ifelse): Merge another node.
4669 (Loops): Split into...
4670 (Forloop, Foreach): New nodes; work is still underway on them.
4671 (Answers): Add more info on foreach macro; work is still underway.
4672 (Indir): Add test that indir collects arguments before looking up
4674 * TODO: Update based on this patch.
4676 2006-09-01 Eric Blake <ebb9@byu.net>
4678 * m4/m4.c (m4_create): Fix latent bug since 2003-10-08.
4679 * m4/hash.h (m4_free_hash_iterator): New prototype.
4680 * m4/hash.c (struct m4_hash) [!NDEBUG]: Add iter member, to
4681 ensure we don't do unsafe things while iterating.
4682 (HASH_ITER, ITER_CHAIN): New accessor macros.
4683 (m4_hash_new, m4_hash_resize, maybe_grow): Fix malloc typing bug.
4684 (m4_hash_delete, m4_hash_insert): Unsafe while iterating.
4685 (m4_hash_remove) [!NDEBUG]: Enforce safety while iterating.
4686 (m4_get_hash_iterator_next) [!NDEBUG]: Track current iterators,
4687 to catch unsafe actions.
4688 (m4_free_hash_iterator): New function, to avoid memory leaks, and
4689 when debugging, to track safe actions.
4690 (m4_hash_apply): Avoid memory leak.
4691 * m4/symtab.c (m4_symtab_apply): Likewise.
4692 * ltdl/m4/gnulib-cache.m4: Remove getopt from here; it is pulled
4693 in manually to src/ for now.
4694 * tests/builtins.at (gmp): Add keyword module.
4695 * tests/modules.at (Freezing modules, modules: shadow)
4696 (modules: unload, modules: importing, modules: trace): Likewise.
4698 2006-08-30 Eric Blake <ebb9@byu.net>
4700 * m4/utility.c (m4_warn): Factor "Warning" out of messages into
4702 (m4_bad_argc, m4_numeric_arg): Update all callers.
4703 * m4/macro.c (m4_macro_call): Likewise.
4704 * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
4705 (Indir, Builtin, Ifdef): More doc merges.
4706 (Loops): Mention that documenting foreach would be nice.
4707 (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
4708 (Include, Eval, Location, M4exit): s/input.m4/stdin/.
4709 * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
4710 (substitute, syncoutput): Update all m4_warn callers.
4711 * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
4712 (traceon, traceoff): Make warning message consistent.
4713 (define, pushdef): Update all m4_warn callers.
4714 * tests/generate.awk: Choose file name so that documentation can
4715 show command-line behavior.
4716 * tests/builtins.at (define): Update to new wording.
4717 * tests/macros.at (pushdef/popdef): Likewise.
4718 * tests/freeze.at (loading format 1): Likewise.
4719 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4721 * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
4723 (Defn): Add failing test case for mixing text and builtin.
4724 (Renamesyms): Improve wording, and identify core dump that needs
4727 2006-08-29 Eric Blake <ebb9@byu.net>
4729 * doc/m4.texinfo (Quoting Arguments, Definitions, Define)
4730 (Arguments, Pseudo Arguments): More doc merges from the branch.
4731 (Macro expansion): Turn example into test.
4732 (Pseudo Arguments): Add example of avoiding argument.
4733 * modules/m4.c (undefine, popdef): Accept multiple arguments.
4734 (define, pushdef): Warn on non-text macro name.
4735 (ifelse, m4_dump_symbols, defn, traceon, traceoff): Tweak
4736 warning/error messages.
4737 (ifdef): Ignore extra arguments.
4738 * m4/symtab.c (m4_symbol_value_copy): Avoid memory leak.
4739 (m4__symtab_remove_module_references): Check that there is no leak.
4740 * tests/macros.at (pushdef/popdef): Update to new message.
4741 * tests/builtins.at (define): Likewise.
4742 * tests/freeze.at (loading format 1): Likewise.
4743 * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.
4745 * m4/m4private.h (m4_get_syntax_lquote, m4_get_syntax_rquote)
4746 (m4_get_syntax_bcomm, m4_get_syntax_ecomm) [NDEBUG]: Use same type
4747 as accessor function, to avoid compiler warning.
4748 * m4/module.c (m4__module_open): Move declaration of variable to
4749 avoid compiler warning.
4750 * src/main.c (main): Avoid shadowing a global variable.
4751 * src/freeze.c (produce_symbol_dump): Avoid unused variable
4752 warning when NDEBUG.
4753 * tests/options.at (--discard-comments, --import-environment)
4754 (--debug, --prepend-include, --help and --version): Rename tests
4755 to name option tested.
4757 2006-08-28 Eric Blake <ebb9@byu.net>
4759 * m4/utility.c (m4_bad_argc): Move assertion out of hot path...
4760 * m4/module.c (install_builtin_table): ...to here, and add
4761 assertion that blind macros require arguments.
4762 * m4/m4module.h (struct m4_builtin): Document restrictions that
4763 must be met during module loading.
4764 * modules/gnu.c (changeresyntax, changesyntax): These are blind,
4765 so require an argument to avoid triggering assertion.
4766 (debugfile): Tweak error message.
4768 2006-08-25 Eric Blake <ebb9@byu.net>
4770 * m4/m4module.h (M4_BUILTIN_GROKS_MACRO, M4_BUILTIN_BLIND)
4771 (M4_BUILTIN_SIDE_EFFECT): New enumerators.
4772 (struct m4_builtin): New member flags replaces groks_macro_args,
4773 blind_if_no_args. min_args and max_args are now 0-based.
4774 Rearrange members to reduce size on platforms where function
4775 pointers are 64 bits but regular pointers are 32.
4776 (m4_bad_argc): Add argument.
4777 * m4/m4private.h (VALUE_SIDE_EFFECT_ARGS_BIT): New define.
4778 * m4/utility.c (m4_bad_argc): Simplify calculation, and take side
4779 effect into account.
4780 * m4/module.c (install_builtin_table): Adjust all users affected
4782 * m4/macro.c (m4_macro_call): Likewise.
4783 * src/freeze.c (reload_frozen_state): Likewise.
4784 * modules/m4.c (builtin_functions, ifelse, syscmd): Likewise.
4785 * modules/gnu.c (builtin_functions, builtin, esyscmd): Likewise.
4786 * modules/import.c (builtin_functions): Likewise.
4787 * modules/load.c (builtin_functions): Likewise.
4788 * modules/modtest.c (builtin_functions): Likewise.
4789 * modules/mpeval.c (builtin_functions): Likewise.
4790 * modules/perl.c (builtin_functions): Likewise.
4791 * modules/shadow.c (builtin_functions): Likewise.
4792 * modules/stdlib.c (builtin_functions): Likewise.
4793 * modules/time.c (builtin_functions, mktime_functions)
4794 (strftime_functions): Likewise.
4795 * doc/m4.texinfo (Loops): Update test now that shift is blind.
4796 (Macro Arguments): Fix typo in test.
4797 (Patsubst): Fix typo in test.
4798 * modules/gnu.c (m4_regexp_substitute): Don't skip empty match at
4799 end of string. Fix return value when ignore_duplicates.
4800 * tests/builtins.at (patsubst): Fix typo in test.
4802 * tests/options.at (debug-flags): Update to reflect new message.
4803 (deprecated options, prepend-include, help and version): New
4805 * tests/testsuite.at (AT_CHECK_M4): Avoid hanging testsuite if
4806 test omits an input file name.
4807 * src/main.c (long_options, main): Add -B/--prepend-include.
4808 (usage): Document it.
4809 (main): `m4 --help --version' now displays help, not version.
4810 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4811 dirname filenamecat.
4812 * m4/m4module.h (m4_add_include_directory): Add parameter.
4813 * m4/m4private.h (m4__include_init): New prototype.
4814 * m4/m4.c (m4_create): Put `.' on path before options are
4816 * m4/path.c (includes): Assume C89. Use gnulib for file name
4818 (m4__include_init): New function.
4819 (search_path_add): Allow prepending.
4820 (m4_add_include_directory, search_path_env_init): Adjust callers.
4821 (m4_path_search): Relative names now invoke path search, since
4822 `.' might not be first.
4823 * doc/m4.texinfo (Invoking m4, Search Path): Document new option.
4825 2006-08-25 Bruno Haible <bruno@clisp.org> (tiny change)
4826 and Eric Blake <ebb9@byu.net>
4828 * bootstrap: Run autopoint before gnulib-tool, since autopoint
4829 0.15 installs macros obsoleted by current gnulib.
4831 2006-08-25 Eric Blake <ebb9@byu.net>
4833 * doc/m4.texinfo (Macro Arguments): Another section merged;
4834 testsuite failures now exposed.
4836 2006-08-23 Eric Blake <ebb9@byu.net>
4838 * doc/m4.texinfo (Quoted strings, Other tokens, Comments)
4839 (Input processing): More doc merges from the branch.
4840 (Regular expression syntax): Add introductory text.
4841 (Inhibiting Invocation): More doc merges from the branch.
4842 (Other tokens): Reorder after comments.
4843 * tests/generate.awk: Allow passing options to doc examples.
4845 2006-08-22 Eric Blake <ebb9@byu.net>
4847 * tests/options.at (debug-flags): New test.
4848 * m4/m4module.h (M4_DEBUG_TRACE_VERBOSE): Make sure this value is
4849 not negative, to distinguish failure in m4_debug_decode.
4850 (m4_debug_decode): Add new parameter.
4851 * modules/gnu.c (regexp): Slight cleanup.
4852 (renamesyms): Ignore excess arguments.
4853 (syncoutput): Make case-insensitive, warn on bad argument.
4854 (debugmode): Factor -+ handling out to...
4855 * m4/debug.c (m4_debug_decode): ...here.
4856 (m4_debug_message_prefix): Fix spacing.
4857 * src/main.c (main): Let -d option adjust flags.
4858 * m4/input.c (file_clean): Avoid printing empty file name.
4859 * doc/m4.texinfo (Syncoutput): Document new range of input.
4860 (Invoking m4): Document use of multiple -d flags.
4862 Start porting various fixes from the branch that use gnulib.
4863 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4864 binary-io cloexec close-stream fopen-safer getopt gnupload mkstemp
4865 regexprops-generic stdlib-safer unlocked-io.
4866 * m4/debug.c (m4_debug_set_output): Close debug file on exec.
4867 * m4/path.c (m4_path_search): Close input file on exec, reject
4868 empty file name, fix parameter naming.
4869 * m4/output.c (make_room_for): Close diversion file on exec.
4870 (includes): Assume C89 headers.
4871 (tmpfile): For now, we don't want tmpfile-safer, because we want
4873 * m4/m4private.h (includes): Use various gnulib headers.
4874 * doc/regexprops-generic.texi: Use gnulib's copy.
4876 * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
4877 * AUTHORS: Add copyright.
4878 * ChangeLog: Likewise.
4879 * README: Likewise. Require automake 1.9b or later.
4880 * HACKING: New file.
4881 * README-alpha: Add copyright.
4882 * THANKS: Likewise. Update.
4883 * doc/STYLE: Add copyright, and tweak for changed directories.
4884 * modules/README: Add copyright, and tweak for libtool version.
4885 * examples/COPYING: New file.
4886 * examples/WWW/COPYING: Likewise.
4887 * examples/WWW/m4lib/COPYING: Likewise.
4888 * modules/shadow.m4: Add copyright.
4889 * modules/perl.m4: Likewise.
4890 * modules/modtest.m4: Likewise.
4891 * modules/stdlib.m4: Likewise.
4892 * modules/time.m4: Likewise.
4893 * modules/time2.m4: Likewise.
4894 * po/Makevars: Likewise.
4895 * tests/iso8859.m4: Likewise.
4896 * tests/m4.in: Likewise.
4897 * NEWS: Add (C) to copyright.
4899 * m4/system_.h: Likewise.
4900 * tests/atlocal.in: Likewise.
4901 * tests/builtins.at: Likewise.
4902 * tests/freeze.at: Likewise.
4903 * tests/generate.awk: Likewise.
4904 * tests/macros.at: Likewise.
4905 * tests/modules.at: Likewise.
4906 * tests/options.at: Likewise.
4907 * tests/others.at: Likewise.
4908 * tests/testsuite.at: Likewise.
4909 * m4/utility.c: Spell out copyright years.
4910 * src/main.c: Likewise.
4912 * doc/m4.texinfo (Bugs, Manual, Syntax): Sync from branch.
4914 2006-08-21 Eric Blake <ebb9@byu.net>
4916 * configure.ac (AC_CHECK_HEADERS_ONCE): Check for <sys/wait.h>.
4917 * modules/gnu.c (esyscmd): Use -1 for failure. Set sysval to 0
4918 when no arguments are given, but without losing warning about 0
4920 * modules/m4.c (syscmd): Likewise.
4921 (includes): Assume C89.
4922 (m4_sysval): Make static.
4923 (M4_SYSVAL_EXITBITS, M4_SYSVAL_TERMSIGBITS): New macros.
4924 (sysval): Port calculation from branch.
4926 2006-08-20 Eric Blake <ebb9@byu.net>
4928 * m4/macro.c (expand_macro): Move argument check...
4929 (m4_macro_call): ...to here, so indir will warn.
4930 * modules/gnu.c (__program__): New macro, ported from branch.
4931 (builtin): Perform argument check.
4932 (changesyntax): Avoid out-of-bounds read.
4934 * modules/gnu.c (includes): Assume stdlib.h, errno.
4935 (m4_regexp_compile): Add no_sub parameter, avoid memory leaks.
4936 (substitute): Add caller parameter, avoid out-of-bounds memory
4938 (m4_regexp_substitute, patsubst, regexp, renamesyms): Adjust
4941 2006-08-16 Eric Blake <ebb9@byu.net>
4943 * po/POTFILES.in: Add more files that contain translatable
4945 * po/Makevars (XGETTEXT_OPTIONS): Add options to pass more
4946 information to translators.
4947 (USE_MSGCTXT): New var for gettext 0.15.
4948 * m4/input.c (file_clean, m4_push_file, m4__next_token): Start
4949 debug/trace messages in lower case.
4950 * m4/macro.c (expand_argument): Likewise.
4951 * m4/path.c (m4_path_search): Likewise.
4952 * src/main.c (main): Likewise.
4954 2006-08-14 Eric Blake <ebb9@byu.net>
4956 * src/main.c (usage): Document --import-environment.
4957 * doc/m4.texinfo (History, Invoking m4): Synchronize from branch.
4959 2006-08-11 Eric Blake <ebb9@byu.net>
4961 * bootstrap (func_get_translations): Only remove files when doing
4963 (func_update_po): Avoid CDPATH problems.
4965 2006-08-10 Eric Blake <ebb9@byu.net>
4967 * bootstrap (func_get_translations): New function.
4968 (func_update_po): Borrow ideas from tar to correctly pull in
4969 translations from newer location.
4971 2006-08-09 Eric Blake <ebb9@byu.net>
4973 * bootstrap: Recent gnulib no longer has jm_* macros to worry
4975 * ltdl/m4/gnulib-cache.m4: Augment with gnulib-tool --import
4977 * m4/m4module.h (M4ERROR, M4WARN): Delete, replaced by...
4978 (m4_error, m4_warn): ... these new prototypes.
4979 (m4_current_file, m4_current_line): Move into context, rather
4980 than leaving as globals.
4981 (m4_insert_file, m4_insert_diversion, m4_freeze_diversions)
4982 (m4_undivert_all, m4_input_init): Now takes context.
4983 * m4/utility.c (m4_error, m4_warn): New functions.
4984 * m4/m4private.h: Assume errno exists.
4985 (struct m4): Move warning_status to a bit flag,
4986 and add exit_status. Adjust accessors accordingly.
4987 * src/main.c (print_program_name_CB): No longer needed.
4988 (main): Use new m4_get_fatal_warnings_opt.
4989 * m4/debug.c: Adjust all callers of M4WARN and M4ERROR, and abort
4990 instead of issuing "INTERNAL ERROR". Pass context when needed,
4991 and use new accessors.
4992 * m4/input.c: Likewise.
4993 * m4/macro.c: Likewise.
4994 * m4/output.c: Likewise.
4995 * m4/utility.c: Likewise.
4996 * modules/evalparse.c: Likewise.
4997 * modules/gnu.c: Likewise.
4998 * modules/load.c: Likewise.
4999 * modules/m4.c: Likewise.
5000 * modules/mpeval.c: Likewise.
5001 * src/freeze.c: Likewise.
5002 * src/main.c: Likewise.
5003 * tests/macros.at: Adjust to new message format.
5004 * tests/builtins.at: Likewise.
5005 * tests/freeze.at: Likewise.
5006 * tests/modules.at: Likewise.
5007 * doc/m4.texinfo: Likewise.
5009 * configure.ac (AM_GNU_GETTEXT, AM_GNU_GETTEXT_VERSION): Require
5012 2006-08-03 Eric Blake <ebb9@byu.net>
5014 * src/stackovf.c (setup_stackovf_trap): Port patch from branch to
5015 gracefully handle ENOSYS.
5019 2006-07-28 Eric Blake <ebb9@byu.net>
5021 * src/freeze.c (reload_frozen_state): Copy string when creating
5022 placeholder, to avoid memory corruption.
5023 * m4/symtab.c (symbol_popval): Avoid memory leak.
5024 (m4_symbol_rename): Avoid shadowing rename function.
5025 (dump_symbol_CB, symtab_dump) [DEBUG_SYM]: Fix compilation.
5026 * tests/freeze.at (reloading unknown builtin): Add test.
5027 * tests/generate.awk: Capture m4.texinfo line number in
5028 testsuite.log, not just generated.at.
5030 Port idea from branch that a frozen file can request an unknown
5031 builtin without producing a warning unless the builtin is
5033 * m4/m4private.h (m4__symbol_type): Add M4_SYMBOL_PLACEHOLDER.
5034 (m4_is_symbol_value_placeholder, m4_get_symbol_value_placeholder)
5035 (m4_set_symbol_value_placeholder): New accessors.
5036 * m4/m4module.h (m4_is_symbol_placeholder),
5037 (m4_get_symbol_value_placeholder),
5038 (m4_set_symbol_value_placeholder),
5039 (m4_get_symbol_placeholder): Likewise.
5040 * m4/symtab.c (m4_is_symbol_value_placeholder),
5041 (m4_get_symbol_value_placeholder),
5042 (m4_set_symbol_value_placeholder): Likewise.
5043 (dump_symbol_CB): Handle new symbol type.
5044 * m4/macro.c (trace_pre): Likewise.
5045 (m4_macro_call): Warn when invoking a placeholder.
5046 * modules/m4.c (dumpdef): Handle dumping a placeholder.
5047 (defn): Warn when referencing a placeholder.
5048 * src/freeze.c (dump_symbol_CB): Ignore placeholder when
5050 (reload_frozen_state): When reloading unknown builtin, install a
5051 placeholder instead of warning.
5052 * tests/freeze.at (loading format 1): Allow warning when
5053 popdef'ing undefined function.
5055 2006-07-27 Paul Eggert <eggert@cs.ucla.edu> (tiny change)
5057 * m4/hash.c (m4_hash_string_hash): Don't case-fold in the hash
5058 function. Shift by 7, not 3, for consistency with
5059 gnulib/lib/hash.c. Don't assume hash word is 32 bits.
5061 2006-07-27 Eric Blake <ebb9@byu.net>
5063 * src/main.c (usage): Update to match branch.
5064 (main): Update --version info to distinguish between program name
5065 `m4' and package name `GNU M4'.
5066 (AUTHORS): Translate René Seindal's name.
5067 * configure.ac (TIMESTAMP): Remove now-redundant parentheses.
5068 * Makefile.am (doc/m4.1): Update to match branch.
5069 * m4/m4.c (DEFAULT_NESTING_LIMIT): Raise to 1024, to match
5072 * m4/system_.h (EXIT_MISMATCH): Define.
5073 * src/main.c (main): Don't clear syntax table for version 1.
5074 (usage): Document exit status.
5075 * src/freeze.c (reload_frozen_state): Port GET_DIRECTIVE from the
5076 branch, and require V directive to appear first in file. Fix
5077 broken logic for detecting F and T in version 1 files.
5079 2006-07-22 Eric Blake <ebb9@byu.net>
5081 * src/main.c (stackovf_handler): Document the problems in our
5083 * src/stackovf.c: Forward port changes in branch to use POSIX
5084 sa_sigaction when available.
5085 (process_sigsegv): Avoid buffer overrun when error string is
5086 translated, although the fact that we translate in a signal
5087 handler is still a bug.
5088 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Forward port changes
5089 from branch to modernize checks.
5091 * modules/format.c (format): Avoid compiler warning that str may
5092 be used uninitialized.
5094 * m4/m4private.h (DEBUG_MODULES, DEBUG_STKOVF) [DEBUG]: Fix
5096 (DEBUG_SYNTAX) [DEBUG]: Turn on more debug.
5097 (DEBUG_MACRO): Remove unused macro.
5098 * src/stackovf.c: Avoid compiler warnings.
5099 * m4/input.c: Likewise.
5100 * m4/module.c: Likewise.
5101 * m4/output.c: Likewise.
5102 * m4/path.c: Likewise.
5103 * m4/symtab.c: Likewise.
5104 * m4/syntax.c: Likewise.
5106 2006-07-20 Eric Blake <ebb9@byu.net>
5108 * ltdl/m4/gnulib-cache.m4: gnulib-tool has changed again.
5109 Regenerate to explicitly ask for --assume-autoconf=2.60.
5111 2006-07-19 Eric Blake <ebb9@byu.net>
5113 * po/ChangeLog: Merge into main ChangeLog, then delete file.
5116 * doc/m4.texinfo (copying): Relax restriction on front-cover and
5119 2006-07-17 Eric Blake <ebb9@byu.net>
5121 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump requirement to
5124 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5126 * modules/format.c (includes): Use xvasprintf.h.
5127 (format): Make static. Avoid buffer overflow, that can lead to
5128 arbitrary code execution exploit. Only pass unsigned char to
5129 is*(). Support F, g, and G specifiers.
5130 * doc/m4.texinfo (Format): Expose buffer overrun bug. Document
5133 2006-07-17 Gary V. Vaughan <gary@gnu.org>
5135 Ensure M4 compiles correctly with -DDEBUG, and use a single
5136 consistent definition of various /DEBUG_[A-Z]+/ symbols:
5138 * m4/input.c: Have commented out out DEBUG_INPUT only by default.
5139 (m4_print_token): Use m4_get_symbol_value_text and
5140 m4_get_symbol_value_func calls instead of obsolescent VALUE_TEXT
5141 and VALUE_FUNC respectively.
5142 (m4__next_token): Use m4_print_token call instead of obsolescent
5144 * m4/module.c: Have commented out out DEBUG_MODULE only by default.
5145 * m4/output.c: Similarly for DEBUG_OUTPUT.
5146 * m4/path.c: Similarly for DEBUG_INCL.
5147 * m4/symtax.c: Similarly for DEBUG_SYM.
5148 * m4/syntax.c: Similarly for DEBUG_SYNTAX.
5149 * src/stackovf.c: Similarly for DEBUG_STACKOVF.
5150 * m4/m4private.h (DEBUG): Add DEBUG_OUTPUT and DEBUG_STACKOVF to
5151 preprocessor macros defined with -DDEBUG compiles.
5153 2006-07-17 Gary V. Vaughan <gary@gnu.org> (tiny change)
5155 * bootstrap: Correct typo in --download-po argument parsing.
5157 2006-07-15 Eric Blake <ebb9@byu.net>
5159 * ltdl/m4/gnulib-cache.m4: Augment with `gnulib-tool --import
5161 * tests/generate.awk (normalize): Recognize @tabchar.
5162 * doc/m4.texinfo (Top): Start merging from branch. Remove tabs.
5163 Fix menus. Upgrade FDL license from 1.1 to 1.2. Fix overfull
5165 (Index macro, Shell commands, Incompatiblities): Rename nodes
5166 from Index, UNIX commands, Other incompat.
5167 (Platform macros, Using frozen files, Frozen file format 1)
5168 (Frozen file format 2, Copying This Manual, Indices): New nodes.
5169 * Makefile.am (EXTRA_DIST): Distribute gendocs.
5170 (MAINTAINERCLEANFILES): Clean up files from gnulib.
5171 (doc_m4_TEXINFOS): Depend on fdl.texi.
5172 (web-manual): New maintainer target.
5174 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5176 * doc/m4.texinfo (Modules): RMS asked me for an explanation of
5177 the modular architecture of M4. The result is paraphrased here
5178 for the benefit of future readers of the manual.
5180 2006-07-14 Gary V. Vaughan <gary@gnu.org> (tiny change)
5182 * Makefile.am (TESTSUITE_AT): Add missing tests/freeze.at.
5184 2006-07-14 Eric Blake <ebb9@byu.net>
5186 * src/main.c (main): Avoid compiler warning.
5187 * modules/gnu.c (renamesyms): Remove unused variable.
5189 2006-07-14 Gary V. Vaughan <gary@gnu.org>
5191 * m4/m4module.h (m4_regexp_syntax_decode, m4_regexp_syntax_encode)
5192 (m4_get_regexp_syntax_opt, m4_set_regexp_syntax_opt): Declare
5193 new functions for managing regexp syntax options.
5194 * m4/m4private.h (m4): Add regexp_syntax field.
5195 * m4/resyntax.c: New file implements the above.
5196 * Makefile.am (m4_libm4_la_SOURCES): Add m4/resyntax.c.
5197 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE, builtin_eregexp)
5198 (builtin_epatsubst, builtin_erenamsyms, m4_regexp_do)
5199 (m4_patsubst_do, m4_renamesyms_do): Removed.
5200 (builtin_changeresyntax): New builtin to change regular expression
5202 (m4_resyntax_encode_safe): Factor out diagnostics code.
5203 * src/freeze.c (produce_resyntax_dump): New function to dump
5204 default regexp syntax specifier to frozen file.
5205 (reload_frozen_state): Updated to action 'R' directive.
5206 * src/main.c (usage): Describe new -r option.
5207 (long_options, OPTSTRING): Declare it.
5208 (main): Encode and store cli regexp syntax option argument.
5209 * tests/freeze.at (regexp syntax): New test that regexp syntax
5211 * tests/generate.awk (m4_pattern_allow): Updated for renamesyms.
5212 * doc/m4.texinfo (Erenamesyms and Renamesyms, Eregexp and Regexp)
5213 (Epatsubst and Patsubst): Renamed to...
5214 (Renamesyms, Regexp, Patsubst): ...these respectively. Updated
5215 documentation and added new examples.
5216 (Changeresyntax): New section describing changeresyntax builtin,
5217 and regexp syntax names.
5218 (Regular expression syntax): New section describing differences
5219 between various regular expression syntaxes.
5220 (Frozen files): Document 'R' directive.
5223 2006-07-13 Gary V. Vaughan <gary@gnu.org>
5225 * bootstrap: Enhanced to work more like our other scripts:
5226 Add a copyright statement; support --version and --help; accept a
5227 --download-po option with argument as a substitute for DOWNLOAD_PO
5230 2006-07-11 Eric Blake <ebb9@byu.net>
5232 * Makefile.am (doc/m4.1): Port patch from branch that avoids
5234 * ltdl/m4/gnulib-cache.m4: Regenerate since upstream gnulib-tool
5237 2006-07-10 Gary V. Vaughan <gary@gnu.org> (tiny change)
5239 * tests/builtin.at (patsubst, regexp): Adjust these tests, now
5240 that `\0' is no longer accepted.
5242 * src/main.c (usage): Alphabetize options within their sections.
5244 * modules/gnu.c (m4_regexp_search, regsub, substitute)
5245 (esyscmd): Improve comments.
5247 * modules/gnu.c (substitute): Remove old warning for \0.
5248 (substitute_warned): No longer required. Removed.
5250 * modules/gnu.c: Put macro definitions into alphabetical order.
5252 2006-07-07 Eric Blake <ebb9@byu.net>
5254 * tests/freeze.at (loading format 1): New file, with new test.
5255 * tests/testsuite.at: Include it.
5256 * tests/macros.at (Arity, defn, and freeze): Add frozen keyword.
5257 * tests/modules.at (Freezing modules): Likewise.
5259 * configure.ac (AC_PREREQ): Autoconf 2.60 is now out.
5260 (AC_CHECK_HEADERS): Assume signal.h.
5261 (AC_CHECK_HEADERS_ONCE): Use new feature to shrink configure.
5262 (AC_CHECK_FUNCS_ONCE): Likewise.
5263 * src/m4.h (includes): Assume signal.h.
5265 2006-07-05 Eric Blake <ebb9@byu.net>
5267 Fix all testsuite failures on cygwin.
5268 * doc/m4.texinfo (Syscmd, Esyscmd): Forward-port updates from
5269 branch-1_4. Solves testsuite failure when uninstalled m4 is
5270 shadowed by redefinition of PATH in libtool wrapper.
5271 * Makefile.am (module_ldflags): Don't forget AM_LDFLAGS, which
5272 contains the -no-undefined required by cygwin.
5273 (TESTS_ENVIRONMENT): Export abs_top_builddir.
5274 * tests/others.at (misc): Port to platforms where /etc/passwd
5275 does not exist or does not contain user named root.
5276 * tests/modules.at (AT_CHECK_M4_MODTEST): Look in correct
5278 * tests/builtins.at (define, divert): Avoid overquoting.
5279 * tests/generate.awk (new_group): Likewise.
5281 2006-07-05 Gary V. Vaughan <gary@gnu.org>
5283 The regs_allocated field in a struct re_pattern_buffer refers
5284 to the state of a particular re_registers struct when used in
5285 successive matches using the same compiled pattern. Avoid a
5286 SEGV in `renamesyms' resulting from using a new re_registers
5287 with an existing re_pattern_buffer:
5289 * modules/gnu.c (m4_pattern_buffer): Wrapper struct for associated
5290 pattern buffer and registers.
5291 (m4_regexp_search): New function to call re_regexp_search with
5292 correctly matched pattern buffer and register instantiations.
5293 (m4_regexp_compile): Return an m4_pattern_buffer. Adust all
5296 2006-07-04 Gary V. Vaughan <gary@gnu.org>
5298 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Update to take into account
5299 changes to gnulib getopt.m4 since last build.
5300 * Makefile.am (src_m4_SOURCES): Only compile shipped getopt module
5301 if the system getopt fails M4_GETOPT tests.
5303 2006-06-22 Eric Blake <ebb9@byu.net>
5305 * Makefile.am (EXTRA_DIST): Distribute gnulib-cache.m4.
5306 Reported by Bruno Haible.
5308 2006-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5310 * m4/module.c (m4__module_exit): Avoid ltdl memory leak.
5312 2006-06-19 Eric Blake <ebb9@byu.net>
5316 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5318 * Makefile.am (src_m4_DEPENDENCIES): Make dependency explicit.
5319 (clean-local): Split into and depend upon...
5320 (clean-local-tests, clean-local-src): ...these two. The latter
5321 removes the libtool object directory below `src', to work around
5322 a buglet in Automake, failing to list it.
5323 (EXTRA_DIST): Distribute modules/perl.c.
5325 2006-06-19 Eric Blake <ebb9@byu.net>
5327 * Makefile.am ($(srcdir)/doc/m4.1): No need to list $(srcdir) in
5328 right side of dependency; VPATH does that.
5329 (stamp-vcl): Update to use libtool's algorithm.
5330 (EXTRA_DIST): Distribute stamp-vcl.
5331 Reported by Ralf Wildenhues.
5332 (TESTSUITE): Revert earlier change that used absolute path, as
5333 that broke 'make dist' in VPATH. Stick with $(srcdir) instead.
5334 (EXTRA_DIST): Revert earlier change of $(TESTSUITE).
5335 (TESTS_ENVIRONMENT) [USE_GMP]: Revert earlier addition, since
5336 atlocal takes care of it instead.
5337 (check-local, installcheck-local, clean-local): Inline absolute
5338 path to testsuite here, rather than relative path to testsuite
5341 2006-06-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5343 * m4/m4private.h (DELETE): Cast away const here...
5344 * src/stackovf.c (stackovf_exit): ...to avoid cast-as-lvalue here.
5345 * src/freeze.c (reload_frozen_state): Avoid uninitialized
5348 2006-06-19 Eric Blake <ebb9@byu.net>
5350 * Makefile.am (doc/m4.1): Build in $(srcdir), to match where
5351 .info pages are built.
5352 Reported by Ralf Wildenhues.
5353 (EXTRA_DIST): Inline definition of testsuite, so that make dist
5356 2006-06-16 Eric Blake <ebb9@byu.net>
5358 Follow recommendations from autoconf manual for autotest.
5359 * Makefile.am (TESTSUITE): Factor the $(srcdir) out of uses, and
5360 turn it into an absolute path until autotest provides an option
5361 that allows us to avoid changing directories. Properly quote
5363 (TESTS_ENVIRONMENT) [USE_GMP]: Inform testsuite about GMP.
5364 (check-recursive): Delete unused target.
5365 ($(TESTSUITE)): Atomically update testsuite.
5366 (CD_TESTDIR): Simplify.
5367 (m4__cd): Delete unused macro.
5368 (check-local): Let TESTSUITEFLAGS influence the run.
5369 (installcheck-local): Let TESTSUITEFLAGS override
5370 AUTOTEST_PATH. Add dependencies.
5371 (clean-local): Clean up.
5372 (DISTCLEANFILES, MAINTAINERCLEANFILES): Add directory location.
5373 * README: Document how to use the testsuite.
5375 2006-06-15 Eric Blake <ebb9@byu.net>
5377 * configure.ac (M4_DEFAULT_PRELOAD): Fix typo in last commit.
5379 * ltdl/m4/m4-error.m4 (M4_ERROR): Use M4_ instead of m4_ to avoid
5380 clashes with m4sugar.
5381 * ltdl/m4/m4-getopt.m4 (M4_GETOPT): Likewise.
5382 * ltdl/m4/m4-gettext.m4 (M4_GNU_GETTEXT): Likewise.
5383 * ltdl/m4/m4-obstack.m4 (M4_OBSTACK): Likewise.
5384 * ltdl/m4/m4-regex.m4 (M4_REGEX): Likewise.
5385 * ltdl/m4/gmp.m4 (_M4_LIB_GMP): Likewise.
5386 * ltdl/m4/stackovf.m4 (M4_SYS_STACKOVF): Likewise.
5387 * ltdl/m4/debug.m4 (M4_CHECK_DEBUGGING): Likewise.
5388 * configure.ac: Likewise.
5389 (M4_DEFAULT_PRELOAD): Use as a macro, not shell variable.
5390 * Makefile.am (src_m4_CPPFLAGS): Use STACKOVF as a makefile
5392 * ltdl/m4/m4-gnulib.m4: Delete, no longer needed.
5394 Reduce compiler warnings. Inside GMP, mpq_t is an array type, so
5395 const mpq_t is not assignable from plain mpq_t. Avoid
5396 type-punning warnings caused trying to mix these types.
5397 * modules/mpeval.c (numb_ior, numb_eor, numb_and, numb_lshift),
5398 (numb_rshift, numb_divide, numb_modulo): Remove const qualifier.
5399 * modules/evalparse.c (or_term, xor_term, and_term, shift_term),
5400 (mult_term, exp_term): Remove type-punning casts.
5401 (numb_pow): Remove const qualifier.
5402 * src/freeze.c (reload_frozen_state): Fix typo in messages.
5403 Fix variables that can be used uninitialized, which fixes
5404 security hole where malicious frozen file can execute arbitrary
5407 2006-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5409 * Makefile.am (modules_mpeval_la_LIBADD): Readd $(LIBADD_GMP).
5411 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5412 and Eric Blake <ebb9@byu.net>
5414 Allow `make dist' to work again.
5415 * Makefile.am (EXTRA_DIST): doc/helptoman.pl is gone.
5416 (MAINTAINERCLEANFILES): Avoid redundant mention of dist_man_MANS.
5417 (cvs-dist): Fix typo.
5418 * NEWS: Match current version number.
5420 2006-06-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5422 * Makefile.am (AM_CPPFLAGS): Add $(LTDLINCL), so the right
5425 * bootstrap: Do not run libtoolize manually, this is done
5426 correctly by autoreconf. Invoke autoreconf with --no-recursive
5427 to avoid unnecessary rerunning of autotools for libltdl.
5429 2006-06-13 Eric Blake <ebb9@byu.net>
5433 2006-06-12 Eric Blake <ebb9@byu.net>
5435 * m4/output.c [HAVE_MKTEMP]: Gnulib provides mkstemp, so don't
5437 * src/m4.h: Don't declare mktemp.
5438 * m4/input.c (m4__next_token): Avoid bzero.
5439 * configure.ac (AC_CHECK_FUNCS): Remove obsolete checks.
5440 * Makefile.am (doc/m4.1): Depend on installed help2man, rather
5441 than distributing outdated helptoman.pl.
5442 * doc/helptoman.pl: Delete.
5444 2006-06-10 Eric Blake <ebb9@byu.net>
5446 * README (Patches): Document the current dependence on CVS
5447 builds of autotools.
5448 * ltdl/m4/gnulib-cache.m4: Update, and use --macro-prefix=M4.
5449 * configure.ac: Use consistent quoting throughout.
5450 (AC_PREREQ): Bump to 2.59d.
5451 (AC_INIT): Package name begins with uppercase.
5452 (AC_ARG_WITH): Use AS_HELP_STRING.
5453 (AM_INIT_AUTOMAKE): Enable gnits mode.
5454 (AC_ISC_POSIX, AM_PROG_CC_STDC, AC_PROG_INSTALL, AC_PROG_MAKE_SET),
5455 (AC_PROG_AWK, AM_C_PROTOTYPES, AC_C_CONST, AC_HEADER_STDC),
5456 (AC_CHECK_HEADERS, AC_FUNC_ALLOCA, AC_FUNC_VPRINTF): Remove checks
5457 done by gnulib or automake, or which autoconf has declared
5459 * m4/m4private.h (Includes): Assume C89 or better, and use errno
5461 * m4/output.c (Includes): Likewise.
5462 * modules/gnu.c (Includes): Likewise.
5463 * modules/m4.c (Includes): Likewise.
5464 * src/m4.h (Includes): Likewise.
5466 * README-alpha: Update web address.
5467 * README: Likewise. Change encoding to ASCII. Remove old advice
5468 about cygwin. Document bootstrapping dependency.
5469 * AUTHORS: Update from branch-1_4.
5470 * THANKS: Likewise. Change encoding to UTF-8.
5471 * BACKLOG: Delete. This file is too old and unmaintained to be
5473 * ChangeLog: Change encoding to UTF-8.
5475 Avoid compiler warnings.
5476 * m4/macro.c (trace_format): Don't mark this as a printf format,
5477 since we don't accept the same set of modifiers as printf. It
5478 would be nice if gcc let us specify a custom format archetype.
5479 * src/main.c (main): Cast away const.
5481 2006-06-10 Andreas Schwab <schwab@suse.de> (tiny change)
5482 Eric Blake <ebb9@byu.net>
5484 * modules/time.c (ctime): Pass correctly typed variable to
5487 (localtime): Likewise.
5488 (strftime): Likewise.
5489 * m4/utility.c (m4_numeric_arg): For now, document arbitrary
5490 limit inherent in this interface.
5492 2006-05-08 Bruno Haible <bruno@clisp.org> (tiny change)
5494 * modules/m4.c (WEXITSTATUS): Provide fallback definition.
5495 (sysval): Use WEXITSTATUS.
5496 * modules/gnu.c (esyscmd): Set sysval to 0xffff, to accomodate both
5497 big-endian and little-endian wait status definitions.
5499 2006-05-06 Eric Blake <ebb9@byu.net>
5501 * po/Makevars (MSGID_BUGS_ADDRESS): Add.
5502 * po/POTFILES.in (src/getopt.c, src/version-etc.c): These files live
5505 2006-05-06 Eric Blake <ebb9@byu.net>
5507 * configure.ac (LT_CONFIG_LTDL_DIR): Inform libtool which
5508 subdirectory to use.
5509 (support for -pipe): Move after LT_INIT, since it relies on
5512 2006-05-05 Eric Blake <ebb9@byu.net>
5514 * Makefile.am (doc/m4.1): Use $@, not $(srcdir)/doc/$@.
5518 2006-05-05 Bruno Haible <bruno@clisp.org>
5519 and Eric Blake <ebb9@byu.net>
5521 * configure.ac (gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES): Move to...
5522 * ltdl/m4/gnulib-cache.m4: ...this new file, per new gnulib-tool
5524 * bootstrap: Update usage of gnulib-tool.
5526 2006-05-04 Eric Blake <ebb9@byu.net>
5528 * Makefile.am (doc/m4.1): Use EXEEXT on built binary.
5531 2005-12-05 Gary V. Vaughan <gary@gnu.org>
5533 * bootstrap (func_update_po): Synch with CVS GNU tar. wget 1.9.x
5534 and 1.10.x support --cache=off, so $WGETFLAGS are not necessary.
5535 Reported by Eric Blake <ebb9@byu.net>
5537 2005-12-04 Gary V. Vaughan <gary@gnu.org>
5539 * bootstrap (func_update_po): Test and set $WGETFLAGS to disable
5540 http caching as -C is no longer supported by wget 1.10.x.
5541 Reported by Eric Blake <ebb9@byu.net>
5543 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5545 * m4/module.c (caller_id): To match libtool-2.0 interface, changed
5547 (iface_id): ...an lt_dlinterface_id type.
5548 (m4__module_find): New abstraction for lt_dlhandle_fetch. Use
5549 throughout, instead of calling obsolete lt_dlhandle_find directly.
5550 (m4__module_next): Use multiloader-safe lt_dlhandle_iterate. Use
5551 throughout, instead of calling obsolete lt_dlhandle_next.
5552 * m4/m4private.h (m4__module_find): Declare it.
5553 * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func):
5554 Use m4__module_next instead of obsolete lt_dlhandle_next.
5556 2005-10-20 Gary V. Vaughan <gary@gnu.org>
5558 * bootstrap (func_update_po): Update pofiles directly from the
5559 translation project.
5560 * po/LINGUAS, po/cs.po, po/de.po, po/el.po, po/fr.po, po/it.po,
5561 po/ja.po, po/nl.po, po/pl.po, po/ru.po, po/sv.po: No need to store
5562 these files under source control anymore.
5563 Suggested by Eric Blake <ebb9@byu.net>
5565 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5567 * ltdl/m4/m4-gnulib.m4: Update FSF contact address. Somehow this
5568 file escaped the address updates on 2005-05-01.
5570 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5572 * bootstrap: Allow user overriding of gnulib-tool location, and
5573 correctly determine module source directories whether gnulib-tool
5574 is given as a relative or absolute path, or is found by searching
5576 Reported by Eric Blake <ebb9@byu.net>
5578 2005-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5580 * ltdl/m4/debug.m4 (m4_CHECK_DEBUGGING): Make sure that both $rm
5581 and $RM are defined for various versions of
5582 AC_LIBTOOL_COMPILER_OPTION.
5584 * bootstrap (AUTORECONF): New variable to allow user overriding of
5587 2005-07-07 Gary V. Vaughan <gary@gnu.org>
5589 * doc/m4.texinfo (History): Add better notes on the ancestory of
5590 GNU m4, and other historical interest.
5592 2005-05-08 Gary V. Vaughan <gary@gnu.org>
5594 * m4/symtab.c (m4_symbol_rename): New function that performs a low
5595 level symbol rename.
5596 * m4/m4module.h (m4_symbol_rename): Declare it as part of the API.
5597 * modules/gnu.c (regsub): Factored out of m4_epatsubst_do...
5598 (m4_patsubst_do, m4_renamesyms_do): ...wrappers that use
5600 (erenamesyms, renamesyms): ...builtins that use these to implement
5601 macro renaming by regular expression.
5602 * doc/m4.texinfo (Erenamesyms and Renamesyms): Document them.
5603 * tests/generate.awk: Allow some forbidden `m4_' prefixed symbols
5604 to stop the new generated tests from choking.
5606 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5608 Since most of the build is handled from a single Makefile.am now,
5609 we can teach make about the dependencies between the m4 binary and
5610 the preopened modules it is built against:
5612 * configure.ac (PREOPEN_DEPENDENCIES): Substitute for a list of
5614 * Makefile.am (src_m4_DEPENDENCIES): Rebuild the m4 program if any
5615 of the preopened modules have changed.
5617 2005-05-07 Gary V. Vaughan <gary@gnu.org>
5619 * configure.ac (gl_MODULES): Add mkstemp for machines that don't
5620 have a native implementation.
5622 2005-05-06 Gary V. Vaughan <gary@gnu.org>
5624 * src/m4.h (EXIT_SUCCESS, EXIT_FAILURE): Removed. These are
5625 handled already by gnu/exit.h.
5627 * configure.ac (gl_MODULES): Add assert to support a
5628 --disable-assert configure time option for NDEBUG setting.
5630 * Makefile.am (src_m4_SOURCES): Add version-etc-fsf.c.
5631 * bootstrap (src_modules): Add version-etc-fsf.
5632 * src/main.c (version_etc_copyright): Removed.
5634 * ltdl/m4/m4-getopt.m4 (m4_GETOPT): Synch with gnulib/getopt.m4.
5636 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5638 * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
5640 * src/freeze.c (produce_frozen_state): Use \n line-endings even
5641 on Windows, so that the frozen file reader will work.
5642 Reported by Josef T. Burger <bolo@bolo.com>
5644 2005-05-04 Vincent Lonngren <Vincent.lonngren.759@student.lu.se>
5646 Forward port of a patch that allowed m4-1.4.2 to compile on
5649 * configure.ac (AC_CHECK_HEADERS): Add signal.h,
5651 * src/m4.h: And include them as appropriate.
5652 * src/main.c, src/stackovf.h: Don't include signal.h literally;
5653 m4.h will include the correct file.
5655 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5657 * m4/m4private.h: Make errno visible for the sources patched
5660 2005-05-04 Paul Eggert <eggert@twinsun.com>
5662 * src/main.c (print_program_name_CB): Preserve errno, since
5663 M4ERROR relies on this.
5664 * modules/gnu.c (m4_esyscmd): Clear errno before calling popen.
5665 * modules/m4.c (m4_maketemp): Clear errno before calling mkstemp.
5666 * m4/path.c (m4_path_search): Don't let "free" trash errno when
5669 * m4/output.c (m4_insert_file): Don't assume errno has a valid
5670 value simply because fread returns zero. This fixes a
5671 portability bug reported by Marion Hakanson in
5672 <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
5674 2005-05-04 Santiago Vila <sanvila@debian.org>
5676 * tests/stackovf.test: Use tempfile if available.
5678 2005-05-04 Robert Bihlmeyer <robbe@orcus.priv.at> (tiny change)
5680 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
5681 * m4/output.c (m4_insert_file): Do not mix buffered and
5682 unbuffered I/O, as this breaks on the Hurd.
5684 2005-05-04 Gary V. Vaughan <gary@gnu.org>
5686 Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
5687 Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
5688 and libtoolize does a better job of ltdl importing now too, so
5689 take advantage of that while updating the tree:
5691 * acm4, config: Moved from here...
5692 * ltdl/m4, ltdl/config: ...to here.
5693 * doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
5694 src/Makefile.am, tests/Makefile.am: Removed...
5695 * Makefile.am: ...and migrated to here, with adjustments to
5696 compensate for relative path differences.
5697 * commit: Adjust relative paths.
5698 * configure.ac: Adjust relative paths.
5699 (AC_PREREQ): 2.59 isn't strictly new enough, we also need a
5701 (LT_PREREQ): 2.0 isn't released yet, but will work when it is! In
5702 the meanwhile, CVS HEAD libtool is needed.
5703 (AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
5704 stricly new enough, we also need a patch.
5705 (AM_PROG_CC_C_O): Required for subdir-objects in Automake.
5706 (AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
5707 (gl_MODULES): Don't list getopt and version-etc, as they don't
5709 * bootstrap: After running gnulib-tool to import the listed
5710 modules, fetch getopt and version-etc into src manually.
5711 (ltdldir): Change to ltdl.
5712 * src/main.c: Adjust for changes in version-etc API.
5713 * ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
5714 but works when the getopt module isn't to be included in the lib.
5715 * README: Add note about patching autoconf and automake to
5718 2005-05-02 Matt Kraai <kraai@debian.org> (tiny change)
5720 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
5721 * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
5722 empty file rather than to a nonexistent file. This closes a
5723 common security hole.
5724 * modules/m4.c (m4_maketemp): Implement the above, by using
5725 mkstemp rather than mktemp.
5727 2005-05-01 Gary V. Vaughan <gary@gnu.org>
5729 The FSF are moving offices today. Changed their contact address
5730 in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
5731 `51 Franklin Street, Fifth Floor, MA 02110-1301'.
5733 2005-03-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5735 * tests/Makefile (clean-local): Ignore testsuite cleanup
5738 2005-03-11 Per Bothner <per@bothner.com> (tiny change)
5740 * tests/Makefile (clean-local): Only run the testsuite cleanup
5741 if the testsuite has been generated.
5743 2005-02-11 Stepan Kasal <kasal@ucw.cz>
5745 * TODO: slight clarification of the example of qindir usage.
5747 2005-02-08 Gary V. Vaughan <gary@gnu.org>
5749 * TODO: Add qindir requirement, and defn bug.
5750 From Stepan Kasal <kasal@ucw.cz>
5752 2005-02-08 Stepan Kasal <kasal@ucw.cz>
5754 * TODO: Add ``execution stack'', fix a typo.
5755 * doc/m4.texinfo: Typos.
5757 2004-12-24 Eric Blake <ebb9@byu.net>
5759 * configure.ac (INCLUDE_STDBOOL_H): Account for gnulib's move
5760 to the gnu subdirectory.
5761 * acm4/m4-error.m4 (INCLUDE_ERROR_H): Likewise.
5762 * acm4/m4-obstack.m4 (INCLUDE_OBSTACK_H): Likewise.
5763 * acm4/m4-regex.m4 (INCLUDE_REGEX_H): Likewise.
5764 * m4/system_.h: Likewise, in non-configured includes.
5766 2004-10-14 Noah Misch <noah@cs.caltech.edu>,
5767 Gary V. Vaughan <gary@gnu.org>
5769 * m4/m4.c (m4_context_field_table, m4_context_opt_bit_table):
5770 Protect definitions from macro expansion under -DNDEBUG by
5771 parenthesising the expanded function names.
5772 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
5773 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
5774 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
5775 (m4_is_syntax_macro_escaped): Similarly protect function
5776 definitions from macro expansion under -DNDEBUG by #undefing the
5777 matching macro names before each definition. Also, move all the
5778 function definitions to the end of the file so that any
5779 invocations in the rest of the file pick up the fast macro
5781 * m4/m4private.h (m4_set_symbol_table, m4_set_syntax_table)
5782 (m4_set_debug_file, m4_set_trace_messages)
5783 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
5784 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
5785 (m4_set_max_debug_arg_length_opt): New fast macro versions of the
5786 option setter functions.
5788 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5790 * po/POTFILES.in: Reflect move of gnulib files from gnulib/m4
5793 2004-09-23 Gary V. Vaughan <gary@gnu.org>
5795 * src/main.c: Include gnulib files from the correct directory.
5797 * gnulib/*: Don't store any of the gnulib files in arch, as they
5798 generate spurious changes.
5799 * Makefile.am (ACLOCAL_AMFLAGS): Remove gnulib/acm4 since the
5800 gnulib macros now share our macro directory.
5801 (SUBDIRS): Descend into `gnu' rather than `gnulib'.
5802 * bootstrap: Call gnulib-tool to import from the gnulib tree.
5803 (gl_AC_HEADER_INT_TYPES_H, gl_AC_HEADER_STDINT_H,
5804 gl_AC_TYPE_UINTMAX_T): Patch gnulib.m4 to define these in terms of
5805 the gettext macros from autopoint that overwrite the gnulib-tool
5806 imported versions. Import sources and Makefile.am into the `gnu'
5807 directory. Changed all callers.
5808 * configure.ac (gl_EARLY, gl_SOURCE_BASE, gl_M4_BASE, gl_MODULES,
5809 gl_INIT): Call these gnulib-tool macros instead of the hardcoded
5810 for imported modules.
5811 * acm4/m4-error.m4, acm4/m4-gettext.m4, acm4/m4-obstack.m4,
5812 acm4/m4-regex.m4: Use AC_BEFORE to enforce ordering rather than
5813 hardcoding the gnulib macros they wrap.
5815 2004-07-15 Gary V. Vaughan <gary@gnu.org>
5817 Latest CVS libtool can preload modules in libraries, including
5818 its own module loaders! Tweak m4 so that it doesn't try to treat
5819 libltdl's module loaders as m4 modules when freezing and on exit:
5821 * gnulib/acm4/*.m4: Don't store these files in arch since they
5822 generate spurious changes.
5823 * bootstrap: Simplify initial libtoolize call, since CVS
5824 libtoolize is smarter these days.
5825 * doc/Makefile.am (%.1): Make the helptoman call work with a VPATH
5827 * m4/module.h (m4__module_exit): Missing declaration.
5828 * m4/m4private.h (m4__module_next): New function declaration.
5829 * m4/module.c (m4__module_next): lt_dlhandle_{firs,nex}t
5830 encapsulation. Changed all callers.
5831 (m4__module_interface): New function to verify m4 loadable module
5833 (m4__module_init): Register the interface validator.
5834 (m4__module_exit): Only close my own modules.
5835 * modules/m4.c (unistd.h): Provide missing declaration.
5836 (m4_set_sysval, m4_sysval_flush, m4_dump_symbols)
5837 (m4_expand_ranges): More missing declarations.
5838 * modules/modtest.c (export_test): Ditto.
5839 * src/Makefile.am (AM_CPPFLAGS): Add libltdl directory.
5840 * src/main.c (main): Bump copyright year.
5841 * tests/modules.at: Fix sed syntax error.
5844 2004-06-17 Gary V. Vaughan <gary@gnu.org>
5846 Tweaking to enable compilation with latest CVS libtool and
5847 libltdl. We can't just dump the library files directly into the
5848 m4 directory anymore now that libltdl is built from pieces itself:
5850 * bootstrap: Rewritten to use latest libtoolize sanely, and to
5851 set up libltdl subdirectory.
5852 * configure.ac (AC_CONFIG_AUX_DIR): Point to our own, not the
5853 gnulib subdirectory's config.
5854 (TIMESTAMP): Use $ac_aux_dir for VPATH builds.
5855 (m4_pattern_forbid): Remove the cruft to deal with renamed jm_
5857 (AC_LIB_LTDL): Latest libltdl is a sub-project with its own
5858 configure.ac, so use AC_WITH_LTDL instead.
5859 * Makefile.am (SUBDIRS): Add libltdl.
5860 * acm4/m4-regex.m4 (jm_INCLUDED_REGEX): Updated. gnulib now uses
5862 * m4/Makefile.am (AM_CPPFLAGS): Add INCLTDL.
5863 (libm4_la_SOURCES): Remove ltdl.c and ltdl.h.
5864 (libm4_la_LIBADD): Add LIBLTDL.
5865 * m4/ltdl.c, m4/ltdl.h: Removed.
5866 * m4/m4module.h: Include canonical ltdl.h.
5869 2004-06-14 Gary V. Vaughan <gary@gnu.org>
5871 * gnulib/import: Now updates makefile fragments, and configure.ac.
5872 * gnulib/m4/gnulib.am: New file. Generated makefile fragments.
5873 * gnulib/m4/Makefile.am: include it.
5874 * gnulib/acm4/intmax.m4, gnulib/acm4/longdouble.m4,
5875 gnulib/acm4/longlong.m4, gnulib/acm4/printf-posix.m4,
5876 gnulib/acm4/signed.m4, gnulib/acm4/size_max.m4,
5877 gnulib/acm4/wchar_t.m4, gnulib/acm4/wint_t.m4,
5878 gnulib/acm4/xsize.m4: New macro files from latest gnulib import.
5879 * gnulib/acm4/alloca.m4, gnulib/acm4/inttypes_h.m4,
5880 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-prefix.m4,
5881 gnulib/acm4/error.m4, gnulib/acm4/po.m4, gnulib/acm4/regex.m4,
5882 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
5883 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
5884 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
5885 gnulib/acm4/free.m4, gnulib/acm4/gettext.m4,
5886 gnulib/acm4/glibc21.m4: Updated macro files from latest gnulib
5888 * gnulib/m4/getopt_int.h: New source file from latest gnulib
5890 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/getopt1.c,
5891 gnulib/m4/obstack.c, gnulib/m4/obstack.h, gnulib/m4/regex.c,
5892 gnulib/m4/unlocked-io.h, gnulib/m4/version-etc.c,
5893 gnulib/m4/xmalloc.c, gnulib/m4/getopt.c, gnulib/m4/getopt.h:
5894 Updated source files from latest gnulib.
5896 2004-02-29 Gary V. Vaughan <gary@gnu.org>
5898 * config/mailnotify: New file for mailing commit notifications,
5899 imported from cvs-utils.
5900 * commit: Updated from cvs-utils and tweaked for m4.
5902 2003-12-01 Gary V. Vaughan <gary@gnu.org>
5904 * config/mkstamp: Updated from CVS libtool.
5905 * configure.ac: Generate a gnu coding standards compliant version
5906 number, and use it for the banner.
5907 * Makefile.am (stamp-vcl): New rules to force m4 to be regenerated
5908 mhen the TIMESTAMP changes in ChangeLog, but the file modification
5909 time doesn't (e.g. in cvs commit). Otherwise dist tarballs will
5910 contain the previous version number.
5911 * src/main.c: Make --version output conform to the GNU standard.
5913 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7g...
5914 * modules/Makefile.am (gnu_la_SOURCES, load_la_SOURCES,
5915 m4_la_SOURCES, traditional_la_SOURCES, modtest_la_SOURCES,
5916 shadow_la_SOURCES, import_la_SOURCES, stdlib_la_SOURCES,
5917 time_la_SOURCES): ...so that these are defaulted correctly, and
5918 can be removed from this file.
5919 (AM_LDFLAGS): Add -module...
5920 (gnu_la_LDFLAGS, load_la_LDFLAGS, m4_la_LDFLAGS,
5921 traditional_la_LDFLAGS, modtest_la_LDFLAGS, shadow_la_LDFLAGS,
5922 import_la_LDFLAGS, stdlib_la_LDFLAGS, time_la_LDFLAGS): ...so that
5923 the individual settings can be removed.
5924 * m4/Makefile.am (libm4_la_LIBADD): Add $(LTLIBINTL) here once...
5925 * module/Makefile.am (gnu_la_LIBADD, load_la_LIBADD,
5926 m4_la_LIBADD, traditional_la_LIBADD, modtest_la_LIBADD,
5927 shadow_la_LIBADD, import_la_LIBADD, stdlib_la_LIBADD,
5928 time_la_LIBADD): ...so that these are picked up as a deplib of
5929 libm4 and don't need to be set explicitly.
5931 2003-11-18 Gary V. Vaughan <gary@gnu.org>
5933 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Remove perl.la
5934 from the standard build. It is too fragile.
5936 * gnulib/acm4/libtool.m4, m4/ltdl.c, m4/ltdl.h: Reimported from
5937 CVS libtool after merging m4 changes across to libtool.
5939 * m4/symtab.c (m4_symtab_create): Fix a careless use of sizeof.
5940 * m4/path.c (search_path_add): Ditto.
5942 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5944 * configure.ac (AC_LIBTOOL_TAGS): Don't include shell code for
5945 libtool tags we don't use in configure. This reduces the size
5946 of the script from over 1Mb to under 700Kb.
5948 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5950 The import script was not written properly, and the last gnulib
5951 import was incomplete. Fixed that problem, and reimport our
5952 gnulib dependencies, which picks up the address calculation
5953 overflow checks described by Paul below. Also tweak the clients
5954 of the gnulib xalloc module not to use deprecated macros:
5956 * gnulib/import: Recurse through module dependencies rather than
5957 naively descending only one level.
5958 * configure.ac: Add calls to gnulib's strnlen and extension module
5960 * gnulib/m4/Makefile.am: Add snippets from gnulib's strnlen and
5962 * gnulib/acm4/extensions.m4, gnulib/acm4/xalloc.m4,
5963 gnulib/m4/alloca.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
5964 gnulib/m4/stdbool_.h, gnulib/m4/unlocked-io.h, gnulib/m4/xalloc.h,
5965 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Updated from CVS
5967 * gnulib/acm4/libtool.m4: Updated from CVS libtool.
5968 * m4/hash.c (m4_get_hash_iterator_next): Use `xzalloc (S)' in
5969 place of `xcalloc (1, S)'.
5970 * m4/m4.c (m4_create): Likewise.
5971 * m4/m4private.h (m4_symbol_value_create): Likewise.
5972 * m4/symtab.c (symtab_fetch): Likewise.
5973 * m4/syntax.c (m4_syntax_create): Likewise.
5974 * src/freeze.c (reload_frozen_state): Likewise.
5975 * m4/path.c (search_path_add): Eliminate use of deprecated NEW
5977 * m4/symtab.c (m4_symtab_create): Likewise.
5979 2003-11-13 Gary V. Vaughan <gary@gnu.org>
5981 * tests/module.at: Comment typo.
5983 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5985 * tests/modules.at (modules: importing): Apply some lateral
5986 thinking, and use AT_CHECK to compare the output of a sed pass
5987 over stderr against the canonical strerror string.
5989 * tests/modules.at (modules: importing): Edit the generated stderr
5990 output to canonicalize strerror output, before a comparison.
5992 2003-10-10 Gary V. Vaughan <gary@gnu.org>
5994 Tru64UNIX perl is sloppy with namespace pollution. This patch is
5995 careful not to trip over the mess:
5997 * modules/perl.c: Some builds of perl install headers that contain
5998 `#define try __builtin_try'. Be sure to undefine that macro
5999 before `m4/hash.h' gets included, which uses the `try' symbol.
6000 * m4/system_.h: Similarly for `bool'. Undefine `bool', `true' and
6001 `false' before including `stdbool.h'.
6002 (DELETE): This symbol is not in m4's namespace, and is in any
6003 case only used internally...
6004 * m4/m4private.h (DELETE): ...so move it to here.
6005 Reported by Martin MOKREJS <mmokrejs@natur.cuni.cz>
6007 2003-10-08 Paul Eggert <eggert@twinsun.com>
6009 Don't use XMALLOC and XCALLOC. Once we install the
6010 corresponding patch into gnulib, this will fix some
6011 address-calculation overflow bugs on hosts where calloc (A, B)
6012 returns garbage when A*B overflows.
6014 * m4/hash.c (m4_hash_new, node_new, m4_hash_resize,
6015 maybe_grow, m4_get_hash_iterator_next): Replace XMALLOC with
6016 xmalloc, XCALLOC with xcalloc.
6017 * m4/m4.c (m4_create): Likewise.
6018 * m4/m4private.h (m4_symbol_value_create): Likewise.
6019 * m4/output.c (m4_output_init): Likewise.
6020 * m4/symtab.c (symtab_fetch, m4_set_symbol_traced): Likewise.
6021 * m4/syntax.c (remove_syntax_attribute): Likewise.
6022 * src/freeze.c (reload_frozen_state): Likewise.
6023 * src/main.c (main): Likewise.
6025 2003-10-07 Gary V. Vaughan <gary@gnu.org>
6027 * Makefile.am (ACLOCAL_AMFLAGS): Search in the new acm4 and
6028 gnulib/acm4 directories for aclocal m4 macros.
6029 * gnulib/Makefile.am (EXTRA_DIST): Removed.
6030 (MAINTAINERCLEANFILES): Add Makefile.in.
6031 * configure.ac (m4_GNULIB_MODULES): Use it to declare which gnulib
6033 * acm4/m4-gnulib.m4 (m4_GNULIB_MODULES): New macro.
6034 * gnulib/import: New file. Temporary script for updating gnulib
6035 imported files, until gnulib-tool is working.
6036 * gnulib/config/codeset.m4, gnulib/config/error.m4,
6037 gnulib/config/exitfail.m4, gnulib/config/extensions.m4,
6038 gnulib/config/getopt.m4, gnulib/config/gettext.m4,
6039 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6040 gnulib/config/intdiv0.m4, gnulib/config/inttypes-pri.m4,
6041 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6042 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6043 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6044 gnulib/config/lib-prefix.m4, gnulib/config/malloc.m4,
6045 gnulib/config/nls.m4, gnulib/config/obstack.m4,
6046 gnulib/config/onceonly_2_57.m4, gnulib/config/po.m4,
6047 gnulib/config/progtest.m4, gnulib/config/realloc.m4,
6048 gnulib/config/regex.m4, gnulib/config/restrict.m4.
6049 gnulib/config/stdbool.m4, gnulib/config/stdint_h.m4,
6050 gnulib/config/strerror_r.m4, gnulib/config/strndup.m4,
6051 gnulib/config/strnlen.m4, gnulib/config/strtol.m4,
6052 gnulib/config/uintmax_t.m4, gnulib/config/ulonglong.m4,
6053 gnulib/config/unlocked-io.m4, gnulib/config/xalloc.m4,
6054 gnulib/config/xstrndup.m4: Removed.
6055 * gnulib/acm4/alloca.m4, gnulib/acm4/codeset.m4,
6056 gnulib/acm4/error.m4, gnulib/acm4/exitfail.m4,
6057 gnulib/acm4/extensions.m4, gnulib/acm4/free.m4,
6058 gnulib/acm4/getopt.m4, gnulib/acm4/gettext.m4,
6059 gnulib/acm4/glibc21.m4, gnulib/acm4/iconv.m4,
6060 gnulib/acm4/intdiv0.m4, gnulib/acm4/inttypes-pri.m4,
6061 gnulib/acm4/inttypes.m4, gnulib/acm4/inttypes_h.m4,
6062 gnulib/acm4/isc-posix.m4, gnulib/acm4/lcmessage.m4,
6063 gnulib/acm4/lib-ld.m4, gnulib/acm4/lib-link.m4,
6064 gnulib/acm4/lib-prefix.m4, gnulib/acm4/malloc.m4,
6065 gnulib/acm4/nls.m4, gnulib/acm4/obstack.m4,
6066 gnulib/acm4/onceonly_2_57.m4, gnulib/acm4/po.m4,
6067 gnulib/acm4/progtest.m4, gnulib/acm4/realloc.m4,
6068 gnulib/acm4/regex.m4, gnulib/acm4/restrict.m4.
6069 gnulib/acm4/stdbool.m4, gnulib/acm4/stdint_h.m4,
6070 gnulib/acm4/strerror_r.m4, gnulib/acm4/strndup.m4,
6071 gnulib/acm4/strnlen.m4, gnulib/acm4/strtol.m4,
6072 gnulib/acm4/uintmax_t.m4, gnulib/acm4/ulonglong.m4,
6073 gnulib/acm4/unlocked-io.m4, gnulib/acm4/xalloc.m4,
6074 gnulib/acm4/xstrndup.m4: Reimported from CVS gnulib with
6075 gnulib/import script.
6076 * gnulib/m4/alloca.c, gnulib/m4/alloca_.h, gnulib/m4/error.c,
6077 gnulib/m4/error.h, gnulib/m4/exitfail.c, gnulib/m4/free.c,
6078 gnulib/m4/malloc.c, gnulib/m4/obstack.c, gnulib/m4/obstack.h,
6079 gnulib/m4/realloc.c, gnulib/m4/regex.c, gnulib/m4/strtol.c,
6080 gnulib/m4/version-etc.c, gnulib/m4/version-etc.h,
6081 gnulib/m4/xalloc.h, gnulib/m4/xmalloc.c: Updated from CVS
6082 gnulib with gnulib/import script.
6083 * configure.ac, gnulib/m4/Makefile.am: Manually insert anticipated
6084 guards ready for gnulib-tool to autoupdate on import.
6085 * config/debug.m4, config/gmp.m4, config/m4-error.m4,
6086 config/m4-gettext.m4, config/m4-obstack.m4, config/m4-regex.m4,
6087 config/stackovf.m4: Moved from here...
6088 * acm4/debug.m4, acm4/gmp.m4, acm4/m4-error.m4,
6089 acm4/m4-gettext.m4, acm4/m4-obstack.m4, acm4/m4-regex.m4,
6090 acm4/stackovf.m4: ...to here, to separate aclocal macros from
6091 configure time helper scripts.
6092 * config/error.m4: Removed; superceded by gnulib/acm4/error.m4.
6093 * m4/hash.c, m4/m4.c, m4/macro.c, m4/module.c, m4/output.c,
6094 m4/path.c, m4/symtab.c, m4/syntax, m4/system_.h, modules/m4.c,
6095 src/main.c, src/stackovf.c: s/xfree/free/g to comply with new
6097 * src/main.c (version_etc_copyright): Only output the current
6099 (version_etc): Call with new variadic API.
6101 2003-09-16 Gary V. Vaughan <gary@gnu.org>
6103 * gnulib/m4/version-etc.c, gnulib/m4/version-etc.h: Import
6104 version-etc module from CVS gnulib.
6105 * po/POTFILES.in: Add gnulib/m4/version-etc.c.
6106 * src/Makefile.am: Build it.
6107 * src/main.c: Use it.
6109 * gnulib/m4/exit.h: Import exit module from CVS gnulib.
6110 * gnulib/m4/Makefile.am (pkginclude_HEADERS): Add exit.h.
6111 * m4/system_.h: Don't define EXIT_SUCCESS and FAILURE, include
6114 2003-09-15 Charles Wilson <cygwin@cwilson.fastmail.fm>,
6115 Gary V. Vaughan <gary@gnu.org>
6117 * bootstrap: Separate options.
6118 * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1.
6119 * gnulib/m4/Makefile.am (stdbool.h): Use srcdir, gnulib_srcdir is
6121 * modules/Makefile.am (gnu_la_LIBADD, load_la_LIBADD)
6122 (m4_la_LIBADD, mpeval_la_LIBADD, traditianal_la_LIBADD)
6123 (modtest_la_LIBADD, import_la_LIBADD, perl_la_LIBADD)
6124 (shadow_la_LIBADD, stdlib_la_LIBADD, time_la_LIBADD): Add
6125 $(LTLIBINTL) for gettext support on cygwin.
6126 * src/Makefile.am (m4_LDADD): Remove $(INTLLIBS), since we now
6127 have $(LTLIBINTL) from the preloaded module la files.
6128 * README: Remove the warning about using --disable-nls on Windows
6131 2003-09-15 Gary V. Vaughan <gary@gnu.org>
6133 * gnulib/m4/regex.c: s/<regex.h>/"regex.h"/ or else the compiler
6134 picks up the system regex.h if gl_REGEX decides gnulib/m4/regex.c
6137 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6139 * doc/STYLE: Document the gnulib header naming conventions, and
6141 * gnulib/m4/error_.h, gnulib/m4/gettext_.h, gnulib/m4/obstack_.h,
6142 gnulib/m4/regex_.h: Renamed to gnulib/m4/error.h,
6143 gnulib/m4/gettext.h, gnulib/m4/obstack.h, gnulib/m4/regex.h
6145 * gnulib/m4/Makefile.am: Remove the rules to build these headers.
6147 * gnulib/m4/strtol.c, gnulib/config/strtol.m4: Import strtol
6148 module from CVS gnulib.
6149 * configure.ac (AC_REPLACE_FUNCS): Remove strtol.
6150 (gl_FUNC_STRTOL): In favour of the module macro.
6152 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6154 Replace the getopt code with CVS gnulib getopt. The source files
6155 detect whether they are in a glibc environment and preprocess away
6156 all of the code if there is a system getopt, so we can compile
6157 them into the m4 executable unconditionally:
6159 * gnulib/m4/getopt.c, gnulib/m4/getopt1.c, gnulib/m4/getopt.h,
6160 gnulib/config/getopt.m4: Import getopt module from CVS gnulib.
6161 * configure.ac (gl_GETOPT): Use this instead of homebrew inline
6163 * src/getopt.c, src/getopt1.c, src/gnu-getopt.h: Removed old
6165 * src/Makefile.am: Adjust.
6166 * src/main.c: Always include our shipped getopt.h.
6167 * po/POTFILES.in: Use new location of getopt.c.
6169 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6171 * configure.ac (AC_CONFIG_FILES): Remove config/Makefile.
6172 * config/Makefile.am: Removed. Automake 1.8 distributes the files
6173 in this directory automatically.
6174 * Makefile.am (EXTRA_DIST): Except config/mkstamp.
6176 * configure.ac (pkglibexecdir): Don't try and set it here, PACKAGE
6178 * m4/Makefile.am (MODULE_PATH): Removed. Calculate pkglibexecdir
6180 * modules/Makefile.am (pkglibexecdir): Set it here.
6181 (pkgmodincdir): Renamed to pkgmodincludedir). Changed all clients.
6183 * gnulib/m4/regex.c, gnulib/m4/regex_.h, gnulib/config/regex.m4:
6184 Import regex module from CVS gnulib.
6185 * gnulib/config/restrict.m4: Ditto for dependee module restrict.
6186 * config/m4-regex.m4 (m4_REGEX): Wrap gnulib/config/regex.m4, but
6187 do extra substitutions for Makefile.
6188 * configure.ac: Use it.
6189 * gnulib/m4/Makefile.am: Maybe install regex.h after linking it
6190 from regex_.h if necessary.
6191 * m4/system_.h: Include the correct version of regex.h.
6192 * m4/regex.c, m4/regex.h, config/regex.m4: Removed legacy
6194 * po/POTFILES.in: Use new location of regex.c.
6196 * gnulib/m4/Makefile.am (EXTRA_DIST): Removed malloc.c and
6197 realloc.c: automake distributes these files already.
6199 2003-09-12 Gary V. Vaughan <gary@gnu.org>
6201 Replace the xstrzdup code by importing the xstrndup module from
6202 CVS gnulib, along with its dependencies: strndup and strnlen:
6204 * gnulib/m4/xstrndup.c, gnulib/m4/xstrndup.h,
6205 gnulib/config/xstrndup.m4: Import xstrndup module from CVS
6207 * gnulib/m4/strndup.c, gnulib/m4/strndup.h,
6208 gnulib/config/strndup.m4: Ditto wrt strndup.
6209 * gnulib/m4/strnlen.c, gnulib/config/strnlen.m4: Ditto wrt
6211 * gnulib/m4/Makefile.am: Add rules from newly imported modules.
6212 However, contrary to gnulib, we install xstrndup.h.
6213 * configure.ac (AC_REPLACE_FUNCS): Remove xstrzdup.
6214 * gnulib/lib/xstrzdup.c: Delete. This was never a gnulib file, it
6215 is an artifact of the old m4 portability layer.
6216 * configure.ac (gl_XSTRNDUP): This is the gnulib equivalent.
6217 * m4/system_.h: Include xstrndup.h.
6218 * m4/macro.c (process_macro): Call xstrndup, not xstrzdup.
6220 2003-09-11 Gary V. Vaughan <gary@gnu.org>
6222 Reimport the latest xalloc module from CVS gnulib, and adjust the
6223 m4 sources to take advantage of xalloc xfree. Also create a new
6224 macro DELETE with the same semantics as the old m4 XFREE macro,
6225 and carefully tweak callers:
6227 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h: Updated from CVS
6229 * m4/utility.c (xfree): Removed. This function is now supplied by
6231 * m4/m4private.h (WITH_DMALLOC): Removed XFREE redefine.
6232 * m4/path.c (search_path_add): Use NEW macro from xalloc.h.
6233 * m4/symtab.c (m4_symtab_create): Ditto.
6234 * m4/system_.h: Removed XFREE redefine.
6235 (DELETE): New macro with same functionality as the original m4
6236 XFREE macro, but based on xalloc.h now. Changed all callers.
6237 * src/main.c (main): Use XMALLOC macro.
6238 * m4/hash.c, m4/macro.c, m4/symtab.c, m4/syntax.c: Use xfree
6240 * m4/output.c (m4_output_exit): Use DELETE instead of XFREE.
6242 2003-09-10 Gary V. Vaughan <gary@gnu.org>
6244 Import the xalloc module from CVS gnulib, along with its
6245 dependencies: exitfail, malloc and realloc. We had different
6246 semantics for our XFREE and a function xfree() not supplied by
6247 gnulib, so also a bit of work to keep everything running
6250 * configure.ac (AC_REPLACE_FUNCS): Removed xmalloc and xstrdup.
6251 (gl_XALLOC): Use gnulib equivalents.
6252 * gnulib/config/exitfail.m4, gnulib/m4/exitfail.h,
6253 gnulib/m4/exitfail.c: Import exitfail module from CVS gnulib.
6254 * gnulib/config/malloc.m4, gnulib/m4/malloc.c: Ditto wrt malloc.
6255 * gnulib/config/realloc.m4, gnulib/m4/realloc.c: Ditto wrt
6257 * gnulib/config/xalloc.m4, gnulib/m4/xalloc.h,
6258 gnulib/m4/xmalloc.c, gnulib/m4/xstrdup.c: Ditto wrt xalloc.
6259 * gnulib/m4/Makefile.am: Add fragment from gnulib for newly
6261 (pkgincdir): Removed. Use pkgincludedir instead.
6262 * m4/m4private.h (XFREE): xfree already checks for NULL.
6263 * m4/system_.h: Use xalloc module, and remove macros already
6264 supplied by xalloc.h.
6265 * m4/utility.c (xfree): xalloc does not yet implement xfree, so
6266 moved the old definition from m4/xmalloc.c to here for now.
6268 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6270 Import the error and progname modules from CVS gnulib. Our old
6271 error.c subsumed the functionality of both, so a little adjustment
6272 was required to accomodate the split in sources. Also added more
6273 wrapper macros to choose between a system installed error.h or our
6274 shipped gnulib error module:
6276 * m4/error.c, m4/error.h: Removed.
6277 * m4/Makefile.am: Adjust.
6278 (pkgincdir): Removed. Use pkgincludedir instead.
6279 * m4/module.h, src/main.c: Don't include `m4/error.h'.
6280 * m4/system_.h (INCLUDE_ERROR_H): Add a substitution for suitable
6282 * gnulib/m4/progname.c: Imported from CVS gnulib.
6283 * gnulib/m4/progname.h: Ditto.
6284 * src/main.c: Adjust to use progname module.
6285 * gnulib/m4/error.c: Imported from CVS gnulib.
6286 * gnulib/m4/error_.h: Ditto.
6287 * gnulib/m4/Makefile.am: Build the error module into our libgnu.la
6288 if appropriate, and link a local error.h if the system version is
6290 (libgnu_la_SOURCES) Add progname module sources.
6291 * gnulib/config/error.m4: Imported from CVS gnulib.
6292 * gnulib/config/strerror_r.m4: Ditto.
6293 * config/m4-error.c: New file. Wrap gnulib error.m4 but arrange
6294 to have ERROR_H for Makefile substitutions and tell system.h
6295 whether the system error.h should be used, or a locally installed
6297 * configure.ac (jm_PREREQ_ERROR): Replaced by a call to m4_ERROR.
6299 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6301 * gnulib/m4/Makefile.am (MOSTLYCLEANFILES): Typo
6302 s/gettext_.h/gettext.h/.
6304 * bootstrap: Revert 2003-09-04 patch now that CVS autoconf and
6305 automake have been fixed.
6307 * config/m4-obstack.m4 (m4_FUNC_OBSTACK): D'oh! Now that we wrap
6308 gl_OBSTACK, which in turn calls AC_FUNC_OBSTACK, don't rerun bits
6309 of code originally snarfed from AC_FUNC_OBSTACK!!! While I'm here
6310 rename to m4_OBSTACK in light of wrapping gl_OBSTACK.
6312 2003-09-09 Gary V. Vaughan <gary@gnu.org>
6314 The gnulib obstack module requires the gnulib gettext module for
6315 systems that do not have GNU gettext installed. Because we use
6316 -Ignulib/m4 in our Makefiles it is not safe to drop gettext.h in
6317 that directory incase it clashes with the system gettext.h. This
6318 delta uses gettext_.h and extra rules in the Makefile to make a
6319 link to gettext.h when needed:
6321 * Makefile.am (auxdir): Removed. No longer used.
6322 * configure.ac (ac_aux_dir): Removed AC_SUBST. No longer used.
6323 (TIMESTAMP): List path to `mkstamp' literally, as ac_aux_dir has
6325 (AC_CONFIG_LIBOBJ_DIR): Declare this for possible future single
6326 Makefile based build.
6327 (AC_CONFIG_AUX_DIR): Now we use gnulib/config where the majority
6328 of the macros are kept.
6329 * Makefile.am (ACLOCAL_MFLAGS): Search gnulib/config first.
6330 * configure.ac (AM_INIT_AUTOMAKE): Require 1.7a.
6331 * config/Makefile (ACLOCAL_MACROS): Removed. Automake 1.7a
6332 distributes these automatically.
6333 * config/regex.m4 (jm_WITH_REGEX): Fixed underquoting to prevent
6334 warning from automake-1.7a.
6335 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Renamed to
6336 m4_CHECK_DEBUGGING for consistency with gnulib prefixes. Changed
6338 * config/m4-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto
6339 wrt. m4_FUNC_OBSTACK.
6340 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto
6341 wrt. m4_sys_STACKOVF.
6342 * config/gmp.m4 (_M4_AC_LIB_GMP, M4_AC_LIB_GMP): Ditto
6343 wrt. _m4_LIB_GMP, m4_LIB_GMP.
6344 (ac_gmp_save_LIBS, ac_cv_using_lib_gmp): Don't use autoconf's
6345 namespace. Renamed to m4_gmp_save_LIBS and m4_cv_using_lib_gmp
6347 * config/m4-gettext.m4: New file to set GETTEXT_H appropriately.
6348 * gnulib/m4/Makefile.am: Added a new block to make an appropriate
6349 gettext.h link on deficient systems.
6350 (pkginc_HEADERS): Mention $(GETTEXT_H).
6351 (EXTRA_HEADERS): Mention gettext.h.
6352 * gnulib/config/gettext_.h: New file from gnulib's gettext.h.
6353 * gnulib/config/codeset.m4, gnulib/config/gettext.m4,
6354 gnulib/config/glibc21.m4, gnulib/config/iconv.m4,
6355 gnulib/config/intdiv.m4, gnulib/config/inttypes-pri.m4,
6356 gnulib/config/inttypes.m4, gnulib/config/inttypes_h.m4,
6357 gnulib/config/isc-posix.m4, gnulib/config/lcmessage.m4,
6358 gnulib/config/lib-ld.m4, gnulib/config/lib-link.m4,
6359 gnulib/config/lib-prefix.m4, gnulib/config/nls.m4,
6360 gnulib/config/po.m4, gnulib/config/progtest.m4,
6361 gnulib/config/stdint_h.m4, gnulib/config/uintmax_t.m4,
6362 gnulib/config/ulonglong.m4: Imported from CVS gnulib.
6364 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6366 We can't mirror the gnulib directory structure here, since we need
6367 to be able to eg. `#include <m4/obstack.h>' from our source files,
6368 which is much easier if the local obstack.h is created in a
6369 directory named m4. Rather than trying to symlink everything into
6370 the m4 directory, now we build a libtool convenience library from
6371 the sources we get from gnulib and link that with libm4.la:
6373 * gnulib/config/extensions.m4: Imported from CVS gnulib.
6374 * gnulib/config/unlocked-io.m4: Ditto.
6375 * gnulib/m4/unlocked-io.h: Ditto.
6376 * gnulib/m4/obstack.m4, gnulib/m4/onceonly_2_57.m4,
6377 gnulib/m4/stdbool.m4: All moved to gnulib/config directory.
6378 * gnulib/lib/obstack.c, gnulib/lib/obstack_.h,
6379 gnulib/lib/stdbool_.h: All moved to gnulib/m4 directory.
6380 * m4/strtol.c, m4/xmalloc.c, m4/xstrdup.c, m4/xstrzdup.c: Ditto.
6381 * m4/Makefile.am: Adjust.
6382 * gnulib/Makefile.am (EXTRA_DIST): Name just the additional gnulib
6383 macros we redistribute.
6384 * gnulib/m4/Makefile.am: New file. Build libgnu.la convenience
6385 library among others.
6386 (GNULIB_SRCS, GNULIB_MACROS): Removed.
6387 * Makefile.am (ACLOCAL_AMFLAGS): Adjust.
6388 * config/m4-obstack.m4: Adjust.
6389 * po/POTFILES.in: Adjust.
6390 * configure.ac: Reformatting. Call newly imported gnulib macros.
6391 * m4/builtin.c, m4/macro.c, m4/module.c, m4/utility.c: Removed
6392 bogus calls of `#include "m4.h"'.
6393 * Makefile.am: INCLUDES has been deprecated in favour of
6395 * m4/Makefile.am: Ditto.
6396 * modules/Makefile.am: Ditto.
6397 * src/Makefile.am: Ditto.
6399 2003-09-05 Gary V. Vaughan <gary@gnu.org>
6401 * config/Makefile.am: Reverting yesterdays patch for VPATH builds.
6403 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6405 Migrate the obstack support into the gnulib directories for easy
6406 synchronisation with upstream files in gnulib:
6408 * config/gnu-obstack.m4: Moved from here...
6409 * config/m4-obstack.m4: ...to here.
6410 * config/Makefile.am (SPECIFIC_MACROS): Adjust.
6411 * m4/obstack.c, m4/obstack_.h: Moved from here...
6412 * gnulib/obstack.c, gnulib/obstack.h: ...to here.
6413 * po/POTFILES.in: Adjust.
6414 * gnulib/Makefile.am (GNULIB_SRCS, GNULIB_MACROS): Adjust.
6415 * m4/Makefile.am: Add a whole new section to link the obstack
6416 sources from the gnulib tree if necessary.
6417 * gnulib/m4/onceonly_2_57.m4, gnulib/m4/obstack.m4: New macros
6419 * config/m4-obstack.m4: Rewrite as a wrapper for
6420 gnulib/m4/obstack.m4.
6422 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6424 GNU M4 currently builds with a number of files adapted from
6425 upstream sources. Recently the gnulib project on savannah.gnu.org
6426 has pulled together a great many of these externally maintained
6427 files. This delta is the beginnings of isolating those files
6428 maintained in gnulib to make it easy to synchronise M4 with the
6429 upstream files prior to releases.
6431 * Makefile.am (ACLOCAL_AMFLAGS): Mention gnulib/m4 macro
6433 (SUBDIRS): Added new gnulib subdirectory.
6434 * configure.ac (AC_CONFIG_FILES): Add new gnulib tree Makefiles.
6435 * config/stdbool.m4: Moved from here...
6436 * gnulib/m4/stdbool.m4: ...to here.
6437 * m4/stdbool_.h: Moved from here...
6438 * gnulib/lib/stdbool_.h: ...to here.
6439 * gnulib/Makefile.am: New file. Make sure the gnulib tree is
6441 * m4/Makefile.am: Adjust gnulib/modules/stdbool:Makefile.am based
6442 code to work with new stdbool_.h location.
6443 (gnulib_srcdir): New.
6445 2003-09-04 Gary V. Vaughan <gary@gnu.org>
6447 * config/Makefile.am (MAINTAINERCLEANFILES, ACLOCAL_MACROS)
6448 (STANDARD_TOOLS, SPECIFIC_MACROS): Needed `$(srcdir)/' for VPATH
6450 (SPECIFIC_TOOLS): New variable. Moved mkstamp to here.
6451 (EXTRA_DIST): Use it.
6453 * bootstrap: CVS autoreconf leaves file droppings. Remove
6454 aclocal.m4t incase autoreconf doesn't.
6456 2003-08-29 Gary V. Vaughan <gary@gnu.org>
6458 * m4/gnu-obstack.h: Updated from CVS gnulib. For consistency with
6459 the other gnulib imports, renamed to m4/obstack_.h.
6460 * m4/obstack.c: Updated from CVS gnulib.
6461 * m4/Makefile.am (EXTRA_HEADERS): Adjust.
6462 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Merge in additional
6463 header tests from gnulib obstack module. AC_CONFIG_LINKS knows
6464 about vpath already, and $top_srcdir upsets CVS Automake, so the
6465 $top_srcdir reference was removed.
6467 * m4/system-h.in: For consistency with the gnulib imports, renamed
6469 * m4/Makefile (EXTRA_HEADERS): Adjust.
6470 * configure.ac (AC_CONFIG_FILES): Adjust.
6472 * m4/stdbool_.h: New file from gnulib for systems without their
6474 * m4/Makefile.am: Add snippets from gnulib for C99 bool support.
6475 * config/stdbool.m4: New file. Macros from gnulib for same.
6476 * configure.ac: Use it.
6478 2003-08-27 Gary V. Vaughan <gary@gnu.org>
6480 * config/debug.m4: `perl -pi.bak -e 's/(Copyright) (\d)/$1 (C) $2/g'`
6481 * config/gmp.m4: Ditto.
6482 * config/gnu-obstack.m4: Ditto.
6483 * config/stackovf.m4: Ditto.
6484 * m4/builtin.c: Ditto.
6485 * m4/debug.c: Ditto.
6486 * m4/error.c: Ditto.
6487 * m4/error.h: Ditto.
6488 * m4/gnu-obstack.h: Ditto.
6491 * m4/input.c: Ditto.
6493 * m4/m4module.h: Ditto.
6494 * m4/m4private.h: Ditto.
6495 * m4/macro.c: Ditto.
6496 * m4/module.c: Ditto.
6497 * m4/obstack.c: Ditto.
6498 * m4/output.c: Ditto.
6500 * m4/regex.c: Ditto.
6501 * m4/regex.h: Ditto.
6502 * m4/strtol.c: Ditto.
6503 * m4/symtab.c: Ditto.
6504 * m4/syntax.c: Ditto.
6505 * m4/utility.c: Ditto.
6506 * m4/xmalloc.c: Ditto.
6507 * m4/xstrdup.c: Ditto.
6508 * m4/xstrzdup.c: Ditto.
6509 * modules/evalparse.c: Ditto.
6510 * modules/format.c: Ditto.
6511 * modules/gnu.c: Ditto.
6512 * modules/import.c: Ditto.
6513 * modules/load.c: Ditto.
6514 * modules/m4.c: Ditto.
6515 * modules/m4.h: Ditto.
6516 * modules/modtest.c: Ditto.
6517 * modules/mpeval.c: Ditto.
6518 * modules/perl.c: Ditto.
6519 * modules/shadow.c: Ditto.
6520 * modules/stdlib.c: Ditto.
6521 * modules/time.c: Ditto.
6522 * modules/traditional.c: Ditto.
6523 * src/freeze.c: Ditto.
6524 * src/getopt.c: Ditto.
6525 * src/getopt1.c: Ditto.
6527 * src/main.c: Ditto.
6528 * src/stackovf.c: Ditto.
6530 * config/gmp.m4 (M4_AC_LIB_GMP): Use AC_INCLUDES_DEFAULT:
6531 ac_default_headers is an autoconf internal variable.
6532 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
6533 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6535 * configure.ac (AC_CONFIG_FILES): Add tests/atlocal.
6536 * tests/Makefile.am (TESTS_ENVIRONMENT): Revert the 2003-08-14
6539 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6541 * configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
6543 * system-h.in (m4_boolean): Removed in favour of using C99 bool if
6544 possible or faking one with a typedef. Changed all callers.
6546 2003-08-15 Gary V. Vaughan <gary@gnu.org>
6548 Still cleaning up the users' module API, by taking out the stuff
6549 that isn't used by any existing modules, and moving specialised
6550 functions out of libm4 and into the module they are used by.
6552 * m4/m4module.h (m4_skip_space): No need to export this. Moved...
6553 * m4/utility.c (m4_skip_space): ...to here the home of its only
6554 use, made static and renamed to `skip_space'. Changed all
6556 * m4/m4module.h (m4_expand_ranges): Removed prototype.
6557 * m4/utility.c (m4_expand_ranges): Moved definition from here...
6558 * modules/m4.c (m4_expand_ranges): ...to here, and exported using
6560 * modules/m4.h (m4_expand_ranges_func): For lt_dlsym import
6562 * modules/gnu.c (builtin_syntax): Import and use in this
6563 builtin implementation.
6564 * m4/m4module.h (M4_DEBUG_PRINT1, M4_DEBUG_PRINT2, M4_DEBUG_PRINT3):
6566 * m4/macro.c (trace_flush): Except here where the macro is now
6568 * m4/m4module.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6569 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): Only used internally, so
6571 * m4/m4private.h (M4_DEBUG_MESSAGE, M4_DEBUG_MESSAGE1)
6572 (M4_DEBUG_MESSAGE2, M4_DEBUG_MESSAGE3): ...to here.
6574 2003-08-14 Gary V. Vaughan <gary@gnu.org>
6576 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use the interrim new
6577 compiler based AC_CHECK_HEADER that was introduced in
6579 * config/stackovf.m4 (M4_AC_SYS_STACKOVF): Ditto.
6580 * config/gmp.m4 (AC_LIB_GMP): Ditto. And renamed to M4_AC_LIB_GMP.
6581 * configure.ac: Use renamed M4_AC_LIB_GMP.
6583 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Don't AC_REQUIRE a
6584 macro that requires arguments! This stops the shell's bad
6585 substitution error at configure time.
6587 * tests/Makefile.am (TESTS_ENVIRONMENT): Now we can pass make
6588 variables to the testsuite shell. Set the value of USE_GMP so
6589 that the gmp test will run!
6590 (check-local, clean-local): Use the TESTS_ENVIRONMENT variable.
6592 2003-08-11 Gary V. Vaughan <gary@gnu.org>
6594 Libltdl already has an excellent mechanism for accessing C symbols
6595 in modules. Lets use that! Remove all the exporting cruft and
6596 just use lt_dlsym in conjunction with a few conventions to
6597 simplify module writers' jobs. Also removed the table address
6598 caching code and otherwise simplified the module loader quite a
6599 bit. To access exported symbols in other modules, first the
6600 exporting module must name the symbols <modname>_LTX_<symname>,
6601 and the importing module must define a function type called
6602 <symname>_func. The importer then adds
6603 M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
6604 that wishes to call out to the exported functions. Care must be
6605 taken that <symname> is non-NULL in the importing module incase
6606 M4_MODULE_IMPORT fails, but otherwise it can be called as if the
6607 definition was in the importers source. Study
6608 `modules/{gnu.c,m4.{c,h}' for a model example. At the moment,
6609 m4_module_import will attempt to automatically load a module
6610 required for symbol access if it is not loaded already.
6612 * TODO: Removed the items fixed in this delta.
6613 * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
6615 * m4/ltdl.h (lt_dlhandle_find): Declare it.
6616 * m4/module.c (m4_module_unload): Use it.
6617 * src/freeze.c (reload_frozen_state): Ditto.
6618 * m4/m4module.h (m4_export): Deleted. Removed all references.
6619 (M4_MODULE_IMPORT): New user convenience macro for importing
6620 arbitrary symbols from other modules.
6621 * m4/module.c (m4_module_import): New function to service
6622 M4_MODULE_IMPORT macro.
6623 (module_data): Removed. Looking up the tables on demand with
6624 lt_dlsym, rather than caching their addresses here simplifies the
6626 (m4_get_module_builtin_table, m4_get_module_macro_table):
6627 Removed. Changed all callers.
6628 (set_module_macro_table, set_module_builtin_table): Renamed to
6629 install_macro_table and install_builtin_table respectively, and
6630 simplified now that the cache is no more.
6631 * modules/gnu.c (builtin_symbols): Use this new mechanism to
6632 import m4_dump_symbols from the m4 module.
6633 (builtin_esyscmd): Likewise for m4_set_sysval and
6635 * modules/m4.c (m4_export_table): Removed. Functions are
6636 addressed with the new mechanism which doesn't need this.
6637 (m4_set_sysval): New exported accessor function to prevent
6638 problems with variable access on inferior architectures.
6639 * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
6640 (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
6641 that we can have some type safety.
6642 * modules/modtest.c (export_test): C level exported function for
6643 testing the new import mechanism.
6644 * modules/import.c: New file for the import end of the test.
6645 * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
6646 * tests/modules.at: New test cases for intermodule symbol
6649 2003-08-07 Gary V. Vaughan <gary@gnu.org>
6651 * m4/m4module.c (m4_string): Moved from here...
6652 * m4/m4private.c (m4_string): ...to here.
6654 * m4/utility.c (dumpdef_cmp): Removed stale declaration.
6656 2003-07-29 Gary V. Vaughan <gary@gnu.org>
6658 * m4/m4module.h (M4_DEFAULT_NESTING_LIMIT): This value is
6659 already available to module writers through
6660 m4_{get,set}_nesting_limit_opt(), so moved from here...
6661 * m4/m4.c (DEFAULT_NESTING_LIMIT): ...to here and renamed.
6662 (m4_create): Use it.
6664 2003-07-28 Gary V. Vaughan <gary@gnu.org>
6666 Aside from auditing path.c for m4module.h api obfuscation, this
6667 delta introduces the concept of private struct members in opaque
6668 data types to GNU m4: See the STYLE file for details.
6670 * TODO: Remind ourselves that a rewrite of path.c is needed.
6671 * m4/m4module.h (m4_search_path, struct m4_search_path_info):
6673 * m4/m4private.h (m4__search_path, m4__search_path_info): ...to
6674 here and renamed. These type definitions are for internal api use
6675 only. Changed all callers.
6676 * m4/m4module.h (m4_search_path_env_init, m4_search_path_add):
6678 * m4/path.c (search_path_env_init, search_path_add): ...to here
6679 and renamed. These calls were never used outside this file.
6680 Changed all callers.
6681 (dirpath): Moved functionality of this static declaration...
6682 * m4/m4private.h (struct m4): ...to this new internal only
6683 search_path field. Changed all callers.
6684 (m4__get_search_path): Added new internal api accessor.
6685 * m4/path.c (m4_search_path_info_new): Removed. Not used.
6686 (m4_include_init): Removed...
6687 * m4/m4.c (m4_create): ...because the new m4 field is now
6689 (m4_delete): Recycle search_path memory.
6690 * src/main.c (main): Don't call m4_include_init now that it's
6692 * doc/STYLE: Document convention for private fields in opaque
6695 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6697 Sometimes exporting the address of a symbol from a module isn't
6698 enough for other modules to call that symbol correctly. If
6699 custom data types are used for function parameters, they need to
6700 be known to the caller. This change introduces the concept of
6701 $(prefix)/include/modules/$(modulename).h to declare those
6702 structures. Also we move m4_dump_symbols from libm4 to the m4
6703 module to show this concept in action.
6705 * m4/m4module.h (m4_dump_symbol_data): Moved from here...
6706 * modules/m4.h (m4_dump_symbol_data): ...to this new file for
6707 exporting data structures from modules/m4.c.
6708 * modules/m4.c, modules/gnu.c: Include it.
6709 * modules/Makefile.am (pkgmodinc_HEADERS): Install it.
6710 * m4/m4module.h (m4_dump_symbol_CB, m4_dump_symbols): Removed
6712 * m4/utility.c (dumpdef_cmp, m4_dump_symbol_CB, m4_dump_symbols):
6714 * modules/m4.c (dumpdef_cmp_CB, dump_symbol_CB, m4_dump_symbols):
6715 ...to here, with slight renaming.
6716 (m4_export_table): Prototype and add m4_dump_symbols.
6717 * m4/symtab.c (m4_is_symbol_value_void): Needed for an external
6718 definition of m4_dump_symbols.
6719 * m4/m4module.h (m4_is_symbol_value_void): Prototype it.
6720 * m4/m4private.h (m4_is_symbol_value_void): Fast macro version.
6722 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6724 Create an export table in modules/m4.c in readiness for beefing up
6725 the module loader to track module exports and imports.
6727 * m4/m4module.h (m4_debug_flush_files): Removed prototype.
6728 * m4/debug.c (m4_debug_flush_files): Moved...
6729 * modules/m4.c (m4_sysval_flush): ...to here and renamed.
6730 * modules/gnu.c (builtin_esysval): Use it.
6731 * m4/m4module.h (m4_export): New type for declaring module symbols
6733 * modules/m4.c (m4_export_table): List symbols exported from this
6734 module for use by other modules.
6736 2003-07-24 Gary V. Vaughan <gary@gnu.org>
6738 An experiment: There is loads of code in libm4 which should be in
6739 the m4 module, but is also used by another module. Just because
6740 some linkers won't cope with calls across dynamic runtime loaded
6741 objects I initially left the code in libm4. It will tidy the
6742 module api immensely if this code moves to the right place, I just
6743 need to remember to invent a suitable calling mechanism at some
6744 point. For now, only modules that are statically linked and
6745 preloaded will get this treatment, so the only platforms that will
6746 break are those that require all symbols to be resolved at link
6749 * TODO: Reminder that what I am doing could reduce portability
6750 unless I do something more robust later.
6751 * m4/m4module.h (m4_sysval): No longer exported from libm4.
6752 * m4/utility.c (m4_sysval): No longer declared in libm4.
6753 * modules/Makefile.am: Reformatting.
6754 * modules/m4.c (m4_sysval): Declare it at place of use.
6755 * modules/gnu.c (m4_sysval): Import it for use in esyscmd.
6757 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6759 * m4/m4module.h: Reformatting and rearranging lines a bit.
6760 (m4_obstack): Save typing by typedefing `struct obstack'. Changed
6762 (m4_call_macro, m4_expand_input): Renamed...
6763 (m4_macro_call, m4_macro_expand_input): ...to these. Changed all
6765 (m4_expansion_level, m4_process_macro): Moved...
6766 * m4/macro.c (expansion_level, process_macro): ...to here, and
6769 * m4/m4module.h (program_name): Not used by modules at all, so
6771 * src/main.c (program_name): ...to here.
6772 (print_program_name): Renamed...
6773 (print_program_name_CB): ...to conform to the STYLE guide.
6775 2003-07-23 Gary V. Vaughan <gary@gnu.org>
6777 More refactoring of the m4module.h API. Replace #defines with an
6778 enum, and move non-public functions out of the public API.
6780 * m4/debug.c (stdarg.h, varargs.h): Remove variadic header
6782 * m4/macro.c (stdarg.h): Add ANSI C variadic header.
6783 * m4/debug.c (m4_debug, trace): Moved...
6784 * m4/m4private.h (struct m4): ...to fields of this struct.
6785 (m4_get_debug_file, m4_get_trace_messages): New fast access macros
6787 * m4/debug.c (m4_debug_init, m4_debug_exit): Removed functions...
6788 * src/main.c (m4_debug_init, m4_debug_exit): ...invocations...
6789 * m4/m4.c (m4_create, m4_delete): ...and handled here instead.
6790 * m4/m4module.h (m4_context_field_table): Add entries for new
6791 debug_file and trace_messages fields.
6792 (M4_DEBUG_TRACE_ARGS, M4_DEBUG_TRACE_EXPANSION)
6793 (M4_DEBUG_TRACE_QUOTE, M4_DEBUG_TRACE_ALL, M4_DEBUG_TRACE_LINE)
6794 (M4_DEBUG_TRACE_FILE, M4_DEBUG_TRACE_PATH, M4_DEBUG_TRACE_CALL)
6795 (M4_DEBUG_TRACE_INPUT, M4_DEBUG_TRACE_CALLID)
6796 (M4_DEBUG_TRACE_VERBOSE): Replaced #defines with an enum.
6797 (m4_is_debug_bit): New macro to simplfy checks against the debug
6799 (m4_trace_format, m4_trace_header, m4_trace_flush)
6800 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Removed
6802 * m4/debug.c (m4_trace_format, m4_trace_header, m4_trace_flush)
6803 (m4_trace_prepre, m4_trace_pre, m4_trace_post): Moved...
6804 * m4/macro.c (trace_format, trace_header, trace_flush)
6805 (trace_prepre, trace_pre, trace_post): ...to these newly static
6806 functions, since they are only ever used from this file. Changed
6809 2003-07-17 Gary V. Vaughan <gary@gnu.org>
6811 Change the macros for checking syntax so that matching against
6812 multiple possible syntax classes can be done with a single
6813 comparison some of the time. The various classes are now bits of
6814 an int that can be checked with bitwise logic operators.
6816 * m4/m4module.h (M4_SYNTAX_IGNORE, M4_SYNTAX_OTHER)
6817 (M4_SYNTAX_SPACE, M4_SYNTAX_OPEN, M4_SYNTAX_CLOSE, M4_SYNTAX_COMMA)
6818 (M4_SYNTAX_DOLLAR, M4_SYNTAX_ACTIVE, M4_SYNTAX_ESCAPE)
6819 (M4_SYNTAX_ASSIGN, M4_SYNTAX_ALPHA, M4_SYNTAX_NUM)
6820 (M4_SYNTAX_LQUOTE, M4_SYNTAX_RQUOTE, M4_SYNTAX_BCOMM)
6821 (M4_SYNTAX_ECOMM): Replaced #defines with an enum.
6822 (M4_SYNTAX_ALNUM): Removed. Changed all callers.
6823 (M4_IS_IGNORE, M4_IS_OTHER, M4_IS_SPACE, M4_IS_OPEN, M4_IS_CLOSE)
6824 (M4_IS_COMMA, M4_IS_DOLLAR, M4_IS_ACTIVE, M4_IS_ESCAPE)
6825 (M4_IS_ASSIGN, M4_IS_ALPHA, M4_IS_NUM, M4_IS_LQUOTE, M4_IS_RQUOTE)
6826 (M4_IS_BCOMM, M4_IS_ECOMM, M4__IS_STRING, M4_IS_IDENT): Removed.
6827 Replace all calls with invocations of these...
6828 (m4_is_syntax, m4_has_syntax): ...New macros.
6829 * src/freeze.c (produce_syntax_dump): Remove mask argument, which
6830 is no longer required with new macros. Changed all callers.
6832 2003-07-15 Gary V. Vaughan <gary@gnu.org>
6834 * m4/input.c (CHAR_EOF, CHAR_BUILTIN, CHAR_RETRY): These token
6835 values are returned as part of the internal interface, so they
6837 * m4/private.h: ...to here.
6838 * m4/macro.c (expand_token): Check for out of range
6839 m4_peek_input() results before looking up in the syntax table.
6840 (collect_arguments): Ditto.
6842 * NEWS: Note `$' syntax class.
6844 2003-07-08 Paul Eggert <eggert@twinsun.com> and
6845 Gary V. Vaughan <gary@gnu.org>
6847 Conform to POSIX if the POSIXLY_CORRECT environment is set.
6848 --traditional `define' now smashes all the definitions.
6850 * NEWS: Explain this.
6851 * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
6852 (Extensions): Explain that extensions that are incompatible with
6853 POSIX are disabled if POSIXLY_CORRECT is set.
6854 (Incompatibilities): Remove.
6855 (Define, Other Incompat): Explain difference
6856 between GNU and POSIX behavior of define, pushdef, popdef.
6857 * m4/m4.c (m4_get_posixly_correct_opt): New undef.
6858 * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
6859 * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
6860 (m4_get_posixly_correct_opt): New macro.
6861 * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
6863 * modules/m4.c (builtin_functions): defn now takes any number of args.
6864 (builtin_define): Smash all the definitions if
6866 (builtin_defn)): Allow any number of arguments.
6867 (builtin_undivert): Do not allow nonnumeric arguments
6869 * src/main.c (main): Set posixly-correct behavior if either
6870 POSIXLY_CORRECT is set, or if -G is given.
6871 * tests/builtins.at: New test for smashed definitions.
6873 2003-06-27 Gary V. Vaughan <gary@gnu.org>
6875 * doc/m4.texinfo (Changesyntax): Document Dollar syntax class.
6876 * m4/m4module.h (M4__SYNTAX_STRING): New syntax class. Be careful
6877 not to slow the parser down.
6878 (M4__IS_STRING): New macro to test string syntax class membership.
6879 * m4/syntax.c: Adjust docucomment.
6880 (m4_syntax_create): Add a default M4_SYNTAX_DOLLAR element.
6881 (m4_syntax_code): Translate `$' -> M4_SYNTAX_DOLLAR.
6882 * m4/input.c (init_builtin_token): Comment typo.
6883 (m4__next_token): Comment typo.
6884 Accept M4_SYNTAX_DOLLAR items into M4_TOKEN_STRING type tokens
6885 by using the new M4__IS_STRING macro.
6886 * m4/macro.c (m4_process_macro): Use M4_IS_DOLLAR to test for
6887 variable references in macro expansions.
6889 * doc/m4.texinfo (Eregexp and Regexp): Typo.
6890 (Epatsubst and Patsubst): Typo.
6893 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6895 Move the global variables that pertain to syntax to a new `struct
6896 m4_syntax_table', and then add one of these to `struct m4'. The
6897 ripple effect through the code to both change formerly global
6898 references, and make sure a suitable context is available in
6899 lexical scope is disproportionately large compared to the size of
6900 the change proper. This change is a large part of decoupling
6901 syntax.c from the rest of the code that uses it.
6903 * m4/m4private.h (struct m4): Add a syntax field.
6904 * m4/m4.c (m4_create): Initialise it,
6905 (m4_delete): Recycle it.
6906 (m4_get_symtab): Remove hand coded version...
6907 (m4_get_symbol_table): ...and generate this with cpp. Changed all
6909 * m4/m4module.h (m4_context_field_table): Add an extra field so we
6910 can generate m4_get_symbol_table. Add a new row for
6911 m4_get_syntax_table.
6912 (M4SYNTAX): Syntactic sugar for module writers.
6913 (m4_symtab): Renamed to m4_symbol_table. Changed all callers.
6914 (m4_syntax_table): New home for syntax related formerly global
6916 * m4/m4private.h (struct m4_syntax_table): Define it.
6917 * m4/input.c (m4_input_init): Initialisation of these formerly
6918 global variables moved...
6919 * m4/syntax.c (m4_syntax_create): ...to here.
6920 * m4/input.c (m4_input_exit): And similarly, recycling of the
6921 memory used by those values moved...
6922 * m4/syntax.c (m4_syntax_delete): ...to here.
6923 * m4/m4module.h (DEF_LQUOTE, DEF_RQUOTE, DEF_BCOMM, DEF_ECOMM):
6924 Moved to m4/m4private.h.
6925 * m4/syntax.c (m4_get_syntax_lquote, m4_get_syntax_rquote)
6926 (m4_get_syntax_bcomm, m4_get_syntax_ecomm)
6927 (m4_is_syntax_single_quotes, m4_is_syntax_single_comments)
6928 (m4_is_syntax_macro_escaped): New accessors for m4_syntax_table
6929 objects. Changed all callers that used to directly access the
6931 (m4__single_quotes, m4__single_comments, m4__use_macro_escape):
6932 Removed and incorporated into m4_syntax_table structure.
6933 * m4/utility.c (lquote, rquote, bcomm, ecomm): Ditto.
6934 * m4/syntax.c (m4_set_syntax): Now returns an error status,
6935 instead of requiring a `struct m4' to generate its own errors.
6936 Changed all callers.
6937 * src/main.c (main): Now that the syntax table is initialised as
6938 part of m4_create, we have to manually wipe the syntax entries if
6939 we are about to read a frozen file.
6941 2003-06-26 Gary V. Vaughan <gary@gnu.org>
6943 * doc/STYLE: Added notes on callback naming schemes.
6945 * m4/module.c (m4_set_module_macro_table)
6946 (m4_set_module_builtin_table): Declarations weren't changed when
6947 definitions were renamed on 2003-06-19.
6949 * m4/hash.c (m4_hash_resize): ifdefed out. This function is
6950 neither used nor particularly appropriate since it exposes the
6951 internal workings of the hash module. I haven't yet decided
6952 whether to remove it entirely.
6954 2003-06-20 Gary V. Vaughan <gary@gnu.org>
6956 Two related changes, and a huge knockon effect throughout the
6957 source: Moved the option variables out of global space and into
6958 `struct m4'; made `m4_symtab' a real datatype, so that its api
6959 is not marred passing `struct m4' around just so it can decide
6960 whether to keep traced symbol names or not. Added setters and
6961 getters for the formerly global option variables, and obviously
6962 changed a vast number of functions to take a `struct m4' and use
6963 the getter funcs to find option values.
6965 * m4/utility.c (interactive, sync_output, debug_level)
6966 (no_gnu_extensions, prefix_all_builtins, suppress_warnings)
6967 (max_debug_argument_length, warning_status, nesting_limit)
6968 (discard_comments): Removed.
6969 * m4/m4module (warning_status, no_gnu_extensions, nesting_limit)
6970 (debug_level, max_debug_argument_length, prefix_all_builtins)
6971 (suppress_warnings, discard_comments, interactive, sync_output):
6972 Removed from here...
6973 * m4/m4private.h (struct m4): ...and equivalent fields added to
6975 (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6976 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6977 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6978 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6979 (m4_get_interactive_opt, m4_get_sync_output_opt): Fast access
6980 macros for the new fields.
6981 * m4/m4module.h (m4_context_field_table)
6982 (m4_context_opt_bit_table): Helper macros used to generate
6983 prototypes, setters and getters for new option fields
6985 * m4/m4.c (m4_get_warning_status_opt, m4_get_no_gnu_extensions_opt)
6986 (m4_get_nesting_limit_opt, m4_get_debug_level_opt)
6987 (m4_get_max_debug_arg_length_opt, m4_get_prefix_builtins_opt)
6988 (m4_get_suppress_warnings_opt, m4_get_discard_comments_opt)
6989 (m4_get_interactive_opt, m4_get_sync_output_opt)
6990 (m4_set_warning_status_opt, m4_set_no_gnu_extensions_opt)
6991 (m4_set_nesting_limit_opt, m4_set_debug_level_opt)
6992 (m4_set_max_debug_arg_length_opt, m4_set_prefix_builtins_opt)
6993 (m4_set_suppress_warnings_opt, m4_set_discard_comments_opt)
6994 (m4_set_interactive_opt, m4_set_sync_output_opt): Addressable
6995 setter and getter functions generated by cpp from
6996 m4_context_field_table and m4_context_opt_bit_table, exported as
6997 part of the module api. Changed all callers.
6998 * m4/symtab (struct m4_symtab): Used as the concrete type for
7000 (m4_symtab_create): Allocate and initialise a new struct.
7001 (m4_symtab_apply): New function that works like m4_hash_apply, but
7002 with different callbacks specific to symbol tables. Changed all
7004 (symbol_destroy, arg_destroy, arg_copy): Renamed
7005 symbol_destroy_CB, arg_destroy_CB, arg_copy_CB to remind me that
7006 they have unused parameters for a reason!
7007 (dump_symbol_CB): New callback to dump the contents of a single
7009 (symtob_dump): Rewritten in terms of dump_symbol_CB.
7010 * m4/utility.c (m4_dump_symbol): Renamed to m4_dump_symbol_CB.
7011 Changed all callers.
7012 * m4/m4.c (m4_create): By default point the `nuke_trace_bit' field
7013 of the contained `m4_symtab' at the `no_gnu_extensions' field.
7014 Although I'm not convinced these semantics are correct, they are
7015 at least consistent with how things were before this delta. Also
7016 set the default nesting limit to M4_DEFAULT_NESTING_LIMIT.
7018 2003-06-19 Gary V. Vaughan <gary@gnu.org>
7020 Tie down the interface to libm4 some more. Make more structures
7021 opaque to modules by moving them to m4private.h, and writing
7022 setters and getters. To win back the speed penalty for doing this
7023 also wrote macroized versions that do know about structure layout
7024 in m4private.h and #include that file into modules when NDEBUG is
7025 defined at compile time. There are still some accessor macros in
7026 m4private.h that need to go, but that is not necessary to clean
7029 * m4/m4module.h (m4_symbol_type): Moved...
7030 * m4/m4private.h (m4__symbol_type): ...to here.
7031 * m4/symtab.c (m4_get_symbol_value, m4_get_symbol_traced)
7032 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7033 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7034 (m4_get_symbol_func, m4_symbol_value_create)
7035 (m4_symbol_value_delete, m4_set_symbol_value_text)
7036 (m4_set_symbol_value_func): New exported api to symbols.
7037 (m4_get_symbol_value_type): Replaced by m4_is_symbol_value_text
7038 and m4_is_symbol_value_func.
7039 * m4/m4module.h: Prototype these guys.
7040 * m4/module.c (m4_set_module_macro_table)
7041 (m4_set_module_builtin_table): Make these static, there is no
7042 reason to pollute the api with them.
7043 * m4/m4private.h: Reformatting.
7044 (m4_get_symtab): Only define when NDEBUG is defined.
7045 (m4_get_symbol_value, m4_get_symbol_traced)
7046 (m4_set_symbol_traced, m4_set_symbol_name_traced)
7047 (m4_is_symbol_text, m4_is_symbol_func, m4_get_symbol_text)
7048 (m4_get_symbol_func, m4_symbol_value_create)
7049 (m4_symbol_value_delete, m4_set_symbol_value_text)
7050 (m4_set_symbol_value_func): Macro implementations of the new
7051 functions when NDEBUG is defined.
7052 (SYMBOL_TRACED, SYMBOL_VALUE, SYMBOL_TYPE, SYMBOL_TEXT)
7053 (SYMBOL_FUNC, VALUE_TYPE, VALUE_TEXT, VALUE_FUNC): Removed.
7054 Superceded by the above. All callers changed.
7055 (M4ARG): Removed. This is no longer different to the
7056 m4/m4module.h definition.
7057 * modules/gnu.c, modules/m4.c: Only include m4private.h when
7058 NDEBUG is defined. That way we exercise the same (albeit slower)
7059 api that external modules must use.
7061 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7063 Renamed some of the types and their accessors to make more sense.
7064 Now we have a SYMTAB in which we store SYMBOLs, and each SYMBOL
7065 has a stack of SYMBOL_VALUEs.
7067 * m4/m4module.h (m4_token, m4_get_token_type, m4_get_token_text)
7068 (m4_get_token_func, m4_token_copy): Renamed to m4_symbol_value,
7069 m4_get_symbol_value_type, m4_get_symbol_value_text,
7070 m4_get_symbol_value_func and m4_symbol_value_copy respectively.
7071 Changed all callers.
7072 (m4_symbol_type): s/M4_TOKEN_/M4_SYMBOL_/
7073 (m4_get_token_type): Renamed
7074 * m4/input.c (m4_next_token): Renamed to m4__next_token, and moved
7075 to the internal api.
7076 * m4/m4private.h: s/TOKEN_ARG_/SYMBOL_ARG_/
7078 (m4__symtab_init, m4__symtab_exit): Removed prototypes.
7079 (m4_token_arg): Renamed to m4_symbol_arg. Changed all callers.
7080 (m4__token_type): Moved here from m4module.h.
7081 (m4__next_token): Renamed from m4_next_token.
7082 * m4/symtab.c: Removed some of the parameterised macro support
7083 functions for modularisation later.
7084 (m4_token_copy): Renamed to m4_symbol_value_copy, and use new
7085 m4_hash_dup to perform a true deep copy of the SRC.
7086 (arg_copy): Callback for m4_symbol_value_copy.
7087 * utility.c (m4_token_get_type, m4_token_text, m4_token_func):
7088 Renamed to m4_get_symbol_value_type, m4_get_symbol_value_text and
7089 m4_get_symbol_value_func. Changed all callers.
7091 2003-06-18 Gary V. Vaughan <gary@gnu.org>
7093 Tidy up style of hash.[ch] in accordance with doc/STYLE.
7095 * m4/hash.c: Internal symbol renaming and formatting.
7096 (m4_hash_dup): New function to facilitate deep copies of hash
7098 (m4_hash_apply_func): Returns a void* now, which is a richer type
7099 for returning exceptions (NULL means keep going).
7100 (m4_hash_apply): Ditto.
7101 * m4/hash.h: Declare exported symbols with an explicit extern.
7104 2003-06-17 Gary V. Vaughan <gary@gnu.org>
7106 Still refactoring furiously. This delta represents a change in
7107 semantics to symtab.c. Instead of building temporary m4_tokens
7108 in the caller, and copying fields in the methods, we now create
7109 the actual m4_token for hashing in the caller so the methods just
7110 slot them in directly. Also, this means that we don't lookup a
7111 symbol and get back an allocated but VOID token to copy fields
7112 into, we create the token we want to push and pass that to
7113 m4_symbol_define or m4_symbol_pushdef. And that's it. There are
7114 a few other small changes to stop knowledge of the implementation
7115 of symtab.c leaking out into other files.
7117 * m4/macro.c (expand_argument): Comment typo corrected.
7118 * m4/symtab.c (symtab_fetch): New function to fetch the address of
7120 (m4_symbol_pushdef): Take an extra value parameter and use this
7121 directly as the new top of the value stack. All callers changed
7122 to build a token and pass responsibility for memory in, rather
7123 than copying as we used to.
7124 (m4_symbol_define): Also use the new value parameter directly as a
7125 replacement for the top of the value stack. All callers changed
7126 to build a token as above.
7127 (m4_set_symbol_traced): New function to set the traced bit on the
7128 named symbol, creating it if necessary.
7129 (symbol_popval): The guts of the old m4_symbol_popdef.
7130 (m4_symbol_popdef): Use it.
7131 * m4/builtin.c (m4_symbol_set_token): Removed,
7132 (m4__symbol_set_builtin, m4__symbol_set_macro): Removed and
7134 * m4/module.c (m4_set_module_builtin_table)
7135 (m4_set_module_macro_table): ...with these more orthogonal
7137 * m4/m4module.h (m4_macro_pushdef, m4_macro_define)
7138 (m4_builtin_pushdef, m4_builtin_define): Removed. No longer
7140 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE)
7141 (m4_arg_signature_parse): Moved...
7142 * m4/symtab.c: ...to here.
7143 * m4/input.c (m4_token_copy): Arghh... I'm amazed this didn't
7144 screw something up. Moved...
7145 * m4/symtab.c (m4_token_copy): ...to here, and fixed so that it
7146 actually does a proper deep copy of source to dest.
7148 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7150 Further refactoring to stabilise the module API. Renaming some
7151 functions for orthogonality, and judicious definition migration to
7152 move things out of the set of exported symbols.
7154 * doc/STYLE: New file. Notes on coding style.
7155 * m4/m4module.c: Updated bitrotted docucomment at the top of the
7157 (m4_module_name, m4_module_builtins, m4_module_macros): Renamed to
7158 m4_get_module_name, m4_get_module_builtin_table,
7159 m4_get_module_macro_table which are verb phrases. Changed all
7161 * m4/builtin.c (m4_builtin_table_install, m4_macro_table_install):
7163 * m4/module.c (m4_set_module_builtin_table)
7164 (m4_set_module_macro_table): ...here, and renamed. Changed all
7166 * m4/m4module.c (m4_module_data): This...
7167 * m4/m4private.c (struct m4_module_data): ...and this...
7168 * m4/module.c (module_data) ...consolidated here and no longer
7169 exported. Changed all callers.
7171 2003-06-16 Gary V. Vaughan <gary@gnu.org>
7173 Begin work on lifting the curse of the global variables. To start
7174 with create a `struct m4' context container, and replace
7175 `m4__symtab' with `context->symtab' throughout. This means
7176 initialising a context container in main, and adjusting many
7177 functions between main and the module entry points so that the
7178 container gets passed through. It would have been nice to
7179 defer this until after 1.5, but it has a major effect on the
7180 user's module writing ABI, so it needs to be addressed now - at
7181 least in the areas that impact the ABI. An interrelated change
7182 in the symtab API removes the dependency on a global symbol table,
7183 and instead focuses on a passed table (from the context
7186 * TODO: Reminders for finishing context functionality.
7187 * m4/Makefile.am (libm4_la_SOURCES): Add m4.c.
7188 * m4/m4.c: New file. Manage new struct m4 objects to eliminate
7189 global variables and eventually allow m4 to be reentrant.
7190 * m4/m4private.h (m4): Define the new structure here...
7191 (M4_SYMTAB, m4_get_symtab): ...so we can have fast accessors that
7192 don't carry the overhead of a function call.
7193 * m4/m4module.h: Prototype extern functions from m4/m4.c.
7194 (m4): Declare type for new struct m4 objects.
7195 (M4SYMTAB): User macro to ease finding the symbol table for the
7196 current context for module developers.
7197 (m4_symbol_token): Renamed to m4_symbol_set_token which contains a
7199 (M4_BUILTIN, m4_builtin_func, M4_BUILTIN_HANDLER)
7200 (m4_builtin_define, m4_builtin_pushdef, m4_builtin_table_install)
7201 (m4_call_macro, m4_dump_symbols, m4_expand_input)
7202 (M4_FINISH_HANDLER, M4_INIT_HANDLE, m4_macro_define)
7203 (m4_macro_pushdef, m4_macro_table_install, m4_module_load)
7204 (m4_module_unload, m4_process_macro, m4_symbol_set_token): Add an
7205 m4* context parameter. Changed definitions and all callers.
7206 (m4_symtab): Alias for m4_hash to decouple the
7207 m4_symtab api from m4_hash.
7208 (m4_symtab_apply, m4_symtab_apply_func): Use m4_symtab instead of
7210 (m4_symtab_create): New function to return an initialised
7212 (m4_symtab_delete): New function to delete an m4_symtab's memory.
7213 (m4_symbol_define, m4_symbol_delete, m4_symbol_lookup)
7214 (m4_symbol_popdef, m4_symbol_pushdef): Add an m4_symtab parameter
7215 instead of simply using the global m4__symtab. Changed
7216 definitions and all callers.
7217 * m4/m4private.h (m4__symtab_remove_module_references): Ditto.
7218 * m4/symtab.c (m4__symtab_init, m4__symtab_exit): Removed.
7219 * src/main.c (main): Create a context and use that instead of the
7220 former global m4__symtab.
7222 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7224 * m4/hash.c (m4_hash_apply): Pass an initial hash table parameter
7225 to the callback. Callbacks should not need to hardcode the
7226 hashtable they are working from, nor should we have to waste the
7227 userdata parameter to pass the table in.
7228 * m4/hash.h (m4_hash_apply_func): Require the initial table
7230 * m4/symtab.c (symtab_destroy): Use the passed table instead
7231 of hardcoding m4__symtab.
7232 (m4_symbol_popdef): Don't use the userdata parameter to pass the
7233 table to arg_destroy.
7234 (arg_destroy): Use the hash parameter, ignore userdata.
7235 * modules/m4.c (set_trace): Make it fit the m4_hash_apply_func
7237 (traceon, traceoff): Call set_trace with the extra initial
7240 2003-06-13 Gary V. Vaughan <gary@gnu.org>
7242 More refactoring to stabilise the module api, this time for
7243 symtab.c. Additionally, start to pay attention to function names
7244 that don't contain a verb like they should.
7246 * m4/m4module.h (m4_symtab_apply): Reintroduced this function as a
7247 wrapper for m4_hash_apply to decouple the symtab module from the
7249 (m4_symbol_builtin, m4_symbol_macro): Renamed to
7250 m4__symbol_set_builtin and m4__symbol_set_macro. Changed all
7252 (m4_symbol_delete): Create a macro version to save a function
7254 (m4_token_t, m4_data_t): These violate the POSIX reserved
7255 namespace. Renamed to m4_token_type and m4_symbol_type. Changed
7257 (m4_token_type): Renamed to m4_token_get_type.
7258 (m4_symtab, m4_symtab_init, m4_symtab_remove_module_references)
7259 (m4_symtab_exit): Removed from the exported module
7261 * m4/m4private.h (m4__symtab, m4__symtab_init)
7262 (m4__symtab_remove_module_references, m4__symtab_exit): ...and
7263 renamed and added to the internal api. Changed all callers.
7264 (m4_symtab_apply): A faster macro version of the function for
7265 users of the internal api.
7266 * m4/symtab.c (m4_symbol_destroy, m4_arg_destroy): Renamed to
7267 symbol_destroy and arg_destroy.
7268 (symtab_debug): Added a prototype.
7269 (m4_symtab_apply, m4_symbol_delete): Moved to the end of the file
7270 so that callers in this file get the faster macro versions from
7273 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7275 Refactoring modules to rationalise the API into an external
7276 documented (eventually!) API for use by modules in the `m4_'
7277 namespace declared in m4/m4module.h, an internal API between the
7278 source files we ship (including our shipped modules) in the `m4__'
7279 namespace declared in m4/m4private.h and making the rest as
7280 cohesive as possible with liberal use of the `static' keyword.
7281 This change represents an audit to m4/module.c along these
7284 * m4/m4module.h (m4_module_close_all, m4_module_find_by_builtin):
7285 Removed. No longer used.
7286 (m4_module_close): Removed prototypes.
7287 (m4_module_init, m4_module_open, m4_module_unload_all): Removed
7288 from the exported module api...
7289 * m4/m4private.h (m4__module_init, m4__module_open)
7290 (m4__module_exit): ...and renamed and added to the internal api.
7291 Changed all callers.
7292 (BUILTIN_SYMBOL, MACRO_SYMBOL, INIT_SYMBOL, FINISH_SYMBOL):
7293 Centralised definitions after renaming...
7294 * m4/module.c (M4_BUILTIN_SYMBOL, M4_MACRO_SYMBOL, M4_INIT_SYMBOL)
7295 (M4_FINISH_SYMBOL): ...and removing from here.
7296 (m4_module_dlerror, m4_module_remove, m4_module_close)
7297 (m4_caller_id): Not exported at all, so renamed to module_dlerror,
7298 module_remove, module_close and caller_id.
7299 (MODULE_SELF_NAME): New macro to make reporting self errors
7301 (m4_module_load, module_close, module_remove): Use it.
7302 * m4/m4private.h (USER_MODULE_PATH_ENV): Macro to hold "M4MODPATH"
7304 * src/main.c (main): Use it.
7306 2003-06-12 Gary V. Vaughan <gary@gnu.org>
7308 * README: Remove references to --enable-changeword, which has been
7309 removed from the code.
7311 2003-06-11 Gary V. Vaughan <gary@gnu.org>
7313 Getting rid of the annoying bug with configure --enable-debug,
7314 which spewed -e: command not found errors. This was an interaction
7315 between libtool-1.5's LT_AC_COMPILER_OPTION, and config/debug.m4.
7316 You'll need to re-bootstrap the m4 tree with cvs libtool (HEAD or
7317 branch-1-5) to get the full fix.
7319 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Require libtools version
7320 of AC_LIBTOOL_COMPILER_OPTION (which now requires LT_AC_PROG_SED),
7321 and then use the probed value of $SED.
7322 (AC_LIBTOOL_COMPILER_OPTION): Removed. Don't conditionally define
7323 this, it messes up the AC_REQUIRE stack.
7325 2003-06-10 Gary V. Vaughan <gary@gnu.org>
7327 * m4/symtab.c (m4_symbol_popdef): Need to pass the hash address to
7328 the destroy callback.
7329 (m4_arg_destroy): Use the hash address to free the hash node key
7332 2003-06-06 Gary V. Vaughan <gary@gnu.org>
7334 First cut at formal parameters in macros.
7336 * configure.ac (AC_REPLACE_FUNCS): Add xstrzdup.
7337 * m4/xstrzdup.c: New file.
7338 * m4/builtin.c (M4_ARG_SIGNATURE_DEFAULT_SIZE): Start size for
7339 associative array of parameter names to details.
7340 (m4_symbol_token): Capture macro names with parameter lists.
7341 (m4_arg_signature_parse): And build an associative array to hang
7342 from the symbol structure to map names to details.
7343 * m4/hash.c (m4_hash_new): Break the m4_hash_new followed by
7344 m4_hash_resize idiom. Now that we potentially add a little hash
7345 table to many of the entries in the symbol table, added an extra
7346 arg to set the initial size. Changed all callers.
7347 (m4_hash_apply): New function that is basically a generalised
7349 * m4/symtab.c (m4_symbol_apply): ...this. Now deleted. Adjusted
7350 all callers to call m4_hash_apply instead.
7351 (m4_arg_destroy): Recycle memory used by an m4_token_arg.
7352 (m4_symbol_popdef): Use m4_arg_destroy to help recycle the
7353 m4_arg_signature association that might be attached to the symbol,
7354 * m4/hash.h (m4_hash_apply_func): Replacement type for...
7355 * m4/m4module.h (m4_symtab_apply_func): ...this. Now deleted.
7356 (M4_SYNTAX_ASSIGN): Placeholder for assigning default values in
7358 (M4_IS_ASSIGN): Detect characters with M4_SYNTAX_ASSIGN syntax.
7359 (M4_IS_IDENT): Detect characters that can be safely used in
7361 * m4/syntax.c (m4_syntax_init): Add an M4_SYNTAX_ASSIGN character.
7362 * m4/macro.c: Corrected grammar in some comments. Use `token'
7363 rather than `td' for m4_token variables.
7364 (m4_process_macro): If we find a dollar followed by some
7365 M4_IS_IDENT characters, replace that with the contents of the argv
7366 entry with offset stored in the m4_token_arg associated with the
7367 collected identifier.
7369 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7371 Begin preparations for supporting formal parameters in m4 macros.
7373 * m4/m4private.h (struct m4_token_arg): Placeholder for holding
7374 the details of a formal parameter.
7375 (m4_token): Add an arg_signature member to hold a hash table for
7376 looking up formal parameters.
7377 * m4/input.c: Update more bitrotted comments.
7378 (m4_push_builtin): Initialise arg_signature member.
7379 (init_builtin_token): Copy arg_signature member.
7380 * m4/m4module.h (m4_builtin_pushdef, m4_builtin_define)
7381 (m4_macro_pushdef, m4_macro_define): Rewritten as macros to
7383 * m4/builtin.c (m4_builtin_pushdef, m4_builtin_define)
7384 (m4_macro_pushdef, m4_macro_define): ...these, And...
7385 (m4_symbol_token): ...wrapped around this new function, which
7386 vastly simplifies the arguments required by the functions it
7388 Changed all callers.
7390 2003-06-05 Gary V. Vaughan <gary@gnu.org>
7392 * m4/macro.c: Format changes.
7394 2003-06-04 Gary V. Vaughan <gary@gnu.org>
7396 * m4/input.c: Updated various bitrotted comments.
7397 (m4_push_builtin): Just pass the whole m4_token, rather than
7398 extracting all the fields in the caller. This also allows us to
7399 check the token type for consistency.
7400 (macro_funcs, macro_peek, macro_read, m4_push_macro, CHAR_MACRO):
7401 Renamed to builtin_funcs, builtin_peek, builtin_read,
7402 m4_push_builtin and CHAR_BUILTIN for consistency with the rest of
7403 the code. Changed all callers.
7404 (struct input_block): Similarly renamed u_m member to u_b, and
7405 changed all callers.
7406 (m4_next_token): Use bzero to initialise the data fields.
7407 * m4/m4module (m4_push_macro): Renamed to m4_push_builtin.
7409 2003-05-29 Gary V. Vaughan <gary@gnu.org>
7411 These changes were necessary to get m4 to build on my iBook
7412 running "powerpc-apple-darwin6.6" using Apples build of gcc "gcc
7413 (GCC) 3.1 20020420 (prerelease)":
7415 * src/main.c: Don't include dlfcn.h, ltdl.h handles correct
7416 inclusion of module loader headers.
7417 * modules/Makefile.am: Use AM_LDFLAGS, not LDFLAGS.
7418 * m4/Makefile.am: Ditto.
7419 (libm4_la_LIBADD): Added $(LTLIBINTL).
7420 * m4/utility.c (program_name): Removed declaration in favour of
7421 the one already in error.c!
7422 * m4/m4module.h (program_name): Define to program_invocation_name
7423 when using GNU C library. Use an explicit extern declaration.
7424 (interactive, sync_output, debug_level, hash_table_size)
7425 (no_gnu_extensions, prefix_all_builtins, max_debug_argument_length)
7426 (suppress_warnings, warning_status, nesting_limit, discard_comments)
7427 (lquote, rquote, bcomm, ecomm, m4_bad_argc, m4_skip_space)
7428 (m4_numeric_arg, m4_shipout_int, m4_shipout_string, m4_dump_args)
7429 (m4_debug, m4_debug_init, m4_debug_exit, m4_debug_decode)
7430 (m4_debug_flush_files, m4_debug_set_output, m4_debug_message_prefix)
7431 (m4_trace_prepre, m4_trace_pre, m4_trace_post, m4_sysval)
7432 (m4_expansion_level, m4_expand_ranges, m4_expand_input)
7433 (m4_call_macro, m4_process_macro, m4_syntax_table, m4_current_file)
7434 (m4_current_line, m4_current_diversion, m4_output_current_line):
7435 Don't rely on default, use an explicit extern.
7436 * m4/error.h (error, error_at_line, error_print_progname)
7437 (error_message_count, error_one_per_line): Ditto.
7438 * m4/ltdl.c: Update from CVS libtool.
7440 * commit: Update from CVS cvs-utils.
7442 2002-11-04 gettextize <bug-gnu-gettext@gnu.org>
7444 * po/Makefile.in.in: Upgrade to gettext-0.11.5.
7445 * po/boldquot.sed: New file, from gettext-0.11.5.
7446 * po/en@boldquot.header: New file, from gettext-0.11.5.
7447 * po/en@quot.header: New file, from gettext-0.11.5.
7448 * po/insert-header.sin: New file, from gettext-0.11.5.
7449 * po/quot.sed: New file, from gettext-0.11.5.
7450 * po/remove-potcdate.sin: New file, from gettext-0.11.5.
7451 * po/Rules-quot: New file, from gettext-0.11.5.
7453 2002-11-04 Akim Demaille <akim@epita.fr>
7455 * doc/m4.texinfo (Esyscmd): Don't grep, use something easier:
7457 * tests/others.at (iso8859): Use abs_srcdir, not srcdir.
7459 2002-11-04 Akim Demaille <akim@epita.fr>
7461 * config/Makefile.am (ACLOCAL_MACROS): Ship the Gettext macros.
7463 2002-11-04 Akim Demaille <akim@epita.fr>
7465 * configure.ac: Automake 1.7.1, Autoconf 2.54, Gettext 0.11.5,
7466 used as `external', and Libtool 1.4.3.
7468 (LTLIBOBJS): Don't play with it.
7470 * Makefile.am (SUBDIRS): Remove intl.
7471 (ACLOCAL_AMFLAGS): Add -I config.
7472 (EXTRA_DIST): Add config/config.rpath.
7475 * modules/perl.c (M4INIT_HANDLER): Don't prototype xs_init.
7477 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7479 Preparations for refactoring syntax tables to allow reverse
7480 lookups [fetch me a M4_SYNTAX_OPEN], without compromising the
7481 speed of normal lookups in an array of unsigned short.
7483 * m4/input.c (single_quotes, single_comments, use_macro_escape):
7485 * m4/m4private.h (m4__single_quotes, m4__single_comments,
7486 m4__use_macro_escape): ...to here, and renamed. The `m4__' prefix
7487 is for internal symbols which unavoidably pollute the global
7488 namespace, but are not published APIs.
7489 Adjusted all callers.
7490 * m4/input.c (m4_syntax_init, m4_syntax_code, m4_set_quotes,
7491 m4_set_comment, m4_set_syntax, set_syntax_internal,
7492 unset_syntax_attribute): Moved from this file...
7493 * m4/syntax.c: New. ...to this file.
7494 Also added an m4_syntax_exit stub for orthogonality.
7495 * src/main.c (main): Use it.
7496 * m4/Makefile.am (libm4_la_SOURCES): Add syntax.c.
7497 * m4/m4module.h: Reformatting. New prototypes.
7499 2002-05-29 Gary V. Vaughan <gary@gnu.org>
7501 * bootstrap (aclocal_apiversion): The aclocal apiversion is
7502 distinct from the automake release number (in that the apiversion
7503 apparently has no micro-version-component).
7504 (aclocal_apilibdir): Use it.
7506 2002-05-28 Gary V. Vaughan <gary@gnu.org>
7508 * m4/hash.c (m4_hash_resize): New function.
7509 * m4/hash.h: Add prototype.
7510 * m4/symtab.c (m4_symtab_init): Use it. This could do with some
7511 benchmarking to find a good value for, say, autoconf. This is
7512 already a little quicker than before for me.
7514 * m4/symtab.c (m4_symtab_hash, m4_symtab_cmp): Moved from here...
7515 * m4/hash.c (m4_hash_string_hash, m4_hash_string_cmp): .. to here,
7517 * m4/hash.h: Adjust prototypes.
7519 2002-01-22 Akim Demaille <akim@epita.fr>
7521 * bootstrap (aclocal_apilibdir): New, to cope with Automake's new
7523 * tests/Makefile.am (package.m4): New.
7524 * tests/atlocal.in: Adjust to CVS Autotest.
7525 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Use AC_LIBOBJ.
7526 * configure.ac: LIBOBJ is a forbidden string.
7527 Simplify AM_INIT_AUTOMAKE invocation.
7528 * config/Makefile.am (ACLOCAL_MACROS): Add amversion.m4 and
7531 2002-01-21 gettextize <bug-gnu-utils@gnu.org>
7533 * po/Makefile.in.in: Upgrade to gettext-0.10.40.
7535 2001-10-19 Akim Demaille <akim@epita.fr>
7537 * m4/module.c, m4/output.c, src/main.c: Normalize error messages.
7539 2001-10-19 Akim Demaille <akim@epita.fr>
7541 * m4/input.c (m4_next_token): Display where was opened what is
7544 2001-10-19 Akim Demaille <akim@epita.fr>
7546 * m4/macro.c (expand_argument): Display where was opened what is
7549 2001-10-18 Akim Demaille <akim@epita.fr>
7551 * m4/input.c, modules/m4.c: Formatting changes.
7553 2001-10-17 Gary V. Vaughan <gary@gnu.org>
7555 * bootstrap: s/configure.in/configure.ac/
7557 2001-10-16 Gary V. Vaughan <gary@gnu.org>
7559 * m4/symtab.c (m4_symbol_destroy): This function calls
7560 m4_symbol_popdef, which recycles a symbols memory when the last
7561 definition is popped. Since we were passing the address of the
7562 symbol name found in the symbol table, and it was being removed
7563 partway through m4_symbol_destroy() we were referencing freed
7564 memory for the balance of the function. Now we take a copy of the
7565 symbol name tring and use that as a key into the symbol
7566 table... that way if the original symbol name is freed, the copy
7569 2001-10-13 Akim Demaille <akim@epita.fr>
7571 * m4/ltdl.c: Update.
7573 2001-10-13 Akim Demaille <akim@epita.fr>
7575 * src/main.c, src/freeze.c, m4/debug.c, m4/input.c, m4/macro.c:
7576 Don't gettextize internal error messages.
7578 2001-10-13 Akim Demaille <akim@epita.fr>
7580 * tests/macros.at (Arity and defn): New failing test.
7581 (Arity, defn, and freeze): New.
7583 Fix `Arity and defn'.
7585 * m4/input.c (m4_push_macro): Don't forget the arity.
7586 * modules/m4.c (defn): Likewise.
7588 2001-10-13 Akim Demaille <akim@epita.fr>
7590 * tests/builtins.at (pushdef/popdef, trace, trace2, trace3): Move
7592 * tests/macros.at (pushdef/popdef, Tracing Hanoi Towers)
7593 (Propagation of traceon, Propagation of --trace): this new file.
7595 2001-10-13 Akim Demaille <akim@epita.fr>
7597 * m4/utility.c (m4_numeric_arg): Use the usual (argc, argv, ...)
7598 interface instead of (name, argc...).
7599 Upon failure, specify which argument was guilty.
7602 2001-10-13 Akim Demaille <akim@epita.fr>
7604 * modules/evalparse.c: Save translators' time: don't translate
7605 internal error messages.
7606 (m4_evaluate): Simplify/normalize error messages.
7607 * doc/m4.texinfo (Eval): Adjust.
7609 2001-10-13 Akim Demaille <akim@epita.fr>
7611 * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
7612 where no checking is needed.
7613 * m4/utility.c (m4_bad_argc): Use the usual (argc, argv, ...)
7614 interface instead of (name, argc...).
7616 * modules/gnu.c (m4_patsubst_do): Don't check argc, done
7619 2001-10-13 Akim Demaille <akim@epita.fr>
7621 * m4/utility.c (m4_bad_argc): Display user argument counts, i.e.,
7622 exclude the builtin name from the count.
7623 * modules/m4.c (ifelse): Do not use the regular argc mechanism, as
7624 calling ifelse with a single argument is valid.
7625 * doc/m4.texinfo (Ifelse): Add an example where ifelse is invoked
7626 with 1 and 2 args, mostly to strengthen the test suite.
7628 2001-10-13 Akim Demaille <akim@epita.fr>
7630 * m4/output.c (m4_make_diversion, m4_insert_file)
7631 (m4_insert_diversion, +m4_freeze_diversions): Ansify.
7633 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7635 * m4/input.c (init_builtin_token): Renamed from init_macro_token,
7636 since we call these things builtins in the rest of the code!
7638 * modules/gnu.c (m4_regexp_compile): s/%0/%s/
7640 2001-10-12 Gary V. Vaughan <gary@gnu.org>
7642 Rather than forcing each builtin definition to manage its own
7643 argument range checking, tabulate the maxima and minima for all
7644 builtins in each module. This forces us to consider what the
7645 valid ranges for each builtin should be, and moves the checking
7646 code out of each builtin implementation and into the builtin
7647 caller infrastructure.
7649 * m4/m4module.h (struct m4_builtin): Add argument minima and
7651 * m4/m4private.h (struct m4_token): Reflect them here too.
7652 * m4/input.c (struct input_block): ...and here.
7653 (m4_token_copy): New function for token copying.
7654 (init_macro_token): Copy them from a token to the input stack.
7655 (m4_next_token): Don't forget to initialise them for text
7657 * m4/macro.c (expand_argument): Use m4_token_copy, and also
7658 check argument counts before calling the builtin handler.
7659 * m4/symtab.c (m4_symbol_builtin): Take minima and maxima params.
7660 (m4_symbol_macro): Likewise.
7661 * m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args
7662 parameters. Updated all callers.
7663 (m4_builtin_define): Ditto.
7664 (m4_macro_pushdef, m4_macro_define): Ditto.
7665 * m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto.
7666 * modules/evalparse.c: Declare argument counts for defined
7667 builtins and remove explicit calls to m4_bad_argc().
7668 * modules/gnu.c: Ditto.
7669 * modules/load.c: Ditto.
7670 * modules/m4.c: Ditto.
7671 * modules/modtest.c: Ditto.
7672 * modules/mpeval.c: Ditto.
7673 * modules/perl.c: Ditto.
7674 * modules/shadow.c: Ditto.
7675 * modules/stdlib.c: Ditto.
7676 * modules/time.c: Ditto.
7679 2001-10-10 Gary V. Vaughan <gary@gnu.org>
7681 The trace semantics now attach the trace bit to a symbol name.
7682 For as long as a traceon(`foo') is active, calls to foo will be
7683 traced regardless of intervening undefines or module unloads.
7684 Fixed the flag propogation issues differently to the fixes
7685 reverted with the last attempt at nailing down trace:
7687 * m4/m4private.h: This file is not visible outside of the m4
7688 source tree, so I removed all the `M4_' and `m4_' prefixes to save
7689 on typing. Updated all clients.
7690 (m4_token): New typedef contains the fields that need to be passed
7691 around with the low level tokeniser.
7692 (m4_token_data): Removed.
7693 (m4_symbol): Now contains the traced flag again.
7694 * m4/symtab.c: Rewritten again. Now we don't remove symbols with
7695 the trace bit set. This change is contained entirely within this
7696 module and doesn't leak out into the callers. Updated all
7698 (m4_symbol_builtin, m4_symbol_macro): Adjusted to make use of the
7699 new fields in m4_token. Updated all clients.
7700 * m4/builtin.c (m4_builtin_pushdef): Needs a flags argument so
7701 that `groks_macro_args' and `blind_if_no_args' flags are retained
7702 when defn() results are passed around in m4 code. Updated all
7704 (m4_builtin_define): Ditto.
7705 (m4_macro_pushdef, m4_macro_define): Ditto.
7706 * m4/input.c (struct input_block): Add a flags field to facilitate
7708 (m4_push_macro): ...use it.
7709 (init_macro_token): Retrieve it.
7710 (m4_next_token): Initialise it.
7711 * m4/macro.c (expand_argument): Copy it.
7712 * m4/m4module.h: Adjust.
7713 * tests/builtins.at: Adjust the expected output of the trace
7714 tests to reflect the change in semantics.
7715 * tests/modules.at (modules: trace): Check that unloading a
7716 module which supplies a traced symbol definition doesn't lose te
7719 2001-10-07 Gary V. Vaughan <gary@gnu.org>
7721 * modules/gnu.c (m4_macro_table): Display the timetamp when
7722 expanding __m4_version__.
7724 * configure.ac (--with-modules): Forgot a comma in the
7725 AC_HELP_STRING parameter list.
7727 2001-10-05 Gary V. Vaughan <gary@gnu.org>
7729 * bootstrap: Remove aclocal.m4t when it is no longer required.
7731 2001-10-05 Akim Demaille <akim@epita.fr>
7733 * tests/Makefile.am: Adjust for gnuprog2.
7734 * tests/m4.in: There can be a leading path.
7735 * tests/modules.at (AT_CHECK_M4_MODTEST): No need for $4 and $5.
7736 * tests/testsuite.at: Adjust to the most recent Autotest.
7737 (AT_CHECK_M4_FILTER): Fix and rename as...
7739 * tests/others.at: Use it.
7741 * config/gmp.m4 (_AC_LIB_GMP): In order to read the content of a
7742 variable in shell scripts, one uses `$'...
7744 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7746 * configure.ac: `rm -f $m4_getopt_h' was lost.
7748 2001-10-04 Gary V. Vaughan <gary@gnu.org>
7750 * configure.ac (TIMESTAMP): Display with AS_BOX at configure
7751 time. Define it for config.h in order to...
7752 * src/main.c (main): ...display the timestamp for --version.
7754 2001-10-04 Akim Demaille <akim@epita.fr>
7756 * modules/gnu.c (m4_regexp_do, m4_patsubst_do): Extracted from
7757 previous builtins `regexp' and `patsubst'.
7758 (regexp, patsubst): Use them.
7759 (eregexp, epatsubst): New builtins.
7760 * doc/m4.texinfo (Patsubst, Regexp): Rename and complete as...
7761 (Epatsubst and Patsubst, Eregexp and Regexp): these.
7762 (Extensions): More info on REs.
7764 2001-10-04 Akim Demaille <akim@epita.fr>
7766 * modules/modtest.c (init_handler): Consistently output to stderr.
7767 (finish_handler): New.
7768 (test): The `if' is an `assert'.
7769 * tests/modules.at: Adjust.
7771 2001-10-04 Akim Demaille <akim@epita.fr>
7773 * m4/utility.c (m4_bad_argc): Detail the mismatches.
7775 2001-10-01 Akim Demaille <akim@epita.fr>
7777 * tests/generate.awk: Tag the tests with `documentation'.
7778 * tests/modules.at (AT_CHECK_M4_MODTEST): New.
7779 Use the make the existing modtest tests more uniform, and complete
7780 the set of possibilities.
7782 2001-10-01 Akim Demaille <akim@epita.fr>
7784 * config/gmp.m4: Consult the user before using GMP: use
7786 * configure.ac: Adjust.
7787 * modules/gmp.c: No protection needed as the module is not built
7790 2001-10-01 Akim Demaille <akim@epita.fr>
7792 * tests/generate.awk: Remove debugging code.
7793 (fatal): Specify the current location.
7795 * m4/debug.c, m4/macro.c, m4/utility.c, modules/format.c,
7796 * modules/gnu.c, modules/m4.c: Use M4ARG.
7798 2001-10-01 Akim Demaille <akim@epita.fr>
7800 * modules/gnu.c (RE_SYNTAX_BRE, RE_SYNTAX_ERE): New.
7801 (m4_regexp_compile): New.
7802 (regexp, patsubst): Use it.
7804 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7806 Reinstate the memory handling improvements from the patch I just
7807 reverted. Relevant ChangeLog entries repeated here:
7809 * m4/module.c (m4_module_remove): New function that holds the core
7810 of the old m4_module_unload.
7811 (m4_module_unload): Use it.
7812 (m4_module_unload_all): When we know the modules will never be
7813 used again (i.e. on exit), free up as much module memory as
7814 possible. There are still some artifacts from resident modules
7815 living inside ltdl.c, but everything else is freed.
7816 * m4/debug.c (m4_debug_exit): Free memory allocated in
7818 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7819 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7820 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7821 * m4/m4module.h: Updated prototypes.
7822 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7823 * m4/hash.h: Updated prototypes.
7824 * src/main.c (main): Use all these new functions to clean up as
7825 much memory as possible before exit.
7827 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7829 Reverted my large patch for removing the old m4_symbol
7830 structure on 2001-09-20. We are still not happy about the way
7831 trace works in conjunction with defn and undefine, and leaving
7832 the reverted patch active prevents us from moving the traced
7833 bit from the definition back to the symbol.
7835 2001-09-30 Gary V. Vaughan <gary@gnu.org>
7837 * configure.in: Moved to...
7838 * configure.ac: ...here. Added a libtool like timestamped
7839 banner, and tidied up the libltdl cruft.
7840 * config/mkstamp: Script to extract a timestamp from ChangeLog.
7841 * modules/Makefile.am (INCLTDL): Removed. This is required
7842 only when libltdl is configured in a subdirectory.
7843 * src/Makefile.am: Ditto.
7844 (LIBADD_DL): No need to add this again, libtool already knows
7845 that libm4.la depends on it.
7846 * m4/Makefile.am: Automake sets variables from AC_SUBST. Use
7849 * TODO: stackovf.c is basically broken.
7850 Reported by Marc Espie <espie@schutzenberger.liafa.jussieu.fr>
7852 2001-09-28 Akim Demaille <akim@epita.fr>
7854 * tests/Makefile.am (EXTRA_DIST): `m4' is not to be shipped.
7856 2001-09-27 Akim Demaille <akim@epita.fr>
7858 * tests/m4.in: Don't use short options.
7859 Simplify the stderr signature normalization.
7861 2001-09-27 Akim Demaille <akim@epita.fr>
7863 tests/m4 shall be position independent.
7867 * tests/testsuite.at: No args to AT_INIT.
7868 * configure.in, tests/Makefile.am: Adjust.
7870 2001-09-22 Akim Demaille <akim@epita.fr>
7872 Autotest has changed again.
7874 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
7875 (package.m4): Remove.
7876 * configure.in: Adjust to LIBADD_GMP.
7878 2001-09-21 Gary V. Vaughan <gary@gnu.org>
7880 * config/gmp.m4 (AC_ARG_WITH): Removed.
7881 (GMP_LIB): Renamed to LIBADD_GMP for consistency.
7882 (AC_LIB_GMP): When performing a test compile against libgmp,
7883 include the header gmp.h if possible, and link against -lgmp. If
7884 they both work define USE_GMP.
7885 * modules/Makefile.am (mpeval_la_LIBADD): Add LIBADD_GMP.
7886 (mpeval_LTX_init_func): Complain on load that there was no libgmp
7889 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7891 * m4/evalparse.c: Moved to...
7892 * modules/evalparse.c: ...here. This code is shared between
7893 modules/mpeval.c and modules/m4.c, so there is no need to pollute
7894 the libm4 API with its details. Moderately rewritten to interface
7895 into its clients more simply.
7896 * m4/eval.c: Deleted. Migrated functionality to...
7897 * modules/m4.c: ...here.
7898 (builtin_eval): Implemented in terms of the new interface style.
7899 * modules/mpeval.c (builtin_mpeval): Ditto.
7900 * m4/m4module.h: Removed references to the former m4/eval.c.
7901 * m4/Makefile.am (libm4_la_SOURCES): Removed eval.c.
7902 (EXTRA_libm4_la_SOURCES): Deleted.
7903 * modules/Makefile.am (EXTRA_m4_la_SOURCES): Reference evalparse.c.
7904 (EXTRA_mpeval_la_SOURCES): Reference evalparse.c.
7906 2001-09-20 Akim Demaille <akim@epita.fr>
7908 * config/gmp.m4 (AM_WITH_GMP): Rename as...
7910 By default, use gmp.
7912 * configure.in: Adjust.
7913 Use Automake conditionals for USE_GMP.
7914 Always compute sizeof (long long int).
7915 This was a bug BTW, as `eval' (not `mpeval') depends on it:
7916 before, it was used _only_ if mpeval was not activated.
7917 * modules/Makefile.am (pkglibexec2dir, +pkglibexec2_LTLIBRARIES)
7918 (mpeval_la_LIBADD): New macros.
7919 * modules/mpeval.c: No longer be conditioned by WITH_GMP.
7921 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Create package.m4.
7922 * tests/atlocal.in, tests/builtins.at: Depend upon USE_GMP, not
7925 2001-09-20 Akim Demaille <akim@epita.fr>
7927 * tests/Makefile.am (package.m4): New.
7928 * tests/testsuite.at: Adjust AT_INIT and AT_VICTIMS.
7930 2001-09-20 Gary V. Vaughan <gary@gnu.org>
7932 More cleanup. After the last patch, m4_symbol holds nothing but
7933 the head of a chain of m4_token_data. So I have removed the old
7934 m4_symbol, so that m4_token_data chains are stored directly in the
7935 value cell of a hash table node. But there's more... m4_symbol
7936 was a more natural name for the symbol value cell, and now that it
7937 is gone I have renamed the former m4_token_data structure to
7938 m4_symbol. This change turned out to be a pig to get right, since
7939 the original code didn't need to modify the value cell itself,
7940 since changing the chain happened inside the m4_symbol that used
7941 to be returned -- I had to pass the address of the value cell
7942 across various function calls, incase the head value changed. I
7943 also tightened up the memory management to help me find a nasty
7944 memory corruption bug that took me all night to track down...
7946 * m4/m4private.h (struct m4_symbol): Removed.
7947 (struct m4_token_data): Renamed to `struct m4_symbol'. Updated
7949 * m4/hash.c (m4_hash_iterator_value): Return the address of the
7950 value cell. Updated all callers.
7951 * m4/symtab.c: Took advantage of the simplification in the data
7952 structures to rewrite a lot of this file more simply. There is
7953 still some room for optimisation here, but we should tackle that
7954 systematically closer to the release.
7956 * m4/ltdl.c: Added dmalloc support, and fixed some memory leaks it
7957 revealed. This version is ahead of CVS libtool until I get chance
7958 to flush my changes.
7959 * m4/module.c (m4_module_remove): New function that holds the core
7960 of the old m4_module_unload.
7961 (m4_module_unload): Use it.
7962 (m4_module_unload_all): When we know the modules will never be
7963 used again (i.e. on exit), free up as much module memory as
7964 possible. There are still some artifacts from resident modules
7965 living inside ltdl.c, but everything else is freed.
7966 * m4/debug.c (m4_debug_exit): Free memory allocated in
7968 * m4/input.c (m4_input_exit): Ditto wrt m4_input_init().
7969 * m4/output.c (m4_output_exit): Ditto wrt m4_output_init ().
7970 * src/stackovf.c (stackovf_exit): Ditto wrt setup_stackovf_trap ().
7971 * m4/m4module.h: Updated prototypes.
7972 * m4/hash.c (m4_hash_exit): Free the nodes on the free list.
7973 * m4/hash.h: Updated prototypes.
7974 * src/main.c (main): Use all these new functions to clean up as
7975 much memory as possible before exit.
7977 2001-09-18 Gary V. Vaughan <gary@gnu.org>
7979 The `traced' flag needs to be attached to the definition of a
7980 symbol rather than the current symbol containing the definition.
7981 Implementing this showed up some long standing post 1.4 bugs in
7982 flag propogation which I also fixed.
7984 * m4/m4private.h (struct m4_symbol): Remove the traced flag.
7985 (struct m4_token_data): And add it back in here.
7986 * m4/input.c (init_macro_token): Propogate the traced flag
7988 * m4/macro.c (expand_argument): Ditto.
7989 * tests/builtins.at (trace2, trace3): New tests based on Akim's
7992 2001-09-08 Gary V. Vaughan <gary@gnu.org>
7994 * m4/m4private.h (struct m4_token_data): Simplified by removing
7995 the redundant `traced' flag, and one level of structure nesting.
7996 (M4_TOKEN_DATA_FUNC_TRACED): Removed.
7997 * m4/input.c (init_macro_token): No need to initialise removed
7999 * m4/macro.c (expand_argument): No need to copy it either.
8000 * m4/utility.c (m4_token_data_func_traced): Or provide an access
8003 * m4/hash.c (m4_hash_bucket_insert): Symbol shadowing is no longer
8004 dependant on multiple symbols with the same key, so preserving
8005 relative symbol order in each bucket during resizing is no longer
8006 required. The resize function is considerably faster as a result.
8008 * m4/m4module.h, m4/builtin.c, m4/symtab.c:
8009 s/m4_symbol_insert/m4_symbol_define/g;
8010 s/m4_builtin_insert/m4_builtin_define/g;
8011 s/m4_macro_insert/m4_macro_define/g. Updated all callers.
8013 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8015 Get rid of m4_symbol_lookup_t entirely. With Akim's earlier
8016 commits, the m4_lookup_symbol dispatch function is split into
8017 specialised functions that must be called directly.
8019 * m4/m4module.h (m4_symbol_lookup_t): Removed.
8020 * m4/symtab.c (m4_lookup_symbol): Removed.
8021 (m4_symbol_builtin, m4_symbol_macro): New functions.
8022 * m4/builtin.c (m4_builtin_define): Split into...
8023 (m4_builtin_pushdef, m4_builtin_insert): ...these.
8024 (m4_macro_define): Split into...
8025 (m4_macro_pushdef, m4_macro_insert): ...these.
8026 * src/main.c (main): Set command line macros from `-D' parameters
8027 using `m4_macro_define'.
8029 2001-09-08 Gary V. Vaughan <gary@gnu.org>
8031 * m4/symtab.c (m4_symtab_remove_module_references): Renamed as
8032 this from m4_remove_table_reference_symbols().
8033 * m4/m4module.h, m4/module.c: Updated all references.
8035 2001-09-07 Akim Demaille <akim@epita.fr>
8037 * modules/stdlib.c, modules/times.c: Misc cleanups.
8039 2001-09-07 Akim Demaille <akim@epita.fr>
8041 * configure.in: We now need Autoconf 2.52e.
8042 * m4/m4module.h (m4_symbol_lookup_t): Remove `M4_SYMBOL_POPDEF'
8043 and `M4_SYMBOL_DELETE'.
8044 * m4/symtab.c (m4_lookup_symbol, symtab_debug): Adjust.
8045 * src/main.c (main): Adjust.
8047 2001-09-06 Gary V. Vaughan <gary@gnu.org>
8049 Fix the obstack.h problem once and for all! At configure time we
8050 can test for a system supplied obstack.h: depending on the
8051 result, we now generate system.h with an #include of the correct
8052 header. As a bonus, I've also added a --with-included-obstack,
8053 incase the user doesn't like the system obstack for some
8054 reason... and also we can test the shipped obstack on a system
8055 that has oe of its own. We also now need to be careful to add
8056 build directories to the include search path, since the generated
8057 system.h will be in the build tree.
8059 * configure.in (AC_CONFIG_FILES): Generate system.h from
8061 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Determine whether to
8062 include the system obstack header or the copy shipped with M4.
8063 Allow the user to override configure and force the build to use
8064 the shipped version.
8065 * m4/system-h.in: New file, template for...
8066 * m4/system.h: ...this. Now deleted.
8067 * m4/m4module.h: Include system.h before everything else.
8068 * src/freeze.c: Ditto.
8069 * m4/Makefile.am (dist-hook): Remove generated system.h.
8070 (INCLUDES): Check builddir for generated headers before checking
8072 * modules/Makefile.am (INCLUDES): Ditto.
8073 * src/Makefile.am (INCLUDES): Ditto.
8075 2001-09-05 Gary V. Vaughan <gary@gnu.org>
8077 * TODO: Remove the items that have been addressed already.
8079 2001-09-05 Akim Demaille <akim@epita.fr>
8081 * src/main.c (main): Standardize --version.
8083 2001-09-05 Akim Demaille <akim@epita.fr>
8085 * modules/format.c (format): Have a bigger `str'.
8087 2001-09-05 Akim Demaille <akim@epita.fr>
8089 Rationalize warnings, reporting the macro name as if it were a
8090 program name, and assertions.
8092 * m4/m4module.h (m4_lookup_symbol): Prototype, it is still used.
8094 * m4/symtab.c (m4_lookup_symbol, m4_symbol_popdef)
8096 Use assert for internal errors.
8097 * m4/utility.c (m4_bad_argc, m4_numeric_arg, m4_dump_symbols): Use
8099 * modules/m4.c (undefine, defn, traceon, traceoff, dumpdef): use
8101 * tests/builtins.at (pushpop): Adjust.
8103 2001-09-05 Akim Demaille <akim@epita.fr>
8105 * m4/symtab.c (m4_symbol_insert): Don't use `foo () || bar ()'
8108 2001-09-05 Akim Demaille <akim@epita.fr>
8110 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_LOOKUP.
8111 * m4/macro.c, m4/symtab.c: Adjust.
8113 2001-09-05 Akim Demaille <akim@epita.fr>
8115 * m4/symtab.c (m4_symbol_popdef, m4_symbol_delete): Rename as...
8116 (m4_symbol_pop, m4_symbol_del): this.
8117 (m4_symbol_lookup, m4_symbol_pushdef, m4_symbol_insert)
8118 (m4_symbol_popdef, m4_symbol_delete): New.
8119 (m4_lookup_symbol): Adjust.
8120 * m4/m4module.h, src/main.c, modules/gnu.c, modules/m4.c: Adjust.
8122 2001-09-05 Akim Demaille <akim@epita.fr>
8124 * m4/m4module.h (m4_symbol_lookup): Rename as...
8125 (m4_symbol_lookup_t): this.
8127 2001-09-05 Akim Demaille <akim@epita.fr>
8129 * m4/m4module.h (m4_symbol_lookup): Remove M4_SYMBOL_IGNORE,
8131 * m4/symtab.c (m4_lookup_symbol): Adjust.
8133 2001-09-03 Gary V. Vaughan <gary@gnu.org>
8135 Bootstrap will now work with Libtool 1.4.1 or higher:
8136 * bootstrap: Remove stale autom4te.cache files when
8138 * config/Makefile.am (ACLOCAL_MACROS): Add ltdl.m4 and
8140 * bootstrap: Ignore acinclude.m4 now the we include ltdl.m4 and
8141 libtool.m4 directly.
8142 Run libtoolize to refresh ltmain.sh.
8143 * config/ltmain.sh: Deleted.
8144 * acinclude.m4: Deleted.
8145 * m4/ltdl.c, m4/ltdl.h: Updated from libtool-1.4.1.
8147 * config/debug.m4 (AC_LIBTOOL_COMPILER_OPTION): Provide a fallback
8148 implementation for the cvs impaired libtool user.
8150 2001-09-03 Akim Demaille <akim@epita.fr>
8152 * m4/symtab.c (m4_lookup_symbol): Give more details when reporting
8154 Avoid using `default' in switch, as it hides useful compiler
8155 warnings when a case is forgotten.
8157 2001-09-03 Akim Demaille <akim@epita.fr>
8159 * src/main.c (MODULE_SHORTOPT, MODULEPATH_SHORTOPT): Remove, there
8160 is no such thing as `WITH_MODULES'.
8162 2001-09-03 Akim Demaille <akim@epita.fr>
8164 Improve the test suite's selfcontainedness.
8166 * doc/m4.texinfo: Let `input.m4' be the input file, not `in'.
8167 (Include, Undivert): Tag the other input files.
8168 * tests/generate.awk: Catch `@comment file:'.
8169 `-I $src' is no longer needed.
8170 `next' is really like `return': the rest is skipped.
8171 Adjust to `input.m4'.
8172 (fatal): New function.
8173 * tests/foo, tests/incl.m4: Remove.
8175 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8177 The shadowing mechanism and, infact, the whole symbol table
8178 implementation was creaking under the weight of the features piled
8179 on top of it. We now have a separate hash table module which will
8180 dynamically resize to keep symbol density withing good performace
8181 limits, and a new symtab module layered above it. Symbol lookups
8182 are now marginally more efficient (since the shadowed flag is no
8183 longer required) and symbol removal, such as on module unload, is
8184 considerably faster due to a reorganisation of the data structures
8187 * src/main.c (main): Don't mention `-H'.
8188 * doc/m4.texinfo (Invoking m4): Document that -H no longer has any
8191 * m4/hash.c: New generalised dynamic hash table data structure
8193 * m4/hash.h: Public interface.
8194 * m4/Makefile.am (pkginc_HEADERS): Add hash.h.
8195 (libm4_la_SOURCES): Add hash.c.
8196 * m4/symtab.c: More or less rewritten from scratch, within the
8197 bounds of the previous API.
8198 (m4_symtab_apply): A cleaner version of the old hack_all_symbols
8199 call. Updated all callers.
8200 * m4/m4module.c: #include <m4/hash.h>, and changed all affected
8201 declarations to reflect API changes.
8202 (M4INIT): Generate a declaration too, to avoid the warning with
8203 --enable-debug builds.
8206 * m4/utility.c (hash_table_size): Removed.
8207 (m4_dump_symbols): Rewritten to build and qsort an array of symbol
8208 names, which are then looked up by builtin_dumpdef() as necessary.
8209 This implies a small speedup in builtin_symbols(), which discarded
8210 all of the symbol info under the old call.
8211 * m4/m4private.h (m4_symbol): Removed shadowed flag -- symbol
8212 shadowing is implicit in respect to the new data structures.
8213 symbol names are no longer duplicated here, they are stored in the
8214 key field of the hash table.
8215 Moved macro_args and blind_no_args...
8216 (m4_token_data): ...to here.
8217 m4/macro.c (expand_macro): Added a name argument since the symbol
8218 name is no longer copied into each struct m4_symbol. Modified all
8220 (collect_arguments): Ditto.
8221 * modules/m4.c (set_trace): Ditto.
8222 * modules/gnu.c (builtin_symbols): Updated.
8223 * src/freeze.c (produce_symbol_dump): Much improved in light of
8224 the improved symbol table layout.
8226 2001-09-01 Gary V. Vaughan <gary@gnu.org>
8228 * m4/m4private.h (SYMBOL_NEXT): Move into m4's name space; renamed
8230 (SYMBOL_TRACED): Similarly renamed by prefixing with `M4_'.
8231 (SYMBOL_SHADOWED, SYMBOL_MACRO_ARGS, SYMBOL_BLIND_NO_ARGS,
8232 SYMBOL_NAME, SYMBOL_TYPE, SYMBOL_TEXT, SYMBOL_FUNC,
8233 SYMBOL_HANDLE): Ditto.
8234 * m4/builtin.c, m4/macro.c, m4/symtab.c, m4/utility.c,
8235 modules/gnu.c, modules/m4.c, src/freeze.c,
8236 src/main.c: Updated all references.
8238 * src/Makefile.am (m4_SOURCES): Don't list $(M4OBJS) here, since
8239 Automake 1.5 chokes on dynamic source file lists, Besides, it is
8240 already listed in m4_LDADD... how did that ever used to work?
8241 * configure.in (getopt.h): Use AC_CONFIG_LINKS instead of a manual
8243 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Ditto.
8244 Suggested by Tim Van Holder <tim.van.holder@pandora.be>
8246 * tests/m4: Don't call the m4 wrapper script with libtool, it
8247 works fine all by itself.
8249 2001-08-30 Gary V. Vaughan <gary@gnu.org>
8251 The experimental `changeword' feature never took off, and has
8252 no obvious advantages over `changesyntax' to compensate the
8253 enormous speed penalty it carries:
8254 * configure.in (ENABLE_CHANGEWORD): Removed.
8255 * m4/m4module.h (m4_set_word_regexp): Removed.
8256 * m4/m4private.h (m4_token_data): Removed original_text field.
8257 * m4/utility.c (m4_token_data_orig_text): Removed.
8258 * m4/input,c: Removed all conditional ENABLE_CHANGEWORD code.
8259 * m4/macro.c: Ditto.
8260 * src/main.c: Ditto.
8261 * modules/Makefile.am (changeword.la): Removed.
8262 * modules/changeword.c: File removed.
8263 * doc/m4.texinfo: References to changeword and --word-regexp
8265 * po/POTFILES.in: modules/changeword.c removed.
8266 * tests/atlocal.in (ENABLE_CHANGEWORD): Removed.
8267 * tests/builtins.at (changeword): Test removed.
8269 2001-08-30 Akim Demaille <akim@epita.fr>
8271 * bootstrap.sh: Create aclocal.m4 instead of modifying it.
8272 This also help having a single list of m4 files: in
8274 * config/Makefile.am (STANDARD_MACROS): Rename as...
8275 (ACLOCAL_MACROS): this.
8276 (list-standard-macros): Remove.
8279 2001-08-29 Gary V. Vaughan <gary@gnu.org>
8281 In an attempt to moderate my egomania...
8282 * tests/modules.at: Remove attributions.
8284 * tests/generate.awk: When making substitutions to "@&t@", either
8285 "&" or "\&" in the substitution string argument to gsub refer back
8286 to the matched text. "@\\&t@" seems to work though, Tests 43 and
8289 2001-08-29 Akim Demaille <akim@epita.fr>
8291 * tests/others.at (changeword, ddivert, debug, esyscmd, exp, gmp)
8292 (include, indir, multiquotes, patsubst, pushdef/popdef, regexp)
8293 (sync-lines, trace, translit, undivert, wrap): Move to...
8294 * tests/builtins.at: this new file.
8295 * tests/others.at (Discard comments, import-environment): Move to...
8296 * tests/options.at: this new file.
8298 2001-08-29 Akim Demaille <akim@epita.fr>
8300 * tests/others.at (Freezing modules)
8301 (--module-directory: absolute path, modpath2, modpath3)
8302 (M4MODPATH: absolute path, modtest, shadow, unload): Move to...
8303 * tests/modules.at: here, new file.
8304 * tests/others.at, tests/generate.awk: Add a banner.
8305 * tests/testsuite.at: Adjust.
8306 (AT_CHECK_M4_FILTER): New, but unused.
8308 2001-08-29 Akim Demaille <akim@epita.fr>
8310 * tests/testsuite.at (AT_CHECK_M4): Don't pass -I, let the tests
8312 * tests/others.at (wrap): Inline wrap.m4.
8313 (shadow): Inline shadow.m4.
8314 (iso8859): Don't specify the path from top_srcdir, but from srcdir.
8315 * tests/m4: Simplify.
8317 2001-08-29 Akim Demaille <akim@epita.fr>
8319 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): Use autom4te's
8322 2001-08-29 Akim Demaille <akim@epita.fr>
8324 * tests/generate.awk (normalize): s/@__@/@&t@/.
8326 2001-08-28 Akim Demaille <akim@epita.fr>
8328 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/.
8330 2001-08-28 Gary V. Vaughan <gary@gnu.org>
8332 * bootstrap (generate.awk): Generate test cases with new script.
8334 2001-08-27 Akim Demaille <akim@epita.fr>
8336 * tests/Makefile.am (installcheck-local): Don't use
8337 `dc_install_base' which is not visible here, but `exec_prefix'
8338 which is clearly the RT anyway.
8339 * tests/testsuite.at (AT_CHECK_M4): Don't pass -M here since it is
8340 related to testing a now installed m4.
8341 * tests/m4: Do it here.
8343 2001-08-27 Akim Demaille <akim@epita.fr>
8345 * tests/others.at (indir): Formatting change.
8347 2001-08-27 Akim Demaille <akim@epita.fr>
8349 * tests/Makefile.am (installcheck-local): New.
8350 * tests/testsuite.at (AT_CHECK_M4): Pass `-b' so that C-c works on
8352 Prefer options over envvars.
8353 * src/main.c (main): First bug caught by the test suite (yeah!):
8354 --batch lacked a `break' which resulted in an accidental
8355 invocation of --discard-comments.
8357 2001-08-27 Akim Demaille <akim@epita.fr>
8359 * tests/others.at (capitalize, changeword, comments, ddivert)
8360 (debug, esyscmd, exp, foreach, forloop, fstab, hanoi, include)
8361 (misc, multiquotes, patsubst, pushdef/popdef, regexp, reverse)
8362 (sysv-args, trace, translit, undivert): Don't rely on files in
8363 examples/: AT_DATA them.
8365 2001-08-27 Akim Demaille <akim@epita.fr>
8367 Let the test suite use a wrapper around the not installed m4 to
8368 pretend it is (installed).
8370 * bootstrap (aclocal.m4): Output AC_SUBST's and AM_CONDITIONAL's in
8371 such a way that m4 does not process them.
8372 * configure.in: The package name seems to be `m4', not `M4'.
8374 * tests/atlocal.in (at_package, M4): Remove.
8375 * tests/testsuite.at, tests/others.at: Use m4, not $M4.
8377 2001-08-27 Akim Demaille <akim@epita.fr>
8379 * tests/Makefile.am (CLEANFILES): Remove.
8380 (DISTCLEANFILES, clean-local): New.
8381 * examples/mktests.sh: Remove.
8383 2001-08-27 Akim Demaille <akim@epita.fr>
8385 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8386 Don't use aclocal: it's written by hand.
8387 * aclocal.m4: m4_include all the files instead of being built by
8389 * bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
8390 until it reads the traces by itself.
8391 * configure.in: Require Autoconf 2.42c as we are now using
8392 AC_CONFIG_TESTDIR instead of AT_CONFIG.
8393 Catch unexpanded `jm_' macros.
8394 * config/atconfig.m4: Remove.
8395 * config/error.m4: new.
8396 * config/Makefile.am: Ship the files included by aclocal.m4.
8397 * tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
8398 (TESTSUITE_AT): this, to please Automake.
8399 (TESTSUITE): This target uses autotest/autotest.m4, not
8400 autotest/general.m4.
8401 * tests/testsuite.at: Prereq Autotest 2.52c.
8402 * examples/Makefile.am (pkgdata_DATA): Rename as...
8403 (dist_pkgdata_DATA): this.
8404 * doc/Makefile.am (man_MANS): Rename as...
8405 (dist_man_mans): this.
8407 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8409 * m4/system.h [cygwin*]: Thanks to Paul Sokolovsky and
8410 Robert Collins, building on Cygwin no longer requires Windows
8411 import and export symbol decorations.
8412 * m4/m4module.h (M4_SCOPE) [cygwin*]: Deleted all occurences.
8413 * m4/error.h (M4_SCOPE) [cygwin*]: Ditto.
8414 * m4/debug.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8415 * m4/error.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8416 * m4/input.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8417 * m4/macro.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8418 * m4/output.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8419 * m4/utilty.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8420 * m4/xmalloc.c (M4_GLOBAL_DATA) [cygwin*]: Ditto.
8421 * configure.in (LIBM4_DLL_IMPORT) [cygwin*]: Don't set this
8423 * src/Makefile.am (AM_CPPFLAGS) [cygwin*]: Don't use it either!
8424 * modules/Makefile.am (AM_CPPFLAGS) [cygwin*]: Ditto.
8426 2001-08-20 Gary V. Vaughan <gary@gnu.org>
8428 Ansify the source. Previously we had a mix, where my code was
8429 in a K&R compatible style, and the preexisting code was in ANSI
8430 style. Nothing is lost wrt release 1.4 by reverting to ANSI,
8431 and now the code base is much cleaner.
8433 * m4/system.h: Remove M4_PARAMS macro and all users. Remove
8434 VOID macro and all users.
8435 * m4/m4module.h: Ansify function prototypes and headers.
8436 * m4/builtin.c: Ditto.
8437 * m4/evalparse.c: Ditto.
8438 * m4/input.c: Ditto.
8439 * m4/macro.c: Ditto.
8440 * m4/module.c: Ditto.
8441 * m4/output.c: Ditto.
8443 * m4/symtab.c: Ditto.
8444 * m4/utility.c: Ditto.
8445 * modules/format.c: Ditto.
8446 * modules/gnu.c: Ditto.
8447 * modules/m4.c: Ditto.
8448 * modules/mpeval.c: Ditto.
8449 * src/freeze.c: Ditto.
8451 * src/main.c: Ditto.
8453 2001-08-20 Akim Demaille <akim@epita.fr>
8455 * config/atconfig.m4: s/EOF/ATEOF/, so that configure can be
8456 generated with stock 2.52.
8458 2001-08-20 Akim Demaille <akim@epita.fr>
8460 * config/atconfig.m4: New, until part of Autoconf per se.
8461 * configure.in (AT_CONFIG): Use it.
8463 * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
8464 * tests/atlocal.in: New.
8465 * tests/generate.awk: For the time being, the empty quadrigraph is
8467 * tests/others.at (changeword, gmp): Check the configuration
8468 variable against `yes'.
8469 * tests/testsuite.at (dnl): Allow it, as it's used all over the
8472 2001-08-20 Akim Demaille <akim@epita.fr>
8474 * m4/utility.c (m4_numeric_arg): Spell out the culprit.
8475 * modules/m4.c (undivert): Disable the possibility of undiverting
8476 several files at once: it is not documented, it is inconsistent
8477 with the other macros, it can be straightforwardly mocked by
8478 several invocations, and most importantly, it prevents the
8479 possibility of other kinds of extension.
8480 Use `m4_numeric_arg'.
8482 2001-08-20 Akim Demaille <akim@epita.fr>
8484 * examples/include.m4: Typo.
8485 * tests/generate.awk: Really add it.
8486 * tests/Makefile.am: Adjust.
8487 * tests/others.at (Discard comments): It sure fails without `-c'.
8488 (include, undivert): Add -I examples/.
8490 2001-08-20 Akim Demaille <akim@epita.fr>
8492 Use sprintf, not ecft and friends since it is standard, portable,
8493 simplifies the code, and since the latter is even deprecated
8494 according to the GNU libc documentation.
8496 * modules/format.c: Drop evct support.
8498 2001-08-19 Gary V. Vaughan <gary@gnu.org>
8500 * config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
8502 * configure.in: ...do it here instead.
8504 * c-boxes.el: Deleted.
8505 * m4/builtin.c: Reformat box comments to be closer to GNU
8507 * m4/debug.c: Ditto.
8509 * m4/evalparse.c: Ditto.
8510 * m4/input.c: Ditto.
8511 * m4/m4module.h: Ditto.
8512 * m4/macro.c: Ditto.
8513 * m4/output.c: Ditto.
8514 * m4/symtab.c: Ditto.
8515 * m4/utility.c: Ditto.
8516 * modules/changeword.c: Ditto.
8517 * modules/format.c: Ditto.
8518 * modules/gnu.c: Ditto.
8519 * modules/load.c: Ditto.
8520 * modules/m4.c: Ditto.
8521 * modules/modtest.c: Ditto.
8522 * modules/mpeval.c: Ditto.
8523 * modules/perl.c: Ditto.
8524 * modules/shadow.c: Ditto.
8525 * modules/stdlib.c: Ditto.
8526 * modules/time.c: Ditto.
8527 * src/freeze.c: Ditto.
8528 * src/main.c: Ditto.
8530 2001-08-17 Gary V. Vaughan <gary@gnu.org>
8532 * m4/module.c: Fixup some errors in the description comment.
8534 2001-08-17 Akim Demaille <akim@epita.fr>
8536 * tests/others.at (iso8859): Specify the path to the M4 test file.
8537 * tests/testsuite.at (AT_CHECK_M4): Normalize the path of input
8538 files in error messages.
8540 2001-08-17 Akim Demaille <akim@epita.fr>
8542 * tests/testsuite.at (AT_CHECK_M4): Anchor M4PATH in $top_srcdir.
8543 * tests/others.at: Adjust input files paths.
8544 * tests/atconfig.in: Set top_builddir.
8545 * tests/Makefile.am: Adjust.
8546 `testsuite' is in src, not build.
8548 2001-08-17 Akim Demaille <akim@epita.fr>
8550 * tests/Makefile.am (EXTRA_DIST): Ship generate.awk.
8551 (generate.at): Install a temporary hack until the actual
8552 generate.awk is added to the repository.
8553 * tests/atconfig.in: New.
8555 2001-08-17 Akim Demaille <akim@epita.fr>
8557 Really apply the patch ``Drop Autoconf 2.13 compatibility.''
8559 2001-08-17 Akim Demaille <akim@epita.fr>
8561 * doc/m4.texinfo: Promote proper quotation.
8563 2001-08-17 Akim Demaille <akim@epita.fr>
8565 Remove the non Autotest tests.
8567 * tests/other-tests/capitalize.test,
8568 * tests/other-tests/changeword.test,
8569 * tests/other-tests/comments.test, tests/other-tests/ddivert.test,
8570 * tests/other-tests/debug.test,
8571 * tests/other-tests/discard-comments.m4,
8572 * tests/other-tests/discard-comments.test,
8573 * tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8574 * tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8575 * tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8576 * tests/other-tests/gmp.m4, tests/other-tests/gmp.test,
8577 * tests/other-tests/hanoi.test,
8578 * tests/other-tests/import-environment.m4,
8579 * tests/other-tests/import-environment.test,
8580 * tests/other-tests/include.test, tests/other-tests/indir.test,
8581 * tests/other-tests/iso8859.m4, tests/other-tests/iso8859.test,
8582 * tests/other-tests/misc.test, tests/other-tests/modfreeze.test,
8583 * tests/other-tests/modpath1.test, tests/other-tests/modpath2.test,
8584 * tests/other-tests/modpath3.test, tests/other-tests/modpath4.test,
8585 * tests/other-tests/modtest.test,
8586 * tests/other-tests/multiquotes.test,
8587 * tests/other-tests/patsubst.test, tests/other-tests/pushpop.test,
8588 * tests/other-tests/regexp.test, tests/other-tests/reverse.test,
8589 * tests/other-tests/shadow.test, tests/other-tests/stackovf.test,
8590 * tests/other-tests/sync-lines.m4,
8591 * tests/other-tests/sync-lines.test,
8592 * tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8593 * tests/other-tests/translit.test, tests/other-tests/undivert.test,
8594 * tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8595 * tests/other-tests/wrap.test: Remove.
8597 * tests/run-test, tests/get-them: Remove.
8598 * tests/Makefile.am: Adjust.
8600 2001-08-17 Akim Demaille <akim@epita.fr>
8602 others.at no longer depends on other-tests/.
8604 * tests/others.at (stackovf): You're actually...
8606 (modfreeze, modpath1, modpath2, modpath3, modpath4, modtest, shadow)
8607 (unload.test): Keep their authorship.
8608 (discard-comments, gmp, import-environment, modfreeze)
8609 (sync-lines): Embed the input files.
8610 * tests/stackovf.test: Copy from other-tests/stackovf.test.
8611 * tests/iso8850.m4: Copy from other-tests/iso8859.m4.
8613 2001-08-17 Akim Demaille <akim@epita.fr>
8615 * doc/m4.texinfo (Esyscmd): Fix the paths in the Vice example.
8616 (M4exit): Tag the exit status of the example.
8617 * tests/get-them: Adjust.
8618 * tests/generate.awk: New, based on get-them.
8619 * tests/Makefile.am: Adjust to generate `generated.at'.
8620 * tests/testsuite.at: Adjust.
8621 (AT_CHECK_M4): Don't overquote. Blush...
8623 2001-08-17 Akim Demaille <akim@epita.fr>
8625 Start using Autotest. atconfig creation is still lacking.
8627 * examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
8628 * examples/reverse.m4, tests/other-tests/import-environment.m4,
8629 * tests/other-tests/iso8859.m4: Don't produce trailing blanks.
8630 * tests/other-tests/import-environment.test: Don't check LANGUAGE
8631 as it might be `unset', or set to `C'.
8632 * tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
8633 * tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8634 * tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8635 * tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
8636 * tests/other-tests/shadow.test: Adjust.
8637 * tests/testsuite.at, tests/others.at: New.
8638 * tests/Makefile.am: Adjust.
8640 2001-08-17 Akim Demaille <akim@epita.fr>
8642 Drop Autoconf 2.13 compatibility.
8644 * configure.in (changeword): No need to undefine it, as anyway if
8645 it's defined, M4sugar moved it as m4_changeword.
8646 And anyway, proper quotation is enough.
8647 (m4_pattern_allow): As it exists in 2.50, just use it.
8648 (AC_OUTPUT): Split in AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
8649 Don't handle Gettext's duties, let it handle them.
8650 * config/gnu-obstack.m4: Use m4_pattern_allow directly.
8652 2001-08-17 Akim Demaille <akim@epita.fr>
8654 * modules/m4.c (m4_dumpdef): Output to stderr, not m4_debug.
8655 (m4_errprint): Use fputs.
8656 * doc/m4.texinfo (Invoking m4) <--error-output>: errprint and
8657 dumpdef are not concerned.
8658 (Dumpdef, Errprint): Emphasize their insensitivity to
8660 * doc/Makefile.am: Add `TAGS' support.
8661 (MAINTAINERCLEANFILES): Remove texinfo.tex and mdate-sh which are
8663 * config/Makefile.am (MAINTAINERCLEANFILES): New.
8665 2001-08-17 Akim Demaille <akim@epita.fr>
8667 * modules/Makefile.am (ETAGS_ARGS): New.
8669 2001-08-17 Akim Demaille <akim@epita.fr>
8671 * m4/symtab.c (m4_hack_all_symbols, m4_lookup_symbol): Formatting
8674 2001-08-17 Akim Demaille <akim@epita.fr>
8676 * m4/builtin.c (m4_macro_define): Do not reset SYMBOL_TRACED.
8678 2001-08-17 Akim Demaille <akim@epita.fr>
8680 * m4/m4module.h (m4/list.h): Don't include it.
8682 2001-08-16 Gary V. Vaughan <gary@gnu.org>
8684 m4_modules are no more, we use lt_dlhandles directly and let
8685 latest libltdl features manage the list of loaded modules.
8686 * acinclude.m4: Regenerated.
8687 * m4/ltdl.c: Updated from master copy.
8688 * m4/module.c: Reimplemented to take advantage of advances in
8690 * m4/builtin.c (m4_builtin_find_by_name): Traverse loaded module
8691 list with lt_dlhandle_next.
8692 (m4_builtin_find_by_func): Ditto.
8693 (m4_builtin_table_install): Use lt_dlhandle.
8694 (m4_macro_define): Ditto.
8695 (m4_macro_table_install): Ditto.
8696 m4/module.h: Prototype new module management API.
8697 (m4_modules): No longer required.
8698 (m4_module_init_t, m4_module_finish_t): POSIX namespace
8699 violations, renamed to...
8700 (m4_module_init_func, m4_module_finish_func): ...these,
8702 (M4INIT_HANDLER): Clean way to declare init functions in modules.
8703 (M4FINISH_HANDLER): And similarly for finish functions.
8704 * m4/system.h (_CONC): Used by M4INIT_HANDLER and M4FINISH_HANDLER
8705 -- Add indirection to the CONC macro so that arguments are
8707 * modules/modtest.c (m4_init_module): Replaced with M4INIT_HANDLER.
8708 * modules/shadow.c (m4_init_module): Ditto.
8709 Due to new init function semantics, be careful to perform the
8710 initialisation only on first load.
8711 * modules/perl.c (m4_init_module): Ditto. And Ditto.
8712 (m4_finish_module): Replaced with M4FINISH_HANDLER.
8713 Due to new finish function semantics, be careful to perform the
8714 finalisation only on first load.
8715 * m4/m4private.h (m4_module): Removed in favour of...
8716 (m4_module_data): ...structure without all the wrapper fields.
8717 Instances of this new structure are stored associated lt_dlhandles
8718 with lt_dlcaller_data_set().
8719 * m4/builtin.c (m4_builtin_define): Takes a handle argument
8720 instead of the old module argument.
8721 (m4_builtin_table_install): Ditto.
8722 * modules/load.c (m4_resident_module): Removed. This is no
8723 longer implemented as a magic symbol...
8724 * modules/m4.c (m4_resident_module): Ditto.
8725 * modules/load.c (M4INIT_HANDLER): ...the module init function now
8726 uses the ltdl api to make the module resident.
8727 * modules/m4.c (M4INIT_HANDLER): Ditto.
8728 * modules/load.c (builtin_modules): Traverse the loaded module
8729 list with lt_dlhandle_next.
8730 (builtin_load): Much simplified in light of the reimplemented
8732 * src/freeze.c (produce_module_dump): Cleaned up and optimised in
8733 light of the m4/module.c rewrite.
8734 (produce_symbol_dump): Ditto.
8735 (reload_frozen_state): Ditto.
8736 * m4/list.c, m4/list.h: Files deleted. No longer required.
8737 * m4/Makefile.am (pkginc_HEADERS): Delete list.h reference.
8738 (libm4_la_SOURCES): Delete list.c reference.
8739 * m4/m4private.h (m4_token_data): Add a handle field. This
8740 eliminates many of the searches to find the handle associated with
8741 various tokens that are passed between functions.
8742 (struct m4_symbol): Removed the module field. The
8743 module association does not belong with the symbol...
8744 * m4/input.c (struct m4_builtin): ...it belongs with the builtin
8745 that the module implementation code is from. Added a handle
8747 (m4_push_macro): Add a `handle' argument. Changed all callers.
8748 (init_macro_token): Set the `handle' field for the
8750 * m4/macro.c (expand_argument): Copy the new handle field during
8752 * modules/m4.c (macro_install): Use the new handle field to
8753 optimise the search for the correct builtin structure, and pass
8754 the handle details to m4_builtin_define.
8756 2001-08-15 Akim Demaille <akim@epita.fr>
8758 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Be sure `m4/' exists
8759 when creating `m4/obstack.h'.
8760 * tests/Makefile.am (TESTS_ENVIRONMENT): Pass top_srcdir and
8762 * tests/defs: Make them absolute.
8763 (CDPATH) Neutralize.
8764 * tests/gethem: Use them.
8766 2001-08-14 Gary V. Vaughan <gary@gnu.org>
8768 * config/ltmain.sh: Doh! Import again for a quoting fix that
8769 prevented any regression test from passing.
8771 * m4/m4module.h (obstack.h): Choose between installed version
8772 and shipped version based on configure tests.
8773 * src/freeze.c (obstack.h): Ditto.
8775 * acconfig.h: Removed. No longer required.
8777 * bootstrap: Rewritten to play nicely with Autoconf 2.5x.
8778 * configure.in (MY_NAME, MY_VERSION): Define these once, and feed
8779 them to AC_INIT and AM_INIT_AUTOMAKE.
8780 * Makefile.am (AUTOMAKE_OPTIONS): Remove `gnits' which would
8781 disallow MY_NAME and MY_VERSION arguments to AM_INIT_AUTOMAKE.
8782 * config/gnu-obstack.m4 (M4_AC_FUNC_OBSTACK): Don't choke on
8783 shell variable m4_cv_func_obstack_h.
8784 * tests/defs (M4): Be more careful about relative path to libtool
8785 script and m4 binary by using $srcdir.
8787 * src/main.c (main): Use lt_dlinsertsearchdir to prepend -M
8788 optargs to the existing libltdl search path.
8789 * acinclude.m4: Regenerate from latest libtool,m4 and ltdl.m4.
8790 * m4/ltdl.c: Updated.
8792 * config/ltmain.sh: Ditto.
8794 2001-08-11 Gary V. Vaughan <gary@gnu.org>
8796 * src/main.c (main): Add `-b' (for `batch') mode switch to force
8797 interactive mode off.
8799 2001-08-10 Akim Demaille <akim@epita.fr>
8801 * configure.in: Require Autoconf 2.52.
8802 (AC_ARG_PROGRAM): Remove, handled by Automake.
8803 (m4_getopt): Rename as...
8804 (m4_getopt_h): this.
8805 Allow the tokens `m4_cv_*', `m4_top_srcdir', and `m4_getopt_h'.
8806 Undefine `changeword' only if defined.
8807 * config/gnu-obstack.m4: Require Autoconf 2.52.
8808 (M4_AC_FUNC_OBSTACK): Rename `m4_obstack' and `m4_obstack_h'.
8811 2001-08-09 Yuji Minejima <ggb01164@nifty.ne.jp>
8813 * doc/m4.texinfo: Fix some typos, and apply some small
8816 2001-08-09 Andreas Schwab <schwab@suse.de>
8818 * src/main.c (main): Fix improper uses of error (missing format
8821 2001-08-07 Akim Demaille <akim@epita.fr>
8823 Improve `make distcheck'.
8825 * configure.in: Be sure to be able to run `mkconfig.sh' when src
8827 * Makefile.am (dist-hook): Remove, as it is no longer needed.
8828 * doc/m4.texinfo (Include): Add missing blank.
8829 * m4/Makefile.am (EXTRA_DIST): Distribute gnu-obstack.h and
8832 2001-08-07 Akim Demaille <akim@epita.fr>
8834 * m4/evalparse.c: A better introductory comment.
8835 * m4/m4module.h (M4_DEBUG_PRINT2): s/M4_debug/m4_debug/.
8836 * m4/macro.c: Adjust old comments.
8837 * modules/README: Typo.
8839 2001-08-07 Akim Demaille <akim@epita.fr>
8841 * config/gnu-obstack.m4: New.
8843 2001-08-07 Akim Demaille <akim@epita.fr>
8845 * config/Makefile.am, config/stackovf.m4: New.
8846 * configure.in, Makefile.am: Adjust.
8848 2001-08-05 gettextize <bug-gnu-utils@gnu.org>
8850 * po/Makefile.in.in: Upgrade to gettext-0.10.39.
8851 * po/cat-id-tbl.c: Remove file.
8852 * po/stamp-cat-id: Remove file.
8854 2001-04-08 Roderick Koehle <Roderick.Koehle@infineon.com>
8856 * modules/format.c (format): Formatting for %f was not
8857 interpreting the position of the decimal point correctly for
8860 2000-12-01 Gary V. Vaughan <gary@gnu.org>
8862 * TODO: Removed m4exit bug.
8863 * modules/load.c (m4_resident_module): Make this module resident.
8864 * module/m4.c (m4_resident_module): Ditto.
8865 * m4/modules.c (m4_module_load): Use new ltdl resident modules
8866 feature to mark modules as resident if they export
8867 `m4_resident_module' as TRUE.
8868 (m4_module_unload): Do not remove resident modules, and take care
8869 with symbol insertion and deletion with resident modules.
8870 * m4/ltdl.c, m4/ltdl.h: Update to latest unreleased versions to
8871 use resident modules feature.
8873 2000-11-30 Gary V. Vaughan <gary@gnu.org>
8875 * TODO: Updated. Removed some cruft that has since been fixed
8876 or implemented. Added some more entries.
8879 * modules/README: Updated.
8880 * doc/m4.texinfo: Updated.
8882 * modules/gnu.c (builtin_functions): Make indir orthogonal to
8883 builtin, in that each is recognised as a macro only with parameters
8884 (builtin_indir): Passing 0 arguments is now an error, as with
8887 * src/main.c (usage): Added missing description of `-c' option.
8889 2000-11-29 Gary V. Vaughan <gary@gnu.org>
8891 Consolidate the myriad of dispersed test scripts into the
8892 tests subdirectory. I think I now have all the file where I
8893 want them, so there shouldn't be anymore upheaval =)O|
8895 * tests/Makefile.am: Updated to run the new tests added below.
8896 * tests/other-tests/capitalize.test, tests/other-tests/comments.test,
8897 tests/other-tests/ddivert.test, tests/other-tests/debug.test,
8898 tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
8899 tests/other-tests/foreach.test, tests/other-tests/forloop.test,
8900 tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
8901 tests/other-tests/hanoi.test, tests/other-tests/include.test,
8902 tests/other-tests/indir.test, tests/other-tests/misc.test,
8903 tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
8904 tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
8905 tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
8906 tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
8907 tests/other-tests/pushpop.test, tests/other-tests/regexp.test,
8908 tests/other-tests/reverse.test, tests/other-tests/shadow.test,
8909 tests/other-tests/sysv-args.test, tests/other-tests/trace.test,
8910 tests/other-tests/translit.test, tests/other-tests/undivert.test,
8911 tests/other-tests/unfrozen.m4, tests/other-tests/unload.test,
8912 tests/other-tests/wrap.test: New tests based on the contents
8913 of the tests removed below.
8914 * examples/Makefile.am, modules/Makefile.am: Updated to
8915 reflect removed tests.
8916 * examples/defs,modules/defs: Removed.
8917 * examples/capitalize.test, examples/comments.test,
8918 examples/ddivert.test, examples/debug.test,
8919 examples/esyscmd.test, examples/exp.test,
8920 examples/foreach.test, examples/forloop.test,
8921 examples/fstab.test, examples/hanoi.test,
8922 examples/include.test, examples/indir.test,
8923 examples/misc.test, examples/multiquotes.test,
8924 examples/patsubst.test, examples/pushpop.test,
8925 examples/regexp.test, examples/reverse.test,
8926 examples/sysv-args.test, examples/trace.test,
8927 examples/translit.test, examples/undivert.test,
8928 examples/wrap.test, modules/frozen.m4, modules/modfreeze.test,
8929 modules/modpath1.test, modules/modpath2.test,
8930 modules/modpath3.test, modules/modpath4.test,
8931 modules/modtest.test, modules/shadow.test,
8932 modules/unfrozen.m4, modules/unload.test: Removed.
8934 Move the implementation of GMP support for the mpeval() builtin
8935 into a loadable module that depends on libgmp. mpeval() and
8936 eval() share a common parser, now in m4/evalparser.c; the code
8937 in m4/numb.c and m4/numb.h is now physically split between
8938 m4/eval.c (the eval() backend) and modules/mpeval.c (the
8939 mpeval() backend), rather than being differentiated by cpp
8940 macros and multiple inclusion. The mpeval module is always
8941 built but will generate an diagnostic if it is used from an
8942 installation that didn't link in the gmp library.
8943 * modules/Makefile.am: build and install the new mpeval module.
8944 * modules/mpeval.c: Now contains the former parts of m4/numb.c
8945 and m4/numb.h that are required for gmp support in mpeval().
8946 * m4/Makefile.am (libm4_la_SOURCES): Removed evalmp.c.
8947 * m4/evalmp.c: Removed.
8948 * m4/m4module.h: Removed conditional prototype for
8950 * m4/eval.c: Rewritten. Contains the former parts of m4/numb.c
8951 and m4/numb.h that do not rely on gmp.
8952 * m4/evalparse.c: New file, contains the shared parts of the
8953 eval() and evalmp() parser implementations, and is no longer
8954 unencumbered by cpp magic to uncover the right parts.
8955 * m4/numb.h: Removed. It's former contents are split between
8956 m4/eval.c and modules/mpeval.c.
8959 * tests/other-tests/changeword.test: New test. Rudimentary
8960 testing of changeword builtin runs only if --wnable-changeword
8961 was used at configure time.
8962 * tests/mkconfig.sh: Solaris sed (at least) does not parse nested
8963 alternation correctly. Split into two expressions to compensate.
8964 * m4/input.c (m4_input_init): Use m4_ prefix on m4_set_word_regexp.
8965 * modules/Makefile.am: Build changeword module.
8966 * modules/changeword.c (m4_macro_table): Define __m4_changeword__
8967 only when --enable-changeword was passed to configure.
8968 (builtin_changeword): If --enable-changeword was not used, then
8969 report that changeword() builtin has no support in m4 binary.
8971 2000-11-28 Gary V. Vaughan <gary@gnu.org>
8973 * src/main.c (main): Fixed a particularly nasty bug is
8974 user_search_path setting -- the -M flag processing must be
8975 extremely careful with search path ordering, or else the default
8976 installed module directory (possibly containing modules from a
8977 previous release) is placed earlier in the search path than any -M
8978 arguments (which are relied upon to load uninstalled modules with
8979 most of the tests in the regresion suite).
8981 * modules/load.c (builtin_load): Nasty hack to prevent adding
8982 symbols to symtab again if a module is loaded more than once.
8983 * modules/m4.c (builtin_ifelse): removed unused variable argv0.
8985 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed a
8986 possible NULL pointer dereference.
8988 * m4/module.c (m4_module_find_by_modname): Renamed from
8989 m4_module_modname_find. Fixed all references.
8990 (m4_module_find_by_builtin): New function.
8992 * modules/modfreeze.test: load the `load' module with each
8994 * src/freeze.c (produce_frozen_state): Simplified in light of
8995 module field in m4_symbol. Allow a third argument for text macros
8996 to name the originating module.
8997 (reload_frozen_state): ditto.
8998 * m4/m4module.h: Fixup prototypes.
8999 * m4/builtin.h (m4_builtin_define): Add a module argument so
9000 that symbols can be registered against the defining module.
9001 (m4_macro_define): ditto.
9002 * m4/m4private.h (m4_symbol): Make the module field const to save
9003 on casting in the rest of the code.
9004 (SYMBOL_MODULE): New macro.
9006 * m4/symtab.c (m4_remove_table_reference_symbols): Fixed stupid
9007 symbol reference maintenance bugs when removing a symbol from the
9010 * src/stackovf.c (setup_stackovf_trap): Fixed some memory leaks.
9012 2000-11-27 Gary V. Vaughan <gary@gnu.org>
9014 * configure.in (m4_cv_func_obstack): A better check for whether
9015 libc has an obstack implementation.
9016 * m4/Makefile.am (EXTRA_libm4_la_SOURCES): add gnu-obstack.h.
9018 * configure.in (--with-modules): Changed semantics. This
9019 option is now used to list modules to be preopened.
9020 * src/m4.h: #include "ltdl.h" unconditionally.
9021 * src/main.c: Removed all dependencies on WITH_MODULES.
9022 * src/freeze.c: ditto.
9023 * modules/Makefile.am: ditto.
9024 * m4/m4.c (builtin_m4exit): ditto.
9025 * modules/modpath1.test: ditto.
9026 * modules/modpath2.test: ditto.
9027 * modules/modpath3.test: ditto.
9028 * modules/modpath4.test: ditto.
9029 * modules/modtest.test: ditto.
9030 * modules/shadow.test: ditto.
9031 * modules/unload.test: ditto.
9033 * m4/Makefile.am (libm4_la_SOURCES): Removed obstack.c, since it
9034 comes up on demand in LTLIBOBJS now.
9035 * configure.in (getopt_long): Creating and relying on a link for
9036 getopt.h on hosts with no getopt_long() of thier own works
9037 correctly now. This is necessary so that callers of getopt_long()
9038 can simply `#include <getopt.h>': the naive way of doing this
9039 would end up using our own getopt.h and the installed
9040 getopt_long(), which is asking for trouble!
9041 (obstack_init): A similar argument applies to obstack.h and
9044 * m4/ltdl.c: Upgraded to latest bleeding edge version again.
9045 On Solaris-2.5 (at least) the native dlopen implementation
9046 gets confused about m4.o when looking for module "m4". This
9047 version always looks for .la an .$lib_ext suffixed names first
9048 to work around the problem. Sigh.
9050 * po/POTFILES.in: Take account of these file movements.
9051 * src/Makefile.am (m4_SOURCES): removed eval.c.
9052 (EXTRA_m4_SOURCES): removed numb.c and numb.h.
9053 * m4/Makefile.am (libm4_la_SOURCES): added eval.c.
9054 (EXTRA_libm4_la_SOURCES): added numb.c and numb.h.
9055 * modules/m4.c (builtin_eval): Use m4_evaluate().
9056 * m4/eval.c: Moved here from src/eval.c to facilitate
9057 implementation of eval() builtin as part of the `m4' loadable
9059 (m4_evaluate): renamed from evaluate for namespace cleanliness.
9060 * m4/numb.c: Moved here from src/numb.c, since it is #included
9061 into eval.c at compile time.
9062 * m4/m4module.h (m4_evaluate): Added prototype.
9063 * src/m4.h (evaluate): Removed prototype.
9065 2000-11-25 Gary V. Vaughan <gary@gnu.org>
9067 * modules/perl.c (builtin_perleval): Use PL_na for
9068 compatibility with perl-5.6.
9070 * src/main.c (main): It is now safe to
9071 ``m4_module_install("m4")'', without tripping over the m4
9073 * m4/ltdl.h, m4/ltdl.c: Upgraded to latest bleeding edge
9074 versions having fixed the insidious module search order bug.
9076 * m4/Makefile.am (libm4_la_LIBADD): New magic -- we are
9077 supposed to be using @LIBADD_DL@; @DLLDFLAGS@ is dead.
9079 * configure.in: Figure out whether to use the installed
9080 getopt.h or the supplied one.
9081 * src/Makefile.am: ditto.
9083 * po/POTFILES.in: List files in their new positions.
9085 * config/ltmain.sh: This needs to be checked in to match the
9086 libtool macros copied to acinclude.m4 (until a released
9087 libtool copes with m4's needs).
9088 * bootstrap: Run gettextize.
9090 2000-11-24 Gary V. Vaughan <gary@gnu.org>
9092 * AUTHORS: Added my details.
9095 * bootstrap: temporary update until released libtool catches up.
9097 * All files: Use new GNU GPL copyright blurb with current contact
9100 * configure.in (LTLIBOBJS): Use canonical code for calculation of
9103 * config: renamed acm4 directory to config to be more like
9104 other autoconfiscated packages.
9106 * configure.in (M4_AC_CHECK_DEBUGGING): Use it.
9107 * config/debug.m4: New file implementing configure macros to add
9108 suitable debug flags to the compiler invocation.
9110 * modules/load.c: New file implementing the ``load'' and
9111 ``unload'' builtins.
9112 * tests/get-them: Set the module search directory to the modules
9113 build directory in generated tests.
9114 * modules/shadow.test: ditto.
9115 * modules/modtest.test: ditto.
9116 * modules/modpath1.test: ditto.
9117 * modules/modpath2.test: ditto.
9118 * modules/modpath3.test: ditto.
9119 * modules/modpath4.test: ditto.
9120 * modules/modtest.test: ditto.
9121 * modules/modfreeze.test: ditto.
9122 * modules/unload.test: ditto.
9124 * modules/changeword.c: New file implementing the ``changeword''
9125 builtin as a loadable module.
9126 * modules/mpeval.c: New file implementing the ``mpeval'' builtin
9127 as a loadable module.
9129 * src/main.c (main): Load the gnu module if m4 was started
9130 normally -- i.e. without the -G option.
9131 * modules/gnu.c: New file implementing a new loadable module wuth
9132 definitions for all the gnu extension builtins.
9133 * modules/format.c: Moved here from src/format.c. Now included
9136 * src/main.c (main): Load the traditional module if m4 was
9137 started in `no_gnu_extensions' mode.
9138 * modules/traditional.c: New file implementing the ``unix'' macro,
9139 required when m4 is executed in traditional mode, as a loadable
9142 * src/main.c: Renamed from m4.c to avoid confusion with
9144 (main): Always load the m4 module.
9145 * modules/m4.c: New file implementing a new loadable module with
9146 definitions for all m4 builtins that are not gnu extensions.
9148 * m4/Makefile.am: Adjusted to take new files below into account.
9149 * m4/m4module.h: Prototypes for exported functions and types moved
9150 to this directory from the src directory.
9151 * m4/m4private.h: Moved here from src/m4private.h to facilitate
9152 the migration of all builtin implementations to loadable modules.
9153 * m4/macro.c: Moved this file here from the src directory,
9154 renaming all exported symbols to use the prefix ``m4_''.
9155 * m4/builtin.c: ditto.
9156 * m4/module.c: ditto.
9157 * m4/symtab.c: ditto.
9158 * m4/debug.c: ditto.
9159 * m4/input.c: ditto.
9160 * m4/output.c: ditto.
9162 * m4/ltdl.h, m4/ltdl.c: ditto.
9163 * m4/utility.c: Odd functions moved here from files in the src
9164 directory to facilitate builtin migration.
9166 2000-08-12 Gary V. Vaughan <gary@gnu.org>
9168 * src/builtin.c (dump_symbols): Use "Undefined name `%s'" for
9169 error message, to make translators' jobs a little easier.
9170 (builtin_builtin): ditto.
9171 (builtin_traceon): ditto.
9172 (builtin_traceoff): ditto.
9173 Reported by Akim Demaille <akim@epita.fr>
9175 * m4/Makefile.am (pkgincdir): Deleted. Use automake's built in
9176 pkgincludedir instead.
9178 * m4/m4module.h (rquote): Renamed with a prefix of `m4_' since
9179 it is exported globally. Fixed all references.
9183 (DEF_RQUOTE): Renamed with a prefix of `M4_' since it is exported
9184 globally. Fixed all references.
9185 (DEF_LQUOTE): ditto.
9189 2000-07-28 Gary V. Vaughan <gary@gnu.org>
9194 * configure.in (AC_CHECK_FUNCS): added bzero and calloc.
9195 (AC_OUTPUT): touch stamp-h.in, not stamp-h.
9197 * doc/m4.texinfo: Fixed to work with --html option of makeinfo.
9198 Removed `Prev', `Next' and `Up' fields of all @nodes now that
9199 makeinfo calculates them for us, and to make any future
9200 reorganisation easier.
9201 (Frozen files): Document format version 2.
9202 `V' now takes argument `2'.
9203 `F' can take a single argument if symbol and builtin names
9204 are the same, or 3 arguments if the builtin is from a module.
9205 New `S' specification for saving syntax table contents.
9206 New `M' specification for saving loaded module names.
9207 * src/freeze.c: Implement them.
9208 * src/input.c (syntax_code): For interpreting frozen syntax
9211 * examples/Makefile.am: Add the contents of the WWW directory to
9213 * examples/WWW/Makefile: ditto,
9214 (%.htm): Compares file contents (not just sizes) to determine
9215 whether a change has occured.
9216 * examples/WWW/_header.htm: Bumped version number.
9217 * examples/WWW: Regenerated content.
9219 * m4/Makefile.am (AUTOMAKE_OPTIONS): Support for non-ANSI
9220 compilers comes much easier without ansi2knr.
9221 * src/Makefile.am (AUTOMAKE_OPTIONS): ditto.
9223 * m4/list.c: New generic list container type.
9224 * m4/list.h: Interface to new container type.
9225 * m4/Makefile.am (pkginc_HEADERS): Install list.h.
9226 (libm4_la_SOURCES): compile and link list.c.
9227 * src/builtin.c (builtin_tables): Use list container.
9228 * src/module.c (symtab): ditto.
9229 * src/symtab.c (symtab): ditto.
9231 * m4/system.h: New file for common preprocessor definitions.
9232 * m4/Makefile.am (pkginc_HEADERS): install system.h.
9233 * m4/error.c: Use system.h in place of inline preprocessor.
9234 * m4/error.h: ditto.
9235 * m4/module.c: ditto.
9236 * m4/module.h: ditto.
9237 * m4/xmalloc.c: ditto.
9239 * m4/error.h (error_one_per_line): Make M4_GLOBAL_DATA for WIN32
9241 * m4/xmalloc.c (xmalloc_exit_failure): ditto.
9243 * m4module.h (syntax_table): Renamed with a prefix of `m4_' since
9244 it is exported globally. Fixed all references.
9246 (module_init_t): ditto.
9247 (module_finish_t): ditto.
9248 (token_data): ditto.
9249 (SYNTAX_OTHER): Renamed with a prefix of `M4_' since
9250 it is exported globally. Fixed all references.
9251 (SYNTAX_IGNORE): ditto.
9252 (SYNTAX_SPACE): ditto.
9253 (SYNTAX_OPEN): ditto.
9254 (SYNTAX_CLOSE): ditto.
9255 (SYNTAX_COMMA): ditto.
9256 (SYNTAX_DOLLAR): ditto.
9257 (SYNTAX_ACTIVE): ditto.
9258 (SYNTAX_ESCAPE): ditto.
9259 (SYNTAX_ALPHA): ditto.
9260 (SYNTAX_NUM): ditto.
9261 (SYNTAX_ALNUM): ditto.
9262 (SYNTAX_LQUOTE): ditto.
9263 (SYNTAX_RQUOTE): ditto.
9264 (SYNTAX_BCOMM): ditto.
9265 (SYNTAX_ECOMM): ditto.
9266 (SYNTAX_VALUE): ditto.
9267 (SYNTAX_MASKS): ditto.
9285 (TOKEN_NONE): ditto.
9286 (TOKEN_STRING): ditto.
9287 (TOKEN_SPACE): ditto.
9288 (TOKEN_WORD): ditto.
9289 (TOKEN_SIMPLE): ditto.
9290 (TOKEN_MACDEF): ditto.
9292 * m4/m4module.h (voidstar): Removed in favour of `VOID' for
9293 consistency. Fixed all references.
9294 (STRING): Renamed to `m4_string' for consistency, and because if
9295 is exported globally. Fixed all references.
9296 (token_type): Renamed to `m4_token_t' for the same reasons.
9297 (token_data_type): Renamed to `m4_token_data_t' for the same
9300 * m4/m4module.h (XCALLOC): Wrapper macro which handles type
9304 (XFREE): Wrapper macro which avoids freeing NULL pointers.
9306 * m4/m4module.h (m4_macro): New type for module defined user
9308 * modules/modtest.c (m4_macro_table): Define module user macros.
9309 * modules/shadow.c (m4_macro_table): ditto.
9311 * m4/m4module.h (M4BUILTIN_HANDLER): For defining handlers
9312 declared with M4BUILTIN.
9314 * m4/xmalloc.c: Use memset if bzero is not available when
9315 emulating calloc with malloc.
9316 (xcalloc): Fallback to malloc/bzero if calloc is not available.
9317 (xfree): Added for consistency. Will not try to free NULL
9319 * src/m4.c (xfree): Deleted in favour of the above.
9320 * m4/xmalloc.c (WITH_DMALLOC): preprocess away the entire file if
9321 linking with libdmalloc.
9322 * m4/xstrdup.c (WITH_DMALLOC): ditto.
9324 * modules/frozen.m4: New test case.
9325 * modules/unfrozen.m4: ditto.
9326 * modules/modfreeze.test: New test.
9327 * modules/unload.test: ditto.
9328 * modules/Makefile.am (EXTRA_DIST): Distribute them.
9330 * modules/modpath1.test: Don't try this test if module support is
9332 * modules/modpath2.test: ditto.
9333 * modules/modpath3.test: ditto.
9334 * modules/modpath4.test: ditto.
9335 * modules/modtest.test: ditto.
9336 * modules/shadow.test: ditto.
9338 * modules/perl.c: New module.
9339 * modules/perl.m4: Example of using it.
9340 * modules/Makefile.am (perl_la_SOURCES): Build new perl module.
9342 * src/m4.c (main): Assume interactive mode if STDIN is connected
9344 Changed startup sequence slightly so that syntax is not
9345 initialised from here when loading a frozen file.
9347 * src/builtin.c: Much improved macro definition style.
9348 * src/m4private.h: Internal structures for m4_builtin and
9349 m4_macro instances. These are not exposed to module writers.
9350 * src/module.c (module_modname_find): Find a module structure
9352 (make_macro_table): Build an internal macro table from a external
9354 (make_builtin_table): Build an internal builtin table from an
9355 external definition.
9357 * src/module.c (module_unload): Be extremely careful to remove
9358 builtins and macros that match the module being unloaded -- no
9359 longer assume that the top element can be removed incase another
9360 odule defines an identical name.
9361 * src/symtab.c (remove_table_reference_symbols): remove all symbol
9362 table entries which refer to a given builtin table.
9363 * src/builtin.c (remove_tables): Use it!
9365 2000-07-13 Thomas Tanner <tanner@ffii.org>
9367 * Makefile.am (SUBDIRS): we need modules/ for "make dist"
9368 * acm4/modules.m4: deleted
9369 * bootstrap: don't libtoolize libltdl!
9370 * configure.in: AC_SUBST INCLTDL and LIBLTDL, -with-modules flag:
9371 if set, enable WITH_MODULES and add modules to DLPREOPEN
9372 * examples/misc.test: redirect standard output
9373 * lib/Makefile.am: don't use DLLDFLAGS
9374 * lib/m4module.c: include necessary headers to silence GCC -Wall
9375 * lib/m4regex.c: fixes to silence GCC -Wall
9376 * modules/Makefile.am: don't use DLLDFLAGS, add INCLTDL to INCLUDES,
9377 build modules conditionally
9378 * modules/shadow.c: define symbol aliases before using them
9379 * modules/test.c: define symbol aliases before using them
9380 * po/de.po: update translation
9381 * src/Makefile.am: delete pathconf.h, set MODULE_PATH to
9382 pkglibexecdir, don't use DLLDFLAGS, add INCLTDL to INCLUDES and
9384 * src/m4.c: initialize libltdl's preloaded symbols via
9385 LTDL_SET_PRELOADED_SYMBOLS
9386 * src/module.c: libltdl's memory management must be initialized
9387 before calling lt_dlinit!, fix warnings
9389 2000-01-18 Gary V. Vaughan <gary@gnu.org>
9391 * README: Caveat about nls not supported by dll architecture on
9394 * TODO (MODULE SPECIFIC ISSUES): more ideas for the future.
9396 * tests/Makefile.am (stamp-TESTS): now works with VPATH.
9397 * src/Makefile.am (m4_LDADD): use $(builddir) for VPATH.
9398 * modules/Makefile.am (LIBS): ditto.
9399 (INCLUDES): search $(top_srcdir) (for eg. <m4/error.h>) and then
9400 $(top_srcdir)/m4 (for only <m4module.h>).
9401 * modules/shadow.test: fixed for VPATH.
9402 * modules/modtest.test: ditto.
9403 * modules/modpath4.test: ditto.
9404 * modules/modpath3.test: ditto.
9405 * modules/modpath2.test: ditto.
9406 * modules/modpath1.test: ditto.
9408 * modules/time.test: Removed due to timezone dependence,
9409 * modules/Makefile.am (TESTS): Removed time.test.
9411 * configure.in: Use $3 of AC_DEFINE so that we can,,,
9412 * acconfig.h: Remove everything except the gettext parameters.
9413 * acm4/gmp.m4: Add a serial number, and take advantage of $3 of
9415 * acm4/ltdl.m4: Updated to latest from libtool cvs.
9416 * acm4/modules.m4: Remove code which duplicates ltdl.m4 and
9417 increment serial number.
9419 * Makefile.am (SUBDIRS): Moved @MODULES_DIR@ to compile before
9420 src dir and immediately after libm4 is built for confidence that
9421 it doesn't rely on the src directory.
9422 (SUBDIRS): Moved doc dir to the end since helptoman.pl and
9423 makeinfo stop the build on cygwin (because they don't work).
9425 * src/m4.h: use GNU standard #if HAVE_CONFIG_H ideom.
9427 * m4/m4private.h: ...is not a public header, so moved to src.
9428 Add `#include <config.h>', `#define _COMPILING_M4' and
9430 * m4/Makefile.am (noinst_HEADERS): remove m4private.h.
9431 * src/Makefile.am (noinst_HEADERS): add m4private.h.
9432 * src/builtin.c: `#include "m4private.h"' now takes care of the
9433 above. Duplicates removed.
9434 * src/debug.c: ditto.
9435 * src/eval.c: ditto.
9436 * src/evalmp.c: ditto.
9437 * src/format.c: ditto.
9438 * src/freeze.c: ditto.
9439 * src/input.c: ditto.
9441 * src/macro.c: ditto.
9442 * src/module.c: ditto.
9443 * src/numb.h: ditto.
9444 * src/output.c: ditto.
9445 * src/path.c: ditto.
9446 * stackovf.c: ditto.
9449 * po/POTFILES.in: compensate for renaming of lib/*.
9450 * m4/Makefile.am (CLEANFILES): @EXEEXT@ left libtool wrapper behind.
9451 (INCLUDES): Look first in $(top_srcdir) (for eg. <m4/error.h>),
9452 and then in $(top_srcdir)/lib (for eg. "m4private.h").
9453 * src/Makefile.am (m4_LDADD): replace libi/libm4.la with
9455 * m4/m4error.h: Renamed error.h, for installation to
9456 $prefix/include/m4..
9457 * m4/m4obstack.h: Renamed obstack.h, for same reason.
9458 * m4/m4regex.h: Renamed regex.h, for same reason.
9459 * m4/m4error.c: Renamed error.c, and use #include "error.h".
9460 * m4/m4obstack.c: Renamed obstack.c, and fix #includes.
9461 * m4/m4regex.c: Renamed regex.c, and fix #includes.
9463 * lib: moved to m4 to easily support header installation to
9465 * Makefile.am (SUBDIRS): renamed lib dir to m4.
9466 * configure.in (AC_OUTPUT): reference m4/Makefile.in.
9467 * acm4/regex.m4: Point to m4/regex.c.
9469 * examples/foreach.m4: Sanitise quoting.
9470 * examples/foreach.test: New torture test.
9471 From Akim Demaille <akim@epita.fr>
9473 2000-01-17 Gary V. Vaughan <gary@gnu.org>
9475 * src/ltdl.c: Use access() to abort doomed module load attempts
9476 if module file does not exist.
9478 * src/Makefile.am (m4_SOURCES, EXTRA_SOURCES): getopt.o and
9479 getopt1.o will already be used if appropriate, so I moved getopt.c
9480 and getopt1.c from m4_SOURCES to EXTRA_SOURCES.
9482 * modules/modpath1.test: Use correct filename in header line.
9483 * modules/modpath2.test: ditto.
9484 * modules/modpath3.test: ditto.
9485 * modules/modpath4.test: ditto.
9487 Without these changes lt_dlopen("test") attempts to
9488 LoadLibrary("/bin/test") on Windows, which although harmless
9489 generates a spurious error message which spoils most of the tests:
9490 * modules/Makefile.am (EXTRA_DIST): s/test.m4 /modtest.m4 /
9491 (TESTS): s/test.test /modtest.test /
9492 (pkglibexec_LTLIBRARIES): s/test.la /modtest.la /
9493 (test_la_SOURCES, test_la_LDFLAGS): renamed to use modtest.
9494 * modules/modpath1.test: s/test.m4 /modtest.m4 /
9495 * modules/modpath2.test: ditto.
9496 * modules/modpath4.test: ditto.
9497 * modules/modpath3.test: s/-m test /-m modtest /
9498 * modules/shadow.m4: use {un,}loadmodule(`modtest').
9500 2000-01-16 Gary V. Vaughan <gary@gnu.org>
9502 * src/ltdl.c (find_file): Updated to new version with fixed memory
9503 allocation bug in `next'.
9504 * src/ltdl.h: updated to match.
9506 * modules/Makefile.am: Cleaned up and reordered.
9508 2000-01-16 René Seindal <rene@seindal.dk>
9510 * modules/Makefile.am (TESTS): New tests for the module system.
9512 * modules/*.test: New files.
9514 * src/m4.c (main): Added call to module_init().
9515 Treats -M and -m as the arguments -D -U and -t, ie deferred.
9517 * src/m4.h: Added declaration of module_init().
9519 * src/module.c (module_init): No longer static
9521 * modules/Makefile.am ({test,shadow,time,stdlib}_la_LDFLAGS):
9522 Added to shut up automake about non standard libtool library
9525 * src/module.c: Disabled DEBUG by default.
9527 * modules/README: Changed example from unload.m4 to shadow.m4
9529 * modules/shadow.m4: Renamed from unload.m4
9531 * modules/Makefile.am (EXTRA_DIST): Removed unload.m4.
9533 * src/m4.c (main): Functionality for -m and -M were reversed.
9536 2000-01-12 Gary V. Vaughan <gary@gnu.org>
9538 * doc/help2man.pl: updated to version 1.020.
9540 * lib/COPYING.LIB: updated to version 2.1.
9542 * lib/m4module.h: restructure the M4_SCOPE code to work when
9543 creating a dll which links with libm4.la and both DLL_EXPORT
9544 (for the new dll) and LIBM4_DLL_IMPORT (for m4module.h) are
9547 2000-01-11 Gary V. Vaughan <gary@gnu.org>
9549 Merged the following changes from my tree:
9551 1999-06-15 Gary V. Vaughan <gary@gnu.org>
9553 * configure.in (AC_LIBTOOL_WIN32_DLL): Declare that m4 has been
9554 ported to compile shared libs.
9556 * configure.in (LIBM4_DLL_IMPORT): Discover whether we need to
9557 use `__declspec(dllimport)' when linking libm4.la on win32.
9558 * src/Makefile.am (m4_LDFLAGS): Use dllimport if necessary.
9560 * configure.in (M4OBJS): Discover whether we need the shipped
9561 implementation of getopt_long.
9562 * src/Makefile.am (m4_LDADD): Link the getopt objects into the
9563 main binary here, as opposed to the module library in lib/libm4.la.
9565 1999-06-14 Gary V. Vaughan <gary@gnu.org>
9567 * modules/README: Updated to describe the improved libltdl based
9569 * README (cygwin): Added some compilation notes for building m4
9570 correctly under cygwin.
9571 * TODO: Cleaned out the entries for the module system since they
9572 are now implemented.
9574 * *.[ch]: __P is in the compiler's reserved namespace, so replaced
9575 all instances of __P with M4_PARAMS.
9577 * lib/getdate.h: removed unreferenced file.
9579 * lib/m4private.h: New file to define the private interface to the
9580 token_data struct, which must be shared between m4module.c, and
9581 builtin.c but not exported to modules built from the installed
9582 m4module.h since it's size changes depending on compile time
9585 * src/m4.h: Lots of stuff moved to lib/m4module.h.
9587 * lib/m4module.h: New file to define the interface available when
9588 compiling m4 modules.
9589 * lib/m4module.c: Moved parts of builtin.c, and m4.c which are
9590 necessary for module compilation into this new file.
9592 * lib/Makefile.am (include_HEADERS): install headers (renamed to
9593 avoid nameclash with other system headers) necessary for compiling
9595 (libm4_la_SOURCES): always include error.c, obstack.c and regex.c
9596 so that modules can include the (renamed) installed headers and
9597 be guaranteed a matching implementation.
9598 * lib/m4error.h: renamed from error.h.
9599 * lib/m4obstack.h: renamed from obstack.h.
9600 * lib/m4regex.h: renamed from regex.h.
9601 * configure.in (AC_REPLACE_FUNCS): Don't look for a system
9602 implementation, simply include the shipped version
9603 unconditionally, otherwise it is hard for a module to know
9604 whether the m4obstack.h header it is using matches the
9605 implementation it ends up linking against.
9606 (jm_WITH_REGEX): Include regex into libm4 unconditionally for
9609 1999-05-18 Gary V. Vaughan <gary@gnu.org>
9611 * examples/misc.test: Don't run this test on machines which don't
9612 have a root user in /etc/passwd (e.g. cygwin).
9614 * tests/get-them (/^@example$/): Error messages might have a
9615 ``.exe'' suffix to the program name, or else use the libtool
9616 ``.libs/lt-m4'' binary, or generally have an unexpected path. All
9617 of these cases are now catered for when comparing error messages
9619 * tests/other-tests/*.test: ditto.
9620 * examples/*.test: ditto.
9622 * tests/defs (M4): use libtool execute mode.
9623 * examples/defs (M4): ditto.
9625 * tests/get-them (END): explicitly close any open file.
9626 (printthem): In a regular expression, '{' is the start of a repeat
9627 count! Use `[{]' for a literal open brace.
9628 (/^@node /): Don't use substr on a string shorter than the trim
9631 1999-05-17 Gary V. Vaughan <gary@gnu.org>
9633 * configure.in (LTLIBOBJS): calculated from LIBOBJS, and
9635 (AC_LIBTOOL_DLOPEN): declare that this package will use dlopen.
9637 2000-01-10 Andreas Schwab <schwab@suse.de>
9639 * tests/other-tests/gmp.test: Find config.sh in build directory.
9641 * configure.in: Find tests/mkconfig.sh in $srcdir.
9643 * configure.in: Define HAVE_SIGINFO_T if siginfo_t is defined in
9644 <signal.h> (for SUS2 compliant systems).
9646 * src/stackovf.c: Check for HAVE_SIGINFO_T in addition to
9649 2000-01-10 René Seindal <rene@seindal.dk>
9653 * TODO, NEWS: Cleaned up and updated.
9655 * src/m4.c (main): New variable exit_status for exit status in
9656 case of unreadable files. Now m4 will exit with EXIT_FAILURE if a
9657 file cannot be read instead of EXIT_SUCCESS.
9659 * src/builtin.c (m4_indir): Changed error message to help
9660 translators (from Akim Demaille <demaille@inf.enst.fr>).
9662 * lib/obstack.[hc], getopt*.[ch]: Updated to newest version from
9665 * lib/error.[hc], lib/regex.[hc], lib/strtol.c: Updated to version
9668 * src/input.c (match_input): Reordering of code, to avoid multiple
9669 calls to push_string_init() from obstack_grow(), which can happen
9670 with some compilers (found and fixed by James Bonfield
9671 <jkb@mrc-lmb.cam.ac.uk>).
9673 * src/stackovf.c: Added prototypes for ultrix.
9674 (setup_stackovf_trap): Added __P to cast.
9675 (Both reported by John David Anglin <dave@hiauly1.hia.nrc.ca>)
9677 2000-01-09 René Seindal <rene@seindal.dk>
9679 * doc/m4.texinfo (Changequote): Added comment about changing
9680 quotes when the old quote is a part of the new.
9682 * src/builtin.c (expand_ranges): Added break after trailing dash.
9683 This caused misbehavious on some systems (found and fixed by Akim
9684 Demaille <demaille@inf.enst.fr>).
9686 * AUTHORS: Thomas Tanner included
9688 * acconfig.h: Added entry for ss_sp (see below).
9690 * configure.in (use_stackovf): Added check for stack_t with member
9691 ss_base instead of ss_sp (BSDI notably). (Reported by Paul Eggert
9692 <eggert@twinsun.com>).
9694 * doc/m4.texinfo (Frozen files): Added a simpler example for
9695 generating frozen files from several input files.
9697 1999-11-14 Paul Eggert <eggert@twinsun.com>
9699 * po/POTFILES.in: Add lib/getopt.c, lib/obstack.c,
9700 lib/regex.c, lib/xmalloc.c.
9702 1999-11-10 René Seindal <rene@seindal.dk>
9704 * Makefile.am (ACLOCAL_AMFLAGS): Passes -I acm4 to aclocal.
9706 * src/module.c: reindented.
9707 (module_load): return if this is a repeated load of same module.
9708 (module_init): slight change of logic to avoid repeated
9709 initialisation debug messages.
9711 * Makefile.am (DIST_SUBDIRS): Added to ensure modules/ is included
9712 in the distribution.
9714 * modules/Makefile.am (test_la_LDFLAGS): set to -module to silence
9715 automake warnings about missing lib prefix.
9716 (time_la_LDFLAGS): ditto
9717 (stdlib_la_LDFLAGS): ditto
9719 1999-11-10 Paul Eggert <eggert@twinsun.com>
9721 * src/m4.h: Include error.h, since our macros use error.
9722 * src/m4.c: Don't need to include error.h.
9724 1999-11-09 Paul Eggert <eggert@twinsun.com>
9726 * src/m4.h (voidstar): Define to void * if __STDC__ is defined
9727 and zero, as Solaris 7 cc does.
9728 (bcopy): Remove macro; no longer needed with new obstack.h.
9730 * src/output.c (freeze_diversions): Don't assume that a
9731 diversion size can fit in `int'. Check for diversion file
9732 size too large to be printed with `unsigned long'.
9734 * src/Makefile.am (CFLAGS): Omit -Wall.
9736 * src/stackovf.c (setup_stackovf_trap): Remove cast to unsigned.
9738 * src/debug.c (trace_format):
9739 Use ANSI C if (defined __STDC__ && __STDC__) || defined PROTOTYPES.
9741 * src/freeze.c (produce_frozen_state):
9742 Don't assume string lengths fit in int.
9744 1999-10-13 René Seindal <rene@seindal.dk>
9746 * po/cs.po: Czech translation added.
9748 * po/sv.po: Updated Swedish translation.
9750 * po/ru.po: Updated Russian translation.
9752 * po/pl.po: Updated Polish translation.
9754 * po/el.po: Greek translation added.
9756 1999-10-13 René Seindal <rene@seindal.dk>
9758 * configure.in (ALL_LINGUAS): Added Greek translation (el).
9759 (ALL_LINGUAS): Added Czech translation (cs).
9761 1999-03-30 Gary V. Vaughan <gary@gnu.org>
9763 * src/builtin.c: moved module loading functions into...
9764 * src/module.c: entirely new implementation using libltdl.
9765 * po/POTFILES.in: added src/module.c.
9766 * modules/Makefile.am (LTLIBRARIES): Removed lib prefix as these
9767 are modules, not linktime libraries.
9768 (LDFLAGS): added -no-undefined -module and -avoid-version flags.
9769 * modules/stdlib.c (m4_macro_table): use <name>_LTX collision
9770 avoidance on exported symbols.
9771 * modules/test.c (m4_macro_table, m4_init_module,
9772 m4_finish_module): ditto.
9773 * modules/time.c (m4_macro_table): ditto.
9775 * modules/time2.m4: new file which requires command line loading
9777 * src/m4.c (--load-module): dynamically load named runtime module
9778 into running executable before reading the source.
9779 (--module-directory): prepend a directory to the module search
9781 (module_init()): Do this the first time we load a module instead;
9782 if the module subsystem is broken normal m4 scripts can still run.
9783 * src/m4.h (install_builtin_table): is now exported.
9785 1999-03-26 Gary V. Vaughan <gary@gnu.org>
9787 * src/module.c: removed. No longer required.
9788 * po/POTFILES.in: removed src/module.c.
9790 * Makefile.am (MAINTAINERCLEANFILES): Remove all the files that
9791 the bootstrap script can recreate.
9792 * acm4/Makefile.am (MAINTAINERCLEANFILES): ditto.
9793 * doc/Makefile.am (MAINTAINERCLEANFILES): ditto.
9794 * examples/Makefile.am (MAINTAINERCLEANFILES): ditto.
9795 * lib/Makefile.am (MAINTAINERCLEANFILES): ditto.
9796 (AUTOMAKE_OPTIONS): reduced strictness to allow COPYING.LIB.
9797 * modules/Makefile.am (MAINTAINERCLEANFILES): ditto.
9798 * src/Makefile.am (MAINTAINERCLEANFILES): ditto.
9799 * tests/Makefile.am (MAINTAINERCLEANFILES): ditto.
9801 * acinclude.m4: removed. `aclocal -I acm4' handles this much
9803 * acm4/Makefile.am (ACINCLUDE_M4): ditto.
9804 * acm4/gettext.m4: removed. It causes a multiple definition vs.
9805 the installed gettext.m4 file when running aclocal.
9807 1999-03-25 Gary V. Vaughan <gary@gnu.org>
9809 * configure.in (AM_INIT_AUTOMAKE): bumped version number to
9810 distinguish this from the last prerelease.
9811 (AC_LIBLTDL_CONVENIENCE): build libltdl as a convenience library
9812 in its own subdirectory.
9814 * modules/Makefile.am (*_SOURCES): renamed to use libtool's "no
9815 lib prefix on a module" feature.
9816 (LDFLAGS): Added `-module -avoid-version' flags to build
9817 versionless module libraries.
9818 * src/builtin.c (m4_load_module): use libltdl.
9819 (module_unload_all): use libltdl.
9820 * src/m4.c (module_init): initialise module loading on demand for
9821 better diagnostics, and so that m4 will still work even if
9822 the module code is broken.
9823 * src/m4.h (module_init): removed. No longer relevant.
9824 * modules/stdlib.c (m4_macro_table): use stdlib_LTX_ prefix on
9825 exported symbols for compatibility with dlpreopening.
9826 * modules/test.c (m4_macro_table, m4_init_module,
9827 m4_finish_module): ditto.
9828 * modules/time.c (m4_macro_table): ditto.
9830 * bootstrap: New file. Runs all the autoutils in the right order
9831 after a fresh checkout, or a make maintainer-clean.
9833 1999-02-18 Akim Demaille <demaille@inf.enst.fr>
9835 * src/builtin.c (dump_symbols): New function, factoring common
9836 content of m4_dumpdef and m4_symbols.
9837 (m4_dumpdef): Use it.
9838 (m4_symbols): New function, implementing `symbols'. Use it.
9839 * doc/m4.texinfo: Fixed missing commas after @xref, so that the
9840 file compile with modern makeinfo.
9841 (Symbols): New node, documenting symbols.
9842 (direntry): Modernize.
9844 1998-12-11 René Seindal <rene@seindal.dk>
9846 * src/builtin.c (predefined_tab): New predefined macros
9847 __m4_changeword__, __m4_gmp__ and __m4_modules__ for testing for
9848 configure time options.
9850 1998-12-01 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
9852 * src/module.c (module_try_load): Don't try to be clever and
9853 overwrite argument string. Instead allocate all constructed
9854 strings locally, since they can have arbitrary lengths. Make
9855 arguments pointers to const.
9856 (module_search): Simplify due to above change.
9858 1998-11-29 René Seindal <rene@seindal.dk>
9862 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): New tests.
9864 * tests/other-tests/import-environment.{m4,test}: New test.
9866 * tests/other-tests/discard-comments.{m4,test}: New test.
9868 * doc/m4.texinfo (Invoking m4): Updated for --discard-comments.
9870 * src/m4.c (main): New option -c --discard-comments.
9871 New global variable discard_comments.
9873 * src/m4.h (token_type): New TOKEN_NONE for tokens to be
9874 discarded, ie never returned from next_token().
9875 Added declaration of discard_comments.
9877 * src/input.c (next_token): Now loops until token type is not
9878 TOKEN_NONE. Comments are now given this type when comments should
9881 * doc/m4.texinfo (Invoking m4): Updated for --import-environment
9884 1998-11-28 René Seindal <rene@seindal.dk>
9886 * src/m4.c (main): New option --import-environment (no single
9889 * When configured with --with-gmp both the normal (fast) eval()
9890 and the gmp aware mpeval() are defined. To restore previous
9891 bahaviour use "define(`eval', defn(`mpeval'))".
9893 * tests/other-tests/gmp.m4: Changed to use mpeval().
9895 * src/evalmp.c: New file for compiling eval.c as gmp aware.
9896 Just defines USE_GMP if WITH_GMP is defined and includes eval.c.
9898 * src/eval.c: Now includes "numb.c" directly. Everything in this
9899 file must by static, except evaluate(), which is changed to
9900 mp_evaluate() if USE_GMP in force.
9902 * src/numb.c: Changed to be included by eval.c instead of being
9903 compiled separately. Everything is declared static.
9905 * src/numb.h: Removed declarations of functions, as numb.c is now
9908 * src/builtin.c: Declaration of m4_mpeval() added.
9909 Inserted `mpeval' in builtin table.
9910 (do_eval): New function with common code for m4_eval and m4_mpeval.
9911 (m4_mpeval): New function for gmp version of eval.
9913 * src/m4.h: Declaration of mp_evaluate().
9915 * src/Makefile.am (m4_SOUCES): Includes mpeval.c.
9916 (EXTRA_m4_SOURCES): Now has numb.c and numb.h
9918 * src/m4.c (main): m4 --version also shows which options were used
9919 for compilation, such as: "GNU m4 1.4n (options: modules gmp)"
9921 1998-11-27 René Seindal <rene@seindal.dk>
9923 * Error messages now always print program name before input file
9924 name as specified by GNU coding standards. Reported by Akim
9925 Demaille <demaille@inf.enst.fr>.
9927 * doc/m4.texinfo (Include): Change due to changed error message
9931 * tests/get-them: Minor change to sed script due to changed error
9934 * src/m4.c (print_program_name): New func used to print program
9935 name, input file and line number in error (). Used as an
9936 error_print_progname handler.
9937 (reference_error): Removed.
9938 (main): Assigns error_print_progname.
9940 * src/m4.h (M4ERROR): Removed reference_error ().
9942 1998-11-25 René Seindal <rene@seindal.dk>
9944 * Updated to libtool 1.2b.
9946 * src/builtin.c (install_builtin_table): Added braces to avoid
9947 warning of ambiguous 'else'.
9949 * src/module.c: Inserted search path code from path.c modified to
9951 (module_init): Configured default path used only if M4MODPATH is
9953 (module_try_load): Now reads libMODULE.la as generated by libtool
9954 for actual module name.
9955 (module_load): Gives better error messages on failure.
9957 * src/m4.h: Added declarations of structures and functions for
9958 generic search path handling.
9960 * src/path.c: Removed all module specific code and introduced new
9961 functions of more generic search path handling.
9963 1998-11-24 René Seindal <rene@seindal.dk>
9965 * configure.in: Defines INTLINCL to -I$(top_srcdir)/intl if using
9966 included gettext, as <libintl.h> might not be found
9967 otherwise. Reported by Andrew Bettison <andrewb@zip.com.au>.
9969 1998-11-22 René Seindal <rene@seindal.dk>
9971 * src/output.c (insert_diversion): Fixed bug that might cause m4
9972 to read from standard output! Triggered by input
9973 'divert(1)undivert(0)'. Test for divnum>0 changed to divnum>=0,
9974 so now 'undivert(0)' does nothing.
9976 1998-11-18 René Seindal <rene@seindal.dk>
9980 * src/input.c (set_word_regexp): Fixed a bug, where word_regexp
9981 could be changed when compiling a illegal regexp, causing later
9982 use of the regexp to dump core.
9984 * src/module.c (module_load): Changed error message to conform to
9987 * src/m4.c (usage): Added message about reporting bugs.
9989 * doc/m4.texinfo (Changeword): Corrected a wrong example.
9990 (Changeword): Added note about the type of regexps used.
9992 * ltconfig, ltmain.sh: New files from Libtool 1.2.
9994 * configure.in: Added calls to AM_ENABLE_SHARED, AM_DISABLE_STATIC
9995 and AM_PROG_LIBTOOL.
9997 * acm4/modules.m4 (AM_WITH_MODULES): Redone completely to work
10000 * modules/Makefile.am: Changed completely to compile modules using
10001 libtool. The modules are compiled as shared libraries, and are
10002 renamed when installed.
10004 * src/m4.h, src/module.c, acm4/modules.m4, acconfig.h: Renamed
10005 USE_SHL_LOAD to HAVE_SHL_LOAD
10007 * src/builtin.c (shipout_string): Now tests for a NULL string.
10009 * src/module.c: New level of indirection around non-portable
10010 functions to load shared objects. Intended to encapsulate the non
10011 portable parts better and to reduce the number of #ifdefs in the
10014 * Makefile.am (DIST_SUBDIRS): Instead of EXTRA_DIST for added
10015 directory modules/ to the distribution.
10017 1998-11-15 René Seindal <rene@seindal.dk>
10021 * modules/stdlib.c: New module `stdlib' defining some standard
10022 functions: getcwd, getlogin, getpid, getppid, getuid, getpwnam,
10023 getpwuid, hostname, rand, srand, getenv, setenv, unsetenv, uname.
10025 * src/builtin.c (shipout_string): New convenience function for
10026 builtins and modules.
10028 * src/module.c (module_load): Tentative support for
10029 shl_load/shl_findsym, but I cannot test it. Copied from MetaHTML.
10031 * Makefile.am (SUBDIRS): Directory modules added if configured.
10033 * modules/Makefile.am: Now correctly compiles and installs
10034 modules in pkglibexecdir.
10036 * src/m4.h: WITH_MODULES defined iff HAVE_DLOPEN or USE_SHL_LOAD.
10037 These two are now initialised by autoconf macros.
10039 * src/path.c (module_env_init): MODULE_PATH is always on the
10042 * src/Makefile.am: Now generated pathconf.h which defined the
10043 default MODULE_PATH.
10045 * configure.in (pkglibexecdir): Added defintion of pkglibexecdir,
10046 where modules are installed.
10048 * acm4/modules.m4: Enhanced with code from MetaHTML, contributed
10049 by Brian J. Fox <bfox@datawave.net>. This change allow modules to
10050 build and install automatically, and it is prepared for other
10051 interfacec than dlopen().
10053 * src/builtin.c (predefined_tab): Added __m4_version__ for the
10054 current version of GNU m4. It is a GNU extension.
10056 1998-11-14 René Seindal <rene@seindal.dk>
10058 * tests/Makefile.am (GENERATED_TESTS): Added new
10059 generated-tests/changesy.8.test
10061 * doc/m4.texinfo (Changesyntax): Documentation for escape
10064 * src/macro.c (expand_token): Check for escaped macro call before
10065 symbol table lookup.
10067 * src/builtin.c (m4_changesyntax): Added `@' flag to define escape
10070 * src/input.c: New static variable use_macro_escape, which is TRUE
10071 iff some character has code SYNTAX_ESCAPE
10072 (input_init): Added initialisation of use_macro_escape.
10073 (check_use_macro_escape): New function to synchronise
10074 use_macro_escape with the syntax table.
10075 (set_quotes): Added call to check_use_macro_escape()
10078 (next_token): Added new case for IS_ESCAPE.
10080 * src/m4.h (SYNTAX_ESCAPE): Defined as simple syntax category.
10082 1998-10-13 René Seindal <rene@seindal.dk>
10086 * tests/Makefile.am (GENERATED_TESTS): Renamed gentest to
10089 * tests/Makefile.am (OTHER_TESTS, OTHER_FILES): Added manually
10090 maintained tests in tests/other-tests. These currently tests for
10091 8-bit transparency, multiple precision arithmetic and sync-line
10092 output. Test for stackoverflow detection does not work.
10094 * examples/Makefile.am (TESTS): Added tests for all example files.
10096 * examples/mktests.sh: New file. Help program for creating test
10099 * tests/mkconfig.sh: New file to generate tests/config.m4 and
10100 tests/config.sh. This is for tests of configure selectable
10101 features. Picks up all set WITH_ and ENABLE_ veriables from
10104 * src/path.c (path_search): Added argument 'char **expanded_name'
10105 to return the expanded name.
10107 * src/m4.h: Added 2nd argument to declaration of path_search().
10109 * src/m4.c (main): Added 2nd argument to path_search().
10111 * src/freeze.c (reload_frozen_state): Do.
10113 * src/builtin.c (m4_undivert): Do.
10116 1998-10-11 René Seindal <rene@seindal.dk>
10118 * acm4/Makefile.am (ACINCLUDES_M4): Added gmp.m4 and modules.m4
10120 * acm4/modules.m4: New file. Defines AM_WITH_MODULES.
10122 * acm4/gmp.m4: New file. Defines AM_WITH_GMP.
10124 * configure.in: Introduced AM_WITH_MODULES and AM_WITH_GMP.
10126 * AUTHORS, ChangeLog: Changed all dates to ISO 8601.
10128 * intl/: Updated to GNU gettext 0.10.35.
10130 * doc/m4.texinfo (Format): Documented that format is blind.
10132 * src/builtin.c (builtin_tab): Builtin format marked as blind.
10134 1998-10-07 René Seindal <rene@seindal.dk>
10138 * tests/Makefile.am (GENERATED_TESTS): Changed .m4 extension to
10139 .test, as the files are no longer just m4 input.
10141 * tests/get-them (FILE): Changed .m4 extension to .test.
10143 * src/m4.h (token_type): New token type TOKEN_SPACE introduced.
10144 Otherwise quoted strings with leading whitespace first in a macro
10145 argument would be eliminated.
10147 * src/macro.c (expand_token): Handles new token type TOKEN_SPACE.
10148 (expand_argument): Do.
10150 * src/input.c (next_token): SPACE and NUM/OTHER characters are only
10151 grouped together iff both quote and comment strings are single
10152 character. Otherwise they might include a comment/quote leader.
10153 (next_token): Returns new token type TOKEN_SPACE.
10155 * src/builtin.c (push_builtin_table): New function to push a
10156 builtin_table on the stack without installing its contents.
10157 (find_builtin_by_name): Added call to push_builtin_table() if
10158 reading frozen files. Otherwise the builtins named in the frozen
10159 files could not be found.
10160 (install_builtin_table): Changed to use push_builtin_table()
10162 1998-10-04 René Seindal <rene@seindal.dk>
10164 * po/pl.po: Polish translation added.
10166 * po/POTFILES.in: src/module.c added.
10168 1998-10-04 René Seindal <rene@seindal.dk>
10172 * configure.in (ALL_LINGUAS): Added Polish pl.po
10174 1998-10-03 René Seindal <rene@seindal.dk>
10176 * Many files: Incorporated changes to implement dynamic modules.
10177 Detailed comments in src/modules.c and modules/README
10179 * src/module.c: New file, implements the OS dependant parts of
10180 dynamic module loading.
10182 * src/Makefile.am (m4_SOURCES): Added module.c
10184 * src/builtin.h: New file, declares some functions from builtin.c
10185 that are of use for other modules (shipout_int, numeric_arg,
10186 skip_space, bad_argc), and the macros ARG() and DECLARE().
10188 * src/builtin.c (install_builtin_table): New function. Each
10189 module brings in a builtin_table, which is pushed on a stack.
10190 (struct builtin_table): New struct for list of builtin_tables.
10191 (m4_loadmodule): New function to implement builtin "loadmodule".
10192 (shipout_int): No longer static, to be used by modules.
10196 (builtin_init): changed to call install_builtin_table()
10197 (find_builtin_by_name): Now searches all builtin_tables
10198 (find_builtin_by_addr): do.
10200 * src/path.c: Reorganised to allow for two search paths, one for
10201 include files and one for modules.
10203 * src/m4.h: Added declarations for new functions in module.c and
10206 * src/m4.c (main): Added call to module_init().
10208 * modules: New directory with a few demo modules.
10210 * Makefile.am (EXTRA_DIST): Added modules/* since modules/ is not
10213 * configure.in: Added modules/Makefile to AC_OUTPUT.
10215 * configure.in: Added code to implement --with-modules. Tests for
10216 <dlfcn.h> and -ldl.
10218 * acconfig.h: Added WITH_MODULES
10220 1998-10-02 René Seindal <rene@seindal.dk>
10222 * examples/Makefile.am (pkgdata_DATA): Removed special target for
10223 check and variables TESTS. These tests are now run from the
10226 * tests/Makefile.am (OTHER_TESTS): Added tests from the example/
10227 directory. The files stay there but the tests are run from the
10230 * tests/Makefile.am (EXTRA_DIST): Added run-test.
10232 * tests/run-test: New file. Run a test manually
10234 * tests/Makefile.am, tests/get_them: Moved automatically generated
10235 tests (from the manual) to sub directory tests/gentest/. The
10236 tests/ directory had gotten a bit messy.
10238 1998-09-06 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10240 * examples/{comments,ddivert,debug,iso8859,reverse,sysv-args,\
10241 wrap}.test: Added a few testcases.
10243 1998-08-21 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10247 * lib/Makefile.am (noinst_HEADERS): regex.h added
10249 * configure.in (jm_WITH_REGEX, jm_PREREQ_ERROR):
10250 acm4/{error,regex}.m4 (from fileutils-3.16u.tar.gz).
10252 * acm4/Makefile.am: created providing rules to create
10253 $(top_srcdir)/acinclude.m4 to be used by aclocal.
10255 * tests/defs (LANGUAGE, LC_ALL, LANG): force them to be
10256 `C'. Reported by Ulrich Drepper.
10258 * Makefile.am (SUBDIRS): Removed checks directory
10259 * configure.in (AC_OUTPUT): Removed checks/Makefile
10261 * doc/m4.texinfo (Patsubst,example): @comment added to preserve
10262 the space when m4.texinfo is edited and whitespace.el is active.
10263 (Defn,example): idem.
10265 1998-08-20 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10267 * doc/m4.texinfo (Esyscmd): grep ../Makefile instead of
10268 ../COPYING. ../Makefile is a file which is certainly present when
10269 test is executed in testSubDir. One can't be sure that the COPYING
10270 file is in .. or ../.. in all situations, the ../Makefile is
10273 * doc/m4.texinfo (Include): adjusted expected test output
10274 according to new tests, i.e. the input will always come from the
10275 file `in' created by the test.
10277 * tests/Makefile.am: Added three lines at the top to get
10278 esyscmd.1.test working.
10280 * tests/get-them: modified to generate clearer tests who will need
10281 less maintenance when new test examples are created in
10282 `doc/m4.texinfo'. All tests are small (nearly stand-alone, they
10283 need the generic file `defs') shell scripts creating `in', `ok',
10284 `out' and when apropriate `okerr' and `err' in the directory
10285 `testSubDir' when executed. The compare of `ok' and `out'
10286 (and of `okerr' and `err') will be the exit status of the test.
10287 `out' must match `ok' (and `okerr' must match `err') for the test
10290 * tests/[a-b]\{1,8\}.[0-9]+.test: This namespace is reserved for
10291 the tests generated by tests/get-them getting it input normally
10292 from doc/m4.texinfo. The namespace tests/[a-b]+[0-9]+.test (no `.'
10293 (dot) before the numeric part) is reserved for all other (hand
10294 written) tests. The `+' means one or more times.
10296 1998-08-12 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10298 * doc/Makefile.am (EXTRA_DIST): helptoman.pl and $(MANS) to
10299 supported short man page to refer to info documentation
10300 * helptoman.pl: added
10301 * configure.in: AC_PATH_PROG(PERL,perl)
10302 * Makefile.am (SUBDIRS): doc after src
10304 * libitized with libit 0.5 from
10305 ftp://ftp.iro.umontreal.ca/pub/contrib/pinard/maintenance/libit.
10307 * configure.in (AC_REPLACE_FUNCS): added xmalloc xstrdup
10308 * lib/Makefile.am (libm4_a_SOURCES): removed automakely supported
10309 replacement functions, (libm4_a_LIBADD): @LIBOBJS@
10310 * configure.in (AM_WITH_REGEX), acconfig.h (WITH_REGEX): added
10311 lib/rx.{c,h}: added
10312 * configure.in (AC_CHECK_FUNC): getopt_long
10314 * src/m4.c (usage): Report bugs to m4-bugs@gnu.org.
10316 * TODO: added entry about dependencies
10318 1998-08-10 René Seindal <rene@seindal.dk>
10322 * doc/m4.texinfo (Changesyntax): Added documentation for the macro
10325 * src/builtin.c (m4_changesyntax): Added builtin macro
10326 "changesyntax" to modify the syntax table.
10328 * src/input.c, src/m4.h, src/macro.c: Implemented an input syntax
10329 table. All categories are assigned a syntax code and tokens are
10330 read according to this table.
10332 1998-08-09 René Seindal <rene@seindal.dk>
10334 * src/numb.{c,h}: New files, implements multiple precision eval
10335 using GNU gmp. Originally submitted by John Gerard Makecki
10336 (johnm@vlibs.com), later modified. Tested with GNU gmp 2.0.2.
10338 * doc/m4.texinfo (Eval): Added documentation for multiple
10339 precision arithmetic library support.
10341 * src/m4.{c,h}, src/eval.c, src/builtin.c, configure.in: Changes
10342 to accommodate multiple precision eval.
10344 1998-08-07 René Seindal <rene@seindal.dk>
10346 * src/input.c (MATCH, match_input), src/m4.h: changed definition
10347 of comment and quote strings to `unsigned int' to allow eight bit
10348 chars (reported by andrewb@zip.com.au (Andrew Bettison)).
10350 * src/builtin.c, doc/m4.texinfo: Builtin `syncoutput' added by
10351 patch from Mike Howard <mike@clove.com>
10353 1998-08-06 René Seindal <rene@seindal.dk>
10355 * gettext.m4: corrected AM_WITH_NLS to handle use of installed
10358 1998-08-03 René Seindal <rene@seindal.dk>
10362 * src/m4.h: Added ifdef ENABLE_NLS around include of <libintl.h>
10363 and _ macro. M4 now builds with --disable-nls.
10365 * src/m4.c (main): reintroduced textdomain(PACKAGE) to get gettext
10366 to look for right message catalogs. Call indef'ed by ENABLE_NLS.
10368 * configure.in (ALL_LINGUAS): Added complete list of translations:
10369 de fr it ja nl ru sv.
10371 1998-05-23 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10373 * po/nl.po: Dutch translation by Erick Branderhorst.
10375 * po/fr.po: French translation by Erick Branderhorst, based on the
10376 translations by François Pinard in fr.msg and m4.cod.
10378 1998-05-22 Erick Branderhorst <Erick.Branderhorst@asml.nl>
10382 * src/m4.c: #include <signal.h> not <sys/signal.h>.
10384 * src/Makefile.am: CFLAGS = -Wall @CFLAGS@.
10386 * checks/Makefile.am: explicit list tests in CHECKS.
10388 * configure.in, {,src,doc,lib,examples,checks}/Makefile.am,
10389 src/{ansi2knr.{1,c}} doc/{m4.texinfo,mdate-sh}, missing,
10390 mkinstalldirs, install-sh: Added automake (1.3) support.
10392 * lib/{alloca.c,error.{c,h},get{date.h,opt.{c,h},opt1.c},
10393 obstack.{c,h},regex.{c,h},strtol.c,xmalloc.c,xstrdup.c}:
10394 Used libitize (0.4) to update.
10396 * configure.in, ABOUT-NLS, intl/*, po/*: Added gettextize
10397 (0.10.25) support. Removed LOCALE, fr.msg, m4.cod and adjusted
10398 README accordingly.
10400 * src/stackovf.c: #ifdef USE_STACKOVF ... #endif to (de-)activate
10401 stack overflow functionality.
10403 1994-12-03 François Pinard <pinard@iro.umontreal.ca>
10405 * Prerelease 1.4.1.
10407 * Makefile.in (realclean-local): Delete stamp-h.in.
10409 * configure.in, {,src,lib}/Makefile.in, src/m4.h, src/m4.c:
10410 Localize, adapting from how it is done in sharutils.
10412 * fr.tt: New file, for French.
10414 * configure.in, {,*/}Makefile.in, acconfig.h, src/m4.c,
10415 src/freeze.c: Rename PRODUCT to PACKAGE.
10417 1994-11-26 François Pinard <pinard@iro.umontreal.ca>
10419 * configure.in: Check for <libintl.h> and <locale.h>.
10420 * src/m4.h, src/builtin.c, src/debug.c, src/eval.c, src/macro.c,
10421 src/stackovf.c: Rename _ to __P.
10422 * src/m4.h: Declare _ as a macro returning its argument, or else,
10423 include <libintl.h> and declare _ as gettext.
10424 * src/m4.c: Possibly include <locale.h> and call setlocale.
10425 * src/m4.c, src/builtin.c, src/debug.c, src/eval.c, src/freeze.c,
10426 src/input.c, src/macro.c, src/output.c, src/path.c,
10427 src/stackovf.c, src/symtab.c: Use _ macro over all localizable
10430 1994-11-07 François Pinard <pinard@iro.umontreal.ca>
10432 * doc/Makefile.in (stamp-vti): Use new -r option to date.
10434 * configure.in: Put --with-gmp in place, in prevision for John
10436 * acconfig.h: Document WITH_GMP.
10438 1994-11-05 François Pinard <pinard@iro.umontreal.ca>
10442 * doc/Makefile.in (realclean): Also remove stamp-vti.
10443 Reported by Eric Backus.
10445 1994-11-02 François Pinard <pinard@iro.umontreal.ca>
10447 * src/freeze.c (produce_frozen_state): If the frozen file cannot
10448 be opened, return immediately after producing the error message.
10449 Reported by Andreas Schwab.
10451 * configure.in: Check for const only after having found possible
10452 ANSIfying compiler flags, this is of no use to check it before.
10453 Reported by Alexander Lehmann.
10455 1994-11-01 François Pinard <pinard@iro.umontreal.ca>
10457 * src/macro.c (collect_arguments): Cast obstack arguments to
10458 (voidstar), so avoiding compiler warnings.
10459 Reported by Joseph E. Sacco.
10461 * src/freeze.c (produce_frozen_state): Cast printed lengths to
10462 (int) so they correspond to %d format items.
10463 Reported by Joseph E. Sacco.
10465 * src/m4.c (main): Cast the argument to xfree to (voidstar).
10466 * src/symtab.c (free_symbol): Idem.
10467 Reported by Karl Vogel.
10469 1994-10-31 François Pinard <pinard@iro.umontreal.ca>
10471 * Makefile.in (DISTFILES): Distribute BACKLOG.
10473 * configure.in: Define PRODUCT and VERSION.
10474 * acconfig.h: Document PRODUCT and VERSION.
10475 * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
10476 constant string m4 and variable or parameter named version.
10478 1994-10-30 François Pinard <pinard@iro.umontreal.ca>
10480 * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
10481 __STDC__. Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
10482 defines __STDC__ to 0, for indicating it is *not* ANSI!
10483 Reported by Kaveh R. Ghazi.
10485 * configure.in: Added obsolescent tests for AIX and Minix.
10487 * doc/Makefile.in (mostlyclean): Remove texclean in dependencies,
10488 which texclean does not exist anymore.
10489 Reported by Eric Backus, Jim Meyering, John David Anglin and
10492 1994-10-29 François Pinard <pinard@iro.umontreal.ca>
10494 * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
10495 Reported by John David Anglin.
10497 * src/ansi2knr.c: New version, sent by Peter Deutsch.
10498 * aclocal.m4 (fp_C_PROTOTYPES): Substitute empty or ansi2knr for
10499 ANSI2KNR, depending on the fact the compiler is ANSI or not.
10500 * src/Makefile.in: Use -Ovarargs=convert on ansi2knr calls.
10501 Remove the sed filter after ansi2knr for debug.c. Use $O instead
10502 of $U, put underline in extensions rather than in basenames. Use
10503 implicit rules, now that regularity makes this possible.
10504 Have $(OBJECTS) depend on $(ANSI2KNR), so to trigger compilation
10505 of ansi2knr whenever it is needed.
10506 * configure.in: Adjusted for correct STACKOVF substitution.
10507 * src/debug.c (trace_format): When not __STDC__, use (...) as a
10508 parameter list, so ansi2knr will convert it to (va_alist) va_dcl.
10509 Reported by David MacKenzie.
10511 * Makefile.in: Remove binprefix. Use transform_name instead.
10512 Reported by David MacKenzie.
10514 * doc/Makefile.in: Create version.texi, use it, clean it.
10515 Reported by Jim Meyering.
10517 1994-10-28 François Pinard <pinard@iro.umontreal.ca>
10519 * Makefile.in (all, install, uninstall): Depend on Makefile.
10521 * Makefile.in: For actions invoking $(MAKE) from within compound
10522 sh statements, exit non-zero if the sub-make fails. Otherwise,
10523 the top-level make may exit successfully when it should fail.
10524 Reported by Jim Kingdon.
10526 * {,/*}Makefile.in: Use && after all cd, in case they fail.
10528 * {,*/}Makefile.in: Declare PRODUCT and VERSION macros.
10529 (dist): Use PRODUCT and VERSION instead of tricks on .fname.
10530 * configure.in: Substitute PRODUCT and VERSION.
10532 * {,*/}Makefile.in (dist): Always try a hard link before a copy.
10534 1994-10-27 François Pinard <pinard@iro.umontreal.ca>
10536 * Makefile.in (mostlyclean-local): Do not remove *~.
10537 * */Makefile.in (mostlyclean): Idem.
10538 Reported by Robert E. Brown and Richard Stallman.
10540 1994-10-09 François Pinard <pinard@iro.umontreal.ca>
10542 * src/m4.h: Get rid of CONFIG_BROKETS.
10544 1994-10-02 François Pinard <pinard@iro.umontreal.ca>
10546 * configure.in: Use AC_ARG_PROGRAM.
10547 * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
10548 Reported by David MacKenzie.
10550 1994-10-01 François Pinard <pinard@iro.umontreal.ca>
10552 * configure.in: Do not add -O to CFLAGS for GNU C, now that
10553 configure does it automatically.
10554 Reported by Jim Meyering.
10556 1994-09-23 François Pinard <pinard@iro.umontreal.ca>
10558 * src/stackovf.c: Declare the handler_t typedef earlier in the
10559 code, use it for stackovf_handler.
10560 (setup_stackovf_trap): Use RETSIGTYPE instead of void while
10561 casting sigsegv_handler.
10562 Reported by Robert Bernstein.
10564 * src/m4.c (main): Initialize program_name to argv[0] without
10566 Reported by Karl Berry.
10568 1994-09-18 François Pinard <pinard@iro.umontreal.ca>
10570 * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
10571 Reported by Karl Berry.
10573 1994-09-14 François Pinard <pinard@iro.umontreal.ca>
10575 * lib/Makefile.in (mostlyclean): Added.
10576 (TAGS): Make in $(srcdir).
10578 * configure.in: Use `choke me' in test, like everywhere!
10580 * {doc,examples,lib,src}/Makefile.in (check): Deleted, as
10581 unreacheable and useless.
10583 * doc/Makefile.in (texclean): Deleted, merged in mostlyclean.
10585 * lib/Makefile.in (DISTFILES): Distribute TAGS.
10586 (distclean): Do not remove TAGS.
10587 (realclean): Remove it.
10588 * Makefile.in: Make TAGS in lib also, not just in src.
10589 Reported by Karl Berry.
10591 * Makefile.in (distclean, realclean): Instead of recursively
10592 calling $(MAKE) for the -local part, allow parallel execution of
10593 -recursive and -local, only delay the removal of config.status,
10594 which is repeated in both goals.
10596 1994-09-13 François Pinard <pinard@iro.umontreal.ca>
10600 * Makefile.in: Group all *clean-recursive goals in one, using sed
10601 to remove `-recursive' while calling make recursively. Also, use
10602 a subshell for each recursive $(MAKE).
10603 Reported by Jim Meyering.
10605 * src/m4.h (memcpy): Define with bcopy for BSD systems.
10606 Reported by Kaveh R. Ghazi.
10608 * src/Makefile.in (ansi2knr): Use $(LIBS) while linking, for SunOS
10609 4.1.3 requires -ldl to link even ansik2nr, and we need a way to
10612 * configure.in: Use date instead of touch for stamp-h.
10613 * Makefile.in (stamp-h.in): Idem.
10615 * Makefile.in (distclean, realclean): Force serial execution of
10616 both goals, in case parallel makes are being used.
10617 Reported by Jim Meyering.
10619 * src/Makefile.in (DISTFILES): Distribute TAGS.
10620 (distclean): Do not remove TAGS.
10621 (realclean): Remove it.
10622 Reported by Karl Berry.
10624 1994-09-10 François Pinard <pinard@iro.umontreal.ca>
10626 * configure.in: Use fp_ to match aclocal.m4. Revert _OS_ macros
10627 to old names, for following Autoconf.
10629 1994-09-08 François Pinard <pinard@iro.umontreal.ca>
10631 * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
10632 ./install.sh will not be correctly referred to in sub-Makefiles.
10633 Reported by John David Anglin.
10635 * doc/Makefile.in (texclean): Remove *.cps and *.fns too.
10636 Reported by Eric Backus.
10638 * Makefile.in, checks/Makefile.in, doc/Makefile.in,
10639 examples/Makefile.in, lib/Makefile.in, src/Makefile.in: Limit
10640 config.status into remaking this directory's Makefile only.
10641 * Makefile.in (stamp-h): Do not check nor touch stamp-h.
10642 * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
10643 Reported by Jim Meyering.
10645 1994-09-06 François Pinard <pinard@iro.umontreal.ca>
10647 * configure.in: Correct stack overflow detection logic, taking
10648 care of systems having only incomplete implementations (like for
10649 Pyramid 9820 OSx 5.0d).
10650 Reported by Kaveh R. Ghazi.
10652 * src/Makefile.in (TAGS): Remote -t from etags call.
10654 1994-09-02 François Pinard <pinard@iro.umontreal.ca>
10656 * lib/Makefile.in (install): Depend on all.
10658 1994-08-31 François Pinard <pinard@iro.umontreal.ca>
10660 * examples/Makefile.in (mostlyclean): Do not depend on texclean.
10661 Reported by Jim Meyering and John David Anglin.
10663 * Makefile.in (distclean-local): Delete config.log.
10664 Reported by Jim Meyering.
10666 Solidify frozen files with respect to -P:
10667 * src/m4.c: Have -P set prefix_all_buitins variable instead of
10668 calling a function by that name. Declare the variable.
10669 * src/m4.h: Adjust declaration for prefix_all_buitins.
10670 * src/builtin.c (builtin_init): Merge in functionality from
10671 previous prefix_all_buitins function, while making entries in the
10672 symbol table, but not modifying the builtin description itself.
10674 * src/freeze.c (reload_frozen_state): Add a useless `break;',
10675 because *many* compilers do not accept an empty `default:'.
10676 Reported by Akiko Matsushita, Eric Backus, John David Anglin,
10677 Joseph E. Sacco, Kaveh R. Ghazi, Tom McConnell and Ulrich Drepper.
10679 * configure.in: Use AC_TYPE_SIGNAL.
10680 * src/stackovf.c (setup_stackovf_trap): Use RETSIGTYPE.
10681 Reported by Robert Bernstein.
10683 * checks/Makefile.in (check): Modify PATH so check-them will find
10684 m4 in the src directory.
10685 * Makefile.in (check): Don't.
10686 Reported by Akiko Matsushita and Jim Meyering.
10688 * src/output.c (make_room_for, output_character_helper): New
10689 functions, for implementing a global MAXIMUM_TOTAL_SIZE instead of
10690 a per buffer MAXIMUM_BUFFER_SIZE.
10692 * src/output.c (output_text): New function, for optimizing the
10693 output of strings of characters. Use it.
10695 1994-08-30 François Pinard <pinard@iro.umontreal.ca>
10697 * doc, src: New directories reorganizing the distribution.
10698 * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
10700 * Makefile.in: Adjusted.
10701 * configure.in: Configure new Makefiles.
10703 * m4.h: Declare STRING typedef. Use it for comment and quote
10704 strings, adjusting all references. (This is the rudiments of a
10705 beginning for the eventual withdrawal of NUL terminated strings.)
10706 * output.c (shipout_text): Accept a length parameter, and use it.
10707 All callers adjusted.
10709 1994-08-29 François Pinard <pinard@iro.umontreal.ca>
10711 * m4.h: Include <unistd.h> if it exists.
10712 * stackovf.c: Don't.
10714 Clean up for current_diversion variable:
10715 * output.c: Move current_diversion from builtin.c.
10716 * m4.h: Declare current_diversion so builtin.c can access it.
10717 * output.c (output_init, make_diversion): Initialize or update
10719 * builtin.c (builtin_init, m4_divert): Leave current_diversion
10722 Remove limit on number of diversions:
10723 * output.c: Replace ndiversion by diversions, declare it.
10724 (output_init): Allocate only diversion 0.
10725 (make_diversion): Allocate new diversions as needed.
10726 * m4.h, m4.c: Remove NDIVERSIONS and ndiversion related stuff.
10727 * m4.c: Still accept -N, but do nothing with it.
10728 Reported by David MacKenzie.
10731 * output.c (freeze_diversions): New function.
10732 * m4.h: Declare freeze_diversions.
10733 * freeze.c: Document frozen file format, revise it, call
10734 freeze_diversions to add diversions to frozen format, and code to
10735 reload them properly.
10736 * m4.c: Do not undivert automatically at end when status being
10737 frozen. Do not call builtin_init when reloading frozen state.
10739 Speed up diversion processing:
10740 * output.c: Add INITIAL_BUFFER_SIZE, MAXIMUM_BUFFER_SIZE,
10741 COPY_BUFFER_SIZE, in-memory diversion buffers, struct diversion
10742 structure and variables, cached variables out of output_diversion,
10743 reallocate_diversion_for and OUTPUT_CHARACTER.
10744 (shipout_text, make_diversion, insert_diversion): Adapted to new
10746 (insert_file): Use better buffering.
10747 Reported by David MacKenzie.
10749 1994-08-28 François Pinard <pinard@iro.umontreal.ca>
10751 * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
10752 dist works from another build directory.
10754 1994-08-27 François Pinard <pinard@iro.umontreal.ca>
10756 * symtab.c (hack_all_symbols): Use hash_table_size instead of
10757 constant HASHMAX, for -H option to work better.
10759 * builtin.c (DECLARE): Simplify by using _ ().
10761 * freeze.c: New file.
10762 * Makefile.in: Compile it, distribute it.
10763 * m4.c: Recognize, document and process --freeze-state (-F) and
10764 --reload-state (-R) options. Pass a true flag to builtin_init
10765 only if no reloading some state.
10766 * builtin.c (define_builtin): Remove static specifier.
10767 (find_builtin_by_name): Remove static specifier.
10768 (builtin_init): Accept and obey a flag argument.
10769 * m4.h: Add declarations for freeze.c, changes for builtin.c.
10771 1994-08-24 François Pinard <pinard@iro.umontreal.ca>
10773 * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
10776 * configure.in: Implement --with-dmalloc.
10777 * acconfig.h: Document WITH_DMALLOC.
10778 * m4.h: Add code for when WITH_DMALLOC.
10780 1994-08-15 François Pinard <pinard@iro.umontreal.ca>
10782 * m4.c (long_options): Use "error-output", the dash was missing.
10783 Reported by Akiko Matsushita.
10785 1994-08-12 François Pinard <pinard@iro.umontreal.ca>
10787 * m4.h: Include <sys/types.h>.
10788 * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
10789 * m4.h: Declare len_lquote and len_rquote as size_t, not int.
10791 * input.c: Declare len_lquote, len_rquote, len_bcomm and len_ecomm
10792 as size_t, not int.
10793 * builtin.c (dump_args): Declare len as size_t, not int.
10795 * debug.c: Prototype the forward declaration of debug_set_file.
10797 * builtin.c (m4_undivert): Replace div by file, for avoiding the
10798 shadowing of this variable.
10799 * output.c (insert_diversion): Idem.
10801 * input.c: Delete def_rquote, def_lquote, def_bcomm and def_ecomm.
10802 (input_init): Duplicate default quote and comment strings.
10803 (set_quotes): Free previous quote strings in all cases. Duplicate
10804 even default quote strings.
10805 (set_comment): Free previous comment strings in all cases.
10806 Duplicate even default comment strings.
10808 * configure.in: Updated for Autoconf 2.0.
10809 * Makefile.in (distclean-local): Also delete config.cache.
10811 * m4.c (usage): Reorganize the --help output by topic. Include a
10812 description for debugging flags.
10814 1994-07-29 François Pinard <pinard@iro.umontreal.ca>
10816 * configure.in: If sigaction is available and SA_ONSTACK defined,
10817 use sigaction. Otherwise, if sigvec is available and SV_ONSTACK
10818 defined, use sigvec. Else don't compile stackovf.c.
10819 * stackovf.c (setup_stackovf_trap): Idem.
10820 Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
10823 1994-07-21 François Pinard <pinard@iro.umontreal.ca>
10825 * m4.c (usage): Replace printf par fputs.
10827 1994-07-18 François Pinard <pinard@iro.umontreal.ca>
10831 1994-07-17 François Pinard <pinard@iro.umontreal.ca>
10833 * configure.in: Check for sigaction and sigvec. Add a new delayed
10834 check for RLIMIT_STACK, combine in the checking for getrlimit.
10835 All those things are not universally available.
10836 * stackovf.c: Split setting up the trap handler and catching
10837 signals, for better taking care of various configure outcomes.
10838 * examples/stackovf.sh: Correct a typo.
10839 Reported by Eric Backus, Jim Avera and Jim Meyering.
10841 1994-07-16 François Pinard <pinard@iro.umontreal.ca>
10843 * ansi2knr.c: New version sent by its author, Peter Deutsch.
10845 1994-07-15 François Pinard <pinard@iro.umontreal.ca>
10847 * Makefile.in: Modify so parallel make will not try making
10848 lib/libm4.a twice simultaneously.
10849 Reported by Jim Meyering.
10851 1994-07-14 François Pinard <pinard@iro.umontreal.ca>
10853 * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
10854 error message, for when no code possibility exists. Even if this
10855 line is completely #ifdef'ed out, it brings a syntax error.
10856 Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
10858 * Makefile.in (install): Have install depend on all too, for lib
10859 to be remade as needed.
10861 * examples/stackovf.sh: Try ksh, bsh and bash for shells
10862 providing ulimit, instead of using only ksh.
10863 Reported by Jim Avera and Joseph E. Sacco.
10865 1994-07-12 François Pinard <pinard@iro.umontreal.ca>
10867 * Makefile.in (check): Have it depend on all instead of m4. In
10868 this way, a change in lib will be detected and processed.
10870 * builtin.c (numeric_arg): Use strtol and verify the conversion,
10871 instead of using sscanf which stops as soon as there is a
10872 non-digit in the input. Previously, incr(1xyzzy), eval(1,2xyzzy)
10873 and divert(1xyzzy) were all accepted without any warning or error
10875 * m4.h: Declare strtol as long if not including stdlib.h.
10876 * configure.in: Check for limits.h, and replace strtol if missing.
10877 * lib/Makefile.in: Substitute LIBOBJS. Distribute strtol.c.
10878 * lib/strtol.c: New file, from elsewhere.
10879 Reported by Andreas Schwab.
10881 1994-07-07 François Pinard <pinard@iro.umontreal.ca>
10883 * macro.c (expand_macro): Cast value to (boolean) prior to
10884 assigning it to traced.
10885 Reported by Tom McConnell.
10887 * Makefile.in (m4): Always make all in lib first.
10888 Reported by Jim Meyering.
10890 1994-07-06 Jim Avera <jima@netcom.com>
10892 * stackovf.c: Isolated OS-dependent sections; Improved portability,
10893 adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
10894 handlers), and a default error message if the fault address is not
10895 available (when neither siginfo.h nor BSD sigcontext are supported).
10896 * configure.in: Changes for stackovf.h: Check for sigcontext,
10897 sigaction, sigstack, and define rlim_t as int if necessary.
10898 * acconfig.h: Added HAVE_SIGCONTEXT and rlim_t.
10899 * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
10900 * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
10902 1994-07-05 François Pinard <pinard@iro.umontreal.ca>
10904 * configure.in: Use AC_SET_MAKE.
10905 * Makefile.in: Use @SET_MAKE@.
10906 Reported by Jim Meyering.
10908 * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
10909 Reported by Ian Taylor.
10911 1994-07-02 François Pinard <pinard@iro.umontreal.ca>
10913 * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
10914 because siginfo.h is unrelated to standard headers, and siginfo.h
10915 is already checked for.
10916 Reported by Joseph E. Sacco.
10918 * acconfig.h, aclocal.m4, m4.h: Replace HAVE_PROTOTYPES by
10920 * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
10923 1994-06-29 François Pinard <pinard@iro.umontreal.ca>
10925 * builtin.c (substitute): Use \& to represent this part of the
10926 string which was matched by the whole regexp, instead of
10927 representing the whole string. Any usage of \0 issues a warning
10928 and acts like \&, it will disappear in some subsequent release.
10930 1994-06-27 François Pinard <pinard@iro.umontreal.ca>
10932 * m4.c: Complete prototype for forwarded declaration of usage.
10934 * input.c (init_macro_token): Correct own reference in error
10935 message. Previous name get_macro_func was referred to instead.
10936 (next_char): Correct own reference in error message. Previous
10937 name advance_input was referred to instead.
10939 * m4.h: Declare eval_t and unsigned_eval_t typedefs to 32 bits.
10940 * eval.c (logical_or_term, logical_and_term, or_term, xor_term,
10941 and_term, not_term, logical_not_term, cmp_term, shift_term,
10942 add_term, mult_term, exp_term, unary_term, simple_term): Add
10943 prototype to forwarded declarations. Declare parameter v1 as
10944 eval_t * instead of int *. Same for local variable v2 in dyadic
10945 functions. Same for result in exp_term.
10946 * builtin.c (m4_eval): Declare value as eval_t instead of int.
10947 (ntoa): Declare value as eval_t instead of int. Declare uvalue as
10948 unsigned_eval_t instead of unsigned int. Change casts accordingly.
10949 (shipout_int): Cast first argument of ntoa to eval_t.
10950 Reported by Thorsten Ohl.
10952 * macro.c: Complete the prototypes of forwarded expand_macro and
10954 Reported by Thorsten Ohl.
10956 * m4.h: Define voidstar as void * or char * depending on __STDC__.
10957 The Ultrix 3.1 compiler cannot do much with void pointers.
10959 * builtin.c (dumpdef_cmp): Replace void * by voidstar.
10960 * m4.c (xfree): Replace void * by voidstar.
10961 Reported by Tom McConnell.
10963 * ansi2knr.1: New, from elsewhere.
10964 * Makefile.in (DISTFILES): Distribute ansi2knr.1
10966 * Makefile.in (stamp-h.in): Avoid running ./config.status if
10967 stamp-h does not exist yet. This avoids running it a second time
10968 just after the initial ./configure.
10969 Reported by David MacKenzie and Tom McConnell.
10971 * m4.h: Replace the enum debug_info declaration with a series of
10972 #define's. The Ultrix 3.1 compiler would otherwise need casting
10973 (int) to most references, when used in expressions.
10974 Reported by Tom McConnell.
10976 1994-06-25 François Pinard <pinard@iro.umontreal.ca>
10978 * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
10979 following an idea from Brook G. Milligan. AC_HAVE_PROTOTYPES
10980 calls the compiler. Previously, FP_PROTOTYPES was only calling
10981 the preprocessor; by not being subject to CFLAGS, this was
10982 discouraging those flags asking for ANSI compilation.
10983 * acconfig.h: Document HAVE_PROTOTYPES.
10984 * configure.in: Use AC_HAVE_PROTOTYPES instead of FP_PROTOTYPES.
10985 * m4.h: Define _() according to HAVE_PROTOTYPES, not __STDC__.
10986 Reported by Eric Backus.
10988 * configure.in: Substitute CFLAGS and LDFLAGS, taking their value
10989 from the environment. Default CFLAGS to -g if not set.
10990 * Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
10991 * lib/Makefile.in: Have CFLAGS substituted from configure.
10992 Reported by Eric Backus and Tom McConnell.
10994 * configure.in: m4_undefine changeword before using AC_ENABLE.
10996 * m4.h: Declare prototypes for error (for ANSI compilers only),
10997 prefix_all_builtins and reference_error.
10998 Reported by Tom McConnell.
11000 * input.c (set_word_regexp): Do not try to initialize the array
11001 test from a string, this does not work with non-ANSI compilers.
11002 Reported by Eric Backus.
11004 * Makefile.in (dist): Clean examples/ before saving it.
11005 (distclean-local): Also remove stamp-h.
11006 Reported by Eric Backus.
11008 * Makefile.in (_stackovf.c): Goal for compiling stacokovf.c with
11009 non ANSI compilers.
11010 Reported by Tom McConnell.
11012 * checks/Makefile.in (clean): Depends on mostlyclean.
11013 (mostlyclean): New goal.
11015 1994-06-24 François Pinard <pinard@iro.umontreal.ca>
11017 * Makefile.in (DISTFILES): Distribute install.sh.
11018 * install.sh: New file, copied from elsewhere.
11019 Reported by Assar Westerlund and Kaveh R. Ghazi.
11021 1994-06-23 François Pinard <pinard@iro.umontreal.ca>
11023 * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
11024 * acconfig.h: Explain ENABLE_CHANGEWORD.
11026 [These modifs all depend upon ENABLE_CHANGEWORD and are adapted
11027 from code provided by Pete Chown]
11028 * m4.h: Add original_text field to u_t variant of union u.
11029 Declare TOKEN_DATA_FUNC macro.
11030 * builtin.c: Declare changeword.
11031 (m4_changeword): New function.
11032 * input.c: Include "regex.h", define variables with word regexps.
11033 (input_init): Initialize the word regexp.
11034 (set_word_regexp): New.
11035 (next_token): Declare local variables, use the previous code if
11036 default_word_regexp is true. Else, match using a new code. Save
11038 * macro.c (expand_token): Ship out original text if not a macro
11040 Reported by Krste Asanovic and Pete Chown.
11042 [These modifs all depend upon ENABLE_CHANGEWORD]
11043 * m4.h: Declare external user_word_regexp.
11044 * m4.c: Declare user_word_regexp, and initialize it from
11045 --word-regexp or -W, or NULL if not specified.
11046 * input.c: Use user_word_regexp if specified, instead of
11047 DEFAULT_WORD_REGEXP.
11049 * Makefile.in (m4): Revert Jan 3 1994 change. I'm unable to
11052 * Makefile.in, lib/Makefile.in: Limit suffixes to .c and .o.
11053 * checks/Makefile.in: Empty the suffix list.
11054 Reported by Geoff Russell, Joel Sherrill and Roland McGrath.
11056 * m4.c: Declare nesting_limit and initialize it to 250.
11057 Implement -LNUMBER or --nesting-limit=NUMBER to change its
11059 * m4.h: Declare nesting_limit as external.
11060 * macro.c (expand_macro): Stop execution whenever nesting limit
11062 Reported by Bengt Mertensson.
11064 * eval.c (evaluate): Diagnose excess characters in eval input.
11065 Things like `eval(08)' used to return 0 with no diagnostic.
11067 * m4.h: Capitalize first letter of all macro arguments in
11070 * m4.c: Declare warning_status, initialize it to 0. Add new
11071 option -E, or --fatal-warnings, which sets warning_status to
11072 EXIT_FAILURE instead.
11073 * m4.h: Declare external warning_status. Define EXIT_SUCCESS and
11074 EXIT_FAILURE if not otherwise done by header files.
11075 * m4.c: Delete declarations for EXIT_SUCCESS and EXIT_FAILURE.
11076 * m4.c, input.c, output.c, symtab.c, builtin.c, macro.c, debug.c,
11077 eval.c: Replace 0 by warning_status and 1 by EXIT_FAILURE in first
11078 argument of all M4ERROR calls.
11079 Reported by Noah Friedman.
11081 * examples/incl-test.m4: Renamed from incl_test.m4.
11082 * examples/include.m4: Include incl-test.m4 instead of
11084 * examples/multiquotes.m4: Renamed from multi-quotes.m.
11086 1994-06-22 François Pinard <pinard@iro.umontreal.ca>
11088 * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found. Note
11089 that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
11090 also tested it on a Sun Sparc workstation running SunOS 4.x.
11092 * format.c (format): When not HAVE_EFGCVT, m4 was failing the
11093 49.format check, abusing a `union values' argument with sprintf
11094 without selecting the proper field. Now, save the formatting type
11095 first, delaying the fetch of the corresponding argument.
11096 Reported by Joseph E. Sacco and Tom Quinn.
11098 * format.c (format): Remove const from char *fmt declaration when
11099 not HAVE_EFGCVT, because a NUL may be forced into it.
11101 * m4.h: Declare atof() when not STDC_HEADERS.
11102 Reported by Joseph E. Sacco.
11104 * Regenerate configure using Autoconf 1.11, this corrects a
11105 problem about an incorrect cpp seting on NeXT 3.1.
11106 Reported by Alexander Lehmann.
11108 1994-06-05 François Pinard <pinard@iro.umontreal.ca>
11110 * m4.h (_): Change argument from `x' to `Args'.
11112 1994-04-22 François Pinard <pinard@iro.umontreal.ca>
11114 * m4.h: Rename Args() to _().
11115 * m4.h: Remove extern specifier from all function declarations.
11117 1994-04-22 Jim Avera <jima@netcom.com>
11119 * stackovf.c: New file implementing stack-overflow detection.
11120 * configure.in: Check for getrlimit, sigaction. If all of
11121 standard headers, getrlimit and sigaction, define USE_STACKOVF and
11122 substitute ${U}stackovf.o for STACKOVF.
11123 * acconfig.h: Declare USE_STACKOVF.
11124 * Makefile.in: Distribute stackovf.c, link with $(STACKOVF).
11125 * m4.h: Declare setup_stackovf_trap().
11126 * m4.c: Call setup_stackovf_trap().
11127 * tests/stackovf_test.sh: New file.
11129 1994-04-13 François Pinard <pinard@iro.umontreal.ca>
11131 * checks/Makefile.in: Rename .all-stamp to stamp-checks.
11133 * Makefile.in (Makefile, etc.): Adapt for Autoconf 1.8.
11135 1994-01-30 François Pinard <pinard@iro.umontreal.ca>
11137 * m4.h: Remove definition of volatile, not used anymore.
11138 Reported by Jim Meyering and Joseph E. Sacco.
11140 * m4.h: Consistently use `do { ... } while (0)' in macros, instead
11141 of `if ... else /* nothing */' for if macros.
11142 Reported by Jim Meyering.
11144 * builtin.c (m4_regexp): Reorganize the code for avoiding a
11145 warning from gcc about `repl' possibly used before defined.
11146 Reported by Jim Meyering.
11148 * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
11149 Reported by Jim Meyering.
11151 1994-01-25 François Pinard <pinard@iro.umontreal.ca>
11153 * m4.h: Move the conditional definition of volatile after the
11154 inclusion of system files, because they may define it first.
11156 1994-01-04 François Pinard <pinard@iro.umontreal.ca>
11158 * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
11159 get around a problem with Alpha make seeing a syntax error, there.
11160 Reported by Vern Paxson.
11162 1994-01-03 François Pinard <pinard@iro.umontreal.ca>
11164 * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
11165 Reported by Richard Stallman.
11167 1993-12-25 François Pinard <pinard@iro.umontreal.ca>
11169 * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
11170 instead of AC_HAVE_FUNCS.
11171 Reported by Noah Friedman.
11173 1993-12-01 François Pinard <pinard@iro.umontreal.ca>
11175 * m4.c: Initialize show_help and show_version to zero.
11177 * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
11178 Use them in exit() and usage() calls.
11180 1993-11-27 François Pinard <pinard@iro.umontreal.ca>
11182 * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
11183 syserr() macro. Delete errref, add reference_error and M4ERROR.
11184 * m4.c: Replace errref, which was returning an input reference
11185 string, with reference_error, which prints it on standard error.
11186 * builtin.c, output.c: Use errno as second parameter to error,
11187 instead of using syserr() with %s.
11188 * *.c: Use M4ERROR instead of error: no more errref() with %s.
11189 Doing so, the program name appears after the input reference
11190 instead of before, which eases M-x next-error processing.
11192 1993-11-24 François Pinard <pinard@iro.umontreal.ca>
11194 * checks/get-them: Escape braces with backslashes in patterns,
11195 because HPUX-9.01 awk needs this.
11196 Reported by Jim Meyering.
11198 1993-11-22 François Pinard <pinard@iro.umontreal.ca>
11200 * builtin.c: Declare "FILE *popen ();".
11202 * m4.h: Remove MESSAGE{,1,2}, WARNING1, FATAL{,1}, INTERNAL_ERROR
11203 macros, replace error_message_prefix() declaration by errref()'s.
11204 Declare xrealloc, for use in errref().
11205 * m4.c: Delete error_message_prefix() function, add errref().
11206 * *.c: Use error() systematically in place of all error macros,
11207 now that error() flushes stdout first. Make needed adjustments.
11209 * m4.h: Remove const in sys_errlist[] declaration, it creates
11210 conflicts on SGI and Alpha.
11211 Reported by Kaveh R. Ghazi.
11213 1993-11-20 François Pinard <pinard@iro.umontreal.ca>
11215 * m4.c: Include <getopt.h> instead of "getopt.h".
11217 * configure.in: Output to config.h. Use HAVE_FUNCS preferably.
11218 * acconfig.h: New, for documenting HAVE_EFGCVT.
11219 * Makefile.in: Distribute acconfig.h, .stamp-h.in and config.h.in,
11220 use them wherever appropriate. Also use -I. for compilations.
11221 * lib/Makefile.in: Use -I.. for compilations.
11222 * *.c: Include <config.h> or "config.h".
11224 * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
11225 * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
11227 1993-11-17 François Pinard <pinard@iro.umontreal.ca>
11229 * builtin.c (m4_eval): Cast strlen to (int) before comparing.
11231 * input.c (input_init): Initialize quote and comment strings
11232 explicitely instead of calling set_quotes and set_comment: by
11233 doing so, we ensure we do not free uninitialized variables.
11235 * checks/check-them: Reverse arguments to both diff, so the
11236 expected is on the left and the obtained on the right.
11238 * m4.h: Add MESSAGE{,1,2}, WARNING1, FATAL{,1} and INTERNAL_ERROR
11239 macros. Delete declarations for m4error, warning, fatal and
11240 internal_error, add declaration for error_message_prefix.
11241 * m4.c: Delete m4error, warning, fatal and internal_error
11242 routines, add error_message_prefix routine.
11243 * *.c: Replace m4error routine calls with MESSAGE* macro calls,
11244 warning with WARNING*, fatal with FATAL* and internal_error with
11246 * Makefile.in (_m4.c): Do not adjust ansi2knr output for va_alist,
11247 this is not needed anymore.
11249 * m4.h: Declare extern FILE *debug. Add DEBUG_PRINT{1,3} and
11250 DEBUG_MESSAGE{,1,2} macros. Delete declarations for debug_print
11251 and debug_message, add declaration for debug_message_prefix.
11252 * debug.c: Remove static specifier for FILE *debug declaration.
11253 Delete debug_print and debug_message routines, add
11254 debug_message_prefix routine.
11255 * builtin.c, debug.c: Replace debug_print routine calls with
11256 DEBUG_PRINT* macro calls.
11257 * input.c, path.c: Replace debug_message routine calls with
11258 DEBUG_MESSAGE* macro calls.
11260 * m4.h: Remove inclusion of <varargs.h>.
11261 * debug.c: Include <stdarg.h> or <varargs.h>.
11262 (trace_format): Use stdarg instead of varargs if __STDC__.
11264 * configure.in: Remove checks for vfprintf and _doprnt. These
11265 implementations use varargs tricks which are not portable enough.
11266 * lib/vfprintf.c: Deleted.
11267 * lib/_doprnt.c: Deleted.
11268 * lib/Makefile.in: Adjusted accordingly. Remove LIBOBJS.
11269 Reported by Joel Sherrill.
11271 * path.c (add_include_directory): Use xstrdup.
11273 * builtin.c (find_builtin_by_name): Declare static.
11275 * *.[ch]: Add const to a few "char *" declarations.
11277 * configure.in: Remove commented tests for fileno() and fstat().
11278 * debug.c: Remove comments about HAVE_FILENO and HAVE_FSTAT.
11280 * debug.c (debug_flush_files): New.
11281 * m4.h: Declares it.
11282 * builtin.c (m4_syscmd, m4_esyscmd): Use it.
11283 Reported by Nicolas Pioch.
11285 1993-11-12 François Pinard <pinard@iro.umontreal.ca>
11287 * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
11288 Reported by Joel Sherrill.
11290 * builtin.c (prefix_all_builtins): Instead of the table size, use
11291 the null entry at end for stopping the loop. It was overwritten.
11292 Reported by Andreas Schwab and Jim Meyering.
11294 * builtin.c (prefix_all_builtins): Cast xmalloc to (char *).
11295 Reported by Kaveh R. Ghazi.
11297 * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
11298 Reported by Karl Vogel.
11300 1993-11-09 François Pinard <pinard@iro.umontreal.ca>
11302 * m4.h: Do not define volatile if already defined.
11303 Reported by René Seindal.
11305 * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@. Grrr!
11307 Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
11308 Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
11310 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11312 * m4.h: Define strchr and strrchr in terms of index and rindex,
11313 instead of the other way around.
11314 * builtin.c, m4.c, path.c: Use strchr instead of index.
11316 * input.c (next_char): Remove a "break;" after a "return ...;".
11317 Reported by Tom McConnell.
11319 1993-11-08 François Pinard <pinard@iro.umontreal.ca>
11323 * configure.in: Do not copy check files in the build hierarchy.
11324 * checks/check-them: Identify the m4 version being checked. For
11325 finding m4, look in $PATH instead of in the parent directory.
11326 * Makefile.in (check): Prepend `pwd` to $PATH before checking.
11327 * checks/Makefile.in (.all-stamp): Always create check files in
11328 the source hierarchy, not anymore in the build hierarchy.
11329 (check): cd to the source hierarchy before performing checks.
11330 Do not copy nor clean COPYING anymore, take it from `..'.
11331 Reported by Tom McConnell.
11333 * Makefile.in (Makefile): Use $(SHELL).
11334 (config.status): Use $(SHELL). Use "config.status --recheck"
11335 instead of "configure --no-create", which is obsolete.
11336 Reported by Tom McConnell.
11338 1993-11-05 François Pinard <pinard@iro.umontreal.ca>
11340 * m4.c (usage): Use "%s" instead of "m4" in format string.
11341 Reported by Jim Meyering.
11343 * Makefile.in: Distribute mkinstalldirs.
11344 Reported by Pierre Gaumond.
11345 Reported by Jim Meyering.
11346 Reported by Tom McConnell.
11347 Reported by Andreas Gustafsson.
11349 * checks/check-them: Renamed from checks/check_them.
11350 * checks/get-them: Renamed from checks/get_them.
11351 * checks/.all-stamp: Renamed from checks/.all_stamp.
11352 * checks/Makefile.in: Changed accordingly.
11353 Reported by Jim Meyering.
11355 1993-11-04 François Pinard <pinard@iro.umontreal.ca>
11357 * lib/Makefile.in (dist): Correct permissions on files.
11359 * output.c: Declare tmpfile, some systems don't.
11361 1993-11-03 François Pinard <pinard@iro.umontreal.ca>
11363 * checks/Makefile.in (dist): Correct permissions on files.
11365 * Makefile.in (dist): Ensure recursive linking for subdirectory
11366 `examples', also set read/write permissions on all its files.
11368 * mkinstalldirs: New, from elsewhere.
11369 * Makefile.in: Use it.
11371 * debug.c: Synchronize debug messages and regular output when
11372 the debug file and stdout are redirected to the same file.
11373 * configure.in: Add (commented) checks for fileno and fstat.
11374 Reported by Jim Avera.
11376 * builtin.c (m4_ifelse): Diagnose excess arguments if 5, 8, 11,
11377 etc., arguments, then ignore the superfluous one. m4 used to
11378 diagnose missing arguments and return the empty string.
11379 Reported by Nick S. Kanakakorn.
11381 1993-11-02 François Pinard <pinard@iro.umontreal.ca>
11383 * m4.c (main): At end of all input, ensure all undiverted text
11384 goes to the main output stream.
11385 Reported by Andreas Gustafsson.
11387 * m4.c (main): exit (0), instead of return 0.
11389 * m4.c: Implement -P and --prefix-builtins.
11390 * builtin.c: Delete const specifier on builtin_tab.
11391 (prefix_all_builtins): New.
11392 Reported by Noah Friedman.
11393 Reported by Scott Bartram.
11395 * c-boxes.el: New, from elsewhere.
11396 * Makefile.in: Distribute it.
11398 * m4.h: Do not define bcopy if <string.h> defines it.
11399 Reported by Stephen Perkins.
11401 * builtin.c (define_macro): Allow a missing second argument, in
11402 which case it is implied empty. Affects define and pushdef.
11403 Reported by Eric Allman.
11405 1993-11-01 François Pinard <pinard@iro.umontreal.ca>
11407 * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
11408 struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
11409 * builtin.c: Initialize all the blindness fields in builtin_tab.
11410 (define_builtin): Copy the blindness of a builtin into its symbol.
11411 * macro.c (expand_token): Avoid processing a blind builtin if the
11412 next character is not an opening parenthesis.
11413 Reported by David MacKenzie.
11414 Reported by Noah Friedman.
11416 * configure.in: Ensure an exit status of 0 on completion.
11417 Reported by Vivek P. Singhal.
11419 * eval.c (eval_lex): Admit both lower and upper case letters for
11420 bases greater than 10. Only lower case letters were accepted.
11422 * eval.c (eval_lex): Recognize 0bDIGITS and 0rRADIX:DIGITS syntax.
11423 Reported by Krste Asanovic.
11425 * eval.c: Rename NOT to LNOT. Add XOR, NOT, LSHIFT and RSHIFT.
11426 * eval.c (logical_not_term): New name for not_term.
11427 * eval.c (xor_term): New, between or_term and and_term.
11428 * eval.c (not_term): New, between and_term and logical_not_term.
11429 * eval.c (shift_term): New, between cmp_term and add_term.
11430 Reported by Krste Asanovic: ~, ^, <<, >>.
11431 Reported by Ben A. Mesander: ** vs ^.
11433 * m4.c: Delete xmalloc.c, xrealloc.c, xstrdup.c.
11434 * m4.h: Delete xrealloc.c.
11435 * lib/xmalloc.c: New, from elsewhere.
11436 * lib/xstrdup.c: New, from elsewhere.
11437 * lib/Makefile.in: Distribute and compile them.
11439 * m4.c: Change progname to program_name.
11440 * builtin.c, eval.c, m4.c, m4.h: Rename error to m4error.
11441 * lib/error.c: New, from elsewhere.
11442 * lib/Makefile.in: Distribute and compile error.c.
11443 * configure.in: Check AC_VPRINTF and for strerror.
11444 * m4.c: Delete cmd_error. Use error instead.
11445 * m4.c: Change label capitalisation to "ERROR", "Warning", etc.
11447 * m4.h: Delete #define const, let Autoconf takes care of this.
11449 * m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
11450 Merge parse_args into main. Declare argv to be `char *const *',
11451 then remove superfluous casts.
11453 * m4.c: Rename --no-gnu-extensions to --traditional.
11454 Reported by Ben A. Mesander.
11456 * m4.c (usage): Add a status parameter. Supply one in various
11457 calls. Add --help processing. Remove -V for --version.
11459 * lib/Makefile.in: Put $(CFLAGS) last in .c.o rule.
11461 * lib/Makefile.in: Have an AR=ar declaration.
11462 Reported by Eric Backus.
11463 Reported by Bjorn R. Bjornsson.
11464 Reported by Tom Tromey.
11465 Reported by Kristine Lund.
11466 Reported by Marion Hakanson.
11468 1993-10-30 François Pinard <pinard@iro.umontreal.ca>
11470 * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
11471 Reported by Noah Friedman.
11473 1993-10-25 François Pinard <pinard@iro.umontreal.ca>
11475 * Makefile.in: Remove MDEFINES and cleanup.
11477 1993-06-09 François Pinard <pinard@iro.umontreal.ca>
11479 * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
11480 Create a gzip file.
11482 1993-02-06 François Pinard <pinard@iro.umontreal.ca>
11484 * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
11485 ensure 777 mode for directories, so older tar's will restore file
11488 1993-01-17 François Pinard <pinard@iro.umontreal.ca>
11490 * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
11491 so the installer can override automatically configured choices.
11492 Reported by Karl Berry.
11494 1993-01-15 François Pinard <pinard@iro.umontreal.ca>
11496 * lib/vfprintf.c: Stolen from Oleo distribution and adapted. The
11497 previous version was not working properly on m68k-hp-bsd4.3.
11498 Reported by Roland McGrath.
11500 * lib/_doprnt.c: Stolen from Oleo distribution.
11501 * configure.in: Check for _doprnt.c if vfprintf.c selected.
11502 * lib/Makefile.in: Distribute _doprnt.c.
11503 Do not distribute regex.[ch].old anymore.
11505 1993-01-01 François Pinard <pinard@iro.umontreal.ca>
11507 * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
11508 Richard wants it there.
11510 1992-12-27 François Pinard <pinard@iro.umontreal.ca>
11512 * Makefile.in: Add DEFS to MDEFINES.
11513 * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
11514 (libm4.a): Remove the library before creating it.
11515 (distclean): Remove tags and TAGS too.
11517 1992-12-23 François Pinard <pinard@iro.umontreal.ca>
11519 * Makefile.in (dvi, m4.dvi): New goals.
11521 * builtin.c, eval.c, format.c, input.c, m4.[ch], m4.texinfo,
11522 macro.c, output.c, path.c, symtab.c: Change Copyright from
11523 1989-1992 to the explicit enumeration 1989, 1990, 1991, 1992.
11525 * examples/divert.m4: Deleted, this bug has been corrected.
11527 * Makefile.in (texclean, mostlyclean): New goals.
11529 * Makefile.in (clean): Remove clutter from ansi2knr.
11530 Reported by Pierre Gaumond.
11532 1992-12-20 François Pinard <pinard@iro.umontreal.ca>
11534 * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule. The user
11535 might well use CFLAGS is s/he needs it.
11537 * Makefile.in: Allow installation of info files from a separate
11539 Reported by Jason Merrill.
11540 Reported by David MacKenzie.
11541 Reported by Skip Montanaro.
11542 Reported by Erez Zadok.
11543 Reported by Assar Westerlund.
11545 1992-12-19 François Pinard <pinard@iro.umontreal.ca>
11548 This is still a beta release for the future GNU m4 version 1.1.
11550 * lib/alloca.c: New, from elsewhere.
11551 * lib/Makefile.in: Distribute it. Define and use $(ALLOCA).
11553 * m4.h: Do not define index/rindex if already defined. If
11554 FALSE/TRUE are already defined, do not redefine them, but merely
11555 define boolean typedef to int.
11557 * Makefile.in: Use $(DEFS) while compiling ansi2knr.
11558 * ansi2knr.c: Rewrite #ifdef HAVE_STRING_H || STDC_HEADERS,
11559 because some C compilers do not like connectives with #ifdef.
11560 * m4.h: Define `volatile' only if __GNUC__, instead of once for
11561 __GNUC__ and once for __STDC__.
11562 * lib/regex.h: Leave const alone, AC_CONST will take care of it.
11564 * checks/Makefile.in: Use .all_stamp instead of $(CHECKS) for
11565 Makefile dependencies. Without it, make keeps destroying and
11566 remaking $(CHECKS) in a loop (why?). Distribute .all_stamp.
11568 * m4.h, m4.c, builtin.c, output.c: Change all divertion/DIVERTION
11569 to diversion/DIVERSION, this was a spelling error.
11571 * m4.c: Declare version[], remove #include "version.h".
11572 * version.h: Deleted.
11573 * Makefile.in: Remove references to version.h.
11575 * output.c (shipout_text): Centralize all `#line NUM ["FILE"]'
11576 production, by using a simpler and more robust algorithm. This
11577 solves the problem of synclines sometimes written in the middle of
11578 an output line. Delete sync_line() and output_lines variable.
11579 * m4.h: Remove sync_line prototype and output_lines declaration.
11580 * input.c (next_char), output.c (shipout_text): Remove references
11582 * input.c (push_file, pop_file): Merely put the value -1 in
11583 output_current_line instead of calling sync_line, for delaying a
11584 single `#line NUM FILE' before next output line. Do not test
11585 for sync_output, because this is unnecessary clutter.
11586 * output.c (make_divertion, insert_divertion): Idem.
11587 * input.c: Rename must_advance_line to start_of_input_line, for
11590 * debug.c (trace_header): Select a new debug line format, which
11591 better complies with GNU standards for formatting error messages.
11592 With option `-dfl', M-x next-error might be used on the output.
11593 * m4.c (vmesg): Adjust format of error output to GNU standards.
11594 * m4.texinfo: Adjust examples for `make check' to work.
11596 * m4.h, builtin.c, debug.c, input.c, macro.c, path.c: Use upper
11597 case for enum debug_info constants, which were all lower case.
11599 * builtin.c (m4_regexp, m4_patsubst): Use re_search instead of
11601 * lib/regex.[ch]: Use new version from textutils 1.3.6, with some
11602 collected patches. I tried a few times using newer regex.[ch], it
11603 mysteriously stopped aborting with this one. Insecure feeling...
11604 * lib/Makefile.in: Distribute regex.[ch].old, just in case!
11606 1992-12-18 François Pinard <pinard@iro.umontreal.ca>
11608 * m4.c: Change `--no-warnings' to `--silent'.
11609 Reported by David MacKenzie.
11611 * m4.c: Put all M4OPTS code upon IMPLEMENT_M4OPTS control, and
11612 leave it off for now. See comment in m4.c for justification.
11613 Reported by David MacKenzie.
11615 * configure.in: Replace AC_USG by AC_HAVE_HEADERS(string.h).
11616 * m4.h, ansi2knr.c, lib/regex.h: Replace USG by HAVE_STRING_H.
11618 * Makefile.in: Add a new `info' goal. Use macro MAKEINFO.
11620 * Makefile.in: Ensure recursive cleaning is done before local
11621 cleaning for all clean goals.
11623 * builtin.c (ntoa): Ensure the value is always interpreted as a
11624 signed quantity, whatever the radix is.
11626 1992-11-18 Jim Meyering <meyering@idefix>
11628 * builtin.c, format.c, input.c: Split long lines.
11629 * m4.c: Use typedef macro_definition instead of struct
11631 * symtab.c: Use typedef symbol instead of struct symbol.
11633 1992-11-17 François Pinard <pinard@iro.umontreal.ca>
11635 * *.[ch]: Remove all trailing whitespace, in code and comments.
11637 * configure.in: Find some awk.
11638 * Makefile.in: Add $(AWK) to MDEFINES.
11639 * checks/Makefile.in: Transmit $(AWK) to get_them.
11640 * checks/get_them: Use $AWK instead of gawk. Add a close in the
11641 awk script when switching files, because without this, mawk runs
11642 out of file descriptors.
11644 1992-11-16 François Pinard <pinard@iro.umontreal.ca>
11646 * Makefile.in (realclean): Delete m4.info*.
11647 Reported by Jim Meyering.
11649 * Makefile.in: Adjust and link with checks/Makefile.
11650 * checks/Makefile.in: New.
11651 * configure.in: Output checks/Makefile.
11653 * checks/get_them: Have the dnl header of each test more
11654 recognizable by next-error, also use a better message.
11656 1992-11-16 Jim Meyering <meyering@idefix>
11658 * m4.h [__GNUC__]: Use __volatile__ instead of `volatile.'
11659 And use that only if __GNUC__ since we're using it's GCC-specific
11660 semantics that tell the compiler the associated function doesn't
11663 * builtin.c (substitute): Don't use character as an array index.
11664 (dumpdef_cmp): Make formal arguments `const void *' to avoid
11665 warnings with gcc -W -Wall on systems with qsort prototype.
11666 (m4_errprint): Cast obstack_finish to `char *' to avoid warnings
11669 * eval.c (most functions): Add parentheses to assignments used
11670 as truth values go avoid warnings from gcc -Wall.
11672 * input.c, m4.c, output.c, path.c, symtab.c: Declare static
11673 any functions that don't need external scope.
11675 * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
11676 (many functions and arrays): Declare `const'.
11678 1992-11-15 François Pinard <pinard@iro.umontreal.ca>
11680 * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
11681 removing the declaration from m4.h. Also rename false to FALSE
11684 * lib/Makefile.in (Makefile): New goal.
11686 * Makefile.in, lib/Makefile.in: Add a .c.o rule, so CFLAGS is not
11687 so heavily loaded. It gets more easily overridable, calling make.
11688 Reported by Jim Meyering.
11690 * Makefile.in (dist): Get .fname from the current directory name,
11691 instead of from version.h. I need updating many files manually,
11692 when the version changes, version.h is just one of them.
11694 1992-11-14 François Pinard <pinard@iro.umontreal.ca>
11696 * m4.h: Remove the tag `boolean' on the enum introducing typedef
11697 `boolean'. This tag conflicts with <sys/types.h> on SVR4.
11698 Reported by Tom McConnell.
11700 1992-11-13 François Pinard <pinard@iro.umontreal.ca>
11702 * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
11703 39.cleardiv, which were describing missing or spurious newlines.
11704 Modify examples 52.eval, 53.esyscmd and 54.sysval so the results
11705 do not depend on machine word size, `/bin/false' implementation,
11706 or `wc' output format. `make check' is more dependable, now.
11708 * checks/check_them: Summarize the failed tests by listing their
11709 name, at end. If none, issue `All checks successful'. Output
11710 `Checking' instead of `Input file:'.
11712 * checks/get_them, checks/check_them: Reindented.
11714 * Makefile.in (dist): chmod a+r before making the tar file.
11716 1992-11-12 François Pinard <pinard@iro.umontreal.ca>
11718 * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
11720 * input.c (next_token): Reinitialize token_buttom just after using
11721 it as a watermark with obstack_free. Or else, a future token, big
11722 enough for triggering reallocation of the obstack chunk, could
11723 void the initialized value of token_buttom, later causing panic in
11724 obstack_free. Rename token_buttom to token_bottom everywhere.
11726 * m4.h: Before declaring errno, first include <errno.h> and
11727 ensure that it does not define errno.
11728 Reported by Richard Stallman.
11730 1992-11-11 François Pinard <pinard@iro.umontreal.ca>
11732 * builtin.c: Define and use DECLARE macro for builtins.
11734 * builtin.c (m4_ifelse): Avoid any diagnostic when exactly one
11735 argument, this is a common idiom for introducing long comments.
11737 * builtin.c (m4_ifelse): If 3n + 2 arguments, diagnose missing
11738 arguments. The last argument was silently ignored.
11740 * m4.c (cmd_error): Add a missing semicolon before va_end().
11742 1992-11-10 François Pinard <pinard@iro.umontreal.ca>
11744 * Makefile.in: Now handle protoized sources. Define and use U.
11745 Compile and use ansi2knr with old compilers. Update DISTFILES.
11746 Add `aclocal.m4' to `configure' dependencies.
11747 * ansi2knr.c: New, from Ghostscript distribution.
11748 * configure.in: Define U through FP_PROTOTYPES for old compilers.
11749 Add AC_ISC_POSIX, AC_CONST, AC_SIZE_T.
11750 * aclocal.m4: New, provide FP_PROTOTYPES.
11751 * m4.h: Conditionnaly protoized through Args, save for varags.
11752 * builtin.c: Protoized. Then:
11753 Include <sys/types.h> if size_t is not defined, before "regex.h".
11754 (m4_ifelse): Fetch built-in name properly for diagnostic.
11755 (m4_dumpdef): Remove wrong (char *) cast calling dump_symbol.
11756 (m4_regexp): Add const to `msg' declaration.
11757 (m4_patsubst): Add const to `msg' declaration.
11758 * debug.c: Protoized, save for varargs.
11759 * eval.c: Protoized.
11760 * format.c: Protoized.
11761 * input.c: Protoized.
11762 * m4.c: Protoized, save for varargs. Then:
11763 (xfree): Accept void * instead of char *.
11764 (xmalloc): Return void * instead of char *.
11765 (xrealloc): Accept and return void * instead of char *.
11766 * macro.c: Protoized.
11767 * output.c: Protoized.
11768 * path.c: Protoized. Then cast some (char *) over xmalloc's.
11769 * symtab.c: Protoized.
11771 1992-11-06 François Pinard <pinard@iro.umontreal.ca>
11773 * m4.texinfo: Remove directory from diagnostics in 30.include,
11774 51.eval, 56.errprint and 57.m4exit tests.
11776 * m4.h: Remove declarations for int or void system functions, they
11777 cause more conflicting trouble than they make good.
11779 * configure.in: Avoid configuration header file. Add some tests.
11780 * m4.h: Remove #include "config.h".
11781 * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
11782 Then, rewritten for better compliance with GNU standards.
11784 1992-11-05 François Pinard <pinard@iro.umontreal.ca>
11786 * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
11787 because of a misplaced #endif.
11789 * Many *.[hc] files: Correct intra-line spacing here and there,
11790 according to GNU indent 1.6 advice.
11792 * configure.in: New, using Autoconf 1.2.
11793 * m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
11794 * Delete old configure.in, configure, etc/configure.in,
11795 etc/configure, lib/configure.in, lib/configure and config/*.
11796 Reported by Jason Merrill.
11798 * symtab.c (hash): Change (char) NULL to '\0'.
11799 Reported by Jason Merrill.
11801 * Delete .vers, etc/newdist.sh, etc/newvers.sh and
11802 etc/nextvers.sh. Release numbers will be edited `by hand'.
11803 * version.h: De-automatize, force value in.
11805 * m4.c: Changes in order to use a newer getopt.h.
11806 Reported by David MacKenzie.
11808 * checks/: New name for examples/.
11809 * checks/get_them: New location for etc/get_examples.
11810 * checks/check_them: New location for etc/check_examples.
11811 * Makefile.in, checks/get_them, checks/check_them: Adjust.
11812 * lib/vfprintf.c: New location for etc/vfprintf.c.
11813 * Delete empty etc/.
11814 * examples/: New name for test/.
11816 1992-03-10 François Pinard <pinard@iro.umontreal.ca>
11818 * Makefile.in (check): Add m4 as dependency.
11820 * m4.c: Accept --no-warnings instead of --no_warnings, and
11821 --no-gnu-extensions instead of --no_gnu_extensions. Make the
11822 usage message more informative.
11823 Reported by David MacKenzie.
11825 1992-03-09 François Pinard <pinard@iro.umontreal.ca>
11827 * etc/check_examples: New name for check_examples.sh.
11828 * etc/get_examples: New name for get_examples.sh.
11829 * Makefile.in, etc/Makefile.in: Use new names.
11831 * Makefile.in: Transmit $(CC) while making in lib.
11833 * Many *.[hc] files: GNU indent'ed, with further fine tuning of
11834 code disposition by hand.
11836 1992-03-08 François Pinard <pinard@iro.umontreal.ca>
11838 * m4.h: Delete definitions for abort() and exit().
11839 Reported by Richard Stallman.
11841 * config/hmake-unicos, config/s-unicos.h: New files.
11842 Reported by Hal Peterson.
11844 * eval.c (exp_term): Have N^0 return 1.
11845 Reported by Michael Fetterman.
11847 * eval.c, input.c, m4.h: Remove last comma in enums.
11848 Reported by Mike Lijewski.
11850 * Transfer of maintenance duties from René to François.
11852 1991-10-24 René Seindal <seindal@diku.dk>
11854 * Release 1.0. Many thanks to those, who provided me with bug
11855 reports and feedback.
11857 * Uses GNU configure, taken from the gdb distribution.
11859 * Uses GNU getopt(), with long option names.
11861 * The -Q/+quiet option is added, which suppresses warnings about
11862 missing or superflous arguments to built-in macros.
11864 * Added default options via the M4OPTS environment variable.
11866 * The built-in format can now be configured to use sprintf as
11867 the formatting engine, for systems without [efg]cvt(3).
11869 * GNU library code is moved to the ./lib subdirectory; other
11870 utility files are now in ./etc.
11872 * Several minor bugs have been fixed.
11874 1991-07-26 René Seindal <seindal@diku.dk>
11876 * Fixed various bugs. Release 0.99, manual 0.09. Many thanks to
11877 François Pinard and Roland H. Pesch for providing me with reports.
11879 * The builtins incr and decr are now implemented without use of
11882 * The builtin indir is added, to allow for indirect macro calls
11883 (allows use of "illegal" macro names).
11885 * The debugging and tracing facilities has been enhanced
11886 considerably. See the manual for details.
11888 * The -tMACRO option is added, marks MACRO for tracing as soon
11891 * Builtins are traced after renaming iff they were before.
11893 * Named files can now be undiverted.
11895 * The -Nnum option can be used to increase the number of
11896 divertions available.
11898 * Calling changecom without arguments now disables all comment
11901 * The function m4_patsubst() is now consistently declared
11904 * A bug in dnl is fixed.
11906 * A bug in the multi-character quoting code is fixed.
11908 * Several typos in the manual has been corrected. More probably
11911 * The m4.info file is now installed along with the program.
11913 1990-11-15 René Seindal <seindal@diku.dk>
11915 * Updated and enhanced version. Release 0.75, manual 0.07.
11917 * Implemented search path for include files (-I option and
11918 M4PATH envronment variable).
11920 * Implemented builtin "format" for printf-like formatting.
11922 * Implemented builtin "regexp" for searching for regular
11925 * Implemented builtin "patsubst" for substitution with regular
11928 * Implemented builtin "esyscmd", which expands to a shell
11931 * Implemented "__file__" and "__line__" for use in error
11934 * Implemented character ranges in "translit".
11936 * Implemented control over debugging output.
11938 * Implemented multi-character quotes.
11940 * Implemented multi-character comment delimiters.
11942 * Changed predefined macro "gnu" to "__gnu__".
11944 * Changed predefined macro "unix" to "__unix__", when the -G
11945 option is not used. With -G, "unix" is still defined.
11947 * Changed "shift", "$@" and "$*" to not insert spaces afters
11950 * Added program name to error messages.
11952 * Fixed two missing null bytes bugs.
11954 1990-01-22 René Seindal <seindal@diku.dk>
11956 * Initial beta release. Release 0.50, manual 0.05.
11965 Copyright (C) 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2003,
11966 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
11968 Copying and distribution of this file, with or without
11969 modification, are permitted provided the copyright notice
11970 and this notice are preserved.